浏览代码

上朵双十二

wangxiaoming 5 年之前
父节点
当前提交
ad6d95181d

二进制
tooth/images/20191212/40_coupon.png


二进制
tooth/images/20191212/90_coupon.png


二进制
tooth/images/20191212/back.jpg


二进制
tooth/images/20191212/baokuan.png


二进制
tooth/images/20191212/dubang.png


二进制
tooth/images/20191212/index-ban.jpg


二进制
tooth/images/20191212/lingquan.png


二进制
tooth/images/20191212/lips.png


二进制
tooth/images/20191212/peijian.png


二进制
tooth/images/20191212/qinshe.png


二进制
tooth/images/20191212/rouyu.png


+ 224 - 0
tooth/index-2019-12-12.html

@@ -0,0 +1,224 @@
+<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>soodo上朵</title>
+		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
+		<link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
+		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
+		<link rel="stylesheet" type="text/css" href="css/main.css" />
+		<style>
+			body{background-image: url(images/20191212/back.jpg);background-repeat:repeat-y;}
+			.mui-content{background-image: url(images/20191212/back.jpg);background-repeat:repeat-y;}
+			.color_a {color: #000000;}
+			.color_a:hover {color: #000000;}
+			.ul_class>ul>li{float: left;display: block;}
+			.ul_class>ul>li>img{display: block;width: 100%;}
+			.ul_class{display: block;width: 100%;}
+			.ul_li_coupon{width: 34%;}
+			.ul_li_st{width: 44%;}
+			.font_js{padding-top: 20px;padding-bottom: 25px;color: #FFFFFF;text-align: center;font-size: 12px;}
+		</style>
+	</head>
+	<script>
+		var start = new Date(2019,12-1,9,00,00,00);
+		var end = new Date(2019,12-1,20,23,59,59);
+		var d = new Date().getTime(); //当前时间戳
+		if (!(d > start && d <= end)) {
+			location.href = "index.html?dates="+new Date().getTime();
+		}
+	</script>
+	<body>
+		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
+			<a class="mui-tab-item mui-active">
+				<span class="iconfont icon-shouye"></span>
+				<span class="mui-tab-label">首页</span>
+			</a>
+			<a class="mui-tab-item">
+				<span class="iconfont icon-liebiao"></span>
+				<span class="mui-tab-label">列表</span>
+			</a>
+			<a class="mui-tab-item">
+				<span class="iconfont icon-gouwuche"></span>
+				<span class="mui-tab-label">购物车</span>
+			</a>
+			<a class="mui-tab-item">
+				<span class="iconfont icon-huiyuan"></span>
+				<span class="mui-tab-label">会员</span>
+			</a>
+		</footer>
+		<div class="mui-content" style="overflow:hidden;">
+			<div><img src="images/20191212/index-ban.jpg" style="width: 100%;"></div>
+			<div><img src="images/20191212/lingquan.png" style="width: 100%;"></div>
+			
+			<div class="ul_class">
+				<ul>
+					<li class="ul_li_coupon get_coupon" couponId="90000" style="margin-left: 10%;"><img src="images/20191212/40_coupon.png" style=""></li>
+					<li class="ul_li_coupon get_coupon" couponId="90001" style="margin-left: 10%;"><img src="images/20191212/90_coupon.png" style=""></li>
+				</ul>
+			</div>
+			
+			<div><img src="images/20191212/baokuan.png" style="width: 100%;"></div>
+			
+			<div class="go_to_pro" colorId="42"><img src="images/20191212/qinshe.png" style="width: 100%;"></div>
+			
+			<div class="go_to_pro" colorId="100"><img src="images/20191212/lips.png" style="width: 100%;"></div>
+			
+			<div><img src="images/20191212/peijian.png" style="width: 100%;"></div>
+			
+			<div class="ul_class" style="width: 100%;overflow:hidden;">
+				<ul>
+					<li class="ul_li_st go_to_pro" colorId="311" style="margin-left: 4%;"><img src="images/20191212/dubang.png" style=""></li>
+					<li class="ul_li_st go_to_pro" colorId="310" style="margin-left: 3%;"><img src="images/20191212/rouyu.png" style=""></li>
+				</ul>
+			</div>
+			
+			<div class="font_js">*活动最终解释权归上朵所有</div>
+			
+			<div id="item3" class="mui-control-content">
+			</div>
+		</div>
+		<div class="loading covers">
+			<div class="loading-bj"></div>
+			<p>正在加载...</p>
+		</div>
+		<!--春节放假通知-->
+		<div class="year-dalog"></div>
+		<script src="js/mui.min.js"></script>
+		<script src="js/jquery-2.1.1.min.js"></script>
+		<script src="js/swiper.min.js"></script>
+		<script src="js/main.js"></script>
+		<!-- <script src="js/wechat-utils-1.0.js"></script> -->
+		<script>
+			//ready事件
+			mui.ready(function() {
+				
+				//刷新用户信息
+				refreshUserInfo();
+				//设置分享
+				fenxiang();
+				$(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
+			});
+			
+			mui('body').on('tap', '.go_to_pro', function() {
+				var colorId = $(this).attr("colorId");
+				if(isEmpty(colorId)){
+					mui.openWindow({
+					    url: 'pro-details.html?colorId='+colorId
+					})
+				}
+			});
+			
+			mui('body').on('tap', '.get_coupon', function() {
+				var couponId = $(this).attr("couponId");
+				if(isEmpty(couponId)){
+					$.ajax(base_path + '/wechat/coupon/re_coupon?dates=' + new Date().getTime(), {
+						data: {
+							couponId : couponId		//优惠券类型id
+						},
+						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
+									mui.toast('领取成功');
+									// mui.alert("领取成功!", function() {
+									// 	location.href = "index.html?dates=" + new Date().getTime(); // 前往首页
+									// });
+									return false;
+								} else {
+									if(dt.resultCode == "500" || dt.resultCode == "502" || dt.resultCode == "503"){
+										mui.toast(dt.message);
+										// mui.alert(dt.message, function() {
+										// 	//刷新
+										// 	WeixinJSBridge.call('closeWindow');
+										// 	wx.closeWindow();
+										// });
+										return false;
+									}else{
+										mui.toast("领取失败!");
+										// var myjson = JSON.stringify(dt);
+										// mui.alert("领取失败!" + myjson);
+										return false;
+									}
+								}
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(xhr);
+							mui.alert("领取优惠券失败!网络错误");
+						}
+					});
+				}
+			});
+			
+			//更新用户信息
+			function refreshUserInfo(){
+				var oldrefreshUserInfo =  null;
+				if (!window.localStorage) {
+					console.log("您的浏览器不支持localStorage");
+				} else {
+					oldrefreshUserInfo = localStorage.getItem('refreshUserInfo');
+				}
+				var nowdate = new Date();
+				var nowrefreshUserDate = nowdate.format("yyyy-MM-dd");
+				if(nowrefreshUserDate != oldrefreshUserInfo){
+					$.ajax(base_path + '/wechat/getUserInfo?dates=' + new Date().getTime(), {
+						dataType: 'json',
+						type: 'post',
+						timeout: 15000,
+						xhrFields: {
+							withCredentials: true
+						},
+						crossDomain: true,
+						success: function(dt) {
+							if(dt.isRedirect) {
+								location.href = dt.redirectURL;
+							} else {
+								if (!window.localStorage) {
+									console.log("您的浏览器不支持localStorage");
+								} else {
+									//自定义json数据
+									var date = new Date();
+									var refreshUserDate = date.Format("yyyy-MM-dd");
+									localStorage.setItem('refreshUserDate', refreshUserDate);
+								}
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(xhr)
+						}
+					});
+				}
+			}
+			
+			//分享
+			function fenxiang(){
+				var src = location.href;
+				src = "https://s.iamberry.com/soodo/wechat/index.html";
+				window.wxFriend = {
+						"appId": "",
+						"imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
+						"link": src,
+						"desc": '让你的齿龄停留在18岁',
+						"title": 'soodo上朵',
+						"netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
+						"shareTimeSuccess": "分享成功",
+						"shareTimeCancel": "已取消分享",
+						"shareAppSuccess": "分享成功!",
+						"shareAppCancel": "已取消分享"
+				};
+				getConfig();
+			}
+		</script>
+	</body>
+</html>

+ 71 - 7
tooth/index.html

@@ -15,12 +15,12 @@
 		</style>
 	</head>
 	<script>
+		var start = new Date(2019,12-1,10,00,00,00);
+		var end = new Date(2019,12-1,20,23,59,59);
 		var d = new Date().getTime(); //当前时间戳
-		// if (d > 1555862400000 && d <= 1557503999000) {
-		// 	location.href = "index-2019-05-01.html";
-		// }
-		
-		
+		if (d > start && d <= end) {
+			location.href = "index-2019-12-12.html?dates="+new Date().getTime();
+		}
 	</script>
 	<body>
 		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
@@ -193,7 +193,7 @@
 		<script src="js/jquery-2.1.1.min.js"></script>
 		<script src="js/swiper.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
@@ -284,12 +284,17 @@
 						location.href = "cash-coupon.html?id=" + th.attr("name");
 					}
 				});
