Authored by 郝肖肖

Merge branch 'master' into feature/ctx

@@ -9,6 +9,9 @@ exports.category = (req, res, next) => { @@ -9,6 +9,9 @@ exports.category = (req, res, next) => {
9 let uid = req.user.uid || req.query.uid; 9 let uid = req.user.uid || req.query.uid;
10 let params = { 10 let params = {
11 uid: uid, 11 uid: uid,
  12 + port: 1,
  13 + channel: req.query.channel,
  14 + season: req.query.season,
12 isApp: req.yoho.isApp, 15 isApp: req.yoho.isApp,
13 scene: req.query.scene || 1 16 scene: req.query.scene || 1
14 }; 17 };
@@ -42,6 +45,9 @@ exports.shop = (req, res, next) => { @@ -42,6 +45,9 @@ exports.shop = (req, res, next) => {
42 let uid = req.user.uid || req.query.uid; 45 let uid = req.user.uid || req.query.uid;
43 let params = { 46 let params = {
44 uid: uid, 47 uid: uid,
  48 + port: 1,
  49 + channel: req.query.channel,
  50 + season: req.query.season,
45 isApp: req.yoho.isApp, 51 isApp: req.yoho.isApp,
46 scene: req.query.scene || 1 52 scene: req.query.scene || 1
47 }; 53 };
1 'use strict'; 1 'use strict';
  2 +const _ = require('lodash');
2 3
3 class shareModel extends global.yoho.BaseModel { 4 class shareModel extends global.yoho.BaseModel {
4 constructor(ctx) { 5 constructor(ctx) {
@@ -10,9 +11,19 @@ class shareModel extends global.yoho.BaseModel { @@ -10,9 +11,19 @@ class shareModel extends global.yoho.BaseModel {
10 * @returns {*|Promise.<TResult>} 11 * @returns {*|Promise.<TResult>}
11 */ 12 */
12 getShareContent(params) { 13 getShareContent(params) {
  14 + let shareIdInt = _.parseInt(params.shareId);
  15 +
  16 + if (shareIdInt) {
  17 + params.shareId = _.toString(shareIdInt);
  18 + } else {
  19 + return Promise.resolve({});
  20 + }
  21 +
13 return this.get({ 22 return this.get({
14 url: 'operations/api/v5/webshare/getShare', 23 url: 'operations/api/v5/webshare/getShare',
15 - data: {share_id: params.shareId}, 24 + data: {
  25 + share_id: params.shareId
  26 + },
16 api: global.yoho.ServiceAPI, 27 api: global.yoho.ServiceAPI,
17 }).then(result => { 28 }).then(result => {
18 return result; 29 return result;
@@ -78,7 +78,9 @@ class TideModel extends global.yoho.BaseModel { @@ -78,7 +78,9 @@ class TideModel extends global.yoho.BaseModel {
78 crmRecommendShop(params) { 78 crmRecommendShop(params) {
79 return this.get({ 79 return this.get({
80 data: Object.assign({ 80 data: Object.assign({
81 - method: 'app.product.crmRecommend.shop' 81 + method: 'app.product.crmRecommend.shop',
  82 + imageType: 2,
  83 + imageSize: '314*352',
82 }, params) 84 }, params)
83 }); 85 });
84 } 86 }
@@ -121,7 +123,7 @@ class TideModel extends global.yoho.BaseModel { @@ -121,7 +123,7 @@ class TideModel extends global.yoho.BaseModel {
121 }); 123 });
122 } 124 }
123 125
124 - if (shopInfo.shopId || _.get(res[1], 'data.productList', []).length) { 126 + if (shopInfo.imageUrl || _.get(res[1], 'data.productList', []).length) {
125 tide.shopInfo.push({ 127 tide.shopInfo.push({
126 title: '# 为你精选 #', 128 title: '# 为你精选 #',
127 shopInfo: shopInfo, 129 shopInfo: shopInfo,
@@ -454,17 +454,13 @@ class BuyNowController { @@ -454,17 +454,13 @@ class BuyNowController {
454 } 454 }
455 455
456 /** 456 /**
457 - * 输入优惠券码使用优惠券 457 + * 兑换优惠券
458 */ 458 */
459 useCouponCode(req, res, next) { 459 useCouponCode(req, res, next) {
460 co(function* () { 460 co(function* () {
461 - let result = yield req.ctx(BuyNowModel).usePromotionCode({  
462 - uid: req.user.uid,  
463 - product_sku: req.body.product_sku,  
464 - sku_type: req.body.sku_type,  
465 - buy_number: req.body.buy_number,  
466 - promotion_code: req.body.promotion_code  
467 - }); 461 + let result = yield req.ctx(shoppingModel).useCoupon(
  462 + req.user.uid, req.body.couponCode
  463 + );
468 464
469 res.json(result); 465 res.json(result);
470 })().catch(next); 466 })().catch(next);
@@ -267,7 +267,8 @@ const payAli = (req, res, next) => { @@ -267,7 +267,8 @@ const payAli = (req, res, next) => {
267 uid: req.user.uid, 267 uid: req.user.uid,
268 udid: req.cookies.udid || require('yoho-md5')(req.ip) || 'yoho', 268 udid: req.cookies.udid || require('yoho-md5')(req.ip) || 'yoho',
269 orderCode: req.query.out_trade_no, 269 orderCode: req.query.out_trade_no,
270 - contentCode: '78d0fb6c97d691863286edcb4d8abfa9' 270 + contentCode: '78d0fb6c97d691863286edcb4d8abfa9',
  271 + client_id: req.cookies._yasvd || ''
271 }; 272 };
272 273
273 // 如果没有uid,跳转到首页 274 // 如果没有uid,跳转到首页
@@ -44,7 +44,7 @@ class payModel extends global.yoho.BaseModel { @@ -44,7 +44,7 @@ class payModel extends global.yoho.BaseModel {
44 return this.get({data: { 44 return this.get({data: {
45 method: 'app.recommend.purchased', 45 method: 'app.recommend.purchased',
46 productSkn: param.skn, 46 productSkn: param.skn,
47 - udid: param.uid, 47 + uid: param.uid,
48 rec_pos: '100005', 48 rec_pos: '100005',
49 limit: 2, 49 limit: 2,
50 client_id: param.client_id 50 client_id: param.client_id
@@ -72,7 +72,9 @@ class payModel extends global.yoho.BaseModel { @@ -72,7 +72,9 @@ class payModel extends global.yoho.BaseModel {
72 payment_amount: _.get(result, 'data.order_extInfo.payment_amount') || 72 payment_amount: _.get(result, 'data.order_extInfo.payment_amount') ||
73 _.get(result, 'data.payment_amount'), 73 _.get(result, 'data.payment_amount'),
74 pay_expire: _.get(result, 'data.order_detail_info.ext.pay_expire') || 74 pay_expire: _.get(result, 'data.order_detail_info.ext.pay_expire') ||
75 - _.get(result, 'data.pay_expire') 75 + _.get(result, 'data.pay_expire'),
  76 + order_goods: _.get(result, 'data.order_goods'),
  77 + package_info: _.get(result, 'data.package_info', [])
76 } 78 }
77 }; 79 };
78 } 80 }
@@ -83,6 +85,8 @@ class payModel extends global.yoho.BaseModel { @@ -83,6 +85,8 @@ class payModel extends global.yoho.BaseModel {
83 return Promise.resolve({}); 85 return Promise.resolve({});
84 } 86 }
85 87
  88 + param.uid.appVersion = _.get(global, 'yoho.config.appVersion');
  89 +
86 return this.get({data: { 90 return this.get({data: {
87 method: 'app.SpaceOrders.detail', 91 method: 'app.SpaceOrders.detail',
88 uid: param.uid, 92 uid: param.uid,
@@ -95,21 +99,14 @@ class payModel extends global.yoho.BaseModel { @@ -95,21 +99,14 @@ class payModel extends global.yoho.BaseModel {
95 99
96 // 购买此商品的用户也购买了,要先从订单详情获取商品skn 100 // 购买此商品的用户也购买了,要先从订单详情获取商品skn
97 _getOthersBuy(param) { 101 _getOthersBuy(param) {
98 - return Promise.all([  
99 - this.getOtherDetail(param)  
100 - ]).then((result) => {  
101 -  
102 - let goodSkn = ''; 102 + this.getOtherDetail(param).then(result => {
  103 + let skn = _.get(result, 'data.order_goods.0.product_skn', '');
103 104
104 - if (result && result[0] && result[0].data && result[0].data.order_goods) {  
105 - goodSkn = result[0].data.order_goods[0].product_skn; 105 + if (skn) {
  106 + return this._getOthersBuy2(Object.assign(param, { skn: skn }));
  107 + } else {
  108 + return Promise.resolve([]);
106 } 109 }
107 -  
108 - return this._getOthersBuy2(Object.assign(param, { skn: goodSkn }));  
109 -  
110 - }).then((result) => {  
111 -  
112 - return result;  
113 }); 110 });
114 } 111 }
115 112
@@ -267,7 +267,7 @@ class shoppingModel extends global.yoho.BaseModel { @@ -267,7 +267,7 @@ class shoppingModel extends global.yoho.BaseModel {
267 } 267 }
268 268
269 /** 269 /**
270 - * 购物车结算--使用优惠券 270 + * 购物车结算--兑换优惠券
271 * @param uid int 用户uid 271 * @param uid int 用户uid
272 * @param couponCode string 优惠券代码 272 * @param couponCode string 优惠券代码
273 * @return 273 * @return
@@ -59,11 +59,13 @@ @@ -59,11 +59,13 @@
59 </a> 59 </a>
60 {{/data}} 60 {{/data}}
61 {{/banner}} 61 {{/banner}}
  62 + {{#if othersBuy}}
62 <div class="others-buy clearfix"> 63 <div class="others-buy clearfix">
63 <p>购买此商品的用户也购买了</p> 64 <p>购买此商品的用户也购买了</p>
64 {{# othersBuy}} 65 {{# othersBuy}}
65 {{> common/goods}} 66 {{> common/goods}}
66 {{/ othersBuy}} 67 {{/ othersBuy}}
67 </div> 68 </div>
  69 + {{/if}}
68 {{> home/maybe-like}} 70 {{> home/maybe-like}}
69 </div> 71 </div>
@@ -185,13 +185,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -185,13 +185,14 @@ module.exports = class extends global.yoho.BaseModel {
185 }; 185 };
186 186
187 allList[key].forEach(row => { 187 allList[key].forEach(row => {
188 -  
189 - obj.list.push({  
190 - name: row.brand_name,  
191 - isHot: row.is_hot === 'Y' ? true : false,  
192 - isNew: row.is_show_new === 'Y' ? true : false,  
193 - url: this._urlJump(parseInt(row.type, 10), row)  
194 - }); 188 + if (row) {
  189 + obj.list.push({
  190 + name: _.get(row, 'brand_name', ''),
  191 + isHot: _.get(row, 'is_hot') === 'Y' ? true : false,
  192 + isNew: _.get(row, 'is_show_new') === 'Y' ? true : false,
  193 + url: this._urlJump(parseInt(_.get(row, 'type'), 10), row)
  194 + });
  195 + }
195 }); 196 });
196 resu.brandList.push(obj); 197 resu.brandList.push(obj);
197 } 198 }
@@ -207,9 +208,9 @@ module.exports = class extends global.yoho.BaseModel { @@ -207,9 +208,9 @@ module.exports = class extends global.yoho.BaseModel {
207 }; 208 };
208 209
209 obj.list.push({ 210 obj.list.push({
210 - brandName: newList[key].brand_name,  
211 - url: this._urlJump(parseInt(newList[key].type, 10), newList[key]),  
212 - img: helpers.image(newList[key].brand_ico, 186, 115), 211 + brandName: _.get(newList, `${key}.brand_name`, ''),
  212 + url: this._urlJump(parseInt(_.get(newList, `${key}.type`), 10), _.get(newList, `${key}`)),
  213 + img: helpers.image(_.get(newList, `${key}.brand_ico`), 186, 115),
213 }); 214 });
214 resu.newBrandWall.push(obj); 215 resu.newBrandWall.push(obj);
215 } 216 }
@@ -172,6 +172,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -172,6 +172,8 @@ module.exports = class extends global.yoho.BaseModel {
172 return Promise.resolve({}); 172 return Promise.resolve({});
173 } 173 }
174 174
  175 + uid.appVersion = _.get(global, 'yoho.config.appVersion');
  176 +
175 return this.get({ 177 return this.get({
176 data: { 178 data: {
177 method: 'app.SpaceOrders.detail', 179 method: 'app.SpaceOrders.detail',
@@ -323,7 +323,6 @@ const local = { @@ -323,7 +323,6 @@ const local = {
323 domain: 'm.yohobuy.com' 323 domain: 'm.yohobuy.com'
324 }); 324 });
325 325
326 -  
327 // 弱密码返回数据 326 // 弱密码返回数据
328 let passwordWeakReturn; 327 let passwordWeakReturn;
329 328
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 'use strict'; 11 'use strict';
12 12
  13 +const _ = require('lodash');
13 const config = global.yoho.config; 14 const config = global.yoho.config;
14 const utils = require(global.utils); 15 const utils = require(global.utils);
15 const ResetModel = require('../models/reset'); 16 const ResetModel = require('../models/reset');
@@ -48,7 +49,16 @@ const passwordResetPage = (req, res) => { @@ -48,7 +49,16 @@ const passwordResetPage = (req, res) => {
48 */ 49 */
49 const passwordReset = (req, res, next) => { 50 const passwordReset = (req, res, next) => {
50 let passwordWeakObj = req.session.passwordWeak; 51 let passwordWeakObj = req.session.passwordWeak;
51 - let uid = (req.user && req.user.uid) || (passwordWeakObj && passwordWeakObj.uid); 52 + let uid = req.user && req.user.uid;
  53 +
  54 + if (!uid && passwordWeakObj && passwordWeakObj.uid && passwordWeakObj.session_key) {
  55 + uid = {
  56 + toString: () => {
  57 + return _.parseInt(passwordWeakObj.uid);
  58 + },
  59 + sessionKey: passwordWeakObj.session_key
  60 + };
  61 + }
52 62
53 if (!uid || !passwordWeakObj || !passwordWeakObj.token) { 63 if (!uid || !passwordWeakObj || !passwordWeakObj.token) {
54 return res.json({ 64 return res.json({
@@ -300,6 +300,10 @@ module.exports = class extends global.yoho.BaseModel { @@ -300,6 +300,10 @@ module.exports = class extends global.yoho.BaseModel {
300 * 搜索店铺的商品 300 * 搜索店铺的商品
301 */ 301 */
302 getShopGoods(params) { 302 getShopGoods(params) {
  303 + if (!/^[0-9]*$/.test(params.shop_id)) {
  304 + return Promise.resolve({});
  305 + }
  306 +
303 let finalParams = { 307 let finalParams = {
304 method: 'app.search.shop', 308 method: 'app.search.shop',
305 }; 309 };
@@ -155,6 +155,9 @@ router.get('/search/shop/goods', search.searchShopGoods); // 搜索店铺下的 @@ -155,6 +155,9 @@ router.get('/search/shop/goods', search.searchShopGoods); // 搜索店铺下的
155 155
156 router.get('/list/global(/:pathParams)?', rewrite.resolvePathParams, globalPro.list); // 全球购路由重写 全球购列表页 156 router.get('/list/global(/:pathParams)?', rewrite.resolvePathParams, globalPro.list); // 全球购路由重写 全球购列表页
157 157
  158 +router.get('/index/index', rewrite.resolvePathParams, list.listNew); // 列表新的 URL
  159 +router.get('/list/index', rewrite.resolvePathParams, list.listNew); // 旧 兼容 PC 的链接
  160 +
158 router.get('/list(/:pathParams)?', rewrite.resolvePathParams, list.listNew); // 列表新的 URL 161 router.get('/list(/:pathParams)?', rewrite.resolvePathParams, list.listNew); // 列表新的 URL
159 router.get('/search/category', 162 router.get('/search/category',
160 cors, 163 cors,
@@ -42,7 +42,7 @@ const domains = { @@ -42,7 +42,7 @@ const domains = {
42 42
43 module.exports = { 43 module.exports = {
44 app: 'h5', 44 app: 'h5',
45 - appVersion: '6.5.3', // 调用api的版本 45 + appVersion: '6.6.0', // 调用api的版本
46 appName: 'yohobuywap-node', 46 appName: 'yohobuywap-node',
47 port: 6001, 47 port: 6001,
48 siteUrl: '//m.yohobuy.com', 48 siteUrl: '//m.yohobuy.com',
@@ -20,6 +20,11 @@ module.exports = (limiter, policy) => { @@ -20,6 +20,11 @@ module.exports = (limiter, policy) => {
20 20
21 try { 21 try {
22 blacklist = JSON.parse(args[0]); 22 blacklist = JSON.parse(args[0]);
  23 + } catch (error) {
  24 + logger.error(error);
  25 + }
  26 +
  27 + try {
23 whitelist = JSON.parse(args[1]); 28 whitelist = JSON.parse(args[1]);
24 } catch (error) { 29 } catch (error) {
25 logger.error(error); 30 logger.error(error);
1 { 1 {
2 "name": "yohobuywap-node", 2 "name": "yohobuywap-node",
3 - "version": "6.6.1", 3 + "version": "6.6.3",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 "build:dll": "webpack --config ./public/build/webpack.dll.indexcss.config.js", 15 "build:dll": "webpack --config ./public/build/webpack.dll.indexcss.config.js",
16 "build": "webpack --config ./public/build/webpack.dll.indexcss.config.js && webpack --config ./public/build/webpack.prod.config.js", 16 "build": "webpack --config ./public/build/webpack.dll.indexcss.config.js && webpack --config ./public/build/webpack.prod.config.js",
17 "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js", 17 "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js",
18 - "lint:css": "stylelint -s scss --cache --custom-formatter ./node_modules/stylelint-formatter-table", 18 + "lint:css": "stylelint -s scss --config .stylelintrc.js --cache --custom-formatter ./node_modules/stylelint-formatter-table",
19 "lint:js": "eslint --ext .js,.vue --cache --format table", 19 "lint:js": "eslint --ext .js,.vue --cache --format table",
20 "lint-css": "npm run -s lint:css -- ./**/*.{scss,css,vue}", 20 "lint-css": "npm run -s lint:css -- ./**/*.{scss,css,vue}",
21 "lint-js": "npm run -s lint:js -- .", 21 "lint-js": "npm run -s lint:js -- .",
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 "css-loader": "^0.28.11", 101 "css-loader": "^0.28.11",
102 "echarts": "^4.0.4", 102 "echarts": "^4.0.4",
103 "eslint": "^4.19.1", 103 "eslint": "^4.19.1",
104 - "eslint-config-yoho": "^1.0.9", 104 + "eslint-config-yoho": "~1.0.9",
105 "eslint-plugin-html": "^4.0.3", 105 "eslint-plugin-html": "^4.0.3",
106 "extract-text-webpack-plugin": "^4.0.0-beta.0", 106 "extract-text-webpack-plugin": "^4.0.0-beta.0",
107 "friendly-errors-webpack-plugin": "^1.7.0", 107 "friendly-errors-webpack-plugin": "^1.7.0",
@@ -131,7 +131,7 @@ @@ -131,7 +131,7 @@
131 "store": "^2.0.12", 131 "store": "^2.0.12",
132 "style-loader": "^0.21.0", 132 "style-loader": "^0.21.0",
133 "stylelint": "^9.2.0", 133 "stylelint": "^9.2.0",
134 - "stylelint-config-yoho": "^1.3.0", 134 + "stylelint-config-yoho": "~1.3.0",
135 "stylelint-formatter-table": "^1.0.2", 135 "stylelint-formatter-table": "^1.0.2",
136 "vue": "^2.5.16", 136 "vue": "^2.5.16",
137 "vue-infinite-scroll": "^2.0.1", 137 "vue-infinite-scroll": "^2.0.1",
@@ -64,12 +64,11 @@ function getGender() { @@ -64,12 +64,11 @@ function getGender() {
64 64
65 require('channel/maybe-like')({gender: getGender()}); 65 require('channel/maybe-like')({gender: getGender()});
66 66
67 -// 你可能喜欢没有数据就隐藏  
68 -setTimeout(function() { 67 +$(document).on('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD', () => {
69 if ($('#goods-list').find('.good-info').length === 0) { 68 if ($('#goods-list').find('.good-info').length === 0) {
70 $('.maybe-like').hide(); 69 $('.maybe-like').hide();
71 } 70 }
72 -}, 200); 71 +});
73 72
74 function Marquee() { 73 function Marquee() {
75 prompt.scrollLeft(prompt.scrollLeft() + 1); 74 prompt.scrollLeft(prompt.scrollLeft() + 1);
@@ -213,8 +213,13 @@ module.exports = function(likeParameter) { @@ -213,8 +213,13 @@ module.exports = function(likeParameter) {
213 }); 213 });
214 214
215 // 为您优选埋点 end 215 // 为您优选埋点 end
  216 +
  217 + // 支付成功页,请求数据完成
  218 + $(document).trigger('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD');
216 }, 219 },
217 error: function() { 220 error: function() {
  221 + // 支付成功页,请求数据完成
  222 + $(document).trigger('PAY_SUCCESS_PAGE_MAYBE_LIKE_LOAD');
218 tip.show('网络断开连接了~'); 223 tip.show('网络断开连接了~');
219 searching = false; 224 searching = false;
220 loading.hideLoadingMask(); 225 loading.hideLoadingMask();
@@ -6,7 +6,7 @@ const cookie = require('yoho-cookie'); @@ -6,7 +6,7 @@ const cookie = require('yoho-cookie');
6 6
7 const u = navigator.userAgent; 7 const u = navigator.userAgent;
8 const isFromYOHO = /m\.yohobuy\.com/i.test(document.referrer); 8 const isFromYOHO = /m\.yohobuy\.com/i.test(document.referrer);
9 -const isApp = /yohobuy/i.test(u) || 9 +const isApp = /yoho/i.test(u) ||
10 !!window.yohoInterface || 10 !!window.yohoInterface ||
11 /app_version=/i.test(location.search) || 11 /app_version=/i.test(location.search) ||
12 /openrefer=/i.test(location.search); 12 /openrefer=/i.test(location.search);
@@ -8,7 +8,6 @@ require('layout/_modal.css'); @@ -8,7 +8,6 @@ require('layout/_modal.css');
8 require('home/order-list.page.css'); 8 require('home/order-list.page.css');
9 9
10 let $ = require('yoho-jquery'), 10 let $ = require('yoho-jquery'),
11 - Hammer = require('yoho-hammer'),  
12 lazyLoad = require('yoho-jquery-lazyload'), 11 lazyLoad = require('yoho-jquery-lazyload'),
13 tip = require('plugin/tip'), 12 tip = require('plugin/tip'),
14 Swiper = require('yoho-swiper'); 13 Swiper = require('yoho-swiper');
@@ -33,8 +32,7 @@ let loading = require('plugin/loading'); @@ -33,8 +32,7 @@ let loading = require('plugin/loading');
33 32
34 let dialog = require('plugin/dialog'); 33 let dialog = require('plugin/dialog');
35 34
36 -let orderHammer,  
37 - $reaMask = $('.reason-mask'), 35 +let $reaMask = $('.reason-mask'),
38 $refundReaMask = $('.refund-reason-mask'), 36 $refundReaMask = $('.refund-reason-mask'),
39 reasonSwiper, 37 reasonSwiper,
40 refundReasonSwiper; 38 refundReasonSwiper;
@@ -222,8 +220,7 @@ function sureOrder(orderId) { @@ -222,8 +220,7 @@ function sureOrder(orderId) {
222 } 220 }
223 221
224 // 点击订单区域跳转订单详情页 222 // 点击订单区域跳转订单详情页
225 -orderHammer = new Hammer(document.getElementById('order-container'));  
226 -orderHammer.on('tap', function(e) { 223 +$('#order-container').on('click', function(e) {
227 let $cur = $(e.target), 224 let $cur = $(e.target),
228 $order, 225 $order,
229 id, 226 id,
@@ -46,6 +46,8 @@ const PARAMMAP = { @@ -46,6 +46,8 @@ const PARAMMAP = {
46 const getParams = (pathParams) => { 46 const getParams = (pathParams) => {
47 let params = {}; 47 let params = {};
48 48
  49 + pathParams = _.replace(pathParams, '.html', '');
  50 +
49 if (pathParams) { 51 if (pathParams) {
50 let paramsRaw = _.split(pathParams, '-'); 52 let paramsRaw = _.split(pathParams, '-');
51 53
@@ -251,6 +251,14 @@ const getSearchParamsWithoutMethod = (params) => { @@ -251,6 +251,14 @@ const getSearchParamsWithoutMethod = (params) => {
251 finalParams.brand = params.brand_id || params.brand; 251 finalParams.brand = params.brand_id || params.brand;
252 } 252 }
253 if (params.shop_id && params.shop_id !== '0') { // 店铺ID 253 if (params.shop_id && params.shop_id !== '0') { // 店铺ID
  254 + let shopIdInt = _.parseInt(params.shop_id);
  255 +
  256 + if (shopIdInt) {
  257 + params.shop_id = _.toString(shopIdInt);
  258 + } else {
  259 + params.shop_id = '';
  260 + }
  261 +
254 finalParams.shop_id = params.shop_id; 262 finalParams.shop_id = params.shop_id;
255 } 263 }
256 if (params.type) { // 排序类型 264 if (params.type) { // 排序类型