瀏覽代碼

✨ 分销提现:基本接入 100%

YunaiV 1 年之前
父節點
當前提交
74e6680880

+ 12 - 13
pages.json

@@ -406,7 +406,18 @@
 						"title": "佣金排行榜",
 						"title": "佣金排行榜",
 						"group": "分销商城"
 						"group": "分销商城"
 					}
 					}
-				}
+				}, {
+                "path": "withdraw",
+                "style": {
+                  "navigationBarTitleText": "申请提现"
+                },
+                "meta": {
+                  "auth": true,
+                  "sync": true,
+                  "title": "申请提现",
+                  "group": "分销商城"
+                }
+              }
 			]
 			]
 		},
 		},
 		{
 		{
@@ -552,18 +563,6 @@
 						"title": "充值记录",
 						"title": "充值记录",
 						"group": "支付"
 						"group": "支付"
 					}
 					}
-				},
-				{
-					"path": "withdraw",
-					"style": {
-						"navigationBarTitleText": "申请提现"
-					},
-					"meta": {
-						"auth": true,
-						"sync": true,
-						"title": "申请提现",
-						"group": "支付"
-					}
 				}
 				}
 			]
 			]
 		},
 		},

+ 1 - 0
pages/pay/components/account-type-select.vue → pages/commission/components/account-type-select.vue

@@ -1,3 +1,4 @@
+<!-- 提现方式的 select 组件 -->
 <template>
 <template>
   <su-popup :show="show" class="ss-checkout-counter-wrap" @close="hideModal">
   <su-popup :show="show" class="ss-checkout-counter-wrap" @close="hideModal">
     <view class="ss-modal-box bg-white ss-flex-col">
     <view class="ss-modal-box bg-white ss-flex-col">

+ 5 - 2
pages/commission/wallet.vue

@@ -13,7 +13,7 @@
 					<view class="money-num">{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}</view>
 					<view class="money-num">{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}</view>
 					<view class="ss-flex">
 					<view class="ss-flex">
 						<view class="ss-m-r-20">
 						<view class="ss-m-r-20">
-							<button class="ss-reset-button withdraw-btn" @tap="sheep.$router.go('/pages/pay/withdraw')">
+							<button class="ss-reset-button withdraw-btn" @tap="sheep.$router.go('/pages/commission/withdraw')">
 								提现
 								提现
 							</button>
 							</button>
 						</view>
 						</view>
@@ -214,9 +214,12 @@
     state.summary = data;
     state.summary = data;
 	}
 	}
 
 
-	onLoad(async () => {
+	onLoad(async (options) => {
 		state.today = dayjs().format('YYYY-MM-DD');
 		state.today = dayjs().format('YYYY-MM-DD');
 		state.date = [state.today, state.today];
 		state.date = [state.today, state.today];
+    if (options.type === 2) { // 切换到“提现” tab 下
+      state.currentTab = 1;
+    }
 		getLogList();
 		getLogList();
 		getAgentInfo();
 		getAgentInfo();
 	});
 	});

+ 15 - 11
pages/pay/withdraw.vue → pages/commission/withdraw.vue

@@ -1,3 +1,4 @@
+<!-- 分佣提现 -->
 <template>
 <template>
   <s-layout title="申请提现" class="withdraw-wrap" navbar="inner">
   <s-layout title="申请提现" class="withdraw-wrap" navbar="inner">
     <view class="page-bg"></view>
     <view class="page-bg"></view>
@@ -14,7 +15,7 @@
         <view class="num-title">可提现金额(元)</view>
         <view class="num-title">可提现金额(元)</view>
         <view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view>
         <view class="wallet-num">{{ fen2yuan(state.brokerageInfo.brokeragePrice) }}</view>
       </view>
       </view>
-      <button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')">
+      <button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/commission/wallet', { type: 2 })">
         提现记录
         提现记录
       </button>
       </button>
     </view>
     </view>
@@ -59,19 +60,22 @@
           placeholder="请输入提现账号"
           placeholder="请输入提现账号"
         />
         />
       </view>
       </view>
-      <!-- TODO 芋艿: -->
+      <!-- 收款码 -->
       <view class="card-title" v-show="['2', '3'].includes(state.accountInfo.type)">收款码</view>
       <view class="card-title" v-show="['2', '3'].includes(state.accountInfo.type)">收款码</view>
       <view
       <view
