zzd
This commit is contained in:
1 parent
22e0aaf610
commit
4df8ee27da
2 files changed
+18
-3
No files matched your search
+5
-1
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { getLaunchParam } from "@/sheep/utils/app"
|
||||
import { getLaunchParam, getUrlQueryParam } from "@/sheep/utils/app"
|
||||
import { getAppInfo } from "@@/utils/app"
|
||||
import { APPENV } from "./sheep/constant"
|
||||
|
||||
@@ -166,6 +166,10 @@ const setTabbar = (launchParam?: string, auth?: string) => {
|
||||
export default {
|
||||
async onLaunch() {
|
||||
try {
|
||||
const lp = getUrlQueryParam("launchParam")
|
||||
if (lp) {
|
||||
uni.setStorageSync("launchParam", lp)
|
||||
}
|
||||
const { tryZzdEntryLogin } = await import("@/sheep/utils/request")
|
||||
await tryZzdEntryLogin()
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { APPENV } from "@/sheep/constant"
|
||||
import { getAppInfo, getLaunchParam, isDevEnv } from "@/sheep/utils/app"
|
||||
import { getAppInfo, getLaunchParam, getUrlQueryParam, isDevEnv } from "@/sheep/utils/app"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
|
||||
const moduleList = [
|
||||
@@ -61,7 +61,10 @@ const moduleList = [
|
||||
]
|
||||
|
||||
onShow(() => {
|
||||
uni.removeStorageSync("launchParam")
|
||||
const fromUrl = getUrlQueryParam("launchParam")
|
||||
if (fromUrl) {
|
||||
uni.setStorageSync("launchParam", fromUrl)
|
||||
}
|
||||
jumpByParam()
|
||||
})
|
||||
|
||||
@@ -75,6 +78,9 @@ const jumpByParam = async () => {
|
||||
const zzdR = await tryZzdEntryLogin()
|
||||
if (zzdR !== "ok") return
|
||||
switch (launchParam) {
|
||||
case "thirdApp":
|
||||
uni.setStorageSync("launchParam", launchParam)
|
||||
return uni.reLaunch({ url: "/pages/thirdApp/happyMall" })
|
||||
case "canteen": // 食堂
|
||||
uni.setStorageSync("launchParam", launchParam)
|
||||
uni.switchTab({ url: "/pages/tabbar/canteen" })
|
||||
@@ -104,6 +110,11 @@ const jumpByParam = async () => {
|
||||
uni.switchTab({ url: "/pages/tabbar/prosperityShopMchList" })
|
||||
break
|
||||
default:
|
||||
if (!launchParam) {
|
||||
uni.showToast({ title: "缺少入口参数,请从工作台重新进入", icon: "none", duration: 3500 })
|
||||
} else {
|
||||
uni.showToast({ title: "暂不支持的入口:" + launchParam, icon: "none", duration: 3500 })
|
||||
}
|
||||
uni.hideTabBar()
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user