diff --git a/app.js b/app.js index ad2d372..976151b 100644 --- a/app.js +++ b/app.js @@ -70,6 +70,7 @@ App({ room_id: null, //直播间分享的房间ID room_goods_id: null, //直播间分享的商品ID fail_url: new Map(), + sp_scene:"1175,1176,1177" }, auth: o, request: a, @@ -975,5 +976,12 @@ App({ } }).then(res=>{}) } + }, + //判段是不是视频号 + is_sp_hao:function () { + if(!this.globalData.scene) return false; + if(this.globalData.sp_scene.indexOf(this.globalData.scene)==-1) return false; + return true; } + }); diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index e51efb2..9b20287 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -814,9 +814,22 @@ Page({ var th = this; var ind = t.currentTarget.dataset.openSpecModal_ind; var action= t.currentTarget.dataset.action; + + + + if(getApp().is_sp_hao() && action=='add'){ + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + + if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; - th.setData({ + th.setData({ open_ind_store: ind }); @@ -1276,7 +1289,18 @@ Page({ openSpecModel: function(t) { var th=this; var open_store = t.currentTarget.dataset.ind; - this.setData({ + + if(getApp().is_sp_hao() && open_store==1){ + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + + + this.setData({ store: 0, choice_sort_store: 0, sort_store: 0, diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index eb45600..c640bb3 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1148,6 +1148,17 @@ Page({ }); + if ("add" == t.currentTarget.dataset.action && getApp().is_sp_hao()) { + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + + + //如果是秒杀的话,要看redis够不够 if (this.data.prom_type == 1 || this.data.prom_type == 2) { @@ -2053,6 +2064,16 @@ Page({ openSpecModel: function (t) { var th = this; var open_store = t.currentTarget.dataset.ind; + + if(getApp().is_sp_hao() && open_store==1){ + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + this.setData({ store: 0, choice_sort_store: 0,