Browse Source

处理BUG

wangcz 7 years ago
parent
commit
3eb096aa63

+ 1 - 1
components/mobile/base/BaseFilter.vue

@@ -62,7 +62,7 @@
       RemindBox
     },
     watch: {
-      val: {
+      defaultVal: {
         handler: function (val) {
           this.val = val
         },

+ 20 - 19
pages/mobile/center/user/payCenter.vue

@@ -252,16 +252,14 @@
           {
             title: '交易方式',
             selectOption: 'remitteeType',
-            selectItems: [{key: '全部',
-              val: null
+            selectItems: [{
+              key: '平台代收',
+              val: 'PAIDTOPLATFORM'
             }, {
               key: '卖家收款',
               val: 'PAIDTOVENDOR'
-            }, {
-              key: '平台代收',
-              val: 'PAIDTOPLATFORM'
             }],
-            defaultVal: null
+            defaultVal: 'PAIDTOPLATFORM'
           },
           {
             title: '交易币种',
@@ -294,22 +292,20 @@
           {
             title: '交易时间',
             selectOption: 'date',
-            selectItems: [{key: '全部',
-              val: null
-            }, {
-              key: '一个月',
+            selectItems: [{
+              key: '30天',
               val: 1
             }, {
-              key: '三个月',
+              key: '90天',
               val: 2
             }, {
-              key: '六个月',
+              key: '180天',
               val: 3
             }, {
               key: '自定义',
               val: 4
             }],
-            defaultVal: null
+            defaultVal: 1
           }
         ]
       }
@@ -322,12 +318,7 @@
       BaseFilter
     },
     fetch ({store, route}) {
-      return route.query.type ? Promise.all([
-        store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
-      ]) : Promise.all([
-//        store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
-        store.dispatch('payCenter/loadBuyerRecord', {count: 10, page: 1, sorting: {'paytime': 'DESC'}})
-      ])
+      return
     },
     filters: {
       payTypeFilter: function (type) {
@@ -372,6 +363,16 @@
         immediate: true
       }
     },
+    created () {
+      let currentTime = this.baseUtils.getClearDay(new Date())
+      let fromDate = currentTime - 29 * 24 * 60 * 60 * 1000
+      let toDate = currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
+      if (this.$route.query.type) {
+        this.$store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
+      } else {
+        this.$store.dispatch('payCenter/loadBuyerRecord', {count: 10, page: 1, sorting: {'paytime': 'DESC'}, fromDate: fromDate, toDate: toDate, remitteeType: 'PAIDTOPLATFORM'})
+      }
+    },
     mounted () {
       this.$http.get('/data/bank.json').then(res => {
         this.bankList = res.data.list

+ 22 - 18
pages/mobile/center/vendor/payCenter.vue

@@ -264,16 +264,14 @@
           {
             title: '交易方式',
             selectOption: 'remitteeType',
-            selectItems: [{key: '全部',
-              val: null
+            selectItems: [{
+              key: '平台代付',
+              val: 'PLATFORMPAIDTOVENDOR'
             }, {
               key: '买家付款',
               val: 'PAIDTOVENDOR'
-            }, {
-              key: '平台代付',
-              val: 'PLATFORMPAIDTOVENDOR'
             }],
-            defaultVal: null
+            defaultVal: 'PLATFORMPAIDTOVENDOR'
           },
 //          {
 //            title: '交易状态',
@@ -292,25 +290,25 @@
           {
             title: '交易时间',
             selectOption: 'date',
-            selectItems: [{key: '全部',
-              val: null
-            }, {
-              key: '一个月',
+            selectItems: [{
+              key: '30天',
               val: 1
             }, {
-              key: '三个月',
+              key: '90天',
               val: 2
             }, {
-              key: '六个月',
+              key: '180天',
               val: 3
             }, {
               key: '自定义',
               val: 4
             }],
-            defaultVal: null
+            defaultVal: 1
           }
         ],
-        totalMoney: 0
+        totalMoney: 0,
+        fromDate: 0,
+        toDate: 0
       }
     },
     components: {
@@ -320,10 +318,6 @@
       EmptyStatus,
       BaseFilter
     },
-    fetch ({store, route}) {
-      return route.query.type ? Promise.all([store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
-        ]) : Promise.all([store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})])
-    },
     async asyncData({route}) {
       let { data } = await axios.get('/trade/transfer/vendor/bankTransfer/ledger?type=sup')
       return {
@@ -332,6 +326,16 @@
         switchType: route.query.switchType || 'record'
       }
     },
+    created () {
+      let currentTime = this.baseUtils.getClearDay(new Date())
+      let fromDate = currentTime - 29 * 24 * 60 * 60 * 1000
+      let toDate = currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
+      if (this.$route.query.type) {
+        this.$store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
+      } else {
+        this.$store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup', fromDate: fromDate, toDate: toDate, remitteeType: 'PAIDTOPLATFORM'})
+      }
+    },
     mounted () {
       if (!this.bankList || !this.bankList.length) {
         this.$http.get('/data/bank.json').then(res => {