| @@ -23,7 +23,7 @@ Component({ | |||||
| * 组件的方法列表 | * 组件的方法列表 | ||||
| */ | */ | ||||
| methods: { | methods: { | ||||
| getList1() { | |||||
| getList() { | |||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponChannelList, | url: config.api.couponChannelList, | ||||
| @@ -68,28 +68,7 @@ Component({ | |||||
| ready() { | ready() { | ||||
| app.couponChannelListCallback = token => { | app.couponChannelListCallback = token => { | ||||
| Http.setToken(token); | Http.setToken(token); | ||||
| Http.get({ | |||||
| url: config.api.couponChannelList, | |||||
| data: { | |||||
| pageNum: 1, | |||||
| pageSize: 5, | |||||
| targetAd: 6 | |||||
| } | |||||
| }).then(res => { | |||||
| this.setData({ | |||||
| list: res.data.list, | |||||
| total: res.data.total | |||||
| }); | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err) | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| this.getList(); | |||||
| }; | }; | ||||
| if (app.globalData.token && app.globalData.token != null) { | if (app.globalData.token && app.globalData.token != null) { | ||||
| app.couponChannelListCallback(app.globalData.token); | app.couponChannelListCallback(app.globalData.token); | ||||
| @@ -516,8 +516,8 @@ Page({ | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }; | }; | ||||
| // 砍价下拉刷新 | // 砍价下拉刷新 | ||||
| that.selectComponent("#bargain").getList1(); | |||||
| console.log(that.selectComponent("#bargain")) | |||||
| that.selectComponent("#bargain").getList(); | |||||
| that.selectComponent("#spellGroup").getList(); | |||||
| wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
| }, | }, | ||||
| //加载更多 | //加载更多 | ||||
| @@ -24,7 +24,7 @@ | |||||
| <!-- 砍价专场 --> | <!-- 砍价专场 --> | ||||
| <c-bargain id="bargain"/> | <c-bargain id="bargain"/> | ||||
| <!-- 拼团专场 --> | <!-- 拼团专场 --> | ||||
| <c-spellGroup/> | |||||
| <c-spellGroup id="spellGroup"/> | |||||
| <!-- 小游戏暂时注释 --> | <!-- 小游戏暂时注释 --> | ||||
| <view class='game' wx-if="{{showIf}}"> | <view class='game' wx-if="{{showIf}}"> | ||||
| <view class='game-entry'> | <view class='game-entry'> | ||||
| @@ -49,6 +49,7 @@ page { | |||||
| } | } | ||||
| .rushtobuyimgs{ | .rushtobuyimgs{ | ||||
| padding: 0 30rpx; | padding: 0 30rpx; | ||||
| margin-top:20rpx; | |||||
| } | } | ||||
| .rushtobuyimgs image{ | .rushtobuyimgs image{ | ||||
| width: 335rpx; | width: 335rpx; | ||||
| @@ -38,11 +38,8 @@ Component({ | |||||
| e.currentTarget.dataset.targetad | e.currentTarget.dataset.targetad | ||||
| }` | }` | ||||
| }); | }); | ||||
| } | |||||
| }, | |||||
| ready() { | |||||
| app.couponChannelListCallback = token => { | |||||
| Http.setToken(token); | |||||
| }, | |||||
| getList(){ | |||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponChannelList, | url: config.api.couponChannelList, | ||||
| data: { | data: { | ||||
| @@ -53,18 +50,24 @@ Component({ | |||||
| }).then(res => { | }).then(res => { | ||||
| this.setData({ | this.setData({ | ||||
| list: res.data.list, | list: res.data.list, | ||||
| total:res.data.total | |||||
| }); | |||||
| }) | |||||
| .catch(err => { | |||||
| console.log(err) | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| total: res.data.total | |||||
| }); | }); | ||||
| }) | }) | ||||
| .catch(err => { | |||||
| console.log(err) | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| } | |||||
| }, | |||||
| ready() { | |||||
| app.couponChannelListCallback = token => { | |||||
| Http.setToken(token); | |||||
| this.getList(); | |||||
| }; | }; | ||||
| if (app.globalData.token && app.globalData.token != null) { | if (app.globalData.token && app.globalData.token != null) { | ||||
| app.couponChannelListCallback(app.globalData.token); | app.couponChannelListCallback(app.globalData.token); | ||||