浏览代码

618活动页面

wangxiaoming 6 年之前
父节点
当前提交
b117485294

+ 2 - 1
aiberle/pro-details.html

@@ -180,7 +180,8 @@
 								productRemark = productInfo.productColorDes;
 								productIntroduceImg = productInfo.productParameterImg;
 								li.innerHTML = '<a><div class="index-pro-tit">' + productInfo.productName + '</div>' +
-									'<p class="mui-text-left">' + productInfo.productColorDes + '<span style="float: right;color: #ff3b3b;">¥' + (productInfo.productDiscount / 100).toFixed(2) + '</span></p></a>' +
+									'<p class="mui-text-left" >' + productInfo.productColorDes + '</p></a>' +
+									'<p class="mui-text-left"><span style="color: #ff3b3b;font-size: 15px;">¥' + (productInfo.productDiscount / 100).toFixed(2) + '</span>  <span style="float: right;">' + productInfo.productSalesnum + '已售</span></p></a>' +
 									zen + '</br>' +
 									productInfo.imagetextContext +
 									'';

+ 81 - 0
tooth/cash-coupon-618.html

@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title>soodo上朵</title>
+		<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">
+		<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 type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
+		<script>
+			//屏蔽分享
+			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+				// 通过下面这个API隐藏右上角按钮
+				WeixinJSBridge.call('hideOptionMenu');
+			});
+		</script>
+	</head>
+	<body>
+		<div class="mui-content">
+			<div class="mui-content-padded">
+				<img width="100%" src="images/quan-2.jpg" />
+			</div>
+			<br />
+			<div class="mui-text-center">
+				<button type="button" class="mui-btn" id="my-btn" style="background-color: #F1436C;color: #fff;border: 0;border-radius: 0;padding: 8px 40px;">立即领取</button>
+			</div>
+		</div>
+		<!-- 加载ing begin-->
+		<div class="loading covers">
+			<div class="loading-bj"></div>
+			<p>正在加载...</p>
+		</div>
+		<!-- 加载ing end -->
+	<script type="text/javascript" src="js/mui.min.js"></script>
+	<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
+	<script type="text/javascript" src="js/main.js"></script>
+	<script type="text/javascript">
+	window.addEventListener('pageshow', function(e) {
+		// 通过persisted属性判断是否存在 BF Cache
+		if(e.persisted) {
+			location.reload();
+		}
+	});
+	mui.ready(function(){
+		$(".loading").hide();//隐藏(正在加载...)
+	});	
+	$(document).on('tap', '#my-btn', function() {
+		$.ajax(base_path + '/wechat/activity/receive_coupon?dates=' + new Date().getTime(), {
+					data: {},// ajax参数 没有则不写
+					dataType: 'json',
+					xhrFields: {
+						withCredentials: true
+					},
+					crossDomain: true,
+					type: 'get',
+					timeout: 15000,
+					success: function(dt) {
+						if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
+							location.href = dt.redirectURL;
+						} else {
+							if(dt.status){
+								mui.alert(dt.message,function(){
+									location.href='coupon_list.html'
+								});
+							}else{
+								mui.alert(dt.message);
+							}
+						}
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(xhr);
+						mui.alert("领取失败!网络错误");
+					}
+				});
+	});
+	</script>
+	</body>
+</html>

文件差异内容过多而无法显示
+ 2 - 1
tooth/clearing.html


+ 39 - 14
tooth/css/main.css

