原先团购处理

This commit is contained in:
2024-06-05 22:20:18 +08:00
parent 4545fbfab5
commit dbd3800314
5 changed files with 39 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
<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>