index.vue
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
* @Date: 2026-01-13 14:55:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-13 15:25:25
* @FilePath: /xyxBooking-weapp/src/pages/offlineBookingList/index.vue
* @Description: 离线预约记录页面
-->
<template>
<view class="offline-booking-list-page">
<view class="header-tip">
<IconFont name="tips" size="15" color="#A67939" />
<text>您当前处于离线模式,仅展示本地缓存的预约记录</text>
</view>
<view class="list-wrapper">
<view v-for="(item, index) in booking_list" :key="index">
<reserveCard :data="item" detail_path="/offlineBookingDetail" is_offline />
</view>
<view v-if="!booking_list.length" class="empty">
<text>本地无缓存预约记录</text>
</view>
</view>
<view class="action-area">
<button class="home-btn" @tap="toHome">返回首页</button>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import Taro, { useDidShow } from '@tarojs/taro'
import { IconFont } from '@nutui/icons-vue-taro'
import reserveCard from '@/components/reserveCard.vue'
import { get_offline_booking_cache } from '@/composables/useOfflineBookingCache'
const booking_list = ref([])
const toHome = () => {
Taro.reLaunch({ url: '/pages/index/index' })
}
const load_cache = () => {
booking_list.value = get_offline_booking_cache()
}
useDidShow(() => {
load_cache()
})
</script>
<style lang="less">
.offline-booking-list-page {
min-height: 100vh;
background-color: #F6F6F6;
.header-tip {
display: flex;
align-items: center;
padding: 20rpx 32rpx;
color: #A67939;
font-size: 26rpx;
background: #FFF;
}
.list-wrapper {
padding: 32rpx;
}
.empty {
padding: 120rpx 0;
text-align: center;
color: #A67939;
font-size: 32rpx;
}
.action-area {
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
padding: 24rpx 32rpx;
background: #FFF;
box-sizing: border-box;
box-shadow: 0 -10rpx 8rpx 0 rgba(0,0,0,0.06);
.home-btn {
background-color: #A67939;
color: #FFF;
border-radius: 16rpx;
font-size: 32rpx;
padding: 12rpx 0;
}
}
}
</style>