zhb пре 1 месец
родитељ
комит
47d525981b
3 измењених фајлова са 43 додато и 18 уклоњено
  1. 12 3
      pages/ib/agent-transfer.vue
  2. 16 8
      pages/ib/transfer.vue
  3. 15 7
      pages/ib/withdraw.vue

+ 12 - 3
pages/ib/agent-transfer.vue

@@ -257,6 +257,7 @@ const rules = {
             },
             {
                 validateFunction: (rule, value, data, callback) => {
+                    value = Number(value)
                     if (!value) {
                         callback(t('vaildate.amount.format'))
                     } else if (
@@ -271,6 +272,8 @@ const rules = {
                             amountLimits.maxAmount)
                     } else if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
                         callback(t('vaildate.amount.format'))
+                    } else if (value > balance.value) {
+                        callback(t('Label.LoginBalance') + ':$' + balance.value);
                     }
                     return true
                 }
@@ -280,7 +283,7 @@ const rules = {
 }
 
 function validateAmount() {
-    const amount = form.amount
+    const amount = Number(form.amount)
     if (!amount) {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
@@ -302,12 +305,16 @@ function validateAmount() {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
     }
+    if (amount > balance.value) {
+        amountErrorMessage.value = t('Label.LoginBalance') + ':$' + balance.value
+        return false
+    }
     amountErrorMessage.value = ''
     return true
 }
+const balance = ref(0)
 const setAllAmount = () => {
-    const found = loginOptions.value.find(opt => opt.login === Number(loginValue.value))
-    form.amount = found.balance
+    form.amount = balance.value
     validateAmount()
 }
 
@@ -557,6 +564,8 @@ watch(loginValue, (newVal) => {
         step2.value = true
         form.withdrawLogin = Number(newVal)
         showCentAccountTransferTip(newVal)
+        const found = loginOptions.value.find(opt => opt.login === Number(loginValue.value))
+        balance.value = Number(found.balance)
         form.depositLogin = null
         form.depositLogin1 = null
         form.amount = ''

+ 16 - 8
pages/ib/transfer.vue

@@ -38,7 +38,7 @@
                                                                 ibInfo.ibNo }}</span> <span
                                                             v-t="'Label.CommissionBalance'"></span>
                                                         <span>:</span><span class="text-danger">${{ balanceInt
-                                                        }}.{{ balanceDecimal }}</span>
+                                                            }}.{{ balanceDecimal }}</span>
                                                     </h5>
                                                 </view>
 
@@ -81,7 +81,7 @@
                                                                     <checkbox value="1" :checked="form.agree5" />
                                                                     <text>{{
                                                                         t('news_add_field1.activitiesNZTwo.itemDeposit1')
-                                                                        }}</text>
+                                                                    }}</text>
 
                                                                     <p
                                                                         style="margin-top: 10px;line-height: 1.5; font-size: 14px">
@@ -90,7 +90,7 @@
                                                                                 t('Custom.Withdraw.Des') }}</text>
                                                                         <text>{{
                                                                             t('news_add_field1.activitiesNZTwo.itemDeposit2')
-                                                                            }}</text>
+                                                                        }}</text>
                                                                         <text class="clause crm-cursor"
                                                                             style="text-decoration: underline;"
                                                                             @click.stop="dialogClauseNZTwo = true">{{
@@ -98,7 +98,7 @@
                                                                             }}</text>
                                                                         <text>{{
                                                                             t('news_add_field1.activitiesNZTwo.itemDeposit4')
-                                                                            }}</text>
+                                                                        }}</text>
                                                                     </p>
 
                                                                 </label>
@@ -121,7 +121,7 @@
                                                                             style="margin-top: 10px; line-height: 1.5; font-size: 14px">
                                                                             <text> {{
                                                                                 t('news_add_field1.activitiesNewList.item1')
-                                                                                }}{{
+                                                                            }}{{
                                                                                     t('news_add_field1.activitiesNewList.item2')
                                                                                 }}</text>
                                                                         </view>
@@ -135,9 +135,10 @@
 
 
 
-                                                <view type="submit" value="Submit"
+                                                <view @click="toTransfer"
                                                     class="btn btn-danger waves-effect waves-light"><i
-                                                        class="fi fi-rs-check"></i> {{t('Btn.Submit')}}
+                                                        class="fi fi-rs-check"></i>
+                                                    {{ t('Btn.Submit') }}
                                                 </view>
                                             </view>
                                         </uni-forms>
