wenjuan.su 1 год назад
Родитель
Сommit
c2c5c03902

+ 11 - 1
app/src/main/java/com/yihucha/hbyhc/presentation/order/OrderDetailsDaifukuanActivity.java

@@ -527,7 +527,17 @@ public class OrderDetailsDaifukuanActivity extends BaseActivity
527
                 map.put("uid", obligationBeanList.getUid());
527
                 map.put("uid", obligationBeanList.getUid());
528
                 map.put("user_address", obligationBeanList.getUser_address());
528
                 map.put("user_address", obligationBeanList.getUser_address());
529
                 map.put("user_phone", obligationBeanList.getUser_phone());
529
                 map.put("user_phone", obligationBeanList.getUser_phone());
530
-                PayActivity.launch(context, "1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price());
530
+
531
+                if (EmptyCheckUtils.isNotEmpty(obligationBeanList.getType())){
532
+                    map.put("type",obligationBeanList.getType().getType());
533
+                    map.put("note",obligationBeanList.getType().getNote());
534
+                    map.put("price",obligationBeanList.getType().getPrice());
535
+                    if (obligationBeanList.getType().getOther()>0){
536
+                        map.put("other",obligationBeanList.getType().getOther());
537
+                    }
538
+                }
539
+                PayActivity.launch(context, "1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price(),2,obligationBeanList);
540
+//                PayActivity.launch(mContext,"1", JSON.toJSONString(map), item.getGroup_order_id(), item.getPay_price(),2,item);
531
             }
541
             }
