Pārlūkot izejas kodu

2024-2-23 代码备份
红积分页面功能开发、接口调试完成
支付页面调整,增加好友代付选项
代付页面UI完成一部分

zhangbing 2 gadi atpakaļ
vecāks
revīzija
5946ce183a

+ 9 - 2
app/src/main/AndroidManifest.xml

@@ -78,10 +78,17 @@
78 78
         tools:replace="android:theme"
79 79
         tools:targetApi="31">
80 80
         <activity
81
+            android:name=".presentation.pay.ShareFriendsPayActivity"
82
+            android:label="代付详情"
83
+            android:exported="false" />
84
+        <activity
85
+            android:name=".presentation.integral.NewRedIntegralActivity"
86
+            android:exported="false"
87
+            android:label="我的红积分" />
88
+        <activity
81 89
             android:name=".presentation.mine.TixianDetailActivity"
82 90
             android:exported="false"
83
-            android:label="详情"
84
-            />
91
+            android:label="详情" />
85 92
         <activity
86 93
             android:name=".presentation.mine.CommissionDetailActivity"
87 94
             android:exported="false"

+ 3 - 0
app/src/main/java/com/yihucha/hbyhc/base/BaseActivity.java

@@ -2,6 +2,7 @@ package com.yihucha.hbyhc.base;
2 2
 
3 3
 import android.app.Activity;
4 4
 import android.app.Dialog;
5
+import android.content.pm.ActivityInfo;
5 6
 import android.os.Build;
6 7
 import android.os.Bundle;
7 8
 import android.util.Log;