@@ -50,6 +50,10 @@ p{color: #999;}
 #index-top-menu .mui-control-item{color: #333;border: 0;position: relative;}
 #index-top-menu .mui-control-item.mui-active{background-color: #fff;color: #333;}
 #index-top-menu .mui-control-item.mui-active:after{content: '';position: absolute;left: 50%;bottom: 4px;width: 30px;margin-left: -15px;height: 1px;background-color: #333;}
+#customized-menu{border: 0;width: 60%;margin: 0 auto;}
+#customized-menu .mui-control-item{color: #333;border: 0;position: relative;}
+#customized-menu .mui-control-item.mui-active{background-color: #fff;color: #333;}
+#customized-menu .mui-control-item.mui-active:after{content: '';position: absolute;left: 50%;bottom: 4px;width: 30px;margin-left: -15px;height: 1px;background-color: #f16071;}
 #vip-top-menu{border: 0;width: 80%;display: block;margin: -20px auto 0 auto;box-shadow:0px 1px 3px 1px #ccc;border-radius: 50px;}
 #vip-top-menu .mui-control-item{color: #333;border: 0;position: relative;background-color: #fff;}
 #vip-top-menu .mui-control-item.mui-active{background-color: #fff;color: #333;}
@@ -67,13 +71,41 @@ p{color: #999;}
 .banner-box-pro{margin: 12px 14px 5px 14px;}
 .mui-slider-indicator .mui-indicator {display: inline-block;width: 8px;height: 8px;margin: 1px 2px;cursor: pointer;border-radius: 8px;background: #e8e8e8;-webkit-box-shadow: 0 0 0 0 rgba(130,130,130,.7);box-shadow: 0 0 0 0 rgba(130,130,130,.7);}
 .mui-slider-indicator .mui-active.mui-indicator{background-color: #f16071;width: 8px;}
+.reply-message{padding:0px 5px !important;position: relative;}
+.reply-message:after{content: '';position: absolute;left: 15px;right:15px !important;bottom: 0;height: 1px !important;background: rgba(0,0,0,.1);width: auto;}
+.reply-message .mui-card-content{padding-bottom: 10px;}
+.reply-message .mui-card{box-shadow: 0 0 0 0;border-radius: 0;}
+.reply-message .dec{padding-top: 10px;}
+.reply-message .dec img{width: 18%;min-width: 18%;max-width: 18%;margin: 0 1% 0 0;}
+.reply-message .dec img:last-child{margin-right: 0;}
+.my-fullscreen{position: fixed;height: 100%;left: 0;width: 20%;text-align: center;background-color: #fff;z-index: 99;}
+.menu-right-control{position: fixed;height: 100%;right: 10px;width: 20%;text-align: center;top: 20%;z-index: 99;}
+.my-img-list>li{position: relative;font-family: Muiicons;font-size: 24px;font-weight: 400;font-style: normal;line-height: 1;display: inline-block;text-decoration: none;-webkit-font-smoothing: antialiased;}
+.my-img-list>li:after{content: '\e472';position: absolute;right: 3px;top: 1px;background:rgba(0,0,0,.2);border-radius: 50%;color: #fff;}
+.my-img-list>li.active:after{background: #f16071;}
+.menu-right-control .my-img-list img{width: 95%;max-width: 70px;}
+.my-cl-list{width:100%;display:block;position: fixed;left: 0; padding-left: 0;bottom: 65px;text-align: center;}
+.my-cl-list>li{display: inline-block;text-align: center;width: 30px;height: 30px;border-radius: 30px;margin: 0 20px;}
+.my-cl-list>li .mui-icon{color: transparent;font-size: 32px;}
+.my-cl-list>li.active .mui-icon{color: #333;}
+.my-cl-list .quan-white{background-color: #fff;}
+.my-cl-list .quan-roseGold{background-color: #f7f2c7;}
+.my-cl-list .quan-pink{background-color: #e4cbd3;}
+#menu-left-control.mui-segmented-control .mui-control-item{display: block;width: auto;border-left:0;padding: 20px 0;color: #666;} 
+#menu-left-control.mui-segmented-control .mui-control-item.mui-active{background-color: #ffdfe1;color: #f16071;}
+.up-head-img{background-color: #fff;border-radius: 50%;display: inline-block;width: 50px;height: 50px;line-height: 50px;color: #f16071;}
+.up-head-img .mui-icon{font-size: 50px;line-height: 50px;}
 .mui-slider-indicator{bottom: 4px;}
 .table-top{vertical-align: top;}
 .table-bottom{vertical-align: bottom;}
 .table-middle{vertical-align: middle;}
 .div-btn-buy-know{background-color: #f16071;color: #fff;font-size: 16px;}
+.btn-customized-submit{width:100%;z-index: 99; text-align: center; position: fixed;left:0;bottom: 0;line-height: 50px;height: 50px; background-color: #f16071;color: #fff;font-size: 18px;padding: 0 10px;display: none;}
 .cart{line-height: 1.1;}
 .cart div{font-size: 12px;}
+.my-menu-list>li{margin: 20px 0;}
+.my-menu-list .mui-badge{background-color: #fff;color: #333;min-width: 4.5em;max-width: 4.5em;padding:7px 6px 6px 6px;}
+.my-menu-list .mui-badge.active{background-color: #f16071;color: #fff;}
 .my-badge-danger{background: #f16071;color: #fff; -webkit-transform: scale(.7);}
 .cart .my-badge-danger{position: absolute;top: 3px;display: none;}
 .cart:after{content:'';position: absolute;top: 0;left: 0;width: 100%;height: 1px;background: #ccc;-webkit-transform: scaleY(.5);}
@@ -133,20 +165,8 @@ p{color: #999;}
 .my-btn{width: 100px;color: #666;}
 .pro-table-pull{padding-bottom: 50px;}
 .mui-table-view.mui-grid-view .mui-table-view-cell{font-size: 14px;}
-.dalog-vip-center{
-    display: none;
-    -webkit-transition-duration: 400ms;
-    transition-duration: 400ms;
-    position: fixed;
-    width: 280px;
-    height: 260px;
-    top: 50%;
-    left: 50%;
-    margin-left: -140px;
-    margin-top: -140px;
-    opacity: 1;
-    z-index: 999;
-}
+.dalog-vip-center{display: none;-webkit-transition-duration: 400ms;transition-duration: 400ms;position: fixed;width: 280px;height: 260px;top: 50%;left: 50%;margin-left: -140px;margin-top: -140px;opacity: 1;z-index: 999;}
+.my-btn-danger{display: block;width: 100%;background-color: #f16071;height: 44px;border-radius: 0;color: #fff;border: 0;}
 .bn-box{background-color: #fff7f7;padding-top: 20px;}
 .bn-box img{width: 50%;display: block;margin: 0 auto;border-radius: 50%;}
 .buy-footer1 {position: fixed;bottom: 0;left: 0;height: 50px;background-color: #f0f0f0;width: 100%;padding: 0;}
@@ -183,6 +203,11 @@ p{color: #999;}
 .clearing-box{margin: 14px;}
 .clearing-box .center{margin-left: 35%;}
 .my-view-no-top:before{display: none;}
+.my-list-618{border:1px dashed #ccc;padding-top: 15px;padding-bottom: 15px; margin-bottom: 25px;}
+.my-list-618:after,.my-list-618:before,.my-list-618 .mui-table-view-cell:after,.my-list-618 .mui-table-view-cell:before{display: none;}
+.my-list-618 .name-618{position: absolute;left: 70px;top: 20px;}
+.my-list-618 .date-618{position: absolute;right: 20px;top: 25px;}
+.btn-submit-618{color: #fff;width: 100%;height: 50px;border:0;border-radius:0;text-align: center;background-color: #F1436C;}
 .my-view-no-top .mui-navigate-right:after{right: 0;font-size: 22px;}
 			input[name=checkbox] {
     width: 18px;

二进制
tooth/images/fenxiang-2018-0618.jpg


二进制
tooth/images/hd-618.jpg


+ 229 - 0
tooth/index-2018-618-list.html

@@ -0,0 +1,229 @@
+<!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="format-detection" content="telephone=no">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<title>soodo上朵</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" />
+		<script>
+			//屏蔽分享
+		</script>
+	</head>
+
+	<body>
+		<div class="mui-content" style="padding-bottom: 50px;">
+			<div class="vip-user-box">
+				<div class="user-middle">
+					<div class="user-head">
+						<!--头像-->
+						<img id="headDiv" src="images/tx-1.png" />
+						<!--等级图标-->
+						<!--<span class="user-leave"><img src="images/icon-vip-1.png" /></span>-->
+					</div>
+					<!--昵称-->
+					<div class="user-name" id="userNickname" style="font-size: 20px;">name</div>
+					<!--用户身份-->
+					<!--<div class="userIdentity"></div>-->
+					<p>让笑容停留在18岁</p>
+				</div>
+			</div>
+			<div class="mui-content-padded">
+				<ul class="mui-table-view my-list-618">
+				<li class="mui-text-center">
+					已助力好友列表
+				</li>	
+				<li class="mui-text-center">
+					<h6>(共<span id="allCount">0</span>人,还需<span id="nextCount">0</span>人)</h6>
+				</li>
+				<!--<li class="mui-table-view-cell mui-media">
+					<a href="javascript:;">
+						<img class="mui-media-object mui-pull-left" src="images/tx-1.png">
+						<div class="name-618">
+							木屋
+						</div>
+						<h6 class="date-618">2018-06-18 10:10</h6>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media">
+					<a href="javascript:;">
+						<img class="mui-media-object mui-pull-left" src="images/tx-1.png">
+						<div class="name-618">
+							木屋
+						</div>
+						<h6 class="date-618">2018-06-18 10:10</h6>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media">
+					<a href="javascript:;">
+						<img class="mui-media-object mui-pull-left" src="images/tx-1.png">
+						<div class="name-618">
+							木屋
+						</div>
+						<h6 class="date-618">2018-06-18 10:10</h6>
+					</a>
+				</li>-->
+
+			</ul>
+			</div>
+			<div class="mui-content-padded">
+				<h4 class="mui-text-center">活动详情</h4>
+			</div>
+			<div class="mui-content-padded">
+				<img width="100%" src="images/hd-618.jpg" />
+			</div>
+			
+		</div>
+		<footer class="mui-bar mui-bar-tab">
+			<button type="button" class="btn-submit-618" style="display: none;"></button>
+		</footer>
+		<!-- 加载ing -->
+		<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 src="js/wechat-utils-1.0.js"></script>
+		<script>
+			window.addEventListener('pageshow', function(e) {
+				// 通过persisted属性判断是否存在 BF Cache
+				if(e.persisted) {
+					location.reload();
+				}
+			});
+			
+			mui.ready(function() {
+				$.ajax(base_path + '/wechat/activity/to_activity?dates=' + new Date().getTime(), {
+					data: {},// ajax参数 没有则不写
+					dataType: 'json',
+					xhrFields: {
+						withCredentials: true
+					},
+					crossDomain: true,
+					type: 'get',
+					timeout: 15000,
+					success: function(dt) {
+						if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
+							location.href = dt.redirectURL;
+						} else {
+							$("#headDiv").prop("src",dt.data.member.userHead);
+							$("#userNickname").text(dt.data.member.userNickname);
+							if(dt.status) {//判断接口返回状态status
+								console.log(dt)	
+								if(dt.data.status==-1){
+									$(".btn-submit-618").attr("name",dt.data.status).text("立即参加").show();
+									$(".my-list-618").hide();
+								}else if(dt.data.status==1){
+									$(".btn-submit-618").attr("name",dt.data.status).text("查看二维码").show();
+								}else if(dt.data.status==2){
+									$(".btn-submit-618").attr("name",dt.data.status).text("领取刷头兑换券").show();
+								}else if(dt.data.status==3){
+									$(".btn-submit-618").text("已领取刷头兑换券").attr("disabled","disabled").show();
+								}
+								var table=document.body.querySelector(".my-list-618");
+								mui.each(dt.data.activityHelpList, function() {
+									var li=document.createElement("li");
+									li.className='mui-table-view-cell mui-media';
+									li.innerHTML='<a><img class="mui-media-object mui-pull-left" src="'+this.userHead+'"><div class="name-618">'+this.userNickname+'</div><h6 class="date-618">'+this.activityCreateTime+'</h6></a>';
+									table.appendChild(li);
+								});
+								$("#allCount").text(dt.data.activity.activityAlreadyHelp);
+								$("#nextCount").text(dt.data.activity.activityAllHelp-dt.data.activity.activityAlreadyHelp);
+							} else {
+								mui.alert(dt.message,function(){
+									location.href="pro-list.html";
+								});
+							}
+							setTimeout(function(){
+								fenxiang();
+								$(".loading").hide();//隐藏loadilng
+							},500);
+						}
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(xhr);
+						mui.alert("进入失败!网络错误");
+					}
+				});
+				
+			});
+			
+			
+			
+		
+			//按钮事件
+			$(document).on('tap', '.btn-submit-618', function() {
+				var th=$(this);
+				var src='';
+				switch (th.attr("name")){
+					case "-1":
+					$.ajax(base_path+'/wechat/activity/participate_activity?dates=' + new Date().getTime(), {
+					data: {},// ajax参数 没有则不写
+					dataType: 'json',
+					xhrFields: {
+						withCredentials: true
+					},
+					crossDomain: true,
+					type: 'get',
+					timeout: 20000,
+					success: function(dt) {
+						if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
+							location.href = dt.redirectURL;
+						} else {
+							if(dt.status) {//判断接口返回状态status
+								//console.log(dt.data.imgPath);	
+							} else {
+								mui.alert(dt.message);
+							}
+						}
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(xhr);
+						mui.alert("参加失败!网络错误");
+					}
+				});
+						break;
+					case "1":
+					 location.href='index-2018-618.html';
+						break;
+					case "2":
+					location.href='cash-coupon-618.html';
+						break;
+					case "3":
+					mui.alert("您已经领取过优惠券,请勿重复操作")
+						break;	
+					default:
+						break;
+				}
+				
+			});
+			
+			//分享			
+			function fenxiang(){
+				var src = location.href;
+								window.wxFriend = {
+										"appId": "",
+										"imgUrl": 'https://s.iamberry.com/soodo/wechat/images/fenxiang-2018-0618.jpg',
+										"link": src,
+										"desc": '老会员免费领取刷头福利啦!',
+										"title": '【soodo上朵】老会员免费领取刷头福利啦!',
+										"netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
+										"shareTimeSuccess": "分享成功",
+										"shareTimeCancel": "已取消分享",
+										"shareAppSuccess": "分享成功!",
+										"shareAppCancel": "已取消分享"
+								};
+								getConfig();
+			}
+		</script>
+	</body>
+
+</html>

+ 80 - 0
tooth/index-2018-618.html

@@ -0,0 +1,80 @@
+<!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="format-detection" content="telephone=no">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<title>soodo上朵</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" />
+		<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" style="padding-bottom: 50px;">
+			<div class="mui-content-padded">
+				<img width="100%" id="hd-618" src="" />
+			</div>
+		</div>
+		<!-- 加载ing -->
+		<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();
+				}
+			});
+			
+			mui.ready(function() {
+				$.ajax(base_path + '/wechat/activity/get_activity?dates=' + new Date().getTime(), {
+					data: {},// ajax参数 没有则不写
+					dataType: 'json',
+					xhrFields: {
+						withCredentials: true
+					},
+					crossDomain: true,
+					type: 'get',
+					timeout: 15000,
+					success: function(dt) {
+						if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
+							location.href = dt.redirectURL;
+						} else {
+							if(dt.status) {//判断接口返回状态status
+								console.log(dt)
+								$("#hd-618").attr("src",base_path+"/"+dt.data.activity.activityImg);
+							} else {
+								mui.alert(dt.message,function(){
+									location.href='index-2018-618-list.html';
+								});
+							}
+						}
+						$(".loading").hide();//隐藏loadilng
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(xhr);
+						mui.alert("获取数据失败!网络错误");
+					}
+				});
+			});		
+		</script>
+	</body>
+
+</html>

+ 0 - 403
tooth/js/main.js.bak

@@ -1,403 +0,0 @@
-var domanUrl = "http://" + window.location.host;
-var base_path = "http://w.iamberry.com/iamberry";
-//var base_path = "/iamberry";
-
-//ajax loading
-$(window).ajaxStart(function(){
-    $(".covers").show();
-});
-$(window).ajaxStop(function(){
-    $(".covers").hide();
-});
-
-mui.each(document.querySelectorAll('#footer-bar-tab .mui-tab-item'), function(index, el) {
-					el.addEventListener('tap', function() {
-						switch(index) {
-							case 0:
-								mui.openWindow({
-									url: 'index.html'
-								});
-								break;
-							case 1:
-								mui.openWindow({
-									url: 'pro-list.html'
-								});
-								break;
-							case 2:
-								mui.openWindow({
-									url: 'shopping-cart.html'
-								});
-								break;
-							case 3:
-								mui.openWindow({
-									url: 'my-center.html'
-								});
-								break;	
-							default:
-								break;
-						}
-					}, false);
-				});
-
-function time_before(t){
-	var minute=1000*60;
-	var hour=minute*60;
-	var day=hour*24;
-	var halfamonth=day*15;
-	var month=day*30;
-	var now=new Date().getTime();
-	var diffValue=now-new Date().setTime(t);
-	var monthC=diffValue/month;
-	var weekC=diffValue/(7*day);
-	var dayC=diffValue/day;
-	var hourC=diffValue/hour;
-	var minC=diffValue/minute;
-	if(monthC>=1){
-		result=""+parseInt(monthC)+"月前";
-	}else if(weekC>=1){
-		result=""+parseInt(weekC)+"周前";
-	}else if(dayC>=1){
-		result=""+parseInt(dayC)+"天前";
-	}else if(hourC>=1){
-		result=""+parseInt(hourC)+"小时前";
-	}else if(minC>=2){
-		result=""+parseInt(minC)+"分钟前";
-	}else{
-		result="刚刚";
-	}
-	return result;
-};
-//封装document.getElementById
-function dc(objectid) {
-	if(document.getElementById && document.getElementById(objectid)) {
-		return document.getElementById(objectid);// w3c dom
-	} else if (document.all && document.all(objectid)) {
-		return document.all(objectid);// msie 4 dom
-	} else if (document.layers && document.layers[objectid]) {
-		return document.layers[objectid];// nn 4 dom.. note: this won't find nested layers
-	} else {
-		return false;
-	}
-};
-//生成随机字符,n长度
-function generateMixed(n) {
-	var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
-     var res = "";
-     for(var i = 0; i < n ; i ++) {
-         var id = Math.ceil(Math.random()*35);
-         res += chars[id];
-     }
-     return res;
-}
-function getParam(paramName) {
-	paramValue = "", isFound = !1;
-	if(this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
-		arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
-		while(i < arrSource.length && !isFound) {
-			arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
-		}
-	}
-	return paramValue == "" && (paramValue = null), paramValue
-};
-function getQueryString(name) { 
-var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
-var r = window.location.search.substr(1).match(reg); 
-if (r != null) return unescape(r[2]); return null; 
-} 
-// 对Date的扩展,将 Date 转化为指定格式的String   
-// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,   
-// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)   
-// 例子:   
-// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423   
-// (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18   
-Date.prototype.format = function(fmt)   
-{ //author: meizz   
-  var o = {   
-    "M+" : this.getMonth()+1,                 //月份   
-    "d+" : this.getDate(),                    //日   
-    "h+" : this.getHours(),                   //小时   
-    "m+" : this.getMinutes(),                 //分   
-    "s+" : this.getSeconds(),                 //秒   
-    "q+" : Math.floor((this.getMonth()+3)/3), //季度   
-    "S"  : this.getMilliseconds()             //毫秒   
-  };   
-  if(/(y+)/.test(fmt))   
-    fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));   
-  for(var k in o)   
-    if(new RegExp("("+ k +")").test(fmt))   
-  fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));   
-  return fmt;   
-}
-//计算月份差
-function getMonthNumber(date1,date2){
-  //默认格式为"2010-01-01",根据自己需要改格式和方法
-  var d1=date1.replaceAll("-",''),d2=date2.replaceAll("-",'');
-
-  var year1 =  d1.substring(0,4);
-  var year2 =  d2.substring(0,4); 
-  var month1 = d1.substring(6,4);
-  var month2 = d2.substring(6,4);
-  var len=parseInt((year2-year1)*12+(month2-month1));
-  return len;
-}
- //替换所有要替换的文字
-String.prototype.replaceAll = function (str1,str2){
-var str = this; 
-var result = str.replace(eval("/"+str1+"/gi"),str2);
-return result;
-}
-/**
- ** 加法函数,用来得到精确的加法结果
- ** 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
- ** 调用:accAdd(arg1,arg2)
- ** 返回值:arg1加上arg2的精确结果
- **/
-function accAdd(arg1, arg2) {
-    var r1, r2, m, c;
-    try {
-        r1 = arg1.toString().split(".")[1].length;
-    }
-    catch (e) {
-        r1 = 0;
-    }
-    try {
-        r2 = arg2.toString().split(".")[1].length;
-    }
-    catch (e) {
-        r2 = 0;
-    }
-    c = Math.abs(r1 - r2);
-    m = Math.pow(10, Math.max(r1, r2));
-    if (c > 0) {
-        var cm = Math.pow(10, c);
-        if (r1 > r2) {
-            arg1 = Number(arg1.toString().replace(".", ""));
-            arg2 = Number(arg2.toString().replace(".", "")) * cm;
-        } else {
-            arg1 = Number(arg1.toString().replace(".", "")) * cm;
-            arg2 = Number(arg2.toString().replace(".", ""));
-        }
-    } else {
-        arg1 = Number(arg1.toString().replace(".", ""));
-        arg2 = Number(arg2.toString().replace(".", ""));
-    }
-    return (arg1 + arg2) / m;
-}
-
-//给Number类型增加一个add方法,调用起来更加方便。
-Number.prototype.add = function (arg) {
-    return accAdd(arg, this);
-};
-
-/** 
- ** 除法函数,用来得到精确的除法结果
- ** 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
- ** 调用:accDiv(arg1,arg2)
- ** 返回值:arg1除以arg2的精确结果
- **/
-function accDiv(arg1, arg2) {
-    var t1 = 0, t2 = 0, r1, r2;
-    try {
-        t1 = arg1.toString().split(".")[1].length;
-    }
-    catch (e) {
-    }
-    try {
-        t2 = arg2.toString().split(".")[1].length;
-    }
-    catch (e) {
-    }
-    with (Math) {
-        r1 = Number((arg1 + "").replace(".", ""));
-        r2 = Number((arg2 + "").replace(".", ""));
-        return (r1 / r2) * pow(10, t2 - t1);
-    }
-}
-//给Number类型增加一个div方法,调用起来更加方便。
-Number.prototype.div = function (arg) {
-  return accDiv(this, arg);
-};
-/**
- ** 乘法函数,用来得到精确的乘法结果
- ** 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
- ** 调用:accMul(arg1,arg2)
- ** 返回值:arg1乘以 arg2的精确结果
- **/
-function accMul(arg1, arg2) {
-    var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
-    try {
-        m += s1.split(".")[1].length;
-    }
-    catch (e) {
-    }
-    try {
-        m += s2.split(".")[1].length;
-    }
-    catch (e) {
-    }
-    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
-}
-// 给Number类型增加一个mul方法,调用起来更加方便。
-Number.prototype.mul = function (arg) {
-    return accMul(arg, this);
-};
-function formatDate(now)   {     
-	now = new Date(now);
-    var   year=now.getFullYear();     
-    var   month=now.getMonth()+1;
-    if(month<10){
-    	month="0"+month;
-    }
-    var   date=now.getDate();         
-    return   year+"年"+month+"月"+date+"日";     
-}
-function formatTime(msd) {  
-    var time = parseFloat(msd) /1000;  
-    if (null!= time &&""!= time) {  
-        if (time >60&& time <60*60) {  
-        	 time = parseInt(time /60.0) +"分"; 
-//          time = parseInt(time /60.0) +"分钟"+ parseInt((parseFloat(time /60.0) -  
-//          parseInt(time /60.0)) *60) +"秒";  
-        }else if (time >=60*60&& time <60*60*24) {  
-//          time = parseInt(time /3600.0) +"小时"+ parseInt((parseFloat(time /3600.0) -  
-//          parseInt(time /3600.0)) *60) +"分钟"+
-//          parseInt((parseFloat((parseFloat(time /3600.0) - parseInt(time /3600.0)) *60) -  
-//          parseInt((parseFloat(time /3600.0) - parseInt(time /3600.0)) *60)) *60) +"秒";  
-            time = parseInt(time /3600.0) +"时"+ parseInt((parseFloat(time /3600.0) -  
-            parseInt(time /3600.0)) *60) +"分"; 
-        }else {  
-            time = parseInt(time) +"分";  
-        }  
-    }else{  
-        time = "0分";  
-    }  
-    return time;  
-}
-function formatMinutes(msd) { 
-	// 参数msd (秒)
-    var time = parseFloat(msd);  
-    if (null!= time && ""!= time) {  
-        if (time >0&& time <60*60) {  
-        	 time = parseInt(time /60.0) +"分"; 
-        }else{  
-            time = parseInt(time /3600.0) +"时"+ parseInt((parseFloat(time /3600.0) -  
-            parseInt(time /3600.0)) *60) +"分"; 
-        }
-    }else{  
-        time = "0分"; 
-    }  
-    return time;  
-}
-function formatDay(now)   {     
-	now = new Date(now);    
-    var   month=now.getMonth()+1;  
-    if(month<10){
-    	month="0"+month;
-    }
-    var   date=now.getDate();
-    if(date<10){
-    	date="0"+date;
-    }
-    return month+"-"+date;     
-}
-function formatDateFull(now)   {     
-	now = new Date(now);
-    var   year=now.getFullYear();     
-    var   month=now.getMonth()+1;  
-    if(month<10){
-    	month="0"+month;
-    }
-    var   date=now.getDate();
-    if(date<10){
-    	date="0"+date;
-    }
-    return year+"-"+month+"-"+date;     
-}
-function formatDateMinute(now)   {     
-	now = new Date(now);
-    var   year=now.getFullYear();     
-    var   month=now.getMonth()+1; 
-    if(month<10){
-    	month="0"+month;
-    }
-    var   date=now.getDate();
-    if(date<10){
-    	date="0"+date;
-    }
-    var   hour=now.getHours();
-    if(hour<10){
-    	hour="0"+hour;
-    }
-    var   Minute=now.getMinutes();
-    if(Minute<10){
-    	Minute="0"+Minute;
-    }
-    return year+"-"+month+"-"+date+" "+hour+":"+Minute;     
-}
-function int_for_time(obj){
-	return obj+":00";
-}
-//替换指定传入参数的值,paramName为参数,replaceWith为新值
-function replaceParamVal(paramName,replaceWith) {
-    var oUrl = this.location.href.toString();
-    var re=eval('/('+ paramName+'=)([^&]*)/gi');
-    var nUrl = oUrl.replace(re,paramName+'='+replaceWith);
-    window.history.pushState({},0,nUrl); 
-}
-function isEmptyObject(e) {  
-    var t;  
-    for (t in e)  
-        return !1;  
-    return !0  
-}
-function gotoTop() {
-	mui('.my-scroll-wrapper').scroll().scrollTo(0,0,500);//500毫秒滚动到顶
-	//$(".mui-scroll").css({"transform":"translate3d(0px, 0px, 0px) translateZ(0px)","transition-duration":"100ms"});
-};
-function gotoBottom(){
-	mui('.my-scroll-wrapper').scroll().scrollToBottom();//500毫秒滚动到底部
-}
-$(document).on('tap', '.go_pro_list', function() {
-	var positions='';
-	if(typeof($(this).attr("pos"))!="undefined"){
-		positions=$(this).attr("pos");
-		location.href="pro-list.html?pos="+positions;
-	}else{
-		location.href="pro-list.html";
-	}
-});
-$(document).on('tap', '.icon-shouye', function() {
-	location.href="index.html";
-});
-//回到顶部
-function gotoTop(acceleration, stime) {
-	acceleration = acceleration || 0.1;
-	stime = stime || 10;
-	var x1 = 0,
-		y1 = 0,
-		x2 = 0,
-		y2 = 0,
-		x3 = 0,
-		y3 = 0;
-	if (document.documentElement) {
-		x1 = document.documentElement.scrollLeft || 0;
-		y1 = document.documentElement.scrollTop || 0;
-	}
-	if (document.body) {
-		x2 = document.body.scrollLeft || 0;
-		y2 = document.body.scrollTop || 0;
-	}
-	var x3 = window.scrollX || 0;
-	var y3 = window.scrollY || 0;
-
-	var x = Math.max(x1, Math.max(x2, x3));
-	var y = Math.max(y1, Math.max(y2, y3));
-
-	var speeding = 1 + acceleration;
-	window.scrollTo(Math.floor(x / speeding), Math.floor(y / speeding));
-
-	if (x > 0 || y > 0) {
-		var run = "gotoTop(" + acceleration + ", " + stime + ")";
-		window.setTimeout(run, stime);
-	}
-}

+ 1 - 1
tooth/shopping-cart.html

@@ -78,7 +78,7 @@
 		<script src="js/mui.min.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>
 			window.addEventListener('pageshow', function(e) {
 				// 通过persisted属性判断是否存在 BF Cache