// pages/kabaw/mykabaw.js Page({ /** * 页面的初始数据 */ data: { quans: ['1', '2', '1', '2', '1', '2'], lindex: 0, mycoupon:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.getmycoupon(0) }, getmycoupon: function (index) { var that = this console.log(getApp().api.everyday_coupon.user_info) getApp().request({ url: getApp().api.everyday_coupon.mycoupon, data: { status: index }, success: function (t) { console.log(t) var list = t.data.list that.setData({ mycoupon: list }) } }) }, gouser: function () { var id = e.currentTarget.dataset.id }, godetail: function (e) { var id = e.currentTarget.dataset.way var item = e.currentTarget.dataset.item var send_id = this.data.send_id console.log(item) // var it = JSON.stringify(item) var it = item wx.navigateTo({ url: '/pages/kabaw/detail?id=' + it + '&send_id=' + send_id + '&way=' + id, }) }, thisone: function (e) { var index = e.currentTarget.dataset.index this.getmycoupon(index) this.setData({ lindex: index }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { this.getmycoupon(0) }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })