Commit e2856ed0 by zhangquan

附近优惠更换接口和参数

1 parent f166c481
...@@ -56,6 +56,13 @@ module.exports = { ...@@ -56,6 +56,13 @@ module.exports = {
...data, ...data,
}); });
}, },
// 首页--附近优惠 新接口
getLasteCommodity(data) {
return api.post({
method: `scrm.api.equity.main.page.carefully.chosen.page`,
...data,
});
},
// 首页--门店套餐 // 首页--门店套餐
storePackage(data) { storePackage(data) {
return api.post({ return api.post({
......
...@@ -180,20 +180,17 @@ Page({ ...@@ -180,20 +180,17 @@ Page({
}) })
return return
} }
wx.p.api.equityApi.lasteCommodity(para).then(res => { para.pageOffset = para.pageSize
if (!res?.length) { wx.p.api.equityApi.getLasteCommodity(para).then(res => {
if (!res?.data?.length) {
app.globalData.goodsLoaded = true app.globalData.goodsLoaded = true
return return
} }
app.globalData.goodsPageParam.pageSize +=1 app.globalData.goodsPageParam.pageSize = res.pageOffset
let tempArr = [] let tempArr = []
if (res) { res.data.forEach(item => {
res.forEach(item => {
if (item.couponsGoodsList) {
tempArr.push(item) tempArr.push(item)
}
}) })
}
app.globalData.goodsCommodityList = app.globalData.goodsCommodityList.concat(tempArr) app.globalData.goodsCommodityList = app.globalData.goodsCommodityList.concat(tempArr)
app.globalData.goodsLoaded = false app.globalData.goodsLoaded = false
this.setData({ this.setData({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!