Authored by 郝肖肖

店铺和品牌id转数字

@@ -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 = {
@@ -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({