index.phtml 1.23 KB
{{>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>-->
        </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>