zhb 1 هفته پیش
والد
کامیت
6acc52f698
4فایلهای تغییر یافته به همراه33 افزوده شده و 16 حذف شده
  1. 5 5
      composables/useAccountOptions.js
  2. 25 9
      pages/customer/payment-history.vue
  3. 1 0
      pages/customer/wallet-transfer.vue
  4. 2 2
      pages/ib/recording.vue

+ 5 - 5
composables/useAccountOptions.js

@@ -57,11 +57,11 @@ export function useAccountOptions() {
     onMounted(() => {
       // console.log('hook useAccountOptions mounted')
       // console.log(loginOptions?.length)
-        if (loginOptions && loginOptions?.length > 0) {
-            isLoaded.value = true
-            isSuccess.value = true
-            return
-        }
+        // if (loginOptions && loginOptions?.length > 0) {
+        //     isLoaded.value = true
+        //     isSuccess.value = true
+        //     return
+        // }
         getDateList()
     })
 

+ 25 - 9
pages/customer/payment-history.vue

@@ -117,7 +117,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref, nextTick, reactive } from 'vue';
+import { computed, ref, nextTick, reactive, watch } from 'vue';
 import { useI18n } from 'vue-i18n';
 import { onLoad } from '@dcloudio/uni-app'
 const { t, locale } = useI18n();
@@ -243,23 +243,27 @@ const filterFields = computed(() => [
     {
         key: 'orderStatus', type: 'select', label: t('Custom.PaymentHistory.Status'), placeholder: t('placeholder.choose'), options: orderStatusMap.value, defaultValue: null
     },
-    isLoaded.value && isSuccess.value && { key: 'login', type: 'select', label: t('Custom.PaymentHistory.TradingAccount'), placeholder: t('placeholder.login'), options: loginOptions || [], defaultValue: search.login || undefined, clearable: true },
+    isLoaded.value && isSuccess.value && { key: 'login', type: 'select', label: t('Custom.PaymentHistory.TradingAccount'), placeholder: t('placeholder.login'), options: loginOptions || [], defaultValue: undefined, clearable: true },
     { key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange' }
 ])
 
 const searchParams = ref({})
 
-const handleSearch = (params) => {
+const handleSearch = (params, type) => {
     Object.assign(search, params)
-    search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
-    nextTick(() => {
+    search.platform = loginOptions?.find(item => item.value === params.login)?.platform || ''
+    search.login = params.login && Number(params.login)
+
+    setTimeout(() => {
+        console.log(search, params, 10000, type);
         tableRef.value.refreshTable()
-    })
+    }, 10)
 }
 
 const handleReset = (params) => {
     Object.assign(search, params)
-    search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
+    search.platform = loginOptions?.find(item => item.value === params.login)?.platform || ''
+    search.login = params.login && Number(params.login)
     nextTick(() => {
         tableRef.value.refreshTable()
     })
@@ -332,10 +336,22 @@ const cancle = async (id, type) => {
         console.log('取消删除')
     }
 }
-onLoad((e) => {
+onLoad(async (e) => {
+    let targetLogin: number | null = null
     if (e.login) {
-        search.login = Number(e.login)
+        targetLogin = Number(e.login)
     }
+    await new Promise<void>(resolve => {
+        const stopWatch = watch([isLoaded, isSuccess], ([loaded, success]) => {
+            if (loaded && success) {
+                stopWatch()
+                resolve()
+            }
+        })
+    })
+    searchParams.value.login = targetLogin
+    search.platform = loginOptions?.find(item => item.value === searchParams.value.login)?.platform || ''
+    search.login = searchParams.value.login && Number(searchParams.value.login)
 })
 </script>
 

+ 1 - 0
pages/customer/wallet-transfer.vue

@@ -124,6 +124,7 @@ const rules = computed(() => ({
             { required: true, errorMessage: t('vaildate.amount.format') },
             {
                 validateFunction: (rule, value, data, callback) => {
+                    value = Number(value)
                     if (!value) {
                         callback(t('vaildate.amount.format'))
                     } else if (!/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {

+ 2 - 2
pages/ib/recording.vue

@@ -43,9 +43,9 @@
             <text v-if="row.status == 5">
               {{ t('State.Cancelled') }}
             </text>
-            <button class="cancel-btn btn btn-gray" v-if="row.status == 1" @click.stop="cancel(row.id)">
+            <view class="cancel-btn btn btn-gray" v-if="row.status == 1" @click.stop="cancel(row.id)">
               {{ t('Btn.Cancel') }}
-            </button>
+            </view>
           </view>
 
         </template>