formids.js
1.46 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
Component({
properties:{
url:String,
openType:{
type: String,
value:'navigate',
},
},
data:{
},
methods:{
formSubmit: function(e) {
console.log('formids',e.detail.formId)
if("the formId is a mock one"!=e.detail.formId){
let formids=wx.getStorageSync('formids') || [];
formids.push(e.detail.formId);
formids=[...new Set(formids)];
wx.setStorage({key:'formids',data:formids});
}
this.triggerEvent("click");
if(this.data.url || this.data.openType!='navigate'){
let obj={url:this.data.url};
switch (this.data.openType){
case 'navigate':
wx.navigateTo(obj)
break;
case 'redirect':
wx.redirectTo(obj)
break;
case 'switchTab':
wx.switchTab(obj)
break;
case 'reLaunch':
wx.reLaunch(obj)
break;
case 'navigateBack':
wx.navigateBack(obj)
break;
case 'exit':
break;
}
}
},
},
attached(){
//console.log('this.data',this.data);
}
})