boost.js
1.08 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
// components/tips/boost.js
const cacheKey='A2L-INDEX'
Component({
/**
* 组件的属性列表
*/
properties: {
},
lifetimes: {
attached: function() {
this.show()
},
},
/**
* 组件的初始数据
*/
data: {
disp:false,
background:[{
url:'http://nosqn.colorcun.com/boots/1.png',
txt:'1.戳选地图上的商家,开始预订',
},{
url:'http://nosqn.colorcun.com/boots/2.png',
txt:'2.搜索商家或位置,开始预订',
}]
},
/**
* 组件的方法列表
*/
methods: {
show(){
wx.getStorage({
key:cacheKey,
fail:()=>{
this.setData({
disp:true,
})
this.triggerEvent('event',{act:'show',txt:'新用户'})
//wx.setStorage({key:cacheKey, data:new Date().toISOString()})
},
success:()=>{
this.triggerEvent('event',{act:'hide',txt:'老用户'})
},
})
},
hide(){
this.setData({
disp:false,
})
this.triggerEvent('event',{act:'hide',txt:'新用户'})
},
}
})