Authored by liangxs

领券代码更新

/**
* Created by Administrator on 2016/4/13.
*/
var $ = require('jquery');
var $receive = $('.coupon-right-re');
$receive.on('touchend',function(){
alert('sss')
});
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
background-color: #f0f0f0;
.coupon-title {
text-align: center;
height: 58rem/$pxConvertRem;
height: 40rem/$pxConvertRem;
font-size: 30rem / $pxConvertRem;
background-color: #fff;
padding-top:36rem/$pxConvertRem;
... ... @@ -11,40 +11,61 @@
background-color: #fff;
padding: 36rem/$pxConvertRem;
margin-bottom: 20rem/$pxConvertRem;
min-height: 242rem/$pxConvertRem;
height: 172rem/$pxConvertRem;
.coupon-box-main {
width: 100%;
background-color: #00ee00;
float: left;
height: 170rem / $pxConvertRem;
.coupon-img {
.coupon-left {
float: left;
width: 80%;
height: 170rem/$pxConvertRem;
background-size: 100%;
background-repeat: no-repeat;
}
.coupon-op {
.coupon-right {
float: left;
width: 20%;
height: 170rem/$pxConvertRem;
background-color: #2e2e2e;
margin: 0rem/$pxConvertRem;
.coupon-op-st {
font-size:12rem/$pxConvertRem;;
.coupon-right-st {
color: #fff;
text-align: center;
margin-top: 40rem/$pxConvertRem;
}
.coupon-op-re {
.coupon-right-re {
color: #fff;
text-align: center;
border-radius: 15px;
border: 1px solid #fff;
margin-top: 10rem/$pxConvertRem;
margin-top: 20rem/$pxConvertRem;
margin-left:6rem/$pxConvertRem;
margin-right:6rem/$pxConvertRem;
}
}
}
}
}
.coupon-mask{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,.5);
display:none;
z-index: 9;
}
.coupon-message{
position: fixed;
top:50%;
left: 50%;
width: 100px;
height: 100px;
margin-left: -50px;
margin-top: -50px;
z-index: 10;
background: #000;
display:none;
}
\ No newline at end of file
... ...
{{>layout/header}}
<div class="coupon-page yoho-page">
{{#if showTitle}}
<div class="coupon-title">
{{title}}
</div>
{{/if}}
{{# coupons}}
<div class="coupon-box">
<div class="coupon-box-main">
{{#if url}}
<a href="{{url}}" class="coupon-img">
<img src="{{picUrl}}" />
</a>
{{^}}
<img src="{{picUrl}}" class="coupon-img"/>
{{/if}}
<div class="coupon-op">
<div class="coupon-op-st">已领取</div>
<div class="coupon-op-re">领券</div>
</div>
<!--<div class="coupon-op">
<div>状态:{{status}} 剩余数量:{{num}}</div>
<button onclick="receiveCoupon()">领券</button>
<div><a href="{{go}}">去逛逛</a></div>
</div>-->
{{# floor}}
<div class="coupon-page yoho-page">
{{#if showTitle}}
<div class="coupon-title">
{{title}}
</div>
{{/if}}
{{# coupons}}
<div class="coupon-box">
<div class="coupon-box-main" style="background: url('{{picUrl}}')">
{{#if url}}
<a href="{{url}}">
<div class="coupon-left"></div>
</a>
{{^}}
<div class="coupon-left"></div>
{{/if}}
<div class="coupon-right">
<div class="coupon-right-st">已领取</div>
<div class="coupon-right-re">领券</div>
</div>
</div>
</div>
</div>
{{/ coupons}}
</div>
{{> layout/footer}}
<script type="application/javascript">
function receiveCoupon() {
$.ajax({
url:'http://m.dev.yohobuy.com/coupon/receiveCoupon',
method:'GET',
data:{id:12},
dataType:'html',
success:function (data) {
alert(data);
},
error:function (error) {
alert(error);
}
});
}
</script>
\ No newline at end of file
{{/ coupons}}
</div>
<div class="coupon-mask"> </div>
<div class="coupon-message"></div>
{{/floor}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -341,3 +341,8 @@
</script>
{{/if}}
{{#if floorPage}}
<script>
seajs.use('js/index/coupon');
</script>
{{/if}}
... ...
... ... @@ -52,7 +52,11 @@ class CouponController extends AbstractAction
]
]
];
$this->_view->display('index', $data);
$this->_view->display('index', array(
'floor' => $data,
'floorPage' => true
));
}
/**
... ...