Commit e2856ed0 by zhangquan

附近优惠更换接口和参数

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