+				
+				//刷新用户信息
+				refreshUserInfo();
+				//设置分享
+				// fenxiang();
 				$(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
 			});
 			//春节放假通知弹窗点击事件
 			$(document).on('tap', '.year-dalog', function() {
 				if (!window.localStorage) {
-					mui.alert("您的浏览器不支持localStorage");
+					console.log("您的浏览器不支持localStorage");
 				} else {
 					//自定义json数据
 					var obj = {};
@@ -304,6 +309,65 @@
 					$(".year-dalog").hide();
 				}, 500);
 			});
+			
+			//更新用户信息
+			function refreshUserInfo(){
+				var oldrefreshUserInfo =  null;
+				if (!window.localStorage) {
+					console.log("您的浏览器不支持localStorage");
+				} else {
+					oldrefreshUserInfo = localStorage.getItem('refreshUserInfo');
+				}
+				var nowdate = new Date();
+				var nowrefreshUserDate = nowdate.format("yyyy-MM-dd");
+				if(nowrefreshUserDate != oldrefreshUserInfo){
+					$.ajax(base_path + '/getUserInfo?dates=' + new Date().getTime(), {
+						dataType: 'json',
+						type: 'post',
+						timeout: 15000,
+						xhrFields: {
+							withCredentials: true
+						},
+						crossDomain: true,
+						success: function(dt) {
+							if(dt.isRedirect) {
+								location.href = dt.redirectURL;
+							} else {
+								if (!window.localStorage) {
+									console.log("您的浏览器不支持localStorage");
+								} else {
+									//自定义json数据
+									var date = new Date();
+									var refreshUserDate = date.format("yyyy-MM-dd");
+									localStorage.setItem('refreshUserDate', refreshUserDate);
+								}
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(xhr)
+						}
+					});
+				}
+			}
+			
+			//分享
+			// function fenxiang(){
+			// 	var src = location.href;
+			// 	src = "https://s.iamberry.com/soodo/wechat/index.html";
+			// 	window.wxFriend = {
+			// 			"appId": "",
+			// 			"imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
+			// 			"link": src,
+			// 			"desc": '让你的齿龄停留在18岁',
+			// 			"title": 'soodo上朵',
+			// 			"netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
+			// 			"shareTimeSuccess": "分享成功",
+			// 			"shareTimeCancel": "已取消分享",
+			// 			"shareAppSuccess": "分享成功!",
+			// 			"shareAppCancel": "已取消分享"
+			// 	};
+			// 	getConfig();
+			// }
 		</script>
 	</body>
 </html>

+ 40 - 0
tooth/js/main.js

@@ -458,4 +458,44 @@ function gotoTop(acceleration, stime) {
 		var run = "gotoTop(" + acceleration + ", " + stime + ")";
 		window.setTimeout(run, stime);
 	}
+}
+
+
+/**
+ * 该方法用于将Undefined转换为空值
+ * @param val
+ */
+function convertUndefinedToEmpty(val) {
+    if (undefined == val || null == val||typeof val == undefined || typeof val == 'undefined'|| 'undefined' == val) {
+        val = "";
+    }
+    return val;
+}
+
+/**
+ * 该方法用于将Undefined转换为空值
+ * @param val
+ */
+function cufte(val) {
+    return convertUndefinedToEmpty(val);
+}
+
+/**
+ * 空值返回0,其他值返回原值
+ * @param val
+ */
+function cufteInt(val) {
+    if(convertUndefinedToEmpty(val) == "")
+        return 0;
+    return val;
+}
+
+/**
+ * 空值返回false
+ * @param val
+ */
+function isEmpty(val) {
+    if(convertUndefinedToEmpty(val) == "")
+        return false;
+    return true;
 }

+ 1 - 1
tooth/welfare-receive-coupon.html

@@ -72,7 +72,7 @@
 				$.ajax(base_path + '/wechat/coupon/re_coupon?dates=' + new Date().getTime(), {
 				data: {
 					couponId : couponId		//优惠券类型id
-				},// ajax参数 没有则不写
+				},
 				dataType: 'json',
 				xhrFields: {
 					withCredentials: true