Commit 3e2d5731159b7d37f423948bb6d5ff364345cc69

Authored by season
2 parents 7ad63480 c79c9233

Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp

... ... @@ -135,6 +135,49 @@ App({
135 135 }
136 136 })
137 137 }
  138 + else {
  139 + //--拿下code--
  140 + wx.login({
  141 + success: function (o) {
  142 + var dd = {
  143 + js_code: o.code,
  144 + store_id: os.stoid,
  145 + };
  146 + //-- 导购会员ID --
  147 + if (app.globalData.guide_id) {
  148 + dd.guide_id = app.globalData.guide_id;
  149 + }
  150 +
  151 + app.request.get("/api/weshop/users/openidandkey", {
  152 + data: dd,
  153 + success: function (e) {
  154 + if (e.data.code == 0) {
  155 + //如果有会员的话,没有sessionKey
  156 + if (!e.data.data.sessionKey) {
  157 + // getApp().showWarning("登录成功");
  158 +
  159 + app.globalData.userInfo = e.data.data;
  160 + app.globalData.user_id = e.data.data.user_id;
  161 + app.globalData.openid = e.data.data.weapp_openid;
  162 + //把会员的信息存在内存
  163 + wx.setStorageSync("userinfo", e.data.data);
  164 +
  165 + //调用接口判断是不是会员
  166 + app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
  167 + if (res.data.code == 0) {
  168 + app.globalData.guide_id = res.data.data.id;
  169 + app.globalData.guide_pick_id = res.data.data.pickup_id
  170 + }
  171 + })
  172 +
  173 +
  174 + }
  175 + }
  176 + }
  177 + })
  178 + }
  179 + })
  180 + }
