From 36c2d85b86a6ac1be7f02a7a670e741ca1793bfa Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Mon, 25 Mar 2019 21:34:37 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8B=BC=E5=9B=A2][=E4=BF=AE=E6=94=B9]:[?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/main/bargain/index.js | 25 ++----------------------- pages/main/index.js | 4 ++-- pages/main/index.wxml | 2 +- pages/main/index.wxss | 1 + pages/main/spellGroup/index.js | 33 ++++++++++++++++++--------------- 5 files changed, 24 insertions(+), 41 deletions(-) diff --git a/pages/main/bargain/index.js b/pages/main/bargain/index.js index 4498cf5..7c4627a 100644 --- a/pages/main/bargain/index.js +++ b/pages/main/bargain/index.js @@ -23,7 +23,7 @@ Component({ * 组件的方法列表 */ methods: { - getList1() { + getList() { let that = this; Http.get({ url: config.api.couponChannelList, @@ -68,28 +68,7 @@ Component({ ready() { app.couponChannelListCallback = 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) { app.couponChannelListCallback(app.globalData.token); diff --git a/pages/main/index.js b/pages/main/index.js index 63ec388..59dc778 100644 --- a/pages/main/index.js +++ b/pages/main/index.js @@ -516,8 +516,8 @@ Page({ wx.stopPullDownRefresh(); }; // 砍价下拉刷新 - that.selectComponent("#bargain").getList1(); - console.log(that.selectComponent("#bargain")) + that.selectComponent("#bargain").getList(); + that.selectComponent("#spellGroup").getList(); wx.stopPullDownRefresh(); }, //加载更多 diff --git a/pages/main/index.wxml b/pages/main/index.wxml index 7fcee84..fddf0d0 100644 --- a/pages/main/index.wxml +++ b/pages/main/index.wxml @@ -24,7 +24,7 @@ - + diff --git a/pages/main/index.wxss b/pages/main/index.wxss index 30d6368..8386e59 100644 --- a/pages/main/index.wxss +++ b/pages/main/index.wxss @@ -49,6 +49,7 @@ page { } .rushtobuyimgs{ padding: 0 30rpx; + margin-top:20rpx; } .rushtobuyimgs image{ width: 335rpx; diff --git a/pages/main/spellGroup/index.js b/pages/main/spellGroup/index.js index 0ea1dde..b7a7866 100644 --- a/pages/main/spellGroup/index.js +++ b/pages/main/spellGroup/index.js @@ -38,11 +38,8 @@ Component({ e.currentTarget.dataset.targetad }` }); - } - }, - ready() { - app.couponChannelListCallback = token => { - Http.setToken(token); + }, + getList(){ Http.get({ url: config.api.couponChannelList, data: { @@ -53,18 +50,24 @@ Component({ }).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 + 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) { app.couponChannelListCallback(app.globalData.token);