-        class="input-box ss-flex ss-col-center border-bottom"
+        class="input-box ss-flex ss-col-center"
         v-show="['2', '3'].includes(state.accountInfo.type)"
         v-show="['2', '3'].includes(state.accountInfo.type)"
       >
       >
         <view class="unit" />
         <view class="unit" />
-        <uni-easyinput
-          :inputBorder="false"
-          class="ss-flex-1 ss-p-l-10"
-          v-model="state.accountInfo.accountQrCodeUrl"
-          placeholder="请输收款码地址"
-        />
+        <view class="upload-img">
+          <s-uploader
+            v-model:url="state.accountInfo.accountQrCodeUrl"
+            fileMediatype="image"
+            limit="1"
+            mode="grid"
+            :imageStyles="{ width: '168rpx', height: '168rpx' }"
+          />
+        </view>
       </view>
       </view>
       <!-- 持卡人姓名 -->
       <!-- 持卡人姓名 -->
       <view class="card-title" v-show="state.accountInfo.type === '4'">持卡人</view>
       <view class="card-title" v-show="state.accountInfo.type === '4'">持卡人</view>
@@ -142,7 +146,7 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-  import { computed, reactive, onBeforeMount, ref } from 'vue';
+  import { computed, reactive, onBeforeMount } from 'vue';
   import sheep from '@/sheep';
   import sheep from '@/sheep';
   import accountTypeSelect from './components/account-type-select.vue';
   import accountTypeSelect from './components/account-type-select.vue';
   import { fen2yuan } from '@/sheep/hooks/useGoods';
   import { fen2yuan } from '@/sheep/hooks/useGoods';
