remind.js
1.44 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// pages/customer/remind.js
import util from '../../utils/util';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
reminds:[
{val:0,label:'不提醒'},
{val:30,label:'30分钟前'},
{val:60,label:'1小时前'},
{val:120,label:'2小时前'},
{val:24*60,label:'1天前'},
{val:48*60,label:'2天前'},
],
},
remind_date:0,
id:null,
rdate:0,
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('onLoad',options);
this.id=options.id;
this.rdate=options.rdate;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
radioChange(e){
let val=util.val(e);
console.log(val);
this.remind_date=0;
if(val>0){
this.remind_date=parseInt(this.rdate)-parseInt(val*60);
}
},
remind(){
App.Reserve.SetRelaSuccess({
rid:this.id,
openid:getApp().openid,
remind_date:this.remind_date,
is_agree:1
}).then(res=>{
wx.navigateBack()
})
}
})