Online_regulations.js 1.6 KB
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {

    },
    onLoad: function (options) {

    },

    onReady: function () {

    },
    onShow: function () {
        let that = this;
        that.getList()
    },
    // 列表

    getList() {

        let that = this;
        let url = '/index/second/tranOnlineList';
        let head = {
            'XX-Token': wx.getStorageSync('token')
        }

        app.post(url, '', head).then((res) => {
            // console.log(res)
            that.setData({
                list: res
            })

        }).catch((err) => {

        })
    },


    // 前往答题
    getStudycontent(e) {

        let that = this;
        let url = '/index/second/checkTranStatus';
        let head = {
            'XX-Token': wx.getStorageSync('token')
        }

        app.post(url, '', head).then((res) => {

            var id = e.currentTarget.dataset.id
            wx.navigateTo({
                url: '/pages/getStudycontent/getStudycontent?id=' + id,
            })

        }).catch((err) => {

        })


    },


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

    },

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

    },

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

    },

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

    },

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

    }
})