<template>
|
<view class="index-page">
|
<view class="top-gradient-bg" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }"></view>
|
<view class="top-hero">
|
<view :style="{ height: statusbarHeight + 'px' }"></view>
|
<view class="hero-bar" :style="{ height: navHeight + 'px' }">
|
<view class="location-chip" @tap="handleLocation">
|
<image src="/static/icon/home1_ic_location@2x.png" mode="aspectFit"></image>
|
<text>{{ currentAddress }}</text>
|
<u-icon name="arrow-right" size="14" color="#ffffff"></u-icon>
|
</view>
|
<view class="hero-actions">
|
<view class="hero-action action-pill">
|
<u-icon name="more-dot-fill" size="34" color="#2c2c2c"></u-icon>
|
</view>
|
<view class="hero-action action-ring">
|
<u-icon name="scan" size="28" color="#2c2c2c"></u-icon>
|
</view>
|
</view>
|
</view>
|
|
<view class="search-box" @tap="goStoragePage">
|
<image src="/static/icon/home_ic_search@2x.png" mode="aspectFit"></image>
|
<text class="search-text">搜索寄存点名称或地址</text>
|
</view>
|
|
<view class="banner-card hero-banner">
|
<view class="banner-tag">2027春运保障计划</view>
|
<view class="banner-copy">
|
<text>轻松出行</text>
|
<text>行李先行</text>
|
</view>
|
<image class="banner-image" mode="aspectFill"></image>
|
</view>
|
</view>
|
|
<view class="page-body">
|
<view class="service-grid">
|
<view class="service-card deposit-card">
|
<image class="service-image" src="/static/image/home_ic_jicun@2x.png" mode="aspectFit"></image>
|
</view>
|
<view class="service-card retrieve-card">
|
<image class="service-image" src="/static/image/home_ic_qujian@2x.png" mode="aspectFit"></image>
|
</view>
|
</view>
|
|
<view class="notice-card">
|
<view class="notice-icon-wrap">
|
<image src="/static/icon/home_ic_daizhifu@2x.png" mode="aspectFit"></image>
|
</view>
|
<view class="notice-copy">
|
<text class="notice-title">待支付</text>
|
<text class="notice-text">请在 10 分钟内完成支付,超时订单将自动取消</text>
|
</view>
|
</view>
|
|
<view class="section-head">
|
<text class="section-title">推荐寄存点</text>
|
<text class="section-more">查看更多</text>
|
</view>
|
|
<view class="recommend-list">
|
<view v-for="(item, index) in pointList" :key="index" class="point-card" @tap="goStoragePage">
|
<view class="point-thumb">
|
<image class="point-thumb-image" mode="aspectFill"></image>
|
</view>
|
<view class="point-main">
|
<view class="point-head">
|
<text class="point-name">{{ item.name }}</text>
|
<text class="point-distance">{{ item.distance }}</text>
|
</view>
|
<view class="point-address">
|
<image src="/static/icon/home_ic_location3@2x.png" mode="aspectFit"></image>
|
<text>{{ item.address }}</text>
|
</view>
|
<text class="point-time">{{ item.time }}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
|
<view class="location-toast">
|
<view class="toast-copy">
|
<text class="toast-title">未授权定位</text>
|
<text class="toast-text">我们无法获得您当前位置信息为您推荐附近寄存点</text>
|
</view>
|
<view class="toast-btn" @tap="handleLocation">开启定位</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
|
export default {
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight', 'address']),
|
currentAddress() {
|
return this.address && this.address !== '定位中' ? this.address : '获取定位'
|
}
|
},
|
data() {
|
return {
|
backgroundImage: require('@/static/image/bg_home@2x.png'),
|
pointList: [
|
{
|
name: '中铁快运南站旗舰店',
|
address: '合肥南站负一层100号',
|
time: '周一至周日 7:00~23:00',
|
distance: '239m'
|
},
|
{
|
name: '中铁快运合肥火车站',
|
address: '合肥火车站一层12号',
|
time: '周一至周日 7:00~23:00',
|
distance: '12.8km'
|
},
|
{
|
name: '合肥火车站北广场',
|
address: '合肥火车站一层12号',
|
time: '周一至周日 7:00~23:00',
|
distance: '13.1km'
|
}
|
]
|
}
|
},
|
async onLoad() {
|
await this.$onLaunched
|
},
|
methods: {
|
handleLocation() {
|
uni.showToast({
|
title: '定位功能待接入',
|
icon: 'none'
|
})
|
},
|
goStoragePage() {
|
uni.navigateTo({
|
url: '/pages/storage-point/storage-point'
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.index-page {
|
position: relative;
|
min-height: 100vh;
|
background: #f5f7fb;
|
padding-bottom: 160rpx;
|
}
|
|
.top-gradient-bg {
|
position: absolute;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 420rpx;
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
z-index: 0;
|
}
|
|
.top-hero {
|
position: relative;
|
z-index: 1;
|
padding: 0 30rpx 0 30rpx;
|
box-sizing: border-box;
|
}
|
|
.hero-banner {
|
margin-top: 30rpx;
|
}
|
|
.hero-bar {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.location-chip {
|
display: flex;
|
align-items: center;
|
gap: 6rpx;
|
max-width: 360rpx;
|
image {
|
width: 36rpx;
|
height: 36rpx;
|
margin-right: 8rpx;
|
}
|
text {
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #FFFFFF;
|
}
|
}
|
|
.hero-actions {
|
display: flex;
|
align-items: center;
|
padding: 6rpx 10rpx;
|
border-radius: 999rpx;
|
background: rgba(255, 255, 255, 0.7);
|
}
|
|
.hero-action {
|
width: 52rpx;
|
height: 52rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.action-ring {
|
border-left: 1rpx solid rgba(44, 44, 44, 0.12);
|
}
|
|
.search-box {
|
height: 72rpx;
|
margin-top: 10rpx;
|
padding: 0 22rpx;
|
border-radius: 16rpx;
|
background: #ffffff;
|
display: flex;
|
align-items: center;
|
gap: 14rpx;
|
image {
|
width: 28rpx;
|
height: 28rpx;
|
}
|
}
|
|
.search-text {
|
font-size: 26rpx;
|
color: #b6bcc8;
|
}
|
|
.page-body {
|
position: relative;
|
z-index: 1;
|
padding: 18rpx 22rpx 0;
|
}
|
|
.banner-card {
|
position: relative;
|
height: 310rpx;
|
padding: 28rpx 26rpx;
|
border-radius: 20rpx;
|
overflow: hidden;
|
background: linear-gradient(180deg, #bde7ff 0%, #e9f9ff 38%, #90d16e 100%);
|
box-sizing: border-box;
|
}
|
|
.banner-card::before,
|
.banner-card::after {
|
content: '';
|
position: absolute;
|
top: 28rpx;
|
width: 140rpx;
|
height: 78rpx;
|
background: rgba(255, 255, 255, 0.62);
|
border-radius: 999rpx;
|
}
|
|
.banner-card::before {
|
left: -34rpx;
|
}
|
|
.banner-card::after {
|
right: -24rpx;
|
}
|
|
.banner-tag {
|
display: inline-flex;
|
align-items: center;
|
height: 46rpx;
|
padding: 0 18rpx;
|
border-radius: 24rpx;
|
background: #ff7d51;
|
font-size: 24rpx;
|
font-weight: 600;
|
color: #ffffff;
|
}
|
|
.banner-copy {
|
position: relative;
|
z-index: 1;
|
width: 196rpx;
|
margin-top: 44rpx;
|
padding: 20rpx 18rpx;
|
border: 4rpx solid rgba(255, 255, 255, 0.7);
|
border-radius: 18rpx;
|
background: rgba(112, 175, 92, 0.28);
|
text {
|
display: block;
|
font-size: 48rpx;
|
font-weight: 700;
|
line-height: 1.25;
|
color: #ffffff;
|
}
|
}
|
|
.banner-image {
|
position: absolute;
|
right: 10rpx;
|
bottom: 12rpx;
|
width: 320rpx;
|
height: 220rpx;
|
}
|
|
.service-grid {
|
display: grid;
|
grid-template-columns: repeat(2, 1fr);
|
gap: 18rpx;
|
margin-top: 18rpx;
|
}
|
|
.service-card {
|
width: 334rpx;
|
height: 176rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
box-sizing: border-box;
|
}
|
|
.service-image {
|
width: 334rpx;
|
height: 176rpx;
|
}
|
|
.notice-card {
|
display: flex;
|
align-items: center;
|
margin-top: 30rpx;
|
padding: 30rpx;
|
box-sizing: border-box;
|
border-radius: 18rpx;
|
background: linear-gradient(135deg, #25a2f5 0%, #1eaef4 100%);
|
overflow: hidden;
|
}
|
|
.notice-icon-wrap {
|
flex-shrink: 0;
|
width: 76rpx;
|
height: 76rpx;
|
border-radius: 38rpx;
|
background: rgba(255, 255, 255, 0.14);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.notice-icon {
|
width: 38rpx;
|
height: 38rpx;
|
}
|
|
.notice-copy {
|
margin-left: 18rpx;
|
min-width: 0;
|
}
|
|
.notice-title {
|
display: block;
|
font-weight: bold;
|
font-size: 30rpx;
|
color: #FFFFFF;
|
}
|
|
.notice-text {
|
display: block;
|
margin-top: 6rpx;
|
font-weight: 400;
|
font-size: 24rpx;
|
color: rgba(255,255,255,0.85);
|
}
|
|
.section-head {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 40rpx;
|
}
|
|
.section-title {
|
font-size: 36rpx;
|
font-weight: 700;
|
color: #202020;
|
}
|
|
.section-more {
|
font-size: 24rpx;
|
color: #a4acb8;
|
}
|
|
.section-more::after {
|
content: ' >';
|
}
|
|
.recommend-list {
|
margin-top: 14rpx;
|
}
|
|
.point-card {
|
display: flex;
|
gap: 18rpx;
|
padding: 24rpx;
|
margin-bottom: 18rpx;
|
border-radius: 18rpx;
|
background: #f4f7fc;
|
}
|
|
.point-thumb {
|
position: relative;
|
flex-shrink: 0;
|
width: 132rpx;
|
height: 104rpx;
|
border-radius: 12rpx;
|
overflow: hidden;
|
background: #dfe7f3;
|
}
|
|
.point-thumb-image {
|
width: 100%;
|
height: 100%;
|
}
|
|
.point-main {
|
flex: 1;
|
min-width: 0;
|
}
|
|
.point-head {
|
display: flex;
|
align-items: flex-start;
|
justify-content: space-between;
|
gap: 10rpx;
|
}
|
|
.point-name {
|
flex: 1;
|
font-size: 32rpx;
|
font-weight: 600;
|
line-height: 1.35;
|
color: #222222;
|
}
|
|
.point-distance {
|
flex-shrink: 0;
|
font-size: 24rpx;
|
color: #a6aebb;
|
}
|
|
.point-address {
|
display: flex;
|
align-items: center;
|
gap: 6rpx;
|
margin-top: 8rpx;
|
font-size: 24rpx;
|
color: #8f97a4;
|
image {
|
width: 20rpx;
|
height: 20rpx;
|
}
|
}
|
|
.point-time {
|
display: block;
|
margin-top: 10rpx;
|
font-size: 24rpx;
|
color: #9aa2ae;
|
}
|
|
.location-toast {
|
position: fixed;
|
left: 20rpx;
|
right: 20rpx;
|
bottom: 8rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
padding: 18rpx 20rpx;
|
border-radius: 12rpx;
|
background: rgba(42, 42, 42, 0.88);
|
z-index: 30;
|
}
|
|
.toast-copy {
|
min-width: 0;
|
padding-right: 16rpx;
|
}
|
|
.toast-title {
|
display: block;
|
font-size: 28rpx;
|
font-weight: 600;
|
color: #ffffff;
|
}
|
|
.toast-text {
|
display: block;
|
margin-top: 6rpx;
|
font-size: 22rpx;
|
line-height: 1.4;
|
color: rgba(255, 255, 255, 0.76);
|
}
|
|
.toast-btn {
|
flex-shrink: 0;
|
height: 54rpx;
|
line-height: 54rpx;
|
padding: 0 20rpx;
|
border-radius: 27rpx;
|
background: linear-gradient(135deg, #18b2ff 0%, #0b95ff 100%);
|
font-size: 24rpx;
|
font-weight: 600;
|
color: #ffffff;
|
}
|
</style>
|