Bladeren bron

2024-2-27 代码备份
佣金支出列表增加跳转订单详情逻辑
订单详情页面逻辑调整
添加银行卡及提现页面逻辑调整
我的页面UI微调

zhangbing 2 jaren geleden
bovenliggende
commit
654e0dc3ad
28 gewijzigde bestanden met toevoegingen van 1927 en 197 verwijderingen
  1. 2 0
      app/build.gradle
  2. 3 1
      app/src/main/java/com/yihucha/hbyhc/application/MyApplication.java
  3. 6 0
      app/src/main/java/com/yihucha/hbyhc/config/Constants.java
  4. 7 0
      app/src/main/java/com/yihucha/hbyhc/network/service/OrderService.java
  5. 1 1
      app/src/main/java/com/yihucha/hbyhc/presentation/annuity/AnnuityFragment.kt
  6. 2 3
      app/src/main/java/com/yihucha/hbyhc/presentation/home/adapter/ItemMessageAdapter.java
  7. 10 2
      app/src/main/java/com/yihucha/hbyhc/presentation/integral/NewRedIntegralActivity.java
  8. 32 6
      app/src/main/java/com/yihucha/hbyhc/presentation/integral/adapter/NewRedIntegralAdapter.kt
  9. 13 8
      app/src/main/java/com/yihucha/hbyhc/presentation/invitation/AddBankCardActivity.kt
  10. 3 5
      app/src/main/java/com/yihucha/hbyhc/presentation/login/LoginActivity.java
  11. 30 39
      app/src/main/java/com/yihucha/hbyhc/presentation/login/LoginHomeActivity.java
  12. 2 1
      app/src/main/java/com/yihucha/hbyhc/presentation/mine/MineFragment.java
  13. 2 2
      app/src/main/java/com/yihucha/hbyhc/presentation/mine/SettingUpActivity.java
  14. 0 6
      app/src/main/java/com/yihucha/hbyhc/presentation/order/OrderActivity.java
  15. 113 100
      app/src/main/java/com/yihucha/hbyhc/presentation/order/OrderDetailsActivity.java
  16. 1535 0
      app/src/main/java/com/yihucha/hbyhc/presentation/order/model/OrderDetailBean.java
  17. 43 16
      app/src/main/java/com/yihucha/hbyhc/presentation/order/view_model/OrderViewModel.java
  18. 45 0
      app/src/main/java/com/yihucha/hbyhc/utils/HtmlUtils.java
  19. 28 0
      app/src/main/java/com/yihucha/hbyhc/utils/ToasterUtils.kt
  20. 10 0
      app/src/main/res/drawable/shape_gradient.xml
  21. 4 2
      app/src/main/res/layout/activity_apply_for_refund_option_page.xml
  22. 0 1
      app/src/main/res/layout/activity_red_integral_new.xml
  23. 2 2
      app/src/main/res/layout/fragment_mine.xml
  24. 4 1
      app/src/main/res/layout/item_message.xml
  25. 3 1
      app/src/main/res/layout/item_new_red_integral.xml
  26. 27 0
      app/src/main/res/layout/layout_add_card_success.xml
  27. BIN
      app/src/main/res/mipmap-xxxhdpi/icon_add_card_success.png
  28. BIN
      app/src/main/res/mipmap-xxxhdpi/icon_mine_hjf.png

+ 2 - 0
app/build.gradle

@@ -223,4 +223,6 @@ dependencies {
223 223
     //zxing 二维码扫描
224 224
     implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
225 225
 
226
+    //toast 吐司通知框架
227
+    implementation 'com.github.getActivity:Toaster:12.6'
226 228
 }

+ 3 - 1
app/src/main/java/com/yihucha/hbyhc/application/MyApplication.java

@@ -15,6 +15,7 @@ import com.blankj.utilcode.util.Utils;
15 15
 import com.bytedance.sdk.openadsdk.TTAdConfig;
16 16
 import com.bytedance.sdk.openadsdk.TTAdConstant;
17 17
 import com.bytedance.sdk.openadsdk.TTAdSdk;
18
+import com.hjq.toast.Toaster;
18 19
 import com.kepler.jd.Listener.AsyncInitListener;
19 20
 import com.kepler.jd.login.KeplerApiManager;
20 21
 import com.yihucha.hbyhc.callback.AgreeToADealListener;
