Files
suke-mp/src/pages/coupons/ticketsBuy/ticketsBuy.vue
2024-06-05 22:20:18 +08:00

30 lines
681 B
Vue

<template>
</template>
<script lang='ts' setup>
onLoad((options) => {
getApp().logger?.info('ticketsBuy options: ', options);
let couponId = options?.couponsId;
if(options?.query && couponId == undefined) {
const params = decodeURIComponent(options?.query);
couponId = getQueryParam(params, 'couponsId');
}
setTimeout(() => {
uni.reLaunch({
url: `/pages/common/groupbuy/detail?id=${couponId}`
});
}, 300);
});
function getQueryParam(queryParams: string, key: string) {
let regex = new RegExp('(?:[?&]|^)' + key + '=([^&]+)'),
match = queryParams.match(regex);
return match && match[1];
}
</script>
<style lang='scss' scoped>
</style>