Showing
3 changed files
with
26 additions
and
11 deletions
@@ -43,7 +43,12 @@ const _msgDetail = (req, res, next) => { | @@ -43,7 +43,12 @@ const _msgDetail = (req, res, next) => { | ||
43 | info: result, | 43 | info: result, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | - res.render('message-detail', options); | 46 | + if (result && result.isCollar && result.isCollar === true) { |
47 | + res.redirect('/home/message'); | ||
48 | + } else { | ||
49 | + res.render('message-detail', options); | ||
50 | + } | ||
51 | + | ||
47 | }).catch(next); | 52 | }).catch(next); |
48 | }; | 53 | }; |
49 | 54 |
@@ -81,15 +81,24 @@ const _detail = (result, id, couponData) => { | @@ -81,15 +81,24 @@ const _detail = (result, id, couponData) => { | ||
81 | ticket: [] | 81 | ticket: [] |
82 | }; | 82 | }; |
83 | final.birthType = true; | 83 | final.birthType = true; |
84 | - for (let coupon of couponData) { | ||
85 | - final.ticket.push({ | ||
86 | - id: coupon.id ? coupon.id : '', | ||
87 | - couponAmount: coupon.couponAmount, | ||
88 | - couponName: coupon.couponName.split('-')[0], | ||
89 | - startTime: _formatDay(coupon.startTime), | ||
90 | - endTime: _formatDay(coupon.endTime), | ||
91 | - useLimit: coupon.useLimit | ||
92 | - }); | 84 | + |
85 | + if (result.data.list[0].body.is_collar === 'Y') { | ||
86 | + | ||
87 | + final = { | ||
88 | + isCollar: true | ||
89 | + }; | ||
90 | + | ||
91 | + } else { | ||
92 | + for (let coupon of couponData) { | ||
93 | + final.ticket.push({ | ||
94 | + id: coupon.id ? coupon.id : '', | ||
95 | + couponAmount: coupon.couponAmount, | ||
96 | + couponName: coupon.couponName.split('-')[0], | ||
97 | + startTime: _formatDay(coupon.startTime), | ||
98 | + endTime: _formatDay(coupon.endTime), | ||
99 | + useLimit: coupon.useLimit | ||
100 | + }); | ||
101 | + } | ||
93 | } | 102 | } |
94 | 103 | ||
95 | // 领取生日券消息 | 104 | // 领取生日券消息 |
@@ -10,6 +10,7 @@ const express = require('express'); | @@ -10,6 +10,7 @@ const express = require('express'); | ||
10 | 10 | ||
11 | const router = express.Router(); // eslint-disable-line | 11 | const router = express.Router(); // eslint-disable-line |
12 | const auth = require('../../doraemon/middleware/auth'); | 12 | const auth = require('../../doraemon/middleware/auth'); |
13 | +const disableBFCache = require('../../doraemon/middleware/disable-BFCache'); | ||
13 | 14 | ||
14 | const cRoot = './controllers'; | 15 | const cRoot = './controllers'; |
15 | const installment = require(cRoot + '/installment'); | 16 | const installment = require(cRoot + '/installment'); |
@@ -90,7 +91,7 @@ router.get('/suggestSub', suggest.suggestSub); | @@ -90,7 +91,7 @@ router.get('/suggestSub', suggest.suggestSub); | ||
90 | router.post('/savesuggest', suggest.saveSuggest); | 91 | router.post('/savesuggest', suggest.saveSuggest); |
91 | 92 | ||
92 | // 消息 | 93 | // 消息 |
93 | -router.use('/message', auth, message.index); | 94 | +router.use('/message', auth, disableBFCache, message.index); |
94 | router.get('/messageDetail', auth, message.index); | 95 | router.get('/messageDetail', auth, message.index); |
95 | router.post('/ajaxDelMes', auth, message.ajaxDelMes); | 96 | router.post('/ajaxDelMes', auth, message.ajaxDelMes); |
96 | router.post('/pickCoupon', auth, message.pickCoupon); | 97 | router.post('/pickCoupon', auth, message.pickCoupon); |
-
Please register or login to post a comment