Commit 0b41d7930908f05c20793400ba3f1e1f65ec0778
1 parent
528800d0
手机段判断视频号场景
Showing
3 changed files
with
55 additions
and
2 deletions
app.js
| ... | ... | @@ -70,6 +70,7 @@ App({ |
| 70 | 70 | room_id: null, //直播间分享的房间ID |
| 71 | 71 | room_goods_id: null, //直播间分享的商品ID |
| 72 | 72 | fail_url: new Map(), |
| 73 | + sp_scene:"1175,1176,1177" | |
| 73 | 74 | }, |
| 74 | 75 | auth: o, |
| 75 | 76 | request: a, |
| ... | ... | @@ -975,5 +976,12 @@ App({ |
| 975 | 976 | } |
| 976 | 977 | }).then(res=>{}) |
| 977 | 978 | } |
| 979 | + }, | |
| 980 | + //判段是不是视频号 | |
| 981 | + is_sp_hao:function () { | |
| 982 | + if(!this.globalData.scene) return false; | |
| 983 | + if(this.globalData.sp_scene.indexOf(this.globalData.scene)==-1) return false; | |
| 984 | + return true; | |
| 978 | 985 | } |
| 986 | + | |
| 979 | 987 | }); | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
| ... | ... | @@ -814,9 +814,22 @@ Page({ |
| 814 | 814 | var th = this; |
| 815 | 815 | var ind = t.currentTarget.dataset.openSpecModal_ind; |
| 816 | 816 | var action= t.currentTarget.dataset.action; |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + if(getApp().is_sp_hao() && action=='add'){ | |
| 821 | + wx.showToast({ | |
| 822 | + title: "视频号商品不允许加入购物车", | |
| 823 | + icon: 'none', | |
| 824 | + duration: 2000 | |
| 825 | + }); | |
| 826 | + return false; | |
| 827 | + } | |
| 828 | + | |
| 829 | + | |
| 817 | 830 | if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; |
| 818 | 831 | |
| 819 | - th.setData({ | |
| 832 | + th.setData({ | |
| 820 | 833 | open_ind_store: ind |
| 821 | 834 | }); |
| 822 | 835 | |
| ... | ... | @@ -1276,7 +1289,18 @@ Page({ |
| 1276 | 1289 | openSpecModel: function(t) { |
| 1277 | 1290 | var th=this; |
| 1278 | 1291 | var open_store = t.currentTarget.dataset.ind; |
| 1279 | - this.setData({ | |
| 1292 | + | |
| 1293 | + if(getApp().is_sp_hao() && open_store==1){ | |
| 1294 | + wx.showToast({ | |
| 1295 | + title: "视频号商品不允许加入购物车", | |
| 1296 | + icon: 'none', | |
| 1297 | + duration: 2000 | |
| 1298 | + }); | |
| 1299 | + return false; | |
| 1300 | + } | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + this.setData({ | |
| 1280 | 1304 | store: 0, |
| 1281 | 1305 | choice_sort_store: 0, |
| 1282 | 1306 | sort_store: 0, | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -1148,6 +1148,17 @@ Page({ |
| 1148 | 1148 | }); |
| 1149 | 1149 | |
| 1150 | 1150 | |
| 1151 | + if ("add" == t.currentTarget.dataset.action && getApp().is_sp_hao()) { | |
| 1152 | + wx.showToast({ | |
| 1153 | + title: "视频号商品不允许加入购物车", | |
| 1154 | + icon: 'none', | |
| 1155 | + duration: 2000 | |
| 1156 | + }); | |
| 1157 | + return false; | |
| 1158 | + } | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1151 | 1162 | //如果是秒杀的话,要看redis够不够 |
| 1152 | 1163 | if (this.data.prom_type == 1 || this.data.prom_type == 2) { |
| 1153 | 1164 | |
| ... | ... | @@ -2053,6 +2064,16 @@ Page({ |
| 2053 | 2064 | openSpecModel: function (t) { |
| 2054 | 2065 | var th = this; |
| 2055 | 2066 | var open_store = t.currentTarget.dataset.ind; |
| 2067 | + | |
| 2068 | + if(getApp().is_sp_hao() && open_store==1){ | |
| 2069 | + wx.showToast({ | |
| 2070 | + title: "视频号商品不允许加入购物车", | |
| 2071 | + icon: 'none', | |
| 2072 | + duration: 2000 | |
| 2073 | + }); | |
| 2074 | + return false; | |
| 2075 | + } | |
| 2076 | + | |
| 2056 | 2077 | this.setData({ |
| 2057 | 2078 | store: 0, |
| 2058 | 2079 | choice_sort_store: 0, | ... | ... |