shish 11 месяцев назад
Родитель
Сommit
d75d52cb8a
1 измененных файлов с 8 добавлено и 25 удалено
  1. 8 25
      hdPad/src/pages/home/components/balanceChange.vue

+ 8 - 25
hdPad/src/pages/home/components/balanceChange.vue

@@ -1,12 +1,6 @@
 <template>
     <view class="balance-change">
-        <scroll-view 
-            scroll-y="true" 
-            class="balance-scroll" 
-            @scrolltolower="loadMore" 
-            :scroll-top="scrollTop"
-            :lower-threshold="50"
-        >
+        <scroll-view scroll-y="true" class="balance-scroll" @scrolltolower="loadMore" :scroll-top="scrollTop" :lower-threshold="50">
             <block v-if="!$util.isEmpty(list.data)">
                 <view class="balance-table">
                     <view v-for="(item, index) in list.data" :key="index" class="balance-item">
@@ -52,18 +46,10 @@ export default {
             scrollTop: 0
         };
     },
-    watch: {
-        customId: {
-            handler(newVal) {
-                if (newVal) {
-                    this.resetList()
-                    this.init()
-                }
-            },
-            immediate: true
-        }
-    },
     methods: {
+        init(){
+
+        },
         showExtraInfo(item) {
             return Number(item.settleId)>0 || !this.$util.isEmpty(item.remark) || Number(item.refundOrderId)>0 || Number(item.shOrderId)>0;
         },
@@ -77,9 +63,7 @@ export default {
             // 不再截断文本,允许完整显示
             return text;
         },
-        async init(){
-            if (!this.customId) return
-            
+        async getMyBalanceList(){
             const res = await getBalanceChangeList({ 
                 page: this.list.page,
                 customId: this.customId 
@@ -102,13 +86,12 @@ export default {
             this.resetList()
             this.scrollTop = 0
             this.$nextTick(() => {
-                this.init()
+                this.getMyBalanceList()
             })
         },
         loadMore() {
-            if (!this.list.noMore && !this.list.isLoading) {
-                this.list.page++
-                this.init()
+            if (!this.list.finished) {
+                this.getMyBalanceList()
             }
         }
     }