Authored by 李奇

商品详情页店铺信息

@@ -13,7 +13,7 @@ Component({ @@ -13,7 +13,7 @@ Component({
13 } 13 }
14 }, 14 },
15 data: { 15 data: {
16 - indicatorDots: true, 16 + indicatorDots: false,
17 interval: 5000, 17 interval: 5000,
18 autoplay: false, 18 autoplay: false,
19 duration: 500, 19 duration: 500,
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 left: 50%; 19 left: 50%;
20 bottom: 100rpx; 20 bottom: 100rpx;
21 display: flex; 21 display: flex;
22 - padding: 5rpx; 22 + padding: 5rpx 6rpx;
23 height: 20rpx; 23 height: 20rpx;
24 box-sizing: border-box; 24 box-sizing: border-box;
25 border-radius: 10rpx; 25 border-radius: 10rpx;
@@ -70,5 +70,19 @@ export default { @@ -70,5 +70,19 @@ export default {
70 method: 'app.Shopping.count', 70 method: 'app.Shopping.count',
71 }, params) 71 }, params)
72 }); 72 });
  73 + },
  74 +
  75 + /**
  76 + * 获取店铺信息
  77 + * @param params
  78 + * @returns {*}
  79 + */
  80 + getShopInfo(params) {
  81 + return api.get({
  82 + url: '',
  83 + data: Object.assign({
  84 + method: 'app.product.queryShopsInfoById'
  85 + }, params)
  86 + });
73 } 87 }
74 }; 88 };
@@ -21,6 +21,7 @@ Page(Object.assign({ @@ -21,6 +21,7 @@ Page(Object.assign({
21 data: { 21 data: {
22 login: false, 22 login: false,
23 shopId: 0, 23 shopId: 0,
  24 + shopInfo: {},
24 productSkn: 0, 25 productSkn: 0,
25 countInCart: 0, 26 countInCart: 0,
26 productName: '', 27 productName: '',
@@ -111,6 +112,7 @@ Page(Object.assign({ @@ -111,6 +112,7 @@ Page(Object.assign({
111 this.supportService(); 112 this.supportService();
112 this.productIntro(); 113 this.productIntro();
113 this.preferList(); 114 this.preferList();
  115 + this._getShopInfo();
114 this._getCountInCart(); 116 this._getCountInCart();
115 }, 500); 117 }, 500);
116 118
@@ -143,6 +145,9 @@ Page(Object.assign({ @@ -143,6 +145,9 @@ Page(Object.assign({
143 scrollTop: 0 145 scrollTop: 0
144 }); 146 });
145 }, 147 },
  148 + toShop: function() {
  149 + router.go('home');
  150 + },
146 onShareAppMessage: function(res) { 151 onShareAppMessage: function(res) {
147 let params = { 152 let params = {
148 FROM: res.from, 153 FROM: res.from,
@@ -344,6 +349,7 @@ Page(Object.assign({ @@ -344,6 +349,7 @@ Page(Object.assign({
344 storage_sum: res.data.storage_sum, 349 storage_sum: res.data.storage_sum,
345 snapshootShareData: snapData, 350 snapshootShareData: snapData,
346 shopId: res.data.shop_id, 351 shopId: res.data.shop_id,
  352 + brandId: res.data.brand_id,
347 productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance === 'Y', // eslint-disable-line 353 productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance === 'Y', // eslint-disable-line
348 productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line 354 productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line
349 productNotForSale: res.data.attribute === 2, 355 productNotForSale: res.data.attribute === 2,
@@ -703,6 +709,26 @@ Page(Object.assign({ @@ -703,6 +709,26 @@ Page(Object.assign({
703 } 709 }
704 }).catch(() => {}); 710 }).catch(() => {});
705 }, 711 },
  712 + _getShopInfo: function() {
  713 + const params = {
  714 + brand_id: this.data.brandId,
  715 + shop_id: this.data.shopId
  716 + };
  717 +
  718 + detailModel.getShopInfo(params)
  719 + .then(res => {
  720 + const shopList = res.data;
  721 +
  722 + if (shopList && shopList.length > 0) {
  723 + const shopInfo = shopList[0];
  724 +
  725 + this.setData({
  726 + shopInfo,
  727 + shopList
  728 + });
  729 + }
  730 + });
  731 + },
706 _payNow: function() { 732 _payNow: function() {
707 router.go('cartEnsure', { 733 router.go('cartEnsure', {
708 productSku: this.data.selectedSKU, 734 productSku: this.data.selectedSKU,
@@ -26,6 +26,15 @@ @@ -26,6 +26,15 @@
26 </view> 26 </view>
27 </view> 27 </view>
28 <view class="gap"></view> 28 <view class="gap"></view>
  29 + <!--店铺-->
  30 + <view class='row-shop-brief'>
  31 + <image class='shop-icon' src="{{helper.image(shopInfo.brand_ico, 120, 60)}}"></image>
  32 + <text class='shop-name'>{{shopInfo.brand_name}}</text>
  33 + <text class="shop-nav-arrow iconfont icon-right"></text>
  34 + <text class='shop-nav' bindtap="toShop">返回首页</text>
  35 + </view>
  36 +
  37 + <view class="gap"></view>
29 <view class="goodsInfo" style="display:{{productDesc.length>0?'block':'none'}}"> 38 <view class="goodsInfo" style="display:{{productDesc.length>0?'block':'none'}}">
30 <view class="module-title"> 39 <view class="module-title">
31 <text class="text">商品信息 <text class="sub-text">DESCRIPTION</text></text> 40 <text class="text">商品信息 <text class="sub-text">DESCRIPTION</text></text>
@@ -126,8 +135,8 @@ @@ -126,8 +135,8 @@
126 <view class="badge" hidden='{{countInCart===0}}'>{{countInCart}}</view> 135 <view class="badge" hidden='{{countInCart===0}}'>{{countInCart}}</view>
127 <image class="image" src="../../../static/images/cart-btn.png" mode="widthFix"></image> 136 <image class="image" src="../../../static/images/cart-btn.png" mode="widthFix"></image>
128 </view> 137 </view>
129 - <view class="img-action">  
130 - <image class="image" src="../../../static/images/store-btn.png" mode="widthFix"></image> 138 + <view class="img-action" bindtap="toShop">
  139 + <image class="image" src="../../../static/images/store-btn-active.png" mode="widthFix"></image>
131 </view> 140 </view>
132 <view wx:if="{{login}}" class="txt-action add" bindtap="addToCart">加入购物车</view> 141 <view wx:if="{{login}}" class="txt-action add" bindtap="addToCart">加入购物车</view>
133 <view wx:else class="txt-action add" bindtap="addToCart"> 142 <view wx:else class="txt-action add" bindtap="addToCart">
@@ -311,6 +311,48 @@ @@ -311,6 +311,48 @@
311 margin-right: 20rpx; 311 margin-right: 20rpx;
312 } 312 }
313 313
  314 +.row-shop-brief {
  315 + height: 88rpx;
  316 + padding: 14rpx 30rpx;
  317 + box-sizing: border-box;
  318 +}
  319 +
  320 +.row-shop-brief .shop-name {
  321 + display: inline-block;
  322 + height: 60rpx;
  323 + font-size: 32rpx;
  324 + margin-left: 20rpx;
  325 + line-height: 60rpx;
  326 + vertical-align:top;
  327 +}
  328 +
  329 +.row-shop-brief .shop-nav {
  330 + float: right;
  331 + display: inline-block;
  332 + height: 60rpx;
  333 + color: #b0b0b0;
  334 + font-size: 28rpx;
  335 + margin-left: 20rpx;
  336 + line-height: 60rpx;
  337 + vertical-align:top;
  338 +}
  339 +
  340 +.row-shop-brief .shop-nav-arrow {
  341 + display: inline-block;
  342 + float: right;
  343 + height: 60rpx;
  344 + color: #b0b0b0;
  345 + font-size: 40rpx;
  346 + line-height: 60rpx;
  347 + margin-right: -10rpx;
  348 + vertical-align:top;
  349 +}
  350 +
  351 +.row-shop-brief .shop-icon {
  352 + width: 120rpx;
  353 + height: 60rpx;
  354 +}
  355 +
314 .goodsInfo{ 356 .goodsInfo{
315 margin: 0 30rpx; 357 margin: 0 30rpx;
316 } 358 }