@@ -282,6 +283,7 @@ const rules = {
             },
             {
                 validateFunction: (rule, value, data, callback) => {
+                    value = Number(value)
                     if (!value) {
                         callback(t('vaildate.amount.format'))
                     } else if (
@@ -296,6 +298,8 @@ const rules = {
                             amountLimits.maxAmount)
                     } else if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
                         callback(t('vaildate.amount.format'))
+                    } else if (value > balance.value) {
+                        callback(t('Label.LoginBalance') + ':$' + balance.value);
                     }
                     return true
                 }
@@ -347,7 +351,7 @@ const setAllAmount = () => {
     validateAmount()
 }
 function validateAmount() {
-    const amount = form.amount
+    const amount = Number(form.amount)
     if (!amount) {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
@@ -369,6 +373,10 @@ function validateAmount() {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
     }
+    if (amount > balance.value) {
+        amountErrorMessage.value = t('Label.LoginBalance') + ':$' + balance.value
+        return false
+    }
     amountErrorMessage.value = ''
     return true
 }

+ 15 - 7
pages/ib/withdraw.vue

@@ -132,7 +132,7 @@
                                             <h6>
                                                 <text>{{
                                                     t('Custom.Withdraw.addBank')
-                                                }}</text>
+                                                    }}</text>
                                                 <text class="add-btn crm-cursor"
                                                     @click="openAddBankCard('add_bankCard')">
                                                     {{ t('Custom.Withdraw.addBank1') }}
@@ -386,7 +386,7 @@
                         <view class="b-card">
                             <view class="card-top">
                                 <text class="tit">{{ t('Custom.Deposit.Title22')
-                                    }}</text>
+                                }}</text>
                                 <cwg-combox :clearable="false" v-model:value="channelId" :options="channelListOptions"
                                     :placeholder="t('placeholder.choose')">
                                 </cwg-combox>
@@ -510,7 +510,7 @@
                                                     </text>
                                                     <text v-if="channelData.type == 'BANK'">{{
                                                         t('Custom.Withdraw.addBank')
-                                                        }}</text>
+                                                    }}</text>
                                                     <text v-if="channelData.type == 'BANK'" class="add-btn crm-cursor"
                                                         @click="openAddBankCard('add_bankCard')">
                                                         {{ t('Custom.Withdraw.addBank1') }}
@@ -658,7 +658,7 @@
                                         <view v-if="channelData.type != 'BANK_TELEGRAPHIC'">
                                             <view class="tit">
                                                 <text>{{ t('Custom.Withdraw.Title3') + '(' + channelData.currency + ')'
-                                                    }}</text>
+                                                }}</text>
                                             </view>
                                         </view>
                                         <view v-if="channelData.type != 'BANK_TELEGRAPHIC'"
@@ -701,7 +701,7 @@
                                         </uni-forms-item>
                                     </view>
                                     <button class="s-btn" type="primary" @click="openTips">{{ t('Btn.Submit')
-                                        }}</button>
+                                    }}</button>
 
                                 </uni-forms>
                             </view>
@@ -1106,6 +1106,10 @@ const rules = computed(() => ({
                         callback(t('vaildate.amount.amount') + mAmount.minAmount + ' - ' + mAmount.maxAmount);
                         return false;
                     }
+                    if (value > loginAmount.value) {
+                        callback(t('Label.LoginBalance') + ':$' + loginAmount.value);
+                        return false;
+                    }
                     if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
                         return true;
                     } else {
@@ -1168,15 +1172,15 @@ const rules = computed(() => ({
 }));
 const amountErrorMessage = ref('')
 const validateAmount = () => {
-    const amount = form.amount
+    const amount = Number(form.amount)
     if (!amount && amount !== 0) {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
     }
+    const numValue = Number(amount);
     if (mAmount.minAmount && mAmount.maxAmount) {
         const min = Number(mAmount.minAmount);
         const max = Number(mAmount.maxAmount);
-        const numValue = Number(amount);
         if (numValue < min || numValue > max) {
             amountErrorMessage.value = t('vaildate.amount.amount') + min + '-' + max
             return false
@@ -1186,6 +1190,10 @@ const validateAmount = () => {
         amountErrorMessage.value = t('vaildate.amount.format')
         return false
     }
+    if (amount > balance.value) {
+        amountErrorMessage.value = t('Label.LoginBalance') + ':$' + balance.value
+        return false
+    }
     amountErrorMessage.value = ''
     return true
 }