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 () { } })