@@ -45,6 +46,8 @@ public abstract class BaseActivity extends AppCompatActivity  {
45 46
         ActivityStack.getScreenManager().pushActivity(this);
46 47
         //禁止大字体和显示大小
47 48
         DispUtil.disabledDisplayDpiChange(this.getResources());
49
+        //所有页面强制竖屏展示
50
+//        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
48 51
         //禁止大字体
49 52
 //        DispUtil.disabledDisplayDpiChange(this.getResources());
50 53
 //        initView();

+ 3 - 0
app/src/main/java/com/yihucha/hbyhc/network/service/UserService.java

@@ -18,6 +18,7 @@ import com.yihucha.hbyhc.presentation.annuity.model.YanglaojinLogXXBean;
18 18
 import com.yihucha.hbyhc.presentation.integral.model.IntegralListBean;
19 19
 import com.yihucha.hbyhc.presentation.integral.model.RedIntegralBean;
20 20
 import com.yihucha.hbyhc.presentation.integral.model.RedIntegralBean2;
21
+import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean;
21 22
 import com.yihucha.hbyhc.presentation.invitation.model.AccumulatedincomeBean;
22 23
 import com.yihucha.hbyhc.presentation.invitation.model.InviteFriendsClassifyBean;
23 24
 import com.yihucha.hbyhc.presentation.invitation.model.InviteFriendsPicBean;
@@ -557,6 +558,8 @@ public interface UserService {
557 558
     @POST("api/user/relation/batch/delete")
558 559
     Observable<DataResponse> cancleCollect(@Body CancleCollectBean body);
559 560
 
561
+    @GET("api/user/green_integral_list")
562
+    Observable<DataResponse<List<RedIntegralListBean>>> getRedIntegralBean(@QueryMap Map<String,Object> map);
560 563
 //    /**
561 564
 //     *检测用户年费状态
562 565
 //     * @param

+ 191 - 0
app/src/main/java/com/yihucha/hbyhc/presentation/integral/NewRedIntegralActivity.java

@@ -0,0 +1,191 @@
1
+package com.yihucha.hbyhc.presentation.integral;
2
+
3
+import android.content.Context;
4
+import android.content.Intent;
5
+import android.graphics.Color;
6
+import android.os.Build;
7
+import android.os.Bundle;
8
+import android.os.Handler;
9
+import android.view.View;
10
+
11
+import androidx.lifecycle.Observer;
12
+import androidx.lifecycle.ViewModelProvider;
13
+import androidx.recyclerview.widget.DividerItemDecoration;
14
+import androidx.recyclerview.widget.LinearLayoutManager;
15
+
16
+import com.lcodecore.tkrefreshlayout.RefreshListenerAdapter;
17
+import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout;
18
+
19
+import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity;
20
+import com.yihucha.hbyhc.config.Constants;
21
+import com.yihucha.hbyhc.databinding.ActivityRedIntegralNewBinding;
22
+import com.yihucha.hbyhc.presentation.integral.adapter.NewRedIntegralAdapter;
23
+import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean;
24
+import com.yihucha.hbyhc.presentation.invitation.view_model.InviteViewModel;
25
+import com.yihucha.hbyhc.presentation.mine.view_model.MineSpreadInfo;
26
+import com.yihucha.hbyhc.presentation.mine.view_model.MineViewModel;
27
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
28
+import com.yihucha.hbyhc.utils.MVUtils;
29
+
30
+import java.util.ArrayList;
31
+import java.util.List;
32
+
33
+public class NewRedIntegralActivity extends ViewBindingTitleBaseActivity<ActivityRedIntegralNewBinding>
34
+        implements View.OnClickListener {
35
+    private NewRedIntegralAdapter adapter;
36
+    private List<RedIntegralListBean> beans = new ArrayList<>();
37
+    private int page = 1;
38
+    private InviteViewModel mInviteViewModel;
39
+    private MineViewModel mMineViewModel;
40
+    private boolean isIncome = true;
41
+
42
+    @Override
43
+    protected void onCreate(Bundle savedInstanceState) {
44
+        super.onCreate(savedInstanceState);
45
+        initView();
46
+        initData();
47
+        initListener();
48
+    }
49
+
50
+    private void initData() {
51
+        if (!"".equals(MVUtils.getString(Constants.TOKEN))) {
52
+            mMineViewModel.getSpreadInfoYhc();
53
+            loadData();
54
+        }
55
+        mMineViewModel.spreadInfo.observe(this, mineSpreadInfo -> {
56
+            mViewBinding.tvRedIntegral.setText(mineSpreadInfo.getGreenIntegral());
57
+        });
58
+        mInviteViewModel.redIntegralListBean.observe(this, datas -> {
59
+//            if (EmptyCheckUtils.isEmpty(datas)) page--; // 如果加载不成功,回滚分页
60
+            System.out.println(datas.size());
61
+            beans.addAll(datas);
62
+            System.out.println(beans.size());
63
+            if (EmptyCheckUtils.isNotEmpty(beans)) {
64
+                mViewBinding.layoutNoData.llNotFound.setVisibility(View.GONE);
65
+                mViewBinding.lvIntegral.setVisibility(View.VISIBLE);
66
+                adapter.setDataBeans(beans);
67
+            } else {
68
+                mViewBinding.layoutNoData.llNotFound.setVisibility(View.VISIBLE);
69
+                mViewBinding.lvIntegral.setVisibility(View.GONE);
70
+            }
71
+        });
72
+        mInviteViewModel.failed.observe(this, s -> {
73
+            if (EmptyCheckUtils.isNotEmpty(beans)) {
74
+                mViewBinding.layoutNoData.llNotFound.setVisibility(View.VISIBLE);
75
+                mViewBinding.lvIntegral.setVisibility(View.GONE);
76
+            }
77
+        });
78
+    }
79
+
80
+    private void loadData() {
81
+        //加载红积分列表数据
82
+        mInviteViewModel.getRedIntegralList(page, 10, isIncome ? 1 : 2);
83
+    }
84
+
85
+    private void initView() {
86
+        mInviteViewModel = new ViewModelProvider(this).get(InviteViewModel.class);
87
+        mMineViewModel = new ViewModelProvider(this).get(MineViewModel.class);
88
+        LinearLayoutManager manager = new LinearLayoutManager(this) {
89
+            @Override
90
+            public boolean canScrollVertically() {
91
+                return false;
92
+            }
93
+        };
94
+        mViewBinding.lvIntegral.setLayoutManager(manager);
95
+        mViewBinding.lvIntegral.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
96
+        if (adapter == null) {
97
+            adapter = new NewRedIntegralAdapter(beans);
98
+        }
99
+        mViewBinding.lvIntegral.setAdapter(adapter);
100
+        mViewBinding.refreshLayout.setEnableRefresh(false);
101
+        mViewBinding.refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
102
+            @Override
103
+            public void onLoadMore(TwinklingRefreshLayout refreshLayout) {
104
+                super.onLoadMore(refreshLayout);
105
+                new Handler().postDelayed(new Runnable() {
106
+                    @Override
107
+                    public void run() {
108
+                        page++;
109
+                        if (!"".equals(MVUtils.getString(Constants.TOKEN)))
110
+                            loadData();
111
+                        refreshLayout.finishLoadmore();
112
+                    }
113
+                }, 1000);
114
+            }
115
+        });
116
+    }
117
+
118
+    private void initListener() {
119
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
120
+            mViewBinding.scrollView.setOnScrollChangeListener((View.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
121
+                int[] location = new int[2];
122
+                mViewBinding.layoutCenterSelector.getLocationOnScreen(location);
123
+                System.out.println(location[0] + ":" + location[1]);
124
+                if (location[1] <= mTitleView.getBottom()) {
125
+                    mViewBinding.layoutTopSelector.setVisibility(View.VISIBLE);
126
+                } else {
127
+                    mViewBinding.layoutTopSelector.setVisibility(View.GONE);
128
+                }
129
+            });
130
+        }
131
+        mViewBinding.titleIncome.setOnClickListener(this);
132
+        mViewBinding.titleIncomeTop.setOnClickListener(this);
133
+        mViewBinding.titlePay.setOnClickListener(this);
134
+        mViewBinding.titlePayTop.setOnClickListener(this);
135
+    }
136
+
137
+    public static void launch(Context context, Bundle bundle) {
138
+        Intent intent = new Intent(context, NewRedIntegralActivity.class);
139
+        intent.putExtra("data", bundle);
140
+        context.startActivity(intent);
141
+    }
142
+
143
+    public static void launch(Context context) {
144
+        Intent intent = new Intent(context, NewRedIntegralActivity.class);
145
+        context.startActivity(intent);
146
+    }
147
+
148
+    @Override
149
+    public void onClick(View v) {
150
+        if (v == mViewBinding.titleIncome || v == mViewBinding.titleIncomeTop) {
151
+            if (isIncome) return;
152
+            beans.clear();
153
+            isIncome = true;
154
+            resetSelector();
155
+            page = 1;
156
+            loadData();
157
+        } else if (v == mViewBinding.titlePay || v == mViewBinding.titlePayTop) {
158
+            if (!isIncome) return;
159
+            beans.clear();
160
+            isIncome = false;
161
+            resetSelector();
162
+            page = 1;
163
+            loadData();
164
+        }
165
+    }
166
+
167
+    private void resetSelector() {
168
+        if (isIncome) {
169
+            mViewBinding.titlePay.setTextColor(Color.parseColor("#333333"));
170
+            mViewBinding.linePay.setVisibility(View.INVISIBLE);
171
+            mViewBinding.titlePayTop.setTextColor(Color.parseColor("#333333"));
172
+            mViewBinding.linePayTop.setVisibility(View.INVISIBLE);
173
+
174
+            mViewBinding.titleIncome.setTextColor(Color.parseColor("#fe0032"));
175
+            mViewBinding.lineIncome.setVisibility(View.VISIBLE);
176
+            mViewBinding.titleIncomeTop.setTextColor(Color.parseColor("#fe0032"));
177
+            mViewBinding.lineIncomeTop.setVisibility(View.VISIBLE);
178
+
179
+        } else {
180
+            mViewBinding.titleIncome.setTextColor(Color.parseColor("#333333"));
181
+            mViewBinding.lineIncome.setVisibility(View.INVISIBLE);
182
+            mViewBinding.titleIncomeTop.setTextColor(Color.parseColor("#333333"));
183
+            mViewBinding.lineIncomeTop.setVisibility(View.INVISIBLE);
184
+
185
+            mViewBinding.titlePay.setTextColor(Color.parseColor("#fe0032"));
186
+            mViewBinding.linePay.setVisibility(View.VISIBLE);
187
+            mViewBinding.titlePayTop.setTextColor(Color.parseColor("#fe0032"));
188
+            mViewBinding.linePayTop.setVisibility(View.VISIBLE);
189
+        }
190
+    }
191
+}

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

