master
chenjunda 2 years ago
parent 037b683990
commit 999fa2a54f

@ -0,0 +1 @@
OrangeSale_End

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

@ -28,7 +28,7 @@ public class OkHttpClientProduct {
public List<OrangeProduct> getProduct() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
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();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());

@ -21,7 +21,7 @@ public class OkHttpMessage {
public OrangeMessage consumeMessage() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient();
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();
Response response = okHttpClient.newCall(request).execute();
JSONObject jsonObject = JSON.parseObject(Objects.requireNonNull(response.body()).string());
@ -30,7 +30,7 @@ public class OkHttpMessage {
*
*/
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();
okHttpClient.newCall(request1).execute();
return orangeMessage;

@ -29,7 +29,7 @@ public class OkHttpUser {
RequestBody requestBody = RequestBody.create(jsonStr, mediaType);
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)
.build();
@ -58,7 +58,7 @@ public class OkHttpUser {
String jsonStr = JSONObject.toJSONString(orangeUser);
RequestBody requestBody = RequestBody.create(jsonStr, mediaType);
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)
.build();
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"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical">
<include layout="@layout/shoppingcart_title" />
<!--无商品时的布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="160dp"
android:orientation="vertical">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:src="@drawable/gwc" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="Cart is Empty ~"
android:textColor="#B5B5B5"
android:textSize="20sp" />
<Button
android:id="@+id/random_search"
android:layout_width="180dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
android:background="@drawable/button_login"
android:text="go shopping..."
android:textColor="#fff"
android:textSize="18sp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<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_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical">
<!--无商品时的布局-->
<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_height="wrap_content"
android:text=" 商品名称:菠萝
数量1 价格10元 "
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
android:id="@+id/imageView2"
android:layout_width="103dp"
android:layout_height="78dp"
android:src="@drawable/yz1" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=" 商品名称:柚子
数量2 价格12元 "
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<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
android:id="@+id/random_search"
android:layout_width="183dp"
android:layout_height="51dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:background="@drawable/button_register"
android:text="立即结算"
android:textColor="#fff"
android:textSize="18sp" />
</LinearLayout>

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

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

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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_height="wrap_content"
android:orientation="vertical">
@ -7,7 +8,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#ff3366"
android:background="#FF9800"
android:orientation="horizontal">
<ImageView

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

Loading…
Cancel
Save