index.vue
2.61 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
98
99
100
101
<!--
* @Date: 2026-01-07 20:41:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-08 13:01:20
* @FilePath: /xyxBooking-weapp/src/pages/offlineBookingCode/index.vue
* @Description: 线下预约码页面
-->
<template>
<view class="offline-booking-code-page">
<view class="header-tip">
<IconFont name="tips" size="15" color="#A67939" />
<text>您当前处于离线模式,仅展示本地缓存的预约码</text>
</view>
<view style="padding: 32rpx;">
<offlineQrCode :list="qrList"></offlineQrCode>
<view class="warning">
<view style="display: flex; align-items: center; justify-content: center;"><IconFont name="tips" /><text style="margin-left: 10rpx;">温馨提示</text></view>
<view style="margin-top: 16rpx;">一人一码,扫码或识别身份证成功后进入</view>
</view>
</view>
<view class="action-area">
<button class="home-btn" @tap="toHome">返回首页</button>
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import Taro from '@tarojs/taro'
import offlineQrCode from '@/components/offlineQrCode';
import { IconFont } from '@nutui/icons-vue-taro'
import { useGo } from '@/hooks/useGo'
const go = useGo();
const qrList = ref([]);
const toHome = () => {
Taro.reLaunch({ url: '/pages/index/index' });
}
onMounted(() => {
try {
const cachedData = Taro.getStorageSync('OFFLINE_QR_DATA');
if (cachedData && cachedData.length > 0) {
qrList.value = cachedData;
}
} catch (e) {
console.error('Read storage failed', e);
}
});
</script>
<style lang="less">
.offline-booking-code-page {
position: relative;
min-height: 100vh;
background-color: #F6F6F6;
.header-tip {
background-color: #FEF8E8;
color: #A67939;
padding: 20rpx 32rpx;
font-size: 26rpx;
display: flex;
align-items: center;
text {
margin-left: 10rpx;
}
}
.warning {
text-align: center;
color: #A67939;
margin-top: 32rpx;
}
.action-area {
position: fixed;
bottom: 60rpx;
left: 0;
width: 100%;
display: flex;
justify-content: center;
.home-btn {
width: 600rpx;
height: 88rpx;
line-height: 88rpx;
background: #fff;
color: #A67939;
border: 2rpx solid #A67939;
border-radius: 44rpx;
font-size: 32rpx;
}
}
}
</style>