532
         } else if (v == mViewBinding.tvCancellationOfOrder) {
542
         } else if (v == mViewBinding.tvCancellationOfOrder) {
533
             if (status.equals("-2")) {
543
             if (status.equals("-2")) {

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

@@ -6,6 +6,7 @@ import android.net.Uri;
6
 import android.os.Bundle;
6
 import android.os.Bundle;
7
 import android.view.View;
7
 import android.view.View;
8
 
8
 
9
+import androidx.annotation.VisibleForTesting;
9
 import androidx.lifecycle.ViewModelProvider;
10
 import androidx.lifecycle.ViewModelProvider;
10
 
11
 
11
 import com.alibaba.fastjson.JSON;
12
 import com.alibaba.fastjson.JSON;
@@ -24,6 +25,8 @@ import com.yihucha.hbyhc.presentation.order.OrderActivity;
24
 import com.yihucha.hbyhc.presentation.order.OrderDetailsDaifukuanActivity;
25
 import com.yihucha.hbyhc.presentation.order.OrderDetailsDaifukuanActivity;
25
 import com.yihucha.hbyhc.presentation.order.model.OrderListObligationBean;
26
 import com.yihucha.hbyhc.presentation.order.model.OrderListObligationBean;
26
 import com.yihucha.hbyhc.presentation.pay.view_model.PayViewModel;
27
 import com.yihucha.hbyhc.presentation.pay.view_model.PayViewModel;
28
+import com.yihucha.hbyhc.utils.DoubleFormatTool;
29
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
27
 import com.yihucha.hbyhc.utils.LogUtil;
30
 import com.yihucha.hbyhc.utils.LogUtil;
28
 import com.yihucha.hbyhc.utils.MVUtils;
31
 import com.yihucha.hbyhc.utils.MVUtils;
29
 import com.yihucha.hbyhc.view.CustomDialog;
32
 import com.yihucha.hbyhc.view.CustomDialog;
@@ -134,7 +137,25 @@ public class PayActivity extends ViewBindingTitleBaseActivity<ActivityPayBinding
134
     }
137
     }
135
 
138
 
136
     private void initView() {
139
     private void initView() {
137
-        mViewBinding.btvPrice.setText(price);
140
+        if (EmptyCheckUtils.isNotEmpty(bean)){
141
+            if (EmptyCheckUtils.isNotEmpty(bean.getType())){
142
+//                String type = bean.getType().getType();
143
+//                String  note = bean.getType().getNote();
144
+                double price = bean.getType().getPrice();
145
+                double other = bean.getType().getOther();
146
+                StringBuffer sb = new StringBuffer("");
147
+                sb.append(DoubleFormatTool.getRoundHalfUpDouble(price));
148
+                if (bean.getType().getOther()>0){
149
+                    sb.append("+");
150
+                    sb.append(DoubleFormatTool.getRoundHalfUpDouble(other));
151
+                }
152
+                mViewBinding.btvPrice.setText(sb.toString());
153
+
154
+            }
155
+        }
156
+        else {
157
+            mViewBinding.btvPrice.setText(price);
158
+        }
138
     }
159
     }
139
 
160
 
140
     @Override
161
     @Override

+ 13 - 3
app/src/main/java/com/yihucha/hbyhc/presentation/pyyx/activity/PyyxProductDetailActivity.kt

@@ -807,11 +807,21 @@ class PyyxProductDetailActivity : ViewBindingBaseActivity<ActivityPyyxProductDet
807
             val appId = Constants.WX_APP_ID
807
             val appId = Constants.WX_APP_ID
808
             val wxapi = WXAPIFactory.createWXAPI(this, appId)
808
             val wxapi = WXAPIFactory.createWXAPI(this, appId)
809
             if (wxapi.wxAppSupportAPI >= com.tencent.mm.opensdk.constants.Build.SUPPORT_OPEN_CUSTOMER_SERVICE_CHAT) {
809
             if (wxapi.wxAppSupportAPI >= com.tencent.mm.opensdk.constants.Build.SUPPORT_OPEN_CUSTOMER_SERVICE_CHAT) {
810
-                val req = WXOpenCustomerServiceChat.Req()
811
-                req.corpId = "wwaeb55681929a37ae"
812
-                req.url = "https://work.weixin.qq.com/kfid/kfc8bd3f11a28aa81db"
810
+                val req = WXOpenCustomerServiceChat.Req().apply {
811
+                    corpId = "wwaeb55681929a37ae" // Replace with your actual corpId
812
+                    url = "https://work.weixin.qq.com/kfid/kfcb5641d3744471601" // Replace with your actual URL
813
+                }
813
                 wxapi.sendReq(req)
814
                 wxapi.sendReq(req)
815
+            } else {
816
+                Toast.makeText(this, "当前微信版本不支持客服功能", Toast.LENGTH_SHORT).show()
814
             }
817
             }
818
+
819
+//            if (wxapi.wxAppSupportAPI >= com.tencent.mm.opensdk.constants.Build.SUPPORT_OPEN_CUSTOMER_SERVICE_CHAT) {
820
+//                val req = WXOpenCustomerServiceChat.Req()
821
+//                req.corpId = "wwaeb55681929a37ae"
822
+//                req.url = "https://work.weixin.qq.com/kfid/kfcb5641d3744471601"
823
+//                wxapi.sendReq(req)
824
+//            }
815
         } else if (view === mViewBinding.llShopping) {
825
         } else if (view === mViewBinding.llShopping) {
816
             if (LoginUtils.isLogin(context)) {
826
             if (LoginUtils.isLogin(context)) {
817
                 //购物车
827
                 //购物车

+ 1 - 1
app/src/main/java/com/yihucha/hbyhc/presentation/pyyx/fragment/PyyxMineFragment.kt

@@ -458,7 +458,7 @@ class PyyxMineFragment : NewBaseFragment<FragmentPyyxMineBinding>(), View.OnClic
458
             if (wxapi.wxAppSupportAPI >= Build.SUPPORT_OPEN_CUSTOMER_SERVICE_CHAT) {
458
             if (wxapi.wxAppSupportAPI >= Build.SUPPORT_OPEN_CUSTOMER_SERVICE_CHAT) {
459
                 val req = WXOpenCustomerServiceChat.Req()
459
                 val req = WXOpenCustomerServiceChat.Req()
460
                 req.corpId = "wwaeb55681929a37ae"
460
                 req.corpId = "wwaeb55681929a37ae"
461
-                req.url = "https://work.weixin.qq.com/kfid/kfc8bd3f11a28aa81db"
461
+                req.url = "https://work.weixin.qq.com/kfid/kfcb5641d3744471601"
462
                 wxapi.sendReq(req)
462
                 wxapi.sendReq(req)
463
             }
463
             }
464
         } else if (view === binding.llBangzhuzhongxin) {
464
         } else if (view === binding.llBangzhuzhongxin) {

+ 3 - 2
app/src/main/res/layout/fragment_pyyx_mine.xml

@@ -470,14 +470,15 @@
470
                     android:orientation="horizontal"
470
                     android:orientation="horizontal"
471
                     android:layout_marginTop="15dp"
471
                     android:layout_marginTop="15dp"
472
                     >
472
                     >
473
+
473
                     <LinearLayout
474
                     <LinearLayout
474
                         android:id="@+id/ll_connect_us"
475
                         android:id="@+id/ll_connect_us"
475
                         android:layout_width="0dp"
476
                         android:layout_width="0dp"
476
                         android:layout_height="wrap_content"
477
                         android:layout_height="wrap_content"
477
                         android:layout_weight="1"
478
                         android:layout_weight="1"
478
                         android:gravity="center"
479
                         android:gravity="center"
479
-                        android:visibility="gone"
480
-                        android:orientation="vertical">
480
+                        android:orientation="vertical"
481
+                        android:visibility="visible">
481
 
482
 
482
                         <ImageView
483
                         <ImageView
483
                             android:layout_width="wrap_content"
484
                             android:layout_width="wrap_content"