123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <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" style="overflow: hidden; padding-bottom: 20px;">
- <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('refreshUserDate');
- }
- 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)
- }
- });
- }
- }
-
-
- /**
- * 该方法用于将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;
- }
-
- //分享
- 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>
|