tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷
This commit is contained in:
@@ -33,14 +33,13 @@
|
||||
</block>
|
||||
|
||||
<block v-if="type == 'goods'">
|
||||
<view class="categoty-goods-wrap" v-if="loadType == 'part'"
|
||||
:style="'padding-top:' + (value.search ? 0 : '20rpx')">
|
||||
<view class="categoty-goods-wrap" v-if="loadType == 'part'" :style="'padding-top:' + (value.search ? 0 : '20rpx')">
|
||||
<!-- 分类筛选 -->
|
||||
<block v-if="category.child_list && value.goodsLevel == 2">
|
||||
<view class="screen-category-wrap">
|
||||
<scroll-view scroll-x="true" class="screen-category" :class="{ 'screen-category-4': value.template == 4 }" :scroll-with-animation="true" :scroll-into-view="scrollIntoView">
|
||||
<view class="item" id="category-2--1" :class="{ selected: categoryId == -1 }" @click="selectCategoey(-1)">全部</view>
|
||||
<view class="item" :id="'category-2-' + oneIndex" :class="{ selected: categoryId == oneIndex }" @click="selectCategoey(oneIndex)" v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
|
||||
<view class="item" id="category-2--1" :class="{ selected: categoryId == -1 }" @click="selectCategory(-1)">全部</view>
|
||||
<view class="item" :id="'category-2-' + oneIndex" :class="{ selected: categoryId == oneIndex }" @click="selectCategory(oneIndex)" v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
|
||||
{{ one.category_name }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -50,14 +49,14 @@
|
||||
<view class="screen-category-popup" @click="$refs.screenCategoryPopup.close()">
|
||||
<scroll-view scroll-y="true" class="screen-category" :class="{ 'screen-category-4': value.template == 4 }">
|
||||
<view class="title">全部</view>
|
||||
<view class="item" :class="{ selected: categoryId == oneIndex }" @click="selectCategoey(oneIndex)" v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
|
||||
<view class="item" :class="{ selected: categoryId == oneIndex }" @click="selectCategory(oneIndex)" v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
|
||||
{{ one.category_name }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</block>
|
||||
<!---->
|
||||
|
||||
<scroll-view scroll-y="true" class="scroll-goods-view" lower-threshold="300" :scroll-top="scrollTop" @scrolltolower="scrolltolower" @touchstart="touchstart" @touchend="touchend" @scroll="listenScroll">
|
||||
|
||||
<!--一级分类展示商品显示-->
|
||||
@@ -70,6 +69,9 @@
|
||||
<view class="goods-img" @click="toDetail(item)">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)"/>
|
||||
<view class="color-base-bg goods-tag" v-if="item.label_name">{{ item.label_name }}</view>
|
||||
<view class="sell-out" v-if="item.goods_stock <= 0">
|
||||
<text class="iconfont icon-shuqing"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="name-wrap" @click="toDetail(item)">
|
||||
@@ -293,7 +295,7 @@
|
||||
oneCategorySelect: function() {
|
||||
this.scrollTop = -1;
|
||||
this.goodsList = [];
|
||||
this.selectCategoey(-1);
|
||||
this.selectCategory(-1);
|
||||
},
|
||||
select: function() {
|
||||
if (this.index == this.select) {
|
||||
@@ -607,7 +609,7 @@
|
||||
}
|
||||
this.$emit('selectsku', data);
|
||||
},
|
||||
selectCategoey(index) {
|
||||
selectCategory(index) {
|
||||
this.categoryId = index;
|
||||
this.pageIndex = 0;
|
||||
this.totalPage = 1;
|
||||
@@ -667,7 +669,7 @@
|
||||
this.$emit('switch', index);
|
||||
} else {
|
||||
let index = this.categoryId - 1;
|
||||
this.selectCategoey(index);
|
||||
this.selectCategory(index);
|
||||
}
|
||||
} else {
|
||||
if (this.categoryId == -1 || (this.category.child_list && this.categoryId == this.category.child_list.length - 1)) {
|
||||
@@ -675,7 +677,7 @@
|
||||
this.$emit('switch', index);
|
||||
} else {
|
||||
let index = this.categoryId + 1;
|
||||
this.selectCategoey(index);
|
||||
this.selectCategory(index);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -995,7 +997,27 @@
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.sell-out{
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: $border-radius;
|
||||
text{
|
||||
color: #fff;
|
||||
font-size: 150rpx;
|
||||
position: absolute;
|
||||
left:50%;
|
||||
top:50%;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
}
|
||||
}
|
||||
.info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -1171,10 +1193,28 @@
|
||||
height: auto;
|
||||
margin-right: 0;
|
||||
line-height: 1;
|
||||
|
||||
position: relative;
|
||||
image {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.sell-out{
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom:0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: $border-radius;
|
||||
text{
|
||||
color: #fff;
|
||||
font-size: 240rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.select-sku {
|
||||
@@ -1200,7 +1240,7 @@
|
||||
|
||||
.screen-category-wrap {
|
||||
display: flex;
|
||||
|
||||
padding-top: 20rpx;
|
||||
.icon-unfold {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
|
||||
Reference in New Issue
Block a user