Browse Source

修改默认月份

bayi 1 year ago
parent
commit
11059ed03e
2 changed files with 9 additions and 1 deletions
  1. 5 1
      salesperson/pages/history/index.js
  2. 4 0
      utils/util.js

+ 5 - 1
salesperson/pages/history/index.js

@@ -1,5 +1,8 @@
 import event from '~/mixins/event'
 import share from '~/mixins/share'
+import {
+    formatDate
+} from '~/utils/util'
 import reachBottom from '~/mixins/reachBottom';
 import {
     getSaleInvite
@@ -7,9 +10,10 @@ import {
 Page({
     behaviors: [reachBottom, share, event],
     data: {
-        dateTime: '2023-09',
+        dateTime: formatDate(new Date(), 6),
     },
     onLoad(options) {
+       
         this.resetData();
     },
     bindDateChange(e) {

+ 4 - 0
utils/util.js

@@ -59,6 +59,10 @@ function formatDate(time, flag) {
         return year + '年' + month + '月' + day + '日';
     } else if (flag == 5) {
         return year + '-' + month + '-' + day;
+    } else if (flag == 5) {
+        return year + '-' + month + '-' + day;
+    } else if (flag == 6) {
+        return year + '-' + month;
     }
 }
 module.exports = {