1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- Page({
- data: {
- list:[]
- },
- onLoad: function (options) {
- var that = this;
- wx.request({
- url: 'https://yutang.web.ximengnaikang.com/api/user/coupons',
- method: 'GET',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- success: function (res) {
- console.log(res)
- if (res.statusCode == 200) {
- that.setData({list:res.data.data})
- }
- }
- })
- },
- buy:function(){
- wx.reLaunch({
- url: '/pages/index/index',
- })
- },
- onReady: function () {
- },
- onShow: function () {
- },
- onHide: function () {
- },
- onUnload: function () {
- },
- onPullDownRefresh: function () {
- wx.showNavigationBarLoading();
- var that = this;
- wx.request({
- url: 'https://yutang.web.ximengnaikang.com/api/user/coupons',
- method: 'GET',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'Authorization':wx.getStorageSync('token')
- },
- success: function (res) {
- console.log(res)
- if (res.statusCode == 200) {
- that.setData({list:res.data.data})
- wx.hideNavigationBarLoading();
- wx.stopPullDownRefresh();
- }
- }
- })
- },
- onReachBottom: function () {
- },
- onShareAppMessage: function () {
- }
- })
|