@@ -0,0 +1,53 @@
1
+package com.yihucha.hbyhc.presentation.integral.adapter
2
+
3
+import android.annotation.SuppressLint
4
+import android.view.LayoutInflater
5
+import android.view.View
6
+import android.view.ViewGroup
7
+import android.widget.TextView
8
+import androidx.recyclerview.widget.RecyclerView.Adapter
9
+import androidx.recyclerview.widget.RecyclerView.ViewHolder
10
+import com.yihucha.hbyhc.R
11
+import com.yihucha.hbyhc.databinding.ItemNewRedIntegralBinding
12
+import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean
13
+import com.yihucha.hbyhc.utils.EmptyCheckUtils
14
+
15
+/**
16
+ *  author : zhangbing
17
+ *  time   : 2024/2/23 10:51
18
+ *  com.yihucha.hbyhc.presentation.integral.adapter
19
+ */
20
+class NewRedIntegralAdapter(var beans: List<RedIntegralListBean>) :
21
+    Adapter<NewRedIntegralAdapter.RedIntegralHolder>() {
22
+
23
+    fun setDataBeans(datas: List<RedIntegralListBean>){
24
+        this.beans = datas
25
+        notifyDataSetChanged()
26
+    }
27
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RedIntegralHolder {
28
+        return RedIntegralHolder(
29
+            LayoutInflater
30
+                .from(parent.context)
31
+                .inflate(R.layout.item_new_red_integral, parent, false)
32
+        )
33
+    }
34
+
35
+    override fun getItemCount(): Int {
36
+        return if (EmptyCheckUtils.isEmpty(beans)) 0 else beans.size*10
37
+    }
38
+
39
+    @SuppressLint("SetTextI18n")
40
+    override fun onBindViewHolder(holder: RedIntegralHolder, position: Int) {
41
+        val bean = beans[position%3]
42
+        holder.tvIntegral.text = "${if (bean.pm == "1") "+" else "-"}${bean.rewardSocre}"
43
+        holder.tvDescription.text = bean.mark
44
+        holder.tvTime.text = bean.createTime
45
+    }
46
+
47
+
48
+    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)
52
+    }
53
+}

+ 72 - 0
app/src/main/java/com/yihucha/hbyhc/presentation/integral/model/RedIntegralListBean.java

