Authored by 郝肖肖

Merge branch 'release/5.2' into feature/homeOptimization

@@ -353,7 +353,7 @@ const shopIntro = (req, res, next) => { @@ -353,7 +353,7 @@ const shopIntro = (req, res, next) => {
353 let appVersion = req.body.appVersion || false; 353 let appVersion = req.body.appVersion || false;
354 let params = {}; 354 let params = {};
355 355
356 - if (shopId) { 356 + if (parseInt(shopId, 10)) {
357 listModel.getShopIntro(shopId).then(result => { 357 listModel.getShopIntro(shopId).then(result => {
358 if (appVersion) { 358 if (appVersion) {
359 params = { 359 params = {
@@ -147,5 +147,5 @@ @@ -147,5 +147,5 @@
147 {{> common/suspend-cart}} 147 {{> common/suspend-cart}}
148 {{/ goodList}} 148 {{/ goodList}}
149 149
150 -<input type="text" class="domain" style="display:none" value={{domain}}> 150 +<input type="hidden" class="domain" value={{domain}}>
151 <input type="hidden" class="shopId shop-id" value={{shopId}}> 151 <input type="hidden" class="shopId shop-id" value={{shopId}}>
@@ -110,7 +110,7 @@ ellipsis.init(); @@ -110,7 +110,7 @@ ellipsis.init();
110 tip.show('网络断开连接了~'); 110 tip.show('网络断开连接了~');
111 } 111 }
112 }); 112 });
113 - } else if ($('.shopId').val().length > 0) { 113 + } else if ($('.shopId').val() && $('.shopId').val() !== 'undefined') {
114 $.ajax({ 114 $.ajax({
115 url: '/product/index/baseShopFav', 115 url: '/product/index/baseShopFav',
116 data: { 116 data: {
@@ -10,13 +10,13 @@ shopCoupon = { @@ -10,13 +10,13 @@ shopCoupon = {
10 common: { 10 common: {
11 appVersion: window.queryString.app_version || window.queryString.appVersion, 11 appVersion: window.queryString.app_version || window.queryString.appVersion,
12 uid: window.queryString.uid, 12 uid: window.queryString.uid,
13 - shopId: $('.shop-id').val() || '',  
14 - brandId: $('.brand-header').data('id') || '', 13 + shopId: parseInt($('.shop-id').val(), 10) || null,
  14 + brandId: parseInt($('.brand-header').data('id'), 10) || null,
15 couponTemplate: require('product/shop/coupon.hbs') 15 couponTemplate: require('product/shop/coupon.hbs')
16 }, 16 },
17 init: function() { 17 init: function() {
18 // 如果都为空,则不请求 18 // 如果都为空,则不请求
19 - if (this.common.shopId === '' && this.common.brandId === '') { 19 + if (!this.common.shopId && !this.common.brandId) {
20 return true; 20 return true;
21 } 21 }
22 22
@@ -27,12 +27,12 @@ shopCoupon = { @@ -27,12 +27,12 @@ shopCoupon = {
27 var that = this, 27 var that = this,
28 _url = location.protocol + '//m.yohobuy.com'; 28 _url = location.protocol + '//m.yohobuy.com';
29 29
30 - if (that.common.shopId === '') {  
31 - // 品牌领券  
32 - _url += '/product/index/getBrandCouponsList';  
33 - } else { 30 + if (that.common.shopId) {
34 // 店铺领券 31 // 店铺领券
35 _url += '/product/index/getShopCouponsList'; 32 _url += '/product/index/getShopCouponsList';
  33 + } else {
  34 + // 品牌领券
  35 + _url += '/product/index/getBrandCouponsList';
36 } 36 }
37 37
38 $.ajax({ 38 $.ajax({