@@ -211,7 +215,7 @@
       confirmText: '查看记录',
       confirmText: '查看记录',
       success: (res) => {
       success: (res) => {
         if (res.confirm) {
         if (res.confirm) {
-          sheep.$router.go('/pages/pay/withdraw-log')
+          sheep.$router.go('/pages/commission/wallet', { type: 2 })
           return;
           return;
         }
         }
         getBrokerageUser();
         getBrokerageUser();

+ 0 - 237
pages/pay/components/account-info-modal.vue

@@ -1,237 +0,0 @@
-<template>
-  <su-popup :show="show" class="add-bank-wrap" @close="hideModal">
-    <view class="ss-modal-box bg-white ss-flex-col">
-      <view class="modal-header ss-flex-col ss-col-left">
-        <text v-if="props.modelValue.type === 'bank'" class="modal-title ss-m-b-20">
-          绑定银行卡
-        </text>
-        <text v-if="props.modelValue.type === 'wechat'" class="modal-title ss-m-b-20">
-          绑定微信
-        </text>
-        <text v-if="props.modelValue.type === 'alipay'" class="modal-title ss-m-b-20">
-          绑定支付宝
-        </text>
-      </view>
-      <view class="modal-content ss-flex-1 ss-p-b-100">
-        <block v-if="props.modelValue.type === 'bank'">
-          <uni-forms
-            ref="form"
-            :model="state.bank.model"
-            :rules="state.bank.rules"
-            validateTrigger="bind"
-            labelWidth="160"
-            labelAlign="center"
-            border
-            :labelStyle="{ fontWeight: 'bold' }"
-          >
-            <uni-forms-item name="account_name" label="持卡人">
-              <uni-easyinput
-                :inputBorder="false"
-                placeholder="请输入持卡人"
-                v-model="state.bank.model.account_name"
-              />
-            </uni-forms-item>
-            <uni-forms-item name="account_header" label="开户行">
-              <uni-easyinput
-                :inputBorder="false"
-                placeholder="请输入开户行"
-                v-model="state.bank.model.account_header"
-              />
-            </uni-forms-item>
-            <uni-forms-item name="account_no" label="银行卡号">
-              <uni-easyinput
-                type="number"
-                :inputBorder="false"
-                placeholder="请输入银行卡号"
-                v-model="state.bank.model.account_no"
-              />
-            </uni-forms-item>
-          </uni-forms>
-        </block>
-
-        <block v-if="props.modelValue.type === 'wechat'">
-          <uni-forms
-            ref="form"
-            :model="state.wechat.model"
-            :rules="state.wechat.rules"
-            validateTrigger="bind"
-            labelWidth="160"
-            labelAlign="center"
-            border
-            :labelStyle="{ fontWeight: 'bold' }"
-          >
-            <uni-forms-item name="account_name" label="真实姓名">
-              <uni-easyinput
-                :inputBorder="false"
-                placeholder="请输入您的真实姓名"
-                v-model="state.wechat.model.account_name"
-              />
-            </uni-forms-item>
-          </uni-forms>
-        </block>
-
-        <block v-if="props.modelValue.type === 'alipay'">
-          <uni-forms
-            ref="form"
-            :model="state.alipay.model"
-            :rules="state.alipay.rules"
-            validateTrigger="bind"
-            labelWidth="160"
-            labelAlign="center"
-            border
-            :labelStyle="{ fontWeight: 'bold' }"
-          >
-            <uni-forms-item name="account_name" label="真实姓名">
-              <uni-easyinput
-                :inputBorder="false"
-                placeholder="请输入您的真实姓名"
-                v-model="state.alipay.model.account_name"
-              />
-            </uni-forms-item>
-            <uni-forms-item name="account_no" label="支付宝">
-              <uni-easyinput
-                :inputBorder="false"
-                placeholder="请输入支付宝 邮箱/手机号"
-                v-model="state.alipay.model.account_no"
-              />
-            </uni-forms-item>
-          </uni-forms>
-        </block>
-      </view>
-      <view class="modal-footer ss-flex ss-row-center ss-col-center">
-        <button class="ss-reset-button save-btn" @tap="onSave">保存</button>
-      </view>
-    </view>
-  </su-popup>
-</template>
-
-<script setup>
-  import { ref, reactive, unref, watch } from 'vue';
-  import sheep from '@/sheep';
-  import { realName, bankName, bankCode, alipayAccount } from '@/sheep/validate/form';
-
-  const form = ref(null);
-  const props = defineProps({
-    modelValue: {
-      type: Object,
-      default() {},
-    },
-    show: {
-      type: Boolean,
-      default: false,
-    },
-  });
-  watch(
-    () => props.modelValue,
-    (newValue, oldValue) => {
-      setModelValue(newValue);
-    },
-  );
-
-  function setModelValue(modelValue) {
-    Object.keys(state[modelValue.type].model).forEach((key) => {
-      state[modelValue.type].model[key] = modelValue[key];
-    });
-  }
-
-  const emits = defineEmits(['update:modelValue', 'close']);
-  // 数据
-  const state = reactive({
-    bank: {
-      model: {
-        account_name: '',
-        account_header: '',
-        account_no: '',
-      },
-      rules: {
-        account_name: realName,
-        account_header: bankName,
-        account_no: bankCode,
-      },
-    },
-    alipay: {
-      model: {
-        account_name: '',
-        account_no: '',
-      },
-      rules: {
-        account_name: realName,
-        account_no: alipayAccount,
-      },
-    },
-    wechat: {
-      model: {
-        account_name: '',
-      },
-      rules: {
-        account_name: realName,
-      },
-    },
-  });
-
-  setModelValue(props.modelValue);
-
-  const hideModal = () => {
-    emits('close');
-  };
-  const onSave = async () => {
-    const validate = await unref(form)
-      .validate()
-      .catch((error) => {
-        'error: ', error;
-      });
-    if (!validate) return;
-    let data = {
-      type: props.modelValue.type,
-      account_header: state[props.modelValue.type].model.account_header,
-      account_name: state[props.modelValue.type].model.account_name,
-      account_no: state[props.modelValue.type].model.account_no,
-    };
-    let res = await sheep.$api.user.account.save(data);
-    if (res.error === 0) {
-      emits('update:modelValue', res.data);
-      hideModal();
-    }
-  };
-</script>
-
-<style lang="scss" scoped>
-  .ss-modal-box {
-    border-radius: 30rpx 30rpx 0 0;
-    max-height: 1000rpx;
-
-    .modal-header {
-      position: relative;
-      padding: 60rpx 40rpx 40rpx;
-
-      .modal-title {
-        font-size: 32rpx;
-        font-weight: bold;
-      }
-
-      .close-icon {
-        position: absolute;
-        top: 10rpx;
-        right: 20rpx;
-        font-size: 46rpx;
-        opacity: 0.2;
-      }
-    }
-
-    .modal-content {
-      overflow-y: auto;
-    }
-
-    .modal-footer {
-      height: 120rpx;
-
-      .save-btn {
-        width: 710rpx;
-        height: 80rpx;
-        border-radius: 40rpx;
-        background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
-        color: $white;
-      }
-    }
-  }
-</style>