riku
2022-09-14 2206df0da6499846c78a358cf95ca33c218a5c5d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// pages/m_service/c_schedule/c_schedule.js
const moment = require('../../../utils/moment.min')
 
Component({
  options: {
    addGlobalClass: true
  },
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: '营业执照续期'
    },
    time: {
      type: String,
      value: '2022-9-10 星期六'
    },
    leftDays: {
      type: Number,
      value: 2
    },
  },
 
  /**
   * 组件的初始数据
   */
  data: {
 
  },
 
  lifetimes: {
    attached: function () {
      this._init()
    }
  },
 
  /**
   * 组件的方法列表
   */
  methods: {
    _init() {
      moment.updateLocale('en', {
        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_')
      });
      // console.log(moment.locales());
      // moment.locale('ch')
      const now = moment().hour(0).minute(0).second(0).millisecond(0)
      const s = moment(now).add(3, 'days')
 
      let leftDays = now.diff(s, 'days')
      const time = s.format('YYYY-MM-DD dddd')
      this.setData({
        time,
        leftDays
      })
    },
    goto() {
      wx.navigateTo({
        url: '/pages/m_service/p_scheduledetail/p_scheduledetail',
        success: (result) => {},
      })
    }
  }
})