Authored by liangxs

领券修改

... ... @@ -2,16 +2,58 @@
* Created by Administrator on 2016/4/13.
*/
var $ = require('jquery');
var $receive = $('.coupon-right-re');
var $receive = $('.coupon-right-reBox');
var $go=$('.coupon-right-goBox');
var $mask = $('.coupon-mask');
var $message = $('.coupon-message');
var $messageOpDet = $('.coupon-message-op-det');
var $messageOpGo = $('.coupon-message-op-go');
var $messageOpRel = $('.coupon-message-op-rel');
var timeID;
$receive.on('touchend',function(){
$.ajax({
url:'/coupon/receiveCoupon',
success:function(){
dataType:'json',
success:function(data){
var msg=data.msg;
var status=data.status;
$message.find('.coupon-message-content').text(msg);
$mask.show();
$message.show();
if(status==1){
$messageOpDet.show();
$messageOpRel.hide();
$messageOpGo.hide();
maskAutoHide(3000);
}else if(status==2){
$messageOpRel.show();
$messageOpDet.hide();
$messageOpGo.hide();
$mask.unbind('touchend');
}else{
$messageOpGo.show();
$messageOpDet.hide();
$messageOpRel.hide();
maskAutoHide(3000);
}
},
error:function(){}
});
});
$mask.on('touchend',function(){
$mask.hide();
$message.hide();
clearTimeout(timeID);
});
function maskAutoHide(time){
timeID=setTimeout(task,time);
function task(){
if($mask.css('display')!='none') {
$message.hide();
$mask.hide();
}
}
}
\ No newline at end of file
... ...
.coupon-page {
background-color: #f0f0f0;
.coupon-title {
background-color: #fff;
text-align: center;
height: 40rem/$pxConvertRem;
height: 96rem/$pxConvertRem;
line-height: 96rem/$pxConvertRem;
font-size: 30rem / $pxConvertRem;
background-color: #fff;
padding-top:36rem/$pxConvertRem;
}
.coupon-box {
background-color: #fff;
padding: 36rem/$pxConvertRem;
margin-bottom: 20rem/$pxConvertRem;
padding-top: 0;
height: 172rem/$pxConvertRem;
.coupon-box-main {
width: 100%;
... ... @@ -26,46 +25,88 @@
.coupon-right {
float: left;
width: 20%;
text-align: center;
height: 170rem/$pxConvertRem;
background-color: #2e2e2e;
font-size:12rem/$pxConvertRem;;
background-color: rgb(224,84,85);
.coupon-right-reBox {
height: 100%;
width: 100%;
color:#fff;
.coupon-right-re {
font-size: 25rem/$pxConvertRem;
margin-top: 60rem/$pxConvertRem;
}
}
.coupon-right-goBox {
height: 100%;
width: 100%;
color:#fff;
font-size: 15rem/$pxConvertRem;
.coupon-right-st {
color: #fff;
text-align: center;
margin-top: 40rem/$pxConvertRem;
}
.coupon-right-re {
color: #fff;
text-align: center;
.coupon-right-go {
border-radius: 15px;
border: 1px solid #fff;
margin: 0 auto;
margin-top: 20rem/$pxConvertRem;
margin-left:6rem/$pxConvertRem;
margin-right:6rem/$pxConvertRem;
width: 90rem/$pxConvertRem;
height: 30rem/$pxConvertRem;
line-height: 30rem/$pxConvertRem;
}
}
}
}
}
}
.coupon-mask{
.coupon-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,.5);
display:none;
background-color: rgba(0, 0, 0, .5);
display: none;
z-index: 9;
}
.coupon-message{
.coupon-message {
position: fixed;
top:50%;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin-left: -50px;
margin-top: -50px;
width: 550rem/$pxConvertRem;
height: 250rem/$pxConvertRem;
margin-left: -275rem/$pxConvertRem;
margin-top: -125rem/$pxConvertRem;
z-index: 10;
background: #000;
background-color: rgba(250, 250, 250, .92);
display: none;
border-radius: 10px;
.coupon-message-content {
border-bottom: 1px solid rgb(197, 197, 197);
height: 160rem/$pxConvertRem;
text-align: center;
line-height: 160rem/$pxConvertRem;
font-size: 28rem/$pxConvertRem;
}
.coupon-message-op {
height: 90rem/$pxConvertRem;
text-align: center;
line-height: 90rem/$pxConvertRem;
font-size: 32rem/$pxConvertRem;
.coupon-message-op-det {
color: rgb(223, 98, 112);
display:none;
}
.coupon-message-op-go {
color:rgb(223,98,112);
display:none;
}
.coupon-message-op-rel {
color: rgb(223, 98, 112);
display:none;
}
}
}
\ No newline at end of file
... ...
... ... @@ -18,14 +18,26 @@
{{/if}}
<div class="coupon-right">
{{#if status}}
<div class="coupon-right-st">点击领券</div>
<div class="coupon-right-reBox">
<div class="coupon-right-re">
<div>点击</div>
<div>领取</div>
</div>
</div>
{{^}}
{{#if is_zero}}
<a href="{{go}}">
<div class="coupon-right-goBox">
<div class="coupon-right-st">已抢光</div>
<div class="coupon-right-re">去逛逛</div>
<div class="coupon-right-go">去逛逛</div>
</div>
</a>
{{^}}
<a href="{{go}}">
<div style="height: 100%;width:100%" class="coupon-right-goBox">
<div class="coupon-right-st">已领取</div>
<div class="coupon-right-re">去逛逛</div>
<div class="coupon-right-go">去逛逛</div>
</div></a>
{{/if}}
{{/if}}
</div>
... ... @@ -35,7 +47,20 @@
</div>
<div class="coupon-mask"></div>
<div class="coupon-message"></div>
<div class="coupon-message">
<div class="coupon-message-content"></div>
<div class="coupon-message-op">
<a class="coupon-message-op-det">
<span>去查看</span>
</a>
<a href="http://m.dev.yohobuy.com/boy" class="coupon-message-op-go">
<span>去逛逛</span>
</a>
<a href="http://m.dev.yohobuy.com/coupon/floor">
<span class="coupon-message-op-rel">刷新</span>
</a>
</div>
</div>
{{/floor}}
{{> layout/footer}}
<script type="application/javascript">
... ...