feat: 更新预约功能与礼品卡支持

- 新增礼品卡页面,支持礼品卡的选择与使用。
- 调整预约下单流程,增强预约信息展示与用户交互。
- 更新支付成功页面的导航逻辑,确保用户体验流畅。
- 优化搜索页面的历史关键词加载逻辑,提升性能。
This commit is contained in:
pikachu1995@126.com
2026-09-28 14:37:26 +08:00
parent 2107e3f03a
commit 0bffe81c6b
25 changed files with 2272 additions and 1038 deletions

View File

@@ -234,7 +234,7 @@ import {
getStoreIsCollect,
} from '@/api/members.js'
import config from '@/config/config'
import { getGoodsList } from '@/api/goods.js'
import { getGoodsList, getMpScene } from '@/api/goods.js'
import { getAllCoupons } from '@/api/promotions.js'
import { getFloorStoreData } from '@/api/home'
import {
@@ -349,6 +349,33 @@ function fallbackToBasePage() {
getCategoryData()
}
function applyStoreId(id) {
storeId.value = id || ''
goodsParams.storeId = storeId.value
couponParams.storeId = storeId.value
}
function parseStoreIdFromParams(params) {
const text = String(params || '').trim()
if (!text) return ''
if (text.indexOf('id=') === 0) return text.slice(3)
const match = /(?:^|&)id=([^&]+)/.exec(text)
return match ? decodeURIComponent(match[1]) : ''
}
async function resolveStoreIdFromScene(scene) {
const raw = decodeURIComponent(String(scene || '')).trim()
if (!raw) return ''
const direct = parseStoreIdFromParams(raw)
if (direct) return direct
try {
const res = await getMpScene(raw)
return parseStoreIdFromParams(res?.data?.result)
} catch {
return ''
}
}
function getStoreLicencePhoto() {
uni.navigateTo({
url: `/pages/product/licencePhoto?id=${storeId.value}`,
@@ -505,11 +532,15 @@ function getCoupon(item: any) {
}
onLoad((options: any) => {
storeId.value = options.id
console.log(storeId.value, 'this.storeId')
goodsParams.storeId = options.id
couponParams.storeId = options.id
applyStoreId(options?.id)
if (!storeId.value && options?.scene) {
resolveStoreIdFromScene(options.scene).then((id) => {
if (!storeId.value && id) {
applyStoreId(id)
init()
}
})
}
})
onPageScroll((e) => {
@@ -531,7 +562,7 @@ onMounted(() => {
withShareTicket: true,
})
// #endif
init()
if (storeId.value) init()
})
</script>