Authored by 沈志敏

分享活动页

@@ -7,8 +7,7 @@ const couponModel = require(`${mRoot}/coupon`); // 领取优惠券 model @@ -7,8 +7,7 @@ const couponModel = require(`${mRoot}/coupon`); // 领取优惠券 model
7 exports.index = (req, res, next) => { 7 exports.index = (req, res, next) => {
8 var renderData = { 8 var renderData = {
9 module: 'activity', 9 module: 'activity',
10 - page: 'coupon',  
11 - appDownLoadLink: 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho' 10 + page: 'coupon'
12 }, 11 },
13 ordercode = req.query.ordercode, 12 ordercode = req.query.ordercode,
14 uid = req.query.uid, 13 uid = req.query.uid,
@@ -28,7 +27,6 @@ exports.index = (req, res, next) => { @@ -28,7 +27,6 @@ exports.index = (req, res, next) => {
28 // 获取信息成功 27 // 获取信息成功
29 couponData.ordercode = ordercode; 28 couponData.ordercode = ordercode;
30 } 29 }
31 - couponData.appDownLoadLink = renderData.appDownLoadLink;  
32 res.render('coupon', { 30 res.render('coupon', {
33 result: couponData, 31 result: couponData,
34 module: 'activity', 32 module: 'activity',
@@ -61,6 +59,7 @@ exports.getCoupon = (req, res, next) => { @@ -61,6 +59,7 @@ exports.getCoupon = (req, res, next) => {
61 // 获取信息成功 59 // 获取信息成功
62 couponData.ordercode = ordercode; 60 couponData.ordercode = ordercode;
63 } 61 }
  62 +
64 // console.log(couponData); 63 // console.log(couponData);
65 res.json({ 64 res.json({
66 result: couponData 65 result: couponData
@@ -94,6 +93,7 @@ exports.verify = (req, res, next) => { @@ -94,6 +93,7 @@ exports.verify = (req, res, next) => {
94 // 获取信息成功 93 // 获取信息成功
95 couponData.ordercode = ordercode; 94 couponData.ordercode = ordercode;
96 } 95 }
  96 +
97 // console.log(couponData); 97 // console.log(couponData);
98 res.json({ 98 res.json({
99 result: couponData 99 result: couponData
@@ -17,19 +17,21 @@ const getPageInfo = (pageInfo) => { @@ -17,19 +17,21 @@ const getPageInfo = (pageInfo) => {
17 dest.activityID = pageInfo.id; 17 dest.activityID = pageInfo.id;
18 dest.title = pageInfo.data.h5Title; 18 dest.title = pageInfo.data.h5Title;
19 dest.activityDesc = pageInfo.data.activityDesc; 19 dest.activityDesc = pageInfo.data.activityDesc;
  20 + dest.formatActivityDesc = pageInfo.data.formatActivityDesc;
20 dest.couponPic = pageInfo.data.couponPic; 21 dest.couponPic = pageInfo.data.couponPic;
21 dest.oldUserCouponPic = pageInfo.data.oldUserCouponPic; 22 dest.oldUserCouponPic = pageInfo.data.oldUserCouponPic;
22 dest.mobile = pageInfo.data.mobile; 23 dest.mobile = pageInfo.data.mobile;
23 dest.wechatShare = true; 24 dest.wechatShare = true;
24 dest.secondScreenPic = pageInfo.data.secondScreenPic; 25 dest.secondScreenPic = pageInfo.data.secondScreenPic;
  26 + dest.activityEndPic = pageInfo.data.activityEndPic;
  27 + dest.buttonLink = pageInfo.data.buttonLink;
25 28
26 - // 强制活动开始,活动上线产品要求这样设置  
27 - pageInfo.data.flag = 1;  
28 - if (pageInfo.data.flag === 1) {  
29 - dest.bgImg = pageInfo.data.activityNormalPic;  
30 - } else { 29 + if (pageInfo.data.flag === 3 || pageInfo.data.flag === 4 || pageInfo.data.flag === 5) {
  30 + // flag为3 表示活动结束 , 4 表示未开始
31 dest.bgImg = pageInfo.data.activityEndPic; 31 dest.bgImg = pageInfo.data.activityEndPic;
32 dest.ended = true; 32 dest.ended = true;
  33 + } else {
  34 + dest.bgImg = pageInfo.data.activityNormalPic;
33 } 35 }
34 dest.message = pageInfo.data.returnMsg; 36 dest.message = pageInfo.data.returnMsg;
35 } 37 }
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <p>登录Yoho!Buy有货客户端即可使用</p> 27 <p>登录Yoho!Buy有货客户端即可使用</p>
28 28
29 <div class="use-coupon-btn"> 29 <div class="use-coupon-btn">
30 - <a href="{{appDownLoadLink}}">马上去Yoho!Buy有货使用</a> 30 + <a href="{{buttonLink}}">马上去Yoho!Buy有货使用</a>
31 </div> 31 </div>
32 <span class="description"></span> 32 <span class="description"></span>
33 </div> 33 </div>
@@ -60,6 +60,7 @@ @@ -60,6 +60,7 @@
60 </div> 60 </div>
61 61
62 <div class="tip-wrap hidden"> 62 <div class="tip-wrap hidden">
  63 + <img src="{{image activityEndPic 640 1136}}">
63 <div class="tip fail"> 64 <div class="tip fail">
64 <div class="header"> 65 <div class="header">
65 </div> 66 </div>
@@ -81,7 +82,12 @@ @@ -81,7 +82,12 @@
81 <div class="mask hidden"></div> 82 <div class="mask hidden"></div>
82 <div class="dialog hidden" id="message"> 83 <div class="dialog hidden" id="message">
83 <span class="close"></span> 84 <span class="close"></span>
84 - {{{activityDesc}}} 85 + <div class="activity-message">
  86 + <h3>活动说明</h3>
  87 + <div class="message">
  88 + {{{formatActivityDesc}}}
  89 + </div>
  90 + </div>
85 </div> 91 </div>
86 92
87 93
@@ -329,14 +329,30 @@ $('.close').on('click', function() { @@ -329,14 +329,30 @@ $('.close').on('click', function() {
329 $('.dialog').addClass('hidden'); 329 $('.dialog').addClass('hidden');
330 $('.mask').addClass('hidden'); 330 $('.mask').addClass('hidden');
331 $('#dialog .content').html(' '); 331 $('#dialog .content').html(' ');
  332 + $('body').css({
  333 + overflow: 'auto',
  334 + position: ''
  335 + });
  336 +});
  337 +$('.mask').on('touchmove', function() {
  338 + return false;
332 }); 339 });
  340 +
333 $('.coupon-description span').on('click', function() { 341 $('.coupon-description span').on('click', function() {
334 $('#message').removeClass('hidden'); 342 $('#message').removeClass('hidden');
335 $('.mask').removeClass('hidden'); 343 $('.mask').removeClass('hidden');
  344 + $('body').css({
  345 + overflow: 'hidden',
  346 + position: 'fixed'
  347 + });
336 }); 348 });
337 $('.description').on('click', function() { 349 $('.description').on('click', function() {
338 $('#message').removeClass('hidden'); 350 $('#message').removeClass('hidden');
339 $('.mask').removeClass('hidden'); 351 $('.mask').removeClass('hidden');
  352 + $('body').css({
  353 + overflow: 'hidden',
  354 + position: 'fixed'
  355 + });
340 }); 356 });
341 357
342 $('.use-coupon-btn').on('click', function() { 358 $('.use-coupon-btn').on('click', function() {
@@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
187 .dialog { 187 .dialog {
188 width: 84%; 188 width: 84%;
189 height: 410px; 189 height: 410px;
190 - position: absolute; 190 + position: fixed;
191 background: #fff; 191 background: #fff;
192 border-radius: 0.6rem; 192 border-radius: 0.6rem;
193 left: 8%; 193 left: 8%;
@@ -232,7 +232,7 @@ @@ -232,7 +232,7 @@
232 .activity-message { 232 .activity-message {
233 width: 100%; 233 width: 100%;
234 height: 410px; 234 height: 410px;
235 - overflow: scroll; 235 + overflow: auto;
236 } 236 }
237 237
238 .activity-message h3 { 238 .activity-message h3 {
@@ -277,17 +277,20 @@ @@ -277,17 +277,20 @@
277 .tip-wrap { 277 .tip-wrap {
278 width: 100%; 278 width: 100%;
279 height: 100%; 279 height: 100%;
280 - background: #9d1a15;  
281 position: fixed; 280 position: fixed;
282 top: 0; 281 top: 0;
283 left: 0; 282 left: 0;
284 z-index: 3; 283 z-index: 3;
  284 +
  285 + img {
  286 + width: 100%;
  287 + height: 100%;
  288 + }
285 } 289 }
286 290
287 .tip { 291 .tip {
288 width: 100%; 292 width: 100%;
289 height: 100%; 293 height: 100%;
290 - background: #9d1a15;  
291 position: absolute; 294 position: absolute;
292 top: 0; 295 top: 0;
293 left: 0; 296 left: 0;