|
@@ -169,7 +169,8 @@ Page({ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
index: index, |
|
|
index: index, |
|
|
mallTenantId: mallTenantId, |
|
|
mallTenantId: mallTenantId, |
|
|
|
|
|
|
|
|
|
|
|
businePageNum: 1, // 切换广场后将页码切换至1 |
|
|
|
|
|
noDataFlag: false |
|
|
}); |
|
|
}); |
|
|
this.getBannerlist(); |
|
|
this.getBannerlist(); |
|
|
this.getBusinessList() |
|
|
this.getBusinessList() |
|
@@ -208,7 +209,8 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getCouponChannelList(key) { |
|
|
getCouponChannelList(key) { |
|
|
if (this.data.noDataFlag) { |
|
|
|
|
|
|
|
|
const that = this |
|
|
|
|
|
if (that.data.noDataFlag) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
tt.showLoading({ |
|
|
tt.showLoading({ |
|
@@ -217,14 +219,14 @@ Page({ |
|
|
let param = {} |
|
|
let param = {} |
|
|
if (key == 0) { |
|
|
if (key == 0) { |
|
|
param = { |
|
|
param = { |
|
|
pageNum: this.data.businePageNum, |
|
|
|
|
|
|
|
|
pageNum: that.data.businePageNum, |
|
|
pageSize: 6, |
|
|
pageSize: 6, |
|
|
targetAd: 101, |
|
|
targetAd: 101, |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || "" |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || "" |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
param = { |
|
|
param = { |
|
|
pageNum: this.data.businePageNum, |
|
|
|
|
|
|
|
|
pageNum: that.data.businePageNum, |
|
|
pageSize: 6, |
|
|
pageSize: 6, |
|
|
business: key, |
|
|
business: key, |
|
|
targetAd: 101, |
|
|
targetAd: 101, |
|
@@ -237,9 +239,10 @@ Page({ |
|
|
url: config.api.couponChannelList, |
|
|
url: config.api.couponChannelList, |
|
|
data: param |
|
|
data: param |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
|
|
|
|
|
|
if (res.data.list && res.data.list.length != 0) { |
|
|
if (res.data.list && res.data.list.length != 0) { |
|
|
|
|
|
let tempLsit = that.data.businessData |
|
|
|
|
|
|
|
|
let tempLsit = this.data.businessData |
|
|
|
|
|
let data = res.data.list |
|
|
let data = res.data.list |
|
|
data.map(item => { |
|
|
data.map(item => { |
|
|
if (item.salePriceStr && item.salePriceStr.indexOf('.') != -1) { |
|
|
if (item.salePriceStr && item.salePriceStr.indexOf('.') != -1) { |
|
@@ -250,24 +253,22 @@ Page({ |
|
|
item.sale = item.inventory - item.remainInventory |
|
|
item.sale = item.inventory - item.remainInventory |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (this.data.businePageNum > 1) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
|
if (that.data.businePageNum > 1) { |
|
|
|
|
|
that.setData({ |
|
|
businessData: [...tempLsit, ...data] |
|
|
businessData: [...tempLsit, ...data] |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ |
|
|
|
|
|
|
|
|
that.setData({ |
|
|
businessData: data |
|
|
businessData: data |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.setData({ |
|
|
|
|
|
// noDataFlag: true, |
|
|
|
|
|
businessData: [] |
|
|
|
|
|
|
|
|
that.setData({ |
|
|
|
|
|
noDataFlag: true, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
tt.hideLoading(); |
|
|
tt.hideLoading(); |
|
|
console.log(this.data.businessData, 'businessData'); |
|
|
|
|
|
|
|
|
console.log(that.data.businessData, 'businessData'); |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
tt.hideLoading(); |
|
|
tt.hideLoading(); |
|
|
tt.showModal({ |
|
|
tt.showModal({ |
|
@@ -1451,52 +1452,59 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 刷新 |
|
|
* 刷新 |
|
|
*/ |
|
|
*/ |
|
|
onPullDownRefresh: function (e) { |
|
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
tt.showLoading({ |
|
|
tt.showLoading({ |
|
|
title: "加载中..." |
|
|
title: "加载中..." |
|
|
}); |
|
|
}); |
|
|
let that = this; |
|
|
let that = this; |
|
|
|
|
|
// that.setData({ |
|
|
|
|
|
// topicObj2: null, //欢乐城首页限时抢购 |
|
|
|
|
|
// topicObj3: null, //欢乐城首页砍价 |
|
|
|
|
|
// topicObj4: null, //欢乐城首页拼团 |
|
|
|
|
|
// topicObj5: null, //欢乐城首页消费卡 |
|
|
|
|
|
// topicObj6: null, //欢乐城首页积分商城 |
|
|
|
|
|
// specialLsit: null, //专题 |
|
|
|
|
|
// }) |
|
|
|
|
|
// // that.getWeapNote(); |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
topicObj2: null, //欢乐城首页限时抢购 |
|
|
|
|
|
topicObj3: null, //欢乐城首页砍价 |
|
|
|
|
|
topicObj4: null, //欢乐城首页拼团 |
|
|
|
|
|
topicObj5: null, //欢乐城首页消费卡 |
|
|
|
|
|
topicObj6: null, //欢乐城首页积分商城 |
|
|
|
|
|
specialLsit: null, //专题 |
|
|
|
|
|
}) |
|
|
|
|
|
// that.getWeapNote(); |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
page: 1 |
|
|
|
|
|
|
|
|
page: 1, |
|
|
|
|
|
businePageNum: 1, |
|
|
|
|
|
noDataFlag: false |
|
|
}) |
|
|
}) |
|
|
if (that.data.optionsData != null && (that.data.optionsData.couponChannelId || that.data.optionsData.orderId)) { |
|
|
|
|
|
that.getWeapNote(that.data.optionsData.couponChannelId, that.data.optionsData.orderId); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.getWeapNote() |
|
|
|
|
|
} |
|
|
|
|
|
if (that.selectComponent("#lists")) { |
|
|
|
|
|
if (that.data.code == 0 || that.data.code == undefined) { |
|
|
|
|
|
that.selectComponent("#lists").getList(0, 1, "refresh"); |
|
|
|
|
|
tt.stopPullDownRefresh(); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); |
|
|
|
|
|
tt.stopPullDownRefresh(); |
|
|
|
|
|
}; |
|
|
|
|
|
that.selectComponent("#hot").getList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// if (that.data.optionsData != null && (that.data.optionsData.couponChannelId || that.data.optionsData.orderId)) { |
|
|
|
|
|
// that.getWeapNote(that.data.optionsData.couponChannelId, that.data.optionsData.orderId); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// that.getWeapNote() |
|
|
|
|
|
// } |
|
|
|
|
|
// if (that.selectComponent("#lists")) { |
|
|
|
|
|
// if (that.data.code == 0 || that.data.code == undefined) { |
|
|
|
|
|
// that.selectComponent("#lists").getList(0, 1, "refresh"); |
|
|
|
|
|
// tt.stopPullDownRefresh(); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); |
|
|
|
|
|
// tt.stopPullDownRefresh(); |
|
|
|
|
|
// }; |
|
|
|
|
|
// that.selectComponent("#hot").getList(); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
// 砍价下拉刷新 |
|
|
|
|
|
// that.selectComponent("#bargain").getList(); |
|
|
|
|
|
// that.selectComponent("#spellGroup").getList(); |
|
|
|
|
|
// that.selectComponent("#rushtobyCard").getList(); |
|
|
|
|
|
|
|
|
// // 砍价下拉刷新 |
|
|
|
|
|
// // that.selectComponent("#bargain").getList(); |
|
|
|
|
|
// // that.selectComponent("#spellGroup").getList(); |
|
|
|
|
|
// // that.selectComponent("#rushtobyCard").getList(); |
|
|
|
|
|
|
|
|
//爆款专区下拉刷新 |
|
|
|
|
|
|
|
|
// // 爆款专区下拉刷新 |
|
|
|
|
|
|
|
|
that.getxsList(); |
|
|
|
|
|
that.topicShow(); |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
|
|
|
// that.getxsList(); |
|
|
|
|
|
// that.topicShow(); |
|
|
|
|
|
|
|
|
|
|
|
this.getBannerlist(); |
|
|
|
|
|
this.getBusinessList() |
|
|
|
|
|
this.getCouponChannelList(this.data.busineKye) |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
tt.hideLoading(); |
|
|
tt.hideLoading(); |
|
|
tt.stopPullDownRefresh(); |
|
|
tt.stopPullDownRefresh(); |
|
|
}, 1000); |
|
|
|
|
|
|
|
|
}, 1600); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//加载更多 |
|
|
//加载更多 |
|
|