|
@@ -180,9 +180,9 @@ const onIsCommentary = () => {
|
|
|
const enterVR = async () => {
|
|
|
if ("xr" in navigator) {
|
|
|
const session = await navigator.xr.requestSession("immersive-vr");
|
|
|
- console.error('支持')
|
|
|
+ console.error("支持");
|
|
|
} else {
|
|
|
- console.error('不支持')
|
|
|
+ console.error("不支持");
|
|
|
}
|
|
|
};
|
|
|
// 授权
|
|
@@ -195,7 +195,7 @@ const $iosGrantedTips = (cb) => {
|
|
|
var arr = version.split(".");
|
|
|
console.log(arr);
|
|
|
if (arr[0] > 12 && arr[1] >= 0) {
|
|
|
- if (typeof DeviceMotionEvent !=='undefined' && typeof DeviceMotionEvent.requestPermission ==='function') {
|
|
|
+ if (typeof DeviceMotionEvent !== "undefined" && typeof DeviceMotionEvent.requestPermission === "function") {
|
|
|
DeviceMotionEvent.requestPermission().then((permissionState) => {
|
|
|
console.log("存在-permissionState", permissionState);
|
|
|
if (permissionState == "granted") {
|
|
@@ -241,14 +241,14 @@ const $iosGrantedTips = (cb) => {
|
|
|
// };
|
|
|
const onVR = () => {
|
|
|
$iosGrantedTips((data) => {
|
|
|
- console.log(data,vrStatus.value);
|
|
|
+ console.log(data, vrStatus.value);
|
|
|
if (data.code == 1) {
|
|
|
store.commit("functions/setVrStatus", !vrStatus.value);
|
|
|
if (currentScene.value.type == "pano") {
|
|
|
+ console.log(1, vrStatus.value);
|
|
|
useApp().then((app) => {
|
|
|
- app.krpanoDom.call(
|
|
|
- vrStatus.value ? "webvr.enterVR()" : "webvr.exitVR()"
|
|
|
- );
|
|
|
+ console.log(2, vrStatus.value);
|
|
|
+ app.krpanoDom.call(vrStatus.value ? "webvr.enterVR()" : "webvr.exitVR()");
|
|
|
});
|
|
|
} else {
|
|
|
if (fdkkCurrentVersion.value == "V4") {
|
|
@@ -276,9 +276,7 @@ const onVR = () => {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- Dialog.alert(
|
|
|
- "运动和方向访问失败,您需要完全关闭此应用,然后再次打开,并允许访问运动与方向"
|
|
|
- );
|
|
|
+ Dialog.alert("运动和方向访问失败,您需要完全关闭此应用,然后再次打开,并允许访问运动与方向");
|
|
|
}
|
|
|
});
|
|
|
};
|