138 181  
139 182 // else if(app.globalData.user_id){ //-- 启用默认的user_id --
140 183 // app.promiseGet("/api/weshop/users/get/" + app.globalData.setting.stoid + "/" + app.globalData.user_id,{}).then(res=>{
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -776,9 +776,10 @@ Page({
776 776  
777 777 // console.log('0xxxxx999999', t.data.data);
778 778 //-----商品详情---
779   - if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
780   - a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
781   - e.wxParseAddFullImageUrl(ee, "content");
  779 + //if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
  780 + //a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
  781 + //e.wxParseAddFullImageUrl(ee, "content");
  782 + getApp().deal_iframe(a,e,'content',t.data.data.serviceContent,ee);
782 783  
783 784 //获取重表
784 785 getApp().promiseGet("/api/weshop/serviceItem/list",{
... ...
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
... ... @@ -628,9 +628,11 @@ Page({
628 628  
629 629 that.getTaohe();
630 630 //-----商品详情---
631   - if (!t.data.data.serviceContent) t.data.data.serviceContent = " ";
632   - a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
633   - e.wxParseAddFullImageUrl(ee, "content");
  631 + //if (!t.data.data.serviceContent) t.data.data.serviceContent = " ";
  632 + //a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
  633 + //e.wxParseAddFullImageUrl(ee, "content");
  634 + getApp().deal_iframe(a,e,'content',t.data.data.serviceContent,ee);
  635 +
634 636  
635 637 //获取重表
636 638 getApp().promiseGet("/api/weshop/serviceItem/list", {
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... ... @@ -204,7 +204,7 @@
204 204 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
205 205 </block>
206 206 <block wx:else>
207   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  207 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy {{sp_seleing?'gray':''}} " data-action="buy">立即购买</view>
208 208 </block>
209 209  
210 210 </block>
... ... @@ -221,7 +221,7 @@
221 221 <view class="spec-cart-btn spec-buy w100" style="background-color: #dcdcdc;color: #999;">配送不匹配</view>
222 222 </block>
223 223 <block wx:else>
224   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
  224 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100 {{sp_seleing?'gray':''}}" data-action="buy">确定</view>
225 225 </block>
226 226 </block>
227 227  
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -3025,6 +3025,13 @@ Page({
3025 3025  
3026 3026 //-----------选择属性的按钮事件----------
3027 3027 sele_spec: function (e) {
  3028 +
  3029 + //防止重复点击
  3030 + if(this.data.sp_seleing){
  3031 + return false;
  3032 + }
  3033 + this.setData({sp_seleing:1})
  3034 +
3028 3035 var that = this, ee = this, th = this;
3029 3036 var gid = e.currentTarget.dataset.gid;
3030 3037 var nor = e.currentTarget.dataset.nor;
... ... @@ -3056,13 +3063,21 @@ Page({
3056 3063 });
3057 3064  
3058 3065  
3059   - that.check_is_youhui(gid, that.data.is_normal);
  3066 + this.get_sto(that.data.is_normal,()=>{
  3067 + that.sele_spec_next(gid,item)
  3068 + });
  3069 +
  3070 +
  3071 + },
3060 3072  
3061   - this.get_sto(that.data.is_normal);
3062 3073  
3063 3074  
3064   - //默认门店要拿下门店库存
3065   - if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) {
  3075 + sele_spec_next(gid,item){
  3076 + var that = this;
  3077 + that.check_is_youhui(gid, that.data.is_normal);
  3078 +
  3079 + //默认门店要拿下门店库存
  3080 + if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) {
3066 3081 var lock = 0, plist = null;
3067 3082 // //先读取门店的lock,采用链式写法,少用await
3068 3083 // getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
... ... @@ -3099,8 +3114,8 @@ Page({
3099 3114  
3100 3115 }
3101 3116  
  3117 + that.sele_spec_chech_activity();
3102 3118  
3103   - this.sele_spec_chech_activity();
3104 3119 },
3105 3120  
3106 3121 //选择了不同的规格的时候要判断是不是有活动正在进行中
... ... @@ -3155,7 +3170,8 @@ Page({
3155 3170 prom_start_time: prom.start_time,
3156 3171 prom_st: prom_st,
3157 3172 prom_act: prom,
3158   - prom_id: prom.id
  3173 + prom_id: prom.id,
  3174 + sp_seleing:0
3159 3175 })
3160 3176  
3161 3177 //却换图片
... ... @@ -3196,13 +3212,14 @@ Page({
3196 3212 prom_end_time: null,
3197 3213 prom_start_time: null,
3198 3214 prom_st: null,
  3215 + sp_seleing:0
3199 3216 })
3200 3217  
3201 3218 },
3202 3219  
3203 3220  
3204 3221 //---------拿出门店分类和门店------------
3205   - get_sto(e) {
  3222 + get_sto(e,func) {
3206 3223 var th = this, that = this;
3207 3224 var is_normal = e;
3208 3225  
... ... @@ -3253,9 +3270,9 @@ Page({
3253 3270 getApp().request.promiseGet("/api/weshop/pickup/list", {
3254 3271 data: dd,
3255 3272 }).then(res => {
3256   - var e = res;
  3273 + var e = res;
3257 3274  
3258   - if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
  3275 + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
3259 3276  
3260 3277 //-- 如果有指定门店的时候 --
3261 3278 if(th.data.sele_g.pickup_ids && th.data.is_normal){
... ... @@ -3346,7 +3363,13 @@ Page({
3346 3363 th.deal_pickup(e); //--普通门店排版--
3347 3364 }, 800)
3348 3365 }
  3366 +
  3367 + if(func) func();
  3368 +
3349 3369 }
  3370 + },err=>{
  3371 + ut.m_toast('网络繁忙,请稍后重试');
  3372 + wx.hideLoading();
3350 3373 })
3351 3374 }, 200)
3352 3375  
... ... @@ -4692,6 +4715,11 @@ Page({
4692 4715 //-----------------拼单生成方法---------------------
4693 4716 addCart_pt: function () {
4694 4717  
  4718 + //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
  4719 + if(this.data.sp_seleing){
  4720 + return false;
  4721 + }
  4722 +
4695 4723 if (this.data.is_normal == 0) {
4696 4724 //看一下有没有起购数,如果有起购数,要计算起购数
4697 4725 // var qnum = parseFloat(th.data.prom_act.minbuynum);
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... ... @@ -312,9 +312,9 @@
312 312 </view> -->
313 313 </view>
314 314 </view>
315   - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">
316   - {{sele_g.goods_name}}
317   - </view>
  315 +<!-- <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">-->
  316 +<!-- {{sele_g.goods_name}}-->
  317 +<!-- </view>-->
318 318 <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->
319 319 <!-- 许程 7.24 暂时注释 -->
320 320 <view wx:if="{{prom_type==1}}">
... ...
packageC/pages/presell/goodsInfo/goodsInfo.js
... ... @@ -4581,7 +4581,9 @@ Page({
4581 4581  
4582 4582 var user_id=getApp().globalData.user_id;
4583 4583 if(!user_id) user_id=0;
4584   - var url=''
  4584 +
  4585 + var url = "&goods_id=" +
  4586 + this.data.gid + "&pre_id=" + this.data.pre_arr.id;
4585 4587 //群id分享
4586 4588 if (getApp().globalData.groupchat_id) {
4587 4589 url+="&groupchat_id="+getApp().globalData.groupchat_id
... ...
pages/giftpack/birthdaygift/birthdaygift.js
1 1 var i = require("../../../utils/util.js")
  2 +const com = require("../../giftpack/public/buy_com.js");
2 3 var e = getApp(),
3 4 a = e.globalData.setting,
4 5 os = a,
... ... @@ -28,8 +29,45 @@ Page({
28 29 integralTitle: "",
29 30 growUpTitle: "",
30 31 is_sub: 0, //是否重复领取
  32 +
  33 + //门店相关
  34 + ismend: 0,
  35 + is_sec_mend: 0,
  36 + sto_sele_name: "", //选中的门店名称
  37 + sto_sele_id: "", //选中的门店id
  38 + sto_sele_distr: "", //选择的门店的配送方式
  39 + is_show_sto_cat: 1, //是否显示门店分类
  40 + only_pk: null,
  41 + all_sto: null,
  42 + sec_sto: null, //选择了的门店分类
  43 + pickpu_list: null, //读出的所有门店list
  44 + def_pickpu_list: null, //一开始5个门店list
  45 + sec_pick_index: 0, //第二级门店选择ID
  46 + fir_pick_index: 0, //第一级门店选择ID
  47 + all_pick_list: null,//所有的门店先记录起来
  48 +
  49 + select_store: 0, //选择更多
  50 + index: 1,
  51 + more_store: 0, //选择门店
  52 + sort_store: 0, //门店分类
  53 + choice_sort_store: 0, //选择分类门店
  54 + new_user: 0, //新用户
  55 +
  56 + def_pick_store: null, // 默认的门店
  57 + fir_def_store: null, //客户默认的门店的
  58 + lat: null, //维度
  59 + lon: null, //经度
  60 +
  61 + is_get_local_ok: 0, //获取坐标是否完成
  62 + region_name: "门店分类", //区域的名字
  63 + is_gps: 1,
  64 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  65 + default_store: {}, //创建添加默认门店地址的对象
  66 +
  67 + store: 0,
  68 + openSpecModal: 0,
31 69 },
32   - GetList: function() {
  70 + GetList:function() {
33 71 var th = this;
34 72 var url = "/api/weshop/marketing/giftbag/bound/get";
35 73 getApp().request.promiseGet(url, {
... ... @@ -43,9 +81,24 @@ Page({
43 81 }).then(res => {
44 82 if (res.data.code == 0) {
45 83 th.setData({
46   -
47 84 giftID: res.data.data.id,
48 85 })
  86 +
  87 + if(th.data.pickup_list && res.data.data.lbType.indexOf(',1,')>-1){
  88 +
  89 + th.data.is_nd_pk=1;
  90 + //-- 检测一下有没有门店 --
  91 + th.check_guide(function (){
  92 + com.wait_for_store_config(th);
  93 + com.set_user_mo_store(th, os, function () {
  94 + if (th.data.def_pick_store) {
  95 + com.check_def_pk(th);
  96 + }
  97 + });
  98 + com.get_sto(th, os);
  99 + })
  100 + }
  101 +
49 102 if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
50 103 //礼包内容--礼券
51 104 th.setData({
... ... @@ -115,11 +168,20 @@ Page({
115 168 },
116 169  
117 170 onLoad: function onLoad(options) {
118   -
119 171 var th = this;
120 172 th.setData({
121 173 getActId: options.actId,
122 174 giftID: options.giftBagId,
  175 + buyType:4
  176 + })
  177 +
  178 + getApp().getConfig2(function (e) {
  179 + var json_d = JSON.parse(e.switch_list);
  180 + th.setData({
  181 + bconfig: e,
  182 + sys_switch: json_d,
  183 + is_retail_price: json_d.is_retail_price || 0
  184 + });
123 185 })
124 186  
125 187 },
... ... @@ -130,11 +192,22 @@ Page({
130 192 getApp().goto('/packageE/pages/togoin/togoin');
131 193 return false;
132 194 }
133   - this.GetList();
134   - this.is_birthdayInfo()
  195 + this.is_birthdayInfo(this.GetList);
135 196  
136 197 },
137   - GetReceive: function() {
  198 +
  199 + //-- 领取礼包的优化 --
  200 + GetReceive:function (){
  201 + var th=this;
  202 + if(this.data.is_nd_pk){
  203 + th.setData({ openSpecModal: 1 })
  204 + th.pp_bacK_func=th.GetReceive_next; //设置回调函数
  205 + }else{
  206 + th.GetReceive_next();
  207 + }
  208 + },
  209 +
  210 + GetReceive_next: function() {
138 211 var th = this;
139 212 if (th.data.receiveState) {
140 213 return false;
... ... @@ -152,6 +225,12 @@ Page({
152 225 "userId": d.user_id, //用户ID
153 226 "buyFrom": 2
154 227 };
  228 +
  229 + //-- 如果需要门店的时候 --
  230 + if( th.data.is_nd_pk==1){
  231 + json.pickup_id=th.data.def_pick_store.pickup_id;
  232 + }
  233 +
155 234 var data = JSON.stringify(json);
156 235 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
157 236 getApp().request.json_post(url, json,
... ... @@ -177,7 +256,7 @@ Page({
177 256 }
178 257 },
179 258 //获取生日有礼信息
180   - is_birthdayInfo: function(e) {
  259 + is_birthdayInfo: function(func) {
181 260 var th = this;
182 261 var url = `/api/weshop/marketing/get/${a.stoid}/${th.data.getActId}`;
183 262 console.log(th.data.getActId);
... ... @@ -186,16 +265,35 @@ Page({
186 265 }).then(res => {
187 266 console.log(res,20000);
188 267 if (res.data.code == 0) {
  268 +
  269 + var sele_g=res.data.data;
  270 +
  271 + sele_g.giftTitle=sele_g.actName;
  272 + sele_g.lbUrl=sele_g.actImg;
  273 +
  274 +
189 275 let birthdayStyle=`
190 276 --bg-color:${res.data.data.actBgColor};
191 277 --color:${res.data.data.actFontColor};
192 278 `
  279 +
  280 +
  281 + if(res.data.data.is_pickup){
  282 + th.data.pickup_list=res.data.data.pickup_list;
  283 + sele_g.pickup_list=res.data.data.pickup_list;
  284 + sele_g.is_pickup=1;
  285 + }
  286 +
193 287 th.setData({
194 288 bimg: res.data.data.actBoundImg,
195 289 birthdayStyle,
  290 + sele_g
196 291 // actFontColor: res.data.actFontColor, //字体颜色
197 292 // actBgColor: res.data.actBgColor, //背景颜色
198 293 })
  294 +
  295 + func();
  296 +
199 297 }
200 298 })
201 299 },
... ... @@ -215,4 +313,404 @@ Page({
215 313 th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
216 314 }
217 315 },
  316 +
  317 + buy_libao: function () {
  318 + com.buy_libao(this)
  319 + },
  320 +
  321 +
  322 + //-- 选择门店 --
  323 + choice_store: function (ee) {
  324 + this.setData({
  325 + keyword:''
  326 + })
  327 +
  328 + //--先判断会员状态--
  329 + var user_info = getApp().globalData.userInfo;
  330 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  331 + wx.navigateTo({
  332 + url: '/packageE/pages/togoin/togoin',
  333 + })
  334 + return false;
  335 + }
  336 +
  337 + var th = this;
  338 + var ind = ee.currentTarget.dataset.ind;
  339 + var bconfig = th.data.bconfig;
  340 +
  341 + //如果开启了,则不在选择门店
  342 + // if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
  343 + // return false;
  344 + // }
  345 + // if (!th.data.only_pk && !th.data.def_pickpu_list) {
  346 + // getApp().confirmBox("门店库存不足", null, 25000, !1);
  347 + // return false;
  348 + // }
  349 +
  350 + if (th.data.only_pk && !th.data.only_pk.length) {
  351 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  352 + return false;
  353 + }
  354 + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
  355 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  356 + return false;
  357 + }
  358 +
  359 +
  360 + if (bconfig && bconfig.is_sort_storage) {
  361 + wx.getLocation({
  362 + type: 'gcj02',
  363 + success: function (res) {
  364 +
  365 + th.data.lat = res.latitude;
  366 + th.data.lon = res.longitude;
  367 + th.data.is_get_local_ok = 1;
  368 + th.setData({
  369 + is_gps: 1
  370 + });
  371 + //th.onShow();
  372 + com.get_sto(th, os);
  373 + },
  374 + fail: function (res) {
  375 + //th.onShow();
  376 + th.data.is_get_local_ok = 1;
  377 + com.get_sto(th, os);
  378 + if (res.errCode == 2) {
  379 + th.setData({
  380 + is_gps: 0
  381 + });
  382 + if (th.data.is_gps == 0) {
  383 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  384 + }
  385 + } else {
  386 + th.setData({
  387 + is_gps: "3"
  388 + });
  389 + }
  390 +
  391 + }
  392 + })
  393 + } else {
  394 + th.data.is_get_local_ok = 1;
  395 + com.get_sto(th, os);
  396 + }
  397 +
  398 + if (ind != undefined && ind != null) {
  399 + this.setData({
  400 + open_ind_store: ind,
  401 + store: 1,
  402 + openSpecModal: !1,
  403 + openSpecModal_pt: !1,
  404 + openSpecModal_flash_normal: !1,
  405 + })
  406 + } else {
  407 + this.setData({
  408 + store: 1,
  409 + openSpecModal: !1,
  410 + openSpecModal_pt: !1,
  411 + openSpecModal_flash_normal: !1
  412 +
  413 + })
  414 + }
  415 + },
  416 + //关闭选择门店
  417 + close_popup: function (e) {
  418 + var th = this;
  419 + this.setData({
  420 + store: 0,
  421 + choice_sort_store: 0,
  422 + sort_store: 0,
  423 + fir_pick_index: 0,
  424 + sec_pick_index: 0
  425 + })
  426 +
  427 + var openindstore = this.data.open_ind_store;
  428 + if (openindstore == 1) {
  429 + th.setData({
  430 + openSpecModal: !0,
  431 + openSpecModal_ind: openindstore,
  432 + });
  433 + } else if (openindstore == 2) {
  434 + th.setData({
  435 + openSpecModal: !0,
  436 + openSpecModal_ind: openindstore,
  437 + });
  438 + } else if (openindstore == 4) { //4就是拼团
  439 + th.setData({
  440 + openSpecModal_pt: 1, //打开拼团购买界面
  441 + store: 0, //关闭门店
  442 + choice_sort_store: 0, //关闭门店2级
  443 + sort_store: 0, //关闭门店2级
  444 + });
  445 + } else {
  446 + th.setData({
  447 + store: 0,
  448 + choice_sort_store: 0,
  449 + sort_store: 0
  450 + })
  451 + }
  452 +
  453 +
  454 + },
  455 + //选择更多门店
  456 + more_store: function () {
  457 + this.setData({
  458 + sort_store: 1
  459 + });
  460 + },
  461 + // 返回按钮
  462 + returns: function () {
  463 + this.setData({
  464 + sort_store: 0,
  465 + choice_sort_store: 0
  466 + });
  467 + },
  468 + //---选择分类门店---
  469 + choice_sort_store: function (e) {
  470 + var index = e.currentTarget.dataset.index;
  471 + var region_name = e.currentTarget.dataset.region;
  472 + var item = this.data.all_sto[index];
  473 + this.setData({
  474 + region_name: region_name,
  475 + sort_store: 0,
  476 + choice_sort_store: 1,
  477 + sec_i:index,
  478 + sec_sto: item,
  479 + sec_pick_index: 0
  480 + });
  481 + },
  482 + choose_for_store_fir: function (e) {
  483 + var index_c = e.currentTarget.dataset.ind;
  484 + var th = this;
  485 + th.setData({
  486 + fir_pick_index: index_c
  487 + })
  488 +
  489 + },
  490 + //确定def_pick为选择的门店
  491 + sure_pick: function (e) {
  492 + var th = this;
  493 + var item = null;
  494 + var openindstore = th.data.open_ind_store;
  495 +
  496 + if (th.data.choice_sort_store == 0) {
  497 + var index = th.data.fir_pick_index;
  498 + if (th.data.is_show_sto_cat == 1) {
  499 + item = th.data.def_pickpu_list[index];
  500 + } else {
  501 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  502 + }
  503 +
  504 + } else {
  505 + var index = th.data.sec_pick_index;
  506 + item = th.data.sec_sto.s_arr[index];
  507 + }
  508 +
  509 + if(!item) return false;
  510 +
  511 + if (!th.data.sele_g) return false;
  512 +
  513 + th.setData({
  514 + def_pick_store: item,
  515 + sto_sele_name: item.pickup_name,
  516 + sto_sele_id: item.pickup_id,
  517 + sto_sele_distr: item.distr_type,
  518 + store: 0,
  519 + choice_sort_store: 0,
  520 + fir_pick_index: 0,
  521 + openSpecModal: !0,
  522 + });
  523 +
  524 +
  525 + },
  526 + //---点击二级之后的选择---
  527 + choose_for_store: function (e) {
  528 + var index_c = e.currentTarget.dataset.ind;
  529 + var th = this;
  530 + th.setData({
  531 + sec_pick_index: index_c,
  532 + fir_pick_index: index_c
  533 + })
  534 +
  535 + },
  536 + //把选择的门店设置成默认的门店def_pick
  537 + set_def_pick: function (e) {
  538 + var th = this;
  539 + var item = null;
  540 + if (th.data.choice_sort_store == 0) {
  541 + var index = th.data.fir_pick_index;
  542 + if (th.data.is_show_sto_cat == 1) {
  543 + item = th.data.def_pickpu_list[index];
  544 + } else {
  545 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  546 + }
  547 + } else {
  548 + var index = th.data.sec_pick_index;
  549 + item = th.data.sec_sto.s_arr[index];
  550 + }
  551 +
  552 + if(!item) return false;
  553 +
  554 + th.setData({
  555 + def_pick_store: item,
  556 + sto_sele_name: item.pickup_name,
  557 + sto_sele_id: item.pickup_id,
  558 + sto_sele_distr: item.distr_type,
  559 + store: 0,
  560 + choice_sort_store: 0,
  561 + openSpecModal: !0,
  562 + });
  563 +
  564 + var user_id = getApp().globalData.user_id;
  565 + var def_pickup_id = item.pickup_id;
  566 + getApp().request.put('/api/weshop/users/update', {
  567 + data: {
  568 + user_id: user_id,
  569 + def_pickup_id: def_pickup_id
  570 + },
  571 + success: function (res) {
  572 + if (res.data.code == 0) {
  573 + if (th.data.choice_sort_store == 0) th.setData({
  574 + fir_pick_index: 0
  575 + });
  576 + getApp().globalData.pk_store = item;
  577 + } else {
  578 + getApp().my_warnning("设置默认门店地址失败", 0, th)
  579 + }
  580 +
  581 + }
  582 + });
  583 +
  584 +
  585 + },
  586 + closeSpecModal: function () {
  587 + this.setData({openSpecModal: 0});
  588 + },
  589 +
  590 + //获取搜索门店输入的值
  591 + input_store: function(e) {
  592 + this.setData({
  593 + keyword: e.detail.value
  594 + })
  595 + },
  596 + //-- 搜索门店 --
  597 + searchfn(){
  598 + let choice_sort_store = this.data.choice_sort_store
  599 + if (choice_sort_store==0) { //全局搜索
  600 + let all_pick_list = this.data.all_pick_list
  601 + let def_pickpu_list = this.data.def_pickpu_list
  602 + let keyword = this.data.keyword
  603 + if (keyword) {
  604 + let arr=all_pick_list.filter( item =>{
  605 + let i = item.pickup_name.indexOf(keyword)
  606 + if (i > -1) {
  607 + return true
  608 + }else{
  609 + return false
  610 + }
  611 + })
  612 + if (arr && arr.length>0) {
  613 + if(this.data.is_show_sto_cat==1){
  614 + this.setData({
  615 + def_pickpu_list:arr
  616 + })
  617 + }else{
  618 + this.setData({
  619 + only_pk:arr
  620 + })
  621 + }
  622 + }else{
  623 + wx.showToast({
  624 + title: '没有搜索到门店',
  625 + icon: 'none',
  626 + duration: 2000
  627 + })
  628 + }
  629 + }else{
  630 + if (this.data.is_show_sto_cat==1) {
  631 + this.setData({
  632 + def_pickpu_list:all_pick_list.slice(0,10)
  633 + })
  634 + }else{
  635 + this.setData({
  636 + only_pk:all_pick_list
  637 + })
  638 + }
  639 +
  640 + }
  641 + }else{ //分类下搜索
  642 + let sec_i=this.data.sec_i
  643 + let all_sto = this.data.all_sto
  644 + let old_all_sto = this.data.old_all_sto
  645 + if (!old_all_sto) {
  646 + this.setData({
  647 + old_all_sto:JSON.parse(JSON.stringify(all_sto))
  648 + })
  649 + }
  650 + let sec_sto= this.data.sec_sto
  651 + let sec_arr = this.data.old_all_sto[sec_i].s_arr
  652 + let keyword = this.data.keyword
  653 + let text='sec_sto.s_arr'
  654 + if (keyword) {
  655 + let arr=sec_arr.filter( item =>{
  656 + let i = item.pickup_name.indexOf(keyword)
  657 + if (i > -1) {
  658 + return true
  659 + }else{
  660 + return false
  661 + }
  662 + })
  663 + if (arr && arr.length>0) {
  664 + this.setData({
  665 + [text]:arr
  666 + })
  667 + }else{
  668 + wx.showToast({
  669 + title: '没有搜索到门店',
  670 + icon: 'none',
  671 + duration: 2000
  672 + })
  673 + }
  674 + }else{
  675 + if(this.data.old_all_sto){
  676 + this.setData({
  677 + [text]: this.data.old_all_sto[sec_i].s_arr
  678 + })
  679 + }else{
  680 + this.setData({
  681 + [text]: all_sto[sec_i].s_arr
  682 + })
  683 + }
  684 +
  685 + }
  686 +
  687 +
  688 + }
  689 + },
  690 +
  691 + check_guide(func){
  692 + var first_leader=this.data.first_leader;
  693 + if(!first_leader){
  694 + func();
  695 + return false;
  696 + }
  697 + if(this.data.is_geted_guide_pick){
  698 + func();
  699 + return false;
  700 + }
  701 + if(getApp().globalData.guide_pick_id){
  702 + func();
  703 + return false;
  704 + }
  705 + var th=this;
  706 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  707 + if (res.data.code == 0) {
  708 + getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  709 + }
  710 + th.data.is_geted_guide_pick=1;
  711 + func();
  712 + })
  713 + },
  714 +
  715 +
218 716 });
219 717 \ No newline at end of file
... ...
pages/giftpack/birthdaygift/birthdaygift.wxml
... ... @@ -180,4 +180,5 @@
180 180 </view>
181 181 <!-- 引入提示组件 -->
182 182 <warn id="warn"></warn>
183   -<my_confirm id="my_confirm"></my_confirm>
184 183 \ No newline at end of file
  184 +<my_confirm id="my_confirm"></my_confirm>
  185 +<include src="../public/buy_com.wxml"></include>
185 186 \ No newline at end of file
... ...
pages/giftpack/birthdaygift/birthdaygift.wxss
... ... @@ -356,4 +356,363 @@ button::after {
356 356 .font_and_bg {
357 357 background-color: var(--bg-color);
358 358 color:var(--color);
  359 +}
  360 +
  361 +
  362 +
  363 +/*-- 和弹出框的组件有关系 --*/
  364 +.xc-width {
  365 + width: 100%;
  366 +}
  367 +.spec-model {
  368 + position: fixed;
  369 + bottom: 0;
  370 + z-index: 20;
  371 + background: white;
  372 + width: 100%;
  373 + /* padding: 0 30rpx; */
  374 + font-size: 32rpx;
  375 + box-sizing: border-box;
  376 + border-radius: 20rpx 20rpx 0 0;
  377 + /* height: 72%; */
  378 +}
  379 +
  380 +.spec-model .pding {
  381 + padding: 0 20rpx;
  382 +}
  383 +.pding {
  384 + padding-top: 20rpx;
  385 + padding-left: 20rpx;
  386 + height: 81%;
  387 + padding-right: 20rpx;
  388 + font-size: 26rpx;
  389 + color: #ea120f
  390 +}
  391 +
  392 +.spec-goods {
  393 + padding: 30rpx 0 20rpx;
  394 + /* float: left; */
  395 + width: 100%;
  396 + /* border-bottom:2rpx solid #eee; */
  397 +}
  398 +
  399 +.spec-img {
  400 + float: left;
  401 + height: 186rpx;
  402 + width: 186rpx;
  403 + border: 4rpx solid #eee
  404 +}
  405 +
  406 +.spec-goods-info {
  407 + float: left;
  408 + padding: 0 25rpx;
  409 + width: 400rpx;
  410 +}
  411 +
  412 +.spec-goods-name {
  413 + font-size: 30rpx;
  414 + line-height: 35rpx;
  415 + height: 70rpx;
  416 + margin: 15rpx 20rpx 25rpx 0;
  417 + overflow: hidden;
  418 + text-overflow: ellipsis;
  419 + color: #333;
  420 +}
  421 +
  422 +.spec-goods-price {
  423 + color: #d60021;
  424 + font-size: 33rpx;
  425 + font-weight: bold;
  426 + /* display: flex; */
  427 +}
  428 +
  429 +.spec-goods-stock {
  430 + margin-top: 3rpx;
  431 + font-size: 24rpx;
  432 + color: #999999;
  433 + margin-right: 15rpx;
  434 +}
  435 +
  436 +.spec-name {
  437 + clear: both;
  438 + padding: 20rpx 0;
  439 + font-size: 30rpx;
  440 + color: #333;
  441 +}
  442 +.spec-name+view{
  443 + flex-wrap: wrap;
  444 +}
  445 +.stores-img {
  446 + width: 28rpx;
  447 + height: 28rpx;
  448 + margin-right: 10rpx;
  449 +}
  450 +.right-arrow {
  451 + width: 15rpx;
  452 + height: 15rpx;
  453 + border-top: 2rpx solid #d70026;
  454 + border-right: 2rpx solid #d70026;
  455 + transform: rotate(45deg);
  456 + display: inline-block;
  457 + margin-bottom: 3rpx;
  458 +}
  459 +
  460 +
  461 +.spec-btn {
  462 + color: black;
  463 + background-color: white;
  464 + padding: 10rpx 10rpx;
  465 + font-size: 26rpx;
  466 + line-height: 28rpx;
  467 + float: left;
  468 + border: 1rpx solid #dedede;
  469 + margin: 4rpx 10rpx 4rpx 0;
  470 + border-radius: 4rpx;
  471 +}
  472 +
  473 +.spec-btn-click {
  474 + color: white;
  475 + background-color: #f23030;
  476 + border: 1rpx solid #f23030;
  477 +}
  478 +
  479 +.spec-cart-btns {
  480 + /* width: 92%; */
  481 + line-height: 70rpx;
  482 + /* margin: 0rpx auto;
  483 + margin-top: 160rpx; */
  484 + /* border-radius: 20rpx; */
  485 + /* position: fixed; */
  486 + /* bottom: 50rpx; */
  487 + /* left: 4%; */
  488 + padding: 20rpx;
  489 +}
  490 +
  491 +.spec-cart-btn {
  492 +
  493 + width: 100%;
  494 + font-size: 30rpx;
  495 + text-align: center;
  496 + color: white;
  497 + border-radius: 40rpx;
  498 +}
  499 +
  500 +.spec-cart-btn.w40 {
  501 + width: 46%;
  502 +}
  503 +
  504 +.spec-add-cart {
  505 + background-color: #ffb03f;
  506 +}
  507 +
  508 +.spec-buy {
  509 + background-color: #f23030;
  510 + /* margin-left: 34rpx; */
  511 +}
  512 +
  513 +.spec-cart-disable {
  514 + background: #bbbbbb;
  515 +}
  516 +
  517 +.spec-cart-btn-lg {
  518 + width: 614rpx;
  519 +}
  520 +
  521 +/* 选择门店的弹窗 */
  522 +.mongolia-layer {
  523 + position: fixed;
  524 + left: 0;
  525 + top: 0;
  526 + right: 0;
  527 + bottom: 0;
  528 + z-index: 11;
  529 + background: rgba(0, 0, 0, 0.4);
  530 + width: 100%;
  531 + height: 91.9%;
  532 +
  533 +}
  534 +
  535 +.popup-frame {
  536 + position: fixed;
  537 + z-index: 20;
  538 + background: white;
  539 + width: 100%;
  540 + border-radius: 20rpx 20rpx 0 0;
  541 + height: auto;
  542 + bottom: 0;
  543 +}
  544 +
  545 +.popup-top {
  546 + border-bottom: 1rpx solid #eee;
  547 + height: 155rpx;
  548 + width: 95%;
  549 + margin: auto;
  550 + line-height: 155rpx;
  551 +
  552 +}
  553 +
  554 +.bg_rights {
  555 + border-top: 2rpx solid;
  556 + border-right: 2rpx solid;
  557 + transform: rotate(45deg);
  558 + display: inline-block;
  559 + width: 15rpx;
  560 + height: 15rpx;
  561 + border-color: #da0b31;
  562 +}
  563 +
  564 +.modal-closes {
  565 + position: absolute;
  566 + right: 30rpx;
  567 + top: -15rpx;
  568 + height: 25rpx;
  569 +
  570 +}
  571 +
  572 +.choose_more {
  573 + margin-top: 40rpx;
  574 + margin-right: 20rpx;
  575 +
  576 +}
  577 +
  578 +.choose_mores {
  579 + margin-top: 30rpx;
  580 + margin-right: 15rpx;
  581 +
  582 +}
  583 +
  584 +.store-list {
  585 + width: 95%;
  586 + min-height: 700rpx;
  587 + overflow-y: scroll;
  588 + margin: auto;
  589 + max-height: 700rpx;
  590 +}
  591 +
  592 +.store-list .store_choose {
  593 + width: 100%;
  594 + height: 120rpx;
  595 + line-height: 125rpx;
  596 + border-bottom: 1rpx solid #eee;
  597 + padding: 10rpx 0;
  598 +}
  599 +
  600 +.store-list .store_choose .store {
  601 + width: 100%;
  602 + margin: auto;
  603 + line-height: 37rpx;
  604 + padding-left: 20rpx;
  605 +
  606 +}
  607 +
  608 +.xc-hook {
  609 + width: 35rpx;
  610 + height: 35rpx;
  611 + transform: rotate(-145deg);
  612 + line-height: 37rpx;
  613 + text-align: center;
  614 +}
  615 +
  616 +.xc-hooks {
  617 + width: 30rpx;
  618 + height: 30rpx;
  619 + border: 1rpx solid #999;
  620 +}
  621 +
  622 +.address-frame {
  623 + width: 93%;
  624 + margin-left: 7rpx;
  625 +
  626 +}
  627 +
  628 +.nearby_store {
  629 + margin-left: 17rpx;
  630 +}
  631 +
  632 +.address_name {
  633 + margin-right: 10rpx;
  634 + width: 360rpx;
  635 +
  636 +}
  637 +
  638 +.address-val {
  639 + height: 38rpx;
  640 + line-height: 38rpx;
  641 +
  642 +}
  643 +
  644 +.store-bottom {
  645 + width: 85%;
  646 + margin: auto;
  647 + height: 90rpx;
  648 +}
  649 +
  650 +.searchbar {
  651 + height: 95rpx;
  652 + border-bottom: 2rpx solid rgb(238, 238, 238);
  653 +}
  654 +.storeListpadd {
  655 + padding: 0rpx 31rpx;
  656 +}
  657 +.search {
  658 + width: 125rpx;
  659 + height: 45rpx;
  660 + line-height: 45rpx;
  661 + background-color: rgb(219, 27, 52);
  662 + border-radius: 30rpx;
  663 + color: rgb(255, 255, 255);
  664 +}
  665 +.inputstore {
  666 + width: 510rpx;
  667 + height: 43rpx;
  668 + line-height: 43rpx;
  669 + border-radius: 30rpx;
  670 + border: 2rpx solid rgb(238, 238, 238);
  671 + padding-left: 30rpx;
  672 +}
  673 +
  674 +
  675 +
  676 +.determine {
  677 + width: 260rpx;
  678 + height: 55rpx;
  679 + border-radius: 50rpx;
  680 + line-height: 55rpx;
  681 +}
  682 +
  683 +.default {
  684 + width: 260rpx;
  685 + height: 55rpx;
  686 + border: 3rpx solid #c8c8c8;
  687 + border-radius: 50rpx;
  688 + line-height: 55rpx;
  689 +}
  690 +
  691 +.store-bottom-frame {
  692 + width: 95%;
  693 + margin: auto;
  694 +
  695 +}
  696 +
  697 +/* 门店分类列表 */
  698 +.sort_store_list {
  699 + max-height: 700rpx;
  700 + min-height: 700rpx;
  701 + overflow: hidden;
  702 + overflow-y: scroll;
  703 + width: 95%;
  704 + margin: auto;
  705 +}
  706 +
  707 +.sort_store_list .sort-store-frame {
  708 + width: 100%;
  709 + height: 100rpx;
  710 + line-height: 100rpx;
  711 + border-bottom: 1rpx solid #eee;
  712 +
  713 +}
  714 +
  715 +.sort_store_list .sort-store-frame .sort-store {
  716 + width: 94.5%;
  717 + margin: auto;
359 718 }
360 719 \ No newline at end of file
... ...
pages/goods/goodsInfo/buy_com_pop.wxml
... ... @@ -153,10 +153,10 @@
153 153 </view>
154 154 <block wx:else>
155 155 <view class="flex jc_sb">
156   - <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  156 + <view class="spec-cart-btn spec-buy w40 {{sp_seleing?'gray':''}}" bindtap="addCart"
157 157 data-action="add" style="background-color: #ffb03f;">加入购物车
158 158 </view>
159   - <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  159 + <view class="spec-cart-btn spec-buy w40 {{sp_seleing?'gray':''}}" bindtap="addCart"
160 160 data-action="buy">立即购买
161 161 </view>
162 162 </view>
... ... @@ -172,10 +172,10 @@
172 172  
173 173 <block wx:else>
174 174 <view class="flex jc_sb">
175   - <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  175 + <view class="spec-cart-btn spec-buy w40 {{sp_seleing?'gray':''}}" bindtap="addCart"
176 176 data-action="add" style="background-color: #ffb03f;">加入购物车
177 177 </view>
178   - <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  178 + <view class="spec-cart-btn spec-buy w40 {{sp_seleing?'gray':''}}" bindtap="addCart"
179 179 data-action="buy">立即购买
180 180 </view>
181 181 </view>
... ...
pages/goods/goodsInfo/buy_pt.wxml
... ... @@ -195,7 +195,7 @@
195 195 </view>
196 196 </block>
197 197 <block wx:else>
198   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  198 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy {{sp_seleing?'gray':''}}" data-action="buy">立即购买</view>
199 199 </block>
200 200 </block>
201 201 <!-- 线上销售 -->
... ... @@ -206,7 +206,7 @@
206 206 </view>
207 207 </block>
208 208 <block wx:else>
209   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  209 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy {{sp_seleing?'gray':''}}" data-action="buy">立即购买</view>
210 210 </block>
211 211 </block>
212 212 </block>
... ... @@ -226,7 +226,7 @@
226 226 <view class="spec-cart-btn spec-buy w100" data-action="add" style="background-color: #dcdcdc;color: #999;">该店不可售</view>
227 227 </block>
228 228 <block wx:else>
229   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
  229 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100 {{sp_seleing?'gray':''}}" data-action="buy">确定</view>
230 230 </block>
231 231 </block>
232 232  
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1392,6 +1392,10 @@ Page({
1392 1392  
1393 1393 //------------加入购物车--------------
1394 1394 addCart: function (t) {
  1395 + //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
  1396 + if(this.data.sp_seleing){
  1397 + return false;
  1398 + }
1395 1399  
1396 1400 var th = this;
1397 1401 var ind = t.currentTarget.dataset.openSpecModal_ind;
... ... @@ -3279,6 +3283,12 @@ Page({
3279 3283 //-----------选择属性的按钮事件----------
3280 3284 sele_spec: function (e) {
3281 3285  
  3286 + if(this.data.sp_seleing){
  3287 + return false;
  3288 + }
  3289 +
  3290 + this.setData({sp_seleing:1})
  3291 +
3282 3292 var that = this;
3283 3293 var th = this;
3284 3294  
... ... @@ -3365,22 +3375,27 @@ Page({
3365 3375 });
3366 3376  
3367 3377  
3368   -
3369 3378 if (nor) {
3370 3379 that.set_sele_g(sku_g)
3371   - that.get_sto(1);
  3380 + that.get_sto(1,()=>{
  3381 + that.sele_spec_next(that,item,gid,nor);
  3382 + });
3372 3383 }
3373   - else that.get_sto();
  3384 + else that.get_sto(null,()=>{
  3385 + that.sele_spec_next(that,item,gid,nor);
  3386 + });
3374 3387  
  3388 + },
3375 3389  
  3390 + //-- 选择规格下一步 --
  3391 + sele_spec_next(that,item,gid,nor){
3376 3392 if (!item.whsle_id && ([1, 2, 4, 6].indexOf(item.prom_type) == -1 || this.data.is_normal == 1))
3377 3393 that.check_is_youhui(gid, that.data.is_normal, 1);
3378 3394  
3379   -
3380 3395 //默认门店要拿下门店库存
3381 3396 if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1, 2, 4, 6].indexOf(item.prom_type) == -1) {
3382 3397 var lock = 0,
3383   - plist = null;
  3398 + plist = null;
3384 3399  
3385 3400 that.check_CanOutQty(that.data.sele_g, that.data.def_pick_store, function (CanOutQty) {
3386 3401 that.data.def_pick_store.CanOutQty = CanOutQty;
... ... @@ -3391,18 +3406,18 @@ Page({
3391 3406 })
3392 3407  
3393 3408 }
3394   - this.sele_spec_chech_activity(nor);
  3409 + that.sele_spec_chech_activity(nor);
3395 3410  
3396 3411 //如果是秒杀,拼团等互动,就不重新算界面
3397 3412 if ([1, 2, 4, 6, 8, 9].indexOf(this.data.base_nor_prom_type) > -1) {
3398 3413 return false;
3399 3414 }
3400 3415  
3401   - this.check_has_flash(gid);
  3416 + that.check_has_flash(gid);
3402 3417 var url = '/api/weshop/activitylist/listGoodActInfo2New';
3403 3418 var req_d = {
3404 3419 "store_id": os.stoid,
3405   - "goods_id": this.data.gid,
  3420 + "goods_id": that.data.gid,
3406 3421 "user_id": user_id,
3407 3422 }
3408 3423 getApp().request.get(url, {
... ... @@ -3421,7 +3436,7 @@ Page({
3421 3436 if (arr3 && arr3.length > 0) {
3422 3437 //获取活动信息
3423 3438 var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +
3424   - arr3[0].act_id + "/" + getApp().globalData.user_id;
  3439 + arr3[0].act_id + "/" + getApp().globalData.user_id;
3425 3440 getApp().request.get(url, {
3426 3441 success: function (e) {
3427 3442 if (e.data.code == 0 && e.data.data) {
... ... @@ -3450,9 +3465,7 @@ Page({
3450 3465 //选择了不同的规格的时候要判断是不是有活动正在进行中
3451 3466 async sele_spec_chech_activity(nor) {
3452 3467 //---如果是活动的时候---
3453   - var prom = null,
3454   - goodsinfo = this.data.sele_g,
3455   - th = this;
  3468 + var prom = null,goodsinfo = this.data.sele_g,th = this;
3456 3469  
3457 3470 //如果是普通购买的时候,要返回原先
3458 3471 if (goodsinfo.goods_id == this.data.base_nor_goods_id) {
... ... @@ -3537,7 +3550,8 @@ Page({
3537 3550 prom_start_time: prom.start_time,
3538 3551 prom_st: prom_st,
3539 3552 prom_act: prom,
3540   - prom_id: prom.id
  3553 + prom_id: prom.id,
  3554 + sp_seleing:0
3541 3555 })
3542 3556  
3543 3557 var pro_null=null;
... ... @@ -3581,7 +3595,10 @@ Page({
3581 3595 }
3582 3596 }
3583 3597  
3584   - if (nor) return false;
  3598 + if (nor){
  3599 + th.setData({ sp_seleing:0 })
  3600 + return false;
  3601 + }
3585 3602  
3586 3603 //---设置普通商品---
3587 3604 th.setData({
... ... @@ -3591,13 +3608,14 @@ Page({
3591 3608 prom_end_time: null,
3592 3609 prom_start_time: null,
3593 3610 prom_st: null,
  3611 + sp_seleing:0
3594 3612 })
3595 3613  
3596 3614 },
3597 3615  
3598 3616  
3599 3617 //---------拿出门店分类和门店------------
3600   - get_sto(e) {
  3618 + get_sto(e,func) {
3601 3619 console.log('get_sto')
3602 3620 var th = this,
3603 3621 that = this;
... ... @@ -3791,12 +3809,16 @@ Page({
3791 3809 th.deal_pickup(e); //--普通门店排版--
3792 3810 }, 800)
3793 3811 }
  3812 + if(func) func();
3794 3813 }else{
3795 3814 wx.hideLoading();
3796 3815 }
3797 3816 } else {
3798 3817 wx.hideLoading();
3799 3818 }
  3819 + },err=>{
  3820 + ut.m_toast('网络繁忙,请稍后重试');
  3821 + wx.hideLoading();
3800 3822 })
3801 3823 }, 200)
3802 3824  
... ... @@ -3807,6 +3829,7 @@ Page({
3807 3829 keyword: e.detail.value
3808 3830 })
3809 3831 },
  3832 +
3810 3833 //搜索门店
3811 3834 searchfn() {
3812 3835 let choice_sort_store = this.data.choice_sort_store
... ... @@ -4190,12 +4213,13 @@ Page({
4190 4213 is_find_def_store = 1;
4191 4214 }
4192 4215  
4193   - //-- 如果库存为0就要重新赋值 --
4194   - def_pick_store.CanOutQty=Qty;
4195   - th.setData({
  4216 + if(def_pick_store){
  4217 + //-- 如果库存为0就要重新赋值 --
  4218 + def_pick_store.CanOutQty=Qty;
  4219 + th.setData({
4196 4220 def_pick_store
4197   - })
4198   -
  4221 + })
  4222 + }
4199 4223  
4200 4224  
4201 4225 } else {
... ... @@ -5338,6 +5362,12 @@ Page({
5338 5362  
5339 5363 //-----------------拼单生成方法---------------------
5340 5364 addCart_pt: function () {
  5365 +
  5366 + //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
  5367 + if(this.data.sp_seleing){
  5368 + return false;
  5369 + }
  5370 +
5341 5371 var th = this;
5342 5372 if (this.data.is_normal == 0) {
5343 5373 //看一下有没有起购数,如果有起购数,要计算起购数
... ... @@ -6245,7 +6275,7 @@ Page({
6245 6275 if (type == 4) type = 0;
6246 6276 if (type == 2) type = 0;
6247 6277 if (type == 6) type = 2; // 6拼团 2团购
6248   - if (type == 10) type = -1;
  6278 + if (type == 10) type = 0;
6249 6279  
6250 6280  
6251 6281 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -1465,10 +1465,10 @@
1465 1465 </view>
1466 1466 </block>
1467 1467 <block wx:else>
1468   - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">
  1468 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow {{sp_seleing?'gray':''}}" data-action="add">
1469 1469 加入购物车
1470 1470 </view>
1471   - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
  1471 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{sp_seleing?'gray':''}}" data-action="buy">
1472 1472 {{sele_g.offline_price?"券后购买":"立即购买"}}
1473 1473 </view>
1474 1474 </block>
... ... @@ -1487,10 +1487,10 @@
1487 1487 </view>
1488 1488 </block>
1489 1489 <block wx:else>
1490   - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">
  1490 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow {{sp_seleing?'gray':''}}" data-action="add">
1491 1491 加入购物车
1492 1492 </view>
1493   - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
  1493 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{sp_seleing?'gray':''}}" data-action="buy">
1494 1494 {{sele_g.offline_price?"券后购买":"立即购买"}}
1495 1495 </view>
1496 1496 </block>
... ...