task_assistance.js
3.12 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
var auth = require("../../../utils/auth.js"), rq = require("../../../utils/request.js");
var e = getApp(), app = e, s = e.globalData.setting, os = s, app_d = e.globalData;
var regeneratorRuntime = require('../../../utils/runtime.js');
Page({
/**
* 页面的初始数据
*/
data: {
sw_index: 0,//轮播的下标控制
iurl: s.imghost,
is_task:0,//判断标题名是任务1还是2
activity_data:"25:20:59",//活动剩余时间
task_number:12,//任务数
is_task:0,//历史记录与任务
aitem:[
{ PrivilegeICOUrl:"https://mshopimg.yolipai.net/public/upload/userqy/ppt/2019/08-19/1e53fef14465c1f4db262fd569e78483.jpg",tite_name:'一页纸活动'},{
PrivilegeICOUrl: "https://mshopimg.yolipai.net/public/upload/userqy/ppt/2019/08-19/aa50f43dc3b9dceff951cb2145c2df3b.jpg", tite_name: '辉煌活动'
},{
PrivilegeICOUrl: "https://mshopimg.yolipai.net/public/upload/userqy/ppt/2019/08-19/5c2ff38b48ed350f2c54b19f0b9319e0.jpg", tite_name: '密码活动'
},{
PrivilegeICOUrl: "https://mshopimg.yolipai.net//miniapp/images/plus/card_one.jpg", tite_name: '啊啊活动'
},
],//活动的轮播图
switch_head: 0, //0:我的任务,1:记录
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var th=this;
th.close();
},
// 轮播图点击左边
click_pre:function(){
var index = this.data.sw_index;
index--;
if (index < 0) return;
this.setData({ sw_index: index })
},
//轮播图点击右边
click_next:function(){
var index = this.data.sw_index;
index++;
if (index >= this.data.aitem.length) return;
this.setData({ sw_index: index })
},
//任务领取
onlicke:function(){
var th=this;
getApp().my_warnning("任务领取成功", 1, th);
},
//我的任务和帮拆记录的替换
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,
is_task: index
})
}
},
//划动的时候监听
onSli:function(e){
var ind=e.detail.current ;
this.setData({
sw_index:ind
})
},
//关闭导航
close: function () {
var th = this;
var nav_b = th.selectComponent("#nav_b"); //组件的id
nav_b.close_box();
nav_b.set_name("助力", "");
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})