|
@@ -11,7 +11,7 @@
|
|
|
<view class="shop-image">
|
|
|
<swiper class="swiper" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="500">
|
|
|
<swiper-item v-for="(item,index) in shopData.storeImgUrl" :key="index">
|
|
|
- <cover-image :src="item.imgPath"></cover-image>
|
|
|
+ <cover-image :src="item"></cover-image>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
</view>
|
|
@@ -76,7 +76,7 @@
|
|
|
name: '',
|
|
|
logo: '',
|
|
|
soldCount: '',
|
|
|
- storeImgUrl: '',
|
|
|
+ storeImgUrl: [],
|
|
|
},
|
|
|
tabIndex: 0,
|
|
|
tabList: [{
|
|
@@ -117,14 +117,13 @@
|
|
|
pageIndex2: 1,
|
|
|
isOver2: false,
|
|
|
sortGoodsList: [],
|
|
|
- queryNode: null,
|
|
|
isSet: false,
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.goodId = options.goodId
|
|
|
NET.request(API.getShopDetail + '/' + this.goodId, {}, 'GET').then(res => {
|
|
|
- res.data.storeImgUrl = res.data.storeImgUrl && res.data.storeImgUrl.length ? res.data.storeImgUrl : []
|
|
|
+ res.data.storeImgUrl = res.data.storeImgUrl && res.data.storeImgUrl.length ? res.data.storeImgUrl.split(',') : []
|
|
|
this.shopData = res.data
|
|
|
}).catch(res => {
|
|
|
this.$refs.uTips.show({
|
|
@@ -132,6 +131,13 @@
|
|
|
type: 'warning',
|
|
|
})
|
|
|
})
|
|
|
+ this.getAllGoodsList()
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ let queryNode = uni.createSelectorQuery().in(this);
|
|
|
+ queryNode.select('#shopBox').boundingClientRect(data => {
|
|
|
+ this.winWidth = data.width
|
|
|
+ }).exec();
|
|
|
NET.request(API.getCategoryByShop + this.goodId, {}, 'GET').then(res => {
|
|
|
this.categoryList = res.data
|
|
|
this.selectSort = res.data.length ? res.data[0].productCategoryId : ''
|
|
@@ -142,13 +148,6 @@
|
|
|
type: 'warning',
|
|
|
})
|
|
|
})
|
|
|
- this.getAllGoodsList()
|
|
|
- },
|
|
|
- onReady() {
|
|
|
- this.queryNode = uni.createSelectorQuery().in(this);
|
|
|
- this.queryNode.select('#shopBox').boundingClientRect(data => {
|
|
|
- this.winWidth = data.width
|
|
|
- }).exec();
|
|
|
},
|
|
|
methods: {
|
|
|
// 切换tab
|
|
@@ -226,8 +225,9 @@
|
|
|
},
|
|
|
// 动态渲染宽度
|
|
|
setWidth() {
|
|
|
+ let queryNode = uni.createSelectorQuery().in(this);
|
|
|
this.categoryList.forEach((site, index) => {
|
|
|
- this.queryNode.select('#categoryCol' + index).boundingClientRect(data => {
|
|
|
+ queryNode.select('#categoryCol' + index).boundingClientRect(data => {
|
|
|
if (data.width > this.winWidth * 0.66) {
|
|
|
site.width = 100
|
|
|
} else if (data.width > this.winWidth * 0.33) {
|