Browse Source

[拼团][修改]:[下拉刷新]

tags/安徽版C.4.1.6最终版
meo 6 years ago
parent
commit
36c2d85b86
5 changed files with 24 additions and 41 deletions
  1. +2
    -23
      pages/main/bargain/index.js
  2. +2
    -2
      pages/main/index.js
  3. +1
    -1
      pages/main/index.wxml
  4. +1
    -0
      pages/main/index.wxss
  5. +18
    -15
      pages/main/spellGroup/index.js

+ 2
- 23
pages/main/bargain/index.js View File

@@ -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);


+ 2
- 2
pages/main/index.js View File

@@ -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();
}, },
//加载更多 //加载更多


+ 1
- 1
pages/main/index.wxml View File

@@ -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'>


+ 1
- 0
pages/main/index.wxss View File

@@ -49,6 +49,7 @@ page {
} }
.rushtobuyimgs{ .rushtobuyimgs{
padding: 0 30rpx; padding: 0 30rpx;
margin-top:20rpx;
} }
.rushtobuyimgs image{ .rushtobuyimgs image{
width: 335rpx; width: 335rpx;


+ 18
- 15
pages/main/spellGroup/index.js View File

@@ -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);


Loading…
Cancel
Save