Authored by 李奇

商品详情页店铺信息

... ... @@ -13,7 +13,7 @@ Component({
}
},
data: {
indicatorDots: true,
indicatorDots: false,
interval: 5000,
autoplay: false,
duration: 500,
... ...
... ... @@ -19,7 +19,7 @@
left: 50%;
bottom: 100rpx;
display: flex;
padding: 5rpx;
padding: 5rpx 6rpx;
height: 20rpx;
box-sizing: border-box;
border-radius: 10rpx;
... ...
... ... @@ -70,5 +70,19 @@ export default {
method: 'app.Shopping.count',
}, params)
});
},
/**
* 获取店铺信息
* @param params
* @returns {*}
*/
getShopInfo(params) {
return api.get({
url: '',
data: Object.assign({
method: 'app.product.queryShopsInfoById'
}, params)
});
}
};
... ...
... ... @@ -21,6 +21,7 @@ Page(Object.assign({
data: {
login: false,
shopId: 0,
shopInfo: {},
productSkn: 0,
countInCart: 0,
productName: '',
... ... @@ -111,6 +112,7 @@ Page(Object.assign({
this.supportService();
this.productIntro();
this.preferList();
this._getShopInfo();
this._getCountInCart();
}, 500);
... ... @@ -143,6 +145,9 @@ Page(Object.assign({
scrollTop: 0
});
},
toShop: function() {
router.go('home');
},
onShareAppMessage: function(res) {
let params = {
FROM: res.from,
... ... @@ -344,6 +349,7 @@ Page(Object.assign({
storage_sum: res.data.storage_sum,
snapshootShareData: snapData,
shopId: res.data.shop_id,
brandId: res.data.brand_id,
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
productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4, // eslint-disable-line
productNotForSale: res.data.attribute === 2,
... ... @@ -703,6 +709,26 @@ Page(Object.assign({
}
}).catch(() => {});
},
_getShopInfo: function() {
const params = {
brand_id: this.data.brandId,
shop_id: this.data.shopId
};
detailModel.getShopInfo(params)
.then(res => {
const shopList = res.data;
if (shopList && shopList.length > 0) {
const shopInfo = shopList[0];
this.setData({
shopInfo,
shopList
});
}
});
},
_payNow: function() {
router.go('cartEnsure', {
productSku: this.data.selectedSKU,
... ...
... ... @@ -26,6 +26,15 @@
</view>
</view>
<view class="gap"></view>
<!--店铺-->
<view class='row-shop-brief'>
<image class='shop-icon' src="{{helper.image(shopInfo.brand_ico, 120, 60)}}"></image>
<text class='shop-name'>{{shopInfo.brand_name}}</text>
<text class="shop-nav-arrow iconfont icon-right"></text>
<text class='shop-nav' bindtap="toShop">返回首页</text>
</view>
<view class="gap"></view>
<view class="goodsInfo" style="display:{{productDesc.length>0?'block':'none'}}">
<view class="module-title">
<text class="text">商品信息 <text class="sub-text">DESCRIPTION</text></text>
... ... @@ -126,8 +135,8 @@
<view class="badge" hidden='{{countInCart===0}}'>{{countInCart}}</view>
<image class="image" src="../../../static/images/cart-btn.png" mode="widthFix"></image>
</view>
<view class="img-action">
<image class="image" src="../../../static/images/store-btn.png" mode="widthFix"></image>
<view class="img-action" bindtap="toShop">
<image class="image" src="../../../static/images/store-btn-active.png" mode="widthFix"></image>
</view>
<view wx:if="{{login}}" class="txt-action add" bindtap="addToCart">加入购物车</view>
<view wx:else class="txt-action add" bindtap="addToCart">
... ...
... ... @@ -311,6 +311,48 @@
margin-right: 20rpx;
}
.row-shop-brief {
height: 88rpx;
padding: 14rpx 30rpx;
box-sizing: border-box;
}
.row-shop-brief .shop-name {
display: inline-block;
height: 60rpx;
font-size: 32rpx;
margin-left: 20rpx;
line-height: 60rpx;
vertical-align:top;
}
.row-shop-brief .shop-nav {
float: right;
display: inline-block;
height: 60rpx;
color: #b0b0b0;
font-size: 28rpx;
margin-left: 20rpx;
line-height: 60rpx;
vertical-align:top;
}
.row-shop-brief .shop-nav-arrow {
display: inline-block;
float: right;
height: 60rpx;
color: #b0b0b0;
font-size: 40rpx;
line-height: 60rpx;
margin-right: -10rpx;
vertical-align:top;
}
.row-shop-brief .shop-icon {
width: 120rpx;
height: 60rpx;
}
.goodsInfo{
margin: 0 30rpx;
}
... ...