refactor: 更新多个页面的样式和结构

This commit is contained in:
pikachu1995@126.com
2026-07-01 16:05:08 +08:00
parent 6654c1de51
commit 5f293d929d
50 changed files with 3337 additions and 1837 deletions

View File

@@ -22,6 +22,28 @@
}
}
.tag-list {
display: flex;
flex-wrap: wrap;
padding: 8rpx 24rpx 20rpx;
}
.tag-item {
padding: 12rpx 28rpx;
margin: 0 20rpx 20rpx 0;
max-width: 100%;
background: #f0f2f5;
border-radius: 100px;
font-size: 26rpx;
color: #333;
line-height: 1.4;
}
.tag-more {
color: $light-color;
background: #fff5f0;
}
.status_bar {
height: var(--status-bar-height);
background: #fff !important;
@@ -181,7 +203,7 @@ page {
.add1 {
background: #fff;
padding: 30rpx 0;
padding: 16rpx 0 0;
}
.oldKeyRow {
@@ -209,10 +231,6 @@ page {
}
view {
display: block;
}
.store-seller-name {
color: #666;
overflow: hidden;
@@ -296,7 +314,7 @@ view {
width: 100%;
flex: 1;
min-height: 0;
background-color: #ededed;
background-color: #fff;
}
.keyword-list-box {
@@ -345,6 +363,9 @@ view {
.keyword-box {
background-color: #fff;
position: relative;
min-height: 100%;
padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
}
.keyword-box .keyword-block {
@@ -353,50 +374,32 @@ view {
.keyword-box .keyword-block .keyword-list-header {
width: 100%;
padding: 20rpx 3%;
padding: 20rpx 24rpx 8rpx;
font-size: 27rpx;
color: #333;
display: flex;
justify-content: space-between;
}
.keyword-box .keyword-block .keyword-list-header image {
width: 40rpx;
height: 40rpx;
}
.keyword-box .keyword-block .keyword > view {
width: 50%;
line-height: 1.75;
overflow: hidden;
padding: 0 3% 0 3% !important;
}
.u-tips {
font-size: 30rpx;
font-weight: 700;
color: #333;
}
.keyword {
display: flex;
flex-wrap: wrap;
}
.keyword-box {
position: relative;
}
.clear {
color: #666666;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
font-size: 28rpx;
background: #f7f7f7;
background: #fff;
border-top: 1px solid #f0f0f0;
z-index: 10;
}
.keyword-box .keyword-block .hide-hot-tis {
@@ -468,11 +471,29 @@ view {
}
.empty {
padding-top: 300rpx;
color: #999999;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40rpx;
color: #999;
text-align: center;
::v-deep .u-image {
width: 346rpx;
height: 304rpx;
}
background: $bg-color;
}
.empty-img {
width: 320rpx;
height: 240rpx;
}
.empty-text {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 24rpx;
font-size: 28rpx;
line-height: 1.8;
color: #999;
}

View File

@@ -15,6 +15,7 @@
<mSearch
ref="mSearch"
class="mSearch-input-box"
:show-clear="false"
@clickLeft="back"
:mode="2"
:placeholder="defaultKeyword"
@@ -38,25 +39,39 @@
</scroll-view>
<div class="keyword-box" v-show="!isShowKeywordList">
<view class="keyword-block add1">
<view class="keyword-list-header"><view class="u-tips">热门搜索</view></view>
<view class="keyword keywordBox">
<view class="wes" v-for="(keyword, index) in hotKeywordList" @tap="doSearch(keyword)" :key="index">{{ keyword }}</view>
<view class="keyword-list-header">
<view class="u-tips">热门搜索</view>
</view>
<view class="tag-list">
<view
class="tag-item wes"
v-for="(keyword, index) in hotKeywordList"
:key="index"
@tap="doSearch(keyword)"
>{{ keyword }}</view>
</view>
</view>
<view class="keyword-block" v-if="oldKeywordList.length > 0">
<view class="keyword-list-header"><view class="u-tips">搜索历史</view></view>
<div class="oldKeyList">
<view class="keyword-list-header">
<view class="u-tips">搜索历史</view>
</view>
<view class="tag-list">
<template v-for="(keyword, index) in oldKeywordList" :key="index">
<div class="oldKeyItem" v-if="keyword" @click="doSearch(keyword)">
<span>{{ keyword }}</span>
</div>
<view
class="tag-item wes"
v-if="keyword"
@tap="doSearch(keyword)"
>{{ keyword }}</view>
</template>
<div @click="showMore" v-if="oldKeywordIndex > loadIndex" class="oldKeyItem">展示更多</div>
</div>
<view
class="tag-item tag-more"
v-if="oldKeywordIndex > loadIndex"
@tap="showMore"
>展示更多</view>
</view>
</view>
<div class="clear mp-iphonex-bottom" @tap="oldDelete">清空搜索历史</div>
<view class="clear mp-iphonex-bottom" @tap="oldDelete">清空搜索历史</view>
</div>
</view>
<!-- 搜索 -->
@@ -93,7 +108,7 @@
</view>
<!-- 一行一个商品展示 -->
<scroll-view
v-if="isSWitch"
v-if="!empty && isSWitch"
class="goods-scroll"
enableBackToTop="true"
lower-threshold="250"
@@ -106,7 +121,7 @@
</scroll-view>
<!-- 一行两个商品展示 -->
<scroll-view
v-if="!isSWitch && !(goodsList == [] || goodsList == '' || goodsList == null)"
v-if="!empty && !isSWitch && goodsList.length"
class="goods-scroll"
scroll-anchoring
enableBackToTop="true"
@@ -118,6 +133,14 @@
<goodsList :res="goodsList" :keyword="keyword" />
<uni-load-more :status="loadingType"></uni-load-more>
</scroll-view>
<view class="empty" v-if="empty">
<image class="empty-img" src="/static/nodata.png" mode="aspectFit"></image>
<view class="empty-text">
<text>没有找到相关的商品信息</text>
<text>请换一个关键词试试吧</text>
</view>
</view>
</view>
<u-popup border-radius="20" mode="right" width="90%" v-model:show="sortPopup">
@@ -202,13 +225,6 @@
</view>
</view>
</u-popup>
<div class="empty" v-if="empty">
<view><image style="width: 320rpx; height: 240rpx" src="/static/nodata.png"></image></view>
<view>
<p>没有找到相关的商品信息</p>
<p>请换一个关键词试试吧</p>
</view>
</div>
<u-back-top :scroll-top="scrollTop"></u-back-top>
</view>
</template>
@@ -637,13 +653,14 @@ export default {
}
//没有更多直接返回 #TODO
let goodsList = await getGoodsList(this.params);
if (goodsList.data.result.records.length < 10) {
const records = goodsList.data.result.records || [];
if (records.length < 10) {
this.loadingType = 'noMore';
this.empty = true;
} else {
this.empty = false;
this.loadingType = 'more';
}
this.goodsList.push(...goodsList.data.result.records);
this.goodsList.push(...records);
this.empty = this.goodsList.length === 0;
this.initSortGoods();
if (this.$store.state.isShowToast){ uni.hideLoading() };