詹子聪 5 роки тому
батько
коміт
1a794a1fa2

+ 5 - 0
app/src/main/AndroidManifest.xml

@@ -52,6 +52,11 @@
             android:name=".ui.mine.MineActivity"
             android:screenOrientation="portrait"
             android:theme="@style/TextInputStyle" />
+
+        <activity
+            android:name=".ui.mine.goods.AddGoodsActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/TextInputStyle" />
     </application>
 
 </manifest>

+ 5 - 0
app/src/main/java/com/itant/shibei/base/ApiService.java

@@ -1,6 +1,7 @@
 package com.itant.shibei.base;
 
 import com.itant.shibei.bean.BeiUser;
+import com.itant.shibei.bean.GoodsBean;
 import com.miekir.network.core.base.BaseResponse;
 
 import java.util.Map;
@@ -36,4 +37,8 @@ public interface ApiService {
     /**忘记密码*/
     @POST("/shibei/api/password")
     Observable<BaseResponse<BeiUser>> resetPassword(@Body Map<String, Object> body);
+
+    /**新增京东商品*/
+    @POST("/shibei/api/addGoods")
+    Observable<BaseResponse<String>> addGoods(@Body GoodsBean body);
 }

+ 8 - 7
app/src/main/java/com/itant/shibei/bean/GoodsBean.java

