myactivity.js 2.0 KB
const app =getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        nav: 1,
        navs: 1,
        list:''
    },
    onLoad: function (options) {
    },

    onReady: function () {
    },
    onShow: function () {
        let that = this;
        that.getList();
    },
    // 列表
    getList() {
        
        let that = this;
        let url = '/index/second/activityList';
        let head = {
            'XX-Token': wx.getStorageSync('token')
        }
        let d = {
            status:that.data.navs
        }
        app.post(url, d, head).then((res) => {
            // console.log(res)
            that.setData({
                list: res
            })

        }).catch((err) => {

        })
    },



    // 导航
    bindNav(e) {
        var nav = e.currentTarget.dataset.nav
        console.log(nav)
        this.setData({
            nav
        })
        this.getList();
    },
    // 导航
    bindtype(e) {
        var navs = e.currentTarget.dataset.navs
        console.log(navs)
        this.setData({
            navs
        })
        this.getList();
    },
    // 打卡
    getdaka(e) {
        var id =e.currentTarget.dataset.id
        wx.navigateTo({
            url: '/pages/myactivity/myactivity_active/myactivity_active?id='+id,
        })

    },
    // 提交报告
    getreport() {
        wx.navigateTo({
            url: '/pages/myactivity/myactivity_report/myactivity_report',
        })

    },








    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})