优化中奖名单页面UI及交互体验
- 去掉顶部导航栏,添加返回按钮 - 替换banner图标为远程图片 - 调整banner标题、副标题、统计卡片字体样式 - 统计数字填充容器居中显示 - Tab栏吸顶效果,添加底部辅助线 - 新增搜索功能,前端过滤姓名/手机号 - 表格列居中对齐,行高64px - 表格宽度自适应屏幕 - 加载更多间距调整
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/winners/winners",
|
"path": "pages/winners/winners",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "中奖名单"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+140
-26
@@ -2,13 +2,18 @@
|
|||||||
<view class="page">
|
<view class="page">
|
||||||
<!-- 顶部公告区 -->
|
<!-- 顶部公告区 -->
|
||||||
<view class="banner-area">
|
<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">
|
<view class="banner-header">
|
||||||
<text class="banner-icon">🏆</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>
|
<text class="banner-title">中奖名单公示</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="banner-subtitle">总计 10,000份权益包,分三期公证抽取</text>
|
<text class="banner-subtitle">总计 10,000份权益包,分三期公证抽取</text>
|
||||||
<view class="stats-card">
|
<view class="stats-card">
|
||||||
<text class="stats-gift">🎁</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-label">已产生</text>
|
||||||
<text class="stats-number">7,000</text>
|
<text class="stats-number">7,000</text>
|
||||||
<text class="stats-label">名幸运持卡人</text>
|
<text class="stats-label">名幸运持卡人</text>
|
||||||
@@ -30,8 +35,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</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">
|
<view class="table-header">
|
||||||
<text class="table-col col-name">姓名</text>
|
<text class="table-col col-name">姓名</text>
|
||||||
<text class="table-col col-idcard">身份证</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-idcard">{{ item.memberIdentityNo }}</text>
|
||||||
<text class="table-col col-phone">{{ item.memberPhone }}</text>
|
<text class="table-col col-phone">{{ item.memberPhone }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="loadmore-area">
|
||||||
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
|
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="'上拉加载更多'" :nomore-text="'没有更多了'" />
|
||||||
</scroll-view>
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -58,17 +74,28 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
loadStatus: 'loadmore'
|
loadStatus: 'loadmore',
|
||||||
|
keyword: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
currentList() {
|
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() {
|
onLoad() {
|
||||||
this.loadDates()
|
this.loadDates()
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
this.loadMore()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadDates() {
|
loadDates() {
|
||||||
this.$u.api.getWinnerDates().then(res => {
|
this.$u.api.getWinnerDates().then(res => {
|
||||||
@@ -134,6 +161,12 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.loadStatus = this.winnerData[index].length >= this.total ? 'nomore' : 'loadmore'
|
this.loadStatus = this.winnerData[index].length >= this.total ? 'nomore' : 'loadmore'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
onSearch() {
|
||||||
|
// 前端过滤,无需重新请求
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,11 +177,25 @@ export default {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="less">
|
<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 {
|
.banner-area {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 24px;
|
padding: 0 24px 24px;
|
||||||
border-radius: 0 0 10px 10px;
|
margin-top: -24px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -159,21 +206,31 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
margin-top: -12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-icon {
|
.banner-icon {
|
||||||
font-size: 50px;
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-title {
|
.banner-title {
|
||||||
font-size: 32px;
|
color: #0D387D;
|
||||||
|
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #0d387d;
|
font-size: 32px;
|
||||||
|
line-height: normal;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-subtitle {
|
.banner-subtitle {
|
||||||
|
color: #8E8E93;
|
||||||
|
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
|
||||||
|
font-weight: 600;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #8e8e93;
|
line-height: normal;
|
||||||
|
letter-spacing: 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,22 +240,33 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background: linear-gradient(146deg, #4981d2 0%, #1853af 100%);
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
background: linear-gradient(-135deg, #4981D2 0%, #1853AF 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-gift {
|
.stats-gift {
|
||||||
font-size: 36px;
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-label {
|
.stats-label {
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: 'Source Han Sans CN', 'Source Han Sans SC', sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #ffffff;
|
line-height: normal;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-number {
|
.stats-number {
|
||||||
font-size: 36px;
|
flex: 1;
|
||||||
|
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: normal;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: center;
|
||||||
color: #fce7b0;
|
color: #fce7b0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,6 +276,10 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 5;
|
||||||
|
border-bottom: 1px solid #f2f2f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-item {
|
.tab-item {
|
||||||
@@ -220,16 +292,19 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tab-label {
|
.tab-label {
|
||||||
font-size: 16px;
|
color: #B1B1B1;
|
||||||
|
font-family: 'Source Han Serif SC VF', 'Source Han Serif SC', serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #b1b1b1;
|
font-size: 16px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-date {
|
.tab-date {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #b1b1b1;
|
color: #B1B1B1;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,12 +322,45 @@ export default {
|
|||||||
border-radius: 100px;
|
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 {
|
.table-area {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
width: 702rpx;
|
width: 100%;
|
||||||
margin: 24rpx;
|
margin: 12px 0;
|
||||||
border-radius: 8rpx;
|
padding: 0 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-header,
|
.table-header,
|
||||||
@@ -266,16 +374,17 @@ export default {
|
|||||||
.table-header {
|
.table-header {
|
||||||
color: #8e8e93;
|
color: #8e8e93;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
height: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-col {
|
.table-col {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col-name {
|
.col-name {
|
||||||
@@ -286,12 +395,17 @@ export default {
|
|||||||
|
|
||||||
.col-idcard {
|
.col-idcard {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col-phone {
|
.col-phone {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: center;
|
||||||
margin-right: 24rpx;
|
}
|
||||||
|
|
||||||
|
/* 加载更多 */
|
||||||
|
.loadmore-area {
|
||||||
|
padding: 24px 0;
|
||||||
|
color: #999999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user