Commit d9c33efc12dc3a3e46ed550fa3903284bb7fd2ad

Authored by 前端开发-罗建龙
1 parent f23d4e4f

加购优化

components/add_purchase/add_purchase.js
... ... @@ -18,7 +18,7 @@ Component({
18 18 properties: {
19 19  
20 20 },
21   -
  21 +
22 22 lifetimes: {
23 23 // attached: function () {
24 24 // // this.clearTime()
... ... @@ -289,7 +289,7 @@ Component({
289 289 that.setData({
290 290 listServiceItem: t.data.data.listServiceItem,
291 291 });
292   - };
  292 + };
293 293 that.setData({
294 294 'sele_g.goods_name': t.data.data.serviceName,
295 295 'sele_g.shop_price': t.data.data.money,
... ... @@ -1276,7 +1276,7 @@ Component({
1276 1276 let sele_g_new = t.data.data
1277 1277 let sele_g = th.data.sele_g
1278 1278 if (sele_g_new && sele_g_new.original_img && !sele_g.original_img) {
1279   - sele_g.original_img=sele_g_new.original_img
  1279 + sele_g.original_img = sele_g_new.original_img
1280 1280 }
1281 1281 th.setData({
1282 1282 sele_g
... ... @@ -1458,7 +1458,7 @@ Component({
1458 1458 if (!th.data.sele_g) return false;
1459 1459  
1460 1460 var g_distr_type = th.data.sele_g.distr_type;
1461   - if ( g_distr_type && g_distr_type != 0) {
  1461 + if (g_distr_type && g_distr_type != 0) {
1462 1462 dd = {
1463 1463 store_id: o.stoid,
1464 1464 distr_type: g_distr_type,
... ... @@ -1490,7 +1490,7 @@ Component({
1490 1490 }
1491 1491 wx.showLoading({
1492 1492 title: '加载中.',
1493   - mask:true
  1493 + mask: true
1494 1494 });
1495 1495 //----------获取门店----------------
1496 1496 getApp().request.promiseGet("/api/weshop/pickup/list", {
... ... @@ -3739,7 +3739,7 @@ Component({
3739 3739 sele_spec: function (e) {
3740 3740  
3741 3741 //如果只有一个规格直接结束
3742   - if ((this.data.sku_g && this.data.sku_g.length==1) || (this.data.sku_g_pt && this.data.sku_g_pt.length==1)) {
  3742 + if ((this.data.sku_g && this.data.sku_g.length == 1) || (this.data.sku_g_pt && this.data.sku_g_pt.length == 1)) {
3743 3743 return
3744 3744 }
3745 3745 if (this.data.sp_seleing) {
... ... @@ -5239,7 +5239,7 @@ Component({
5239 5239 ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
5240 5240 this.setData(ob);
5241 5241 },
5242   - async getUserBuyPromNum(prom_id,is_zh) {
  5242 + async getUserBuyPromNum(prom_id, is_zh) {
5243 5243 var userInfo = getApp().globalData.userInfo;
5244 5244 var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`;
5245 5245 let res = await getApp().request.promiseGet(url, {
... ... @@ -5252,10 +5252,19 @@ Component({
5252 5252 this.setData({
5253 5253 userbuynum
5254 5254 })
5255   - if(is_zh) this.data.user_zh_buy_num=userbuynum;
  5255 + if (is_zh) this.data.user_zh_buy_num = userbuynum;
5256 5256 // return userbuynum
5257 5257 },
5258   -
  5258 + //-- 根据ID拿出门店 --
  5259 + get_pick_from_list(pid) {
  5260 + var all_pick_list = this.data.all_pick_list;
  5261 + for (var i in all_pick_list) {
  5262 + var item = all_pick_list[i];
  5263 + if (item.pickup_id == pid) {
  5264 + return item;
  5265 + }
  5266 + }
  5267 + },
5259 5268  
5260 5269 }
5261 5270 })
... ...