Commit 202437c39ce98f972c514ea8f96ac2afc5345dd1
1 parent
ca8977ef
燕云提的qa提的俩个问题
Showing
3 changed files
with
24 additions
and
3 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)){ |
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); |