@@ -119,7 +120,8 @@ public class MyApplication extends Application {
119 120
         MVUtils.getInstance();
120 121
         //初始化
121 122
         NetworkApi.init(new NetworkRequiredInfo(this));
122
-
123
+        //toast 框架
124
+        Toaster.init(this);
123 125
 
124 126
         context = getApplicationContext();
125 127
         //接收到分享以及登录的intent传递handleIntent方法,处理结果

+ 6 - 0
app/src/main/java/com/yihucha/hbyhc/config/Constants.java

@@ -100,6 +100,12 @@ public class Constants {
100 100
     public static final String PROTOCOL = "http://vod.bjtdba.com/agreement/";
101 101
     //佣金规则
102 102
     public static final String PROTOCOL_YHC_YONGJIN = "https://app.bjtdba.com/api/agreement?type=3";
103
+    //隐私协议
104
+    public static final String PROTOCOL_YHC_YINSI = "https://app.bjtdba.com/api/agreement?type=1";
105
+    //注册协议、服务协议
106
+    public static final String PROTOCOL_YHC_REGIST= "https://app.bjtdba.com/api/agreement?type=2";
107
+    //养老金规则
108
+    public static final String PROTOCOL_YHC_YANGLAOJIN= "https://app.bjtdba.com/api/agreement?type=5";
103 109
     /**
104 110
      *
105 111
      */

+ 7 - 0
app/src/main/java/com/yihucha/hbyhc/network/service/OrderService.java

@@ -17,6 +17,7 @@ import com.yihucha.hbyhc.presentation.order.model.MailCommonBean;
17 17
 import com.yihucha.hbyhc.presentation.order.model.OrderCheckBean;
18 18
 import com.yihucha.hbyhc.presentation.order.model.OrderCreateBean;
19 19
 import com.yihucha.hbyhc.presentation.order.model.OrderCreateShoppingBean;
20
+import com.yihucha.hbyhc.presentation.order.model.OrderDetailBean;
20 21
 import com.yihucha.hbyhc.presentation.order.model.OrderListBean;
21 22
 import com.yihucha.hbyhc.presentation.order.model.OrderListObligationBean;
22 23
 import com.yihucha.hbyhc.presentation.order.model.RefundApplyBean;
@@ -122,6 +123,12 @@ public interface OrderService {
122 123
     Observable<DataResponse<OrderListBean>> getOrderlist(@QueryMap Map<String, Object> request);
123 124
 
124 125
     /**
126
+     * 订单详情
127
+     */
128
+    @GET("api/order/detail/{id}")
129
+    Observable<DataResponse<OrderListBean.ListBean>> getOrderDetail(@Path("id") String id);
130
+
131
+    /**
125 132
      * 订单列表-待付款
126 133
      *
127 134
      * @param

+ 1 - 1
app/src/main/java/com/yihucha/hbyhc/presentation/annuity/AnnuityFragment.kt

@@ -151,7 +151,7 @@ class AnnuityFragment : BaseFragment(), View.OnClickListener {
151 151
         } else if (view == mViewBinding.tvAnnuityRules) {
152 152
             WebViewTitleBaseActivity.launch(
153 153
                 activity, getString(R.string.pension_rules),
154
-                Constants.PROTOCOL + Constants.PENSION_ACCOUNT_RULES
154
+                Constants.PROTOCOL_YHC_YANGLAOJIN
155 155
             )
156 156
         }
157 157
     }

+ 2 - 3
app/src/main/java/com/yihucha/hbyhc/presentation/home/adapter/ItemMessageAdapter.java

@@ -5,11 +5,10 @@ import android.view.LayoutInflater;
5 5
 import android.view.View;
6 6
 import android.view.ViewGroup;
7 7
 import android.widget.BaseAdapter;
8
-import android.widget.TextView;
9 8
 
10
-import com.huantansheng.easyphotos.utils.String.StringUtils;
11 9
 import com.yihucha.hbyhc.R;
12 10
 import com.yihucha.hbyhc.databinding.ItemMessageBinding;
11
+import com.yihucha.hbyhc.utils.HtmlUtils;
13 12
 import com.yihucha.hbyhc.presentation.message.model.TheAnnouncementBean;
14 13
 import com.yihucha.hbyhc.utils.StringsUtil;
15 14
 
@@ -63,7 +62,7 @@ public class ItemMessageAdapter extends BaseAdapter {
63 62
         if (!StringsUtil.isEmpty(getItem(position).getCreate_time())){
64 63
             time = getItem(position).getCreate_time().split(" ")[0];
65 64
         }
66
-        holder.binding.tvContent.setText(getItem(position).getContent());
65
+        holder.binding.tvContent.setText(HtmlUtils.html2Text(getItem(position).getContent()));
67 66
         holder.binding.tvTime.setText(time+"");
68 67
         holder.binding.tvTitle.setText(getItem(position).getTitle());
69 68
         return convertView;

+ 10 - 2
app/src/main/java/com/yihucha/hbyhc/presentation/integral/NewRedIntegralActivity.java

@@ -17,6 +17,7 @@ import com.lcodecore.tkrefreshlayout.RefreshListenerAdapter;
17 17
 import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout;
18 18
 
19 19
 import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity;
20
+import com.yihucha.hbyhc.callback.OnRvItemClickListener;
20 21
 import com.yihucha.hbyhc.config.Constants;
21 22
 import com.yihucha.hbyhc.databinding.ActivityRedIntegralNewBinding;
22 23
 import com.yihucha.hbyhc.presentation.integral.adapter.NewRedIntegralAdapter;
@@ -24,6 +25,8 @@ import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean;
24 25
 import com.yihucha.hbyhc.presentation.invitation.view_model.InviteViewModel;
25 26
 import com.yihucha.hbyhc.presentation.mine.view_model.MineSpreadInfo;
26 27
 import com.yihucha.hbyhc.presentation.mine.view_model.MineViewModel;
28
+import com.yihucha.hbyhc.presentation.order.OrderDetailsActivity;
29
+import com.yihucha.hbyhc.presentation.order.view_model.OrderViewModel;
27 30
 import com.yihucha.hbyhc.utils.EmptyCheckUtils;
28 31
 import com.yihucha.hbyhc.utils.MVUtils;
29 32
 
@@ -57,9 +60,9 @@ public class NewRedIntegralActivity extends ViewBindingTitleBaseActivity<Activit
57 60
         });
58 61
         mInviteViewModel.redIntegralListBean.observe(this, datas -> {
59 62
 //            if (EmptyCheckUtils.isEmpty(datas)) page--; // 如果加载不成功,回滚分页
60
-            System.out.println(datas.size());
63
+//            System.out.println(datas.size());
61 64
             beans.addAll(datas);
62
-            System.out.println(beans.size());
65
+//            System.out.println(beans.size());
63 66
             if (EmptyCheckUtils.isNotEmpty(beans)) {
64 67
                 mViewBinding.layoutNoData.llNotFound.setVisibility(View.GONE);
65 68
                 mViewBinding.lvIntegral.setVisibility(View.VISIBLE);
@@ -116,6 +119,11 @@ public class NewRedIntegralActivity extends ViewBindingTitleBaseActivity<Activit
116 119
     }
117 120
 
118 121
     private void initListener() {
122
+
123
+        adapter.setOnItemClickListener(position -> {
124
+            OrderDetailsActivity.launch(NewRedIntegralActivity.this,beans.get(position).getOrderId());
125
+        });
126
+
119 127
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
120 128
             mViewBinding.scrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
121 129
                 int[] location = new int[2];

+ 32 - 6
app/src/main/java/com/yihucha/hbyhc/presentation/integral/adapter/NewRedIntegralAdapter.kt

@@ -1,13 +1,18 @@
1 1
 package com.yihucha.hbyhc.presentation.integral.adapter
2 2
 
3 3
 import android.annotation.SuppressLint
4
+import android.content.res.ColorStateList
5
+import android.graphics.Color
4 6
 import android.view.LayoutInflater
5 7
 import android.view.View
6 8
 import android.view.ViewGroup
9
+import android.widget.ImageView
7 10
 import android.widget.TextView
11
+import androidx.constraintlayout.widget.ConstraintLayout
8 12
 import androidx.recyclerview.widget.RecyclerView.Adapter
9 13
 import androidx.recyclerview.widget.RecyclerView.ViewHolder
10 14
 import com.yihucha.hbyhc.R
15
+import com.yihucha.hbyhc.callback.OnRvItemClickListener
11 16
 import com.yihucha.hbyhc.databinding.ItemNewRedIntegralBinding
12 17
 import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean
13 18
 import com.yihucha.hbyhc.utils.EmptyCheckUtils
@@ -20,10 +25,11 @@ import com.yihucha.hbyhc.utils.EmptyCheckUtils
20 25
 class NewRedIntegralAdapter(var beans: List<RedIntegralListBean>) :
21 26
     Adapter<NewRedIntegralAdapter.RedIntegralHolder>() {
22 27
 
23
-    fun setDataBeans(datas: List<RedIntegralListBean>){
28
+    fun setDataBeans(datas: List<RedIntegralListBean>) {
24 29
         this.beans = datas
25 30
         notifyDataSetChanged()
26 31
     }
32
+
27 33
     override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RedIntegralHolder {
28 34
         return RedIntegralHolder(
29 35
             LayoutInflater
@@ -33,21 +39,41 @@ class NewRedIntegralAdapter(var beans: List<RedIntegralListBean>) :
33 39
     }
34 40
 
35 41
     override fun getItemCount(): Int {
36
-        return if (EmptyCheckUtils.isEmpty(beans)) 0 else beans.size*10
42
+        return if (EmptyCheckUtils.isEmpty(beans)) 0 else beans.size
37 43
     }
38 44
 
39 45
     @SuppressLint("SetTextI18n")
40 46
     override fun onBindViewHolder(holder: RedIntegralHolder, position: Int) {
41
-        val bean = beans[position%3]
47
+        val bean = beans[position]
42 48
         holder.tvIntegral.text = "${if (bean.pm == "1") "+" else "-"}${bean.rewardSocre}"
43 49
         holder.tvDescription.text = bean.mark
44 50
         holder.tvTime.text = bean.createTime
51
+        holder.jiantou.visibility = if (bean.pm == "1") View.INVISIBLE else View.VISIBLE
52
+        holder.tvIntegral.setTextColor(
53
+            if (bean.pm == "1")
54
+                Color.parseColor("#fe0032")
55
+            else
56
+                Color.parseColor("#333333")
57
+        )
58
+        if (bean.pm == "2") {
59
+            holder.parent.setOnClickListener {
60
+                listener?.onItemClick(position)
61
+            }
62
+        }
63
+
45 64
     }
46 65
 
47 66
 
67
+    var listener: OnRvItemClickListener? = null
68
+    fun setOnItemClickListener(listener: OnRvItemClickListener) {
69
+        this.listener = listener
70
+    }
71
+
48 72
     class RedIntegralHolder(var itemView: View) : ViewHolder(itemView) {
49
-        var tvIntegral:TextView = itemView.findViewById(R.id.tv_integral)
50
-        var tvDescription:TextView = itemView.findViewById(R.id.tv_description)
51
-        var tvTime:TextView = itemView.findViewById(R.id.tv_time)
73
+        var tvIntegral: TextView = itemView.findViewById(R.id.tv_integral)
74
+        var tvDescription: TextView = itemView.findViewById(R.id.tv_description)
75
+        var tvTime: TextView = itemView.findViewById(R.id.tv_time)
76
+        var jiantou: ImageView = itemView.findViewById(R.id.imgv_jiantou)
77
+        var parent: ConstraintLayout = itemView.findViewById(R.id.parent_view)
52 78
     }
53 79
 }

+ 13 - 8
app/src/main/java/com/yihucha/hbyhc/presentation/invitation/AddBankCardActivity.kt

@@ -7,6 +7,9 @@ import android.os.Bundle
7 7
 import android.view.View
8 8
 import android.widget.Toast
9 9
 import androidx.lifecycle.ViewModelProvider
10
+import com.hjq.toast.ToastParams
11
+import com.hjq.toast.Toaster
12
+import com.hjq.toast.style.BlackToastStyle
10 13
 import com.yihucha.hbyhc.R
11 14
 import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity
12 15
 import com.yihucha.hbyhc.databinding.ActivityAddBankCardBinding
@@ -16,6 +19,7 @@ import com.yihucha.hbyhc.presentation.invitation.view_model.InviteViewModel
16 19
 import com.yihucha.hbyhc.utils.EditTextListener
17 20
 import com.yihucha.hbyhc.utils.EmptyCheckUtils
18 21
 import com.yihucha.hbyhc.utils.StringsUtil
22
+import com.yihucha.hbyhc.utils.ToasterUtils
19 23
 
20 24
 class AddBankCardActivity : ViewBindingTitleBaseActivity<ActivityAddBankCardBinding>() {
21 25
     var cardImg: String? = null
@@ -86,11 +90,12 @@ class AddBankCardActivity : ViewBindingTitleBaseActivity<ActivityAddBankCardBind
86 90
             mViewBinding.edtCardNumber.setText(it.user_card)
87 91
         }
88 92
         viewModel.addBankCardResult.observe(this) {
89
-            Toast.makeText(this, it, Toast.LENGTH_LONG).show()
93
+            ToasterUtils.showCustomView(it,R.layout.layout_add_card_success)
90 94
             finish()
91 95
         }
92 96
         viewModel.failed.observe(this) {
93
-            Toast.makeText(this, it, Toast.LENGTH_LONG).show()
97
+            ToasterUtils.showBlack(it)
98
+//            ToasterUtils.showCustomView(it,R.layout.layout_add_card_success)
94 99
         }
95 100
     }
96 101
 
@@ -129,27 +134,27 @@ class AddBankCardActivity : ViewBindingTitleBaseActivity<ActivityAddBankCardBind
129 134
             mViewBinding.apply {
130 135
                 //提交
131 136
                 if (EmptyCheckUtils.isEmpty(edtUserName.text.toString())) {
132
-                    Toast.makeText(this@AddBankCardActivity, "请输入持卡人姓名", Toast.LENGTH_LONG).show()
137
+                    ToasterUtils.showBlack("请输入持卡人姓名")
133 138
                     return
134 139
                 }
135 140
                 if (EmptyCheckUtils.isEmpty(edtCardNumber.text.toString())) {
136
-                    Toast.makeText(this@AddBankCardActivity, "请输入持卡人身份证号", Toast.LENGTH_LONG).show()
141
+                    ToasterUtils.showBlack("请输入持卡人身份证号")
137 142
                     return
138 143
                 }
139 144
                 if (EmptyCheckUtils.isEmpty(edtBankName.text.toString())) {
140
-                    Toast.makeText(this@AddBankCardActivity, "请输入银行", Toast.LENGTH_LONG).show()
145
+                    ToasterUtils.showBlack("请输入所属银行")
141 146
                     return
142 147
                 }
143 148
                 if (EmptyCheckUtils.isEmpty(edtBankName2.text.toString())) {
144
-                    Toast.makeText(this@AddBankCardActivity, "请输入开户支行", Toast.LENGTH_LONG).show()
149
+                    ToasterUtils.showBlack("请输入开户支行")
145 150
                     return
146 151
                 }
147 152
                 if (EmptyCheckUtils.isEmpty(edtBankCardNumber.text.toString())) {
148
-                    Toast.makeText(this@AddBankCardActivity, "请输入银行卡号", Toast.LENGTH_LONG).show()
153
+                    ToasterUtils.showBlack("请输入银行卡号")
149 154
                     return
150 155
                 }
151 156
                 if (!StringsUtil.isIdCard(edtCardNumber.text.toString())) {
152
-                    Toast.makeText(this@AddBankCardActivity, "身份证号格式错误", Toast.LENGTH_LONG).show()
157
+                    ToasterUtils.showBlack("身份证号格式错误")
153 158
                     return
154 159
                 }
155 160
 /*                if (!StringsUtil.isBank(edtBankCardNumber.text.toString())) {

+ 3 - 5
app/src/main/java/com/yihucha/hbyhc/presentation/login/LoginActivity.java

@@ -130,9 +130,7 @@ public class LoginActivity extends ViewBindingTitleBaseActivity<ActivityLoginPho
130 130
                         Toast.makeText(context, "手机号码格式输入错误", Toast.LENGTH_SHORT).show();
131 131
                         return;
132 132
                     }
133
-                    /**
134
-                     * 下面做绑定手机号流程,暂时不做处理
135
-                     */
133
+                    //TODO 下面做绑定手机号流程,暂时不做处理
136 134
                 });
137 135
             }
