zhb hai 2 meses
pai
achega
558f096591

+ 21 - 16
components/cwg-complex-search.vue

@@ -24,14 +24,11 @@
                                     :placeholder="field.placeholder || '请选择日期范围'" @change="handleDateChange" />
                             </template>
                             <template v-else-if="field.type === 'picker'">
-                                <uni-data-picker
-                                    v-model="formData[field.key]"
-                                    :localdata="field.options"
+                                <uni-data-picker v-model="formData[field.key]" :localdata="field.options"
                                     :popup-title="field.popupTitle || t('State.All')"
                                     :map="field.map || { value: 'value', text: 'label' }"
                                     @change="(e) => field.onChange?.(e)"
-                                    @nodeclick="(node) => field.onNodeClick?.(node)"
-                                />
+                                    @nodeclick="(node) => field.onNodeClick?.(node)" />
                             </template>
                             <template v-else-if="field.type === 'number'">
                                 <uni-easyinput v-model="formData[field.key]" type="number"
@@ -97,14 +94,10 @@
                                 :placeholder="field.placeholder || '请输入数字'" />
                         </template>
                         <template v-else-if="field.type === 'picker'">
-                            <uni-data-picker
-                                v-model="tempFormData[field.key]"
-                                :localdata="field.options"
+                            <uni-data-picker v-model="tempFormData[field.key]" :localdata="field.options"
                                 :popup-title="field.popupTitle || t('State.All')"
                                 :map="field.map || { value: 'value', text: 'label' }"
-                                @change="(e) => field.onChange?.(e)"
-                                @nodeclick="(node) => field.onNodeClick?.(node)"
-                            />
+                                @change="(e) => field.onChange?.(e)" @nodeclick="(node) => field.onNodeClick?.(node)" />
                         </template>
                     </view>
                 </view>
@@ -210,6 +203,7 @@ const initFormData = () => {
     })
     formData.value = initial
     tempFormData.value = JSON.parse(JSON.stringify(initial))
