Procházet zdrojové kódy

功能完善,细节调整

詹子聪 před 5 roky
rodič
revize
7c08bea861

+ 2 - 2
app/build.gradle

@@ -10,8 +10,8 @@ android {
         minSdkVersion versions.minSdk
         minSdkVersion versions.minSdk
         targetSdkVersion versions.targetSdk
         targetSdkVersion versions.targetSdk
         applicationId "com.itant.shibei"
         applicationId "com.itant.shibei"
-        versionCode 1
-        versionName "1.1"
+        versionCode 2
+        versionName "1.2"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     }
 
 

+ 12 - 0
app/src/main/java/com/itant/shibei/ui/home/goods/GoodsAdapter.java

@@ -102,6 +102,17 @@ public class GoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
         });
         });
 
 
         AppCompatImageView aciv_goods = holder.getView(R.id.aciv_goods);
         AppCompatImageView aciv_goods = holder.getView(R.id.aciv_goods);
+        String coverUrl = null;
+        try {
+            coverUrl = (String) aciv_goods.getTag();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (TextUtils.isEmpty(coverUrl) || !TextUtils.equals(coverUrl, goodsBean.coverImageUrl)) {
+            aciv_goods.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
+            aciv_goods.setImageResource(R.mipmap.logo_gray);
+        }
+        aciv_goods.setTag(goodsBean.coverImageUrl);
         Glide.with(mContext).load(goodsBean.coverImageUrl)
         Glide.with(mContext).load(goodsBean.coverImageUrl)
                 .apply(RequestOptions.bitmapTransform(new RoundedCorners(mRadius)))
                 .apply(RequestOptions.bitmapTransform(new RoundedCorners(mRadius)))
                 .apply(new RequestOptions()
                 .apply(new RequestOptions()
@@ -117,6 +128,7 @@ public class GoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {
                     }
                     }
                 });
                 });
 
 
+
         if (UserInfoManager.getInstance().isLogin() &&
         if (UserInfoManager.getInstance().isLogin() &&
                 TextUtils.equals("[email protected]", UserInfoManager.getInstance().getBeiUser().email)) {
                 TextUtils.equals("[email protected]", UserInfoManager.getInstance().getBeiUser().email)) {
             View view = holder.getView(R.id.cv_goods);
             View view = holder.getView(R.id.cv_goods);

+ 23 - 0
app/src/main/java/com/itant/shibei/ui/home/goods/GoodsBean.java

@@ -105,4 +105,27 @@ public class GoodsBean implements Serializable {
 
 
     /**是否是本地写死的数据*/
     /**是否是本地写死的数据*/
     public boolean isLocal;
     public boolean isLocal;
+
+    public void updateData(GoodsBean goodsBean) {
+        this.coverImageUrl = goodsBean.coverImageUrl;
+        this.title = goodsBean.title;
+        this.description = goodsBean.description;
+        this.reason = goodsBean.reason;
+        this.oldPrice = goodsBean.oldPrice;
+        this.nowPrice = goodsBean.nowPrice;
+        this.rebate = goodsBean.rebate;
+        this.shopName = goodsBean.shopName;
+        this.province = goodsBean.province;
+        this.isSelfBusiness = goodsBean.isSelfBusiness;
+        this.hasCoupon = goodsBean.hasCoupon;
+        this.couponInfo = goodsBean.couponInfo;
+        this.goodsType = goodsBean.goodsType;
+        this.goodsUrl = goodsBean.goodsUrl;
+        this.salesPerMonth = goodsBean.salesPerMonth;
+        this.goodCommentPercent = goodsBean.goodCommentPercent;
+        this.createTimeMillis = goodsBean.createTimeMillis;
+        this.updateTimeMillis = goodsBean.updateTimeMillis;
+        this.enable = goodsBean.enable;
+        this.isLocal = goodsBean.isLocal;
+    }
 }
 }

+ 9 - 5
app/src/main/java/com/itant/shibei/ui/home/goods/GoodsFragment.java

@@ -39,7 +39,7 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
     private static final int PAGE_SIZE = 20;
     private static final int PAGE_SIZE = 20;
 
 
     @InjectPresenter
     @InjectPresenter
-    GoodsPresenter mPresenter;
+    GoodsPresenter goodsPresenter;
 
 
     private SwipeRefreshLayout srl_goods;
     private SwipeRefreshLayout srl_goods;
     private GoodsAdapter mAdapter;
     private GoodsAdapter mAdapter;
@@ -91,7 +91,7 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
             public void onRefresh() {
             public void onRefresh() {
                 mIsRefresh = true;
                 mIsRefresh = true;
                 mCurrentPage = PAGE_START;
                 mCurrentPage = PAGE_START;
-                mPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
+                goodsPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
             }
             }
         });
         });
 
 
