-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathalert.js
More file actions
81 lines (79 loc) · 2.06 KB
/
alert.js
File metadata and controls
81 lines (79 loc) · 2.06 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
// pages/second/alert/alert.js
Page({
data: {
category: [
{ name: '私家车安防', id: 'carGuard' },
{ name: '家居安防', id: 'homeGuard' },
{ name: '企业安防', id: 'corporateGuard' },
{ name: '校园安防', id: 'campusGuard' },
{ name: '其他', id: 'others' }
],
detail: [
{
"id": "carGuard",
"banner": "/imgs/swiper/swiper-03.jpg",
"cate": "私家车安防",
"detail":[{
"thumb": "/imgs/static/car.jpg",
"name":"1号"
}]
},
{
"id": "homeGuard",
"banner": "/imgs/swiper/swiper-03.jpg",
"cate": "家居安防",
"detail": [{
"thumb": "/imgs/index/smartCommunity.png",
"name": "A座"
}]
},
{
"id": "corporateGuard",
"banner": "/imgs/swiper/swiper-03.jpg",
"cate": "企业安防",
"detail": [{
"thumb": "/imgs/index/smartCommunity.png",
"name": "冠川智能"
}]
},
{
"id": "campusGuard",
"banner": "/imgs/swiper/swiper-03.jpg",
"cate": "校园安防",
"detail": [{
"thumb": "/imgs/index/smartSchool.png",
"name": "红星高中"
}]
},
{
"id": "others",
"banner": "/imgs/swiper/swiper-03.jpg",
"cate": "其他",
"detail": [{
}]
},
],
curIndex: 0,
isScroll: false,
toView: 'carGuard'
},
onReady() {
},
switchTab(e) {
const self = this;
this.setData({
isScroll: true
})
setTimeout(function () {
self.setData({
toView: e.target.dataset.id,
curIndex: e.target.dataset.index
})
}, 0)
setTimeout(function () {
self.setData({
isScroll: false
})
}, 1)
}
})