diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js
index 9ca84cc..b109c30 100644
--- a/packageA/pages/prom_list/prom_list.js
+++ b/packageA/pages/prom_list/prom_list.js
@@ -40,12 +40,16 @@ Page({
g_buy_num: null,
sele_collocation:null,
+ room_id:0, //房间号
},
//------初始化加载----------
onLoad: function(t) {
var goods_id=t.goods_id;
+ var room_id=t.room_id;
this.setData({gid:goods_id});
+
+ if(room_id) this.data.room_id=room_id; //房间号要存起来
var ee=this,th=ee,that=ee;
var first_leader=t.first_leader;
if(first_leader){
@@ -89,9 +93,16 @@ Page({
var appd=getApp().globalData;
var w_time = setInterval(function() {
if (that.data.is_get_local_ok == 0) return false;
+ if (!that.data.data) return false;
clearInterval(w_time);
var distance = null;
var e=JSON.parse(JSON.stringify(ee));
+
+ if(th.data.data) var g_distr_type=th.data.data.distr_type;
+ e.is_no_dis=0;
+ if(e.distr_type!=0 && g_distr_type!=0 && e.distr_type!=g_distr_type ){
+ e.is_no_dis=1;
+ }
//如果有开启近距离的话,同时距离优不一样了
if (that.data.lat != null) {
@@ -405,7 +416,15 @@ Page({
th.data.sele_collocation[jj]['guide_type']=newd['guide_type'];
}
}
-
+
+ //-- 如果有房间号的时候 --
+ if(th.data.room_id){
+ newd['room_id']=th.data.room_id;
+ for(var nn in th.data.sele_collocation ){
+ th.data.sele_collocation[nn]['room_id']=newd['room_id'];
+ }
+ }
+
//-----如果是秒杀,团购,积分购,拼团-----
if (th.data.data.prom_type != 5) {
@@ -624,6 +643,16 @@ Page({
collocationList[i].is_collocation=1;
if(!th.data.sele_collocation) th.data.sele_collocation=new Array();
th.data.sele_collocation.push(collocationList[i]);
+
+ var the_dis_t=collocationList[i].distr_type;
+ //如果有默认门店的判断门店匹配情况
+ if(th.data.def_pick_store && th.data.def_pick_store.distr_type!=0 && the_dis_t!=0 && the_dis_t!=th.data.def_pick_store.distr_type ){
+ th.data.def_pick_store.is_no_dis=1;
+ th.setData({def_pick_store:th.data.def_pick_store});
+ }else{
+ th.data.def_pick_store.is_no_dis=0;
+ th.setData({def_pick_store:th.data.def_pick_store});
+ }
}
}
if(!th.data.sele_collocation){
@@ -694,9 +723,21 @@ Page({
var th = this,that=this;
var timer_get = setInterval(function() {
if (th.data.is_get_local_ok == 0) return false;
- var dd = null,
+ var dd = null,
+ c_list=th.data.collocationList,
i = getApp().request;
- var g_distr_type = th.data.data.distr_type;
+ var g_distr_type = th.data.data.distr_type;
+ var collocationList=th.data.collocationList;
+
+ //获取所有的门店
+ if(g_distr_type==0 && collocationList ){
+ for(var i in collocationList){
+ if(collocationList[i].sele && collocationList[i].distr_type>0){
+ g_distr_type=collocationList[i].distr_type;
+ }
+ }
+ }
+
if (g_distr_type != 0) {
dd = {
store_id: o.stoid,
@@ -1164,7 +1205,7 @@ Page({
is_gps: 1
});
//th.onShow();
- //th.get_sto();
+ th.get_sto();
},
fail: function(res) {
//th.onShow();
@@ -1187,6 +1228,7 @@ Page({
})
}else{
th.data.is_get_local_ok = 1;
+ th.get_sto();
}
if(ind!=undefined && ind!=null ){
@@ -1574,11 +1616,49 @@ Page({
_errObj[_errImg] = "/public/images/default_goods_image_240.gif";
this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
},
+ //判断来个商品的配送的方式是不是一致
+ check_men_dian(g1,g2){
+ if(g1.distr_type!=0 && g2.distr_type!=0 && g1.distr_type!=g2.distr_type){
+ return 0;
+ }
+ return 1;
+ },
set_sele:function (e) {
+ var th=this;
var index=e.currentTarget.dataset.ind;
var set=e.currentTarget.dataset.set;
var text="collocationList["+index+"].sele";
+
+ //判断门店匹配不匹配
+ var click_item=this.data.collocationList[index];
+ var c_list=this.data.collocationList;
+ if(set==1){
+ //-- 选择的商品的门店配送方式和主商品比较 --
+ if(!th.check_men_dian(click_item,th.data.data)){
+ wx.showToast({
+ title: "商品的配送方式不一致",
+ icon: 'none',
+ duration: 2000
+ })
+ return false;
+ }
+ //-- 判断从商品 --
+ for(var ij in this.data.collocationList){
+ if(this.data.collocationList[ij].sele){
+ if(!th.check_men_dian(click_item,this.data.collocationList[ij])){
+ wx.showToast({
+ title: "商品的配送方式不一致",
+ icon: 'none',
+ duration: 2000
+ })
+ return false;
+ }
+ }
+ }
+
+ }
+
var ob={};
ob[text]= parseInt(set);
this.setData(ob);
diff --git a/packageA/pages/prom_list/prom_list.wxml b/packageA/pages/prom_list/prom_list.wxml
index 3ae62ef..ea700e8 100644
--- a/packageA/pages/prom_list/prom_list.wxml
+++ b/packageA/pages/prom_list/prom_list.wxml
@@ -115,7 +115,8 @@
(库存不足)
- (库存不足)
+ (配送不匹配)
+ (库存不足)
@@ -177,6 +178,11 @@
库存不足
+
+
+ 立即购买
+
+
立即购买
diff --git a/packageA/pages/prom_list/prom_list.wxss b/packageA/pages/prom_list/prom_list.wxss
index e1d5663..d7b4120 100644
--- a/packageA/pages/prom_list/prom_list.wxss
+++ b/packageA/pages/prom_list/prom_list.wxss
@@ -357,4 +357,9 @@
border-bottom: 1px solid #eee;
padding-bottom: 15px;
margin-bottom:40rpx;
- }
\ No newline at end of file
+ }
+
+ .join-cart>view.no_store {
+ width: 58%; background-color: #adadad;
+ }
+.no_store{color:#d60021; font-size: 26rpx;}
\ No newline at end of file
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index 4bcc26f..0455e93 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -693,7 +693,9 @@ Page({
if(gg.prom_type==5){
t.data.data.prom_id = gg.prom_id ;
t.data.data.prom_type =5;
-
+ if(gg.room_id){
+ t.data.data.room_id=gg.room_id;
+ }
//--主商品要有导购id和导购类型--
if(gg.guide_id){
t.data.data.guide_id=gg.guide_id;
@@ -707,6 +709,16 @@ Page({
var narr=JSON.parse(JSON.stringify(gg.collocation_goods));
narr.push(t.data.data);
+
+ for(var hi in narr){
+ var dis_t=narr[hi].distr_type;
+ if(dis_t==2){
+ th.setData({ is_all_zt:0});
+ break;
+ }
+ }
+
+
var ie = {
pickup_id: gg.pick_id, pname: gg.pick_name, goods: narr, exp_type: et, wind: m_wind, distr_t: distr_t,
goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0};
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index a3e9c93..22d6d48 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -4894,7 +4894,13 @@ Page({
//----跳转到搭配购买----
go_prom_list:function () {
- wx.navigateTo({ url: "../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid, })
+
+ var url= "../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid;
+ var room_id= getApp().globalData.room_id;
+ if(room_id && this.data.gid==getApp().globalData.room_goods_id){
+ url+="&room_id="+room_id;
+ }
+ wx.navigateTo({ url: url,})
},
//---检查有没有优惠活动---
diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml
index c40db94..34b4112 100644
--- a/pages/goods/goodsInfo/goodsInfo.wxml
+++ b/pages/goods/goodsInfo/goodsInfo.wxml
@@ -449,7 +449,7 @@
(库存不足)
- (配送不匹配)
+ (配送不匹配)
(库存不足)
diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js
index 8a6598b..0b4cbdb 100644
--- a/pages/team/team_show/team_show.js
+++ b/pages/team/team_show/team_show.js
@@ -88,6 +88,9 @@ Page({
lon: null, //经度
is_get_local_ok: 0, //获取坐标是否完成
+
+ sort_store: 0, //门店分类
+ choice_sort_store: 0, //选择分类门店
},
onLoad: function(options) {
@@ -575,8 +578,9 @@ Page({
var g_distr_type=th.data.goods.distr_type;
//--如果默认门店的配送方式不对,就不能被选择--
if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){
- th.data.fir_def_store={}; //赋值空对象
- return false;
+ //th.data.fir_def_store={}; //赋值空对象
+ //return false;
+ ee.is_no_dis=1;
}
var appd=getApp().globalData;
@@ -1017,6 +1021,7 @@ Page({
this.setData({
store: 1,
yijian: false,
+ choice_sort_store:0
})
},
@@ -1104,8 +1109,9 @@ Page({
}
clearInterval(timer_get);
- if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){
- th.setData({def_pick_store:null});
+ //如果会员是有默认的门店话
+ if(!th.data.def_pick_store && th.data.fir_def_store){
+ th.setData({def_pick_store:th.data.fir_def_store});
}
//----------获取门店----------------
@@ -1127,7 +1133,7 @@ Page({
}
//-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
- if (th.data.def_pick_store && (th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
+ if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){
for (var k = 0; k < e.data.data.pageData.length; k++) {
if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
e.data.data.pageData.splice(k, 1); //删除
@@ -1306,6 +1312,9 @@ Page({
}
}
},
+
+
+
//---选择分类门店---
choice_sort_store: function(e) {
var index = e.currentTarget.dataset.index;
@@ -1316,7 +1325,7 @@ Page({
sort_store: 0,
choice_sort_store: 1,
sec_sto: item,
- sec_pick_index: 0
+ sec_pick_index: 0,
});
},
diff --git a/pages/team/team_show/team_show.wxml b/pages/team/team_show/team_show.wxml
index 0007b82..21e42ec 100644
--- a/pages/team/team_show/team_show.wxml
+++ b/pages/team/team_show/team_show.wxml
@@ -233,6 +233,7 @@
+ (配送不匹配)
地址:5{{def_pick_store.fulladdress}}
@@ -264,7 +265,8 @@
- 确定
+ 确定
+ 确定
@@ -278,7 +280,7 @@