Authored by ccbikai

商品详情页

@@ -114,11 +114,14 @@ exports.consults = (req, res, next) => { @@ -114,11 +114,14 @@ exports.consults = (req, res, next) => {
114 /** 114 /**
115 * 咨询表单页 115 * 咨询表单页
116 */ 116 */
117 -exports.consultform = (req, res) => { 117 +exports.consultform = (req, res, next) => {
118 let headerData = headerModel.setNav({ 118 let headerData = headerModel.setNav({
119 navTitle: '我要咨询' 119 navTitle: '我要咨询'
120 }); 120 });
121 121
  122 + if (!req.query.product_id) {
  123 + return next();
  124 + }
122 res.render('detail/consult-form', { 125 res.render('detail/consult-form', {
123 pageHeader: headerData, 126 pageHeader: headerData,
124 productId: req.query.product_id, 127 productId: req.query.product_id,
@@ -39,8 +39,6 @@ function showFooter() { @@ -39,8 +39,6 @@ function showFooter() {
39 39
40 showFooter(); 40 showFooter();
41 41
42 -require('./detail/like');  
43 -  
44 lazyLoad($('img.lazy')); 42 lazyLoad($('img.lazy'));
45 43
46 if ($('#goodsDiscount h1').length < 1) { 44 if ($('#goodsDiscount h1').length < 1) {
@@ -120,6 +118,7 @@ $('#limit-sale').on('touchend', function(e) { @@ -120,6 +118,7 @@ $('#limit-sale').on('touchend', function(e) {
120 } 118 }
121 }); 119 });
122 120
  121 +require('./detail/like');
123 require('./detail/desc'); 122 require('./detail/desc');
124 require('./detail/comments-consults'); 123 require('./detail/comments-consults');
125 require('./detail/consultform'); 124 require('./detail/consultform');
@@ -148,5 +147,3 @@ $.ajax({ @@ -148,5 +147,3 @@ $.ajax({
148 if ($('.good-detail-page').length > 0) { 147 if ($('.good-detail-page').length > 0) {
149 $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); 148 $('#yoho-footer').css('border-top', '1px solid #e0e0e0');
150 } 149 }
151 -  
152 -