yangc пре 7 година
родитељ
комит
e42f225bbb
2 измењених фајлова са 35 додато и 20 уклоњено
  1. 23 14
      pages/mobile/center/user/payCenter.vue
  2. 12 6
      pages/mobile/center/vendor/payCenter.vue

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

@@ -42,13 +42,13 @@
         <div class="date-wrap">
           <label>
             <i class="iconfont icon-ico-date"></i>
-            <input type="date" v-model="filterParams.fromDate" @change="setDate('fromDate')">
+            <input type="date" v-model="dateObj.fromDate" @change="setDate('fromDate')">
             <p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
           </label>
           <span>—</span>
           <label>
             <i class="iconfont icon-ico-date"></i>
-            <input type="date" v-model="filterParams.toDate" @change="setDate('toDate')">
+            <input type="date" v-model="dateObj.toDate" @change="setDate('toDate')">
             <p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
           </label>
         </div>
@@ -193,7 +193,11 @@
         },
         showSelectMethod: false,
         showSelectCurrency: false,
-        showSelectStatus: false
+        showSelectStatus: false,
+        dateObj: {
+          fromDate: '',
+          toDate: ''
+        }
       }
     },
     components: {
@@ -344,20 +348,25 @@
         this.filterRecord(this.filterParams.currencyName)
       },
       setDate (type) {
-        // 00:00:00
-        this.filterParams[type] = new Date(this.filterParams[type]).getTime() - 8 * 60 * 60 * 1000
-        if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
-          if (type === 'fromDate') {
-            this.setRemindText('起始时间不能大于结束时间')
+        if (this.dateObj[type]) {
+          this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
+          if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
+            if (type === 'fromDate') {
+              this.setRemindText('起始时间不能大于结束时间')
+            } else {
+              this.setRemindText('结束时间不能小于起始时间')
+            }
+            this.filterParams[type] = null
+            this.dateObj[type] = null
           } else {
-            this.setRemindText('结束时间不能小于起始时间')
+            if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
+              // 23:59:59
+              this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
+            }
+            this.filterRecord()
           }
-          this.filterParams[type] = null
         } else {
-          if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
-            // 23:59:59
-            this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
-          }
+          this.filterParams[type] = null
           this.filterRecord()
         }
       },

+ 12 - 6
pages/mobile/center/vendor/payCenter.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="mobile-pay-center vendor-pay mobile-fix-content mobile-centerfix-content" :class="{'vendor-pay-record': switchType === 'record'}" id="mobileFixContent" @click="setShowSelect('all', false)">
+  <div class="mobile-pay-center vendor-pay mobile-fix-content mobile-centerfix-content" :class="{'vendor-pay-record': switchType === 'record' && recordList.length}" id="mobileFixContent" @click="setShowSelect('all', false)">
     <div class="mp-head">
       <span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>
       <span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">收款账户</span>
@@ -53,13 +53,13 @@
         <div class="date-wrap">
           <label>
             <i class="iconfont icon-ico-date"></i>
-            <input type="date" v-model="filterParams.fromDate" @change="setDate('fromDate')">
+            <input type="date" v-model="dateObj.fromDate" @change="setDate('fromDate')">
             <p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
           </label>
           <span>—</span>
           <label>
             <i class="iconfont icon-ico-date"></i>
-            <input type="date" v-model="filterParams.toDate" @change="setDate('toDate')">
+            <input type="date" v-model="dateObj.toDate" @change="setDate('toDate')">
             <p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
           </label>
         </div>
@@ -238,7 +238,11 @@
         currentId: '',
         showReuseModal: false,
         totalRecordPrice: 0,
-        file: ''
+        file: '',
+        dateObj: {
+          fromDate: '',
+          toDate: ''
+        }
       }
     },
     components: {
@@ -405,8 +409,8 @@
         this.filterRecord()
       },
       setDate (type) {
-        if (this.filterParams[type]) {
-          this.filterParams[type] = new Date(this.filterParams[type]).getTime() - 8 * 60 * 60 * 1000
+        if (this.dateObj[type]) {
+          this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
           if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
             if (type === 'fromDate') {
               this.setRemindText('起始时间不能大于结束时间')
@@ -414,6 +418,7 @@
               this.setRemindText('结束时间不能小于起始时间')
             }
             this.filterParams[type] = null
+            this.dateObj[type] = null
           } else {
             if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
               // 23:59:59
@@ -422,6 +427,7 @@
             this.filterRecord()
           }
         } else {
+          this.filterParams[type] = null
           this.filterRecord()
         }
       },