|
@@ -10,9 +10,7 @@
|
|
|
<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="css/main.css" />
|
|
|
- <script>
|
|
|
- //屏蔽分享
|
|
|
- </script>
|
|
|
+
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
@@ -75,7 +73,21 @@
|
|
|
<script src="js/mui.previewimage.js"></script>
|
|
|
<script src="js/jquery-2.1.1.min.js"></script>
|
|
|
<script src="js/main.js"></script>
|
|
|
- <script src="js/wechat-utils-1.0.js"></script>
|
|
|
+ <!--<script src="js/wechat-utils-1.0.js"></script>-->
|
|
|
+
|
|
|
+ <script>
|
|
|
+ var channelType = getParam("channelType"); //渠道类型
|
|
|
+ var channelId = getParam("channelId"); //渠道id
|
|
|
+ if(channelType == null || channelId == null ){
|
|
|
+ channelType = 0;
|
|
|
+ channelId=0;
|
|
|
+ }
|
|
|
+ if(channelType != null && channelType > 0 && channelId != null && channelId > 0){
|
|
|
+ // 屏蔽分享
|
|
|
+ window.hiddenAllWechatMenu = true;
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+
|
|
|
<script>
|
|
|
window.addEventListener('pageshow', function(e) {
|
|
|
// 通过persisted属性判断是否存在 BF Cache
|
|
@@ -86,12 +98,16 @@
|
|
|
var colorId = getParam("colorId"); //从URL带过来的产品颜色id
|
|
|
var productName = "";//产品名称 分享用
|
|
|
var colorName = "";//颜色名称 分享用
|
|
|
+
|
|
|
+
|
|
|
//ready事件
|
|
|
mui.ready(function() {
|
|
|
if(colorId != null) {
|
|
|
$.ajax(base_path + '/wechat/product/getProductByProductId?dates=' + new Date().getTime(), {
|
|
|
data: {
|
|
|
- "colorId": colorId
|
|
|
+ "colorId": colorId,
|
|
|
+ "channelType": channelType,
|
|
|
+ "channelId": channelId
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
xhrFields: {
|
|
@@ -274,7 +290,7 @@
|
|
|
};
|
|
|
//json格式化插入 购物项id集合
|
|
|
sessionStorage.setItem('pay_data', JSON.stringify(obj));
|
|
|
- location.href = 'clearing.html'; //跳转结算页面
|
|
|
+ location.href = 'clearing.html?channelType='+channelType+'&channelId='+channelId; //跳转结算页面
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -316,7 +332,7 @@
|
|
|
};
|
|
|
//json格式化插入 购物项id集合
|
|
|
sessionStorage.setItem('pay_data', JSON.stringify(obj));
|
|
|
- location.href = 'clearing.html'; //跳转结算页面
|
|
|
+ location.href = 'clearing.html?channelType='+channelType+'&channelId='+channelId; //跳转结算页面
|
|
|
},500);
|
|
|
}
|
|
|
}else{
|
|
@@ -427,26 +443,33 @@
|
|
|
};
|
|
|
//跳转购物车
|
|
|
$(document).on('tap', '.cart', function() {
|
|
|
- location.href = 'shopping-cart.html';
|
|
|
+ if(channelType != null && channelType > 0 && channelId != null && channelId > 0){
|
|
|
+ var num = $(".cart .mui-badge").text();
|
|
|
+ if(num<1){
|
|
|
+ mui.toast("请添加商品到购物车!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ location.href = 'shopping-cart.html?channelType='+channelType+'&channelId='+channelId;
|
|
|
});
|
|
|
|
|
|
//分享
|
|
|
function fenxiang(){
|
|
|
var src = location.href;
|
|
|
- src = "https://s.iamberry.com/soodo/wechat/pro-details.html?colorId="+colorId;
|
|
|
- window.wxFriend = {
|
|
|
- "appId": "",
|
|
|
- "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
|
|
|
- "link": src,
|
|
|
- "desc": '让你的齿龄停留在18岁',
|
|
|
- "title": 'soodo上朵 | '+productName+"("+colorName+")",
|
|
|
- "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
|
|
|
- "shareTimeSuccess": "分享成功",
|
|
|
- "shareTimeCancel": "已取消分享",
|
|
|
- "shareAppSuccess": "分享成功!",
|
|
|
- "shareAppCancel": "已取消分享"
|
|
|
- };
|
|
|
- getConfig();
|
|
|
+ src = "https://s.iamberry.com/soodo/wechat/pro-details.html?colorId="+colorId;
|
|
|
+ window.wxFriend = {
|
|
|
+ "appId": "",
|
|
|
+ "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
|
|
|
+ "link": src,
|
|
|
+ "desc": '让你的齿龄停留在18岁',
|
|
|
+ "title": 'soodo上朵 | '+productName+"("+colorName+")",
|
|
|
+ "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
|
|
|
+ "shareTimeSuccess": "分享成功",
|
|
|
+ "shareTimeCancel": "已取消分享",
|
|
|
+ "shareAppSuccess": "分享成功!",
|
|
|
+ "shareAppCancel": "已取消分享"
|
|
|
+ };
|
|
|
+ getConfig();
|
|
|
}
|
|
|
|
|
|
</script>
|