assistance.js
1.01 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
var i = require("../../../utils/util.js")
var e = getApp(),
a = e.globalData.setting,
os = a,
t = e.request,
d = e.globalData;
Page({
/**
* 页面的初始数据
*/
data: {
url: a.url, //接口网址
iurl: a.imghost, //图片前缀网址
switch_head: 0, //0:我的任务,1:活动说明
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var th = this;
th.close();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
switch_head: function(e) {
var th = this;
var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明
var switch_head = th.data.switch_head; //0任务,1活动说明
if (index != switch_head) {
th.setData({
switch_head: index
})
}
},
//关闭导航
close: function() {
var th = this;
var nav_b = th.selectComponent("#nav_b"); //组件的id
nav_b.close_box();
nav_b.set_name("助力", "");
}
})