@@ -8,6 +8,7 @@ package com.itant.shibei.bean;
  * Description: 商品实体
  */
 public class GoodsBean {
+    public static final int TYPE_RECOMMEND = 0;
     public static final int TYPE_TECHNOLOGY = 1;
     public static final int TYPE_LIFE = 2;
     public static final int TYPE_NETWORK = 3;
@@ -16,7 +17,7 @@ public class GoodsBean {
     /**
      * 商品id
      */
-    public String goodsId;
+    public long id;
     /**
      * 封面图片地址
      */
@@ -44,7 +45,7 @@ public class GoodsBean {
     /**
      * 返利
      */
-    public String rebate;
+    public long rebate;
     /**
      * 店名
      */
@@ -62,9 +63,9 @@ public class GoodsBean {
      */
     public boolean hasCoupon;
     /**
-     * 优惠券金额
+     * 优惠券信息
      */
-    public String couponMoney;
+    public String couponInfo;
     /**
      * 所属类型
      */
@@ -76,12 +77,12 @@ public class GoodsBean {
     /**
      * 月销量
      */
-    public int salesPerMonth;
+    public long salesPerMonth;
 
     /**
      * 评论条数
      */
-    public int commentNum;
+    public long commentNum;
 
     /**
      * 好评率
@@ -98,5 +99,5 @@ public class GoodsBean {
      */
     public long updateTimeMillis;
 
-    
+    public boolean enable;
 }

+ 16 - 18
app/src/main/java/com/itant/shibei/tool/DataTool.java

@@ -9,8 +9,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- *
- *
  * @author Miekir
  * @date 2020/7/8 19:36
  * Description: 模拟数据提供者
@@ -63,22 +61,22 @@ public class DataTool {
     public static List<GoodsBean> getGoodsList() {
         List<GoodsBean> goodsList = new ArrayList<>();
         GoodsBean goodsBean = new GoodsBean();
-        goodsBean.coverImageUrl="https://img14.360buyimg.com/n0/jfs/t1/97822/29/10664/255856/5e1ebf26Eea1a28ec/ac2c298127bae9a4.jpg";
-        goodsBean.title="华硕(ASUS) PN60 商用办公家用教育 台式机电脑主机 (i7-8550U 256G SSD 8G 正版Win10 三年上门)迷你台式";
-        goodsBean.description="远程教育,在家办公,顺畅不卡顿!酷睿i7-8550U处理器、256GSSD,8G内存,便携电脑移动办公更强性能购买PN61-i7,高效稳定";
-        goodsBean.reason="小巧便携且高效稳定";
-        goodsBean.oldPrice=389900;
-        goodsBean.nowPrice=384900;
-        goodsBean.rebate="50";
-        goodsBean.shopName="华硕京东自营旗舰店";
-        goodsBean.province="广东";
-        goodsBean.isSelfBusiness=true;
-        goodsBean.hasCoupon=true;
-        goodsBean.couponMoney="30";
-        goodsBean.goodsType=GoodsBean.TYPE_TECHNOLOGY;
-        goodsBean.goodsUrl="https://union-click.jd.com/jdc?e=&p=AyIGZRtcEgAXA1QfWhIyEgZUGlocChIFVBJeJUZNXwtEa0xHV0YXEEULWldTCQQHCllHGAdFBwtEQkQBBRxNVlQYBUkeTVxNCRNLGEF6RwtVGloUAxsPVRlaHAciVR1hWBNYZl42cCVPUVF6V1skdFxJZ1kXaxQyEgZUGFMcBREAUitrFQUiVDtADnsGQQBWH1JHCxMCUksOJQMiB1ETXhYKGwFdHVsQByIAVRJrU1dTWhNNBEtnbFMSRQYlMiIEZStrFTIRNxd1WBYLFVcAEg8dUkcFUE9THAsbBl0aWRBSFwIFTl8VChI3VxpaEQs%3D";
-        goodsBean.salesPerMonth=1022;
-        goodsBean.goodCommentPercent=0.98d;
+        goodsBean.coverImageUrl = "https://img14.360buyimg.com/n0/jfs/t1/97822/29/10664/255856/5e1ebf26Eea1a28ec/ac2c298127bae9a4.jpg";
+        goodsBean.title = "华硕(ASUS) PN60 商用办公家用教育 台式机电脑主机 (i7-8550U 256G SSD 8G 正版Win10 三年上门)迷你台式";
+        goodsBean.description = "远程教育,在家办公,顺畅不卡顿!酷睿i7-8550U处理器、256GSSD,8G内存,便携电脑移动办公更强性能购买PN61-i7,高效稳定";
+        goodsBean.reason = "小巧便携且高效稳定";
+        goodsBean.oldPrice = 389900;
+        goodsBean.nowPrice = 384900;
+        goodsBean.rebate = 50;
+        goodsBean.shopName = "华硕京东自营旗舰店";
+        goodsBean.province = "广东";
+        goodsBean.isSelfBusiness = true;
+        goodsBean.hasCoupon = true;
+        goodsBean.couponInfo = "30";
+        goodsBean.goodsType = GoodsBean.TYPE_TECHNOLOGY;
+        goodsBean.goodsUrl = "https://union-click.jd.com/jdc?e=&p=AyIGZRtcEgAXA1QfWhIyEgZUGlocChIFVBJeJUZNXwtEa0xHV0YXEEULWldTCQQHCllHGAdFBwtEQkQBBRxNVlQYBUkeTVxNCRNLGEF6RwtVGloUAxsPVRlaHAciVR1hWBNYZl42cCVPUVF6V1skdFxJZ1kXaxQyEgZUGFMcBREAUitrFQUiVDtADnsGQQBWH1JHCxMCUksOJQMiB1ETXhYKGwFdHVsQByIAVRJrU1dTWhNNBEtnbFMSRQYlMiIEZStrFTIRNxd1WBYLFVcAEg8dUkcFUE9THAsbBl0aWRBSFwIFTl8VChI3VxpaEQs%3D";
+        goodsBean.salesPerMonth = 1022;
+        goodsBean.goodCommentPercent = 0.98d;
         goodsList.add(goodsBean);
         goodsList.add(goodsBean);
         goodsList.add(goodsBean);

+ 6 - 1
app/src/main/java/com/itant/shibei/ui/home/GoodsAdapter.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.content.Context;
 import android.graphics.Paint;
 import android.graphics.drawable.Drawable;
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -83,7 +84,11 @@ public class GoodsAdapter extends CommonAdapter<GoodsBean> {
 
         // 一句话推荐
         TextView tv_reason = holder.getView(R.id.tv_reason);
-        tv_reason.setText(goodsBean.reason);
+        if (TextUtils.isEmpty(goodsBean.reason)) {
+            tv_reason.setText("拾贝推荐");
+        } else {
+            tv_reason.setText(goodsBean.reason);
+        }
 
         holder.setOnClickListener(R.id.cv_goods, new View.OnClickListener() {
             @Override

+ 6 - 4
app/src/main/java/com/itant/shibei/ui/mine/MineActivity.java

@@ -2,6 +2,7 @@ package com.itant.shibei.ui.mine;
 
 
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
@@ -15,8 +16,8 @@ import com.itant.shibei.bean.BeiUser;
 import com.itant.shibei.common.ConstantString;
 import com.itant.shibei.manager.UserInfoManager;
 import com.itant.shibei.tool.StringTool;
-import com.itant.shibei.tool.SystemTool;
 import com.itant.shibei.tool.TimeTool;
+import com.itant.shibei.ui.mine.goods.AddGoodsActivity;
 import com.miekir.common.utils.ViewTool;
 
 public class MineActivity extends BaseBeiActivity implements View.OnClickListener {
@@ -38,7 +39,7 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
         mUser = UserInfoManager.getInstance().getBeiUser();
         setTitle(String.format(ConstantString.WELCOME_HELLO, TimeTool.getCurrentTimePeriod(), mUser.nickName));
         ViewTool.setOnClickListener(this, this,
-                new int[]{R.id.ll_user, R.id.ll_feedback, R.id.btn_exit_login});
+                new int[]{R.id.ll_user, R.id.tv_add_goods, R.id.btn_exit_login});
 
         // 只有我才能管理后台
         View ll_admin = findViewById(R.id.ll_admin);
@@ -62,8 +63,9 @@ public class MineActivity extends BaseBeiActivity implements View.OnClickListene
                 // todo 查看账户明细
                 break;
 
-            case R.id.ll_feedback:
-                SystemTool.sendEmail(this);
+            case R.id.tv_add_goods:
+                // 上架新商品
+                startActivity(new Intent(this, AddGoodsActivity.class));
                 break;
 
             case R.id.btn_exit_login:

+ 1 - 6
app/src/main/java/com/itant/shibei/ui/mine/MineFragment.java

@@ -11,7 +11,6 @@ import androidx.fragment.app.Fragment;
 
 import com.itant.shibei.R;
 import com.itant.shibei.manager.UserInfoManager;
-import com.itant.shibei.tool.SystemTool;
 import com.itant.shibei.ui.mine.login.LoginActivity;
 
 public class MineFragment extends Fragment implements View.OnClickListener {
@@ -22,7 +21,7 @@ public class MineFragment extends Fragment implements View.OnClickListener {
                              ViewGroup container, Bundle savedInstanceState) {
         View root = inflater.inflate(R.layout.activity_mine, container, false);
         root.findViewById(R.id.ll_user).setOnClickListener(this);
-        root.findViewById(R.id.ll_feedback).setOnClickListener(this);
+        //root.findViewById(R.id.ll_feedback).setOnClickListener(this);
         return root;
 
     }
@@ -39,10 +38,6 @@ public class MineFragment extends Fragment implements View.OnClickListener {
                 }
                 break;
 
-            case R.id.ll_feedback:
-                SystemTool.sendEmail(getActivity());
-                break;
-
             default:
                 break;
         }

+ 72 - 76
app/src/main/java/com/itant/shibei/ui/mine/goods/AddGoodsActivity.java

@@ -1,38 +1,42 @@
 package com.itant.shibei.ui.mine.goods;
 
-import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
-import android.view.Menu;
-import android.view.MenuItem;
 import android.view.View;
-
-import androidx.annotation.NonNull;
+import android.widget.CheckBox;
 
 import com.google.android.material.textfield.TextInputEditText;
 import com.itant.shibei.R;
 import com.itant.shibei.base.BaseBeiActivity;
-import com.itant.shibei.tool.StringTool;
-import com.itant.shibei.ui.mine.MineActivity;
-import com.itant.shibei.ui.mine.forget.ForgetActivity;
-import com.itant.shibei.ui.mine.register.RegisterActivity;
+import com.itant.shibei.bean.GoodsBean;
 import com.miekir.common.utils.ToastTool;
 import com.miekir.common.utils.ViewTool;
 import com.miekir.mvp.presenter.InjectPresenter;
 
-import rx_activity_result2.RxActivityResult;
-
 /**
  * @author Miekir
  * @date 2020/6/18 16:48
  * Description: 登录界面
  */
 public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickListener, IAddGoodsView {
-    private TextInputEditText et_email;
-    private TextInputEditText et_password;
+    private TextInputEditText et_goods_title;
+    private TextInputEditText et_cover_url;
+    private TextInputEditText et_desc;
+    private TextInputEditText et_reason;
+    private TextInputEditText et_old_price;
+    private TextInputEditText et_now_price;
+    private TextInputEditText et_province;
+    private TextInputEditText et_coupon;
+    private TextInputEditText et_goods_url;
+    private TextInputEditText et_sales_per_month;
+    private TextInputEditText et_good_comment_percent;
+    private TextInputEditText et_shop_name;
+    private TextInputEditText et_comment_num;
+    private CheckBox cb_self;
+    private CheckBox cb_enable;
 
     @InjectPresenter
-    IAddGoodsPresenter presenter;
+    AddGoodsPresenter presenter;
 
     @Override
     public int getLayoutID() {
@@ -41,74 +45,67 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
 
     @Override
     public void initViews(Bundle savedInstanceState) {
-        setTitle("使用电子邮箱登录");
-        et_email = findViewById(R.id.et_email);
-        et_password = findViewById(R.id.et_password);
-        ViewTool.setOnClickListener(this, this, new int[]{R.id.btn_login, R.id.tv_forget});
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.menu_done, menu);
-        MenuItem item = menu.findItem(R.id.action_done);
-        item.setTitle("  注册账号  ");
-        return super.onCreateOptionsMenu(menu);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(@NonNull MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.action_done:
-                // 注册
-                Intent registerIntent = new Intent(this, RegisterActivity.class);
-                RxActivityResult.on(this).startIntent(registerIntent)
-                        .filter(result -> result.resultCode() == RESULT_OK)
-                        .subscribe(result -> {
-                            // 注册成功之后关闭登录界面
-                            startActivity(new Intent(AddGoodsActivity.this, MineActivity.class));
-                            finish();
-                        });
-                break;
-            default:
-                break;
-        }
-        return super.onOptionsItemSelected(item);
+        setTitle("上架新的商品");
+        et_goods_title = findViewById(R.id.et_goods_title);
+        et_cover_url = findViewById(R.id.et_cover_url);
+        et_desc = findViewById(R.id.et_desc);
+        et_reason = findViewById(R.id.et_reason);
+        et_old_price = findViewById(R.id.et_old_price);
+        et_now_price = findViewById(R.id.et_now_price);
+        et_province = findViewById(R.id.et_province);
+        et_coupon = findViewById(R.id.et_coupon);
+        et_goods_url = findViewById(R.id.et_goods_url);
+        et_sales_per_month = findViewById(R.id.et_sales_per_month);
+        et_good_comment_percent = findViewById(R.id.et_good_comment_percent);
+        et_shop_name = findViewById(R.id.et_shop_name);
+        et_comment_num = findViewById(R.id.et_comment_num);
+        cb_self = findViewById(R.id.cb_self);
+        cb_enable = findViewById(R.id.cb_enable);
+        ViewTool.setOnClickListener(this, this, new int[]{R.id.btn_add_goods});
     }
 
     @Override
     public void onClick(View v) {
         switch (v.getId()) {
-            case R.id.tv_forget:
-                // 忘记密码
-                Intent forgetIntent = new Intent(this, ForgetActivity.class);
-                RxActivityResult.on(this).startIntent(forgetIntent)
-                        .filter(result -> result.resultCode() == RESULT_OK)
-                        .subscribe(result -> {
-                            // 找回密码成功之后关闭登录界面
-                            startActivity(new Intent(AddGoodsActivity.this, MineActivity.class));
-                            finish();
-                        });
-                break;
+            case R.id.btn_add_goods:
+                String title = et_goods_title.getEditableText().toString();
+                String coverUrl = et_cover_url.getEditableText().toString();
+                String description = et_desc.getEditableText().toString();
+                String reason = et_reason.getEditableText().toString();
+                long oldPrice = Long.parseLong(et_old_price.getEditableText().toString());
+                long nowPrice = Long.parseLong(et_now_price.getEditableText().toString());
+                long rebate = oldPrice-nowPrice;
+                String province = et_province.getEditableText().toString();
+                String shopName = et_shop_name.getEditableText().toString();
+                String coupon = et_coupon.getEditableText().toString();
+                String goodsUrl = et_goods_url.getEditableText().toString();
+                String salesPerMonth = et_sales_per_month.getEditableText().toString();
+                String goodCommentPercent = et_good_comment_percent.getEditableText().toString();
+                String commentNum = et_comment_num.getEditableText().toString();
+                boolean isSelf = cb_self.isChecked();
+                boolean isEnable = cb_enable.isChecked();
 
-            case R.id.btn_login:
-                String email = et_email.getEditableText().toString();
-                String password = et_password.getEditableText().toString();
-                if (TextUtils.isEmpty(email)) {
-                    ToastTool.showShort("邮箱不能为空");
-                    return;
-                }
-                if (TextUtils.isEmpty(password)) {
-                    ToastTool.showShort("密码不能为空");
-                    return;
-                }
+                GoodsBean goodsBean = new GoodsBean();
+                goodsBean.title = title;
+                goodsBean.coverImageUrl = coverUrl;
+                goodsBean.description = description;
+                goodsBean.reason = reason;
+                goodsBean.oldPrice = oldPrice;
+                goodsBean.nowPrice = nowPrice;
+                goodsBean.rebate = rebate;
+                goodsBean.province = province;
+                goodsBean.shopName = shopName;
+                goodsBean.couponInfo = coupon;
+                goodsBean.goodsUrl = goodsUrl;
+                goodsBean.salesPerMonth = Long.parseLong(salesPerMonth);
+                goodsBean.goodCommentPercent = Double.parseDouble(goodCommentPercent);
+                goodsBean.commentNum = Long.parseLong(commentNum);
+                goodsBean.isSelfBusiness = isSelf;
+                goodsBean.enable = isEnable;
+                goodsBean.hasCoupon = !TextUtils.isEmpty(coupon);
 
-                password = StringTool.getEncodeString(password);
-                if (TextUtils.isEmpty(password)) {
-                    ToastTool.showShort("该手机不支持加密算法");
-                    return;
-                }
                 showLoading();
-                presenter.submitLogin(email, password);
+                presenter.addGoods(goodsBean);
                 break;
             default:
                 break;
@@ -118,10 +115,9 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
     @Override
     public void onAddGoodsResult(boolean success, String message) {
         dismissLoading();
+        ToastTool.showShort(message);
         if (success) {
             finish();
-        } else {
-            ToastTool.showShort(message);
         }
     }
 }

+ 10 - 8
app/src/main/java/com/itant/shibei/ui/mine/goods/IAddGoodsPresenter.java

@@ -1,7 +1,9 @@
 package com.itant.shibei.ui.mine.goods;
 
+import android.text.TextUtils;
+
 import com.itant.shibei.base.ApiService;
-import com.itant.shibei.bean.BeiUser;
+import com.itant.shibei.bean.GoodsBean;
 import com.miekir.mvp.presenter.BasePresenter;
 import com.miekir.network.core.RetrofitHelper;
 import com.miekir.network.core.base.BaseObserver;
@@ -14,26 +16,26 @@ import io.reactivex.schedulers.Schedulers;
  * @date 2020/7/9 20:54
  * Description: 商品的相关数据接口处理
  */
-public class IAddGoodsPresenter extends BasePresenter<IAddGoodsView> {
+public class AddGoodsPresenter extends BasePresenter<IAddGoodsView> {
 
-    public void submitLogin(String email, String password) {
+    public void addGoods(GoodsBean goodsBean) {
         RetrofitHelper.getInstance()
                 .getRequestApi(ApiService.class)
-                .submitLogin(email, password)
+                .addGoods(goodsBean)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new BaseObserver<BeiUser>() {
+                .subscribe(new BaseObserver<String>() {
                     @Override
-                    public void onSuccess(BeiUser result) {
+                    public void onSuccess(String result) {
                         if (getView() != null) {
-                            //getView().onAddGoodsResult(result, null);
+                            getView().onAddGoodsResult(true, result);
                         }
                     }
 
                     @Override
                     public void onFailure(Throwable e, String errMsg) {
                         if (getView() != null) {
-                            //getView().onAddGoodsResult(null, TextUtils.isEmpty(errMsg) ? "登录失败" : errMsg);
+                            getView().onAddGoodsResult(false, TextUtils.isEmpty(errMsg) ? "添加失败"+e.getMessage() : errMsg);
                         }
                     }
                 });

+ 350 - 79
app/src/main/res/layout/activity_goods_add.xml

@@ -5,93 +5,364 @@
     android:layout_height="match_parent"
     android:background="@color/colorPrimary"
     android:fitsSystemWindows="true"
-    android:orientation="vertical"
     android:focusable="true"
-    android:focusableInTouchMode="true">
+    android:focusableInTouchMode="true"
+    android:orientation="vertical">
     <!--启用深色模式之后,需要使用fitsSystemWindows来不让布局上滑-->
 
     <include layout="@layout/view_toolbar" />
     <!--阴影效果android:background="?android:attr/listDivider"-->
 
-    <com.google.android.material.textfield.TextInputLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/margin_default"
-        android:layout_marginEnd="@dimen/margin_default"
-        android:layout_marginTop="@dimen/margin_default"
-        android:hint="请输入邮箱"
-        app:boxBackgroundMode="outline"
-        app:boxCornerRadiusBottomEnd="4dp"
-        app:boxCornerRadiusBottomStart="4dp"
-        app:boxCornerRadiusTopEnd="4dp"
-        app:boxCornerRadiusTopStart="4dp"
-        app:boxStrokeWidth="@dimen/width_stroke"
-        app:boxStrokeWidthFocused="@dimen/width_stroke"
-        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
-
-        <com.google.android.material.textfield.TextInputEditText
-            android:id="@+id/et_email"
+        android:layout_height="wrap_content">
+
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:textSize="@dimen/text_normal_s"
-            android:inputType="textEmailAddress"
-            android:maxLength="50"/>
-    </com.google.android.material.textfield.TextInputLayout>
+            android:orientation="vertical">
 
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="商品标题[必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
 
-    <com.google.android.material.textfield.TextInputLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/margin_default"
-        android:layout_marginEnd="@dimen/margin_default"
-        android:layout_marginTop="@dimen/margin_default"
-        android:hint="请输入密码"
-        app:boxBackgroundMode="outline"
-        app:boxCornerRadiusBottomEnd="4dp"
-        app:boxCornerRadiusBottomStart="4dp"
-        app:boxCornerRadiusTopEnd="4dp"
-        app:boxCornerRadiusTopStart="4dp"
-        app:boxStrokeWidth="@dimen/width_stroke"
-        app:boxStrokeWidthFocused="@dimen/width_stroke"
-        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
-
-        <com.google.android.material.textfield.TextInputEditText
-            android:id="@+id/et_password"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:inputType="textPassword"
-            android:maxLength="20"
-            android:textSize="@dimen/text_normal_s"/>
-
-    </com.google.android.material.textfield.TextInputLayout>
-
-    <TextView
-        android:id="@+id/tv_forget"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/margin_message"
-        android:layout_marginEnd="@dimen/margin_default"
-        android:text="忘记密码"
-        android:textColor="@color/gray_hint"
-        android:textStyle="bold"
-        android:textSize="@dimen/text_s"
-        android:background="?attr/selectableItemBackground"
-        android:layout_gravity="end"/>
-
-    <android.widget.Button
-        android:id="@+id/btn_login"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:minHeight="0dp"
-        android:layout_marginTop="@dimen/margin_message"
-        android:layout_marginStart="@dimen/margin_default"
-        android:layout_marginEnd="@dimen/margin_default"
-        android:paddingTop="@dimen/padding_full_width"
-        android:paddingBottom="@dimen/padding_full_width"
-        android:text="立即登录  购物返利"
-        android:textColor="@color/white"
-        android:textStyle="bold"
-        android:background="@drawable/selector_btn"
-        style="?android:attr/borderlessButtonStyle"/>
-
-</LinearLayout>
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_goods_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="封面URL[必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_cover_url"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="描述[可选]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_desc"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="一句话推荐[必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_reason"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="原价[单位:分,必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_old_price"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789"
+                    android:inputType="number"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="展示出来的现价[单位:分,原价-(原价-真现价)/2]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_now_price"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789"
+                    android:inputType="number"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="卖家所在省份[可选]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_province"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="商家名称[必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_shop_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="优惠券信息"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_coupon"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="商品推广URL[必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_goods_url"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="月销量[单位:件,必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_sales_per_month"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789"
+                    android:inputType="number"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="好评率[小数,必填]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_good_comment_percent"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789."
+                    android:inputType="numberDecimal"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:layout_marginEnd="@dimen/margin_default"
+                android:hint="评论条数[可选]"
+                app:boxBackgroundMode="outline"
+                app:boxCornerRadiusBottomEnd="4dp"
+                app:boxCornerRadiusBottomStart="4dp"
+                app:boxCornerRadiusTopEnd="4dp"
+                app:boxCornerRadiusTopStart="4dp"
+                app:boxStrokeWidth="@dimen/width_stroke"
+                app:boxStrokeWidthFocused="@dimen/width_stroke">
+
+                <com.google.android.material.textfield.TextInputEditText
+                    android:id="@+id/et_comment_num"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:digits="0123456789"
+                    android:inputType="number"
+                    android:textSize="@dimen/text_normal_s" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <CheckBox
+                android:id="@+id/cb_self"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:layout_marginTop="@dimen/margin_default"
+                android:text="自营商品" />
+
+            <CheckBox
+                android:id="@+id/cb_enable"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/margin_default"
+                android:text="是否生效" />
+
+            <android.widget.Button
+                android:id="@+id/btn_add_goods"
+                style="?android:attr/borderlessButtonStyle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="@dimen/margin_default"
+                android:background="@drawable/selector_btn"
+                android:minHeight="0dp"
+                android:paddingTop="@dimen/padding_full_width"
+                android:paddingBottom="@dimen/padding_full_width"
+                android:text="立即添加"
+                android:textColor="@color/white"
+                android:textStyle="bold" />
+        </LinearLayout>
+    </ScrollView>
+</LinearLayout>

+ 16 - 30
app/src/main/res/layout/activity_mine.xml

@@ -56,37 +56,8 @@
         </LinearLayout>
     </LinearLayout>
 
-
-    <LinearLayout
-        android:id="@+id/ll_feedback"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/height_tab_bar"
-        android:gravity="center_vertical"
-        android:orientation="horizontal"
-        android:paddingStart="@dimen/activity_horizontal_margin"
-        android:paddingEnd="@dimen/activity_horizontal_margin"
-        android:background="?attr/selectableItemBackground"
-        android:visibility="gone">
-
-        <ImageView
-            android:layout_width="@dimen/size_icon_big"
-            android:layout_height="@dimen/size_icon"
-            android:src="@drawable/ic_mine_feedback" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="@dimen/activity_horizontal_margin_s"
-            android:text="反馈"
-            android:textColor="@color/black_text" />
-
-    </LinearLayout>
-
-
     <include layout="@layout/view_divider_common" />
 
-
-
     <!--管理员才能看到此界面-->
     <LinearLayout
         android:id="@+id/ll_admin"
@@ -109,6 +80,21 @@
         <include layout="@layout/view_divider_common"/>
 
         <TextView
+            android:id="@+id/tv_add_goods"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/height_tab_bar"
+            android:background="?attr/selectableItemBackground"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:paddingStart="@dimen/activity_horizontal_margin"
+            android:paddingEnd="@dimen/activity_horizontal_margin"
+            android:text="手动上架商品"
+            android:textColor="@color/black_text" />
+
+        <include layout="@layout/view_divider_common" />
+
+        <TextView
+            android:id="@+id/tv_add_goods_from_url"
             android:layout_width="match_parent"
             android:layout_height="@dimen/height_tab_bar"
             android:background="?attr/selectableItemBackground"
@@ -116,7 +102,7 @@
             android:orientation="horizontal"
             android:paddingStart="@dimen/activity_horizontal_margin"
             android:paddingEnd="@dimen/activity_horizontal_margin"
-            android:text="上架新的商品"
+            android:text="解析添加推荐"
             android:textColor="@color/black_text" />
 
         <include layout="@layout/view_divider_common" />