From d9c33efc12dc3a3e46ed550fa3903284bb7fd2ad Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Wed, 27 Dec 2023 15:42:27 +0800 Subject: [PATCH] 加购优化 --- components/add_purchase/add_purchase.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/components/add_purchase/add_purchase.js b/components/add_purchase/add_purchase.js index 88c941b..66b440f 100644 --- a/components/add_purchase/add_purchase.js +++ b/components/add_purchase/add_purchase.js @@ -18,7 +18,7 @@ Component({ properties: { }, - + lifetimes: { // attached: function () { // // this.clearTime() @@ -289,7 +289,7 @@ Component({ that.setData({ listServiceItem: t.data.data.listServiceItem, }); - }; + }; that.setData({ 'sele_g.goods_name': t.data.data.serviceName, 'sele_g.shop_price': t.data.data.money, @@ -1276,7 +1276,7 @@ Component({ let sele_g_new = t.data.data let sele_g = th.data.sele_g if (sele_g_new && sele_g_new.original_img && !sele_g.original_img) { - sele_g.original_img=sele_g_new.original_img + sele_g.original_img = sele_g_new.original_img } th.setData({ sele_g @@ -1458,7 +1458,7 @@ Component({ if (!th.data.sele_g) return false; var g_distr_type = th.data.sele_g.distr_type; - if ( g_distr_type && g_distr_type != 0) { + if (g_distr_type && g_distr_type != 0) { dd = { store_id: o.stoid, distr_type: g_distr_type, @@ -1490,7 +1490,7 @@ Component({ } wx.showLoading({ title: '加载中.', - mask:true + mask: true }); //----------获取门店---------------- getApp().request.promiseGet("/api/weshop/pickup/list", { @@ -3739,7 +3739,7 @@ Component({ sele_spec: function (e) { //如果只有一个规格直接结束 - if ((this.data.sku_g && this.data.sku_g.length==1) || (this.data.sku_g_pt && this.data.sku_g_pt.length==1)) { + if ((this.data.sku_g && this.data.sku_g.length == 1) || (this.data.sku_g_pt && this.data.sku_g_pt.length == 1)) { return } if (this.data.sp_seleing) { @@ -5239,7 +5239,7 @@ Component({ ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; this.setData(ob); }, - async getUserBuyPromNum(prom_id,is_zh) { + async getUserBuyPromNum(prom_id, is_zh) { var userInfo = getApp().globalData.userInfo; var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`; let res = await getApp().request.promiseGet(url, { @@ -5252,10 +5252,19 @@ Component({ this.setData({ userbuynum }) - if(is_zh) this.data.user_zh_buy_num=userbuynum; + if (is_zh) this.data.user_zh_buy_num = userbuynum; // return userbuynum }, - + //-- 根据ID拿出门店 -- + get_pick_from_list(pid) { + var all_pick_list = this.data.all_pick_list; + for (var i in all_pick_list) { + var item = all_pick_list[i]; + if (item.pickup_id == pid) { + return item; + } + } + }, } }) -- libgit2 0.21.4