You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

36 lines
654 B

var app = getApp()
Page({
data: {
coupons: []
},
onShow: function() {
},
onLoad: function() {
this.getCoupons()
},
getCoupons: function() {
// for test
// var data = wx.getStorageSync('coupons')
// this.setData({coupons: data})
var that = this
var data = {}
data['token'] = app.globalData.token
wx.request({
url: `${app.globalData.API_URL}/coupons`,
data: data,
method: 'GET',
success: function(res){
var data = app.store.sync(res.data)
that.setData({coupons: data})
},
fail: function() {
},
complete: function() {
}
})
}
})