新增注册来源功能
This commit is contained in:
17
src/App.vue
17
src/App.vue
@ -2,9 +2,10 @@
|
||||
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { navigateToInterceptor } from '@/router/interceptor'
|
||||
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
|
||||
|
||||
import { useUserStore } from '@/store'
|
||||
import { strToParams } from '@/utils/tools'
|
||||
|
||||
onLaunch((options) => {
|
||||
// console.log("🚀 ~ onLaunch options:", options)
|
||||
// if (options?.path === 'bundle/order/tea-room/order-detail') {
|
||||
// uni.setStorageSync('transferOrder', {
|
||||
// orderId: options?.query?.orderId || '',
|
||||
@ -33,6 +34,18 @@
|
||||
shareSource: options?.query?.shareSource || ''
|
||||
})
|
||||
}
|
||||
|
||||
// 这里是设置用户场景类型的逻辑: 0 普通扫码进入 1 电梯扫码进入 2 充电宝扫码进入
|
||||
if (options?.query?.scene) {
|
||||
const scene = decodeURIComponent(options.query.scene)
|
||||
const params = strToParams(scene)
|
||||
if (params && params?.registerSource) {
|
||||
const userStore = useUserStore()
|
||||
userStore.setUserRegisterSource(Number(params.registerSource))
|
||||
console.log("🚀 ~ onShow registerSource =", userStore.userRegisterSource)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('App Show', options)
|
||||
})
|
||||
onHide(() => {
|
||||
|
||||
Reference in New Issue
Block a user