You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
// pages/checklist/checklist.js
|
|
|
|
var file = require('../../utils/file.js');
|
|
|
|
const app = getApp()
|
|
|
|
Page({
|
|
data: {
|
|
previewData: null,
|
|
mark: [
|
|
{ value: 'present', name: '点到' },
|
|
{ value: 'cut', name: '旷课' },
|
|
{ value: 'leave', name: '请假' },
|
|
]
|
|
},
|
|
onLoad() {
|
|
var that = this;
|
|
file.generate_list().then(res => {
|
|
that.setData({
|
|
previewData: app.globalData.array,
|
|
});
|
|
});
|
|
console.log(app.globalData.course);
|
|
console.log(app.globalData.teacher);
|
|
console.log(app.globalData.date);
|
|
console.log(app.globalData.weekday);
|
|
console.log(app.globalData.start);
|
|
console.log(app.globalData.end);
|
|
|
|
// console.log(previewData);
|
|
},
|
|
radioChange: function (e) {
|
|
const items = this.data.mark;
|
|
var id = e.currentTarget.id;
|
|
file.setCurrentId(id);
|
|
for (let i = 0, len = items.length; i < len; i++) {
|
|
items[i].checked = items[i].value === e.detail.value;
|
|
if (items[i].checked == true) {
|
|
file.updatestate(items[i].value);
|
|
console.log("global: " + app.globalData.array[id].state);
|
|
console.log("preview: " + this.data.previewData[id].state);
|
|
}
|
|
}
|
|
this.setData({
|
|
items
|
|
});
|
|
},
|
|
// 返回上一级
|
|
returnlast: function (e) {
|
|
app.globalData.currentindex = 0;
|
|
wx.redirectTo({
|
|
url: '/pages/rollcall/rollcall',
|
|
})
|
|
},
|
|
}) |