diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index d01be96..a4467ba 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -120,7 +120,17 @@ Component({ } else if (prom_type == 6) { url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; } - return app.request.promiseGet(url, {}) + if(url==""){ + th.data.requestData.push(item); + th.setData({ goods_array: th.data.requestData, }); + if (th.data.firist_type_curr == th.data.firist_type_data.length) { + th.setData({ goods_btn: [] }); + } + }else{ + return app.request.promiseGet(url, {}) + } + + }).then(res => { index++; var prom = res.data.data; @@ -185,18 +195,27 @@ Component({ } else if (prom_type == 6) { url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; } - - app.request.promiseGet(url, {}).then(res => { - var prom = res.data.data; - if (prom != null) { - item.shop_price = res.data.data.price; - } + if(url!="") { + app.request.promiseGet(url, {}).then(res => { + var prom = res.data.data; + if (prom != null) { + item.shop_price = res.data.data.price; + } + th.data.requestData.push(item); + th.setData({ + goods_array: th.data.requestData, + page: th.data.currentPage - 1, + }); + }) + }else{ th.data.requestData.push(item); th.setData({ goods_array: th.data.requestData, page: th.data.currentPage - 1, }); - }) + } + + }) }) @@ -247,17 +266,25 @@ Component({ url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; } - app.request.promiseGet(url, {}).then(res => { - var prom = res.data.data; - if (prom != null) { - item.shop_price = res.data.data.price; - } + if(url!=null){ + app.request.promiseGet(url, {}).then(res => { + var prom = res.data.data; + if (prom != null) { + item.shop_price = res.data.data.price; + } + th.data.requestData.push(item); + th.setData({ + goods_array: th.data.requestData, + page: th.data.currentPage - 1, + }); + }) + }else{ th.data.requestData.push(item); th.setData({ goods_array: th.data.requestData, page: th.data.currentPage - 1, }); - }) + } }) })