优化中奖名单页面UI及交互体验

- 去掉顶部导航栏,添加返回按钮
- 替换banner图标为远程图片
- 调整banner标题、副标题、统计卡片字体样式
- 统计数字填充容器居中显示
- Tab栏吸顶效果,添加底部辅助线
- 新增搜索功能,前端过滤姓名/手机号
- 表格列居中对齐,行高64px
- 表格宽度自适应屏幕
- 加载更多间距调整
This commit is contained in:
jacobxu666
2026-07-17 10:49:54 +08:00
parent 15936574ba
commit 12ee234130
2 changed files with 142 additions and 28 deletions
+1 -1
View File
@@ -54,7 +54,7 @@
{
"path": "pages/winners/winners",
"style": {
"navigationBarTitleText": "中奖名单"
"navigationStyle": "custom"
}
},
{
+141 -27
View File
@@ -2,13 +2,18 @@
<view class="page">
<!-- 顶部公告区 -->
<view class="banner-area">
<!-- 返回按钮 -->
<view class="back-btn" @click="goBack">
<u-icon name="arrow-left" color="#333333" size="40"></u-icon>
<text class="back-text">返回</text>
</view>
<view class="banner-header">
<text class="banner-icon">&#x1F3C6;</text>
<image class="banner-icon" src="https://zhihuiyou.oss-cn-shenzhen.aliyuncs.com/hhrs/hhrs_zjgs.png" mode="aspectFit"></image>
<text class="banner-title">中奖名单公示</text>
</view>
<text class="banner-subtitle">总计 10,000份权益包,分三期公证抽取</text>
<view class="stats-card">
<text class="stats-gift">&#x1F381;</text>
<image class="stats-gift" src="https://zhihuiyou.oss-cn-shenzhen.aliyuncs.com/hhrs/hhrs_xyckr.png" mode="aspectFit"></image>
<text class="stats-label">已产生</text>
<text class="stats-number">7,000</text>
<text class="stats-label">名幸运持卡人</text>
@@ -30,8 +35,17 @@
</view>
</view>
<!-- 搜索栏 -->
<view class="search-area">
<view class="search-bar">
<u-icon name="search" color="#8e8e93" size="36"></u-icon>
<input class="search-input" v-model="keyword" placeholder="搜索姓名/手机号" confirm-type="search" @confirm="onSearch" />
<view class="search-btn" @click="onSearch">搜索</view>
</view>
</view>
<!-- 中奖者表格 -->
<scroll-view class="table-area" scroll-y @scrolltolower="loadMore" :lower-threshold="100">
<view class="table-area">
<view class="table-header">
<text class="table-col col-name">姓名</text>
<text class="table-col col-idcard">身份证</text>
@@ -42,8 +56,10 @@
<text class="table-col col-idcard">{{ item.memberIdentityNo }}</text>
<text class="table-col col-phone">{{ item.memberPhone }}</text>
</view>
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
</scroll-view>
<view class="loadmore-area">
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
</view>
</view>
</view>
</template>
@@ -58,17 +74,28 @@ export default {
pageSize: 10,
total: 0,
loading: false,
loadStatus: 'loadmore'
loadStatus: 'loadmore',
keyword: ''
}
},
computed: {
currentList() {
return this.winnerData[this.currentTab] || []
const list = this.winnerData[this.currentTab] || []
if (!this.keyword) return list
const kw = this.keyword.trim().toLowerCase()
if (!kw) return list
return list.filter(item =>
(item.memberName && item.memberName.toLowerCase().includes(kw)) ||
(item.memberPhone && item.memberPhone.includes(kw))
)
}
},
onLoad() {
this.loadDates()
},
onReachBottom() {
this.loadMore()
},
methods: {
loadDates() {
this.$u.api.getWinnerDates().then(res => {
@@ -134,6 +161,12 @@ export default {
} else {
this.loadStatus = this.winnerData[index].length >= this.total ? 'nomore' : 'loadmore'
}
},
goBack() {
uni.navigateBack()
},
onSearch() {
// 前端过滤,无需重新请求
}
}
}
@@ -144,11 +177,25 @@ export default {
}
</style>
<style scoped lang="less">
/* 返回按钮 */
.back-btn {
align-self: flex-start;
display: flex;
align-items: center;
gap: 2px;
margin-top: 48px;
}
.back-text {
font-size: 14px;
color: #333333;
}
/* 顶部公告区 */
.banner-area {
background-color: #ffffff;
padding: 24px;
border-radius: 0 0 10px 10px;
padding: 0 24px 24px;
margin-top: -24px;
display: flex;
flex-direction: column;
align-items: center;
@@ -159,21 +206,31 @@ export default {
display: flex;
align-items: center;
gap: 4px;
margin-top: -12px;
}
.banner-icon {
font-size: 50px;
width: 50px;
height: 50px;
}
.banner-title {
font-size: 32px;
color: #0D387D;
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
font-weight: bold;
color: #0d387d;
font-size: 32px;
line-height: normal;
letter-spacing: 0px;
text-align: left;
}
.banner-subtitle {
color: #8E8E93;
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
font-weight: 600;
font-size: 14px;
color: #8e8e93;
line-height: normal;
letter-spacing: 0px;
text-align: center;
}
@@ -183,22 +240,33 @@ export default {
align-items: center;
gap: 12px;
padding: 12px;
background: linear-gradient(146deg, #4981d2 0%, #1853af 100%);
border-radius: 10px;
background: linear-gradient(-135deg, #4981D2 0%, #1853AF 100%);
}
.stats-gift {
font-size: 36px;
width: 36px;
height: 36px;
}
.stats-label {
color: #FFFFFF;
font-family: 'Source Han Sans CN', 'Source Han Sans SC', sans-serif;
font-weight: 400;
font-size: 14px;
color: #ffffff;
line-height: normal;
letter-spacing: 0px;
text-align: left;
}
.stats-number {
font-size: 36px;
flex: 1;
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
font-weight: 600;
font-size: 36px;
line-height: normal;
letter-spacing: 0px;
text-align: center;
color: #fce7b0;
}
@@ -208,6 +276,10 @@ export default {
background-color: #ffffff;
padding-top: 12px;
justify-content: space-around;
position: sticky;
top: 0;
z-index: 5;
border-bottom: 1px solid #f2f2f7;
}
.tab-item {
@@ -220,16 +292,19 @@ export default {
}
.tab-label {
font-size: 16px;
color: #B1B1B1;
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
font-weight: 600;
color: #b1b1b1;
font-size: 16px;
line-height: 22px;
letter-spacing: 0px;
text-align: center;
}
.tab-date {
font-size: 14px;
font-weight: 600;
color: #b1b1b1;
color: #B1B1B1;
line-height: 22px;
}
@@ -247,12 +322,45 @@ export default {
border-radius: 100px;
}
/* 搜索栏 */
.search-area {
background-color: #ffffff;
padding: 10px 12px 12px;
}
.search-bar {
display: flex;
align-items: center;
height: 44px;
background-color: #ffffff;
border: 1px solid #f2f2f7;
border-radius: 100px;
padding: 4px 8px;
gap: 12px;
}
.search-input {
flex: 1;
font-size: 16px;
color: #333;
}
.search-btn {
background-color: #0088ff;
color: #ffffff;
font-size: 14px;
padding: 4px 10px;
border-radius: 50px;
white-space: nowrap;
}
/* 中奖者表格 */
.table-area {
background-color: #ffffff;
width: 702rpx;
margin: 24rpx;
border-radius: 8rpx;
width: 100%;
margin: 12px 0;
padding: 0 12px;
box-sizing: border-box;
}
.table-header,
@@ -266,16 +374,17 @@ export default {
.table-header {
color: #8e8e93;
font-size: 14px;
}
.table-row {
color: #000000;
font-size: 14px;
height: 64px;
}
.table-col {
flex: 1;
text-align: center;
}
.col-name {
@@ -286,12 +395,17 @@ export default {
.col-idcard {
flex: 1;
text-align: right;
text-align: center;
}
.col-phone {
flex: 1;
text-align: right;
margin-right: 24rpx;
text-align: center;
}
/* 加载更多 */
.loadmore-area {
padding: 24px 0;
color: #999999;
}
</style>