【修复】修复页面设计【图片】组件命名问题,导致调用失败的问题。【修复】修复APP下首页商品组件【coreshop-goods】滚动异常的情况。

This commit is contained in:
大灰灰
2022-05-09 23:41:24 +08:00
parent 7ec9a09c17
commit be9e496006
2 changed files with 16 additions and 17 deletions

View File

@@ -81,7 +81,7 @@
</view>
<!-- 横向滚动 -->
<block v-if="coreshopdata.parameters.column == '2' && coreshopdata.parameters.display == 'slide' || coreshopdata.parameters.column == '3' && coreshopdata.parameters.display == 'slide'"
<block v-if="coreshopdata.parameters.display == 'slide'"
v-bind:class="'slide'+coreshopdata.parameters.column">
<view class="coreshop-margin-left-15 coreshop-margin-right-15 coreshop-margin-top-15 coreshop-margin-bottom-15" v-if="coreshopdata.parameters.lookTitle == 'true'">
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" v-if="coreshopdata.parameters.title != ''" @click="coreshopdata.parameters.lookMore == 'true' ? goGoodsList({catId: coreshopdata.parameters.classifyId,brandId:coreshopdata.parameters.brandId}) :''" :arrow="coreshopdata.parameters.lookMore == 'true'" :sub-title="coreshopdata.parameters.lookMore == 'true'?'更多':''"></coreshop-section>
@@ -89,7 +89,7 @@
<block v-if="count">
<swiper :class="coreshopdata.parameters.column==3?'swiper3':coreshopdata.parameters.column==2?'swiper2':''" @change="change">
<swiper-item v-for="no of pageCount" :key="no">
<u-grid :col="coreshopdata.parameters.column" :border="false" align="left">
<u-grid :col="coreshopdata.parameters.column" :border="false" align="left" :data-id="no">
<u-grid-item v-for="(item, index) in coreshopdata.parameters.list" v-if="index >=coreshopdata.parameters.column*no && index <coreshopdata.parameters.column*(no+1)" :key="index" @click="goGoodsDetail(item.id)">
<view class="good_box">
<u-image :src="item.image" :index="item.id" mode="widthFit" width="100%" :height="coreshopdata.parameters.column==3?'104px':coreshopdata.parameters.column==2?'164px':'104px'" radius="10">
@@ -129,6 +129,8 @@
data() {
return {
current: 0,
pageCount: [],
count: false
};
},
filters: {
@@ -149,24 +151,21 @@
required: true,
}
},
computed: {
pageCount() {
var count = this.coreshopdata.parameters.list.length / this.coreshopdata.parameters.column;
if (this.coreshopdata.parameters.column * count < this.coreshopdata.parameters.list.length) {
count = count + 1;
}
return count;
},
count() {
return (this.coreshopdata.parameters.list.length > 0)
}
},
methods: {
change(e) {
this.current = e.detail.current;
}
},
created() {
this.count = this.coreshopdata.parameters.list.length > 0;
var page = Number(this.coreshopdata.parameters.list.length / this.coreshopdata.parameters.column).toFixed(0);
if (this.coreshopdata.parameters.column * page < this.coreshopdata.parameters.list.length) {
page = Number(page) + 1;
}
for (var i = 0; i < page; i++) {
this.pageCount.push(i);
}
}
}
</script>

View File

@@ -5,8 +5,8 @@
<view @click="taped(child)">
<image class="ad-img" :src="child.image" mode="widthFix"></image>
</view>
<view class="imgup-btn" v-if="item.buttonText != ''" @click="showSliderInfo(child.linkType, child.linkValue)">
<button class="coreshop-btn" :style="{background:item.buttonColor,color:item.textColor}">{{item.buttonText}}</button>
<view class="imgup-btn" v-if="child.buttonText != ''" @click="showSliderInfo(child.linkType, child.linkValue)">
<button class="coreshop-btn" :style="{background:child.buttonColor,color:child.textColor}">{{child.buttonText}}</button>
</view>
</view>
</view>