fix
This commit is contained in:
parent
15fc542f6f
commit
511a73f92f
@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onBeforeMount } from "vue";
|
import { ref, reactive, onBeforeMount } from "vue";
|
||||||
import { closeWebview, runTimeEnv } from "../../../utils/index.js";
|
import { closeWebview } from "../../../utils/index.js";
|
||||||
|
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
@ -134,6 +134,14 @@ const doneSet = async () => {
|
|||||||
const backScan = () => {
|
const backScan = () => {
|
||||||
closeWebview();
|
closeWebview();
|
||||||
};
|
};
|
||||||
|
const runTimeEnv = () => {
|
||||||
|
if (plus) {
|
||||||
|
const currentWebView = plus.webview.getWebviewById("wv");
|
||||||
|
return currentWebView.RunTime === "app";
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -98,7 +98,7 @@ import { ref, reactive, onBeforeMount } from "vue";
|
|||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
import { creChangepainting, add } from "@/api/login.js";
|
import { creChangepainting, add } from "@/api/login.js";
|
||||||
import { closeWebview, runTimeEnv } from "../../../utils/index";
|
import { closeWebview } from "../../../utils/index";
|
||||||
|
|
||||||
const { showMessage } = useToast();
|
const { showMessage } = useToast();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@ -235,6 +235,16 @@ const enlarge = (src) => {
|
|||||||
const backScan = () => {
|
const backScan = () => {
|
||||||
closeWebview();
|
closeWebview();
|
||||||
};
|
};
|
||||||
|
const runTimeEnv = () => {
|
||||||
|
try {
|
||||||
|
if (plus) {
|
||||||
|
const currentWebView = plus.webview.getWebviewById("wv");
|
||||||
|
return currentWebView.RunTime === "app";
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -53,7 +53,7 @@ import { ref, reactive, onBeforeMount } from "vue";
|
|||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { freebox, bind, check_freebox, cancel } from "@/api/login.js";
|
import { freebox, bind, check_freebox, cancel } from "@/api/login.js";
|
||||||
import { closeWebview, runTimeEnv } from "../../../utils/index";
|
import { closeWebview } from "../../../utils/index";
|
||||||
const { showMessage } = useToast();
|
const { showMessage } = useToast();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const isButtonDisabled = ref(false);
|
const isButtonDisabled = ref(false);
|
||||||
@ -141,6 +141,14 @@ const check = async () => {
|
|||||||
showMessage({ type: "error", message: res.msg });
|
showMessage({ type: "error", message: res.msg });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const runTimeEnv = () => {
|
||||||
|
if (plus) {
|
||||||
|
const currentWebView = plus.webview.getWebviewById("wv");
|
||||||
|
return currentWebView.RunTime === "app";
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
const currentWebView = plus.webview.getWebviewById("wv");
|
// export const runTimeEnv = () => {
|
||||||
|
// if (plus) {
|
||||||
|
// const currentWebView = plus.webview.getWebviewById("wv");
|
||||||
|
// return currentWebView.RunTime === "app";
|
||||||
|
// } else {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// };\
|
||||||
|
|
||||||
export const runTimeEnv = () => {
|
export const closeWebview = () => {
|
||||||
if (plus) {
|
try {
|
||||||
return currentWebView.RunTime === "app";
|
const currentWebView = plus.webview.getWebviewById("wv");
|
||||||
} else {
|
currentWebView.close();
|
||||||
return false;
|
} catch (e) {
|
||||||
|
return () => {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export const closeWebview = () => {
|
|
||||||
currentWebView.close();
|
|
||||||
};
|
|
||||||
|
Loading…
Reference in New Issue
Block a user