修改店铺页面店铺显示问题

master
lemon橪 2021-08-11 09:49:09 +08:00
parent b93395d0dc
commit 1fbb43c848
2 changed files with 27 additions and 19 deletions

View File

@ -12,8 +12,8 @@
{{ storeInfo.storeName || ''}} {{ storeInfo.storeName || ''}}
</div> </div>
<div class="flex store-message"> <div class="flex store-message">
<div> <span>{{ storeInfo.goodsNum || 0 }}</span>关注 </div> <div> <span>{{ storeInfo.collectionNum || 0 }}</span>关注 </div>
<div> <span>{{ storeInfo.collectionNum || 0 }}</span>件商品 </div> <div> <span>{{ storeInfo.goodsNum || 0 }}</span>件商品 </div>
</div> </div>
</div> </div>
<div class="collection"> <div class="collection">
@ -59,7 +59,7 @@
<div class="contant" v-if="current == 0"> <div class="contant" v-if="current == 0">
<view v-if="!goodsList.length" class="empty"></view> <view v-if="!goodsList.length" class="empty"></view>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
<u-image width="100%" height="324rpx" :src="item.thumbnail"> <u-image width="100%" height="330rpx" mode="aspectFit" :src="item.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<div class="name">{{ item.goodsName }}</div> <div class="name">{{ item.goodsName }}</div>
@ -140,8 +140,24 @@ export default {
// //
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({ withShareTicket: true });
// #endif // #endif
this.init();
}, },
onShow() { onShow() {
if (this.goodsList.length == 0) {
this.init();
}
},
//
onReachBottom() {
this.goodsParams.pageNumber++;
this.getGoodsData();
},
methods: {
/**
* 初始化信息
*/
init() {
this.goodsList = []; this.goodsList = [];
this.categoryList = []; this.categoryList = [];
this.couponList = []; this.couponList = [];
@ -158,13 +174,6 @@ export default {
// //
this.getCategoryData(); this.getCategoryData();
}, },
//
onReachBottom() {
this.goodsParams.pageNumber++;
this.getGoodsData();
},
methods: {
/** /**
* 联系客服 * 联系客服
*/ */
@ -173,7 +182,6 @@ export default {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const params = { const params = {
// originalPrice: this.goodsDetail.original || this.goodsDetail.price, // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
uuid: storage.getUuid(), uuid: storage.getUuid(),
token: storage.getAccessToken(), token: storage.getAccessToken(),

View File

@ -5,7 +5,7 @@
<div class="contant"> <div class="contant">
<view v-if="!goodsList.length" class="empty"></view> <view v-if="!goodsList.length" class="empty"></view>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
<u-image width="100%" height="324rpx" :src="item.thumbnail"> <u-image width="100%" mode="aspectFit" height="324rpx" :src="item.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<div class="name">{{ item.goodsName }}</div> <div class="name">{{ item.goodsName }}</div>