Authored by 陈峰

Merge branch 'feature/shop-optim' of http://git.yoho.cn/fe/yohobuywap-node into feature/shop-optim

@@ -116,7 +116,7 @@ const _getShopInfo = (shopId, uid) => { @@ -116,7 +116,7 @@ const _getShopInfo = (shopId, uid) => {
116 method: 'app.shops.getIntro', 116 method: 'app.shops.getIntro',
117 shop_id: shopId, 117 shop_id: shopId,
118 uid: uid || 0 118 uid: uid || 0
119 - }, {code: 200}).then((result) => { 119 + }, {code: 200, cache: true}).then((result) => {
120 return result.data; 120 return result.data;
121 }); 121 });
122 }; 122 };
@@ -147,7 +147,7 @@ const _getShopCategory = (shopId, channel, gender) => { @@ -147,7 +147,7 @@ const _getShopCategory = (shopId, channel, gender) => {
147 yh_channel: yhChannel[channel], 147 yh_channel: yhChannel[channel],
148 gender: gender || '1,3', 148 gender: gender || '1,3',
149 shop_id: shopId 149 shop_id: shopId
150 - }, {code: 200}).then(result => { 150 + }, {code: 200, cache: true}).then(result => {
151 return result.data; 151 return result.data;
152 }); 152 });
153 }; 153 };
@@ -259,7 +259,7 @@ const getShopBrands = (shopId) => { @@ -259,7 +259,7 @@ const getShopBrands = (shopId) => {
259 return api.get('', { 259 return api.get('', {
260 method: 'app.shops.getShopsBrands', 260 method: 'app.shops.getShopsBrands',
261 shop_id: shopId 261 shop_id: shopId
262 - }, {code: 200}).then((result) => { 262 + }, {code: 200, cache: true}).then((result) => {
263 if (result[0]) { 263 if (result[0]) {
264 return result[0].brand_id; 264 return result[0].brand_id;
265 } 265 }
@@ -276,7 +276,7 @@ const searchProductBySkn = (productSkn) => { @@ -276,7 +276,7 @@ const searchProductBySkn = (productSkn) => {
276 return api.get('', { 276 return api.get('', {
277 method: 'h5.product.batch', 277 method: 'h5.product.batch',
278 productSkn: productSkn 278 productSkn: productSkn
279 - }, {code: 200}).then(result => { 279 + }, {code: 200, cache: true}).then(result => {
280 return _.get(result, 'data.product_list', []); 280 return _.get(result, 'data.product_list', []);
281 }); 281 });
282 }; 282 };
@@ -673,6 +673,7 @@ const getBrandIntro = (brandId, uid) => { @@ -673,6 +673,7 @@ const getBrandIntro = (brandId, uid) => {
673 let param = { 673 let param = {
674 uid: uid 674 uid: uid
675 }; 675 };
  676 +
676 return api.get('', _.assign({ 677 return api.get('', _.assign({
677 method: 'app.brand.getBrandIntro', 678 method: 'app.brand.getBrandIntro',
678 brand_id: brandId 679 brand_id: brandId
1 'use strict'; 1 'use strict';
2 2
3 const fs = require('fs'); 3 const fs = require('fs');
4 -let devHost = '172.16.9.195'; 4 +let devHost = '127.0.0.1';
5 5
6 fs.readFile('.devhost', (err, buf)=> { 6 fs.readFile('.devhost', (err, buf)=> {
7 if (!err) { 7 if (!err) {
@@ -228,7 +228,9 @@ $.extend({ @@ -228,7 +228,9 @@ $.extend({
228 228
229 a.async = 1; 229 a.async = 1;
230 a.src = j; 230 a.src = j;
  231 + setTimeout(function() {
231 m.parentNode.insertBefore(a, m); 232 m.parentNode.insertBefore(a, m);
  233 + }, 50);
232 }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.18/yas.js', '_yas')); 234 }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.18/yas.js', '_yas'));
233 235
234 (function() { 236 (function() {
@@ -15,8 +15,10 @@ shopCoupon = { @@ -15,8 +15,10 @@ shopCoupon = {
15 couponTemplate: require('product/shop/coupon.hbs') 15 couponTemplate: require('product/shop/coupon.hbs')
16 }, 16 },
17 init: function() { 17 init: function() {
  18 + setTimeout(function() {
18 this.loginCoupon(); 19 this.loginCoupon();
19 this.getShopCouponsList(); 20 this.getShopCouponsList();
  21 + }.bind(shopCoupon), 400);
20 }, 22 },
21 getShopCouponsList: function() { 23 getShopCouponsList: function() {
22 var that = this, 24 var that = this,