Authored by 毕凯

Merge branch 'feature/crm2' into release/5.8

'use strict';
const moment = require('moment');
const model = require('../models/individuation');
const channels = {
boys: 1,
... ... @@ -74,6 +75,10 @@ exports.coupon = function(req, res, next) {
activity_template_id,
uid
}).then((result) => {
if (result && result.data) {
result.data.startTime = moment.unix(result.data.startTime).format('YYYY.M.D');
result.data.endTime = moment.unix(result.data.endTime).format('YYYY.M.D');
}
res.jsonp(result);
}).catch(next);
};
... ...
... ... @@ -157,6 +157,18 @@ function modalInit() {
});
}
function getPersenalCouponHtml(data) {
let html = `<div class="persenal-coupon">
<span class="coupon-amount">${data.amount || 0}</span>
<span class="coupon-limit">&yen;${data.useLimit || 0}使用</span>
<span class="coupon-name">${data.limitName}</span>
<span class="coupon-type">${data.limitTypeName}</span>
<span class="coupon-time">有效期:${data.startTime} - ${data.endTime}</span>
</div>`;
return html;
}
function persenalCouponInit() {
let data = {
activity_id: $('.feature-page').data('id')
... ... @@ -177,6 +189,7 @@ function persenalCouponInit() {
success: function(res) {
if (res.code === 200 && res.data && res.data.couponId && res.data.personCouponId) {
$this.attr('data-token', `${res.data.couponId}:${res.data.personCouponId}`);
$this.html(getPersenalCouponHtml(res.data));
$this.closest('.floor').show();
}
}
... ...
... ... @@ -304,3 +304,76 @@ body {
margin-bottom: 20px;
}
}
.feature-page .persenal-coupon {
color: #fff;
.coupon-amount {
position: absolute;
top: 60px;
left: 50px;
width: 240px;
height: 80px;
line-height: 80px;
text-align: center;
font-size: 68px;
font-weight: bold;
border-bottom: 1px solid #fff;
&:before {
content: "\00A5";
position: relative;
left: -6px;
top: -24px;
font-size: 34px;
}
}
.coupon-limit {
position: absolute;
left: 50px;
top: 146px;
width: 240px;
text-align: center;
font-size: 24px;
}
.coupon-name {
position: absolute;
top: 30px;
right: 30px;
width: 280px;
height: 40px;
font-size: 26px;
line-height: 40px;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}
.coupon-type {
position: absolute;
top: 68px;
right: 30px;
width: 280px;
height: 56px;
font-size: 36px;
line-height: 56px;
font-weight: bold;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
letter-spacing: 12px;
}
.coupon-time {
position: absolute;
top: 144px;
right: 70px;
font-size: 40px;
transform: scale(0.4);
transform-origin: right center;
}
}
... ...