第三方app跳转
This commit is contained in:
1 parent
06f5ebd9be
commit
dee8d2e21f
6 files changed
+81
-27
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { defineProps, computed } from "vue"
|
||||
import { computed } from "vue"
|
||||
import { router } from "@@/index"
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { defineProps, computed } from "vue"
|
||||
import { computed } from "vue"
|
||||
import { router } from "@@/index"
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { defineProps, withDefaults } from "vue";
|
||||
import { withDefaults } from "vue"
|
||||
|
||||
export interface Props {
|
||||
type: "top" | "bottom";
|
||||
bgColor: string;
|
||||
type: "top" | "bottom"
|
||||
bgColor: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
type: "top",
|
||||
bgColor: "transparent",
|
||||
});
|
||||
type: "top",
|
||||
bgColor: "transparent",
|
||||
})
|
||||
|
||||
function getHeight() {
|
||||
const { top, bottom } = uni.getSystemInfoSync().safeAreaInsets!;
|
||||
if (props.type && props.type === "bottom") {
|
||||
return bottom + "px";
|
||||
}
|
||||
return top + "px";
|
||||
const { top, bottom } = uni.getSystemInfoSync().safeAreaInsets!
|
||||
if (props.type && props.type === "bottom") {
|
||||
return bottom + "px"
|
||||
}
|
||||
return top + "px"
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="safe" :style="{ backgroundColor: props.bgColor, height: getHeight() }"></view>
|
||||
<view class="safe" :style="{ backgroundColor: props.bgColor, height: getHeight() }"></view>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.safe-top {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
// 获取启动参数
|
||||
const getLaunchParam = (): "canteen" | "selfMerchant" | "coopMerchant" | null => {
|
||||
return new URL(window.location.href).searchParams.get("launchParam") as "canteen" | "selfMerchant" | "coopMerchant" | null
|
||||
const getLaunchParam = (): "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null => {
|
||||
return new URL(window.location.href).searchParams.get("launchParam") as "canteen" | "selfMerchant" | "coopMerchant" | "thirdApp" | null
|
||||
}
|
||||
|
||||
export default getLaunchParam
|
||||
Reference in new issue
Block a user