riku
2022-10-10 437144f41c74505d362a5214a18cec3d01b3ce4b
pages/m_service/c_schedule/c_schedule.js
@@ -1,7 +1,9 @@
// pages/m_service/c_schedule/c_schedule.js
const moment = require('../../../utils/moment.min')
import moment from '../../../utils/moment.min'
import b_scheduleManager from '../behaviors/b_scheduleManager'
Component({
  behaviors: [b_scheduleManager],
  options: {
    addGlobalClass: true
  },
@@ -9,18 +11,7 @@
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: '营业执照续期'
    },
    time: {
      type: String,
      value: '2022-9-10 星期六'
    },
    leftDays: {
      type: Number,
      value: 2
    },
  },
  /**
@@ -30,36 +21,17 @@
  },
  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() {
      var that = this
      wx.navigateTo({
        url: '/pages/m_service/p_scheduledetail/p_scheduledetail',
        success: (result) => {},
        success: (res) => {
          res.eventChannel.emit('acceptDataFromOpenerPage', that.data.thisSchedule)
        },
      })
    }
  }