初次修改

master
tangxi 2 years ago
parent 622cd6a086
commit 4b47b9061c

@ -96,7 +96,7 @@ public class ShoppingCartFragment extends Fragment implements View.OnClickListen
}
private void setData() {
Bundle bundle = getArguments();
usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
// usernameText.setText(String.format("用户名:%s", bundle.getString("username")));
userId=(Integer)bundle.getInt("id");
System.out.println(userId);
}

@ -20,7 +20,7 @@ import okhttp3.Response;
public class OkHttpClientProduct {
public static String Url="http://10.21.91.105:8081";
public static String Url="http://10.21.196.161:8081";
/**
*
*

@ -0,0 +1,46 @@
<?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">
<!-- 结算区域 -->
<RelativeLayout
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#fafafa"
android:padding="6dp">
<TextView
android:id="@+id/total_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="总计0.00"
android:textColor="#333"
android:textSize="16sp"
android:textStyle="bold" />
<Button
android:id="@+id/checkout"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#f44336"
android:text="结算"
android:textColor="#fff" />
<Button
android:id="@+id/clear_cart"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_toLeftOf="@id/checkout"
android:layout_centerVertical="true"
android:background="#333"
android:text="清空购物车"
android:textColor="#fff" />
</RelativeLayout>
</LinearLayout>

@ -6,9 +6,22 @@
android:orientation="vertical">
<include layout="@layout/shoppingcart_title" />
<!--有商品时的布局-->
<include layout="@layout/shop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="627dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<include
layout="@layout/shop"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/cart_buttonlayout" />
</LinearLayout>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical">
android:orientation="horizontal">
<ImageView
android:id="@+id/category_product_image"
@ -12,26 +12,54 @@
android:layout_gravity="center"
android:layout_marginTop="5dp" />
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_toRightOf="@+id/category_product_image"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginTop="25dp"
android:textColor="#050505"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_toRightOf="@+id/category_product_name"
android:layout_gravity="center"
android:layout_marginLeft="100dp"
android:layout_marginTop="25dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="50dp"
android:layout_marginTop="15dp"
android:layout_toRightOf="@+id/category_product_image"
android:textColor="#050505"
android:textSize="16sp" />
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginLeft="100dp"
android:layout_marginTop="15dp"
android:layout_toRightOf="@+id/category_product_name"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/addCart"
android:layout_marginTop="10dp"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="220dp"
android:background="@drawable/left" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -1,70 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#14FFEB3B"
android:orientation="vertical"
>
<ImageView
android:id="@+id/category_product_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:layout_marginTop="5dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="139dp"
android:orientation="horizontal">
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_toRightOf="@+id/category_product_image"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:textColor="#050505"
android:textSize="16sp" />
<CheckBox
android:id="@+id/checkbox"
android:layout_width="46dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_toRightOf="@+id/category_product_name"
android:layout_gravity="center"
android:layout_marginLeft="60dp"
android:layout_marginTop="25dp"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
<ImageView
android:id="@+id/left"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="55dp"
android:layout_toRightOf="@id/category_product_price"
android:background="@drawable/left"
<ImageView
android:id="@+id/category_product_image"
android:layout_width="111dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1" />
/>
<TextView
android:id="@+id/num"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_toRightOf="@+id/left"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:gravity="center"
android:background="#00FEFEFE"
android:textColor="#050505"
android:textSize="16sp" />
<ImageView
android:id="@+id/right"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:layout_toRightOf="@id/num"
android:background="@drawable/right"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="6"
android:background="#1EFFFFFF"
android:orientation="vertical">
</RelativeLayout>
<TextView
android:id="@+id/category_product_name"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_margin="20dp"
android:text="商品名称"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/category_product_price"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginLeft="20dp"
android:text="价格" />
</LinearLayout>
<ImageView
android:id="@+id/left"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginTop="100dp"
android:layout_toRightOf="@id/category_product_price"
android:background="@drawable/left" />
<TextView
android:id="@+id/num"
android:layout_width="18dp"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:layout_toRightOf="@+id/left"
android:background="#00FEFEFE"
android:gravity="center"
android:textColor="#050505"
android:textSize="16sp" />
<ImageView
android:id="@+id/right"
android:layout_width="42dp"
android:layout_height="44dp"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="10dp"
android:layout_marginTop="50dp"
android:layout_toRightOf="@id/num"
android:background="@drawable/right" />
</LinearLayout>
</LinearLayout>

@ -18,24 +18,12 @@
android:layout_gravity="center"
android:src="@drawable/arrow_left" />
<TextView
android:id="@+id/username"
android:layout_width="0dp"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="shopping cart"
android:layout_marginRight="0dp"
android:textColor="#FFF"
android:textSize="20sp" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="center"
android:text="shopping cart"
android:layout_marginRight="40dp"
android:text="删除"
android:layout_marginLeft="270dp"
android:textColor="#FFF"
android:textSize="20sp" />
</LinearLayout>

Loading…
Cancel
Save