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,10 +1137,10 @@ Page({ | ||
| 1137 | map.set(item.prom_id+"",ob); | 1137 | map.set(item.prom_id+"",ob); |
| 1138 | } | 1138 | } |
| 1139 | } | 1139 | } |
| 1140 | - | ||
| 1141 | if(item.is_gift==1){ | 1140 | if(item.is_gift==1){ |
| 1142 | var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | 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 | list.goods.splice(i,1); | 1144 | list.goods.splice(i,1); |
| 1145 | } | 1145 | } |
| 1146 | } | 1146 | } |
pages/cart/cart2/cart2.js
| @@ -747,7 +747,7 @@ Page({ | @@ -747,7 +747,7 @@ Page({ | ||
| 747 | cart_item.shipping_price = 0; | 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 | if(by_qc.region_list!="" && by_qc.region_list!=null && by_qc.region_list!=undefined ){ | 752 | if(by_qc.region_list!="" && by_qc.region_list!=null && by_qc.region_list!=undefined ){ |
| 753 | if(th.check_by_area(by_qc.region_list)){ | 753 | if(th.check_by_area(by_qc.region_list)){ |
pages/goods/categoryList/categoryList.js
| @@ -47,14 +47,13 @@ Page({ | @@ -47,14 +47,13 @@ Page({ | ||
| 47 | is_pl_time:0, | 47 | is_pl_time:0, |
| 48 | requestData:null, //风格三的商品数据列表 分页 | 48 | requestData:null, //风格三的商品数据列表 分页 |
| 49 | stylePage:1, //商品列表分页标识 | 49 | stylePage:1, //商品列表分页标识 |
| 50 | - | ||
| 51 | //风格三使用 | 50 | //风格三使用 |
| 52 | url: t.globalData.setting.imghost, | 51 | url: t.globalData.setting.imghost, |
| 53 | currentPage: 1, | 52 | currentPage: 1, |
| 54 | requestData: null, | 53 | requestData: null, |
| 55 | allData: null, | 54 | allData: null, |
| 56 | openFilterModal: !1, | 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 | requestUrl: "", | 57 | requestUrl: "", |
| 59 | tabname: "goods_id", //排序的字段 | 58 | tabname: "goods_id", //排序的字段 |
| 60 | adname: "desc", //升降的字段 | 59 | adname: "desc", //升降的字段 |
| @@ -643,7 +642,7 @@ Page({ | @@ -643,7 +642,7 @@ Page({ | ||
| 643 | var that = this; | 642 | var that = this; |
| 644 | that.data.requestUrl = t; | 643 | that.data.requestUrl = t; |
| 645 | e.get("/api/weshop/goods/page?1=1", { | 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 | success: function (data) { | 646 | success: function (data) { |
| 648 | console.log(data.data.data.pageData) | 647 | console.log(data.data.data.pageData) |
| 649 | that.setData({ | 648 | that.setData({ |
| @@ -705,7 +704,7 @@ Page({ | @@ -705,7 +704,7 @@ Page({ | ||
| 705 | console.log("page:=" + page) | 704 | console.log("page:=" + page) |
| 706 | var s = this | 705 | var s = this |
| 707 | e.get("/api/weshop/goods/page?1=1", { | 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 | success: function (e) { | 708 | success: function (e) { |
| 710 | console.log(e.data.data.pageData) | 709 | console.log(e.data.data.pageData) |
| 711 | s.setData({ | 710 | s.setData({ |
| @@ -767,7 +766,7 @@ Page({ | @@ -767,7 +766,7 @@ Page({ | ||
| 767 | requestData: [] | 766 | requestData: [] |
| 768 | }); | 767 | }); |
| 769 | s.setData({ | 768 | s.setData({ |
| 770 | - timer: setInterval(function () { | 769 | + timer:setInterval(function () { |
| 771 | if (countDownNum == 0) { | 770 | if (countDownNum == 0) { |
| 772 | clearInterval(s.data.timer); | 771 | clearInterval(s.data.timer); |
| 773 | //关闭定时器之后,可作其他处理 | 772 | //关闭定时器之后,可作其他处理 |
utils/request.js
| @@ -206,6 +206,27 @@ module.exports = { | @@ -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 | time_limit_get(time,url,data){ | 231 | time_limit_get(time,url,data){ |
| 211 | var req=this.get(url,data); | 232 | var req=this.get(url,data); |