myfeedback.js 2.0 KB
const app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        datalist: '',
        lists: '',
        pages: 0

    },
    // 个人信息
    getdatalist() {
        let that = this;
        let url = '/index/second/feedback';
        let head = {
            'XX-Token': wx.getStorageSync('token')
        }
        app.post(url, {}, head).then((res) => {
            console.log(res)
            that.setData({
                datalist: res
            })
        }).catch((err) => {

        })
    },
    // 商品列表
    getdatalists() {
        let that = this;
        let url = '/index/second/goodsList ';
        let head = {
            'XX-Token': wx.getStorageSync('token')
        }

        let params = {
            page: that.data.pages
        }
        app.post(url, params, head).then((res) => {
            console.log(res)
            that.setData({
                lists: res
            })
        }).catch((err) => {

        })
    },

    // 商品详情
    getbindshop(e) {
        var id = e.currentTarget.dataset.id
        // console.log(id)
        wx.navigateTo({
            url: '/pages/myfeedback/myfeedback_active/myfeedback_active?id=' + id,
        })

    },
    //我的主页 
    getmyData() {
        wx.navigateTo({
            url: '/pages/mydetail/mydetail',
        })
    },



    onLoad: function (options) {

    },
    onReady: function () {

    },

    onShow: function () {

        let that = this;
        that.getdatalist();
        that.getdatalists()

    },

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

    },

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

    },

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

    },

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

    },

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

    }
})