Ver código fonte

Merge branch 'dev' of http://git.izouma.com/xiongzhu/paimaide into dev

panhui 3 anos atrás
pai
commit
2f0904ceec
4 arquivos alterados com 88 adições e 55 exclusões
  1. 4 18
      src/components/OrderItem.vue
  2. 3 1
      src/locales/en.json
  3. 3 1
      src/locales/zh.json
  4. 78 35
      src/views/WalletPage.vue

+ 4 - 18
src/components/OrderItem.vue

@@ -428,24 +428,10 @@ export default {
                 })
         },
         delegate() {
-            this.$http
-                .get('/saleBatch/get/' + this.info.batchId)
-                .then(res => {
-                    this.batchInfo = res
-                    if (res.delayDelegate) {
-                        return showDialog({
-                            title: this.$t('common.alert'),
-                            message:
-                                this.$t('delegate.tips2') +
-                                Math.ceil(this.batchInfo.delayDuration / 3600) +
-                                this.$t('delegate.tips3')
-                        })
-                    }
-                    return Promise.resolve()
-                })
-                .then(() => {
-                    this.show = true
-                })
+            this.$http.get('/saleBatch/get/' + this.info.batchId).then(res => {
+                this.batchInfo = res
+                this.show = true
+            })
         },
         showTip() {
             showDialog({

+ 3 - 1
src/locales/en.json

@@ -2,6 +2,8 @@
     "balance": {
         "availableWidthdrawAmount": "Amount that can be withdrawn",
         "balance": "Account Balance",
+        "credits": "Credits",
+        "totalRechargeAmount": "Total Recharge Amount",
         "chooseAmount": "Choose Amount",
         "confirmWithdraw": "Confirm withdrawal",
         "inputCustomAmount": "Enter a custom amount",
@@ -30,7 +32,7 @@
         "insufficientBalance": "Insufficient balance",
         "withdrawMin": "The minimum withdrawal amount is {value}",
         "withdrawFee": "Withdrawal fee",
-        "withdrawFeeTip": "Note: The rate is <span class=\"rate1\">{rate1}</span> for 1/3 of the total purchase volume and <span class=\"rate2\">{rate2}</span> for the excess.",
+        "withdrawFeeTip": "Note: A service fee of <span class=\"rate2\">{rate2}</span> will be charged for withdrawals. If your credits reaches <span class=\"factor\">{factor}</span> times the total recharge amount, a super low service fee of <span class=\"rate1\">{rate1}</span> can be enjoyed.",
         "withdrawing": "Withdrawing",
         "withdrawInputTip": "Enter the withdrawal amount",
         "withdrawModalTitle": "Apply for withdrawal",

+ 3 - 1
src/locales/zh.json

@@ -2,6 +2,8 @@
     "balance": {
         "availableWidthdrawAmount": "可提现金额",
         "balance": "账户余额",
+        "credits": "积分",
+        "totalRechargeAmount": "累计充值",
         "chooseAmount": "选择金额",
         "confirmWithdraw": "确认提现",
         "inputCustomAmount": "请输入自定义金额",
@@ -30,7 +32,7 @@
         "insufficientBalance": "余额不足",
         "withdrawMin": "最低提现金额为{value}",
         "withdrawFee": "提现手续费",
-        "withdrawFeeTip": "注: 购买总流水的1/3手续费为 <span class=\"rate1\">{rate1}</span>,超出部分手续费为 <span class=\"rate2\">{rate2}</span>",
+        "withdrawFeeTip": "注: 提现收取<span class=\"rate2\">{rate2}</span>服务费,如果积分达到总充值金额的<span class=\"factor\">{factor}</span>倍则可以享受<span class=\"rate2\">{rate1}</span>超低手续费",
         "withdrawing": "提现中",
         "withdrawInputTip": "请输入提现金额",
         "withdrawModalTitle": "申请提现",

+ 78 - 35
src/views/WalletPage.vue

@@ -10,11 +10,21 @@
         </ion-header>
         <ion-content class="wallet-page">
             <div class="head">
-                <div class="balance">
-                    <span class="sym">{{ $t('balance.symbol') }}</span
-                    >{{ balance.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}
+                <div class="info">
+                    <div class="col left">
+                        <div class="num">
+                            <span class="sym">{{ $t('balance.symbol') }}</span>
+                            <span>{{ balance.balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</span>
+                        </div>
+                        <div class="label">{{ $t('balance.balance') }}</div>
+                    </div>
+                    <div class="col right">
+                        <div class="num credit">
+                            <span>{{ balance.credits.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</span>
+                        </div>
+                        <div class="label">{{ $t('balance.credits') }}</div>
+                    </div>
                 </div>
-                <div class="label">{{ $t('balance.balance') }}</div>
                 <div class="btn-record">
                     <!-- <img src="../assets/double_arrow_left.png" class="arrow" /> -->
                     <div class="btn-record-item" @click="$router.push({ name: 'userBank' })">
@@ -87,6 +97,11 @@
                         {{ $t('balance.availableWidthdrawAmount') }}:&nbsp;{{ $t('balance.symbol')
                         }}{{ balance.balance }}
                     </div>
+                    <div class="desc">
+                        {{ $t('balance.totalRechargeAmount') }}:&nbsp;{{ $t('balance.symbol')
+                        }}{{ balance.rechargeAccumulation }}
+                    </div>
+                    <div class="desc">{{ $t('balance.credits') }}:&nbsp; {{ balance.credits }}</div>
                     <div class="input-wrapper">
                         <span class="sym">{{ $t('balance.symbol') }}</span>
                         <ion-input
@@ -111,7 +126,8 @@
                         v-html="
                             $t('balance.withdrawFeeTip', {
                                 rate1: withdrawFeeLowRate * 100 + '%',
-                                rate2: withdrawFeeRate * 100 + '%'
+                                rate2: withdrawFeeRate * 100 + '%',
+                                factor: lowFeeFactor
                             })
                         "
                     ></div>
@@ -151,7 +167,9 @@ export default {
         return {
             balance: {
                 balance: 0,
-                feeFreeAllowances: 0
+                feeFreeAllowances: 0,
+                credits: 0,
+                rechargeAccumulation: 0
             },
             showRecharge: false,
             rechargeAmount: 100,
@@ -160,6 +178,7 @@ export default {
             showWithdrawModal: false,
             withdrawFeeRate: 0.08,
             withdrawFeeLowRate: 0.01,
+            lowFeeFactor: 50,
             windowSize: useWindowSize(),
             orderId: null,
             interval: null,
@@ -168,12 +187,17 @@ export default {
     },
     created() {
         this.getBalance()
-        this.$http.get('/sysConfig/get/withdraw_fee_rate').then(res => {
-            this.withdrawFeeRate = Number(res.value)
-        })
-        this.$http.get('/sysConfig/get/withdraw_fee_low_rate').then(res => {
-            this.withdrawFeeLowRate = Number(res.value)
-        })
+        this.$http
+            .post('/sysConfig/multipleGet', ['withdraw_fee_rate', 'withdraw_fee_low_rate', 'low_fee_factor'], {
+                body: 'json'
+            })
+            .then(res => {
+                this.withdrawFeeRate = Number(res.find(item => item.name === 'withdraw_fee_rate')?.value || '0.08')
+                this.withdrawFeeLowRate = Number(
+                    res.find(item => item.name === 'withdraw_fee_low_rate')?.value || '0.01'
+                )
+                this.lowFeeFactor = Number(res.find(item => item.name === 'low_fee_factor')?.value || '50')
+            })
     },
     ionViewDidEnter() {
         Browser.addListener('browserFinished', () => {
@@ -195,13 +219,17 @@ export default {
                     realReceipt: '-'
                 }
             }
-            let fee
-            if (amount <= this.balance.feeFreeAllowances) {
+            let feeRate, fee
+            if (
+                this.balance.rechargeAccumulation &&
+                this.balance.transactionVolume &&
+                this.balance.transactionVolume / this.balance.rechargeAccumulation >= this.lowFeeFactor
+            ) {
+                feeRate = this.withdrawFeeLowRate
                 fee = this.withdrawFeeLowRate * amount
             } else {
-                fee =
-                    this.withdrawFeeRate * (amount - this.balance.feeFreeAllowances) +
-                    this.withdrawFeeLowRate * this.balance.feeFreeAllowances
+                feeRate = this.withdrawFeeRate
+                fee = this.withdrawFeeRate * amount
             }
             return {
                 fee: fee.toFixed(2),
@@ -209,7 +237,7 @@ export default {
             }
         },
         breakpoint() {
-            return Number((450 / this.windowSize.height).toFixed(2))
+            return Number((530 / this.windowSize.height).toFixed(2))
         }
     },
     methods: {
@@ -278,7 +306,7 @@ export default {
             }
             this.$toast.loading(this.$t('balance.withdrawing'))
             this.$http
-                .post('/withdrawApply/apply', { amount, separateFee: true })
+                .post('/withdrawApply/apply/v2', { amount, separateFee: true })
                 .then(res => {
                     this.$toast.dismiss()
                     this.getBalance()
@@ -343,25 +371,37 @@ export default {
         height: 138px;
         padding-top: 28px;
         position: relative;
-        .balance {
-            font-size: 30px;
-            font-weight: bold;
-            color: @text-color;
-            margin-left: 20px;
+        .info {
             .f();
-            align-items: baseline;
-            .sym {
-                font-size: 16px;
-                font-weight: normal;
-                margin-right: 4px;
+            .col {
+                flex: 1 1 0;
+                padding: 0 20px;
+                &.right {
+                    text-align: right;
+                }
+                .num {
+                    font-size: 26px;
+                    font-weight: bold;
+                    color: @text-color;
+                    line-height: 32px;
+                    .sym {
+                        font-size: 16px;
+                        font-weight: normal;
+                        margin-right: 4px;
+                    }
+                    &.credit {
+                        font-size: 20px;
+                        opacity: 0.8;
+                    }
+                }
+                .label {
+                    font-size: 14px;
+                    color: fade(@text-color, 60);
+                    margin-top: 4px;
+                }
             }
         }
-        .label {
-            font-size: 14px;
-            color: fade(@text-color, 60);
-            margin-left: 20px;
-            margin-top: 4px;
-        }
+
         .btn-record {
             position: absolute;
             left: 0;
@@ -571,6 +611,9 @@ ion-modal#modal-withdraw {
         :deep(.rate2) {
             color: #ff7f1f;
         }
+        :deep(.factor) {
+            color: #ff7f1f;
+        }
     }
     .footer {
         position: absolute;