shish 1 month ago
parent
commit
2b1bca32dc

+ 1 - 1
hdApp/src/admin/home/components/purchase-ghs-panel.vue

@@ -214,7 +214,7 @@
             <text class="ghs-more-row__arrow">›</text>
           </view>
           <view class="ghs-more-row ghs-more-row--danger" @click="bpSj()">
-            <text class="ghs-more-row__label">删除批发店</text>
+            <text class="ghs-more-row__label">删除</text>
             <text class="ghs-more-row__arrow">›</text>
           </view>
         </view>

+ 24 - 3
hdApp/src/pagesPurchase/wechatPay.vue

@@ -8,7 +8,7 @@
             <i class="iconfont icondaizhifu"></i>
           </div>
         </block>
-        <view class="wait">待付款</view>
+        <view class="wait" @click="toggleMpAliPayBtn">待付款</view>
         <block>
           <div class="price" v-if="info.reachDiscountPrice >0 || info.orderReachDiscountPrice>0">
             <span class="app-size-36 app-bold" style="text-decoration:line-through;color:#8a7f7f;">¥{{ parseFloat((Number(info.reachDiscountPrice)+Number(realPrice)+Number(info.orderReachDiscountPrice)).toFixed(2)) }}</span>
@@ -44,7 +44,7 @@
           <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" style="height:100upx;line-height:50upx;margin-top:50upx;" :disabled="remainPayTime >0 ? false : true" @click="wxPayFn">微信支付</button>
           <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" style="height:100upx;line-height:100upx;margin-top:50upx;padding:0;display:flex;align-items:center;justify-content:center;width:70%;margin-left:auto;margin-right:auto;" :disabled="remainPayTime >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">挂账</button>
 
-          <button class="button-com" @click="useAliPay()" :class="[remainPayTime >0 ? 'ali-btn green':'default']" style="height:100upx;line-height:100upx;margin-top:50upx;margin-bottom:40upx;padding:0;display:flex;align-items:center;justify-content:center;width:70%;margin-left:auto;margin-right:auto;" :disabled="remainPayTime > 0 ? false : true">支付宝付款</button>
+          <button v-if="!hideMpAliPay" class="button-com" @click="useAliPay()" :class="[remainPayTime >0 ? 'ali-btn green':'default']" style="height:100upx;line-height:100upx;margin-top:50upx;margin-bottom:40upx;padding:0;display:flex;align-items:center;justify-content:center;width:70%;margin-left:auto;margin-right:auto;" :disabled="remainPayTime > 0 ? false : true">支付宝付款</button>
 
           <view style="margin-top:80upx;">
             <image style="width:80vw;margin:0 auto;" :src="`${constant.imgUrl}/cg/hd_cg_route4.png`" mode="widthFix"></image>
@@ -113,12 +113,15 @@ export default {
       info:[],
       hasRequestApi:false,
       needCheck:0,
-      aliPayCodeImg:''
+      aliPayCodeImg:'',
+      // 微信小程序:是否隐藏「支付宝付款」按钮(由点击「待付款」切换,状态持久化到 storage)
+      hideMpAliPay: false
     };
   },
   onLoad (options) {
     this.id = options.id
     this.aliPayCodeImg = `${this.$constant.imgUrl}/default-img.png`
+    this.loadMpAliPayHideState()
   },
   computed: {
     ...mapGetters(["getLoginInfo"]),
@@ -126,6 +129,7 @@ export default {
   },
   onShow(){
     let that = this
+    that.loadMpAliPayHideState()
     if (uni.getStorageSync('wechatPayNeedRefresh') == '1') {
       uni.removeStorageSync('wechatPayNeedRefresh')
       that.init()
@@ -138,6 +142,23 @@ export default {
     }
   },
   methods: {
+    // 从 storage 恢复小程序支付宝按钮隐藏状态(key 被清空则恢复显示)
+    loadMpAliPayHideState() {
+      // #ifdef MP-WEIXIN
+      this.hideMpAliPay = uni.getStorageSync('hdMpWechatPayHideAliPay') === '1'
+      // #endif
+    },
+    // 点击「待付款」切换支付宝付款按钮显示/隐藏,并写入 storage
+    toggleMpAliPayBtn() {
+      // #ifdef MP-WEIXIN
+      this.hideMpAliPay = !this.hideMpAliPay
+      if (this.hideMpAliPay) {
+        uni.setStorageSync('hdMpWechatPayHideAliPay', '1')
+      } else {
+        uni.removeStorageSync('hdMpWechatPayHideAliPay')
+      }
+      // #endif
+    },
     openAliPay(){
       this.$msg('商家还未开通此功能')
     },