@@ -104,14 +104,14 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
                 if (!srl_goods.isRefreshing()) {
                 if (!srl_goods.isRefreshing()) {
                     mIsRefresh = false;
                     mIsRefresh = false;
                     srl_goods.setRefreshing(true);
                     srl_goods.setRefreshing(true);
-                    mPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
+                    goodsPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
                 }
                 }
             }
             }
         });
         });
 
 
         // 获取数据
         // 获取数据
         srl_goods.setRefreshing(true);
         srl_goods.setRefreshing(true);
-        mPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
+        goodsPresenter.getGoodsData(mCurrentPage, PAGE_SIZE);
     }
     }
 
 
     /**
     /**
@@ -133,6 +133,8 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
                             .filter(result -> result.resultCode() == RESULT_OK)
                             .filter(result -> result.resultCode() == RESULT_OK)
                             .subscribe(result -> {
                             .subscribe(result -> {
                                 // 修改商品成功之后刷新item
                                 // 修改商品成功之后刷新item
+                                GoodsBean modifiedBean = (GoodsBean) result.data().getSerializableExtra(AddGoodsActivity.KEY_MODIFY_GOODS);
+                                goodsBean.updateData(modifiedBean);
                                 mAdapter.notifyItemChanged(position);
                                 mAdapter.notifyItemChanged(position);
                             });
                             });
                 })
                 })
@@ -159,7 +161,7 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
                 .setPositiveButton("确定", (DialogInterface dialog, int which) -> {
                 .setPositiveButton("确定", (DialogInterface dialog, int which) -> {
                     dialog.dismiss();
                     dialog.dismiss();
                     // 删除商品
                     // 删除商品
-                    mPresenter.deleteGoodsById(position, goodsBean.id);
+                    goodsPresenter.deleteGoodsById(position, goodsBean.id);
                 }).create();
                 }).create();
         alertDialog.show();
         alertDialog.show();
     }
     }
@@ -198,6 +200,8 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView, ITopAc
         // 请求到数据了,页数自增
         // 请求到数据了,页数自增
         if (goodsList != null && goodsList.size() > 0) {
         if (goodsList != null && goodsList.size() > 0) {
             mCurrentPage++;
             mCurrentPage++;
+        } else {
+            ToastTool.showShort("没有更多数据了");
         }
         }
     }
     }
 
 

+ 95 - 1
app/src/main/java/com/itant/shibei/ui/home/search/SearchActivity.java

@@ -1,11 +1,14 @@
 package com.itant.shibei.ui.home.search;
 package com.itant.shibei.ui.home.search;
 
 
+import android.content.DialogInterface;
+import android.content.Intent;
 import android.os.Bundle;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.View;
 import android.widget.Button;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.EditText;
 
 
+import androidx.appcompat.app.AlertDialog;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.recyclerview.widget.RecyclerView;
 
 
@@ -13,6 +16,9 @@ import com.itant.shibei.R;
 import com.itant.shibei.base.BaseBeiActivity;
 import com.itant.shibei.base.BaseBeiActivity;
 import com.itant.shibei.ui.home.goods.GoodsAdapter;
 import com.itant.shibei.ui.home.goods.GoodsAdapter;
 import com.itant.shibei.ui.home.goods.GoodsBean;
 import com.itant.shibei.ui.home.goods.GoodsBean;
+import com.itant.shibei.ui.home.goods.GoodsPresenter;
+import com.itant.shibei.ui.home.goods.IGoodsView;
+import com.itant.shibei.ui.mine.goods.AddGoodsActivity;
 import com.itant.shibei.widget.DividerItemDecoration;
 import com.itant.shibei.widget.DividerItemDecoration;
 import com.itant.shibei.widget.bottomlistener.OnRcvScrollListener;
 import com.itant.shibei.widget.bottomlistener.OnRcvScrollListener;
 import com.miekir.common.utils.ToastTool;
 import com.miekir.common.utils.ToastTool;
@@ -22,6 +28,8 @@ import com.miekir.mvp.presenter.InjectPresenter;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
+import rx_activity_result2.RxActivityResult;
+
 /**
 /**
  * Copyright (C), 2019-2020, Miekir
  * Copyright (C), 2019-2020, Miekir
  *
  *
@@ -29,7 +37,7 @@ import java.util.List;
  * @date 2020/8/12 19:40
  * @date 2020/8/12 19:40
  * Description: 输入文字搜索
  * Description: 输入文字搜索
  */
  */
