riku
2026-01-22 f14ea940fb32105de8b592992e3f53c62f31d84d
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
// pages/mService/pScheduledetail/pScheduledetail.js
const util = require('../../../utils/util.js');
 
Page({
  /**
   * 页面的初始数据
   */
  data: {},
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', data => {
      let thisSchedule = util.deepCopy(data);
      thisSchedule.steps.forEach((s, i) => {
        s.index = util.formatNumber(i + 1);
        s.title = this.splitStr(s.title);
      });
      this.setData({ thisSchedule });
    });
  },
 
  onSubmit() {
    wx.navigateTo({
      url: '/pages/mService/pSchedule/pSchedule',
      success: result => {},
    });
  },
 
  splitStr(str) {
    let mid = Math.ceil(str.length / 2);
    return [str.substring(0, mid), str.substring(mid, str.length)];
  },
});