Authored by ccbikai(👎🏻🍜)

Merge branch 'feature/activitycoupon'

... ... @@ -80,7 +80,7 @@ app.use(session({
app.use((req, res, next) => {
req.user = {}; // 全局的用户数据
req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
req.app.locals.wap = app.locals.wap; //zookeper对象赋值
req.app.locals.wap = app.locals.wap; // zookeper对象赋值
if (!req.session.id) {
req.session.id = uuid.v4();
}
... ...
... ... @@ -7,8 +7,7 @@ const couponModel = require(`${mRoot}/coupon`); // 领取优惠券 model
exports.index = (req, res, next) => {
var renderData = {
module: 'activity',
page: 'coupon',
appDownLoadLink: 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho'
page: 'coupon'
},
ordercode = req.query.ordercode,
uid = req.query.uid,
... ... @@ -28,7 +27,6 @@ exports.index = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
couponData.appDownLoadLink = renderData.appDownLoadLink;
res.render('coupon', {
result: couponData,
module: 'activity',
... ... @@ -61,6 +59,7 @@ exports.getCoupon = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
// console.log(couponData);
res.json({
result: couponData
... ... @@ -94,6 +93,7 @@ exports.verify = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
// console.log(couponData);
res.json({
result: couponData
... ...
... ... @@ -17,18 +17,21 @@ const getPageInfo = (pageInfo) => {
dest.activityID = pageInfo.id;
dest.title = pageInfo.data.h5Title;
dest.activityDesc = pageInfo.data.activityDesc;
dest.formatActivityDesc = pageInfo.data.formatActivityDesc;
dest.couponPic = pageInfo.data.couponPic;
dest.oldUserCouponPic = pageInfo.data.oldUserCouponPic;
dest.mobile = pageInfo.data.mobile;
dest.wechatShare = true;
dest.secondScreenPic = pageInfo.data.secondScreenPic;
dest.activityEndPic = pageInfo.data.activityEndPic;
dest.buttonLink = pageInfo.data.buttonLink;
// 强制活动开始,活动上线产品要求这样设置
pageInfo.data.flag = 1;
if (pageInfo.data.flag === 1) {
dest.bgImg = pageInfo.data.activityNormalPic;
} else {
if (pageInfo.data.flag === 3 || pageInfo.data.flag === 4 || pageInfo.data.flag === 5) {
// flag为3 表示活动结束 , 4 表示未开始
dest.bgImg = pageInfo.data.activityEndPic;
dest.ended = true;
} else {
dest.bgImg = pageInfo.data.activityNormalPic;
}
dest.message = pageInfo.data.returnMsg;
}
... ... @@ -91,7 +94,7 @@ exports.getCoupon = (data) => {
method: 'wap.order.drawOrderShareCoupon'
},
// 处理完成后,发给后端
// 处理完成后,发给后端
phoneData = Object.assign(defaultParam, data);
return api.get('', phoneData).then(result => {
... ... @@ -108,10 +111,10 @@ exports.registerAndSendCoupon = (data) => {
method: 'wap.order.registerAndSendCoupon'
},
// 处理完成后,发给后端
// 处理完成后,发给后端
verifyData = Object.assign(defaultParam, data);
return api.get('', verifyData).then(result => {
return getUserStatus(result);
}); // 所有数据返回一个 Promise,方便 Promise.all 调用
}); // 所有数据返回一个 Promise,方便 Promise.all 调用
};
... ...
... ... @@ -2,6 +2,9 @@
<div class="receive-coupon-page">
<div class="bg-contain">
<img src="{{image bgImg 640 1136}}">
{{#if secondScreenPic}}
<img src="{{image secondScreenPic}}">
{{/if}}
</div>
<p class="hidden" id="orderCode">{{ordercode}}</p>
<p class="hidden" id="oldUserCouponPic">{{image oldUserCouponPic}}</p>
... ... @@ -24,7 +27,7 @@
<p>登录Yoho!Buy有货客户端即可使用</p>
<div class="use-coupon-btn">
<a href="{{appDownLoadLink}}">马上去Yoho!Buy有货使用</a>
<a href="{{buttonLink}}">马上去Yoho!Buy有货使用</a>
</div>
<span class="description"></span>
</div>
... ... @@ -57,6 +60,7 @@
</div>
<div class="tip-wrap hidden">
<img src="{{image activityEndPic 640 1136}}">
<div class="tip fail">
<div class="header">
</div>
... ... @@ -78,7 +82,12 @@
<div class="mask hidden"></div>
<div class="dialog hidden" id="message">
<span class="close"></span>
{{{activityDesc}}}
<div class="activity-message">
<h3>活动说明</h3>
<div class="message">
{{{formatActivityDesc}}}
</div>
</div>
</div>
... ...
... ... @@ -13,4 +13,4 @@ exports.config = {
transaction_events: {
enabled: true
}
};
\ No newline at end of file
};
... ...
... ... @@ -329,14 +329,30 @@ $('.close').on('click', function() {
$('.dialog').addClass('hidden');
$('.mask').addClass('hidden');
$('#dialog .content').html(' ');
$('body').css({
overflow: 'auto',
position: ''
});
});
$('.mask').on('touchmove', function() {
return false;
});
$('.coupon-description span').on('click', function() {
$('#message').removeClass('hidden');
$('.mask').removeClass('hidden');
$('body').css({
overflow: 'hidden',
position: 'fixed'
});
});
$('.description').on('click', function() {
$('#message').removeClass('hidden');
$('.mask').removeClass('hidden');
$('body').css({
overflow: 'hidden',
position: 'fixed'
});
});
$('.use-coupon-btn').on('click', function() {
... ...
... ... @@ -187,7 +187,7 @@
.dialog {
width: 84%;
height: 410px;
position: absolute;
position: fixed;
background: #fff;
border-radius: 0.6rem;
left: 8%;
... ... @@ -232,7 +232,7 @@
.activity-message {
width: 100%;
height: 410px;
overflow: scroll;
overflow: auto;
}
.activity-message h3 {
... ... @@ -277,17 +277,20 @@
.tip-wrap {
width: 100%;
height: 100%;
background: #9d1a15;
position: fixed;
top: 0;
left: 0;
z-index: 3;
img {
width: 100%;
height: 100%;
}
}
.tip {
width: 100%;
height: 100%;
background: #9d1a15;
position: absolute;
top: 0;
left: 0;
... ...