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": { "style": {
"navigationBarTitleText": "里海云仓", "navigationBarTitleText": "里海云仓",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
}, },
{ {

View File

@ -4,7 +4,6 @@
} }
.wholeSale { .wholeSale {
background-color: #f8fafb !important;
.wholeSale-header-search-wrap { .wholeSale-header-search-wrap {
padding: 30rpx 20rpx 0; padding: 30rpx 20rpx 0;
@ -17,39 +16,16 @@
z-index: 100; z-index: 100;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #40AE36; 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 { .wholeSale-section {
position: relative; position: sticky;
font-weight: bold; top: calc(82rpx + var(--status-bar-height));
font-size: 36rpx; padding: 0rpx 20rpx;
color: #FFFFFF; background-color: #fff;
transition: height .7s;
&::after { overflow: hidden;
content: ""; margin-bottom: 20rpx;
display: inline-block;
position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
}
.wholeSale-nav { .wholeSale-nav {
display: flex; display: flex;
@ -61,42 +37,6 @@
} }
} }
.search_content {
// margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.search_content_wrap {
width: 100%;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
input {
width: 80%;
}
}
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
background: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
.category { .category {
width: 100%; width: 100%;
overflow: auto; overflow: auto;
@ -146,62 +86,45 @@
} }
} }
} }
}
.cate { .search_content {
// margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.search_content_wrap {
width: 100%; width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.cate-wrap { .icon-sousuo {
display: flex; font-size: 26.32rpx;
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; font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
} }
}
input {
width: 80%;
} }
} }
.comprehensive { .search_btn {
display: flex; width: 106rpx;
justify-content: space-between; height: 60rpx;
align-items: center; line-height: 60rpx;
padding: 0 50rpx; background: #40AE36;
border-radius: 100px;
[class^=comprehensive-] { font-size: 28rpx;
display: flex; color: #fff;
align-items: center; }
text {
margin-right: 12rpx;
font-size: 26rpx;
color: #666666;
} }
image {
width: 28rpx;
height: 28rpx;
}
.loudou {
width: 24rpx;
height: 24rpx;
}
}
}
.wholeSale-con { .wholeSale-con {
margin: 0 20rpx; margin: 0 20rpx;
@ -209,6 +132,7 @@
.goods_list { .goods_list {
padding-bottom: 30rpx; padding-bottom: 30rpx;
background-color: #f8fafb;
.goods { .goods {
width: 710rpx; width: 710rpx;
@ -334,9 +258,8 @@
<template> <template>
<view class="wholeSale"> <view class="wholeSale">
<!-- 顶部 -->
<view class="wholeSale-header">
<!-- 适配不同机 --> <!-- 适配不同机 -->
<view class="wholeSale-header">
<view style="height: var(--status-bar-height);background-color: #40af37;"></view> <view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view <view
style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;"> style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
@ -358,6 +281,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 分类区域 --> <!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}"> <view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
@ -393,12 +317,11 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
</view>
<!-- 列表 --> <!-- 列表 -->
<view class="goods_list" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx)'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;" <scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
@scrolltoupper="scrolltoupper" :refresher-threshold="0"> @scrolltoupper="scrolltoupper" :refresher-threshold="0">
<view class="goods_list">
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)"> <view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar"> <view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill"> <u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
@ -443,9 +366,9 @@
</view> </view>
</view> </view>
<loadmore :type="isLoading"></loadmore> <loadmore :type="isLoading"></loadmore>
</view>
</scroll-view> </scroll-view>
</view> </view>
</view>
</template> </template>
<script> <script>
@ -494,7 +417,10 @@
type_id: '10,12,21,24', type_id: '10,12,21,24',
merchant_category_id: '', merchant_category_id: '',
location: '' location: ''
} },
wrapHeight: 300,
isShowSmall: false,
scrollTop: 0,
} }
}, },
computed: { computed: {
@ -531,6 +457,23 @@
this.storeMerchantList(true); this.storeMerchantList(true);
}, },
methods: { 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) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
url: url, url: url,