Browse Source

对接完成

yangc 7 years ago
parent
commit
cc47422b0a

+ 17 - 15
components/mobile/base/BaseFilter.vue

@@ -40,9 +40,7 @@
         }
       },
       // 默认选择
-      defaultVal: {
-        default: 0
-      },
+      defaultVal: {},
       // 选择属性值
       selectOption: {
         type: String,
@@ -51,7 +49,7 @@
     },
     data () {
       return {
-        val: 0,
+        val: null,
         dateObj: {
           fromDate: null,
           toDate: null
@@ -66,9 +64,7 @@
     watch: {
       val: {
         handler: function (val) {
-          if (val) {
-            this.val = val
-          }
+          this.val = val
         },
         immediate: true
       }
@@ -102,23 +98,24 @@
         if (val === 1) { // 一个月
           dateObj = {
             fromDate: currentTime - 30 * 24 * 60 * 60 * 1000,
-            toDate: currentTime
+            toDate: currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
           }
         } else if (val === 2) { // 三个月
           dateObj = {
             fromDate: currentTime - 3 * 30 * 24 * 60 * 60 * 1000,
-            toDate: currentTime
+            toDate: currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
           }
         } else if (val === 3) { // 六个月
           dateObj = {
             fromDate: currentTime - 6 * 30 * 24 * 60 * 60 * 1000,
-            toDate: currentTime
+            toDate: currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
           }
         }
         return dateObj
       },
       setDate (type) {
         if (this.dateObj[type]) {
+          // 初始化为00:00:00
           this.dateObj[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
           if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate > this.dateObj.toDate) {
             if (type === 'fromDate') {
@@ -127,11 +124,16 @@
               this.setRemindText('结束时间不能小于起始时间')
             }
             this.dateObj[type] = null
-          } else {
-            if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate === this.dateObj.toDate) {
-              // 23:59:59
-              this.dateObj.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
-            }
+          }
+//          else {
+//            if (this.dateObj.fromDate && this.dateObj.toDate && this.dateObj.fromDate === this.dateObj.toDate) {
+//              // 23:59:59
+//              this.dateObj.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
+//            }
+//          }
+          // 23:59:59
+          if (type === 'toDate') {
+            this.dateObj.toDate += (23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000)
           }
         } else {
           this.dateObj[type] = null

+ 34 - 23
pages/mobile/center/user/payCenter.vue

@@ -116,7 +116,7 @@
           </div>-->
           <div class="content-line">
             <span class="inline-block title">收款方式:</span>
-            <span class="inline-block content">卖家收款</span>
+            <span class="inline-block content">{{record.remitteeType | payTypeFilter}}</span>
           </div>
           <div class="content-line">
             <span class="inline-block title">时间:</span>
@@ -207,7 +207,7 @@
           toDate: '',
           currencyName: '',
           // 交易方式
-          method: ''
+          remitteeType: ''
         },
         showSelectMethod: false,
         showSelectCurrency: false,
@@ -217,25 +217,25 @@
           toDate: ''
         },
         filterOptions: [
-//          {
-//            title: '交易方式',
-//            selectOption: 'method',
-//            selectItems: [{key: '全部',
-//              val: 0
-//            }, {
-//              key: '卖家收款',
-//              val: 1
-//            }, {
-//              key: '平台代收',
-//              val: 2
-//            }],
-//            defaultVal: 0
-//          },
+          {
+            title: '交易方式',
+            selectOption: 'remitteeType',
+            selectItems: [{key: '全部',
+              val: null
+            }, {
+              key: '卖家收款',
+              val: 'PAIDTOVENDOR'
+            }, {
+              key: '平台代收',
+              val: 'PAIDTOPLATFORM'
+            }],
+            defaultVal: null
+          },
           {
             title: '交易币种',
             selectOption: 'currencyName',
             selectItems: [{key: '全部',
-              val: 0
+              val: null
             }, {
               key: 'RMB',
               val: 'RMB'
@@ -243,13 +243,13 @@
               key: 'USD',
               val: 'USD'
             }],
-            defaultVal: 0
+            defaultVal: null
           },
 //          {
 //            title: '交易状态',
 //            selectOption: 'status',
 //            selectItems: [{key: '全部',
-//              val: 0
+//              val: null
 //            }, {
 //              key: '已付款',
 //              val: 1
@@ -257,13 +257,13 @@
 //              key: '待付款',
 //              val: 2
 //            }],
-//            defaultVal: 0
+//            defaultVal: null
 //          },
           {
             title: '交易时间',
             selectOption: 'date',
             selectItems: [{key: '全部',
-              val: 0
+              val: null
             }, {
               key: '一个月',
               val: 1
@@ -277,7 +277,7 @@
               key: '自定义',
               val: 4
             }],
-            defaultVal: 0
+            defaultVal: null
           }
         ]
       }
@@ -295,6 +295,17 @@
         store.dispatch('payCenter/loadBuyerRecord', {count: 10, page: 1, sorting: {'paytime': 'DESC'}})
       ])
     },