138 136
         });
@@ -235,11 +233,11 @@ public class LoginActivity extends ViewBindingTitleBaseActivity<ActivityLoginPho
235 233
         }else if (v == mViewBinding.tvRegistrationProtocol){
236 234
             //注册协议
237 235
             WebViewTitleBaseActivity.launch(LoginActivity.this,getString(R.string.registration_protocol),
238
-                    Constants.PROTOCOL+Constants.SERVICE_AGREEMENT);
236
+                    Constants.PROTOCOL_YHC_REGIST);
239 237
         }else if (v ==  mViewBinding.tvPrivacyAgreement){
240 238
             //隐私协议
241 239
             WebViewTitleBaseActivity.launch(LoginActivity.this,getString(R.string.privacy_agreement),
242
-                    Constants.PROTOCOL+Constants.PRIVACY_AGREEMENT);
240
+                    Constants.PROTOCOL_YHC_YINSI);
243 241
         }
244 242
     }
245 243
 

+ 30 - 39
app/src/main/java/com/yihucha/hbyhc/presentation/login/LoginHomeActivity.java

@@ -25,14 +25,14 @@ import com.tencent.mm.opensdk.modelmsg.SendAuth;
25 25
 
26 26
 public class LoginHomeActivity extends ViewBindingTitleBaseActivity<ActivityLoginHomeBinding> implements View.OnClickListener {
27 27
     private LoginViewModel loginHomeViewModel;
28
-    private int num=1;
28
+    private int num = 1;
29 29
 
30 30
     @Override
31 31
     protected void onCreate(Bundle savedInstanceState) {
32 32
         super.onCreate(savedInstanceState);
33
-      //  setContentView(R.layout.activity_login_home);
33
+        //  setContentView(R.layout.activity_login_home);
34 34
         //绑定
35
-        loginHomeViewModel=new ViewModelProvider(this).get(LoginViewModel.class);
35
+        loginHomeViewModel = new ViewModelProvider(this).get(LoginViewModel.class);
36 36
 
37 37
         initView();
38 38
         initClick();
@@ -40,10 +40,11 @@ public class LoginHomeActivity extends ViewBindingTitleBaseActivity<ActivityLogi
40 40
 
41 41
     }
42 42
 
43
-    public void initView(){
43
+    public void initView() {
44 44
         mViewBinding.cbSelector.setSelected(false);
45 45
     }
46
-    public void initClick(){
46
+
47
+    public void initClick() {
47 48
         mViewBinding.tvWxLogin.setOnClickListener(this);
48 49
         mViewBinding.tvAlPhone.setOnClickListener(this);
49 50
         mViewBinding.cbSelector.setOnClickListener(this);
@@ -52,7 +53,8 @@ public class LoginHomeActivity extends ViewBindingTitleBaseActivity<ActivityLogi
52 53
         mViewBinding.tvPrivacyAgreement.setOnClickListener(this);
53 54
         mViewBinding.ivQiehuan.setOnClickListener(this);
54 55
     }
55
-    public void initData(){
56
+
57
+    public void initData() {
56 58
 
57 59
 //        loginHomeViewModel.xieyi.observe(this, new Observer<DataResponse<LoginHomeXieyiModel>>() {
58 60
 //            @Override
@@ -68,58 +70,47 @@ public class LoginHomeActivity extends ViewBindingTitleBaseActivity<ActivityLogi
68 70
             }
69 71
         });
70 72
     }
73
+
71 74
     @Override
72 75
     public void onClick(View v) {
73 76
         super.onClick(v);
74 77
         if (v == mViewBinding.tvWxLogin) {
75
-            if (mViewBinding.cbSelector.isSelected()){
78
+            if (mViewBinding.cbSelector.isSelected()) {
76 79
                 regToWx();
77
-            }else {
80
+            } else {
78 81
                 mViewBinding.ivTes.setVisibility(View.VISIBLE);
79 82
             }
80
-        } else if (v == mViewBinding.tvAlPhone){
81
-            if (mViewBinding.cbSelector.isSelected()){
82
-//                TokenResultListener mTokenResultListener = new TokenResultListener() {
83
-//                    @Override
84
-//                    public void onTokenSuccess(String ret) {
85
-//                    }
86
-//
87
-//                    @Override
88
-//                    public void onTokenFailed(String ret) {
89
-//                    }
90
-//                };
91
-//
92
-//                PhoneNumberAuthHelper mPhoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(this, mTokenResultListener);
93
-//                mPhoneNumberAuthHelper.checkEnvAvailable(2);
94
-                 Intent pIntent = new Intent(LoginHomeActivity.this, OneKeyLoginActivity.class);
95
-                    startActivity(pIntent);
96
-            }else {
83
+        } else if (v == mViewBinding.tvAlPhone) {
84
+            if (mViewBinding.cbSelector.isSelected()) {
85
+                Intent pIntent = new Intent(LoginHomeActivity.this, OneKeyLoginActivity.class);
86
+                startActivity(pIntent);
87
+            } else {
97 88
                 mViewBinding.ivTes.setVisibility(View.VISIBLE);
98 89
             }
99
-        }else if (v==mViewBinding.cbSelector){
90
+        } else if (v == mViewBinding.cbSelector) {
100 91
             mViewBinding.ivTes.setVisibility(View.INVISIBLE);
101
-            if (mViewBinding.cbSelector.isSelected()){
92
+            if (mViewBinding.cbSelector.isSelected()) {
102 93
                 mViewBinding.cbSelector.setSelected(false);
103
-            }else {
94
+            } else {
104 95
                 mViewBinding.cbSelector.setSelected(true);
105 96
             }
106
-        }else if (v == mViewBinding.tvPhoneLogin){
97
+        } else if (v == mViewBinding.tvPhoneLogin) {
107 98
             /*if (mViewBinding.cbSelector.isSelected()){
108 99
                 LoginActivity.launch(LoginHomeActivity.this);
109 100
             }else {
110 101
                 mViewBinding.ivTes.setVisibility(View.VISIBLE);
111 102
             }*/
112 103
             LoginActivity.launch(LoginHomeActivity.this);
113
-        }else if (v == mViewBinding.tvRegistrationProtocol){
104
+        } else if (v == mViewBinding.tvRegistrationProtocol) {
114 105
             //注册协议
115 106
 //            loginHomeViewModel.getXieyi(LoginHomeActivity.this,"2");
116
-            WebViewTitleBaseActivity.launch(LoginHomeActivity.this,getString(R.string.registration_protocol),
117
-                    Constants.PROTOCOL+Constants.SERVICE_AGREEMENT);
118
-        }else if (v ==  mViewBinding.tvPrivacyAgreement){
107
+            WebViewTitleBaseActivity.launch(LoginHomeActivity.this, getString(R.string.registration_protocol),
108
+                    Constants.PROTOCOL_YHC_REGIST);
109
+        } else if (v == mViewBinding.tvPrivacyAgreement) {
119 110
             //隐私协议
120 111
 //            loginHomeViewModel.getXieyi(LoginHomeActivity.this,"1");
121
-            WebViewTitleBaseActivity.launch(LoginHomeActivity.this,getString(R.string.privacy_agreement),
122
-                    Constants.PROTOCOL+Constants.PRIVACY_AGREEMENT);
112
+            WebViewTitleBaseActivity.launch(LoginHomeActivity.this, getString(R.string.privacy_agreement),
113
+                    Constants.PROTOCOL_YHC_YINSI);
123 114
         }
124 115
 //        else if (v == mViewBinding.ivQiehuan){
125 116
 //            if (num>=10){
@@ -143,13 +134,13 @@ public class LoginHomeActivity extends ViewBindingTitleBaseActivity<ActivityLogi
143 134
     //注册api
144 135
     private void regToWx() {
145 136
         if (!MyApplication.getApi().isWXAppInstalled()) {
146
-            MyToast.makeText(LoginHomeActivity.this,"您的设备未安装微信客户端",Toast.LENGTH_SHORT).show();
147
-        }else {
137
+            MyToast.makeText(LoginHomeActivity.this, "您的设备未安装微信客户端", Toast.LENGTH_SHORT).show();
138
+        } else {
148 139
             SendAuth.Req req = new SendAuth.Req();
149 140
             //此处中"snsapi_userinfo"不可以更改
150
-            req.scope="snsapi_userinfo";
141
+            req.scope = "snsapi_userinfo";
151 142
             //此处可随意编写
152
-            req.state="wx_cc";
143
+            req.state = "wx_cc";
153 144
             MyApplication.getApi().sendReq(req);
154 145
         }
155 146
     }

+ 2 - 1
app/src/main/java/com/yihucha/hbyhc/presentation/mine/MineFragment.java

@@ -16,6 +16,7 @@ import com.yihucha.hbyhc.base.BaseFragment;
16 16
 import com.yihucha.hbyhc.config.Constants;
17 17
 import com.yihucha.hbyhc.databinding.FragmentMineBinding;
18 18
 import com.yihucha.hbyhc.presentation.integral.NewRedIntegralActivity;
19
+import com.yihucha.hbyhc.presentation.invitation.InviteFriendsActivity;
19 20
 import com.yihucha.hbyhc.presentation.invitation.MyInvitationActivity;
20 21
 import com.yihucha.hbyhc.presentation.mine.model.UserInfoModel;
21 22
 import com.yihucha.hbyhc.presentation.mine.view_model.MineViewModel;
@@ -264,7 +265,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
264 265
             MyEvaluateActivity.launch(getActivity());
265 266
         } else if (view == binding.tvMineYq) {
266 267
             //我的邀请
267
-            MyInvitationActivity.launch(getActivity());
268
+            InviteFriendsActivity.launch(getActivity());
268 269
         } else if (view == binding.tvMineYj) {
269 270
             //点击我的佣金进入我的邀请
270 271
 //            MyInvitationActivity.launch(getActivity());

+ 2 - 2
app/src/main/java/com/yihucha/hbyhc/presentation/mine/SettingUpActivity.java

@@ -141,11 +141,11 @@ public class SettingUpActivity extends ViewBindingTitleBaseActivity<ActivitySett
141 141
         }else if (v ==mViewBinding.llPrivacyAgreement){
142 142
             //隐私协议
143 143
             WebViewTitleBaseActivity.launch(SettingUpActivity.this,getString(R.string.privacy_agreement),
144
-                    Constants.PROTOCOL+Constants.PRIVACY_AGREEMENT);
144
+                    Constants.PROTOCOL_YHC_YINSI);
145 145
         }else if (v ==mViewBinding.llServiceAgreement){
146 146
             //服务协议
147 147
             WebViewTitleBaseActivity.launch(SettingUpActivity.this,getString(R.string.service_agreement),
148
-                    Constants.PROTOCOL+Constants.SERVICE_AGREEMENT);
148
+                    Constants.PROTOCOL_YHC_REGIST);
149 149
         }else if (v ==mViewBinding.llLogOutOfAnAccount){
150 150
             AccountCancellationActivity.launch(context);
151 151
         }else if (v ==mViewBinding.llRealNameAuthentication){

+ 0 - 6
app/src/main/java/com/yihucha/hbyhc/presentation/order/OrderActivity.java

@@ -262,12 +262,6 @@ public class OrderActivity extends BaseActivity implements View.OnClickListener
262 262
                 ApplyForRefundOptionPageActivity.launch(context, orderList.get(position));
263 263
             }
264 264
         });
