index.js
997 Bytes
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
// pages/tab/select/index.js
// import { strategyList } from "./constant/constant";
Page({
/**
* 页面的初始数据
*/
data: {
strategyList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getStrategyList();
this.shareTitle = "攻略专区"
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
user_box_style: `padding-top:${height + 15}px`
})
},
getStrategyList() {
wx.p.api.strategyApi.getStrategyList({
pageNum: 1,
pageSize: 100
}).then(res => {
this.setData({
strategyList: res.list
})
});
},
selectStrategy(e) {
const {id} = e.currentTarget.dataset.item
wx.p.router.go('/packageStrategy/pages/strategyDetail/index', {
id,
notIntercept: true
})
},
onShareAppMessage(){},
onShow(){
const FIRST = wx.p.storage.get('first_enter_miniprograme')
this.setData({
showStore:!FIRST
})
}
});