diff --git a/pages/experience-coupon/claim.vue b/pages/experience-coupon/claim.vue index 5e22f25..ffc21bc 100644 --- a/pages/experience-coupon/claim.vue +++ b/pages/experience-coupon/claim.vue @@ -215,7 +215,25 @@ async function bootstrap() { } } -onLoad((options = {}) => { +function parseOptions(options = {}) { + const href = typeof options.q === "string" ? decodeURIComponent(options.q) : ""; + const [, url = ""] = href.split("?"); + return url.split("&").reduce((acc, cur) => { + if (!cur) return acc; + const [key, val = ''] = cur.split("="); + if (!key) return acc; + acc[key] = val + return acc; + }, {}); +} + +onLoad((opts = {}) => { + let options = {}; + if (opts.q) { + options = { ...parseOptions(opts) } + } else { + options = { ...opts } + } corpId.value = normalizeCorpId(options.corpId || ""); issueId.value = options.issueId || options.id || ""; memberId.value = options.memberId || options.customerId || ""; @@ -249,6 +267,7 @@ onShow(() => { font-size: 28rpx; color: #999; } + .poster-mask { position: fixed; inset: 0;