完善小程序

This commit is contained in:
wwz
2025-03-18 18:29:34 +08:00
parent fc957feb72
commit 9da31e2faa
19 changed files with 594 additions and 352 deletions

View File

@@ -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">