Selaa lähdekoodia

提现规则优化

vaecebyZ 9 kuukautta sitten
vanhempi
commit
ed81849d6b
2 muutettua tiedostoa jossa 60 lisäystä ja 4 poistoa
  1. 8 0
      api/wallet.js
  2. 52 4
      invite/wallet/withdraw.vue

+ 8 - 0
api/wallet.js

@@ -53,3 +53,11 @@ export function getOpenId({jscode,platformType}) {
 		url: '/rewardserver/wallet/getOpenId?jscode='+jscode+'&platformType='+platformType,
 	})
 }
+
+// 查询提现规则
+// /wallet/transferRulerInfo
+export function transferRulerInfo() {
+	return request({
+		url: '/rewardserver/wallet/transferRulerInfo',
+	})
+}

+ 52 - 4
invite/wallet/withdraw.vue

@@ -22,8 +22,9 @@
 
       <view class="info">
         <text>
-          余额提现至微信钱包,提现限额200元/日
-          次日00:00恢复提现额度
+          {{ info.isTransfer ? '可以提现,当前您可以进行提现的金额:' + info.total : '不可提现,' + info.remark }},
+          提现规则:
+          {{ getRole() }},您可进行上月返利额提现操作余额提现至微信钱包,提现限额单笔最低{{ info.minTotal / 100}}元/笔限额{{ info.maxTotal / 100 }}元/日,{{ getRole(true) }}复提现额度
         </text>
       </view>
 
@@ -35,7 +36,7 @@
 </template>
 
 <script>
-import { transfer, getWallet } from '@/api/wallet'
+import { transfer, getWallet, transferRulerInfo } from '@/api/wallet'
 import currency from "@/utils/currency"
 export default {
   data() {
@@ -46,9 +47,51 @@ export default {
       price: null,
       openid: '',
       loading: false,
+      info: {
+        commission: 1,
+        createTime: 0,
+        dayMaxTotal: 0,
+        endDay: null,
+        endHour: 0,
+        endMinute: 0,
+        id: "",
+        isTransfer: false,
+        maxTotal: 0,
+        minTotal: 0,
+        remark: "可提现余额不足",
+        size: 0,
+        startDay: null,
+        startHour: 0,
+        startMinute: 0,
+        timeUnit: "DAY",
+        total: 0,
+        updateTime: 0,
+      }
     };
   },
   methods: {
+    getRole(isEnd) {
+      if (this.info.timeUnit == 'DAY') {
+        let text = ''
+        if (isEnd) {
+          text = `次日${this.info.startHour.toString().padStart(2, 0)}:${this.info.startMinute.toString().padStart(2, 0)}`
+        } else {
+          text = `每日${this.info.startHour.toString().padStart(2, 0)}:${this.info.startMinute.toString().padStart(2, 0)}-${this.info.endHour.toString().padStart(2, 0)}:${this.info.endMinute.toString().padStart(2, 0)}`
+        }
+        return text
+      } else if (this.info.timeUnit == 'MONTH') {
+        let text = ''
+        if (isEnd) {
+          return `次月${this.info.startDay}日`
+        } else {
+          return `每月${this.info.startDay}日-${this.info.endDay}日`
+        }
+        return text
+
+      } else {
+        return '每日'
+      }
+    },
     submit() {
       uni.showLoading({
         title: '加载中'
@@ -102,7 +145,12 @@ export default {
   },
   onShow() {
     const userInfo = JSON.parse(uni.getStorageSync('userInfo'));
-    this.openid = userInfo.openId
+    this.openid = userInfo.openId;
+    transferRulerInfo().then(res => {
+      if (res.success) {
+        this.info = res.content
+      }
+    })
   },
   onLoad({ amount }) {
     const walletId = uni.getStorageSync('walletId');