master
chenjunda 2 years ago
parent 037b683990
commit 999fa2a54f

@ -0,0 +1 @@
OrangeSale_End

@ -4,10 +4,10 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="delegatedBuild" value="false" />
<option name="testRunner" value="GRADLE" /> <option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="jbr-11" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

@ -28,7 +28,7 @@ public class OkHttpClientProduct {
public List<OrangeProduct> getProduct() throws IOException { public List<OrangeProduct> getProduct() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient(); OkHttpClient okHttpClient = new OkHttpClient();
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://10.21.183.162:8081/orange/product/search") .url("http://10.0.2.2:8081/orange/product/search")
.build(); .build();
Response response = okHttpClient.newCall(request).execute(); Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string()); JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());

@ -21,7 +21,7 @@ public class OkHttpMessage {
public OrangeMessage consumeMessage() throws IOException { public OrangeMessage consumeMessage() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient(); OkHttpClient okHttpClient = new OkHttpClient();
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://10.21.183.162:8081/orange/message/consumeMessage") .url("http://10.0.2.2:8081/orange/message/consumeMessage")
.build(); .build();
Response response = okHttpClient.newCall(request).execute(); Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string()); JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());
@ -30,7 +30,7 @@ public class OkHttpMessage {
* *
*/ */
Request request1 = new Request.Builder() Request request1 = new Request.Builder()
.url("http://10.21.183.162:8081/orange/message/updateMessage") .url("http://10.0.2.2:8081/orange/message/updateMessage")
.build(); .build();
okHttpClient.newCall(request1).execute(); okHttpClient.newCall(request1).execute();
return orangeMessage; return orangeMessage;

@ -29,7 +29,7 @@ public class OkHttpUser {
RequestBody requestBody = RequestBody.create(jsonStr, mediaType); RequestBody requestBody = RequestBody.create(jsonStr, mediaType);
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://10.21.183.162:8081/orange/user/login") .url("http://10.0.2.2:8081/orange/user/login")
.post(requestBody) .post(requestBody)
.build(); .build();
@ -58,7 +58,7 @@ public class OkHttpUser {
String jsonStr = JSONObject.toJSONString(orangeUser); String jsonStr = JSONObject.toJSONString(orangeUser);
RequestBody requestBody = RequestBody.create(jsonStr, mediaType); RequestBody requestBody = RequestBody.create(jsonStr, mediaType);
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://10.21.183.162:8081/orange/user/register") .url("http://10.0.2.2:8081/orange/user/register")
.post(requestBody) .post(requestBody)
.build(); .build();
Response response = okHttpClient.newCall(request).execute(); Response response = okHttpClient.newCall(request).execute();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,45 +1,100 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#FFFFFF" android:background="#FFFFFF"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/shoppingcart_title" />
<!--无商品时的布局--> <!--无商品时的布局-->
<LinearLayout
<include
layout="@layout/shoppingcart_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/imageView"
android:layout_width="102dp"
android:layout_height="76dp"
android:src="@drawable/bl1" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:text=" 商品名称:菠萝
android:layout_marginTop="160dp" 数量1 价格10元 "
android:orientation="vertical"> android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:background="@drawable/button_login"
android:layout_height="38dp"
android:text="删除商品" />
<ImageView <ImageView
android:layout_width="150dp" android:id="@+id/imageView2"
android:layout_height="150dp" android:layout_width="103dp"
android:layout_gravity="center" android:layout_height="78dp"
android:src="@drawable/gwc" /> android:src="@drawable/yz1" />
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:text=" 商品名称:柚子
android:layout_marginTop="10dp" 数量2 价格12元 "
android:text="Cart is Empty ~" android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
android:textColor="#B5B5B5"
android:textSize="20sp" /> <Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:background="@drawable/button_login"
android:layout_height="38dp"
android:text="删除商品" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="104dp"
android:layout_height="61dp"
android:src="@drawable/cz2" />
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=" 商品名称:橙子
数量5 价格60元 "
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:background="@drawable/button_login"
android:layout_height="38dp"
android:text="删除商品" />
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="
合计82元 "
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<Button <Button
android:id="@+id/random_search" android:id="@+id/random_search"
android:layout_width="180dp" android:layout_width="183dp"
android:layout_height="50dp" android:layout_height="51dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="25dp" android:layout_marginTop="15dp"
android:background="@drawable/button_login" android:background="@drawable/button_register"
android:text="go shopping..." android:text="立即结算"
android:textColor="#fff" android:textColor="#fff"
android:textSize="18sp" /> android:textSize="18sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>

@ -7,7 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:background="#ff3366" android:background="#FBB246"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:orientation="horizontal"> android:orientation="horizontal">

@ -5,8 +5,8 @@
android:background="#F2F2F2" android:background="#F2F2F2"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/shoppingcart_title" />
<include layout="@layout/cart_no_product" /> <include layout="@layout/cart_no_product" />
<include layout="@layout/shoppingcart_title" />
</LinearLayout> </LinearLayout>

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -7,7 +8,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:background="#ff3366" android:background="#FF9800"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView

@ -3,9 +3,9 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/h5</item> <item name="colorPrimary">#FF9800</item>
<item name="colorPrimaryDark">@color/h5</item> <item name="colorPrimaryDark">#FF9800</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">#FF9800</item>
</style> </style>
</resources> </resources>

Loading…
Cancel
Save