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
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Page({
store: exampleStore,
useAll: true,
data: {
remindList: [
{ time: 0, text: '开始时' },
{ time: 5, text: '5分钟前' },
{ time: 15, text: '15分钟前' },
{ time: 30, text: '30分钟前' },
{ time: 60, text: '1小时前' },
{ time: 1440, text: '1天前' },
{ time: 2880, text: '2天前' },
{ time: 10080, text: '1周前' }
]
},
onLoad() {
dd.setNavigationBar({
title: '会前提醒'
})
},
selectTimes(event) {
if (this.store.data.aheadTimes.includes(event.target.dataset.item.time)) {
this.store.data.aheadTimes.forEach((item, index) => {
if (item == event.target.dataset.item.time) {
this.store.data.aheadTimes.splice(index, 1)
}
return
})
}
else {
this.store.data.aheadTimes.push(event.target.dataset.item.time)
}
this.update()
},
save() {
this.update()
dd.navigateBack({
delta: 1
})
}
});