From c936d90681e39113a91c121023026f142b8cee08 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Tue, 15 Oct 2019 11:11:30 +0800 Subject: [PATCH] 组件的修改,避免https://qa-weshop.yolipai.net的空调用 --- components/diy_goodsGroup/diy_goodsGroup.js | 55 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 14 deletions(-) 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, }); - }) + } }) }) -- libgit2 0.21.4