Bladeren bron

微信支付未完成

Xiao_123 9 maanden geleden
bovenliggende
commit
91cec75b47
2 gewijzigde bestanden met toevoegingen van 39 en 34 verwijderingen
  1. 11 5
      pages/commission/components/account-type-select.vue
  2. 28 29
      pages/commission/withdraw.vue

+ 11 - 5
pages/commission/components/account-type-select.vue

@@ -45,7 +45,8 @@
       type: Boolean,
       default: false,
     },
-    methods: { // 开启的提现方式
+    methods: {
+      // 开启的提现方式
       type: Array,
       default: [],
     },
@@ -57,7 +58,7 @@
 
   const typeList = [
     {
-      // icon: '/static/img/shop/pay/wechat.png', // TODO 芋艿:后续给个 icon
+      icon: '/static/img/shop/pay/wechat.png',
       title: '钱包余额',
       value: '1',
     },
@@ -68,14 +69,19 @@
     },
     {
       icon: '/static/img/shop/pay/wechat.png',
-      title: '微信零钱',
+      title: '微信账户', // 微信手动转账
       value: '3',
     },
     {
       icon: '/static/img/shop/pay/alipay.png',
       title: '支付宝账户',
       value: '4',
-    }
+    },
+    {
+      icon: '/static/img/shop/pay/wechat.png',
+      title: '微信零钱', // 微信 API 转账
+      value: '5',
+    },
   ];
 
   function onChange(e) {
@@ -89,7 +95,7 @@
     }
     // 赋值
     emits('update:modelValue', {
-      type: state.currentValue
+      type: state.currentValue,
     });
     // 关闭弹窗
     emits('close');

+ 28 - 29
pages/commission/withdraw.vue

@@ -19,7 +19,6 @@
         class="ss-reset-button log-btn"
         @tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })"
       >
-
         提现记录
       </button>
     </view>
@@ -31,8 +30,9 @@
           <view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
           <view v-if="state.accountInfo.type === '1'" class="empty-text">钱包余额</view>
           <view v-if="state.accountInfo.type === '2'" class="empty-text">银行卡转账</view>
-          <view v-if="state.accountInfo.type === '3'" class="empty-text">微信零钱</view>
+          <view v-if="state.accountInfo.type === '3'" class="empty-text">微信账户</view>
           <view v-if="state.accountInfo.type === '4'" class="empty-text">支付宝账户</view>
+          <view v-if="state.accountInfo.type === '5'" class="empty-text">微信零钱</view>
           <text class="cicon-forward" />
         </view>
       </view>
@@ -49,7 +49,7 @@
         />
       </view>
       <!-- 提现账号 -->
-      <view class="card-title" v-show="['2', '3', '4'].includes(state.accountInfo.type)">
+      <view class="card-title" v-show="['2', '3', '4', '5'].includes(state.accountInfo.type)">
         提现账号
       </view>
       <view
@@ -102,9 +102,8 @@
         v-show="state.accountInfo.type === '2'"
       >
         <view class="unit" />
-        <!--银入输入改为下拉-->
-       <!--银行改为下拉选择-->
-       <picker
+        <!--银行改为下拉选择-->
+        <picker
           @change="bankChange"
           :value="state.bankListSelectedIndex"
           :range="state.bankList"
@@ -202,28 +201,10 @@
     state.accountSelect = e;
   };
 
-  // 获取提现银行配置字典
-  async function getDictDataListByType() {
-    let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name');
-    if (code !== 0) {
-      return;
-    }
-    if (data && data.length > 0) {
-      state.bankList = data;
-    }
-  }
-
-  //银行下拉选择
-   // 银行选择
-  function bankChange(e) {
-    const value = e.detail.value;
-    state.bankListSelectedIndex = value;
-    state.accountInfo.bankName = state.bankList[value].label;
-  }
-
   // 提交提现
   const onConfirm = async () => {
     // 参数校验
+    //debugger;
     if (
       !state.accountInfo.price ||
       state.accountInfo.price > state.brokerageInfo.price ||
@@ -252,12 +233,12 @@
       confirmText: '查看记录',
       success: (res) => {
         if (res.confirm) {
-          sheep.$router.go('/pages/commission/wallet', { type: 2 })
+          sheep.$router.go('/pages/commission/wallet', { type: 2 });
           return;
         }
         getBrokerageUser();
         state.accountInfo = {};
-      }
+      },
     });
   };
 
@@ -282,11 +263,29 @@
     }
   }
 
+  // 获取提现银行配置字典
+  async function getDictDataListByType() {
+    let { code, data } = await DictApi.getDictDataListByType('brokerage_bank_name');
+    if (code !== 0) {
+      return;
+    }
+    if (data && data.length > 0) {
+      state.bankList = data;
+    }
+  }
+
+  // 银行选择
+  function bankChange(e) {
+    const value = e.detail.value;
+    state.bankListSelectedIndex = value;
+    state.accountInfo.bankName = state.bankList[value].label;
+  }
+
   onBeforeMount(() => {
     getWithdrawRules();
     getBrokerageUser();
-    getDictDataListByType();//获取银行配置字典
-  })
+    getDictDataListByType(); //获取银行字典数据
+  });
 </script>
 
 <style lang="scss" scoped>