| | |
| | | // 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 |
| | | }, |
| | |
| | | * 组件的属性列表 |
| | | */ |
| | | properties: { |
| | | title: { |
| | | type: String, |
| | | value: '营业执照续期' |
| | | }, |
| | | time: { |
| | | type: String, |
| | | value: '2022-9-10 星期六' |
| | | }, |
| | | leftDays: { |
| | | type: Number, |
| | | value: 2 |
| | | }, |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | }, |
| | | |
| | | 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) |
| | | }, |
| | | }) |
| | | } |
| | | } |