my_confirm.js
1.28 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
var t = getApp();
Component({
/*** 页面的初始数据***/
data: {
yu_e_show: 0,
iurl: t.globalData.setting.imghost,
width: 0,
success: null, //成功的回调
cancle: null, //取消的回调
title: null, //标题
s_text: null, //确定的提示语
c_text: null, //取消的提示语
is_show_txt:0,
},
methods: {
open: function(title, s_text, c_text, success, cancle) {
this.setData({
title: title,
s_text: s_text,
c_text: c_text,
yu_e_show: 1
})
this.data.success = success;
this.data.cancle = cancle;
var ck1=title.indexOf('购买该礼包');
var ck2=title.indexOf('兑换该礼包');
var ck3=title.indexOf('领取该礼包');
if(ck1>0 || ck2>0 || ck3>0){
this.setData({
is_show_txt:1
})
}
},
open_cancel: function (yu_e_show){
this.setData({
yu_e_show: yu_e_show
})
},
go_sure: function() {
this.setData({ yu_e_show: 0})
if(this.data.success) this.data.success();
},
go_cancle: function() {
this.setData({ yu_e_show: 0})
if(this.data.cancle) this.data.cancle();
},
close_yu_e: function() {
this.setData({
yu_e_show: 0
})
}
}
})