@@ -0,0 +1,72 @@
1
+package com.yihucha.hbyhc.presentation.integral.model;
2
+
3
+import com.google.gson.annotations.SerializedName;
4
+
5
+/**
6
+ * author : zhangbing
7
+ * time   : 2024/2/23 10:35
8
+ * com.yihucha.hbyhc.presentation.integral.model
9
+ */
10
+public class RedIntegralListBean {
11
+
12
+    @SerializedName("id")
13
+    private String id;
14
+    @SerializedName("mark")
15
+    private String mark;
16
+    @SerializedName("reward_socre")
17
+    private String rewardSocre;
18
+    @SerializedName("pm")
19
+    private String pm;
20
+    @SerializedName("create_time")
21
+    private String createTime;
22
+    @SerializedName("order_id")
23
+    private String orderId;
24
+
25
+    public String getId() {
26
+        return id;
27
+    }
28
+
29
+    public void setId(String id) {
30
+        this.id = id;
31
+    }
32
+
33
+    public String getMark() {
34
+        return mark;
35
+    }
36
+
37
+    public void setMark(String mark) {
38
+        this.mark = mark;
39
+    }
40
+
41
+    public String getRewardSocre() {
42
+        return rewardSocre;
43
+    }
44
+
45
+    public void setRewardSocre(String rewardSocre) {
46
+        this.rewardSocre = rewardSocre;
47
+    }
48
+
49
+    public String getPm() {
50
+        return pm;
51
+    }
52
+
53
+    public void setPm(String pm) {
54
+        this.pm = pm;
55
+    }
56
+
57
+    public String getCreateTime() {
58
+        return createTime;
59
+    }
60
+
61
+    public void setCreateTime(String createTime) {
62
+        this.createTime = createTime;
63
+    }
64
+
65
+    public String getOrderId() {
66
+        return orderId;
67
+    }
68
+
69
+    public void setOrderId(String orderId) {
70
+        this.orderId = orderId;
71
+    }
72
+}

+ 29 - 0
app/src/main/java/com/yihucha/hbyhc/presentation/invitation/view_model/InviteViewModel.java

@@ -17,6 +17,7 @@ import com.yihucha.hbyhc.network.request_bean.ClassifyImgesListRequest;
17 17
 import com.yihucha.hbyhc.network.request_bean.GenerateImagesRequest;
18 18
 import com.yihucha.hbyhc.network.request_bean.SpreadNumberRequest;
19 19
 import com.yihucha.hbyhc.network.service.UserService;
20
+import com.yihucha.hbyhc.presentation.integral.model.RedIntegralListBean;
20 21
 import com.yihucha.hbyhc.presentation.invitation.model.AccumulatedincomeBean;
21 22
 import com.yihucha.hbyhc.presentation.invitation.model.InviteFriendsClassifyBean;
22 23
 import com.yihucha.hbyhc.presentation.invitation.model.InviteFriendsPicBean;
@@ -51,6 +52,7 @@ import java.util.Map;
51 52
  * note:
52 53
  */
53 54
 public class InviteViewModel extends BaseViewModel {
55
+    public MutableLiveData<List<RedIntegralListBean>> redIntegralListBean = new MutableLiveData<>();//红积分收入、支出
54 56
     public MutableLiveData<UserInfoModel> userModel = new MutableLiveData<>();//用户资料
55 57
 
56 58
     public MutableLiveData<InviteJavaBean> mInviteJavaData = new MutableLiveData<>();//java我的邀请数据
@@ -657,6 +659,33 @@ public class InviteViewModel extends BaseViewModel {
657 659
     }
658 660
 
659 661
     /**
662
+     * 红积分收入、支出列表
663
+     */
664
+    @SuppressLint("CheckResult")
665
+    public void getRedIntegralList(int page,int limit,int pm) {
666
+        Map<String,Object> map = new HashMap<>();
667
+        map.put("pm",pm);
668
+        map.put("page",page);
669
+        map.put("limit",limit);
670
+        UserService userService = NetworkApi.createService(UserService.class);
671
+        userService.getRedIntegralBean(map).compose(NetworkApi.applySchedulers(new BaseObserver<DataResponse<List<RedIntegralListBean>>>() {
672
+            @Override
673
+            public void onSuccess(DataResponse<List<RedIntegralListBean>> response) {
674
+                if (response.responseCode == 200) {
675
+                    redIntegralListBean.postValue(response.getData());
676
+                }else {
677
+                    failed.postValue("getRedIntegralList");
678
+                }
679
+            }
680
+
681
+            @Override
682
+            public void onFailure(Throwable e) {
683
+                failed.postValue("getRedIntegralList");
684
+            }
685
+        }));
686
+    }
687
+
688
+    /**
660 689
      * 检测用户年费状态
661 690
      */
662 691
 //    public void getAccountServiceFee() {

+ 4 - 3
app/src/main/java/com/yihucha/hbyhc/presentation/mine/MineFragment.java

@@ -19,6 +19,7 @@ import com.yihucha.hbyhc.config.HttpUrl;
19 19
 import com.yihucha.hbyhc.databinding.FragmentMineBinding;
20 20
 import com.yihucha.hbyhc.presentation.annuity.AnnuityActivity;
21 21
 import com.yihucha.hbyhc.presentation.integral.MyIntegralActivity;
22
+import com.yihucha.hbyhc.presentation.integral.NewRedIntegralActivity;
22 23
 import com.yihucha.hbyhc.presentation.integral.RedIntegralActivity;
23 24
 import com.yihucha.hbyhc.presentation.invitation.InviteFriendsActivity;
24 25
 import com.yihucha.hbyhc.presentation.invitation.MyInvitationActivity;
@@ -26,6 +27,7 @@ import com.yihucha.hbyhc.presentation.mine.model.MyInvitationBean;
26 27
 import com.yihucha.hbyhc.presentation.mine.model.OrderQuantityBean;
27 28
 import com.yihucha.hbyhc.presentation.mine.model.UserInfoModel;
28 29
 import com.yihucha.hbyhc.presentation.mine.model.YanglaojinBean;
30
+import com.yihucha.hbyhc.presentation.mine.view_model.MineSpreadInfo;
29 31
 import com.yihucha.hbyhc.presentation.mine.view_model.MineViewModel;
30 32
 import com.yihucha.hbyhc.presentation.order.AfterSalesOrderListActivity;
31 33
 import com.yihucha.hbyhc.presentation.order.OrderActivity;
@@ -65,7 +67,6 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
65 67
         initClick();
66 68
         return root;
67 69
     }
