This commit is contained in:
1154079537 2024-05-11 17:21:22 +08:00
parent 1f1392cc1d
commit f7cd781e06
2 changed files with 125 additions and 182 deletions

View File

@ -334,7 +334,7 @@
"style": {
"navigationBarTitleText": "里海云仓",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{

View File

@ -4,7 +4,6 @@
}
.wholeSale {
background-color: #f8fafb !important;
.wholeSale-header-search-wrap {
padding: 30rpx 20rpx 0;
@ -17,47 +16,75 @@
z-index: 100;
margin-bottom: 20rpx;
background-color: #40AE36;
.scrollview {
display: flex;
align-items: center;
height: 98rpx;
padding-left: 32rpx;
.scrollview-item {
margin-right: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
}
.scrollview-active {
position: relative;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
&::after {
content: "";
display: inline-block;
position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
}
.wholeSale-nav {
display: flex;
align-items: center;
margin-bottom: 40rpx;
.wholeSale-section {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .7s;
overflow: hidden;
margin-bottom: 20rpx;
.icon {
margin-right: 20rpx;
.wholeSale-nav {
display: flex;
align-items: center;
margin-bottom: 40rpx;
.icon {
margin-right: 20rpx;
}
}
.category {
width: 100%;
overflow: auto;
margin-bottom: 20rpx;
.category-wrap {
display: flex;
padding-bottom: 20rpx;
.category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 38rpx;
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.category-item-active {
position: relative;
.category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
}
}
@ -97,111 +124,7 @@
}
}
.category {
width: 100%;
overflow: auto;
margin-bottom: 20rpx;
.category-wrap {
display: flex;
padding-bottom: 20rpx;
.category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 38rpx;
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.category-item-active {
position: relative;
.category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
}
.cate {
width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.cate-wrap {
display: flex;
padding-bottom: 8rpx;
.cate-item {
text {
padding: 4rpx 16rpx;
white-space: nowrap;
font-size: 30rpx;
color: #333;
}
}
.cate-item-active {
text {
color: #40AE36;
font-weight: bold;
}
}
}
}
.comprehensive {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50rpx;
[class^=comprehensive-] {
display: flex;
align-items: center;
text {
margin-right: 12rpx;
font-size: 26rpx;
color: #666666;
}
image {
width: 28rpx;
height: 28rpx;
}
.loudou {
width: 24rpx;
height: 24rpx;
}
}
}
.wholeSale-con {
margin: 0 20rpx;
@ -209,6 +132,7 @@
.goods_list {
padding-bottom: 30rpx;
background-color: #f8fafb;
.goods {
width: 710rpx;
@ -334,9 +258,8 @@
<template>
<view class="wholeSale">
<!-- 顶部 -->
<!-- 适配不同机 -->
<view class="wholeSale-header">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view
style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
@ -358,47 +281,47 @@
</view>
</view>
</view>
</view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<view
@click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索店铺名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<view
@click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索店铺名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
<!-- 列表 -->
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
@scrolltoupper="scrolltoupper" :refresher-threshold="0">
<view class="goods_list">
<view class="goods_list" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx)'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
@scrolltoupper="scrolltoupper" :refresher-threshold="0">
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
@ -443,8 +366,8 @@
</view>
</view>
<loadmore :type="isLoading"></loadmore>
</view>
</scroll-view>
</scroll-view>
</view>
</view>
</template>
@ -494,7 +417,10 @@
type_id: '10,12,21,24',
merchant_category_id: '',
location: ''
}
},
wrapHeight: 300,
isShowSmall: false,
scrollTop: 0,
}
},
computed: {
@ -531,6 +457,23 @@
this.storeMerchantList(true);
},
methods: {
scrolltoupper() {
this.storeMerchantList(true);
},
onScrollBottom(e) {
this.storeMerchantList();
},
onScroll(e) {
if (this.scrollTop >= e.target.scrollTop) { //
this.wrapHeight = 300;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,