feat: 增加获取位置的方法
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { ref, onUnmounted } from "vue";
|
||||
import { ref, onUnmounted, onMounted } from "vue";
|
||||
import { getUrlParams } from "@/utils/UrlParams";
|
||||
import { useAppStore } from "@/store";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
@@ -31,7 +31,7 @@ import DrawerSection from "../DrawerSection/index.vue";
|
||||
import Calender from "@/components/Calender/index.vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
|
||||
const locationStore = useLocationStore();
|
||||
const calendarVisible = ref(false);
|
||||
const selectedDate = ref("");
|
||||
|
||||
@@ -52,14 +52,6 @@ uni.$on("openCalendar", () => {
|
||||
calendarVisible.value = true;
|
||||
});
|
||||
|
||||
const getWeixinMiniProgramParams = (e) => {
|
||||
console.log("Params:", e);
|
||||
if (e.q && e.q != "undefined") {
|
||||
const qrUrl = decodeURIComponent(e.q); // 获取到二维码原始链接内容
|
||||
const params = getUrlParams(qrUrl);
|
||||
appStore.setSceneId(params.sceneId || params.tagId);
|
||||
}
|
||||
};
|
||||
|
||||
// 打开窗口
|
||||
const drawerRef = ref(null);
|
||||
@@ -68,19 +60,32 @@ const showDrawer = async (e) => {
|
||||
|
||||
drawerRef.value.open();
|
||||
};
|
||||
|
||||
uni.$on("SHOW_DRAWER", showDrawer);
|
||||
|
||||
// 关闭窗口
|
||||
const closeDrawer = (e) => drawerRef.value.close();
|
||||
|
||||
///获取到二维码原始链接内容
|
||||
const getWeixinMiniProgramParams = (e) => {
|
||||
console.log("Params:", e);
|
||||
if (e.q && e.q != "undefined") {
|
||||
const qrUrl = decodeURIComponent(e.q);
|
||||
const params = getUrlParams(qrUrl);
|
||||
appStore.setSceneId(params.sceneId || params.tagId);
|
||||
}
|
||||
};
|
||||
|
||||
onLoad((e) => {
|
||||
getWeixinMiniProgramParams(e);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
// uni.$off('openCalendar')
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user