create-wish.js
1.79 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
let app = getApp();
Page({
data: {
tipsRegisterVisible: false,
curStatus: 1, // 当前场景
},
onShareAppMessage() {},
onLoad(options) {
this.initData();
},
initData() {
app.queryIndex().then((result) => {});
},
/**
* 点击提交心愿单按钮
* 首先要根据自身状态判断
*/
onSubmitHandler() {
this.checkSubmit().then((result) => {
}).catch((err) => {
});;
},
/**
* 提交前判断状态
* 判断顺序
* 1.crm登陆
* 2.黑名单 (团购会员)
* 3.新会员
*
*/
checkSubmit() {
return new Promise((resolve, reject) => {
let indexInfo = app.globalData.indexInfo;
console.log("indexInfo:", indexInfo);
let {
isCrmLogin,
isNewMember,
isBlackList,
newMemberJudge,
oldMemberJudge,
wishBillCode
} = indexInfo;
// 未登陆 出注册弹窗提示
if (isCrmLogin == 0) {
// app.router.push({
// path: 'register'
// });
this.setData({
tipsRegisterVisible: true
})
reject();
return;
}
// 黑名单
if (isBlackList == 1) {
reject();
return;
}
// 新老会员
// isNewMember
// if(isNewMember == 1){
// }else{
// }
resolve();
});
},
// 换一批
onChangeStatusHandler() {
let curStatus = this.data.curStatus;
curStatus++;
if (curStatus > 3) {
curStatus = 1;
}
this.setData({
curStatus
})
},
// 子组件事件
evtcomp(evt) {
let {
name,
data
} = evt.detail;
switch (name) {
case "_evt_hide_rule_tips":
this.setData({
ruleTipsVisible: false
})
break;
default:
break;
}
},
})