-public class SearchActivity extends BaseBeiActivity implements View.OnClickListener, ISearchView, View.OnFocusChangeListener {
+public class SearchActivity extends BaseBeiActivity implements View.OnClickListener, ISearchView, View.OnFocusChangeListener, IGoodsView {
     private static final int PAGE_START = 0;
     private static final int PAGE_START = 0;
     private static final int PAGE_SIZE = 20;
     private static final int PAGE_SIZE = 20;
     private int mCurrentPage = PAGE_START;
     private int mCurrentPage = PAGE_START;
@@ -47,6 +55,9 @@ public class SearchActivity extends BaseBeiActivity implements View.OnClickListe
     @InjectPresenter
     @InjectPresenter
     SearchPresenter searchPresenter;
     SearchPresenter searchPresenter;
 
 
+    @InjectPresenter
+    GoodsPresenter goodsPresenter;
+
     @Override
     @Override
     public int getLayoutID() {
     public int getLayoutID() {
         return R.layout.activity_search;
         return R.layout.activity_search;
@@ -67,6 +78,8 @@ public class SearchActivity extends BaseBeiActivity implements View.OnClickListe
         DividerItemDecoration decoration = new DividerItemDecoration(dividerWidth);
         DividerItemDecoration decoration = new DividerItemDecoration(dividerWidth);
         rv_search_result.addItemDecoration(decoration);
         rv_search_result.addItemDecoration(decoration);
         mAdapter = new GoodsAdapter(this, mGoodsList);
         mAdapter = new GoodsAdapter(this, mGoodsList);
+        mAdapter.setGoodsLongClickListener(this::showAdminDialog);
+        rv_search_result.setAdapter(mAdapter);
         mAdapter.setEmptyView(R.layout.view_empty, rv_search_result);
         mAdapter.setEmptyView(R.layout.view_empty, rv_search_result);
         // 加载更多
         // 加载更多
         rv_search_result.addOnScrollListener(new OnRcvScrollListener(){
         rv_search_result.addOnScrollListener(new OnRcvScrollListener(){
@@ -116,6 +129,58 @@ public class SearchActivity extends BaseBeiActivity implements View.OnClickListe
         }
         }
     }
     }
 
 
+    /**
+     * 修改商品或者删除商品
+     */
+    private void showAdminDialog(int position) {
+        GoodsBean goodsBean = mGoodsList.get(position);
+        if (goodsBean.isLocal) {
+            // 本地写死的不能删除
+            return;
+        }
+        AlertDialog alertDialog = new AlertDialog.Builder(this)
+                .setMessage("选择操作")
+                .setPositiveButton("修改", (dialog, which) -> {
+                    dialog.dismiss();
+                    Intent modifyIntent = new Intent(this, AddGoodsActivity.class);
+                    modifyIntent.putExtra(AddGoodsActivity.KEY_MODIFY_GOODS, goodsBean);
+                    RxActivityResult.on(this).startIntent(modifyIntent)
+                            .filter(result -> result.resultCode() == RESULT_OK)
+                            .subscribe(result -> {
+                                // 修改商品成功之后刷新item
+                                GoodsBean modifiedBean = (GoodsBean) result.data().getSerializableExtra(AddGoodsActivity.KEY_MODIFY_GOODS);
+                                goodsBean.updateData(modifiedBean);
+                                mAdapter.notifyItemChanged(position);
+                            });
+                })
+                .setNeutralButton("取消", (dialog, which) -> {
+                    dialog.dismiss();
+                })
+                .setNegativeButton("删除", (DialogInterface dialog, int which) -> {
+                    dialog.dismiss();
+                    showDeleteDialog(position);
+                }).create();
+        alertDialog.setCanceledOnTouchOutside(false);
+        alertDialog.setCancelable(false);
+        alertDialog.show();
+    }
+
+    /**
+     * 是否删除商品
+     */
+    private void showDeleteDialog(int position) {
+        GoodsBean goodsBean = mGoodsList.get(position);
+        AlertDialog alertDialog = new AlertDialog.Builder(this)
+                .setMessage("确定删除商品:" + goodsBean.title)
+                .setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
+                .setPositiveButton("确定", (DialogInterface dialog, int which) -> {
+                    dialog.dismiss();
+                    // 删除商品
+                    goodsPresenter.deleteGoodsById(position, goodsBean.id);
+                }).create();
+        alertDialog.show();
+    }
+
     @Override
     @Override
     public void onSearchKeywordResult(boolean success, String message, List<GoodsBean> goodsList) {
     public void onSearchKeywordResult(boolean success, String message, List<GoodsBean> goodsList) {
         dismissLoading();
         dismissLoading();
@@ -143,6 +208,35 @@ public class SearchActivity extends BaseBeiActivity implements View.OnClickListe
         // 请求到数据了,页数自增
         // 请求到数据了,页数自增
         if (goodsList != null && goodsList.size() > 0) {
         if (goodsList != null && goodsList.size() > 0) {
             mCurrentPage++;
             mCurrentPage++;
+        } else {
+            ToastTool.showShort("没有更多数据了");
+        }
+    }
+
+    /**
+     * 获取商品结果
+     * @param success
+     * @param message
+     * @param goodsList
+     */
+    @Override
+    public void onGoodsDataCome(boolean success, String message, List<GoodsBean> goodsList) {
+
+    }
+
+    /**
+     * 删除商品结果
+     * @param success
+     * @param message
+     * @param position
+     */
+    @Override
+    public void onDeleteGoodsResult(boolean success, String message, int position) {
+        if (success) {
+            mAdapter.notifyItemRemoved(position);
+            ToastTool.showShort("删除成功");
+        } else {
+            ToastTool.showShort(message);
         }
         }
     }
     }
 
 

+ 9 - 6
app/src/main/java/com/itant/shibei/ui/mine/goods/AddGoodsActivity.java

@@ -1,5 +1,6 @@
 package com.itant.shibei.ui.mine.goods;
 package com.itant.shibei.ui.mine.goods;
 
 
+import android.content.Intent;
 import android.os.Bundle;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.view.View;
 import android.view.View;
@@ -26,7 +27,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
     private TextInputEditText et_desc;
     private TextInputEditText et_desc;
     private TextInputEditText et_reason;
     private TextInputEditText et_reason;
     private TextInputEditText et_old_price;
     private TextInputEditText et_old_price;
-    private TextInputEditText et_now_price;
+    private TextInputEditText et_rebate_all;
     private TextInputEditText et_province;
     private TextInputEditText et_province;
     private TextInputEditText et_coupon;
     private TextInputEditText et_coupon;
     private TextInputEditText et_goods_url;
     private TextInputEditText et_goods_url;
@@ -55,7 +56,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
         et_desc = findViewById(R.id.et_desc);
         et_desc = findViewById(R.id.et_desc);
         et_reason = findViewById(R.id.et_reason);
         et_reason = findViewById(R.id.et_reason);
         et_old_price = findViewById(R.id.et_old_price);
         et_old_price = findViewById(R.id.et_old_price);
-        et_now_price = findViewById(R.id.et_now_price);
+        et_rebate_all = findViewById(R.id.et_rebate_all);
         et_province = findViewById(R.id.et_province);
         et_province = findViewById(R.id.et_province);
         et_coupon = findViewById(R.id.et_coupon);
         et_coupon = findViewById(R.id.et_coupon);
         et_goods_url = findViewById(R.id.et_goods_url);
         et_goods_url = findViewById(R.id.et_goods_url);
@@ -79,7 +80,7 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
         et_desc.setText(mGoodsBean.description);
         et_desc.setText(mGoodsBean.description);
         et_reason.setText(mGoodsBean.reason);
         et_reason.setText(mGoodsBean.reason);
         et_old_price.setText(String.valueOf(mGoodsBean.oldPrice));
         et_old_price.setText(String.valueOf(mGoodsBean.oldPrice));
-        et_now_price.setText(String.valueOf(mGoodsBean.nowPrice));
+        et_rebate_all.setText(String.valueOf(mGoodsBean.rebate));
         et_province.setText(mGoodsBean.province);
         et_province.setText(mGoodsBean.province);
         et_coupon.setText(mGoodsBean.couponInfo);
         et_coupon.setText(mGoodsBean.couponInfo);
         et_goods_url.setText(mGoodsBean.goodsUrl);
         et_goods_url.setText(mGoodsBean.goodsUrl);
@@ -100,8 +101,8 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
                 String description = et_desc.getEditableText().toString();
                 String description = et_desc.getEditableText().toString();
                 String reason = et_reason.getEditableText().toString();
                 String reason = et_reason.getEditableText().toString();
                 long oldPrice = Long.parseLong(et_old_price.getEditableText().toString());
                 long oldPrice = Long.parseLong(et_old_price.getEditableText().toString());
-                long nowPrice = Long.parseLong(et_now_price.getEditableText().toString());
-                long rebate = oldPrice-nowPrice;
+                long rebate = Long.parseLong(et_rebate_all.getEditableText().toString());
+                long nowPrice = oldPrice - rebate/2;
                 String province = et_province.getEditableText().toString();
                 String province = et_province.getEditableText().toString();
                 String shopName = et_shop_name.getEditableText().toString();
                 String shopName = et_shop_name.getEditableText().toString();
                 String coupon = et_coupon.getEditableText().toString();
                 String coupon = et_coupon.getEditableText().toString();
@@ -146,7 +147,9 @@ public class AddGoodsActivity extends BaseBeiActivity implements View.OnClickLis
         dismissLoading();
         dismissLoading();
         ToastTool.showShort(message);
         ToastTool.showShort(message);
         if (success) {
         if (success) {
-            setResult(RESULT_OK);
+            Intent intent = getIntent();
+            intent.putExtra(KEY_MODIFY_GOODS, mGoodsBean);
+            setResult(RESULT_OK, intent);
             finish();
             finish();
         }
         }
     }
     }

+ 5 - 4
app/src/main/java/com/itant/shibei/ui/mine/login/LoginActivity.java

@@ -15,7 +15,6 @@ import com.itant.shibei.base.BaseBeiActivity;
 import com.itant.shibei.bean.BeiUser;
 import com.itant.shibei.bean.BeiUser;
 import com.itant.shibei.manager.UserInfoManager;
 import com.itant.shibei.manager.UserInfoManager;
 import com.itant.shibei.tool.StringTool;
 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.forget.ForgetActivity;
 import com.itant.shibei.ui.mine.register.RegisterActivity;
 import com.itant.shibei.ui.mine.register.RegisterActivity;
 import com.miekir.common.utils.ToastTool;
 import com.miekir.common.utils.ToastTool;
@@ -67,7 +66,8 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
                         .filter(result -> result.resultCode() == RESULT_OK)
                         .filter(result -> result.resultCode() == RESULT_OK)
                         .subscribe(result -> {
                         .subscribe(result -> {
                             // 注册成功之后关闭登录界面
                             // 注册成功之后关闭登录界面
-                            startActivity(new Intent(LoginActivity.this, MineActivity.class));
+                            ToastTool.showShort("注册成功");
+                            //startActivity(new Intent(LoginActivity.this, MineActivity.class));
                             finish();
                             finish();
                         });
                         });
                 break;
                 break;
@@ -87,7 +87,7 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
                         .filter(result -> result.resultCode() == RESULT_OK)
                         .filter(result -> result.resultCode() == RESULT_OK)
                         .subscribe(result -> {
                         .subscribe(result -> {
                             // 找回密码成功之后关闭登录界面
                             // 找回密码成功之后关闭登录界面
-                            startActivity(new Intent(LoginActivity.this, MineActivity.class));
+                            //startActivity(new Intent(LoginActivity.this, MineActivity.class));
                             finish();
                             finish();
                         });
                         });
                 break;
                 break;
@@ -122,7 +122,8 @@ public class LoginActivity extends BaseBeiActivity implements View.OnClickListen
         dismissLoading();
         dismissLoading();
         if (user != null) {
         if (user != null) {
             UserInfoManager.getInstance().setBeiUser(user);
             UserInfoManager.getInstance().setBeiUser(user);
-            startActivity(new Intent(this, MineActivity.class));
+            ToastTool.showShort("登录成功");
+            //startActivity(new Intent(this, MineActivity.class));
             finish();
             finish();
         } else {
         } else {
             ToastTool.showShort(message);
             ToastTool.showShort(message);

+ 6 - 4
app/src/main/res/layout/activity_goods_add.xml

@@ -171,7 +171,7 @@
                 android:layout_marginStart="@dimen/margin_default"
                 android:layout_marginStart="@dimen/margin_default"
                 android:layout_marginTop="@dimen/margin_default"
                 android:layout_marginTop="@dimen/margin_default"
                 android:layout_marginEnd="@dimen/margin_default"
                 android:layout_marginEnd="@dimen/margin_default"
-                android:hint="展示出来的现价[单位:分,原价-(原价-真现价)/2]"
+                android:hint="商品实际返利[单位:分]"
                 app:boxBackgroundMode="outline"
                 app:boxBackgroundMode="outline"
                 app:boxCornerRadiusBottomEnd="4dp"
                 app:boxCornerRadiusBottomEnd="4dp"
                 app:boxCornerRadiusBottomStart="4dp"
                 app:boxCornerRadiusBottomStart="4dp"
@@ -181,7 +181,7 @@
                 app:boxStrokeWidthFocused="@dimen/width_stroke">
                 app:boxStrokeWidthFocused="@dimen/width_stroke">
 
 
                 <com.google.android.material.textfield.TextInputEditText
                 <com.google.android.material.textfield.TextInputEditText
-                    android:id="@+id/et_now_price"
+                    android:id="@+id/et_rebate_all"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
                     android:digits="0123456789"
                     android:digits="0123456789"
@@ -344,14 +344,16 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/margin_default"
                 android:layout_marginStart="@dimen/margin_default"
                 android:layout_marginTop="@dimen/margin_default"
                 android:layout_marginTop="@dimen/margin_default"
-                android:text="自营商品" />
+                android:text="自营商品"
+                android:checked="true"/>
 
 
             <CheckBox
             <CheckBox
                 android:id="@+id/cb_enable"
                 android:id="@+id/cb_enable"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginStart="@dimen/margin_default"
                 android:layout_marginStart="@dimen/margin_default"
-                android:text="是否生效" />
+                android:text="是否生效"
+                android:checked="true"/>
 
 
             <android.widget.Button
             <android.widget.Button
                 android:id="@+id/btn_add_goods"
                 android:id="@+id/btn_add_goods"

+ 16 - 15
app/src/main/res/layout/fragment_tool.xml

@@ -55,9 +55,8 @@
     </FrameLayout>
     </FrameLayout>
 
 
     <include layout="@layout/view_divider_common" />
     <include layout="@layout/view_divider_common" />
-
     <FrameLayout
     <FrameLayout
-        android:id="@+id/fl_get_json"
+        android:id="@+id/fl_biao_qing"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:background="@color/white"
         android:background="@color/white"
@@ -77,7 +76,7 @@
             <TextView
             <TextView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="GetJson微服务"
+                android:text="搞笑表情包"
                 android:textSize="@dimen/text_normal_p"
                 android:textSize="@dimen/text_normal_p"
                 android:textColor="@color/black_text_comfortable"
                 android:textColor="@color/black_text_comfortable"
                 android:textStyle="bold"/>
                 android:textStyle="bold"/>
@@ -88,13 +87,13 @@
                 android:layout_marginTop="@dimen/margin_sss"
                 android:layout_marginTop="@dimen/margin_sss"
                 android:textColor="@color/gray_text_s"
                 android:textColor="@color/gray_text_s"
                 android:textSize="@dimen/text_normal_s"
                 android:textSize="@dimen/text_normal_s"
-                android:text="把JSON字符串保存到云,GET请求获取保存的JSON"/>
+                android:text="为表情包配字幕并下载制作的表情包"/>
         </LinearLayout>
         </LinearLayout>
     </FrameLayout>
     </FrameLayout>
-
     <include layout="@layout/view_divider_common" />
     <include layout="@layout/view_divider_common" />
+
     <FrameLayout
     <FrameLayout
-        android:id="@+id/fl_weather"
+        android:id="@+id/fl_get_json"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:background="@color/white"
         android:background="@color/white"
@@ -114,7 +113,7 @@
             <TextView
             <TextView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="天气API"
+                android:text="GetJson微服务"
                 android:textSize="@dimen/text_normal_p"
                 android:textSize="@dimen/text_normal_p"
                 android:textColor="@color/black_text_comfortable"
                 android:textColor="@color/black_text_comfortable"
                 android:textStyle="bold"/>
                 android:textStyle="bold"/>
@@ -125,13 +124,13 @@
                 android:layout_marginTop="@dimen/margin_sss"
                 android:layout_marginTop="@dimen/margin_sss"
                 android:textColor="@color/gray_text_s"
                 android:textColor="@color/gray_text_s"
                 android:textSize="@dimen/text_normal_s"
                 android:textSize="@dimen/text_normal_s"
-                android:text="返回今日天气信息(限时免费)"/>
+                android:text="把JSON字符串保存到云,GET请求获取保存的JSON"/>
         </LinearLayout>
         </LinearLayout>
     </FrameLayout>
     </FrameLayout>
-    <include layout="@layout/view_divider_common" />
 
 
+    <include layout="@layout/view_divider_common" />
     <FrameLayout
     <FrameLayout
-        android:id="@+id/fl_yiji"
+        android:id="@+id/fl_weather"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:background="@color/white"
         android:background="@color/white"
@@ -151,7 +150,7 @@
             <TextView
             <TextView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="黄历API"
+                android:text="天气API"
                 android:textSize="@dimen/text_normal_p"
                 android:textSize="@dimen/text_normal_p"
                 android:textColor="@color/black_text_comfortable"
                 android:textColor="@color/black_text_comfortable"
                 android:textStyle="bold"/>
                 android:textStyle="bold"/>
@@ -162,12 +161,13 @@
                 android:layout_marginTop="@dimen/margin_sss"
                 android:layout_marginTop="@dimen/margin_sss"
                 android:textColor="@color/gray_text_s"
                 android:textColor="@color/gray_text_s"
                 android:textSize="@dimen/text_normal_s"
                 android:textSize="@dimen/text_normal_s"
-                android:text="返回当天宜忌信息(限时免费)"/>
+                android:text="返回今日天气信息(限时免费)"/>
         </LinearLayout>
         </LinearLayout>
     </FrameLayout>
     </FrameLayout>
     <include layout="@layout/view_divider_common" />
     <include layout="@layout/view_divider_common" />
+
     <FrameLayout
     <FrameLayout
-        android:id="@+id/fl_biao_qing"
+        android:id="@+id/fl_yiji"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:background="@color/white"
         android:background="@color/white"
@@ -187,7 +187,7 @@
             <TextView
             <TextView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="搞笑表情包"
+                android:text="黄历API"
                 android:textSize="@dimen/text_normal_p"
                 android:textSize="@dimen/text_normal_p"
                 android:textColor="@color/black_text_comfortable"
                 android:textColor="@color/black_text_comfortable"
                 android:textStyle="bold"/>
                 android:textStyle="bold"/>
@@ -198,8 +198,9 @@
                 android:layout_marginTop="@dimen/margin_sss"
                 android:layout_marginTop="@dimen/margin_sss"
                 android:textColor="@color/gray_text_s"
                 android:textColor="@color/gray_text_s"
                 android:textSize="@dimen/text_normal_s"
                 android:textSize="@dimen/text_normal_s"
-                android:text="为表情包配字幕并下载制作的表情包"/>
+                android:text="返回当天宜忌信息(限时免费)"/>
         </LinearLayout>
         </LinearLayout>
     </FrameLayout>
     </FrameLayout>
     <include layout="@layout/view_divider_common" />
     <include layout="@layout/view_divider_common" />
+
 </LinearLayout>
 </LinearLayout>