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,25 +180,22 @@ Page({ ...@@ -180,25 +180,22 @@ 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 => {
app.globalData.goodsLoaded = true if (!res?.data?.length) {
return app.globalData.goodsLoaded = true
} return
app.globalData.goodsPageParam.pageSize +=1 }
let tempArr = [] app.globalData.goodsPageParam.pageSize = res.pageOffset
if (res) { let tempArr = []
res.forEach(item => { res.data.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({ commodityList: app.globalData.goodsCommodityList,
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!