diff --git a/app.js b/app.js
index 57c6283..2d5fe48 100644
--- a/app.js
+++ b/app.js
@@ -135,6 +135,49 @@ App({
}
})
}
+ else {
+ //--拿下code--
+ wx.login({
+ success: function (o) {
+ var dd = {
+ js_code: o.code,
+ store_id: os.stoid,
+ };
+ //-- 导购会员ID --
+ if (app.globalData.guide_id) {
+ dd.guide_id = app.globalData.guide_id;
+ }
+
+ app.request.get("/api/weshop/users/openidandkey", {
+ data: dd,
+ success: function (e) {
+ if (e.data.code == 0) {
+ //如果有会员的话,没有sessionKey
+ if (!e.data.data.sessionKey) {
+ // getApp().showWarning("登录成功");
+
+ app.globalData.userInfo = e.data.data;
+ app.globalData.user_id = e.data.data.user_id;
+ app.globalData.openid = e.data.data.weapp_openid;
+ //把会员的信息存在内存
+ wx.setStorageSync("userinfo", e.data.data);
+
+ //调用接口判断是不是会员
+ app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
+ if (res.data.code == 0) {
+ app.globalData.guide_id = res.data.data.id;
+ app.globalData.guide_pick_id = res.data.data.pickup_id
+ }
+ })
+
+
+ }
+ }
+ }
+ })
+ }
+ })
+ }
// else if(app.globalData.user_id){ //-- 启用默认的user_id --
// app.promiseGet("/api/weshop/users/get/" + app.globalData.setting.stoid + "/" + app.globalData.user_id,{}).then(res=>{
diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js
index 8bdb315..6494045 100644
--- a/packageA/pages/goodsInfo/goodsInfo.js
+++ b/packageA/pages/goodsInfo/goodsInfo.js
@@ -776,9 +776,10 @@ Page({
// console.log('0xxxxx999999', t.data.data);
//-----商品详情---
- if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
- a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
- e.wxParseAddFullImageUrl(ee, "content");
+ //if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
+ //a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
+ //e.wxParseAddFullImageUrl(ee, "content");
+ getApp().deal_iframe(a,e,'content',t.data.data.serviceContent,ee);
//获取重表
getApp().promiseGet("/api/weshop/serviceItem/list",{
diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
index fa605f0..74eb0b3 100644
--- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
+++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
@@ -628,9 +628,11 @@ Page({
that.getTaohe();
//-----商品详情---
- if (!t.data.data.serviceContent) t.data.data.serviceContent = " ";
- a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
- e.wxParseAddFullImageUrl(ee, "content");
+ //if (!t.data.data.serviceContent) t.data.data.serviceContent = " ";
+ //a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6);
+ //e.wxParseAddFullImageUrl(ee, "content");
+ getApp().deal_iframe(a,e,'content',t.data.data.serviceContent,ee);
+
//获取重表
getApp().promiseGet("/api/weshop/serviceItem/list", {
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
index a07ac33..aba0c02 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
@@ -204,7 +204,7 @@
库存不足
- 立即购买
+ 立即购买
@@ -221,7 +221,7 @@
配送不匹配
- 确定
+ 确定
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
index 853fc10..ca144a0 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -3025,6 +3025,13 @@ Page({
//-----------选择属性的按钮事件----------
sele_spec: function (e) {
+
+ //防止重复点击
+ if(this.data.sp_seleing){
+ return false;
+ }
+ this.setData({sp_seleing:1})
+
var that = this, ee = this, th = this;
var gid = e.currentTarget.dataset.gid;
var nor = e.currentTarget.dataset.nor;
@@ -3056,13 +3063,21 @@ Page({
});
- that.check_is_youhui(gid, that.data.is_normal);
+ this.get_sto(that.data.is_normal,()=>{
+ that.sele_spec_next(gid,item)
+ });
+
+
+ },
- this.get_sto(that.data.is_normal);
- //默认门店要拿下门店库存
- if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) {
+ sele_spec_next(gid,item){
+ var that = this;
+ that.check_is_youhui(gid, that.data.is_normal);
+
+ //默认门店要拿下门店库存
+ if (!getApp().is_virtual(item) && !item.whsle_id && that.data.sales_rules >= 2 && that.data.def_pick_store) {
var lock = 0, plist = null;
// //先读取门店的lock,采用链式写法,少用await
// getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
@@ -3099,8 +3114,8 @@ Page({
}
+ that.sele_spec_chech_activity();
- this.sele_spec_chech_activity();
},
//选择了不同的规格的时候要判断是不是有活动正在进行中
@@ -3155,7 +3170,8 @@ Page({
prom_start_time: prom.start_time,
prom_st: prom_st,
prom_act: prom,
- prom_id: prom.id
+ prom_id: prom.id,
+ sp_seleing:0
})
//却换图片
@@ -3196,13 +3212,14 @@ Page({
prom_end_time: null,
prom_start_time: null,
prom_st: null,
+ sp_seleing:0
})
},
//---------拿出门店分类和门店------------
- get_sto(e) {
+ get_sto(e,func) {
var th = this, that = this;
var is_normal = e;
@@ -3253,9 +3270,9 @@ Page({
getApp().request.promiseGet("/api/weshop/pickup/list", {
data: dd,
}).then(res => {
- var e = res;
+ var e = res;
- if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
+ if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
//-- 如果有指定门店的时候 --
if(th.data.sele_g.pickup_ids && th.data.is_normal){
@@ -3346,7 +3363,13 @@ Page({
th.deal_pickup(e); //--普通门店排版--
}, 800)
}
+
+ if(func) func();
+
}
+ },err=>{
+ ut.m_toast('网络繁忙,请稍后重试');
+ wx.hideLoading();
})
}, 200)
@@ -4692,6 +4715,11 @@ Page({
//-----------------拼单生成方法---------------------
addCart_pt: function () {
+ //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
+ if(this.data.sp_seleing){
+ return false;
+ }
+
if (this.data.is_normal == 0) {
//看一下有没有起购数,如果有起购数,要计算起购数
// var qnum = parseFloat(th.data.prom_act.minbuynum);
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
index 5e00ddd..dd5d90a 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -312,9 +312,9 @@
-->
-
- {{sele_g.goods_name}}
-
+
+
+
diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js
index be5d872..d840416 100644
--- a/packageC/pages/presell/goodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -4581,7 +4581,9 @@ Page({
var user_id=getApp().globalData.user_id;
if(!user_id) user_id=0;
- var url=''
+
+ var url = "&goods_id=" +
+ this.data.gid + "&pre_id=" + this.data.pre_arr.id;
//群id分享
if (getApp().globalData.groupchat_id) {
url+="&groupchat_id="+getApp().globalData.groupchat_id
diff --git a/pages/giftpack/birthdaygift/birthdaygift.js b/pages/giftpack/birthdaygift/birthdaygift.js
index 0e44149..6918a3a 100644
--- a/pages/giftpack/birthdaygift/birthdaygift.js
+++ b/pages/giftpack/birthdaygift/birthdaygift.js
@@ -1,4 +1,5 @@
var i = require("../../../utils/util.js")
+const com = require("../../giftpack/public/buy_com.js");
var e = getApp(),
a = e.globalData.setting,
os = a,
@@ -28,8 +29,45 @@ Page({
integralTitle: "",
growUpTitle: "",
is_sub: 0, //是否重复领取
+
+ //门店相关
+ ismend: 0,
+ is_sec_mend: 0,
+ sto_sele_name: "", //选中的门店名称
+ sto_sele_id: "", //选中的门店id
+ sto_sele_distr: "", //选择的门店的配送方式
+ is_show_sto_cat: 1, //是否显示门店分类
+ only_pk: null,
+ all_sto: null,
+ sec_sto: null, //选择了的门店分类
+ pickpu_list: null, //读出的所有门店list
+ def_pickpu_list: null, //一开始5个门店list
+ sec_pick_index: 0, //第二级门店选择ID
+ fir_pick_index: 0, //第一级门店选择ID
+ all_pick_list: null,//所有的门店先记录起来
+
+ select_store: 0, //选择更多
+ index: 1,
+ more_store: 0, //选择门店
+ sort_store: 0, //门店分类
+ choice_sort_store: 0, //选择分类门店
+ new_user: 0, //新用户
+
+ def_pick_store: null, // 默认的门店
+ fir_def_store: null, //客户默认的门店的
+ lat: null, //维度
+ lon: null, //经度
+
+ is_get_local_ok: 0, //获取坐标是否完成
+ region_name: "门店分类", //区域的名字
+ is_gps: 1,
+ open_ind_store: 0, //哪里打开的门店列表的控制属性
+ default_store: {}, //创建添加默认门店地址的对象
+
+ store: 0,
+ openSpecModal: 0,
},
- GetList: function() {
+ GetList:function() {
var th = this;
var url = "/api/weshop/marketing/giftbag/bound/get";
getApp().request.promiseGet(url, {
@@ -43,9 +81,24 @@ Page({
}).then(res => {
if (res.data.code == 0) {
th.setData({
-
giftID: res.data.data.id,
})
+
+ if(th.data.pickup_list && res.data.data.lbType.indexOf(',1,')>-1){
+
+ th.data.is_nd_pk=1;
+ //-- 检测一下有没有门店 --
+ th.check_guide(function (){
+ com.wait_for_store_config(th);
+ com.set_user_mo_store(th, os, function () {
+ if (th.data.def_pick_store) {
+ com.check_def_pk(th);
+ }
+ });
+ com.get_sto(th, os);
+ })
+ }
+
if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
//礼包内容--礼券
th.setData({
@@ -115,11 +168,20 @@ Page({
},
onLoad: function onLoad(options) {
-
var th = this;
th.setData({
getActId: options.actId,
giftID: options.giftBagId,
+ buyType:4
+ })
+
+ getApp().getConfig2(function (e) {
+ var json_d = JSON.parse(e.switch_list);
+ th.setData({
+ bconfig: e,
+ sys_switch: json_d,
+ is_retail_price: json_d.is_retail_price || 0
+ });
})
},
@@ -130,11 +192,22 @@ Page({
getApp().goto('/packageE/pages/togoin/togoin');
return false;
}
- this.GetList();
- this.is_birthdayInfo()
+ this.is_birthdayInfo(this.GetList);
},
- GetReceive: function() {
+
+ //-- 领取礼包的优化 --
+ GetReceive:function (){
+ var th=this;
+ if(this.data.is_nd_pk){
+ th.setData({ openSpecModal: 1 })
+ th.pp_bacK_func=th.GetReceive_next; //设置回调函数
+ }else{
+ th.GetReceive_next();
+ }
+ },
+
+ GetReceive_next: function() {
var th = this;
if (th.data.receiveState) {
return false;
@@ -152,6 +225,12 @@ Page({
"userId": d.user_id, //用户ID
"buyFrom": 2
};
+
+ //-- 如果需要门店的时候 --
+ if( th.data.is_nd_pk==1){
+ json.pickup_id=th.data.def_pick_store.pickup_id;
+ }
+
var data = JSON.stringify(json);
var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
getApp().request.json_post(url, json,
@@ -177,7 +256,7 @@ Page({
}
},
//获取生日有礼信息
- is_birthdayInfo: function(e) {
+ is_birthdayInfo: function(func) {
var th = this;
var url = `/api/weshop/marketing/get/${a.stoid}/${th.data.getActId}`;
console.log(th.data.getActId);
@@ -186,16 +265,35 @@ Page({
}).then(res => {
console.log(res,20000);
if (res.data.code == 0) {
+
+ var sele_g=res.data.data;
+
+ sele_g.giftTitle=sele_g.actName;
+ sele_g.lbUrl=sele_g.actImg;
+
+
let birthdayStyle=`
--bg-color:${res.data.data.actBgColor};
--color:${res.data.data.actFontColor};
`
+
+
+ if(res.data.data.is_pickup){
+ th.data.pickup_list=res.data.data.pickup_list;
+ sele_g.pickup_list=res.data.data.pickup_list;
+ sele_g.is_pickup=1;
+ }
+
th.setData({
bimg: res.data.data.actBoundImg,
birthdayStyle,
+ sele_g
// actFontColor: res.data.actFontColor, //字体颜色
// actBgColor: res.data.actBgColor, //背景颜色
})
+
+ func();
+
}
})
},
@@ -215,4 +313,404 @@ Page({
th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
}
},
+
+ buy_libao: function () {
+ com.buy_libao(this)
+ },
+
+
+ //-- 选择门店 --
+ choice_store: function (ee) {
+ this.setData({
+ keyword:''
+ })
+
+ //--先判断会员状态--
+ var user_info = getApp().globalData.userInfo;
+ if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
+ wx.navigateTo({
+ url: '/packageE/pages/togoin/togoin',
+ })
+ return false;
+ }
+
+ var th = this;
+ var ind = ee.currentTarget.dataset.ind;
+ var bconfig = th.data.bconfig;
+
+ //如果开启了,则不在选择门店
+ // if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
+ // return false;
+ // }
+ // if (!th.data.only_pk && !th.data.def_pickpu_list) {
+ // getApp().confirmBox("门店库存不足", null, 25000, !1);
+ // return false;
+ // }
+
+ if (th.data.only_pk && !th.data.only_pk.length) {
+ getApp().confirmBox("门店库存不足", null, 25000, !1);
+ return false;
+ }
+ if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
+ getApp().confirmBox("门店库存不足", null, 25000, !1);
+ return false;
+ }
+
+
+ if (bconfig && bconfig.is_sort_storage) {
+ wx.getLocation({
+ type: 'gcj02',
+ success: function (res) {
+
+ th.data.lat = res.latitude;
+ th.data.lon = res.longitude;
+ th.data.is_get_local_ok = 1;
+ th.setData({
+ is_gps: 1
+ });
+ //th.onShow();
+ com.get_sto(th, os);
+ },
+ fail: function (res) {
+ //th.onShow();
+ th.data.is_get_local_ok = 1;
+ com.get_sto(th, os);
+ if (res.errCode == 2) {
+ th.setData({
+ is_gps: 0
+ });
+ if (th.data.is_gps == 0) {
+ getApp().confirmBox("请开启GPS定位", null, 25000, !1);
+ }
+ } else {
+ th.setData({
+ is_gps: "3"
+ });
+ }
+
+ }
+ })
+ } else {
+ th.data.is_get_local_ok = 1;
+ com.get_sto(th, os);
+ }
+
+ if (ind != undefined && ind != null) {
+ this.setData({
+ open_ind_store: ind,
+ store: 1,
+ openSpecModal: !1,
+ openSpecModal_pt: !1,
+ openSpecModal_flash_normal: !1,
+ })
+ } else {
+ this.setData({
+ store: 1,
+ openSpecModal: !1,
+ openSpecModal_pt: !1,
+ openSpecModal_flash_normal: !1
+
+ })
+ }
+ },
+ //关闭选择门店
+ close_popup: function (e) {
+ var th = this;
+ this.setData({
+ store: 0,
+ choice_sort_store: 0,
+ sort_store: 0,
+ fir_pick_index: 0,
+ sec_pick_index: 0
+ })
+
+ var openindstore = this.data.open_ind_store;
+ if (openindstore == 1) {
+ th.setData({
+ openSpecModal: !0,
+ openSpecModal_ind: openindstore,
+ });
+ } else if (openindstore == 2) {
+ th.setData({
+ openSpecModal: !0,
+ openSpecModal_ind: openindstore,
+ });
+ } else if (openindstore == 4) { //4就是拼团
+ th.setData({
+ openSpecModal_pt: 1, //打开拼团购买界面
+ store: 0, //关闭门店
+ choice_sort_store: 0, //关闭门店2级
+ sort_store: 0, //关闭门店2级
+ });
+ } else {
+ th.setData({
+ store: 0,
+ choice_sort_store: 0,
+ sort_store: 0
+ })
+ }
+
+
+ },
+ //选择更多门店
+ more_store: function () {
+ this.setData({
+ sort_store: 1
+ });
+ },
+ // 返回按钮
+ returns: function () {
+ this.setData({
+ sort_store: 0,
+ choice_sort_store: 0
+ });
+ },
+ //---选择分类门店---
+ choice_sort_store: function (e) {
+ var index = e.currentTarget.dataset.index;
+ var region_name = e.currentTarget.dataset.region;
+ var item = this.data.all_sto[index];
+ this.setData({
+ region_name: region_name,
+ sort_store: 0,
+ choice_sort_store: 1,
+ sec_i:index,
+ sec_sto: item,
+ sec_pick_index: 0
+ });
+ },
+ choose_for_store_fir: function (e) {
+ var index_c = e.currentTarget.dataset.ind;
+ var th = this;
+ th.setData({
+ fir_pick_index: index_c
+ })
+
+ },
+ //确定def_pick为选择的门店
+ sure_pick: function (e) {
+ var th = this;
+ var item = null;
+ var openindstore = th.data.open_ind_store;
+
+ if (th.data.choice_sort_store == 0) {
+ var index = th.data.fir_pick_index;
+ if (th.data.is_show_sto_cat == 1) {
+ item = th.data.def_pickpu_list[index];
+ } else {
+ item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
+ }
+
+ } else {
+ var index = th.data.sec_pick_index;
+ item = th.data.sec_sto.s_arr[index];
+ }
+
+ if(!item) return false;
+
+ if (!th.data.sele_g) return false;
+
+ th.setData({
+ def_pick_store: item,
+ sto_sele_name: item.pickup_name,
+ sto_sele_id: item.pickup_id,
+ sto_sele_distr: item.distr_type,
+ store: 0,
+ choice_sort_store: 0,
+ fir_pick_index: 0,
+ openSpecModal: !0,
+ });
+
+
+ },
+ //---点击二级之后的选择---
+ choose_for_store: function (e) {
+ var index_c = e.currentTarget.dataset.ind;
+ var th = this;
+ th.setData({
+ sec_pick_index: index_c,
+ fir_pick_index: index_c
+ })
+
+ },
+ //把选择的门店设置成默认的门店def_pick
+ set_def_pick: function (e) {
+ var th = this;
+ var item = null;
+ if (th.data.choice_sort_store == 0) {
+ var index = th.data.fir_pick_index;
+ if (th.data.is_show_sto_cat == 1) {
+ item = th.data.def_pickpu_list[index];
+ } else {
+ item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
+ }
+ } else {
+ var index = th.data.sec_pick_index;
+ item = th.data.sec_sto.s_arr[index];
+ }
+
+ if(!item) return false;
+
+ th.setData({
+ def_pick_store: item,
+ sto_sele_name: item.pickup_name,
+ sto_sele_id: item.pickup_id,
+ sto_sele_distr: item.distr_type,
+ store: 0,
+ choice_sort_store: 0,
+ openSpecModal: !0,
+ });
+
+ var user_id = getApp().globalData.user_id;
+ var def_pickup_id = item.pickup_id;
+ getApp().request.put('/api/weshop/users/update', {
+ data: {
+ user_id: user_id,
+ def_pickup_id: def_pickup_id
+ },
+ success: function (res) {
+ if (res.data.code == 0) {
+ if (th.data.choice_sort_store == 0) th.setData({
+ fir_pick_index: 0
+ });
+ getApp().globalData.pk_store = item;
+ } else {
+ getApp().my_warnning("设置默认门店地址失败", 0, th)
+ }
+
+ }
+ });
+
+
+ },
+ closeSpecModal: function () {
+ this.setData({openSpecModal: 0});
+ },
+
+ //获取搜索门店输入的值
+ input_store: function(e) {
+ this.setData({
+ keyword: e.detail.value
+ })
+ },
+ //-- 搜索门店 --
+ searchfn(){
+ let choice_sort_store = this.data.choice_sort_store
+ if (choice_sort_store==0) { //全局搜索
+ let all_pick_list = this.data.all_pick_list
+ let def_pickpu_list = this.data.def_pickpu_list
+ let keyword = this.data.keyword
+ if (keyword) {
+ let arr=all_pick_list.filter( item =>{
+ let i = item.pickup_name.indexOf(keyword)
+ if (i > -1) {
+ return true
+ }else{
+ return false
+ }
+ })
+ if (arr && arr.length>0) {
+ if(this.data.is_show_sto_cat==1){
+ this.setData({
+ def_pickpu_list:arr
+ })
+ }else{
+ this.setData({
+ only_pk:arr
+ })
+ }
+ }else{
+ wx.showToast({
+ title: '没有搜索到门店',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ }else{
+ if (this.data.is_show_sto_cat==1) {
+ this.setData({
+ def_pickpu_list:all_pick_list.slice(0,10)
+ })
+ }else{
+ this.setData({
+ only_pk:all_pick_list
+ })
+ }
+
+ }
+ }else{ //分类下搜索
+ let sec_i=this.data.sec_i
+ let all_sto = this.data.all_sto
+ let old_all_sto = this.data.old_all_sto
+ if (!old_all_sto) {
+ this.setData({
+ old_all_sto:JSON.parse(JSON.stringify(all_sto))
+ })
+ }
+ let sec_sto= this.data.sec_sto
+ let sec_arr = this.data.old_all_sto[sec_i].s_arr
+ let keyword = this.data.keyword
+ let text='sec_sto.s_arr'
+ if (keyword) {
+ let arr=sec_arr.filter( item =>{
+ let i = item.pickup_name.indexOf(keyword)
+ if (i > -1) {
+ return true
+ }else{
+ return false
+ }
+ })
+ if (arr && arr.length>0) {
+ this.setData({
+ [text]:arr
+ })
+ }else{
+ wx.showToast({
+ title: '没有搜索到门店',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ }else{
+ if(this.data.old_all_sto){
+ this.setData({
+ [text]: this.data.old_all_sto[sec_i].s_arr
+ })
+ }else{
+ this.setData({
+ [text]: all_sto[sec_i].s_arr
+ })
+ }
+
+ }
+
+
+ }
+ },
+
+ check_guide(func){
+ var first_leader=this.data.first_leader;
+ if(!first_leader){
+ func();
+ return false;
+ }
+ if(this.data.is_geted_guide_pick){
+ func();
+ return false;
+ }
+ if(getApp().globalData.guide_pick_id){
+ func();
+ return false;
+ }
+ var th=this;
+ getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
+ if (res.data.code == 0) {
+ getApp().globalData.guide_pick_id= res.data.data.pickup_id;
+ }
+ th.data.is_geted_guide_pick=1;
+ func();
+ })
+ },
+
+
});
\ No newline at end of file
diff --git a/pages/giftpack/birthdaygift/birthdaygift.wxml b/pages/giftpack/birthdaygift/birthdaygift.wxml
index ec36d55..353f3bc 100644
--- a/pages/giftpack/birthdaygift/birthdaygift.wxml
+++ b/pages/giftpack/birthdaygift/birthdaygift.wxml
@@ -180,4 +180,5 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/pages/giftpack/birthdaygift/birthdaygift.wxss b/pages/giftpack/birthdaygift/birthdaygift.wxss
index 41018f9..3705d65 100644
--- a/pages/giftpack/birthdaygift/birthdaygift.wxss
+++ b/pages/giftpack/birthdaygift/birthdaygift.wxss
@@ -356,4 +356,363 @@ button::after {
.font_and_bg {
background-color: var(--bg-color);
color:var(--color);
+}
+
+
+
+/*-- 和弹出框的组件有关系 --*/
+.xc-width {
+ width: 100%;
+}
+.spec-model {
+ position: fixed;
+ bottom: 0;
+ z-index: 20;
+ background: white;
+ width: 100%;
+ /* padding: 0 30rpx; */
+ font-size: 32rpx;
+ box-sizing: border-box;
+ border-radius: 20rpx 20rpx 0 0;
+ /* height: 72%; */
+}
+
+.spec-model .pding {
+ padding: 0 20rpx;
+}
+.pding {
+ padding-top: 20rpx;
+ padding-left: 20rpx;
+ height: 81%;
+ padding-right: 20rpx;
+ font-size: 26rpx;
+ color: #ea120f
+}
+
+.spec-goods {
+ padding: 30rpx 0 20rpx;
+ /* float: left; */
+ width: 100%;
+ /* border-bottom:2rpx solid #eee; */
+}
+
+.spec-img {
+ float: left;
+ height: 186rpx;
+ width: 186rpx;
+ border: 4rpx solid #eee
+}
+
+.spec-goods-info {
+ float: left;
+ padding: 0 25rpx;
+ width: 400rpx;
+}
+
+.spec-goods-name {
+ font-size: 30rpx;
+ line-height: 35rpx;
+ height: 70rpx;
+ margin: 15rpx 20rpx 25rpx 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ color: #333;
+}
+
+.spec-goods-price {
+ color: #d60021;
+ font-size: 33rpx;
+ font-weight: bold;
+ /* display: flex; */
+}
+
+.spec-goods-stock {
+ margin-top: 3rpx;
+ font-size: 24rpx;
+ color: #999999;
+ margin-right: 15rpx;
+}
+
+.spec-name {
+ clear: both;
+ padding: 20rpx 0;
+ font-size: 30rpx;
+ color: #333;
+}
+.spec-name+view{
+ flex-wrap: wrap;
+}
+.stores-img {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 10rpx;
+}
+.right-arrow {
+ width: 15rpx;
+ height: 15rpx;
+ border-top: 2rpx solid #d70026;
+ border-right: 2rpx solid #d70026;
+ transform: rotate(45deg);
+ display: inline-block;
+ margin-bottom: 3rpx;
+}
+
+
+.spec-btn {
+ color: black;
+ background-color: white;
+ padding: 10rpx 10rpx;
+ font-size: 26rpx;
+ line-height: 28rpx;
+ float: left;
+ border: 1rpx solid #dedede;
+ margin: 4rpx 10rpx 4rpx 0;
+ border-radius: 4rpx;
+}
+
+.spec-btn-click {
+ color: white;
+ background-color: #f23030;
+ border: 1rpx solid #f23030;
+}
+
+.spec-cart-btns {
+ /* width: 92%; */
+ line-height: 70rpx;
+ /* margin: 0rpx auto;
+ margin-top: 160rpx; */
+ /* border-radius: 20rpx; */
+ /* position: fixed; */
+ /* bottom: 50rpx; */
+ /* left: 4%; */
+ padding: 20rpx;
+}
+
+.spec-cart-btn {
+
+ width: 100%;
+ font-size: 30rpx;
+ text-align: center;
+ color: white;
+ border-radius: 40rpx;
+}
+
+.spec-cart-btn.w40 {
+ width: 46%;
+}
+
+.spec-add-cart {
+ background-color: #ffb03f;
+}
+
+.spec-buy {
+ background-color: #f23030;
+ /* margin-left: 34rpx; */
+}
+
+.spec-cart-disable {
+ background: #bbbbbb;
+}
+
+.spec-cart-btn-lg {
+ width: 614rpx;
+}
+
+/* 选择门店的弹窗 */
+.mongolia-layer {
+ position: fixed;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 11;
+ background: rgba(0, 0, 0, 0.4);
+ width: 100%;
+ height: 91.9%;
+
+}
+
+.popup-frame {
+ position: fixed;
+ z-index: 20;
+ background: white;
+ width: 100%;
+ border-radius: 20rpx 20rpx 0 0;
+ height: auto;
+ bottom: 0;
+}
+
+.popup-top {
+ border-bottom: 1rpx solid #eee;
+ height: 155rpx;
+ width: 95%;
+ margin: auto;
+ line-height: 155rpx;
+
+}
+
+.bg_rights {
+ border-top: 2rpx solid;
+ border-right: 2rpx solid;
+ transform: rotate(45deg);
+ display: inline-block;
+ width: 15rpx;
+ height: 15rpx;
+ border-color: #da0b31;
+}
+
+.modal-closes {
+ position: absolute;
+ right: 30rpx;
+ top: -15rpx;
+ height: 25rpx;
+
+}
+
+.choose_more {
+ margin-top: 40rpx;
+ margin-right: 20rpx;
+
+}
+
+.choose_mores {
+ margin-top: 30rpx;
+ margin-right: 15rpx;
+
+}
+
+.store-list {
+ width: 95%;
+ min-height: 700rpx;
+ overflow-y: scroll;
+ margin: auto;
+ max-height: 700rpx;
+}
+
+.store-list .store_choose {
+ width: 100%;
+ height: 120rpx;
+ line-height: 125rpx;
+ border-bottom: 1rpx solid #eee;
+ padding: 10rpx 0;
+}
+
+.store-list .store_choose .store {
+ width: 100%;
+ margin: auto;
+ line-height: 37rpx;
+ padding-left: 20rpx;
+
+}
+
+.xc-hook {
+ width: 35rpx;
+ height: 35rpx;
+ transform: rotate(-145deg);
+ line-height: 37rpx;
+ text-align: center;
+}
+
+.xc-hooks {
+ width: 30rpx;
+ height: 30rpx;
+ border: 1rpx solid #999;
+}
+
+.address-frame {
+ width: 93%;
+ margin-left: 7rpx;
+
+}
+
+.nearby_store {
+ margin-left: 17rpx;
+}
+
+.address_name {
+ margin-right: 10rpx;
+ width: 360rpx;
+
+}
+
+.address-val {
+ height: 38rpx;
+ line-height: 38rpx;
+
+}
+
+.store-bottom {
+ width: 85%;
+ margin: auto;
+ height: 90rpx;
+}
+
+.searchbar {
+ height: 95rpx;
+ border-bottom: 2rpx solid rgb(238, 238, 238);
+}
+.storeListpadd {
+ padding: 0rpx 31rpx;
+}
+.search {
+ width: 125rpx;
+ height: 45rpx;
+ line-height: 45rpx;
+ background-color: rgb(219, 27, 52);
+ border-radius: 30rpx;
+ color: rgb(255, 255, 255);
+}
+.inputstore {
+ width: 510rpx;
+ height: 43rpx;
+ line-height: 43rpx;
+ border-radius: 30rpx;
+ border: 2rpx solid rgb(238, 238, 238);
+ padding-left: 30rpx;
+}
+
+
+
+.determine {
+ width: 260rpx;
+ height: 55rpx;
+ border-radius: 50rpx;
+ line-height: 55rpx;
+}
+
+.default {
+ width: 260rpx;
+ height: 55rpx;
+ border: 3rpx solid #c8c8c8;
+ border-radius: 50rpx;
+ line-height: 55rpx;
+}
+
+.store-bottom-frame {
+ width: 95%;
+ margin: auto;
+
+}
+
+/* 门店分类列表 */
+.sort_store_list {
+ max-height: 700rpx;
+ min-height: 700rpx;
+ overflow: hidden;
+ overflow-y: scroll;
+ width: 95%;
+ margin: auto;
+}
+
+.sort_store_list .sort-store-frame {
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ border-bottom: 1rpx solid #eee;
+
+}
+
+.sort_store_list .sort-store-frame .sort-store {
+ width: 94.5%;
+ margin: auto;
}
\ No newline at end of file
diff --git a/pages/goods/goodsInfo/buy_com_pop.wxml b/pages/goods/goodsInfo/buy_com_pop.wxml
index 0018476..eb86ef4 100644
--- a/pages/goods/goodsInfo/buy_com_pop.wxml
+++ b/pages/goods/goodsInfo/buy_com_pop.wxml
@@ -153,10 +153,10 @@
- 加入购物车
- 立即购买
@@ -172,10 +172,10 @@
- 加入购物车
- 立即购买
diff --git a/pages/goods/goodsInfo/buy_pt.wxml b/pages/goods/goodsInfo/buy_pt.wxml
index 6046921..8d0de58 100644
--- a/pages/goods/goodsInfo/buy_pt.wxml
+++ b/pages/goods/goodsInfo/buy_pt.wxml
@@ -195,7 +195,7 @@
- 立即购买
+ 立即购买
@@ -206,7 +206,7 @@
- 立即购买
+ 立即购买
@@ -226,7 +226,7 @@
该店不可售
- 确定
+ 确定
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 113eafc..277bf55 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -1392,6 +1392,10 @@ Page({
//------------加入购物车--------------
addCart: function (t) {
+ //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
+ if(this.data.sp_seleing){
+ return false;
+ }
var th = this;
var ind = t.currentTarget.dataset.openSpecModal_ind;
@@ -3279,6 +3283,12 @@ Page({
//-----------选择属性的按钮事件----------
sele_spec: function (e) {
+ if(this.data.sp_seleing){
+ return false;
+ }
+
+ this.setData({sp_seleing:1})
+
var that = this;
var th = this;
@@ -3365,22 +3375,27 @@ Page({
});
-
if (nor) {
that.set_sele_g(sku_g)
- that.get_sto(1);
+ that.get_sto(1,()=>{
+ that.sele_spec_next(that,item,gid,nor);
+ });
}
- else that.get_sto();
+ else that.get_sto(null,()=>{
+ that.sele_spec_next(that,item,gid,nor);
+ });
+ },
+ //-- 选择规格下一步 --
+ sele_spec_next(that,item,gid,nor){
if (!item.whsle_id && ([1, 2, 4, 6].indexOf(item.prom_type) == -1 || this.data.is_normal == 1))
that.check_is_youhui(gid, that.data.is_normal, 1);
-
//默认门店要拿下门店库存
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) {
var lock = 0,
- plist = null;
+ plist = null;
that.check_CanOutQty(that.data.sele_g, that.data.def_pick_store, function (CanOutQty) {
that.data.def_pick_store.CanOutQty = CanOutQty;
@@ -3391,18 +3406,18 @@ Page({
})
}
- this.sele_spec_chech_activity(nor);
+ that.sele_spec_chech_activity(nor);
//如果是秒杀,拼团等互动,就不重新算界面
if ([1, 2, 4, 6, 8, 9].indexOf(this.data.base_nor_prom_type) > -1) {
return false;
}
- this.check_has_flash(gid);
+ that.check_has_flash(gid);
var url = '/api/weshop/activitylist/listGoodActInfo2New';
var req_d = {
"store_id": os.stoid,
- "goods_id": this.data.gid,
+ "goods_id": that.data.gid,
"user_id": user_id,
}
getApp().request.get(url, {
@@ -3421,7 +3436,7 @@ Page({
if (arr3 && arr3.length > 0) {
//获取活动信息
var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +
- arr3[0].act_id + "/" + getApp().globalData.user_id;
+ arr3[0].act_id + "/" + getApp().globalData.user_id;
getApp().request.get(url, {
success: function (e) {
if (e.data.code == 0 && e.data.data) {
@@ -3450,9 +3465,7 @@ Page({
//选择了不同的规格的时候要判断是不是有活动正在进行中
async sele_spec_chech_activity(nor) {
//---如果是活动的时候---
- var prom = null,
- goodsinfo = this.data.sele_g,
- th = this;
+ var prom = null,goodsinfo = this.data.sele_g,th = this;
//如果是普通购买的时候,要返回原先
if (goodsinfo.goods_id == this.data.base_nor_goods_id) {
@@ -3537,7 +3550,8 @@ Page({
prom_start_time: prom.start_time,
prom_st: prom_st,
prom_act: prom,
- prom_id: prom.id
+ prom_id: prom.id,
+ sp_seleing:0
})
var pro_null=null;
@@ -3581,7 +3595,10 @@ Page({
}
}
- if (nor) return false;
+ if (nor){
+ th.setData({ sp_seleing:0 })
+ return false;
+ }
//---设置普通商品---
th.setData({
@@ -3591,13 +3608,14 @@ Page({
prom_end_time: null,
prom_start_time: null,
prom_st: null,
+ sp_seleing:0
})
},
//---------拿出门店分类和门店------------
- get_sto(e) {
+ get_sto(e,func) {
console.log('get_sto')
var th = this,
that = this;
@@ -3791,12 +3809,16 @@ Page({
th.deal_pickup(e); //--普通门店排版--
}, 800)
}
+ if(func) func();
}else{
wx.hideLoading();
}
} else {
wx.hideLoading();
}
+ },err=>{
+ ut.m_toast('网络繁忙,请稍后重试');
+ wx.hideLoading();
})
}, 200)
@@ -3807,6 +3829,7 @@ Page({
keyword: e.detail.value
})
},
+
//搜索门店
searchfn() {
let choice_sort_store = this.data.choice_sort_store
@@ -4190,12 +4213,13 @@ Page({
is_find_def_store = 1;
}
- //-- 如果库存为0就要重新赋值 --
- def_pick_store.CanOutQty=Qty;
- th.setData({
+ if(def_pick_store){
+ //-- 如果库存为0就要重新赋值 --
+ def_pick_store.CanOutQty=Qty;
+ th.setData({
def_pick_store
- })
-
+ })
+ }
} else {
@@ -5338,6 +5362,12 @@ Page({
//-----------------拼单生成方法---------------------
addCart_pt: function () {
+
+ //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对
+ if(this.data.sp_seleing){
+ return false;
+ }
+
var th = this;
if (this.data.is_normal == 0) {
//看一下有没有起购数,如果有起购数,要计算起购数
@@ -6245,7 +6275,7 @@ Page({
if (type == 4) type = 0;
if (type == 2) type = 0;
if (type == 6) type = 2; // 6拼团 2团购
- if (type == 10) type = -1;
+ if (type == 10) type = 0;
if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml
index 6262f2e..11c657e 100644
--- a/pages/goods/goodsInfo/goodsInfo.wxml
+++ b/pages/goods/goodsInfo/goodsInfo.wxml
@@ -1465,10 +1465,10 @@
-
+
加入购物车
-
+
{{sele_g.offline_price?"券后购买":"立即购买"}}
@@ -1487,10 +1487,10 @@
-
+
加入购物车
-
+
{{sele_g.offline_price?"券后购买":"立即购买"}}