完善小程序
This commit is contained in:
@@ -30,9 +30,28 @@
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
ref,
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue'
|
||||
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
|
||||
import {
|
||||
Storelogin
|
||||
} from '@/stores/user.js';
|
||||
|
||||
// 获取全局属性
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance();
|
||||
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
|
||||
const otherNum = ref('')
|
||||
|
||||
const numIndex = ref(0)
|
||||
@@ -82,6 +101,28 @@
|
||||
uni.cache.set('dinersNum', dinersNum.value)
|
||||
uni.pro.redirectTo('product/index')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await proxy.$onLaunched;
|
||||
// 获取当前页面栈
|
||||
const pages = getCurrentPages();
|
||||
// 获取当前页面实例
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const options = currentPage.options;
|
||||
// #ifdef MP-WEIXIN
|
||||
if (options.q) {
|
||||
console.log(options.q)
|
||||
const store = productStore();
|
||||
await store.scanCodeactions(options.q)
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (getApp().globalData.tableCode) {
|
||||
await store.scanCodeactions(getApp().globalData.tableCode)
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user