feat(hhrs): 开发文旅场馆、商户折扣、中奖名单三个H5页面
- 新增自定义导航栏(返回按钮 + 标题) - 文旅场馆/商户折扣:搜索栏 + 卡片列表(缩略图/名称/分类/地址/距离) - 中奖名单:公告区 + 统计卡片 + 三期Tab切换 + 中奖者表格 - pages.json 新增 navigationStyle: custom 配置 - common/http.api.js 新增 mp-api/hhrs 前缀接口占位 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e4c29a08b4
commit
b37aa6bf81
+220
-18
@@ -1,30 +1,232 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="content">
|
||||
<text>商户折扣</text>
|
||||
<!-- 自定义导航栏 -->
|
||||
<view class="nav-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<view class="nav-header">
|
||||
<view class="nav-back" @click="goBack">
|
||||
<text class="back-icon"></text>
|
||||
</view>
|
||||
<text class="nav-title">商户折扣</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-area">
|
||||
<view class="search-bar">
|
||||
<text class="search-icon"></text>
|
||||
<input class="search-input" v-model="keyword" placeholder="请搜索商户名" confirm-type="search" @confirm="onSearch" />
|
||||
<view class="search-btn" @click="onSearch">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商户列表 -->
|
||||
<view class="list-area">
|
||||
<view class="merchant-card" v-for="item in list" :key="item.id" @click="goDetail(item)">
|
||||
<image class="card-img" :src="item.image" mode="aspectFill" />
|
||||
<view class="card-info">
|
||||
<text class="card-name">{{ item.name }}</text>
|
||||
<text class="card-category">{{ item.category }}</text>
|
||||
<text class="card-address">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="card-distance">
|
||||
<text class="distance-icon"></text>
|
||||
<text class="distance-text">{{ item.distance }}km</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight: 44,
|
||||
keyword: '',
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
name: '万达影城(怀化市鹤城区万...',
|
||||
category: '影城',
|
||||
address: '怀化市鹤城区万达广场 C 区501',
|
||||
image: 'https://aliyunoss.hn12301.net/hhrs/hhrs_merchant1.png',
|
||||
distance: '1.4'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '绝味鸭脖(绝味怀化万达...',
|
||||
category: '商超',
|
||||
address: '怀化市鹤城区万达广场 C 区501',
|
||||
image: 'https://aliyunoss.hn12301.net/hhrs/hhrs_merchant2.png',
|
||||
distance: '1.4'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
this.statusBarHeight = sysInfo.statusBarHeight || 44
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {}
|
||||
goDetail(item) {
|
||||
uni.navigateTo({ url: '/pages/discount/detail?id=' + item.id })
|
||||
},
|
||||
onSearch() {
|
||||
// TODO: 调用搜索接口
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
}
|
||||
<style>
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background-color: #f2f2f7;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
background-color: #ffffff;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.nav-header {
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-back {
|
||||
position: absolute;
|
||||
left: 14px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
font-size: 20px;
|
||||
color: #1a1818;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #1a1818;
|
||||
}
|
||||
|
||||
.search-area {
|
||||
background-color: #ffffff;
|
||||
padding: 6px 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-icon {
|
||||
font-size: 18px;
|
||||
color: #8e8e93;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.list-area {
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.merchant-card {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #f2f2f7;
|
||||
border-radius: 6px;
|
||||
padding: 24px 12px;
|
||||
gap: 12px;
|
||||
box-shadow: 0 2px 3px #f2f2f7;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
border-radius: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.card-category {
|
||||
font-size: 14px;
|
||||
color: #727272;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.card-address {
|
||||
font-size: 14px;
|
||||
color: #727272;
|
||||
margin-top: 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.card-distance {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.distance-icon {
|
||||
font-size: 12px;
|
||||
color: #727272;
|
||||
}
|
||||
|
||||
.distance-text {
|
||||
font-size: 12px;
|
||||
color: #727272;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user