浏览代码

修改默认月份

bayi 1 年之前
父节点
当前提交
11059ed03e
共有 2 个文件被更改,包括 9 次插入1 次删除
  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 event from '~/mixins/event'
 import share from '~/mixins/share'
 import share from '~/mixins/share'
+import {
+    formatDate
+} from '~/utils/util'
 import reachBottom from '~/mixins/reachBottom';
 import reachBottom from '~/mixins/reachBottom';
 import {
 import {
     getSaleInvite
     getSaleInvite
@@ -7,9 +10,10 @@ import {
 Page({
 Page({
     behaviors: [reachBottom, share, event],
     behaviors: [reachBottom, share, event],
     data: {
     data: {
-        dateTime: '2023-09',
+        dateTime: formatDate(new Date(), 6),
     },
     },
     onLoad(options) {
     onLoad(options) {
+       
         this.resetData();
         this.resetData();
     },
     },
     bindDateChange(e) {
     bindDateChange(e) {

+ 4 - 0
utils/util.js

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