+    filters: {
+      payTypeFilter: function (type) {
+        if (type === 'PAIDTOVENDOR') {
+          return '卖家收款'
+        } else if (type === 'PAIDTOPLATFORM') {
+          return '平台代收'
+        } else {
+          return '其他'
+        }
+      }
+    },
     watch: {
       'buyerAccount': {
         handler: function (val) {
@@ -364,7 +375,7 @@
             currencyName: this.filterParams.currencyName || null,
             fromDate: this.filterParams.fromDate || null,
             toDate: this.filterParams.toDate || null,
-            method: this.filterParams.method || null,
+            remitteeType: this.filterParams.remitteeType || null,
             keyword: this.filterParams.keyword || null
           })
         }

+ 34 - 25
pages/mobile/center/vendor/payCenter.vue

@@ -77,7 +77,7 @@
           </div>
           <div class="content-line">
             <span class="inline-block title">交易方式:</span>
-            <span class="inline-block content text-ellipse">{{record.operateType === 1063 ? '买家付款' : '平台代付'}}</span>
+            <span class="inline-block content text-ellipse">{{record.type | payTypeFilter}}</span>
           </div>
           <div class="content-line">
             <span class="inline-block title">时间:</span>
@@ -206,8 +206,7 @@
           keyword: '',
           fromDate: '',
           toDate: '',
-          method: '',
-          status: ''
+          remitteeType: ''
         },
         currentId: '',
         showReuseModal: false,
@@ -220,37 +219,37 @@
         filterOptions: [
           {
             title: '交易方式',
-            selectOption: 'method',
+            selectOption: 'remitteeType',
             selectItems: [{key: '全部',
-              val: 0
+              val: null
             }, {
               key: '买家付款',
-              val: 1
+              val: 'PAIDTOVENDOR'
             }, {
               key: '平台代付',
-              val: 2
+              val: 'PAIDTOPLATFORM'
             }],
-            defaultVal: 0
-          },
-          {
-            title: '交易状态',
-            selectOption: 'status',
-            selectItems: [{key: '全部',
-              val: 0
-            }, {
-              key: '已收款',
-              val: 1
-            }, {
-              key: '待收款',
-              val: 2
-            }],
-            defaultVal: 0
+            defaultVal: null
           },
+//          {
+//            title: '交易状态',
+//            selectOption: 'status',
+//            selectItems: [{key: '全部',
+//              val: 0
+//            }, {
+//              key: '已收款',
+//              val: 1
+//            }, {
+//              key: '待收款',
+//              val: 2
+//            }],
+//            defaultVal: 0
+//          },
           {
             title: '交易时间',
             selectOption: 'date',
             selectItems: [{key: '全部',
-              val: 0
+              val: null
             }, {
               key: '一个月',
               val: 1
@@ -264,7 +263,7 @@
               key: '自定义',
               val: 4
             }],
-            defaultVal: 0
+            defaultVal: null
           }
         ]
       }
@@ -329,6 +328,15 @@
             break
         }
         return result
+      },
+      payTypeFilter: function (type) {
+        if (type === 'PAIDTOVENDOR') {
+          return '买家付款'
+        } else if (type === 'PAIDTOPLATFORM') {
+          return '平台代付'
+        } else {
+          return '其他'
+        }
       }
     },
     computed: {
@@ -378,7 +386,8 @@
             type: 'sup',
             fromDate: this.filterParams.fromDate || null,
             toDate: this.filterParams.toDate || null,
-            keyword: this.filterParams.keyword || null
+            keyword: this.filterParams.keyword || null,
+            remitteeType: this.filterParams.remitteeType || null
           })
         }
       },