Commit 57ba7ddc30b4f92f602898b7bb5731b87a62021f
Merge branch 'dev' into 'test'
Dev See merge request !425
Showing
4 changed files
with
28 additions
and
8 deletions
pages/cart/cart/cart.js
... | ... | @@ -1137,10 +1137,10 @@ Page({ |
1137 | 1137 | map.set(item.prom_id+"",ob); |
1138 | 1138 | } |
1139 | 1139 | } |
1140 | - | |
1141 | 1140 | if(item.is_gift==1){ |
1142 | 1141 | var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; |
1143 | - getApp().request.delete(url, {}); | |
1142 | + //getApp().request.delete(url, {}); | |
1143 | + await getApp().request.promiseDelete(url, {}) // 要用同步让赠品删除 | |
1144 | 1144 | list.goods.splice(i,1); |
1145 | 1145 | } |
1146 | 1146 | } | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -747,7 +747,7 @@ Page({ |
747 | 747 | cart_item.shipping_price = 0; |
748 | 748 | |
749 | 749 | //--有不包邮区域,且不免运费,全场的计算-- |
750 | - if(no_ex_id && freight_free>0 && o_price>freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) ){ | |
750 | + if(no_ex_id && freight_free>0 && o_price>=freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) ){ | |
751 | 751 | //如果有设置不包邮区域的时候 |
752 | 752 | if(by_qc.region_list!="" && by_qc.region_list!=null && by_qc.region_list!=undefined ){ |
753 | 753 | if(th.check_by_area(by_qc.region_list)){ | ... | ... |
pages/goods/categoryList/categoryList.js
... | ... | @@ -47,14 +47,13 @@ Page({ |
47 | 47 | is_pl_time:0, |
48 | 48 | requestData:null, //风格三的商品数据列表 分页 |
49 | 49 | stylePage:1, //商品列表分页标识 |
50 | - | |
51 | 50 | //风格三使用 |
52 | 51 | url: t.globalData.setting.imghost, |
53 | 52 | currentPage: 1, |
54 | 53 | requestData: null, |
55 | 54 | allData: null, |
56 | 55 | openFilterModal: !1, |
57 | - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id=1&is_recommend=1", | |
56 | + baseUrl: "api/weshop/goods/page?1=1&orderField=goods_id&orderType=desc&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", | |
58 | 57 | requestUrl: "", |
59 | 58 | tabname: "goods_id", //排序的字段 |
60 | 59 | adname: "desc", //升降的字段 |
... | ... | @@ -643,7 +642,7 @@ Page({ |
643 | 642 | var that = this; |
644 | 643 | that.data.requestUrl = t; |
645 | 644 | e.get("/api/weshop/goods/page?1=1", { |
646 | - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: 1, is_recommend: 1 }, | |
645 | + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
647 | 646 | success: function (data) { |
648 | 647 | console.log(data.data.data.pageData) |
649 | 648 | that.setData({ |
... | ... | @@ -705,7 +704,7 @@ Page({ |
705 | 704 | console.log("page:=" + page) |
706 | 705 | var s = this |
707 | 706 | e.get("/api/weshop/goods/page?1=1", { |
708 | - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: 1, is_recommend: 1 }, | |
707 | + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, | |
709 | 708 | success: function (e) { |
710 | 709 | console.log(e.data.data.pageData) |
711 | 710 | s.setData({ |
... | ... | @@ -767,7 +766,7 @@ Page({ |
767 | 766 | requestData: [] |
768 | 767 | }); |
769 | 768 | s.setData({ |
770 | - timer: setInterval(function () { | |
769 | + timer:setInterval(function () { | |
771 | 770 | if (countDownNum == 0) { |
772 | 771 | clearInterval(s.data.timer); |
773 | 772 | //关闭定时器之后,可作其他处理 | ... | ... |
utils/request.js
... | ... | @@ -206,6 +206,27 @@ module.exports = { |
206 | 206 | }) |
207 | 207 | }) |
208 | 208 | }, |
209 | + | |
210 | + //---promise的使用delete---- | |
211 | + promiseDelete:function(url,data){ | |
212 | + var th=this; | |
213 | + if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; | |
214 | + return new Promise((resolve, reject) => { | |
215 | + data.isShowLoading && th.showLoading(); | |
216 | + wx.request({ | |
217 | + url, | |
218 | + method: 'DELETE', | |
219 | + header: {"content-type": "application/x-www-form-urlencoded" }, | |
220 | + data:data.data, | |
221 | + success(res) { | |
222 | + data.isShowLoading && th.hideLoading(); | |
223 | + resolve(res); | |
224 | + }, | |
225 | + fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } | |
226 | + }) | |
227 | + }) | |
228 | + }, | |
229 | + | |
209 | 230 | //--------具有时间限制的读取接口---------- |
210 | 231 | time_limit_get(time,url,data){ |
211 | 232 | var req=this.get(url,data); | ... | ... |