+    handleSearch()
 }
 // 获取第一个日期或日期范围字段(用于移动端顶部快捷显示)
 const dateField = computed(() => {
@@ -221,6 +215,8 @@ const shouldUseSelect = (field) => {
     return field.options.length > 10 || field.isSelect === true
 }
 const handleDateChange = (value) => {
+    formData.value[dateField.value.key] = value
+    tempFormData.value[dateField.value.key] = value
     // 日期变化时自动触发搜索
     handleSearch()
 }
@@ -274,11 +270,16 @@ watch(formData, (newVal) => {
 const resetForm = () => {
     const empty = {}
     props.fields.forEach(field => {
+        // 有默认值 → 用默认值
         if (field.defaultValue !== undefined) {
             empty[field.key] = field.defaultValue
-        } else if (field.type === 'date' || field.type === 'daterange') {
+        }
+        // 日期字段 → 用默认日期
+        else if (field.type === 'date' || field.type === 'daterange') {
             empty[field.key] = getDefaultDateValue(field)
-        } else {
+        }
+        // 无默认值 → 清空
+        else {
             empty[field.key] = ''
         }
     })
@@ -304,17 +305,21 @@ const closePopup = () => {
 const resetTempForm = () => {
     const empty = {}
     props.fields.forEach(field => {
+        // 有默认值 → 用默认值
         if (field.defaultValue !== undefined) {
             empty[field.key] = field.defaultValue
-        } else if (field.type === 'date' || field.type === 'daterange') {
+        }
+        // 日期字段 → 用默认日期
+        else if (field.type === 'date' || field.type === 'daterange') {
             empty[field.key] = getDefaultDateValue(field)
-        } else {
+        }
+        // 无默认值 → 清空
+        else {
             empty[field.key] = ''
         }
     })
     tempFormData.value = empty
 }
-
 const applyFilter = () => {
     // 将临时数据同步到正式表单
     formData.value = JSON.parse(JSON.stringify(tempFormData.value))

+ 25 - 5
components/cwg-tabel.vue

@@ -139,7 +139,7 @@
 </template>
 
 <script setup>
-import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
+import { ref, computed, watch, onMounted, onUnmounted, nextTick } from 'vue'
 import { getNoteText } from '@/utils/noteHelper';
 import useUserStore from "@/stores/use-user-store";
 import { useI18n } from "vue-i18n";
@@ -492,14 +492,32 @@ const loadData = async () => {
             }
             return true
         }
+        // 👇 修复后:使用解构获取最新的 queryParams,杜绝延迟
+        const query = { ...props.queryParams };
 
+        let startDate = "";
+        let endDate = "";
+
+        // 处理日期范围(用解构后的 query,绝对最新)
+        if (!query.date || query.date.length === 0) {
+            startDate = "";
+            endDate = "";
+        } else {
+            startDate = query.date[0] || "";
+            endDate = query.date[1] || "";
+        }
+
+        // 组装请求参数
         const params = {
             page: {
                 current: pagination.value.current,
                 row: pagination.value.pageSize
             },
-            ...props.queryParams
-        }
+            ...query,        // 用解构后的最新 query
+            startDate,
+            endDate
+        };
+
         // 添加排序参数
         if (sortState.value.prop && sortState.value.order) {
             params.sort = { field: sortState.value.prop, order: sortState.value.order }
@@ -600,7 +618,9 @@ const handleResize = () => {
 // #endif
 // ========== 监听参数变化 ==========
 watch(() => props.queryParams, () => {
-    refreshTable()
+    nextTick(() => {
+        refreshTable()
+    })
 }, { deep: true })
 // ========== 生命周期 ==========
 onMounted(() => {
@@ -609,7 +629,7 @@ onMounted(() => {
     window.addEventListener('resize', handleResize)
     // #endif
     if (props.immediate) {
-        loadData()
+        // loadData()
     }
 })
 onUnmounted(() => {

+ 7 - 0
pages.json

@@ -324,6 +324,13 @@
         "navigationStyle": "custom"
       }
     },
+    {
+      "path": "pages/common/webview",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom"
+      }
+    },
     {
       "path": "pages/common/notice",
       "style": {

+ 1 - 1
pages/customer/payment-history.vue

@@ -249,7 +249,7 @@ const handleSearch = (params) => {
 }
 
 const handleReset = (emptyParams) => {
-    search.value = {}
+    search.value = emptyParams
     nextTick(() => {
         tableRef.value.refreshTable()
     })

+ 3 - 1
pages/customer/recording-history.vue

@@ -248,6 +248,8 @@ const filterFields = [
 const searchParams = ref({})
 const tableRef = ref(null)
 const handleSearch = (params) => {
+    console.log(params)
+    
     search.value = params
     nextTick(() => {
         tableRef.value.refreshTable()
@@ -255,7 +257,7 @@ const handleSearch = (params) => {
 }
 
 const handleReset = (emptyParams) => {
-    search.value = {}
+    search.value = emptyParams
     nextTick(() => {
         tableRef.value.refreshTable()
     })

+ 4 - 4
pages/customer/trade-history.vue

@@ -10,10 +10,10 @@
                 <template #symbol="{ row }">
                     <view class="symbol-cell">
                         <view class="pair">{{ getSymbolParts(row.symbol)[0] }}/{{ getSymbolParts(row.symbol)[1]
-                            }}</view>
+                        }}</view>
                         <view class="desc">{{ row.openPrice }}
                             <text :class="getCmdColorClass(row.cmdName)">{{ formatCmdName(row.cmdName) }}{{ row.volume
-                                }}{{ t('Label.Lot') }}</text>
+                            }}{{ t('Label.Lot') }}</text>
                         </view>
                     </view>
                 </template>
@@ -28,7 +28,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref } from 'vue';
+import { computed, ref, nextTick } from 'vue';
 import { useI18n } from 'vue-i18n';
 const { t, locale } = useI18n();
 import { customApi } from '@/service/custom';
@@ -178,7 +178,7 @@ const handleSearch = (params) => {
 }
 
 const handleReset = (emptyParams) => {
-    search.value = {}
+    search.value = emptyParams
     nextTick(() => {
         tableRef.value.refreshTable()
     })

+ 4 - 4
pages/customer/trade-position.vue

@@ -9,10 +9,10 @@
                 <template #symbol="{ row }">
                     <view class="symbol-cell">
                         <view class="pair">{{ getSymbolParts(row.symbol)[0] }}/{{ getSymbolParts(row.symbol)[1]
-                        }}</view>
+                            }}</view>
                         <view class="desc">{{ row.openPrice }}
                             <text :class="getCmdColorClass(row.cmdName)">{{ formatCmdName(row.cmdName) }}{{ row.volume
-                            }}{{ t('Label.Lot') }}</text>
+                                }}{{ t('Label.Lot') }}</text>
                         </view>
                     </view>
                 </template>
@@ -27,7 +27,7 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref } from 'vue';
+import { computed, ref, nextTick } from 'vue';
 import { useI18n } from 'vue-i18n';
 const { t, locale } = useI18n();
 import { customApi } from '@/service/custom';
@@ -178,7 +178,7 @@ const handleSearch = (params) => {
 }
 
 const handleReset = (emptyParams) => {
-    search.value = {}
+    search.value = emptyParams
     nextTick(() => {
         tableRef.value.refreshTable()
     })

+ 10 - 6
pages/customer/withdrawal.vue

@@ -917,15 +917,19 @@ const selectDigital = (item) => {
 }
 const onDigitalCurrencyChange = (val) => {
   const item = ruleForm.bankBlockchain.find(b => b.id === val)
-  chooseBank(item)
+  chooseBank(item.id)
 }
 
-function chooseBank({ id }) {
+function chooseBank(id) {
+  console.log(id);
+  
   const item = bankList.value.find(b => b.id === id)
-  if (!item) {
-    showToast(t("Msg.item11"));
-    return;
-  }
+  // if (!item) {
+  //   showToast(t("Msg.item11"));
+  //   return;
+  // }
+  console.log(item,121);
+  
   if (channelData.value.type == "DIGITAL_CURRENCY") {
     if (item.authStatus == 0) {
       showToast(t("Msg.item11"));

+ 5 - 5
pages/ib/withdraw.vue

@@ -1056,14 +1056,14 @@ const getBankInfo = async () => {
 }
 const onDigitalCurrencyChange = (val) => {
     const item = ruleForm.bankBlockchain.find(b => b.id === val)
-    chooseBank(item)
+    chooseBank(item.id)
 }
 const chooseBank = (id) => {
     const item = bankList.value.find(b => b.id === id)
-    if (!item) {
-        showToast(t("Msg.item11"));
-        return;
-    }
+    // if (!item) {
+    //     showToast(t("Msg.item11"));
+    //     return;
+    // }
     let codeCache = ""
     if (form.bankCode) codeCache = form.bankCode
     Object.assign(form, item)