Compare commits
7
Commits
xuchao
...
bba2571f25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bba2571f25 | ||
|
|
6e88f6b09d | ||
|
|
a8b4f08921 | ||
|
|
4ed72056a9 | ||
|
|
6cef231473 | ||
|
|
e1801f1026 | ||
|
|
64ac69db93 |
+2
-1
@@ -34,7 +34,8 @@
|
|||||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
|
||||||
"type-check": "vue-tsc --noEmit"
|
"type-check": "vue-tsc --noEmit",
|
||||||
|
"check:api-prefix": "bash scripts/check-api-prefix.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "3.0.0-alpha-5010320260611001",
|
"@dcloudio/uni-app": "3.0.0-alpha-5010320260611001",
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# xuchao: 防止页面调用写死 /mp-api 前缀(request.ts 的 API_BASE 已含该前缀,重复会形成双前缀,
|
||||||
|
# 依赖 chaos 路由全局剥离才能工作,属错误写法)。命中即失败。
|
||||||
|
set -e
|
||||||
|
if grep -rn --include='*.vue' --include='*.ts' -e "('/mp-api/" -e '("/mp-api/' src; then
|
||||||
|
echo "❌ 发现页面写死 /mp-api 前缀,请去掉(API_BASE 会自动拼接)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ api 前缀检查通过"
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { post } from './request'
|
|
||||||
import { BASE_URL } from '../config'
|
|
||||||
import type { CreateOrderParams, CreateOrderResult, PrepayParams, PrepayResult } from './types'
|
|
||||||
|
|
||||||
export function createOrder(params: CreateOrderParams) {
|
|
||||||
return post<CreateOrderResult>(`${BASE_URL}/open-api/pingXiang/createOrder`, params)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function prepay(params: PrepayParams) {
|
|
||||||
return post<PrepayResult>(`${BASE_URL}/open-api/pingXiang/prepay`, params)
|
|
||||||
}
|
|
||||||
@@ -185,6 +185,8 @@ export interface OAuth2LoginResult {
|
|||||||
/** 用户年卡列表项(来自 /zhy-api/cardBag/userCardList) */
|
/** 用户年卡列表项(来自 /zhy-api/cardBag/userCardList) */
|
||||||
export interface UserCardListItem {
|
export interface UserCardListItem {
|
||||||
cardNo: string
|
cardNo: string
|
||||||
|
// xuchao: 卡种ID(后端 CardBagBean.cardModelId),人脸预检与卡种过滤均在用
|
||||||
|
cardModelId: number
|
||||||
cardModelName: string
|
cardModelName: string
|
||||||
validityTime: string
|
validityTime: string
|
||||||
cardModelPic: string
|
cardModelPic: string
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'FAQ' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'FAQ' })
|
||||||
faqList.value = (data || []).map(n => ({
|
faqList.value = (data || []).map(n => ({
|
||||||
id: n.id,
|
id: n.id,
|
||||||
title: n.title,
|
title: n.title,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const notices = ref<NoticeItem[]>([])
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' })
|
||||||
notices.value = (data || []).map(n => ({
|
notices.value = (data || []).map(n => ({
|
||||||
id: n.id,
|
id: n.id,
|
||||||
title: n.title,
|
title: n.title,
|
||||||
|
|||||||
@@ -193,7 +193,25 @@ function fixRichHtml(html: string): string {
|
|||||||
|
|
||||||
const introductionHtml = computed(() => fixRichHtml(scenic.value.introduction))
|
const introductionHtml = computed(() => fixRichHtml(scenic.value.introduction))
|
||||||
const bookingNoticeHtml = computed(() => fixRichHtml(scenic.value.bookingNoticeHtml))
|
const bookingNoticeHtml = computed(() => fixRichHtml(scenic.value.bookingNoticeHtml))
|
||||||
const storeNoticeHtml = computed(() => fixRichHtml(storeNotice.value.content))
|
|
||||||
|
/** 富文本标签特征(管理端公告内容为 textarea 纯文本,含标签才视为 HTML) */
|
||||||
|
// xuchao: 判断公告正文是否为编辑器产出的 HTML
|
||||||
|
const HTML_TAG_RE = /<(?:p|br|div|span|strong|em|i|b|u|h[1-6]|img|ul|ol|li|a|table|tr|td|video|section)[^>]*>/i
|
||||||
|
|
||||||
|
// xuchao: 纯文本转 rich-text 可渲染的 HTML:转义特殊字符 + 换行转 <br/>,保留后台录入的段落格式
|
||||||
|
function plainTextToHtml(text: string): string {
|
||||||
|
return text
|
||||||
|
.replace(/&(?!(?:#\d+|#x[0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);)/g, '&')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
.replace(/\n/g, '<br/>')
|
||||||
|
}
|
||||||
|
|
||||||
|
const storeNoticeHtml = computed(() => {
|
||||||
|
const content = storeNotice.value.content
|
||||||
|
if (!content) return ''
|
||||||
|
return HTML_TAG_RE.test(content) ? fixRichHtml(content) : plainTextToHtml(content)
|
||||||
|
})
|
||||||
|
|
||||||
const activeTab = ref<'notice' | 'intro'>('notice')
|
const activeTab = ref<'notice' | 'intro'>('notice')
|
||||||
const currentSlide = ref(0)
|
const currentSlide = ref(0)
|
||||||
@@ -225,7 +243,7 @@ onLoad((options) => {
|
|||||||
|
|
||||||
async function fetchShopNotice(shopId: string) {
|
async function fetchShopNotice(shopId: string) {
|
||||||
try {
|
try {
|
||||||
const res = await post<any>('/mp-api/mpShopNotice/queryShopNoticePage', {
|
const res = await post<any>('/mpShopNotice/queryShopNoticePage', {
|
||||||
shopId,
|
shopId,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
@@ -247,7 +265,7 @@ async function fetchDetail(shopId: string) {
|
|||||||
const phone = uni.getStorageSync('phone') as string
|
const phone = uni.getStorageSync('phone') as string
|
||||||
if (phone) params.phone = phone
|
if (phone) params.phone = phone
|
||||||
|
|
||||||
const res = await post<any>('/mp-api/mpScenic/getScenicDetail', params)
|
const res = await post<any>('/mpScenic/getScenicDetail', params)
|
||||||
if (res) {
|
if (res) {
|
||||||
scenic.value = {
|
scenic.value = {
|
||||||
id: res.id || res.scenicId || shopId,
|
id: res.id || res.scenicId || shopId,
|
||||||
@@ -862,13 +880,14 @@ $icon-crown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' w
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* xuchao: 正文区固定 45vh 高度——微信要求 scroll-view 有确定高度才能竖向滚动;flex-shrink:0 防止被弹窗整体高度压缩 */
|
||||||
.notice-popup-body {
|
.notice-popup-body {
|
||||||
|
height: 45vh;
|
||||||
|
flex-shrink: 0;
|
||||||
padding: $spacing-3 $spacing-5 $spacing-3;
|
padding: $spacing-3 $spacing-5 $spacing-3;
|
||||||
font-size: $font-size-sm;
|
font-size: $font-size-sm;
|
||||||
color: $uv-tips-color;
|
color: $uv-tips-color;
|
||||||
line-height: 1.9;
|
line-height: 1.9;
|
||||||
max-height: 45vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice-popup-footer {
|
.notice-popup-footer {
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ async function fetchScenicList(resetPage = true) {
|
|||||||
phone: uni.getStorageSync('phone') || '',
|
phone: uni.getStorageSync('phone') || '',
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await post<any>('/mp-api/mpScenic/queryScenicList', params)
|
const res = await post<any>('/mpScenic/queryScenicList', params)
|
||||||
const list = res?.list || res?.rows || res?.records || res || []
|
const list = res?.list || res?.rows || res?.records || res || []
|
||||||
const totalCount = res?.total || res?.totalCount || 0
|
const totalCount = res?.total || res?.totalCount || 0
|
||||||
total.value = totalCount
|
total.value = totalCount
|
||||||
@@ -344,7 +344,7 @@ onLoad((query: any) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const filterRes = await post<any>('/mp-api/mpScenic/queryFilterOptions', { channel: 'pingxiang' }).catch(() => null)
|
const filterRes = await post<any>('/mpScenic/queryFilterOptions', { channel: 'pingxiang' }).catch(() => null)
|
||||||
|
|
||||||
if (filterRes) {
|
if (filterRes) {
|
||||||
const levels = filterRes.levels || filterRes.levelList || []
|
const levels = filterRes.levels || filterRes.levelList || []
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const data = await post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'GUIDE' })
|
const data = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'GUIDE' })
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
imageUrl.value = data[0].imageUrl || ''
|
imageUrl.value = data[0].imageUrl || ''
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,20 +69,20 @@ export function checkFaceFlag(cardNo: string): Promise<boolean> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 上传图片到 OSS */
|
/** 上传图片到 OSS */
|
||||||
export function uploadImage(filePath: string): Promise<string> {
|
export function uploadImage(filePath: string, endpoint = '/open-api/oss/upload'): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: `${BASE_URL}/open-api/oss/upload`,
|
url: `${BASE_URL}${endpoint}`,
|
||||||
filePath,
|
filePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(res.data as string)
|
const data = JSON.parse(res.data as string)
|
||||||
if (data.errcode === 0 && data.data?.fileUrl) {
|
if ((data.errcode === 0 || data.code === 200) && data.data?.fileUrl) {
|
||||||
resolve(data.data.fileUrl)
|
resolve(data.data.fileUrl)
|
||||||
} else {
|
} else {
|
||||||
reject(new Error(data.errmsg || '上传失败'))
|
reject(new Error(data.errmsg || data.msg || '上传失败'))
|
||||||
}
|
}
|
||||||
} catch { reject(new Error('解析响应失败')) }
|
} catch { reject(new Error('解析响应失败')) }
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export async function queryVoucherList(params: QueryVoucherListParams): Promise<
|
|||||||
await delay(300)
|
await delay(300)
|
||||||
return MOCK_VOUCHERS.map((v) => ({ ...v, mobile: params.mobile }))
|
return MOCK_VOUCHERS.map((v) => ({ ...v, mobile: params.mobile }))
|
||||||
}
|
}
|
||||||
return post<VoucherItem[]>('/mp-api/douyin/voucherList', params)
|
return post<VoucherItem[]>('/douyin/voucherList', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,5 +94,5 @@ export async function activateAndBind(params: ActivateAndBindParams): Promise<vo
|
|||||||
await delay(800)
|
await delay(800)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
await post<null>('/mp-api/douyin/activateAndBind', params)
|
await post<null>('/douyin/activateAndBind', params)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// xuchao: 萍乡超级玩家卡下单/预支付接口(open-api 渠道)。原为主包 api/order.ts,
|
||||||
|
// 因仅被本分包页面引用导致主包整包扫描告警,迁入分包;与本地 order.ts(/order/* 旧接口)不是同一组接口,勿混用。
|
||||||
|
import { post } from '../../../api/request'
|
||||||
|
import { BASE_URL } from '../../../config'
|
||||||
|
import type { CreateOrderParams, CreateOrderResult, PrepayParams, PrepayResult } from '../../../api/types'
|
||||||
|
|
||||||
|
export function createOrder(params: CreateOrderParams) {
|
||||||
|
return post<CreateOrderResult>(`${BASE_URL}/open-api/pingXiang/createOrder`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function prepay(params: PrepayParams) {
|
||||||
|
return post<PrepayResult>(`${BASE_URL}/open-api/pingXiang/prepay`, params)
|
||||||
|
}
|
||||||
@@ -115,6 +115,35 @@
|
|||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 5. 照片拍摄要求提示 -->
|
||||||
|
<view class="photo-tips">
|
||||||
|
<text class="photo-tips__title">照片拍摄要求</text>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">图片仅允许1张人脸,多人脸直接驳回</text>
|
||||||
|
</view>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">图片不能无人脸、侧脸过大、遮挡严重(口罩/帽子遮大半脸)</text>
|
||||||
|
</view>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">不允许全身、远景、远距离人像照片</text>
|
||||||
|
</view>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">不允许脸部极致特写、贴脸拍摄无留白</text>
|
||||||
|
</view>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">图片清晰,无严重模糊、逆光、黑影、反光</text>
|
||||||
|
</view>
|
||||||
|
<view class="photo-tips__item">
|
||||||
|
<view class="photo-tips__dot" />
|
||||||
|
<text class="photo-tips__text">不允许翻拍屏幕、截图、证件复印件照片</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 弹窗:证件类型选择 -->
|
<!-- 弹窗:证件类型选择 -->
|
||||||
<uni-popup ref="idTypePopup" type="bottom" :mask-click="true" mask-background="transparent" @change="(e: any) => showIdTypePicker = e.show">
|
<uni-popup ref="idTypePopup" type="bottom" :mask-click="true" mask-background="transparent" @change="(e: any) => showIdTypePicker = e.show">
|
||||||
<view class="popup-sheet">
|
<view class="popup-sheet">
|
||||||
@@ -237,11 +266,16 @@ async function handleImage(filePath: string) {
|
|||||||
try {
|
try {
|
||||||
const compressedPath = await compressImage(filePath)
|
const compressedPath = await compressImage(filePath)
|
||||||
uni.showLoading({ title: '上传中...' })
|
uni.showLoading({ title: '上传中...' })
|
||||||
const url = await uploadImage(compressedPath)
|
const url = await uploadImage(compressedPath, '/open-api/oss/uploadWithFaceCheck')
|
||||||
photoUrl.value = url
|
photoUrl.value = url
|
||||||
uni.showToast({ title: '上传成功', icon: 'success' })
|
uni.showToast({ title: '上传成功', icon: 'success' })
|
||||||
} catch {
|
} catch (e) {
|
||||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
uni.showModal({
|
||||||
|
title: '上传失败',
|
||||||
|
content: (e as Error).message || '上传失败',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '确定',
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
uploading.value = false
|
uploading.value = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
@@ -362,8 +396,8 @@ function handleCancel() {
|
|||||||
|
|
||||||
/* ===== Page ===== */
|
/* ===== Page ===== */
|
||||||
.page {
|
.page {
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
overflow: hidden;
|
overflow-y: auto;
|
||||||
background: $color-card;
|
background: $color-card;
|
||||||
font-family: $font-family-body;
|
font-family: $font-family-body;
|
||||||
}
|
}
|
||||||
@@ -714,6 +748,52 @@ function handleCancel() {
|
|||||||
color: $uv-tips-color;
|
color: $uv-tips-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== 5. Photo Tips ===== */
|
||||||
|
.photo-tips {
|
||||||
|
margin: 32rpx 24rpx;
|
||||||
|
padding: 28rpx;
|
||||||
|
background: #f7f8fa;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-tips__title {
|
||||||
|
display: block;
|
||||||
|
font-family: $font-family-body;
|
||||||
|
font-size: $font-size-sm;
|
||||||
|
font-weight: $font-weight-medium;
|
||||||
|
color: $uv-main-color;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-tips__item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-tips__dot {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: $uv-primary;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.photo-tips__text {
|
||||||
|
flex: 1;
|
||||||
|
font-family: $font-family-body;
|
||||||
|
font-size: $font-size-xs;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $uv-tips-color;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
/* ===== Popup Sheet ===== */
|
/* ===== Popup Sheet ===== */
|
||||||
.popup-sheet {
|
.popup-sheet {
|
||||||
background: $color-card;
|
background: $color-card;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import { onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
|||||||
import { post, getToken } from '../../../api/request'
|
import { post, getToken } from '../../../api/request'
|
||||||
import { BASE_URL } from '../../../config'
|
import { BASE_URL } from '../../../config'
|
||||||
import { useUserStore } from '../../../store/user'
|
import { useUserStore } from '../../../store/user'
|
||||||
import { createOrder, prepay } from '../../../api/order'
|
import { createOrder, prepay } from '../api/pingxiang-order'
|
||||||
import type { BannerItem } from '../../../api/types'
|
import type { BannerItem } from '../../../api/types'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -85,7 +85,7 @@ const noticeHtml = computed(() => fixRichHtml(noticeContent.value))
|
|||||||
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
||||||
async function fetchPurchaseNotice() {
|
async function fetchPurchaseNotice() {
|
||||||
try {
|
try {
|
||||||
const res = await post<BannerItem[]>('/mp-api/mpContent/queryList', {
|
const res = await post<BannerItem[]>('/mpContent/queryList', {
|
||||||
channel: 'pingxiang',
|
channel: 'pingxiang',
|
||||||
type: 'CARD_PURCHASE_NOTICE',
|
type: 'CARD_PURCHASE_NOTICE',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'CARD_NOTICE' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'CARD_NOTICE' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ const noticeHtml = computed(() => fixRichHtml(noticeContent.value))
|
|||||||
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
/** 获取购卡须知富文本(type = CARD_PURCHASE_NOTICE) */
|
||||||
async function fetchPurchaseNotice() {
|
async function fetchPurchaseNotice() {
|
||||||
try {
|
try {
|
||||||
const res = await post<BannerItem[]>('/mp-api/mpContent/queryList', {
|
const res = await post<BannerItem[]>('/mpContent/queryList', {
|
||||||
channel: 'pingxiang',
|
channel: 'pingxiang',
|
||||||
type: 'CARD_PURCHASE_NOTICE',
|
type: 'CARD_PURCHASE_NOTICE',
|
||||||
})
|
})
|
||||||
@@ -500,7 +500,7 @@ async function doActivate() {
|
|||||||
url: `${BASE_URL}/open-api/card/sendAndBind`,
|
url: `${BASE_URL}/open-api/card/sendAndBind`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
orderNo: selectedVoucher.value?.id || '',
|
orderNo: `${selectedVoucher.value?.code || ''}-${selectedVoucher.value?.id || ''}`,
|
||||||
typeId: '820093438328133',
|
typeId: '820093438328133',
|
||||||
userName: form.userName.trim(),
|
userName: form.userName.trim(),
|
||||||
mobile: phone.value,
|
mobile: phone.value,
|
||||||
@@ -578,10 +578,15 @@ async function handleImage(filePath: string) {
|
|||||||
try {
|
try {
|
||||||
const compressed = await compressImage(filePath)
|
const compressed = await compressImage(filePath)
|
||||||
uni.showLoading({ title: '上传中...' })
|
uni.showLoading({ title: '上传中...' })
|
||||||
faceImg.value = await uploadImage(compressed)
|
faceImg.value = await uploadImage(compressed, '/open-api/oss/uploadWithFaceCheck')
|
||||||
uni.showToast({ title: '上传成功', icon: 'success' })
|
uni.showToast({ title: '上传成功', icon: 'success' })
|
||||||
} catch {
|
} catch (e) {
|
||||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
uni.showModal({
|
||||||
|
title: '上传失败',
|
||||||
|
content: (e as Error).message || '上传失败',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '确定',
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
uploading.value = false
|
uploading.value = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
>
|
>
|
||||||
<text class="date-week">{{ d.week }}</text>
|
<text class="date-week">{{ d.week }}</text>
|
||||||
<text class="date-day">{{ d.label }}</text>
|
<text class="date-day">{{ d.label }}</text>
|
||||||
<text v-if="d.disabled" class="date-stock date-stock--empty">不可约</text>
|
<text v-if="d.disabled" class="date-stock date-stock--empty">{{ d.expired ? '已过预约时间' : '不可约' }}</text>
|
||||||
<text v-else-if="d.stock == null" class="date-stock">无限库存</text>
|
<text v-else-if="d.stock == null" class="date-stock">无限库存</text>
|
||||||
<text v-else-if="d.stock >= 50" class="date-stock">可预约</text>
|
<text v-else-if="d.stock >= 50" class="date-stock">可预约</text>
|
||||||
<text v-else-if="d.stock > 0" class="date-stock">余{{ d.stock }}位</text>
|
<text v-else-if="d.stock > 0" class="date-stock">余{{ d.stock }}位</text>
|
||||||
@@ -155,6 +155,8 @@ interface DateOption {
|
|||||||
cards: CardOption[]
|
cards: CardOption[]
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
reason?: string
|
reason?: string
|
||||||
|
// xuchao: 已过预约截止时间(后端置灰补显的日期,不可点)
|
||||||
|
expired?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const scenic = ref({ name: '', address: '', hours: '', image: '' })
|
const scenic = ref({ name: '', address: '', hours: '', image: '' })
|
||||||
@@ -269,7 +271,8 @@ onLoad(async (query: any) => {
|
|||||||
userIdCard.value = res.userIdCard || ''
|
userIdCard.value = res.userIdCard || ''
|
||||||
bookingNotice.value = Array.isArray(res.bookingNotice) ? res.bookingNotice.map((n: any) => (typeof n === 'string' ? n : n?.content || n?.text || '')).join('<br/>') : (res.bookingNotice || '')
|
bookingNotice.value = Array.isArray(res.bookingNotice) ? res.bookingNotice.map((n: any) => (typeof n === 'string' ? n : n?.content || n?.text || '')).join('<br/>') : (res.bookingNotice || '')
|
||||||
cardModelName.value = res.cardModelName || ''
|
cardModelName.value = res.cardModelName || ''
|
||||||
appointmentDays.value = (res.dates || []).length
|
// xuchao: 近N日提示不含过截止置灰补显的日期
|
||||||
|
appointmentDays.value = (res.dates || []).filter((d: any) => !d.expired).length
|
||||||
reserveParams.value = {
|
reserveParams.value = {
|
||||||
scenicId: parseInt(resourceId),
|
scenicId: parseInt(resourceId),
|
||||||
channel: 'Channel_SZH',
|
channel: 'Channel_SZH',
|
||||||
@@ -287,6 +290,7 @@ onLoad(async (query: any) => {
|
|||||||
cards: d.cards || [],
|
cards: d.cards || [],
|
||||||
disabled: d.disabled,
|
disabled: d.disabled,
|
||||||
reason: d.reason,
|
reason: d.reason,
|
||||||
|
expired: d.expired,
|
||||||
}))
|
}))
|
||||||
const firstAvailable = dateOptions.value.find(d => d.stock == null || d.stock > 0)
|
const firstAvailable = dateOptions.value.find(d => d.stock == null || d.stock > 0)
|
||||||
if (firstAvailable) selectedDate.value = firstAvailable.key
|
if (firstAvailable) selectedDate.value = firstAvailable.key
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 预约入园日期 -->
|
<!-- 预约入园日期 -->
|
||||||
<view class="record-info">
|
<view class="record-info">
|
||||||
<text class="record-date">预约入园日期:{{ r.date }}</text>
|
<text class="record-date">预约入园日期:<text class="record-date--value">{{ formatDateOnly(r.date) }}</text></text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<view class="record-actions">
|
<view class="record-actions">
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</uni-popup>
|
</uni-popup>
|
||||||
|
|
||||||
<!-- 详情弹窗 -->
|
<!-- 详情弹窗 -->
|
||||||
<uni-popup ref="detailPopup" type="bottom" :mask-click="true">
|
<uni-popup ref="detailPopup" type="center" :mask-click="true">
|
||||||
<view class="detail-sheet">
|
<view class="detail-sheet">
|
||||||
<view class="sheet-header">
|
<view class="sheet-header">
|
||||||
<text class="sheet-title">使用详情</text>
|
<text class="sheet-title">使用详情</text>
|
||||||
@@ -137,17 +137,9 @@
|
|||||||
<text class="sheet-label">预约景区</text>
|
<text class="sheet-label">预约景区</text>
|
||||||
<text class="sheet-value">{{ detailRecord?.scenicName }}</text>
|
<text class="sheet-value">{{ detailRecord?.scenicName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="sheet-row">
|
|
||||||
<text class="sheet-label">卡种</text>
|
|
||||||
<text class="sheet-value">{{ detailRecord?.cardType }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="sheet-row">
|
|
||||||
<text class="sheet-label">卡号</text>
|
|
||||||
<text class="sheet-value">{{ detailRecord?.cardNo }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="sheet-row">
|
<view class="sheet-row">
|
||||||
<text class="sheet-label">预约入园日期</text>
|
<text class="sheet-label">预约入园日期</text>
|
||||||
<text class="sheet-value">{{ detailRecord?.date }}</text>
|
<text class="sheet-value sheet-value--date">{{ formatDateOnly(detailRecord?.date) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="detailRecord?.session" class="sheet-row">
|
<view v-if="detailRecord?.session" class="sheet-row">
|
||||||
<text class="sheet-label">预约场次</text>
|
<text class="sheet-label">预约场次</text>
|
||||||
@@ -157,10 +149,6 @@
|
|||||||
<text class="sheet-label">预约人</text>
|
<text class="sheet-label">预约人</text>
|
||||||
<text class="sheet-value">{{ detailRecord?.userName }}</text>
|
<text class="sheet-value">{{ detailRecord?.userName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="sheet-row">
|
|
||||||
<text class="sheet-label">证件号</text>
|
|
||||||
<text class="sheet-value">{{ detailRecord?.maskedId }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="sheet-row">
|
<view class="sheet-row">
|
||||||
<text class="sheet-label">预约状态</text>
|
<text class="sheet-label">预约状态</text>
|
||||||
<text class="sheet-value">{{ detailStatusLabel(detailRecord?.status || '') }}</text>
|
<text class="sheet-value">{{ detailStatusLabel(detailRecord?.status || '') }}</text>
|
||||||
@@ -177,6 +165,11 @@
|
|||||||
<text class="sheet-label">取消时间</text>
|
<text class="sheet-label">取消时间</text>
|
||||||
<text class="sheet-value">{{ detailRecord.cancelTime }}</text>
|
<text class="sheet-value">{{ detailRecord.cancelTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 人脸图片 -->
|
||||||
|
<view v-if="detailRecord?.photo" class="sheet-photo">
|
||||||
|
<text class="sheet-label">人脸图片</text>
|
||||||
|
<image class="sheet-photo-avatar" :src="detailRecord.photo" mode="aspectFill" @tap="previewPhoto(detailRecord.photo)" />
|
||||||
|
</view>
|
||||||
<!-- 核销人脸照片 -->
|
<!-- 核销人脸照片 -->
|
||||||
<view v-if="detailRecord?.verifyPhoto" class="sheet-photo">
|
<view v-if="detailRecord?.verifyPhoto" class="sheet-photo">
|
||||||
<text class="sheet-label">核销照片</text>
|
<text class="sheet-label">核销照片</text>
|
||||||
@@ -213,6 +206,7 @@ interface ReserveRecord {
|
|||||||
cancelTime?: string
|
cancelTime?: string
|
||||||
verifyTime?: string
|
verifyTime?: string
|
||||||
verifyPhoto?: string
|
verifyPhoto?: string
|
||||||
|
photo?: string
|
||||||
cardInstruction?: string
|
cardInstruction?: string
|
||||||
cardModelId?: string
|
cardModelId?: string
|
||||||
canCancel?: boolean
|
canCancel?: boolean
|
||||||
@@ -244,9 +238,6 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearTimer()
|
clearTimer()
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.offUserCaptureScreen()
|
|
||||||
// #endif
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const records = ref<ReserveRecord[]>([])
|
const records = ref<ReserveRecord[]>([])
|
||||||
@@ -288,6 +279,7 @@ async function fetchRecords(append = false) {
|
|||||||
cancelTime: item.cancelTime || '',
|
cancelTime: item.cancelTime || '',
|
||||||
verifyTime: item.verifyTime || '',
|
verifyTime: item.verifyTime || '',
|
||||||
verifyPhoto: item.verifyPhoto || '',
|
verifyPhoto: item.verifyPhoto || '',
|
||||||
|
photo: item.photo || '',
|
||||||
cardInstruction: item.cardInstruction || '',
|
cardInstruction: item.cardInstruction || '',
|
||||||
cardModelId: item.cardModelId || item.thirdId || '',
|
cardModelId: item.cardModelId || item.thirdId || '',
|
||||||
canCancel: !!item.canCancel,
|
canCancel: !!item.canCancel,
|
||||||
@@ -308,15 +300,6 @@ async function fetchRecords(append = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.setVisualEffectOnCapture({ visualEffect: 'hidden' })
|
|
||||||
wx.onUserCaptureScreen(() => {
|
|
||||||
uni.showToast({ title: '该页面截图无效,请不要截图', icon: 'none' })
|
|
||||||
if (currentRecord.value) {
|
|
||||||
fetchCode(currentRecord.value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
fetchRecords()
|
fetchRecords()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -332,6 +315,12 @@ function formatReserveDate(date?: string): string {
|
|||||||
return `${m[1]} 年 ${Number(m[2])} 月 ${Number(m[3])} 日`
|
return `${m[1]} 年 ${Number(m[2])} 月 ${Number(m[3])} 日`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 日期去除时分秒(如 2026-08-05 10:00:00 → 2026-08-05) */
|
||||||
|
function formatDateOnly(date?: string): string {
|
||||||
|
if (!date) return ''
|
||||||
|
return date.split(' ')[0]
|
||||||
|
}
|
||||||
|
|
||||||
function showCancelModal(r: ReserveRecord) {
|
function showCancelModal(r: ReserveRecord) {
|
||||||
cancelRecord.value = r
|
cancelRecord.value = r
|
||||||
cancelPopup.value?.open()
|
cancelPopup.value?.open()
|
||||||
@@ -449,6 +438,7 @@ async function viewDetail(r: ReserveRecord) {
|
|||||||
cancelTime: res.cancelTime || r.cancelTime,
|
cancelTime: res.cancelTime || r.cancelTime,
|
||||||
verifyTime: res.verifyTime || r.verifyTime,
|
verifyTime: res.verifyTime || r.verifyTime,
|
||||||
verifyPhoto: res.verifyPhoto || r.verifyPhoto,
|
verifyPhoto: res.verifyPhoto || r.verifyPhoto,
|
||||||
|
photo: res.photo || r.photo,
|
||||||
cardInstruction: res.cardInstruction || r.cardInstruction || '',
|
cardInstruction: res.cardInstruction || r.cardInstruction || '',
|
||||||
cardModelId: res.cardModelId || r.cardModelId || '',
|
cardModelId: res.cardModelId || r.cardModelId || '',
|
||||||
}
|
}
|
||||||
@@ -622,6 +612,11 @@ function previewPhoto(url: string) {
|
|||||||
color: $uv-tips-color;
|
color: $uv-tips-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.record-date--value {
|
||||||
|
color: $uv-error;
|
||||||
|
font-weight: $font-weight-medium;
|
||||||
|
}
|
||||||
|
|
||||||
.record-actions {
|
.record-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
@@ -743,7 +738,7 @@ function previewPhoto(url: string) {
|
|||||||
|
|
||||||
/* ===== Detail Sheet ===== */
|
/* ===== Detail Sheet ===== */
|
||||||
.detail-sheet {
|
.detail-sheet {
|
||||||
background: $color-card; border-radius: $radius-lg $radius-lg 0 0; max-height: 75vh;
|
width: 640rpx; background: $color-card; border-radius: $radius-lg; max-height: 75vh;
|
||||||
display: flex; flex-direction: column;
|
display: flex; flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,6 +773,7 @@ function previewPhoto(url: string) {
|
|||||||
|
|
||||||
.sheet-label { font-family: $font-family-body; font-size: $font-size-sm; color: $uv-main-color; }
|
.sheet-label { font-family: $font-family-body; font-size: $font-size-sm; color: $uv-main-color; }
|
||||||
.sheet-value { font-family: $font-family-body; font-size: $font-size-sm; color: $uv-content-color; text-align: right; }
|
.sheet-value { font-family: $font-family-body; font-size: $font-size-sm; color: $uv-content-color; text-align: right; }
|
||||||
|
.sheet-value--date { color: $uv-error; font-weight: $font-weight-medium; }
|
||||||
|
|
||||||
.sheet-photo {
|
.sheet-photo {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -788,9 +784,9 @@ function previewPhoto(url: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sheet-photo-avatar {
|
.sheet-photo-avatar {
|
||||||
width: 100rpx;
|
width: 200rpx;
|
||||||
height: 100rpx;
|
height: 200rpx;
|
||||||
border-radius: 50%;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet-tip {
|
.sheet-tip {
|
||||||
|
|||||||
@@ -106,21 +106,9 @@ let countdownTimer: ReturnType<typeof setInterval> | null = null
|
|||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearTimer()
|
clearTimer()
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.offUserCaptureScreen()
|
|
||||||
// #endif
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(async (query: any) => {
|
onLoad(async (query: any) => {
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
wx.setVisualEffectOnCapture({ visualEffect: 'hidden' })
|
|
||||||
wx.onUserCaptureScreen(() => {
|
|
||||||
uni.showToast({ title: '该页面截图无效,请不要截图', icon: 'none' })
|
|
||||||
if (codePopup.value) {
|
|
||||||
fetchCode()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
const appointId = query?.appointId
|
const appointId = query?.appointId
|
||||||
if (!appointId) return
|
if (!appointId) return
|
||||||
const phone = (uni.getStorageSync('phone') as string) || ''
|
const phone = (uni.getStorageSync('phone') as string) || ''
|
||||||
|
|||||||
@@ -182,19 +182,33 @@ async function fetchCardPrice() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
fetchCardPrice()
|
fetchCardPrice()
|
||||||
|
fetchSpots()
|
||||||
|
fetchBannersAndNotices()
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 获取 banner 与公告(与景区加载互相独立) */
|
||||||
|
async function fetchBannersAndNotices() {
|
||||||
try {
|
try {
|
||||||
const [bannerData, noticeData, spotsData] = await Promise.all([
|
const [bannerData, noticeData] = await Promise.all([
|
||||||
post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'BANNER' }),
|
post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'BANNER' }),
|
||||||
post<BannerItem[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' }),
|
post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'NOTICE' }),
|
||||||
post<any>('/mp-api/mpScenic/queryScenicList', { channel: 'pingxiang', pageNo: 1, pageSize: 8, phone: uni.getStorageSync('phone') || '' }),
|
|
||||||
])
|
])
|
||||||
banners.value = bannerData || []
|
banners.value = bannerData || []
|
||||||
announcements.value = (noticeData || []).map(n => ({
|
announcements.value = (noticeData || []).map(n => ({
|
||||||
...n,
|
...n,
|
||||||
typeLabel: '公告',
|
typeLabel: '公告',
|
||||||
}))
|
}))
|
||||||
|
} catch {
|
||||||
|
// 静默失败
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取热门景点(独立加载,不阻塞 banner/公告渲染) */
|
||||||
|
async function fetchSpots() {
|
||||||
|
try {
|
||||||
|
const spotsData = await post<any>('/mpScenic/queryScenicList', { channel: 'pingxiang', pageNo: 1, pageSize: 8, phone: uni.getStorageSync('phone') || '' })
|
||||||
const list = spotsData?.list || spotsData || []
|
const list = spotsData?.list || spotsData || []
|
||||||
hotSpots.value = (Array.isArray(list) ? list : []).slice(0, 8).map((s: any) => ({
|
hotSpots.value = (Array.isArray(list) ? list : []).slice(0, 8).map((s: any) => ({
|
||||||
id: s.id || s.scenicId,
|
id: s.id || s.scenicId,
|
||||||
@@ -208,7 +222,7 @@ onMounted(async () => {
|
|||||||
} catch {
|
} catch {
|
||||||
// 静默失败
|
// 静默失败
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
onShareAppMessage(() => ({
|
onShareAppMessage(() => ({
|
||||||
title: '爱上萍乡旅游年卡',
|
title: '爱上萍乡旅游年卡',
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'TERMS' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'TERMS' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const loading = ref(true)
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const list = await post<any[]>('/mp-api/mpContent/queryList', { channel: 'pingxiang', type: 'PRIVACY' })
|
const list = await post<any[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'PRIVACY' })
|
||||||
content.value = list?.[0]?.content || ''
|
content.value = list?.[0]?.content || ''
|
||||||
} catch {
|
} catch {
|
||||||
showToast('加载失败')
|
showToast('加载失败')
|
||||||
|
|||||||
+162
-33
@@ -106,13 +106,13 @@
|
|||||||
<view class="detail-row">
|
<view class="detail-row">
|
||||||
<text class="detail-label">卡号:</text>
|
<text class="detail-label">卡号:</text>
|
||||||
<view class="detail-value-wrap">
|
<view class="detail-value-wrap">
|
||||||
<text class="detail-value">{{ currentCard.cardNo }}</text>
|
<text class="detail-value">{{ currentCard?.cardNo }}</text>
|
||||||
<text class="copy-btn" @click="copyCardNo">复制</text>
|
<text class="copy-btn" @click="copyCardNo">复制</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-row">
|
<view class="detail-row">
|
||||||
<text class="detail-label">有效期至:</text>
|
<text class="detail-label">有效期至:</text>
|
||||||
<text class="detail-value">{{ formatDateOnly(currentCard.validityTime) }}</text>
|
<text class="detail-value">{{ formatDateOnly(currentCard?.validityTime) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-row">
|
<view class="detail-row">
|
||||||
<text class="detail-label">{{ userInfoData?.idType || '证件' }}:</text>
|
<text class="detail-label">{{ userInfoData?.idType || '证件' }}:</text>
|
||||||
@@ -124,30 +124,59 @@
|
|||||||
<!-- 入园提示(持卡人信息下方) -->
|
<!-- 入园提示(持卡人信息下方) -->
|
||||||
<view class="qrcode-section" v-if="!showFaceModal && !isLeaving">
|
<view class="qrcode-section" v-if="!showFaceModal && !isLeaving">
|
||||||
<text class="qrcode-title">入园提示</text>
|
<text class="qrcode-title">入园提示</text>
|
||||||
<view>为确保信息安全,现入园核销只能使用人脸核销。</view>
|
<view v-if="!entryNotice" class="qrcode-fallback">为确保信息安全,现入园核销只能使用人脸核销。</view>
|
||||||
|
<view v-else class="qrcode-content">
|
||||||
|
<rich-text :nodes="entryNotice" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部占位(滑到底时与tabBar的间隔) -->
|
<!-- 底部占位(滑到底时与tabBar的间隔) -->
|
||||||
<view style="height: 48rpx;"/>
|
<view style="height: 48rpx;"/>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
|
||||||
<!-- 人脸绑定提醒弹窗 -->
|
<!-- 人脸绑定提醒弹窗 -->
|
||||||
<ConfirmModal
|
<uni-popup
|
||||||
v-model="showFaceModal"
|
ref="faceModalPopup"
|
||||||
:title="faceModalTitle"
|
type="center"
|
||||||
:content="faceModalContent"
|
:mask-click="false"
|
||||||
confirmText="前往人脸绑定"
|
@change="(e: any) => showFaceModal = e.show"
|
||||||
@confirm="onFaceModalConfirm"
|
>
|
||||||
/>
|
<view class="face-modal">
|
||||||
|
<view class="face-modal__title">人脸核销升级通知</view>
|
||||||
|
|
||||||
|
<view class="face-modal__row face-modal__row--spec">
|
||||||
|
<image class="face-modal__icon" src="https://aliyunoss.hn12301.net/sd/ticket_icon1.png" mode="aspectFit" />
|
||||||
|
<view class="face-modal__col">
|
||||||
|
<text class="face-modal__sub-title">拍照规范</text>
|
||||||
|
<view class="face-modal__desc">仅可现场真人实拍正面头像,禁止艺术写真、美颜修图、远景全身、特写大头照;人脸要求完整。</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="face-modal__row">
|
||||||
|
<image class="face-modal__icon" src="https://aliyunoss.hn12301.net/sd/ticket_icon3.png" mode="aspectFit" />
|
||||||
|
<view class="face-modal__col">
|
||||||
|
<text class="face-modal__sub-title">隐私说明</text>
|
||||||
|
<view class="face-modal__desc">采集人脸仅用于本人入园身份核验,信息加密严格保密,不会挪作其他用途。</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="face-modal__tip">
|
||||||
|
<image class="face-modal__tip-icon" src="https://aliyunoss.hn12301.net/sd/ticket_icon2.png" mode="aspectFit" />
|
||||||
|
<view class="face-modal__tip-text">完成人脸重新绑定后,才可正常使用旅游卡</br>全部入园权益功能</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="face-modal__btn" @click="onFaceModalConfirm">立即重新绑定</view>
|
||||||
|
<view class="face-modal__hint">请使用本人实拍照片</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onUnmounted } from 'vue'
|
import { ref, computed, watch, onUnmounted } from 'vue'
|
||||||
import { onShow, onHide } from '@dcloudio/uni-app'
|
import { onShow, onHide } from '@dcloudio/uni-app'
|
||||||
import { useUserStore } from '../../store/user'
|
import { useUserStore } from '../../store/user'
|
||||||
import { getUserCardList, getQrAndUserInfo } from '../../api/card'
|
import { getUserCardList, getQrAndUserInfo } from '../../api/card'
|
||||||
import type { UserCardListItem, QrAndUserInfoResult } from '../../api/types'
|
import type { UserCardListItem, QrAndUserInfoResult, BannerItem } from '../../api/types'
|
||||||
import ConfirmModal from '../../components/confirm-modal.vue'
|
|
||||||
import { post } from '../../api/request'
|
import { post } from '../../api/request'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -158,9 +187,14 @@ const loaded = ref(false)
|
|||||||
const userCards = ref<UserCardListItem[]>([])
|
const userCards = ref<UserCardListItem[]>([])
|
||||||
const userInfoData = ref<QrAndUserInfoResult | null>(null)
|
const userInfoData = ref<QrAndUserInfoResult | null>(null)
|
||||||
const showFaceModal = ref(false)
|
const showFaceModal = ref(false)
|
||||||
const faceModalTitle = ref('系统安全升级提醒')
|
const faceModalPopup = ref<any>(null)
|
||||||
const faceModalContent = ref('为保障您的旅游卡信息安全、规范入园使用,平台已启动人脸核验升级。\n根据规则要求,使用旅游卡前需完成人脸绑定,核验仅用于身份核实,人脸信息严格保密,不会挪作他用。\n请立即完成人脸绑定,方可继续使用全部功能。')
|
watch(showFaceModal, (v) => {
|
||||||
|
if (v) faceModalPopup.value?.open()
|
||||||
|
else faceModalPopup.value?.close()
|
||||||
|
})
|
||||||
const isLeaving = ref(false)
|
const isLeaving = ref(false)
|
||||||
|
const entryNotice = ref('')
|
||||||
|
const entryNoticeLoaded = ref(false)
|
||||||
|
|
||||||
const hasCard = computed(() => userCards.value.length > 0)
|
const hasCard = computed(() => userCards.value.length > 0)
|
||||||
const currentCardIndex = ref(0)
|
const currentCardIndex = ref(0)
|
||||||
@@ -170,22 +204,17 @@ let timer: ReturnType<typeof setInterval> | null = null
|
|||||||
|
|
||||||
/** 获取用户年卡列表 */
|
/** 获取用户年卡列表 */
|
||||||
async function fetchCards() {
|
async function fetchCards() {
|
||||||
const mobile = uni.getStorageSync('phone') as string
|
const mobile = (uni.getStorageSync('phone') as string) || userStore.userInfo?.phone || ''
|
||||||
if (!mobile) {
|
|
||||||
loaded.value = true
|
|
||||||
loading.value = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
fetchEntryNotice()
|
||||||
try {
|
try {
|
||||||
const list = (await getUserCardList({ mobile, saleChannel: 'xgh' })) || []
|
const list = (await getUserCardList({ mobile, saleChannel: 'xgh' })) || []
|
||||||
const allowedIds = ['820093340659013', '820093438328133']
|
const allowedIds = ['820093340659013', '820093438328133']
|
||||||
userCards.value = list.filter((c: any) => allowedIds.includes(String(c.cardModelId)))
|
userCards.value = list.filter((c: any) => allowedIds.includes(String(c.cardModelId)))
|
||||||
|
currentCardIndex.value = 0
|
||||||
|
|
||||||
const firstCard = userCards.value[0]
|
const firstCard = userCards.value[0]
|
||||||
if (firstCard?.needFaceImgFlag) {
|
if (firstCard?.needFaceImgFlag) {
|
||||||
faceModalTitle.value = '系统安全升级提醒'
|
|
||||||
faceModalContent.value = '为保障您的旅游卡信息安全、规范入园使用,平台已启动人脸核验升级。\n根据规则要求,使用旅游卡前需完成人脸绑定,核验仅用于身份核实,人脸信息严格保密,不会挪作他用。\n请立即完成人脸绑定,方可继续使用全部功能。'
|
|
||||||
showFaceModal.value = true
|
showFaceModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,21 +229,32 @@ async function fetchCards() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 获取入园提示内容(ENTRY_NOTICE 公告) */
|
||||||
|
async function fetchEntryNotice() {
|
||||||
|
if (entryNoticeLoaded.value) return
|
||||||
|
try {
|
||||||
|
const list = await post<BannerItem[]>('/mpContent/queryList', { channel: 'pingxiang', type: 'ENTRY_NOTICE' })
|
||||||
|
entryNotice.value = list?.[0]?.content || ''
|
||||||
|
} catch {
|
||||||
|
entryNotice.value = ''
|
||||||
|
} finally {
|
||||||
|
entryNoticeLoaded.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 刷新当前卡的人脸绑定状态(从接口获取最新数据) */
|
/** 刷新当前卡的人脸绑定状态(从接口获取最新数据) */
|
||||||
async function refreshNeedFace() {
|
async function refreshNeedFace() {
|
||||||
const mobile = uni.getStorageSync('phone') as string
|
const mobile = (uni.getStorageSync('phone') as string) || userStore.userInfo?.phone || ''
|
||||||
if (!mobile) return
|
|
||||||
try {
|
try {
|
||||||
const list = (await getUserCardList({ mobile, saleChannel: 'xgh' })) || []
|
const list = (await getUserCardList({ mobile, saleChannel: 'xgh' })) || []
|
||||||
const allowedIds = ['820093340659013', '820093438328133']
|
const allowedIds = ['820093340659013', '820093438328133']
|
||||||
userCards.value = list.filter((c: any) => allowedIds.includes(String(c.cardModelId)))
|
userCards.value = list.filter((c: any) => allowedIds.includes(String(c.cardModelId)))
|
||||||
|
currentCardIndex.value = 0
|
||||||
|
|
||||||
const current = userCards.value[currentCardIndex.value]
|
const current = userCards.value[currentCardIndex.value]
|
||||||
if (current) {
|
if (current) {
|
||||||
fetchUserInfo(current)
|
fetchUserInfo(current)
|
||||||
if (current.needFaceImgFlag) {
|
if (current.needFaceImgFlag) {
|
||||||
faceModalTitle.value = '系统安全升级提醒'
|
|
||||||
faceModalContent.value = '为保障您的旅游卡信息安全、规范入园使用,平台已启动人脸核验升级。\n根据规则要求,使用旅游卡前需完成人脸绑定,核验仅用于身份核实,人脸信息严格保密,不会挪作他用。\n请立即完成人脸绑定,方可继续使用全部功能。'
|
|
||||||
showFaceModal.value = true
|
showFaceModal.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -248,8 +288,6 @@ function onCardChange(e: any) {
|
|||||||
if (card) {
|
if (card) {
|
||||||
fetchUserInfo(card)
|
fetchUserInfo(card)
|
||||||
if (card.needFaceImgFlag) {
|
if (card.needFaceImgFlag) {
|
||||||
faceModalTitle.value = '系统安全升级提醒'
|
|
||||||
faceModalContent.value = '为保障您的旅游卡信息安全、规范入园使用,平台已启动人脸核验升级。\n根据规则要求,使用旅游卡前需完成人脸绑定,核验仅用于身份核实,人脸信息严格保密,不会挪作他用。\n请立即完成人脸绑定,方可继续使用全部功能。'
|
|
||||||
showFaceModal.value = true
|
showFaceModal.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,8 +331,10 @@ function goBuyCard() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyCardNo() {
|
function copyCardNo() {
|
||||||
|
const card = currentCard.value
|
||||||
|
if (!card) return
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: currentCard.value.cardNo,
|
data: card.cardNo,
|
||||||
success: () => { uni.showToast({ title: '已复制', icon: 'success' }) },
|
success: () => { uni.showToast({ title: '已复制', icon: 'success' }) },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -346,11 +386,9 @@ function onFeatureClick(item: { label: string }) {
|
|||||||
uni.showToast({ title: '请先选择一张旅游卡', icon: 'none' })
|
uni.showToast({ title: '请先选择一张旅游卡', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
post<any>('/mp-api/mpCard/checkFaceBind', { cardModelId: card.cardModelId, cardNumber: card.cardNo })
|
post<any>('/mpCard/checkFaceBind', { cardModelId: card.cardModelId, cardNumber: card.cardNo })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.needBindFace) {
|
if (res?.needBindFace) {
|
||||||
faceModalTitle.value = '系统安全升级提醒'
|
|
||||||
faceModalContent.value = '为保障您的旅游卡信息安全、规范入园使用,平台已启动人脸核验升级。\n根据规则要求,使用旅游卡前需完成人脸绑定,核验仅用于身份核实,人脸信息严格保密,不会挪作他用。\n请立即完成人脸绑定,方可继续使用全部功能。'
|
|
||||||
showFaceModal.value = true
|
showFaceModal.value = true
|
||||||
} else {
|
} else {
|
||||||
const url = card.thirdId
|
const url = card.thirdId
|
||||||
@@ -400,6 +438,89 @@ onUnmounted(() => { if (timer) clearInterval(timer) })
|
|||||||
.page { min-height: 100vh; background: $color-background; font-family: $font-family-body; }
|
.page { min-height: 100vh; background: $color-background; font-family: $font-family-body; }
|
||||||
.scroll-content { }
|
.scroll-content { }
|
||||||
|
|
||||||
|
/* === 人脸绑定提醒弹窗 === */
|
||||||
|
.face-modal {
|
||||||
|
width: 600rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
}
|
||||||
|
.face-modal__title {
|
||||||
|
color: #000;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.face-modal__row {
|
||||||
|
width: 552rpx;
|
||||||
|
display: flex;
|
||||||
|
padding-bottom: 24rpx;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
|
.face-modal__row--spec {
|
||||||
|
border-bottom: 2rpx solid #f2f2f7;
|
||||||
|
margin-top: 36rpx;
|
||||||
|
}
|
||||||
|
.face-modal__icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
.face-modal__col {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
.face-modal__sub-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.face-modal__desc {
|
||||||
|
width: 490rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
|
.face-modal__tip {
|
||||||
|
width: 552rpx;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
padding: 7rpx;
|
||||||
|
background: #f6f9fe;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.face-modal__tip-icon {
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
}
|
||||||
|
.face-modal__tip-text {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
.face-modal__btn {
|
||||||
|
width: 552rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 32rpx;
|
||||||
|
background: #0088ff;
|
||||||
|
}
|
||||||
|
.face-modal__hint {
|
||||||
|
width: 552rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
color: #404040;
|
||||||
|
}
|
||||||
|
|
||||||
/* === 加载中 === */
|
/* === 加载中 === */
|
||||||
.loading-state {
|
.loading-state {
|
||||||
display: flex; flex-direction: column; align-items: center;
|
display: flex; flex-direction: column; align-items: center;
|
||||||
@@ -540,6 +661,14 @@ onUnmounted(() => { if (timer) clearInterval(timer) })
|
|||||||
font-size: $font-size-lg; font-weight: $font-weight-medium; color: $uv-main-color;
|
font-size: $font-size-lg; font-weight: $font-weight-medium; color: $uv-main-color;
|
||||||
display: block; margin-bottom: 20rpx; align-self: flex-start;
|
display: block; margin-bottom: 20rpx; align-self: flex-start;
|
||||||
}
|
}
|
||||||
|
.qrcode-content {
|
||||||
|
font-size: $font-size-base; color: $uv-content-color;
|
||||||
|
line-height: 1.7; word-break: break-all; align-self: flex-start;
|
||||||
|
}
|
||||||
|
.qrcode-fallback {
|
||||||
|
font-size: $font-size-base; color: $uv-content-color;
|
||||||
|
line-height: 1.7; word-break: break-all; align-self: flex-start;
|
||||||
|
}
|
||||||
.qrcode-box {
|
.qrcode-box {
|
||||||
width: 360rpx; height: 360rpx; background: #f8fafc;
|
width: 360rpx; height: 360rpx; background: #f8fafc;
|
||||||
border-radius: 16rpx; display: flex; align-items: center;
|
border-radius: 16rpx; display: flex; align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user