xuqiang 4 年之前
父節點
當前提交
3e536df2be
共有 3 個文件被更改,包括 25 次插入3 次删除
  1. 12 0
      src/pages/electricDetails.vue
  2. 1 1
      src/pages/feeDetail.vue
  3. 12 2
      src/pages/wallet.vue

+ 12 - 0
src/pages/electricDetails.vue

@@ -100,10 +100,20 @@ export default {
         ...mapState(['roomInfo', 'ammeterInfo'])
     },
     mounted() {
+        this.nowDate = new Date();
+        let date = {
+            year: this.nowDate.getFullYear(),
+            month: this.nowDate.getMonth() + 1
+        };
+        let systemDate = date.year + '-' + date.month;
+        this.yearMonth = systemDate;
         this.Info();
     },
     methods: {
         Info() {
+            wx.showLoading({
+                title: '加载中'
+            });
             this.$http
                 .get('/rechargeRecord/ammeter', {
                     roomId: this.roomInfo.roomId,
@@ -112,11 +122,13 @@ export default {
                     yearMonth: this.yearMonth
                 })
                 .then(res => {
+                    wx.hideLoading();
                     // console.log(res);
                     this.list = res.content;
                     this.empty = res.empty;
                 })
                 .catch(e => {
+                    wx.hideLoading();
                     wx.showToast({
                         icon: 'none',
                         title: e.error

+ 1 - 1
src/pages/feeDetail.vue

@@ -93,7 +93,7 @@ export default {
                 sort: 'settleTime,desc',
                 yearMonth: this.yearMonth
             };
-            console.log(this.yearMonth);
+            // console.log(this.yearMonth);
             query.roomId = this.roomInfo.roomId;
             this.$http
                 .get('/api/mp/roomFeeRecord', query)

+ 12 - 2
src/pages/wallet.vue

@@ -8,13 +8,13 @@
 </config>
 <template>
     <div class="list">
-        <van-sticky :offset-top="0">
+        <!-- <van-sticky :offset-top="0">
             <div class="box">
                 <div class="time-box" @click="newShow = true">
                     <div class="text">{{ yearMonth ? yearMonth : '请选择时间' }}</div>
                 </div>
             </div>
-        </van-sticky>
+        </van-sticky> -->
         <template v-if="!empty">
             <div class="content">
                 <div class="con1">
@@ -53,6 +53,7 @@ export default {
         return {
             newShow: false,
             yearMonth: '',
+            nowDate: '',
             list: [],
             currentDate: new Date().getTime(),
             // minDate: new Date().getTime(),
@@ -65,6 +66,15 @@ export default {
     // created() {
     //     console.log(this.roomInfo, this.ammeterInfo);
     // },
+    mounted() {
+        // this.nowDate = new Date();
+        // let date = {
+        //     year: this.nowDate.getFullYear(),
+        //     month: this.nowDate.getMonth() + 1
+        // };
+        // let systemDate = date.year + '-' + date.month;
+        // this.yearMonth = systemDate;
+    },
     methods: {
         timeFormat(date, fmt) {
             var o = {