Authored by 郭成尧

Merge branch 'feature/detailShop' into 'release/5.5.1'

商品详情页店铺换接口



See merge request !416
@@ -42,9 +42,6 @@ const newDetail = { @@ -42,9 +42,6 @@ const newDetail = {
42 return next(); 42 return next();
43 } 43 }
44 44
45 - // result.id = id;  
46 - // result.goodsId = goodsId;  
47 -  
48 let appParams = {product_skn: result.productSkn}; 45 let appParams = {product_skn: result.productSkn};
49 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' + 46 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' +
50 JSON.stringify(appParams) + 47 JSON.stringify(appParams) +
@@ -99,6 +96,7 @@ const newDetail = { @@ -99,6 +96,7 @@ const newDetail = {
99 */ 96 */
100 sknData(req, res, next) { 97 sknData(req, res, next) {
101 let brandId = req.query.brandId; 98 let brandId = req.query.brandId;
  99 + let shopId = req.query.shopId;
102 let productId = req.query.productId; 100 let productId = req.query.productId;
103 let skn = req.query.skn; 101 let skn = req.query.skn;
104 let bundleType = req.query.bundleType; 102 let bundleType = req.query.bundleType;
@@ -111,6 +109,7 @@ const newDetail = { @@ -111,6 +109,7 @@ const newDetail = {
111 newDetailModel.querySknData({ 109 newDetailModel.querySknData({
112 skn, 110 skn,
113 brandId, 111 brandId,
  112 + shopId,
114 productId, 113 productId,
115 bundleType, 114 bundleType,
116 gid 115 gid
@@ -69,6 +69,7 @@ const tool = { @@ -69,6 +69,7 @@ const tool = {
69 69
70 // dest.brandId = origin.brand_info && origin.brand_info.brand_id || 0; 70 // dest.brandId = origin.brand_info && origin.brand_info.brand_id || 0;
71 dest.brandId = _.get(origin, 'brand_info.brand_id', 0); 71 dest.brandId = _.get(origin, 'brand_info.brand_id', 0);
  72 + dest.shopId = _.get(origin, 'shopId', 0);
72 dest.productSkn = origin.product_skn; 73 dest.productSkn = origin.product_skn;
73 dest.id = origin.product_id; 74 dest.id = origin.product_id;
74 75
@@ -285,6 +286,7 @@ const newDetail = { @@ -285,6 +286,7 @@ const newDetail = {
285 } 286 }
286 287
287 result.data.goods_id = data.goodsId; 288 result.data.goods_id = data.goodsId;
  289 + result.data.shopId = _.get(result, 'data.shop_id', null);
288 290
289 return tool.prodessDetailData(result.data); 291 return tool.prodessDetailData(result.data);
290 }); 292 });
@@ -295,11 +297,12 @@ const newDetail = { @@ -295,11 +297,12 @@ const newDetail = {
295 */ 297 */
296 querySknData(params) { 298 querySknData(params) {
297 let brandId = params.brandId; 299 let brandId = params.brandId;
  300 + let shopId = params.shopId;
298 let productId = params.productId; 301 let productId = params.productId;
299 let skn = params.skn; 302 let skn = params.skn;
300 303
301 let apiArray = [ 304 let apiArray = [
302 - this.queryShopsByBrandId(brandId), // 0 品牌信息 305 + this.queryShopsByBrandId(brandId, shopId), // 0 品牌信息
303 commentModel.getCommentInfo({ 306 commentModel.getCommentInfo({
304 productId: productId 307 productId: productId
305 }), // 1 评论信息 308 }), // 1 评论信息
@@ -352,10 +355,11 @@ const newDetail = { @@ -352,10 +355,11 @@ const newDetail = {
352 /* 355 /*
353 接口: 根据BrandID, 查询品牌信息 356 接口: 根据BrandID, 查询品牌信息
354 */ 357 */
355 - queryShopsByBrandId(brandId) { 358 + queryShopsByBrandId(brandId, shopId) {
356 let params = { 359 let params = {
357 - method: 'app.shop.queryShopsByBrandId',  
358 - brand_id: brandId 360 + method: 'app.product.queryShopsInfoById',
  361 + brand_id: brandId,
  362 + shop_id: shopId
359 }; 363 };
360 364
361 let cacheConf = { 365 let cacheConf = {
@@ -107,6 +107,7 @@ @@ -107,6 +107,7 @@
107 107
108 <input id="productSkn" type="hidden" value="{{productSkn}}"> 108 <input id="productSkn" type="hidden" value="{{productSkn}}">
109 <input id="brand-id" type="hidden" value="{{brandId}}"> 109 <input id="brand-id" type="hidden" value="{{brandId}}">
  110 + <input id="shopId" type="hidden" value="{{shopId}}">
110 <input id="product-limit" type="hidden" value="{{isLimitBuy}}"> 111 <input id="product-limit" type="hidden" value="{{isLimitBuy}}">
111 <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}"> 112 <input id="product-coupon-switch" type="hidden" value="{{showCoupon}}">
112 <input id="bundleType" type="hidden" value="{{bundleType}}"> 113 <input id="bundleType" type="hidden" value="{{bundleType}}">
@@ -5,6 +5,7 @@ let productId = $('#productId').val(); @@ -5,6 +5,7 @@ let productId = $('#productId').val();
5 let goodsId = $('#goodsId').val(); 5 let goodsId = $('#goodsId').val();
6 let productSkn = $('#productSkn').val(); 6 let productSkn = $('#productSkn').val();
7 let brandId = $('#brand-id').val(); 7 let brandId = $('#brand-id').val();
  8 +let shopId = $('#shopId').val();
8 let bundleType = $('#bundleType').val(); 9 let bundleType = $('#bundleType').val();
9 10
10 require('../common'); 11 require('../common');
@@ -327,6 +328,7 @@ setTimeout(() => { @@ -327,6 +328,7 @@ setTimeout(() => {
327 skn: skn, 328 skn: skn,
328 productId: productId, 329 productId: productId,
329 brandId: brandId, 330 brandId: brandId,
  331 + shopId: shopId,
330 bundleType: bundleType, 332 bundleType: bundleType,
331 gid: goodsId 333 gid: goodsId
332 }).done(function(info) { 334 }).done(function(info) {