Browse Source

上朵分销

wangxiaoming 6 years ago
parent
commit
a3859069c6

+ 13 - 0
tooth/clearing.html

@@ -114,6 +114,14 @@
 			var orderItem;	//获取订单项信息
 			var couponMoney = 0;		//新人卷 - 优惠金额
 			
+			var channelType = getParam("channelType"); //渠道类型
+			var channelId = getParam("channelId"); //渠道id
+			if(channelType == null || channelId == null ){
+				channelType = 0;
+				channelId=0;
+			}
+			
+			var wechatAddr = new Object();
 			
 			
 			mui.ready(function() {
@@ -128,6 +136,8 @@
 						cartidList = pay_data.text[0]; //购物项id集合
 						parameter["cartIds"] = cartidList;
 						parameter["isCustomize"] = 1;
+						parameter["channelType"] = channelType;
+						parameter["channelId"] = channelId;
 						$.ajax(base_path + '/wechat/order/payBefore', {
 							data: parameter,
 							dataType: 'json',
@@ -409,6 +419,8 @@
 							dataArgs["orderUserRemark"] = remark;
 						}
 						dataArgs["isCustomize"] = 1;
+						dataArgs["channelType"] = channelType;
+						dataArgs["channelId"] = channelId;
 						$.ajax(base_path + '/wechat/order/pay', { // 提交订单,准备支付
 							data: dataArgs,
 							dataType: 'json',
@@ -447,6 +459,7 @@
 												type: 'get',
 												timeout: 15000,
 												success: function(dataobj) {
+													
 													if(dataobj.isRedirect) {
 														location.href = dataobj.redirectURL;
 													} else {

+ 7 - 6
tooth/order-details.html

@@ -12,7 +12,7 @@
 		<link rel="stylesheet" type="text/css" href="css/main.css" />
 		<script type="text/javascript">
 			// 屏蔽分享
-			//window.hiddenAllWechatMenu = true;
+			window.hiddenAllWechatMenu = true;
 		</script>
 	</head>
 
@@ -159,17 +159,18 @@
 								$("#salesPostNum").val(order.salesPostNum);
 							}
 							
-							if(order.couponReduce != null && order.couponReduce != "" && typeof(order.couponReduce) != "undefined"){
+							// if(order.couponReduce != null && order.couponReduce != "" && typeof(order.couponReduce) != "undefined"){
 								var newCouponReduce = order.salesAmount - order.salesYetAmount;
 								if(newCouponReduce <= 0){
 									newCouponReduce = 0;
+									$("#isCouponReduce").hide();
 								}else{
 									$("#couponReduce").html(accDiv(newCouponReduce,100));
+									$("#isCouponReduce").show();
 								}
-								$("#isCouponReduce").show();
-							}else{
-								$("#isCouponReduce").hide();
-							}
+// 							}else{
+// 								$("#isCouponReduce").hide();
+// 							}
 							$("#salesYetAmount").html(accDiv(order.salesYetAmount,100));
 							var str = "";
 							mui.each(order.orderItemList, function(index) {

+ 45 - 22
tooth/pro-details.html

@@ -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>

+ 99 - 0
tooth/pro-list-channel.html

@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<title>产品列表</title>
+		<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" />
+		<style>
+			.btn-buy-know{border: 1px solid #999;position: absolute;right: 0;bottom: 0;}
+			.pro-title{padding:10px 0 6px 0;}
+			.pro-desc{padding: 0 0 8px 0;}
+			.pro-delete{color: #999;margin-left: 15px;}
+			.my-view-no .mui-table-view-cell:after{display: none;}
+		</style>
+		<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
+		<script>
+			//屏蔽分享
+			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+				WeixinJSBridge.call('hideOptionMenu');
+			});
+		</script>
+	</head>
+
+	<body>
+		<!--内容开始-->
+		<div class="mui-content">
+			<ul class="mui-table-view mui-table-view-striped my-view-no mui-table-view-condensed" style="margin-top: 5px;">
+				<li class="mui-table-view-cell">
+					<div class="mui-table">
+		                <div class="mui-table-cell mui-col-xs-12">
+		                    <img width="100%" src="images/pro-channel-1.jpg">
+		                </div>
+		            </div>
+		            <div class="mui-table">
+		                <div class="mui-table-cell mui-col-xs-12">
+		                    <h4 class="pro-title">上朵都市轻奢款声波牙刷</h4>
+		                    <p class="pro-desc">柔和清洁牙龈,温柔呵护牙齿</p>
+		                    <span class="pro-price">¥349.00</span><s class="pro-delete">¥399.00</s>
+		                    <button type="button" class="mui-btn btn-buy-know pro-datail" color="42" >立即购买</button>
+		                </div>
+		            </div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div class="mui-table">
+		                <div class="mui-table-cell mui-col-xs-12">
+		                    <img width="100%" src="images/pro-channel-2.jpg">
+		                </div>
+		            </div>
+		            <div class="mui-table">
+		                <div class="mui-table-cell mui-col-xs-12">
+		                    <h4 class="pro-title">上朵儿童款声波牙刷</h4>
+		                    <p class="pro-desc">柔羽呵护刷毛,专为孩子定制</p>
+		                    <span class="pro-price">¥249.00</span><s class="pro-delete">¥289.00</s>
+		                    <button type="button" class="mui-btn btn-buy-know pro-datail" color="76">立即购买</button>
+		                </div>
+		            </div>
+				</li>
+			</ul>
+		</div>
+		<!--内容结束-->
+		<!-- 加载ing begin-->
+		<div class="loading covers">
+			<div class="loading-bj"></div>
+			<p>正在加载...</p>
+		</div>
+		<!-- 加载ing end -->
+		<script src="js/mui.min.js"></script>
+		<script src="js/jquery-2.1.1.min.js"></script>
+		<script src="js/main.js"></script>
+		<script>
+			window.addEventListener('pageshow', function(e) {
+				// 通过persisted属性判断是否存在 BF Cache
+				if(e.persisted) {
+					location.reload();
+				}
+			});
+			
+			var channelType = getParam("channelType"); //类型
+			var channelId = getParam("channelId"); //渠道id
+
+			//ready事件
+			mui.ready(function() {
+				$(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
+			});
+			
+			//跳转产品详情
+			$(document).on('tap', '.pro-datail', function() {
+				var id = $(this).attr("color");
+				location.href='pro-details.html?colorId='+id+'&channelType='+channelType+'&channelId='+channelId;
+			});
+		</script>
+	</body>
+
+</html>

+ 1 - 1
tooth/register-vip.html

@@ -497,7 +497,7 @@
 							"userSex": userSex, //用户姓名
 							"userTel": tel, //手机
 							"code": code, //验证码
-							"userBirthDate": userBirthDate, //出生日期
+							"userBirthDateString": userBirthDate, //出生日期
 							"apparatusStore": apparatusStore, //渠道id 1:天猫 2:淘宝 3:京东 4:微信 5:其他 6:一条 7:小红书
 							"buyDate": buyDate //购买日期
 						},

+ 14 - 3
tooth/shopping-cart.html

@@ -23,7 +23,7 @@
 
 	<body>
 		<!--底部菜单开始-->
-		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
+		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab" >
 			<a class="mui-tab-item">
 				<span class="iconfont icon-shouye"></span>
 				<span class="mui-tab-label">首页</span>
@@ -86,9 +86,20 @@
 					location.reload();
 				}
 			});
+			
+			var channelType = getParam("channelType"); //渠道类型
+			var channelId = getParam("channelId"); //渠道id
+			if(channelType == null || channelId == null ){
+				channelType = 0;
+				channelId=0;
+			}
+			
 			mui.ready(function() {
 				$.ajax(base_path + '/wechat/cart/selectCartByOpenId?dates=' + new Date().getTime(), {
-					data: {},
+					data: {
+						"channelType": channelType,
+						"channelId": channelId
+					},
 					dataType: 'json',
 					xhrFields: {
 						withCredentials: true
@@ -342,7 +353,7 @@
 						};
 						//json格式化插入    购物项id集合
 						sessionStorage.setItem('pay_data', JSON.stringify(obj));
-						location.href = 'clearing.html'; //跳转结算页面
+						location.href = 'clearing.html?channelType='+channelType+'&channelId='+channelId; //跳转结算页面
 					}
 				} else {
 					mui.alert('您还没有选中商品', '消息提醒', function() {