...
|
...
|
@@ -21,10 +21,8 @@ |
|
|
.page{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
overflow: hidden;
|
|
|
background: #e10c1e;
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
}
|
|
|
.banner{
|
|
|
width: 100%;
|
...
|
...
|
@@ -51,15 +49,14 @@ |
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
overflow: hidden;
|
|
|
padding-top: 2.4rem;
|
|
|
background: #e10c1e;
|
|
|
padding-top: 4rem;
|
|
|
}
|
|
|
.centent div{
|
|
|
width: 81.25%;
|
|
|
height: 4rem;
|
|
|
overflow: hidden;
|
|
|
margin: 0 auto;
|
|
|
padding-bottom: 1rem;
|
|
|
padding-bottom: 1.2rem;
|
|
|
}
|
|
|
.centent input{
|
|
|
width: 68%;
|
...
|
...
|
@@ -105,7 +102,6 @@ |
|
|
.dialog .close{
|
|
|
width: 1.4rem;
|
|
|
height: 1.4rem;
|
|
|
overflow: hidden;
|
|
|
background: #444;
|
|
|
color: #f1f1f1;
|
|
|
border-radius: 50%;
|
...
|
...
|
@@ -115,10 +111,6 @@ |
|
|
line-height: 1.4rem;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.dialog .close img{
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
}
|
|
|
.hidden{
|
|
|
display: none;
|
|
|
}
|
...
|
...
|
@@ -155,27 +147,12 @@ |
|
|
margin:0 auto;
|
|
|
line-height: 2rem;
|
|
|
}
|
|
|
.messages{
|
|
|
width: 82%;
|
|
|
height: 4rem;
|
|
|
position: absolute;
|
|
|
background: rgba(0,0,0,.9);
|
|
|
border-radius: .6rem;
|
|
|
left:9%;
|
|
|
top: 45%;
|
|
|
margin-top: -2rem;
|
|
|
z-index: 2;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.messages p{
|
|
|
line-height: 4rem;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="page">
|
|
|
<div class="banner">
|
|
|
<img src="images/cokeBanner.jpg">
|
|
|
<img src="/activity/cocacola/images/cokeBanner.jpg">
|
|
|
</div>
|
|
|
<div class="centent">
|
|
|
<div>
|
...
|
...
|
@@ -183,21 +160,22 @@ |
|
|
<span>获取验证码</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<input id="verification" type="text" placeholder="请输入手机验证码" maxlength="6"/>
|
|
|
<input id="verification" type="text" placeholder="请输入手机验证码" maxlength="4"/>
|
|
|
<span>领取</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
<img src="images/cokefooter.jpg">
|
|
|
<img src="/activity/cocacola/images/cokefooter.jpg">
|
|
|
<span></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="message hidden" id="dialog">
|
|
|
<div class="dialog hidden" id="dialog">
|
|
|
<span class="close">X</span>
|
|
|
<div class="content"></div>
|
|
|
</div>
|
|
|
<div class="keep-out hidden"></div>
|
|
|
<div class="dialog hidden" id="message">
|
|
|
<span class="close"><img src="images/close.png"></span>
|
|
|
<span class="close">X</span>
|
|
|
<div class="activity-message">
|
|
|
<h3>活动说明</h3>
|
|
|
<div class="message">
|
...
|
...
|
@@ -208,7 +186,9 @@ |
|
|
</div>
|
|
|
</div>
|
|
|
</body>
|
|
|
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
|
|
|
<script type="text/javascript" src="/activity/js/jquery-1.12.0.min.js"></script>
|
|
|
<script type="text/javascript" src="http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js"></script>
|
|
|
<script type="text/javascript" src="/activity/js/jquery.cookie.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
(function(w, d, s, j, f) {
|
|
|
var a = d.createElement(s);
|
...
|
...
|
@@ -234,61 +214,73 @@ |
|
|
|
|
|
var num = 0;
|
|
|
|
|
|
$('#phone').bind('input propertychange', function(){
|
|
|
console.log($(this).val().length);
|
|
|
if ($(this).val().length === 11) {
|
|
|
$('.centent span').eq('0').addClass('verification-code');
|
|
|
}else{
|
|
|
$('#phone').focus(function(){
|
|
|
$('.centent span').eq('0').addClass('verification-code');
|
|
|
})
|
|
|
$('#phone').blur(function(){
|
|
|
if (!$(this).val()) {
|
|
|
$('.centent span').eq('0').removeClass();
|
|
|
}
|
|
|
})
|
|
|
$('#verification').bind('input propertychange', function(){
|
|
|
console.log($(this).val().length);
|
|
|
if ($(this).val().length === 4) {
|
|
|
$('.centent span').eq('1').addClass('verification-code');
|
|
|
}else{
|
|
|
$('#verification').focus(function(){
|
|
|
$('.centent span').eq('1').addClass('get');
|
|
|
})
|
|
|
$('#verification').blur(function(){
|
|
|
if (!$(this).val()) {
|
|
|
$('.centent span').eq('1').removeClass();
|
|
|
}
|
|
|
})
|
|
|
$('.centent').on('click', '.verification-code', function(){
|
|
|
$('.centent span').eq('0').removeClass('verification-code');
|
|
|
if ($(this).siblings('input').val().length === 11) {
|
|
|
$.ajax({
|
|
|
url:'',
|
|
|
dataType:'json',
|
|
|
success:function(data){
|
|
|
if (data.code === 200) {
|
|
|
var time = setInterval(function(){
|
|
|
num++;
|
|
|
if (num > 60) {
|
|
|
clearInterval('time');
|
|
|
$('.centent span').eq('0').addClass('verification-code').html('获取验证码');
|
|
|
} else {
|
|
|
$('.centent span').eq('0').removeClass('verification-code').html('重新发送(' + (60-num) + ')');
|
|
|
}
|
|
|
},1000);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
var phone = $(this).siblings('input').val();
|
|
|
var reg = /[0-9]{11}/;
|
|
|
if (!reg.test(phone)) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
|
|
|
setTimeout(function(){
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('#dialog .content').html(' ')
|
|
|
}, 1400)
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
url:'/activity/cocacola/CocacolaController/sendSms',
|
|
|
data : {
|
|
|
mobile : $("#phone").val()
|
|
|
},
|
|
|
dataType:'json',
|
|
|
success:function(data){
|
|
|
if (data.code === 200) {
|
|
|
var time = setInterval(function(){
|
|
|
num++;
|
|
|
if (num > 60) {
|
|
|
num = 0;
|
|
|
$('.centent span').eq('0').addClass('verification-code').html('获取验证码');
|
|
|
clearInterval(time);
|
|
|
|
|
|
} else {
|
|
|
$('.centent span').eq('0').removeClass('verification-code').html('重新发送(' + (60-num) + ')');
|
|
|
}
|
|
|
},1000);
|
|
|
} else {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">'+ data.message +'<p>');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
$('.centent').on('click', '.get', function(){
|
|
|
if ($(this).siblings('input').val().length === 6) {
|
|
|
$('.centent span').eq('1').removeClass('get');
|
|
|
if ($(this).siblings('input').val().length === 4) {
|
|
|
$.ajax({
|
|
|
url:'',
|
|
|
url:'/activity/cocacola/CocacolaController/validRegCodeAndSendCode',
|
|
|
data : {
|
|
|
code : $("#verification").val(),
|
|
|
mobile : $("#phone").val(),
|
|
|
client_id : $.cookie("_yasvd")
|
|
|
},
|
|
|
dataType:'json',
|
|
|
success:function(data){
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
location.href = "gain.html?mobile=" + $("#phone").val();
|
|
|
} else {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
...
|
...
|
@@ -300,11 +292,6 @@ var num = 0; |
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>');
|
|
|
setTimeout(function(){
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('#dialog .content').html(' ')
|
|
|
}, 1400)
|
|
|
}
|
|
|
});
|
|
|
$('.close').on('click', function(){
|
...
|
...
|
@@ -336,11 +323,23 @@ var num = 0; |
|
|
if (typeof(wx) == "undefined") {
|
|
|
return;
|
|
|
}
|
|
|
var shareUrl = "";
|
|
|
$.ajax({
|
|
|
async : false,
|
|
|
url : "/activity/cocacola/CocacolaController/getWechatShareUrl",
|
|
|
dataType : "json",
|
|
|
success : function(data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
shareUrl = data.data.wechatShareUrl;
|
|
|
}
|
|
|
});
|
|
|
var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
|
|
|
var shareTitle = '来Yoho!Buy有货玩潮流,潮流逛不停';
|
|
|
var shareImg = 'http://192.168.102.205:8090/activity/cocacola/images/cokeBanner.jpg';
|
|
|
var shareTitle = '来Yoho!Buy有货玩潮流,潮流逛不停';
|
|
|
var shareImg = 'http://img12.static.yhbimg.com/activity/2016/04/07/11/02b3b297581ace1ca6251f7f9e67ca7937.jpg';
|
|
|
var shareDesc = '揭盖赢福利,潮流逛不停';
|
|
|
var shareLink = 'https://www.baidu.com/';
|
|
|
var shareLink = shareUrl;
|
|
|
$.getJSON(_weChatInterface + '?pageurl=' +
|
|
|
encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function(json) {
|
|
|
var _appId, _timestamp, _nonceStr, _signature;
|
...
|
...
|
|