Authored by yyq

change style

... ... @@ -62,7 +62,7 @@ module.exports = class extends global.yoho.BaseModel {
*/
getCouponByCodeAsync(uid, code) {
let options = {
method: 'app.Shopping.useCoupon',
method: 'app.coupons.bindPCoupon',
uid: uid,
coupon_code: code
};
... ...
... ... @@ -106,11 +106,14 @@ module.exports = class extends global.yoho.BaseModel {
let total = _.get(resData, 'total', 0);
let pageTotal = _.get(resData, 'pageNum') || 1;
resData.pager = Object.assign({
count: total,
curPage: page,
totalPages: pageTotal
}, setPager(pageTotal, params));
if (resData.couponList && resData.couponList.length) {
resData.pager = Object.assign({
count: total,
curPage: page,
totalPages: pageTotal
}, setPager(pageTotal, params));
}
return resData;
});
... ...
... ... @@ -56,7 +56,7 @@
{{/ couponList}}
{{#unless couponList}}
<p class="empty-tip">您没有优惠券</p>
<p class="empty-tip">暂无优惠券</p>
{{/unless}}
</div>
{{> pager}}
... ...
... ... @@ -20,9 +20,7 @@
<div class="coupon-info">
<p class="name"><span class="type type-s">[{{catalog_name}}]</span> {{coupon_name}}</p>
<p class="time">{{coupon_validity}}</p>
{{#if desc}}
<p class="mutex-tip">{{desc}}</p>
{{/if}}
<p class="desc">{{desc}}</p>
</div>
</div>
{{/ coupons}}
... ...
... ... @@ -647,7 +647,7 @@ coupon = {
}
}
}
console.log(unusableCoupon);
this.usableCoupon = this.usableCoupon || {};
data.usable_coupon_catalogs = data.usable_coupon_catalogs || {};
if (data.usable_coupon_catalogs.list) {
... ...
... ... @@ -33,7 +33,20 @@ $couponCodeUse.click(function() {
data: {code: code}
}).then(function(data) {
if (data.code === 200) {
window.location.reload();
new dialog.Dialog({
className: 'coupon-code-confirm',
content: '兑换成功',
btns: [
{
id: 'confirm-sure',
btnClass: ['confirm-sure'],
name: '确定',
cb: function() {
window.location.reload();
}
}
]
}).show();
} else {
new dialog.Alert(data.message || '兑换失败,请稍后再试').show();
}
... ...
... ... @@ -1242,6 +1242,10 @@
margin-bottom: 16px;
}
.desc {
color: #444;
}
.explain-wrap {
width: calc(100% - 119px);
height: 98px;
... ... @@ -1267,7 +1271,7 @@
.mutex-tip {
width: 200px;
height: 30px;
max-height: 30px;
line-height: 1.2;
position: absolute;
left: 118px;
... ...
... ... @@ -37,6 +37,7 @@
color: #fff;
padding: 0;
border: 0;
outline: none;
}
.sure-convert-btn {
... ... @@ -116,6 +117,20 @@
.empty-tip {
font-size: 12px;
color: #bbb;
background: #fff;
margin-top: -22px;
&:before {
content: "";
width: 104px;
height: 65px;
background: resolve(home/coupon-empty.png);
display: block;
margin: auto;
position: relative;
top: -20px;
}
}
.coupon-item {
... ... @@ -339,3 +354,15 @@
background: resolve(home/useless-tig.png);
}
}
.coupon-code-confirm {
.close,
.confirm-cancel {
display: none;
}
.content {
min-width: 0;
padding: 50px 0;
}
}
... ...