Authored by 沈志敏

分享活动页

... ... @@ -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,9 +93,10 @@ exports.verify = (req, res, next) => {
// 获取信息成功
couponData.ordercode = ordercode;
}
// console.log(couponData);
res.json({
result: couponData
});
}).catch(next);
};
};
\ No newline at end of file
... ...
... ... @@ -17,19 +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;
}
... ... @@ -115,4 +117,4 @@ exports.registerAndSendCoupon = (data) => {
return api.get('', verifyData).then(result => {
return getUserStatus(result);
}); // 所有数据返回一个 Promise,方便 Promise.all 调用
};
};
\ No newline at end of file
... ...
... ... @@ -27,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>
... ... @@ -60,6 +60,7 @@
</div>
<div class="tip-wrap hidden">
<img src="{{image activityEndPic 640 1136}}">
<div class="tip fail">
<div class="header">
</div>
... ... @@ -81,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>
... ...
... ... @@ -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() {
... ... @@ -357,4 +373,4 @@ $('.input-content .clear-verify').on('click', function() {
$('.input-content input').eq('1').val('');
$(this).addClass('hidden');
$('.input-content div').eq('1').removeClass();
});
});
\ No newline at end of file
... ...
... ... @@ -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;
... ...