mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-11-14 04:48:55 +08:00
feat: 更新预约功能与礼品卡支持
- 新增礼品卡页面,支持礼品卡的选择与使用。 - 调整预约下单流程,增强预约信息展示与用户交互。 - 更新支付成功页面的导航逻辑,确保用户体验流畅。 - 优化搜索页面的历史关键词加载逻辑,提升性能。
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user