Showing
7 changed files
with
9 additions
and
9 deletions
@@ -71,7 +71,7 @@ exports.intro = (req, res, next) => { | @@ -71,7 +71,7 @@ exports.intro = (req, res, next) => { | ||
71 | * @param {[type]} res [description] | 71 | * @param {[type]} res [description] |
72 | * @return {[type]} [description] | 72 | * @return {[type]} [description] |
73 | */ | 73 | */ |
74 | -exports.preference = (req, res) => { | 74 | +exports.preference = (req, res, next) => { |
75 | preference({ | 75 | preference({ |
76 | productskn: req.query.productSkn, | 76 | productskn: req.query.productSkn, |
77 | yhchannel: req.yoho.channel, | 77 | yhchannel: req.yoho.channel, |
@@ -80,7 +80,7 @@ exports.preference = (req, res) => { | @@ -80,7 +80,7 @@ exports.preference = (req, res) => { | ||
80 | res.render('detail/preference', Object.assign({ | 80 | res.render('detail/preference', Object.assign({ |
81 | layout: false | 81 | layout: false |
82 | }, result)); | 82 | }, result)); |
83 | - }); | 83 | + }).catch(next); |
84 | }; | 84 | }; |
85 | 85 | ||
86 | /** | 86 | /** |
@@ -131,7 +131,7 @@ let getCommentInfo = (params) => { | @@ -131,7 +131,7 @@ let getCommentInfo = (params) => { | ||
131 | let comments = (params) => { | 131 | let comments = (params) => { |
132 | return getCommentInfo({ | 132 | return getCommentInfo({ |
133 | productId: params.product_id, | 133 | productId: params.product_id, |
134 | - limit: '20' | 134 | + limit: '60' |
135 | }).then(result => { | 135 | }).then(result => { |
136 | let data = {}; | 136 | let data = {}; |
137 | 137 | ||
@@ -169,6 +169,8 @@ let consults = (params) => { | @@ -169,6 +169,8 @@ let consults = (params) => { | ||
169 | data.consults = result[1].list; | 169 | data.consults = result[1].list; |
170 | } | 170 | } |
171 | 171 | ||
172 | + data.showReadMore = result[1].list.length > 2; | ||
173 | + | ||
172 | return data; | 174 | return data; |
173 | }); | 175 | }); |
174 | }; | 176 | }; |
@@ -29,7 +29,7 @@ router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页 | @@ -29,7 +29,7 @@ router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页 | ||
29 | router.get('/detail/preference', detail.preference); // 为你优选 | 29 | router.get('/detail/preference', detail.preference); // 为你优选 |
30 | router.get('/detail/consults', detail.consults); // 商品咨询页 | 30 | router.get('/detail/consults', detail.consults); // 商品咨询页 |
31 | router.get('/detail/consultform', auth, detail.consultform); // 商品咨询表单页 | 31 | router.get('/detail/consultform', auth, detail.consultform); // 商品咨询表单页 |
32 | -router.get('/detail/comments', detail.comments); | 32 | +router.get('/detail/comments', detail.comments); // 商品评价 |
33 | router.post('/detail/consultsubmit', auth, detail.consultsubmit); // 商品咨询提交接口 | 33 | router.post('/detail/consultsubmit', auth, detail.consultsubmit); // 商品咨询提交接口 |
34 | 34 | ||
35 | router.get('/sale', sale.index); | 35 | router.get('/sale', sale.index); |
1 | <div class="goods-comments-page yoho-page"> | 1 | <div class="goods-comments-page yoho-page"> |
2 | <div class="goods-comments" id="goods-comments"> | 2 | <div class="goods-comments" id="goods-comments"> |
3 | - {{log comments}} | ||
4 | {{# comments}} | 3 | {{# comments}} |
5 | <div class="comment-item"> | 4 | <div class="comment-item"> |
6 | <span class="user-name">{{userName}}</span> | 5 | <span class="user-name">{{userName}}</span> |
@@ -41,6 +41,7 @@ var navtabEle = document.getElementById('nav-tab'), | @@ -41,6 +41,7 @@ var navtabEle = document.getElementById('nav-tab'), | ||
41 | $('#feedback-content .consult-content').removeClass('hide'); | 41 | $('#feedback-content .consult-content').removeClass('hide'); |
42 | } | 42 | } |
43 | 43 | ||
44 | + $('.goods-consults .consult-item:lt(2)').removeClass('hide'); | ||
44 | }()); | 45 | }()); |
45 | 46 | ||
46 | if (navtabHammer) { | 47 | if (navtabHammer) { |
@@ -91,8 +92,7 @@ if ($('.goods-consults-page').length > 0) { | @@ -91,8 +92,7 @@ if ($('.goods-consults-page').length > 0) { | ||
91 | if (readmoreHammer) { | 92 | if (readmoreHammer) { |
92 | readmoreHammer.on('tap', function() { | 93 | readmoreHammer.on('tap', function() { |
93 | $('.readmore').hide(); | 94 | $('.readmore').hide(); |
94 | - $('.goods-consults.customer-consults').removeClass('customer-consults'); | ||
95 | - | 95 | + $('.goods-consults').find('.consult-item').removeClass('hide'); |
96 | return false; | 96 | return false; |
97 | }); | 97 | }); |
98 | } | 98 | } |
@@ -62,13 +62,12 @@ function wrapElements(selector, count) { | @@ -62,13 +62,12 @@ function wrapElements(selector, count) { | ||
62 | 62 | ||
63 | 63 | ||
64 | function search() { | 64 | function search() { |
65 | - if (searching || end) { | 65 | + if (searching || end || !introUrl) { |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | searching = true; | 68 | searching = true; |
69 | 69 | ||
70 | // alert($('#reference-swiper-container .swiper-wrapper').width()); | 70 | // alert($('#reference-swiper-container .swiper-wrapper').width()); |
71 | - | ||
72 | loading.showLoadingMask(); | 71 | loading.showLoadingMask(); |
73 | 72 | ||
74 | $.ajax({ | 73 | $.ajax({ |
-
Please register or login to post a comment