68
-
69 70
     private void initData() {
70 71
         if (!"".equals(MVUtils.getString(Constants.TOKEN))) {
71 72
             //用户信息
@@ -284,8 +285,8 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
284 285
 //            MyInvitationActivity.launch(getActivity());
285 286
             MyCommissionActivity.launch(getActivity());
286 287
         } else if (view == binding.tvMineLjf) {
287
-            //绿积分
288
-            MyIntegralActivity.launch(getActivity());
288
+            //绿积分  原红积分页面
289
+            NewRedIntegralActivity.launch(getActivity());
289 290
         } else if (view == binding.llConnectUs) {
290 291
 
291 292
             String appId = "wxbf753066ac8686ba";

+ 12 - 1
app/src/main/java/com/yihucha/hbyhc/presentation/pay/PayActivity.java

@@ -130,6 +130,7 @@ public class PayActivity extends ViewBindingTitleBaseActivity<ActivityPayBinding
130 130
 
131 131
     private void initClick() {
132 132
         mViewBinding.ivWx.setOnClickListener(this);
133
+        mViewBinding.ivFrendsPay.setOnClickListener(this);
133 134
         mViewBinding.ivZfb.setOnClickListener(this);
134 135
         mViewBinding.tvImmediatePayment.setOnClickListener(this);
135 136
     }
@@ -144,11 +145,19 @@ public class PayActivity extends ViewBindingTitleBaseActivity<ActivityPayBinding
144 145
         if (v == mViewBinding.ivWx) {
145 146
             //点击微信
146 147
             mViewBinding.ivWx.setImageResource(R.mipmap.agreement_checked);
148
+            mViewBinding.ivFrendsPay.setImageResource(R.mipmap.agreement_unselected);
147 149
             mViewBinding.ivZfb.setImageResource(R.mipmap.agreement_unselected);
148 150
             mFlagPay = "1";
151
+        } else if (v == mViewBinding.ivFrendsPay) {
152
+            //好友代付
153
+            mViewBinding.ivFrendsPay.setImageResource(R.mipmap.agreement_checked);
154
+            mViewBinding.ivWx.setImageResource(R.mipmap.agreement_unselected);
155
+            mViewBinding.ivZfb.setImageResource(R.mipmap.agreement_unselected);
156
+            mFlagPay = "";
149 157
         } else if (v == mViewBinding.ivZfb) {
150 158
             //点击支付宝
151 159
             mViewBinding.ivWx.setImageResource(R.mipmap.agreement_unselected);
160
+            mViewBinding.ivFrendsPay.setImageResource(R.mipmap.agreement_unselected);
152 161
             mViewBinding.ivZfb.setImageResource(R.mipmap.agreement_checked);
153 162
             mFlagPay = "2";
154 163
         } else if (v == mViewBinding.tvImmediatePayment) {
@@ -156,12 +165,14 @@ public class PayActivity extends ViewBindingTitleBaseActivity<ActivityPayBinding
156 165
             //立即支付
157 166
             if (mFlagPay.equals("1")) {
158 167
                 payViewModel.getPayWx();
159
-            } else {
168
+            } else if (mFlagPay.equals("2")){
160 169
                 //支付宝支付
161 170
                 Map<String, Object> map = new HashMap<>();
162 171
                 map.put("oid", orderId);
163 172
                 map.put("type", "ALI");
164 173
                 payViewModel.getPay(map);
174
+            }else {
175
+                //好友代付
165 176
             }
166 177
         }
167 178
         super.onClick(v);

+ 12 - 0
app/src/main/java/com/yihucha/hbyhc/presentation/pay/ShareFriendsPayActivity.kt

@@ -0,0 +1,12 @@
1
+package com.yihucha.hbyhc.presentation.pay
2
+
3
+import androidx.appcompat.app.AppCompatActivity
4
+import android.os.Bundle
5
+import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity
6
+import com.yihucha.hbyhc.databinding.ActivityShareFriendsPayBinding
7
+
8
+class ShareFriendsPayActivity : ViewBindingTitleBaseActivity<ActivityShareFriendsPayBinding>() {
9
+    override fun onCreate(savedInstanceState: Bundle?) {
10
+        super.onCreate(savedInstanceState)
11
+    }
12
+}

+ 31 - 0
app/src/main/res/layout/activity_pay.xml

@@ -108,6 +108,37 @@
108 108
             android:gravity="center_vertical"
109 109
             android:layout_marginRight="13dp"
110 110
             android:layout_marginLeft="13dp"
111
+            android:orientation="horizontal">
112
+
113
+            <ImageView
114
+                android:layout_width="wrap_content"
115
+                android:layout_height="wrap_content"
116
+                android:src="@mipmap/icon_frends_pay"/>
117
+
118
+            <TextView
119
+                android:layout_width="0dp"
120
+                android:layout_weight="1"
121
+                android:layout_height="wrap_content"
122
+                android:layout_marginLeft="8dp"
123
+                android:textSize="15sp"
124
+                android:textColor="@color/black_333333"
125
+                android:text="好友代付"/>
126
+
127
+            <ImageView
128
+                android:id="@+id/iv_frends_pay"
129
+                android:layout_width="wrap_content"
130
+                android:layout_height="wrap_content"
131
+                android:padding="5dp"
132
+                android:src="@mipmap/agreement_unselected"/>
133
+        </LinearLayout>
134
+        <LinearLayout
135
+            android:layout_width="match_parent"
136
+            android:layout_height="wrap_content"
137
+            android:layout_marginTop="16dp"
138
+            android:layout_marginBottom="16dp"
139
+            android:gravity="center_vertical"
140
+            android:layout_marginRight="13dp"
141
+            android:layout_marginLeft="13dp"
111 142
             android:visibility="gone"
112 143
             android:orientation="horizontal">
113 144
 

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

@@ -0,0 +1,203 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:background="@color/white_f8f8f8"
8
+    android:paddingLeft="16dp"
9
+    android:paddingRight="16dp"
10
+    tools:context=".presentation.integral.RedIntegralActivity">
11
+
12
+    <com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout
13
+        android:id="@+id/refresh_layout"
14
+        android:layout_width="match_parent"
15
+        android:layout_height="match_parent"
16
+        >
17
+
18
+        <androidx.core.widget.NestedScrollView
19
+            android:id="@+id/scrollView"
20
+            android:layout_width="match_parent"
21
+            android:layout_height="match_parent"
22
+            android:fillViewport="true">
23
+
24
+            <androidx.constraintlayout.widget.ConstraintLayout
25
+                android:layout_width="match_parent"
26
+                android:layout_height="wrap_content"
27
+                android:paddingTop="16dp"
28
+                android:layout_below="@+id/imgv_top_bg">
29
+
30
+                <com.yihucha.hbyhc.view.RoundCornerImageView
31
+                    android:id="@+id/imgv_top_bg"
32
+                    android:layout_width="match_parent"
33
+                    android:layout_height="wrap_content"
34
+                    android:scaleType="centerCrop"
35
+                    android:src="@mipmap/bg_red_integral"
36
+                    app:layout_constraintLeft_toLeftOf="parent"
37
+                    app:layout_constraintTop_toTopOf="parent"
38
+                    app:rciv_radius="10dp" />
39
+
40
+                <LinearLayout
41
+                    android:layout_width="match_parent"
42
+                    android:layout_height="wrap_content"
43
+                    android:orientation="vertical"
44
+                    android:paddingLeft="16dp"
45
+                    app:layout_constraintTop_toTopOf="@+id/imgv_top_bg"
46
+                    app:layout_constraintBottom_toBottomOf="@+id/imgv_top_bg"
47
+                    >
48
+
49
+                    <TextView
50
+                        android:id="@+id/tv_name_integral"
51
+                        android:layout_width="wrap_content"
52
+                        android:layout_height="wrap_content"
53
+                        android:layout_marginTop="30dp"
54
+                        android:text="红积分"
55
+                        android:textColor="@color/white"
56
+                        android:textSize="14sp" />
57
+
58
+                    <com.yihucha.hbyhc.view.BoldText
59
+                        android:id="@+id/tv_red_integral"
60
+                        android:layout_width="wrap_content"
61
+                        android:layout_height="wrap_content"
62
+                        android:layout_marginTop="5dp"
63
+                        android:ellipsize="end"
64
+                        android:text="0"
65
+                        android:textColor="@color/white"
66
+                        android:textSize="32sp" />
67
+                </LinearLayout>
68
+                <androidx.constraintlayout.widget.ConstraintLayout
69
+                    android:id="@+id/layout_center_selector"
70
+                    android:layout_width="match_parent"
71
+                    android:layout_height="60dp"
72
+                    app:layout_constraintTop_toBottomOf="@+id/imgv_top_bg">
73
+
74
+                    <com.yihucha.hbyhc.view.BoldText
75
+                        android:id="@+id/title_income"
76
+                        android:layout_width="0dp"
77
+                        android:layout_height="wrap_content"
78
+                        android:layout_marginTop="10dp"
79
+                        android:gravity="center"
80
+                        android:text="收入明细"
81
+                        android:textColor="@color/red_fe0032"
82
+                        android:textSize="15sp"
83
+                        app:layout_constraintLeft_toLeftOf="parent"
84
+                        app:layout_constraintRight_toLeftOf="@+id/title_pay"
85
+                        app:layout_constraintTop_toTopOf="parent" />
86
+
87
+                    <com.yihucha.hbyhc.view.BoldText
88
+                        android:id="@+id/title_pay"
89
+                        android:layout_width="0dp"
90
+                        android:layout_height="wrap_content"
91
+                        android:gravity="center"
92
+                        android:text="支出明细"
93
+                        android:textColor="@color/black_333333"
94
+                        android:textSize="15sp"
95
+                        app:layout_constraintLeft_toRightOf="@+id/title_income"
96
+                        app:layout_constraintRight_toRightOf="parent"
97
+                        app:layout_constraintTop_toTopOf="@+id/title_income" />
98
+
99
+                    <View
100
+                        android:id="@+id/line_income"
101
+                        android:layout_width="0dp"
102
+                        android:layout_height="3dp"
103
+                        android:layout_marginLeft="60dp"
104
+                        android:layout_marginTop="8dp"
105
+                        android:layout_marginRight="60dp"
106
+                        android:background="@color/red_fe0032"
107
+                        android:visibility="visible"
108
+                        app:layout_constraintLeft_toLeftOf="parent"
109
+                        app:layout_constraintRight_toLeftOf="@+id/line_pay"
110
+                        app:layout_constraintTop_toBottomOf="@+id/title_income" />
111
+
112
+                    <View
113
+                        android:id="@+id/line_pay"
114
+                        android:layout_width="0dp"
115
+                        android:layout_height="3dp"
116
+                        android:layout_marginLeft="60dp"
117
+                        android:layout_marginRight="60dp"
118
+                        android:background="@color/red_fe0032"
119
+                        android:visibility="invisible"
120
+                        app:layout_constraintLeft_toRightOf="@+id/line_income"
121
+                        app:layout_constraintRight_toRightOf="parent"
122
+                        app:layout_constraintTop_toTopOf="@+id/line_income" />
123
+                </androidx.constraintlayout.widget.ConstraintLayout>
124
+
125
+                <androidx.recyclerview.widget.RecyclerView
126
+                    android:id="@+id/lv_integral"
127
+                    android:layout_width="match_parent"
128
+                    android:layout_height="wrap_content"
129
+                    app:layout_constraintLeft_toLeftOf="parent"
130
+                    app:layout_constraintTop_toBottomOf="@+id/layout_center_selector" />
131
+
132
+                <include
133
+                    android:id="@+id/layoutNoData"
134
+                    layout="@layout/search_not_found"
135
+                    android:layout_width="wrap_content"
136
+                    android:layout_height="wrap_content"
137
+                    android:visibility="gone"
138
+                    app:layout_constraintBottom_toBottomOf="parent"
139
+                    app:layout_constraintLeft_toLeftOf="parent"
140
+                    app:layout_constraintRight_toRightOf="parent"
141
+                    app:layout_constraintTop_toBottomOf="@+id/layout_center_selector" />
142
+            </androidx.constraintlayout.widget.ConstraintLayout>
143
+        </androidx.core.widget.NestedScrollView>
144
+    </com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>
145
+    <androidx.constraintlayout.widget.ConstraintLayout
146
+        android:id="@+id/layout_top_selector"
147
+        android:layout_width="match_parent"
148
+        android:layout_height="60dp"
149
+        android:visibility="invisible"
150
+        android:background="@color/white_f8f8f8"
151
+        >
152
+
153
+        <com.yihucha.hbyhc.view.BoldText
154
+            android:id="@+id/title_income_top"
155
+            android:layout_width="0dp"
156
+            android:layout_height="wrap_content"
157
+            android:layout_marginTop="10dp"
158
+            android:gravity="center"
159
+            android:text="收入明细"
160
+            android:textColor="@color/red_fe0032"
161
+            android:textSize="15sp"
162
+            app:layout_constraintLeft_toLeftOf="parent"
163
+            app:layout_constraintRight_toLeftOf="@+id/title_pay_top"
164
+            app:layout_constraintTop_toTopOf="parent" />
165
+
166
+        <com.yihucha.hbyhc.view.BoldText
167
+            android:id="@+id/title_pay_top"
168
+            android:layout_width="0dp"
169
+            android:layout_height="wrap_content"
170
+            android:gravity="center"
171
+            android:text="支出明细"
172
+            android:textColor="@color/black_333333"
173
+            android:textSize="15sp"
174
+            app:layout_constraintLeft_toRightOf="@+id/title_income_top"
175
+            app:layout_constraintRight_toRightOf="parent"
176
+            app:layout_constraintTop_toTopOf="@+id/title_income_top" />
177
+
178
+        <View
179
+            android:id="@+id/line_income_top"
180
+            android:layout_width="0dp"
181
+            android:layout_height="3dp"
182
+            android:layout_marginLeft="60dp"
183
+            android:layout_marginTop="8dp"
184
+            android:layout_marginRight="60dp"
185
+            android:background="@color/red_fe0032"
186
+            android:visibility="visible"
187
+            app:layout_constraintLeft_toLeftOf="parent"
188
+            app:layout_constraintRight_toLeftOf="@+id/line_pay_top"
189
+            app:layout_constraintTop_toBottomOf="@+id/title_income_top" />
190
+
191
+        <View
192
+            android:id="@+id/line_pay_top"
193
+            android:layout_width="0dp"
194
+            android:layout_height="3dp"
195
+            android:layout_marginLeft="60dp"
196
+            android:layout_marginRight="60dp"
197
+            android:background="@color/red_fe0032"
198
+            android:visibility="invisible"
199
+            app:layout_constraintLeft_toRightOf="@+id/line_income_top"
200
+            app:layout_constraintRight_toRightOf="parent"
201
+            app:layout_constraintTop_toTopOf="@+id/line_income_top" />
202
+    </androidx.constraintlayout.widget.ConstraintLayout>
203
+</RelativeLayout>

+ 9 - 0
app/src/main/res/layout/activity_share_friends_pay.xml

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context=".presentation.pay.ShareFriendsPayActivity">
8
+
9
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 60 - 0
app/src/main/res/layout/item_new_red_integral.xml

@@ -0,0 +1,60 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="80dp"
6
+    android:background="@color/white"
7
+    android:orientation="horizontal"
8
+    android:padding="16dp">
9
+
10
+    <TextView
11
+        android:id="@+id/tv_integral"
12
+        android:layout_width="wrap_content"
13
+        android:layout_height="wrap_content"
14
+        android:layout_gravity="center"
15
+        android:layout_marginRight="8dp"
16
+        android:gravity="center"
17
+        android:text="22222222"
18
+        android:textColor="@color/black_333333"
19
+        android:textSize="15sp"
20
+        app:layout_constraintBottom_toBottomOf="@+id/tv_description"
21
+        app:layout_constraintRight_toLeftOf="@+id/imgv_jiantou"
22
+        app:layout_constraintTop_toTopOf="@+id/tv_description" />
23
+
24
+    <TextView
25
+        android:id="@+id/tv_description"
26
+        android:layout_width="0dp"
27
+        android:layout_height="0dp"
28
+        android:layout_gravity="center_vertical"
29
+        android:gravity="center_vertical"
30
+        android:text="1111111111111111111"
31
+        android:textColor="@color/black"
32
+        android:textSize="15sp"
33
+        app:layout_constraintBottom_toTopOf="@+id/tv_time"
34
+        app:layout_constraintHorizontal_weight="1"
35
+        app:layout_constraintLeft_toLeftOf="parent"
36
+        app:layout_constraintRight_toLeftOf="@+id/tv_integral"
37
+        app:layout_constraintTop_toTopOf="parent" />
38
+
39
+    <ImageView
40
+        android:id="@+id/imgv_jiantou"
41
+        android:layout_width="wrap_content"
42
+        android:layout_height="wrap_content"
43
+        android:src="@mipmap/order_store_entry_220624"
44
+        app:layout_constraintBottom_toBottomOf="@+id/tv_description"
45
+        app:layout_constraintRight_toRightOf="parent"
46
+        app:layout_constraintTop_toTopOf="@+id/tv_description" />
47
+
48
+    <TextView
49
+        android:id="@+id/tv_time"
50
+        android:layout_width="wrap_content"
51
+        android:layout_height="0dp"
52
+        android:layout_gravity="center_vertical"
53
+        android:gravity="center"
54
+        android:text="2222222222222222222222222"
55
+        android:textSize="13sp"
56
+        app:layout_constraintBottom_toBottomOf="parent"
57
+        app:layout_constraintLeft_toLeftOf="@+id/tv_description"
58
+        app:layout_constraintTop_toBottomOf="@+id/tv_description" />
59
+
60
+</androidx.constraintlayout.widget.ConstraintLayout>

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


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


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