265
-        orderListObligationAdapter.setOnTimeEnd(new OrderListObligationAdapter.OnTimeEnd() {
266
-            @Override
267
-            public void onTimeEnd() {
268
-                //倒计时结束
269
-            }
270
-        });
271 265
         orderListObligationAdapter.setOnClickListener(new OrderListObligationAdapter.OnClickListener() {
272 266
             @Override
273 267
             public void onItemClick(int position) {

+ 113 - 100
app/src/main/java/com/yihucha/hbyhc/presentation/order/OrderDetailsActivity.java

@@ -10,6 +10,7 @@ import androidx.lifecycle.ViewModelProvider;
10 10
 import androidx.recyclerview.widget.LinearLayoutManager;
11 11
 
12 12
 import com.alibaba.fastjson.JSON;
13
+import com.blankj.utilcode.util.GsonUtils;
13 14
 import com.blankj.utilcode.util.ToastUtils;
14 15
 import com.yihucha.hbyhc.R;
15 16
 import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity;
@@ -22,6 +23,7 @@ import com.yihucha.hbyhc.presentation.order.view_model.OrderViewModel;
22 23
 import com.yihucha.hbyhc.presentation.pay.PayActivity;
23 24
 import com.yihucha.hbyhc.presentation.product.ProductDetailsActivity;
24 25
 import com.yihucha.hbyhc.utils.CopyUtils;
26
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
25 27
 import com.yihucha.hbyhc.utils.GlideUtils;
26 28
 import com.yihucha.hbyhc.utils.StringsUtil;
27 29
 
@@ -41,25 +43,48 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
41 43
     public static final String INTENT_ORDER_BEAN = "intentOrderBean";
42 44
     public static final String INTENT_ORDER_OBLIGATION_BEAN = "intentOrderObligationBean";
43 45
     public static final String INTENT_ORDER_STATUS = "intentOrderStatus";
46
+
47
+    public static final String ORDER_ID = "order_id";
48
+
49
+    private String orderId = null;
44 50
     private OrderListBean.ListBean orderBean;
45 51
     private OrderListObligationBean.ObligationBeanList obligationBeanList;
46 52
     private String status;
47 53
     private OrderViewModel mOrderViewModel;
54
+
55
+
48 56
     @Override
49 57
     protected void onCreate(Bundle savedInstanceState) {
50 58
         super.onCreate(savedInstanceState);
51 59
         orderBean = (OrderListBean.ListBean) getIntent().getSerializableExtra(INTENT_ORDER_BEAN);
52 60
         obligationBeanList = (OrderListObligationBean.ObligationBeanList) getIntent().getSerializableExtra(INTENT_ORDER_OBLIGATION_BEAN);
53 61
         status = getIntent().getStringExtra(INTENT_ORDER_STATUS);
62
+        orderId = getIntent().getStringExtra(ORDER_ID);
54 63
 
55 64
         mOrderViewModel =
56 65
                 new ViewModelProvider(this).get(OrderViewModel.class);
57
-        initView();
66
+        if (EmptyCheckUtils.isNotEmpty(orderId)) {
67
+            mOrderViewModel.getOrderDetail(orderId);
68
+        } else {
69
+            initView();
70
+        }
71
+
58 72
         initClick();
59 73
         initData();
60 74
     }
61 75
 
62 76
     private void initData() {
77
+        mOrderViewModel.orderDetail.observe(this, bean -> {
78
+            orderBean = bean;
79
+            obligationBeanList = GsonUtils.fromJson(GsonUtils.toJson(bean), OrderListObligationBean.ObligationBeanList.class);
80
+            status = "5".equals(bean.getStatus())?"99":bean.getStatus();
81
+            if ("5".equals(bean.getStatus())){
82
+                OrderDetailsDaifukuanActivity.launch(context, obligationBeanList, status);
83
+                finish();
84
+                return;
85
+            }
86
+            initView();
87
+        });
63 88
         //取消订单成功
64 89
         mOrderViewModel.cancelOrderSucceed.observe(this, new Observer<String>() {
65 90
             @Override
@@ -127,46 +152,32 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
127 152
 
128 153
             GlideUtils.loadImage(context, obligationBeanList.getMerchant().getMer_avatar(), mViewBinding.ivShopLogo);
129 154
             mViewBinding.btvMerName.setText(obligationBeanList.getMerchant().getMer_name());
130
-            if ("5".equals(obligationBeanList.getPay_type())){
131
-                mViewBinding.tvTotalPrice.setText("积分"+obligationBeanList.getTotal_price());
132
-            }else {
155
+            if ("5".equals(obligationBeanList.getPay_type())) {
156
+                mViewBinding.tvTotalPrice.setText("积分" + obligationBeanList.getTotal_price());
157
+            } else {
133 158
                 mViewBinding.tvTotalPrice.setText(obligationBeanList.getTotal_price());
134 159
             }
135
-            if ("5".equals(obligationBeanList.getPay_type())){
136
-                mViewBinding.tvCouponPrice.setText("积分"+obligationBeanList.getCoupon_price());
137
-            }else {
160
+            if ("5".equals(obligationBeanList.getPay_type())) {
161
+                mViewBinding.tvCouponPrice.setText("积分" + obligationBeanList.getCoupon_price());
162
+            } else {
138 163
                 mViewBinding.tvCouponPrice.setText(obligationBeanList.getCoupon_price());
139 164
             }
140
-            if ("5".equals(obligationBeanList.getPay_type())){
141
-                mViewBinding.tvPayPostage.setText("积分"+obligationBeanList.getPay_postage());
142
-            }else {
165
+            if ("5".equals(obligationBeanList.getPay_type())) {
166
+                mViewBinding.tvPayPostage.setText("积分" + obligationBeanList.getPay_postage());
167
+            } else {
143 168
                 mViewBinding.tvPayPostage.setText(obligationBeanList.getPay_postage());
144 169
             }
145
-            if ("5".equals(obligationBeanList.getPay_type())){
170
+            if ("5".equals(obligationBeanList.getPay_type())) {
146 171
                 mViewBinding.btvPayPrice.setText("积分" + obligationBeanList.getPay_price());
147
-            }else {
172
+            } else {
148 173
                 mViewBinding.btvPayPrice.setText("¥" + obligationBeanList.getPay_price());
149 174
             }
150 175
 
151 176
             mViewBinding.tvGroupOrderSn.setText(obligationBeanList.getGroup_order_sn());
152
-            //支付方式 0=余额 1=微信 2=小程序 3=h5 4=支付宝
153
-           /* if ("0".equals(obligationBeanList.getPay_type())) {
154
-                mViewBinding.tvPayType.setText("余额");
155
-            } else if ("1".equals(obligationBeanList.getPay_type())) {
156
-                mViewBinding.tvPayType.setText("微信");
157
-            } else if ("2".equals(obligationBeanList.getPay_type())) {
158
-                mViewBinding.tvPayType.setText("小程序");
159
-            } else if ("3".equals(obligationBeanList.getPay_type())) {
160
-                mViewBinding.tvPayType.setText("h5");
161
-            } else if ("4".equals(obligationBeanList.getPay_type())) {
162
-                mViewBinding.tvPayType.setText("支付宝");
163
-            }else if ("5".equals(obligationBeanList.getPay_type())){
164
-                mViewBinding.tvPayType.setText("积分兑换");
165
-            }*/
166 177
             if ("5".equals(obligationBeanList.getPay_type())) {
167 178
                 mViewBinding.tvPayType.setText("微信支付");
168 179
 
169
-            }else{
180
+            } else {
170 181
                 mViewBinding.tvPayType.setText("微信支付");
171 182
             }
172 183
             mViewBinding.tvCreateTime.setText(obligationBeanList.getCreate_time());
@@ -190,7 +201,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
190 201
 
191 202
             GlideUtils.loadImage(context, orderBean.getMerchant().getMer_avatar(), mViewBinding.ivShopLogo);
192 203
             mViewBinding.btvMerName.setText(orderBean.getMerchant().getMer_name());
193
-         //   订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
204
+            //   订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
194 205
 //            System.out.println(orderBean.getStatus());
195 206
             if ("0".equals(orderBean.getStatus())) {
196 207
                 mViewBinding.tvRemindTheDelivery.setVisibility(View.VISIBLE);
@@ -246,8 +257,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
246 257
 
247 258
                 setTitle(R.string.completed);
248 259
                 mViewBinding.llBottom.setVisibility(View.VISIBLE);
249
-            }
250
-            else if ("4".equals(orderBean.getStatus())) {
260
+            } else if ("4".equals(orderBean.getStatus())) {
251 261
                 mViewBinding.tvCheckTheLogistics.setVisibility(View.GONE);
252 262
                 mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
253 263
                 mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
@@ -258,8 +268,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
258 268
                 mViewBinding.tvToEvaluate.setVisibility(View.GONE);
259 269
 
260 270
                 setTitle("已申请退款");
261
-            }
262
-            else if ("-1".equals(orderBean.getStatus())) {
271
+            } else if ("-1".equals(orderBean.getStatus())) {
263 272
                 mViewBinding.tvCheckTheLogistics.setVisibility(View.GONE);
264 273
                 mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
265 274
                 mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
@@ -269,8 +278,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
269 278
                 mViewBinding.tvBuyAgain.setVisibility(View.GONE);
270 279
                 mViewBinding.tvToEvaluate.setVisibility(View.GONE);
271 280
                 setTitle("已退款");
272
-            }
273
-            else if ("5".equals(orderBean.getStatus())) {
281
+            } else if ("5".equals(orderBean.getStatus())) {
274 282
                 mViewBinding.tvCancellationOfOrder.setVisibility(View.VISIBLE);
275 283
                 mViewBinding.tvImmediatePayment.setVisibility(View.VISIBLE);
276 284
 
@@ -282,8 +290,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
282 290
                 mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
283 291
                 setTitle("待付款");
284 292
                 mViewBinding.llBottom.setVisibility(View.VISIBLE);
285
-            }
286
-            else {
293
+            } else {
287 294
                 mViewBinding.tvBuyAgain.setVisibility(View.VISIBLE);
288 295
                 mViewBinding.tvApplyForAfterSales.setVisibility(View.VISIBLE);
289 296
 
@@ -298,12 +305,12 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
298 305
                 mViewBinding.llBottom.setVisibility(View.GONE);
299 306
             }
300 307
 
301
-            if ("5".equals(orderBean.getPay_type())){
302
-                mViewBinding.tvTotalPrice.setText("积分"+orderBean.getTotal_price());
303
-                mViewBinding.tvCouponPrice.setText("积分"+orderBean.getCoupon_price());
304
-                mViewBinding.tvPayPostage.setText("积分"+orderBean.getPay_postage());
305
-                mViewBinding.btvPayPrice.setText("积分"+ orderBean.getPay_price());
306
-            }else {
308
+            if ("5".equals(orderBean.getPay_type())) {
309
+                mViewBinding.tvTotalPrice.setText("积分" + orderBean.getTotal_price());
310
+                mViewBinding.tvCouponPrice.setText("积分" + orderBean.getCoupon_price());
311
+                mViewBinding.tvPayPostage.setText("积分" + orderBean.getPay_postage());
312
+                mViewBinding.btvPayPrice.setText("积分" + orderBean.getPay_price());
313
+            } else {
307 314
                 mViewBinding.tvTotalPrice.setText(orderBean.getTotal_price());
308 315
                 mViewBinding.tvCouponPrice.setText(orderBean.getCoupon_price());
309 316
                 mViewBinding.tvPayPostage.setText(orderBean.getPay_postage());
@@ -314,7 +321,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
314 321
             if (StringUtil.isBlank(orderBean.getPay_time())) {
315 322
                 mViewBinding.layoutPaytime.setVisibility(View.GONE);
316 323
                 mViewBinding.tvPayType.setText("微信支付");
317
-            }else {
324
+            } else {
318 325
                 mViewBinding.tvTimeOfPayment.setText(orderBean.getPay_time());
319 326
                 mViewBinding.layoutPaytime.setVisibility(View.VISIBLE);
320 327
                 //支付方式 0=余额 1=微信 2=小程序 3=h5 4=支付宝
@@ -328,7 +335,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
328 335
                     mViewBinding.tvPayType.setText("h5");
329 336
                 } else if ("4".equals(orderBean.getPay_type())) {
330 337
                     mViewBinding.tvPayType.setText("支付宝");
331
-                }else if ("5".equals(orderBean.getPay_type())){
338
+                } else if ("5".equals(orderBean.getPay_type())) {
332 339
                     mViewBinding.tvPayType.setText("积分兑换");
333 340
                 }
334 341
             }
@@ -362,7 +369,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
362 369
 
363 370
         }
364 371
 
365
-        if (!StringsUtil.isEmpty(orderBean.getRefund_order_id())){
372
+        if (!StringsUtil.isEmpty(orderBean.getRefund_order_id())) {
366 373
 //            setTitle("已申请售后");
367 374
             mViewBinding.tvIsRefund.setVisibility(View.VISIBLE);
368 375
             mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
@@ -376,81 +383,81 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
376 383
         if (v == mViewBinding.tvRemindTheDelivery) {
377 384
             ToastUtils.showLong("已告知商家尽快发货");
378 385
         } else if (v == mViewBinding.tvImmediatePayment) {
379
-            if (status.equals("-2")){
386
+            if (status.equals("-2")) {
380 387
                 //去支付
381
-                Map<String,Object> map=new HashMap<>();
382
-                map.put("cost",orderBean.getCost());
383
-                map.put("coupon_price",orderBean.getCoupon_price());
384
-                map.put("create_time",orderBean.getCreate_time());
388
+                Map<String, Object> map = new HashMap<>();
389
+                map.put("cost", orderBean.getCost());
390
+                map.put("coupon_price", orderBean.getCoupon_price());
391
+                map.put("create_time", orderBean.getCreate_time());
385 392
                 map.put("give_coupon_ids", Collections.emptyList());
386
-                map.put("group_order_id",orderBean.getGroup_order_id());
387
-                map.put("group_order_sn",orderBean.getGroup_order_sn());
388
-                map.put("pay_postage",orderBean.getPay_postage());
389
-                map.put("pay_price",orderBean.getPay_price());
390
-                map.put("pay_type",orderBean.getPay_type());
391
-                map.put("real_name",orderBean.getReal_name());
392
-                map.put("total_num",orderBean.getTotal_num());
393
-                map.put("total_postage",orderBean.getTotal_postage());
394
-                map.put("total_price",orderBean.getTotal_price());
395
-                map.put("uid",orderBean.getUid());
396
-                map.put("user_address",orderBean.getUser_address());
397
-                map.put("user_phone",orderBean.getUser_phone());
398
-                PayActivity.launch(context,"1", JSON.toJSONString(map), orderBean.getGroup_order_id(), orderBean.getPay_price());
399
-
400
-            }else {
393
+                map.put("group_order_id", orderBean.getGroup_order_id());
394
+                map.put("group_order_sn", orderBean.getGroup_order_sn());
395
+                map.put("pay_postage", orderBean.getPay_postage());
396
+                map.put("pay_price", orderBean.getPay_price());
397
+                map.put("pay_type", orderBean.getPay_type());
398
+                map.put("real_name", orderBean.getReal_name());
399
+                map.put("total_num", orderBean.getTotal_num());
400
+                map.put("total_postage", orderBean.getTotal_postage());
401
+                map.put("total_price", orderBean.getTotal_price());
402
+                map.put("uid", orderBean.getUid());
403
+                map.put("user_address", orderBean.getUser_address());
404
+                map.put("user_phone", orderBean.getUser_phone());
405
+                PayActivity.launch(context, "1", JSON.toJSONString(map), orderBean.getGroup_order_id(), orderBean.getPay_price());
406
+
407
+            } else {
401 408
                 //去支付
402
-                Map<String,Object> map=new HashMap<>();
403
-                map.put("cost",obligationBeanList.getCost());
404
-                map.put("coupon_price",obligationBeanList.getCoupon_price());
405
-                map.put("create_time",obligationBeanList.getCreate_time());
409
+                Map<String, Object> map = new HashMap<>();
410
+                map.put("cost", obligationBeanList.getCost());
411
+                map.put("coupon_price", obligationBeanList.getCoupon_price());
412
+                map.put("create_time", obligationBeanList.getCreate_time());
406 413
                 map.put("give_coupon_ids", Collections.emptyList());
407
-                map.put("group_order_id",obligationBeanList.getGroup_order_id());
408
-                map.put("group_order_sn",obligationBeanList.getGroup_order_sn());
409
-                map.put("pay_postage",obligationBeanList.getPay_postage());
410
-                map.put("pay_price",obligationBeanList.getPay_price());
411
-                map.put("pay_type",obligationBeanList.getPay_type());
412
-                map.put("real_name",obligationBeanList.getReal_name());
413
-                map.put("total_num",obligationBeanList.getTotal_num());
414
-                map.put("total_postage",obligationBeanList.getTotal_postage());
415
-                map.put("total_price",obligationBeanList.getTotal_price());
416
-                map.put("uid",obligationBeanList.getUid());
417
-                map.put("user_address",obligationBeanList.getUser_address());
418
-                map.put("user_phone",obligationBeanList.getUser_phone());
419
-                PayActivity.launch(context,"1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price());
414
+                map.put("group_order_id", obligationBeanList.getGroup_order_id());
415
+                map.put("group_order_sn", obligationBeanList.getGroup_order_sn());
416
+                map.put("pay_postage", obligationBeanList.getPay_postage());
417
+                map.put("pay_price", obligationBeanList.getPay_price());
418
+                map.put("pay_type", obligationBeanList.getPay_type());
419
+                map.put("real_name", obligationBeanList.getReal_name());
420
+                map.put("total_num", obligationBeanList.getTotal_num());
421
+                map.put("total_postage", obligationBeanList.getTotal_postage());
422
+                map.put("total_price", obligationBeanList.getTotal_price());
423
+                map.put("uid", obligationBeanList.getUid());
424
+                map.put("user_address", obligationBeanList.getUser_address());
425
+                map.put("user_phone", obligationBeanList.getUser_phone());
426
+                PayActivity.launch(context, "1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price());
420 427
             }
421
-        }else if (v == mViewBinding.tvCancellationOfOrder){
422
-            if (status.equals("-2")){
428
+        } else if (v == mViewBinding.tvCancellationOfOrder) {
429
+            if (status.equals("-2")) {
423 430
                 mOrderViewModel.getCancelOrder(orderBean.getGroup_order_id());
424
-            }else {
431
+            } else {
425 432
                 //取消订单
426 433
                 mOrderViewModel.getCancelOrder(obligationBeanList.getGroup_order_id());
427 434
             }
428
-        }else if (v ==mViewBinding.tvCopy){
429
-            if (status.equals("99")){
430
-                CopyUtils.copy(context,obligationBeanList.getGroup_order_sn());
435
+        } else if (v == mViewBinding.tvCopy) {
436
+            if (status.equals("99")) {
437
+                CopyUtils.copy(context, obligationBeanList.getGroup_order_sn());
431 438
                 ToastUtils.showLong("复制成功");
432
-            }else {
433
-                CopyUtils.copy(context,orderBean.getOrder_sn());
439
+            } else {
440
+                CopyUtils.copy(context, orderBean.getOrder_sn());
434 441
                 ToastUtils.showLong("复制成功");
435 442
             }
436
-        }else if (v ==mViewBinding.tvCheckTheLogistics){
443
+        } else if (v == mViewBinding.tvCheckTheLogistics) {
437 444
             //查看物流
438
-            LogisticsActivity.launch(context,orderBean);
439
-        }else if (v == mViewBinding.tvConfirmReceipt){
445
+            LogisticsActivity.launch(context, orderBean);
446
+        } else if (v == mViewBinding.tvConfirmReceipt) {
440 447
             //确认收货
441 448
             mOrderViewModel.getTakeDeliveryOfGoods(orderBean.getOrder_id());
442
-        }else if (v ==  mViewBinding.tvBuyAgain){
449
+        } else if (v == mViewBinding.tvBuyAgain) {
443 450
             //再次购买
444
-            ProductDetailsActivity.launch(context,orderBean.getOrderProduct().get(0).getCart_info().getProduct().getProduct_id());
445
-        }else if (v ==mViewBinding.tvToEvaluate){
451
+            ProductDetailsActivity.launch(context, orderBean.getOrderProduct().get(0).getCart_info().getProduct().getProduct_id());
452
+        } else if (v == mViewBinding.tvToEvaluate) {
446 453
             //去评价
447
-            EvaluateActivity.launch(context,orderBean);
448
-        }else if (v == mViewBinding.tvApplyForAfterSales){
454
+            EvaluateActivity.launch(context, orderBean);
455
+        } else if (v == mViewBinding.tvApplyForAfterSales) {
449 456
             //申请售后
450 457
             ApplyForRefundOptionPageActivity.launch(context, orderBean);
451
-        }else if (v == mViewBinding.tvIsRefund){
458
+        } else if (v == mViewBinding.tvIsRefund) {
452 459
             //售后详情
453
-            AfterSalesOrderDateilsActivity.launch(this,orderBean.getRefund_order_id());
460
+            AfterSalesOrderDateilsActivity.launch(this, orderBean.getRefund_order_id());
454 461
         }
455 462
 
456 463
     }
@@ -469,4 +476,10 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
469 476
         intent.putExtra(INTENT_ORDER_STATUS, status);
470 477
         context.startActivity(intent);
471 478
     }
479
+
480
+    public static void launch(Context context, String orderId) {
481
+        Intent intent = new Intent(context, OrderDetailsActivity.class);
482
+        intent.putExtra(ORDER_ID, orderId);
483
+        context.startActivity(intent);
484
+    }
472 485
 }

File diff suppressed because it is too large
+ 1535 - 0
app/src/main/java/com/yihucha/hbyhc/presentation/order/model/OrderDetailBean.java


+ 43 - 16
app/src/main/java/com/yihucha/hbyhc/presentation/order/view_model/OrderViewModel.java

@@ -270,12 +270,16 @@ public class OrderViewModel extends BaseViewModel {
270 270
      *               <p>
271 271
      *               2: 评价
272 272
      */
273
-    @SuppressLint("CheckResult")
274 273
     public void getOrderList(int page, String status) {
274
+        getOrderList(page, 10, status);
275
+    }
276
+
277
+    @SuppressLint("CheckResult")
278
+    public void getOrderList(int page, int limit, String status) {
275 279
         Map<String, Object> map = new HashMap<>();
276 280
         map.put("page", page);
277 281
         map.put("status", status);
278
-        map.put("limit", "10");
282
+        map.put("limit", limit);
279 283
         OrderService orderService = NetworkApi.createService(OrderService.class);
280 284
         orderService.getOrderlist(map).compose(NetworkApi.applySchedulers(new BaseObserver<DataResponse<OrderListBean>>() {
281 285
             @Override
@@ -296,6 +300,28 @@ public class OrderViewModel extends BaseViewModel {
296 300
             }
297 301
         }));
298 302
     }
303
+    public MutableLiveData<OrderListBean.ListBean> orderDetail = new MutableLiveData<>();
304
+    /**
305
+     * 获取订单详情
306
+     */
307
+    @SuppressLint("CheckResult")
308
+    public void getOrderDetail(String orderId) {
309
+        OrderService service = NetworkApi.createService(OrderService.class);
310
+        service.getOrderDetail(orderId)
311
+                .compose(NetworkApi.applySchedulers(new BaseObserver<DataResponse<OrderListBean.ListBean>>() {
312
+            @Override
313
+            public void onSuccess(DataResponse<OrderListBean.ListBean> response) {
314
+                if (response.responseCode==200) {
315
+                    orderDetail.postValue(response.getData());
316
+                }
317
+            }
318
+
319
+            @Override
320
+            public void onFailure(Throwable e) {
321
+
322
+            }
323
+        }));
324
+    }
299 325
 
300 326
     /**
301 327
      * 待付款列表
@@ -359,22 +385,23 @@ public class OrderViewModel extends BaseViewModel {
359 385
         NetworkApi.createService(OrderService.class)
360 386
                 .getAfterSaleLogistics(orderId)
361 387
                 .compose(NetworkApi.applySchedulers(new BaseObserver<DataResponse<List<ExpressBean>>>() {
362
-            @Override
363
-            public void onSuccess(DataResponse<List<ExpressBean>> logisticsBeanDataResponse) {
364
-                if (logisticsBeanDataResponse.responseCode == 200) {
365
-                    logisticsBean.postValue(logisticsBeanDataResponse.getData());
366
-                } else {
367
-                    ToastUtils.showLong(logisticsBeanDataResponse.responseError);
368
-                }
388
+                    @Override
389
+                    public void onSuccess(DataResponse<List<ExpressBean>> logisticsBeanDataResponse) {
390
+                        if (logisticsBeanDataResponse.responseCode == 200) {
391
+                            logisticsBean.postValue(logisticsBeanDataResponse.getData());
392
+                        } else {
393
+                            ToastUtils.showLong(logisticsBeanDataResponse.responseError);
394
+                        }
395
+
396
+                        LogUtil.LogInfo("logisticsBean", JSON.toJSONString(logisticsBeanDataResponse));
397
+                    }
369 398
 
370
-                LogUtil.LogInfo("logisticsBean", JSON.toJSONString(logisticsBeanDataResponse));
371
-            }
372
-            @Override
373
-            public void onFailure(Throwable e) {
374
-                LogUtil.LogInfo("Throwable", e.getMessage());
399
+                    @Override
400
+                    public void onFailure(Throwable e) {
401
+                        LogUtil.LogInfo("Throwable", e.getMessage());
375 402
 
376
-            }
377
-        }));
403
+                    }
404
+                }));
378 405
 
379 406
     }
380 407
 

+ 45 - 0
app/src/main/java/com/yihucha/hbyhc/utils/HtmlUtils.java

@@ -0,0 +1,45 @@
1
+package com.yihucha.hbyhc.utils;
2
+
3
+import java.util.regex.Pattern;
4
+
5
+public class HtmlUtils {
6
+    /**
7
+     * html格式文本,转换成普通字符串输出
8
+     * @param inputString
9
+     * @return
10
+     */
11
+    public static String html2Text(String inputString) {
12
+        String htmlStr = inputString; // 含html标签的字符串
13
+        String textStr = "";
14
+        Pattern p_script;
15
+        java.util.regex.Matcher m_script;
16
+        Pattern p_style;
17
+        java.util.regex.Matcher m_style;
18
+        Pattern p_html;
19
+        java.util.regex.Matcher m_html;
20
+        Pattern p_html1;
21
+        java.util.regex.Matcher m_html1;
22
+        try {
23
+            String regEx_script = "<[//s]*?script[^>]*?>[//s//S]*?<[//s]*?///[//s]*?script[//s]*?>"; // 定义script的正则表达式{或<script[^>]*?>[//s//S]*?<///script>
24
+            String regEx_style = "<[//s]*?style[^>]*?>[//s//S]*?<[//s]*?///[//s]*?style[//s]*?>"; // 定义style的正则表达式{或<style[^>]*?>[//s//S]*?<///style>
25
+            String regEx_html = "<[^>]+>"; // 定义HTML标签的正则表达式
26
+            String regEx_html1 = "<[^>]+";
27
+            p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
28
+            m_script = p_script.matcher(htmlStr);
29
+            htmlStr = m_script.replaceAll(""); // 过滤script标签
30
+            p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
31
+            m_style = p_style.matcher(htmlStr);
32
+            htmlStr = m_style.replaceAll(""); // 过滤style标签
33
+            p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
34
+            m_html = p_html.matcher(htmlStr);
35
+            htmlStr = m_html.replaceAll(""); // 过滤html标签
36
+            p_html1 = Pattern.compile(regEx_html1, Pattern.CASE_INSENSITIVE);
37
+            m_html1 = p_html1.matcher(htmlStr);
38
+            htmlStr = m_html1.replaceAll(""); // 过滤html标签
39
+            textStr = htmlStr;
40
+        } catch (Exception e) {
41
+            System.err.println("Html2Text: " + e.getMessage());
42
+        }
43
+        return textStr;// 返回文本字符串
44
+    }
45
+}

+ 28 - 0
app/src/main/java/com/yihucha/hbyhc/utils/ToasterUtils.kt

@@ -0,0 +1,28 @@
1
+package com.yihucha.hbyhc.utils
2
+
3
+import android.view.Gravity
4
+import com.hjq.toast.ToastParams
5
+import com.hjq.toast.Toaster
6
+import com.hjq.toast.style.BlackToastStyle
7
+import com.yihucha.hbyhc.R
8
+
9
+/**
10
+ *  author : zhangbing
11
+ *  time   : 2024/2/27 11:09
12
+ *  com.yihucha.hbyhc.utils
13
+ */
14
+object ToasterUtils {
15
+    @JvmStatic
16
+    fun showBlack(msg:String){
17
+        val params = ToastParams()
18
+        params.text = msg
19
+        params.style = BlackToastStyle()
20
+        Toaster.show(params)
21
+    }
22
+    @JvmStatic
23
+    fun showCustomView(msg:String,id:Int){
24
+        Toaster.setView(id)
25
+        Toaster.setGravity(Gravity.CENTER)
26
+        Toaster.show(msg)
27
+    }
28
+}

+ 10 - 0
app/src/main/res/drawable/shape_gradient.xml

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <gradient
4
+        android:angle="180"
5
+        android:endColor="@color/black_333333"
6
+        android:startColor="@color/black_333333"
7
+        />
8
+
9
+    <corners android:radius="10dp" />
10
+</shape>

+ 4 - 2
app/src/main/res/layout/activity_apply_for_refund_option_page.xml

@@ -2,6 +2,7 @@
2 2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     android:layout_width="match_parent"
4 4
     android:layout_height="match_parent"
5
+    xmlns:tools="http://schemas.android.com/tools"
5 6
     android:background="@color/white_f8f8f8"
6 7
     android:orientation="vertical">
7 8
 
@@ -120,10 +121,11 @@
120 121
             android:id="@+id/ll_exchange_products"
121 122
             android:layout_marginTop="20dp"
122 123
             android:layout_width="match_parent"
123
-            android:visibility="visible"
124
+            android:visibility="gone"
124 125
             android:layout_height="wrap_content"
125 126
             android:gravity="center_vertical"
126
-            android:orientation="horizontal">
127
+            android:orientation="horizontal"
128
+            >
127 129
 
128 130
             <ImageView
129 131
                 android:layout_width="wrap_content"

+ 0 - 1
app/src/main/res/layout/activity_red_integral_new.xml

@@ -50,7 +50,6 @@
50 50
                         android:id="@+id/tv_name_integral"
51 51
                         android:layout_width="wrap_content"
52 52
                         android:layout_height="wrap_content"
53
-                        android:layout_marginTop="30dp"
54 53
                         android:text="红积分"
55 54
                         android:textColor="@color/white"
56 55
                         android:textSize="14sp" />

+ 2 - 2
app/src/main/res/layout/fragment_mine.xml

@@ -124,10 +124,10 @@
124 124
                         android:layout_width="wrap_content"
125 125
                         android:layout_height="wrap_content"
126 126
                         android:layout_weight="1"
127
-                        android:drawableTop="@mipmap/icon_mine_lvf"
127
+                        android:drawableTop="@mipmap/icon_mine_hjf"
128 128
                         android:drawablePadding="8dp"
129 129
                         android:gravity="center"
130
-                        android:text="我的绿积分"
130
+                        android:text="我的积分"
131 131
                         android:textColor="@color/black_333333"
132 132
                         android:textSize="12sp" />
133 133
 

+ 4 - 1
app/src/main/res/layout/item_message.xml

@@ -41,6 +41,9 @@
41 41
         android:text="这是公告内容这是公告内容这是公告这是公告内容这是公告内容这是公告这是公告内容…"
42 42
         android:textColor="@color/gray_999999"
43 43
         android:layout_marginTop="5dp"
44
-        android:textSize="13sp" />
44
+        android:textSize="13sp"
45
+        android:maxLines="1"
46
+        android:ellipsize="end"
47
+        />
45 48
 
46 49
 </RelativeLayout>

+ 3 - 1
app/src/main/res/layout/item_new_red_integral.xml

@@ -5,7 +5,9 @@
5 5
     android:layout_height="80dp"
6 6
     android:background="@color/white"
7 7
     android:orientation="horizontal"
8
-    android:padding="16dp">
8
+    android:padding="16dp"
9
+    android:id="@+id/parent_view"
10
+    >
9 11
 
10 12
     <TextView
11 13
         android:id="@+id/tv_integral"

+ 27 - 0
app/src/main/res/layout/layout_add_card_success.xml

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:layout_width="wrap_content"
4
+    android:layout_height="wrap_content"
5
+    android:background="@drawable/shape_gradient"
6
+    android:layout_gravity="center_horizontal"
7
+    android:orientation="vertical"
8
+    android:paddingLeft="30dp"
9
+    android:paddingRight="30dp"
10
+    android:paddingTop="19dp"
11
+    android:paddingBottom="20dp"
12
+    android:alpha="0.5"
13
+    >
14
+    <ImageView
15
+        android:layout_width="30dp"
16
+        android:layout_height="30dp"
17
+        android:layout_gravity="center_horizontal"
18
+        android:src="@mipmap/icon_add_card_success" />
19
+    <TextView
20
+        android:id="@android:id/message"
21
+        android:layout_width="wrap_content"
22
+        android:layout_height="wrap_content"
23
+        android:layout_marginTop="16dp"
24
+        android:textColor="#FFFFFFFF"
25
+        android:layout_gravity="center_horizontal"
26
+        android:textSize="15sp" />
27
+</LinearLayout>

BIN
app/src/main/res/mipmap-xxxhdpi/icon_add_card_success.png


BIN
app/src/main/res/mipmap-xxxhdpi/icon_mine_hjf.png