|
@@ -349,7 +349,10 @@
|
|
|
v-if="isShowGamePage"
|
|
|
class="game-box"
|
|
|
>
|
|
|
- <iframe :src="`./game/index.html`" />
|
|
|
+ <iframe
|
|
|
+ id="gameIframe"
|
|
|
+ :src="`./game/index.html`"
|
|
|
+ />
|
|
|
<!-- edit弹框 -->
|
|
|
<div
|
|
|
v-if="isShowToastFromGame"
|
|
@@ -388,7 +391,10 @@
|
|
|
>
|
|
|
取消
|
|
|
</div>
|
|
|
- <div class="yes-btn">
|
|
|
+ <div
|
|
|
+ class="yes-btn"
|
|
|
+ @click="saveTitle"
|
|
|
+ >
|
|
|
保存
|
|
|
</div>
|
|
|
</div>
|
|
@@ -471,12 +477,24 @@ const checkInput2 = (event) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+const saveTitle = () => {
|
|
|
+ var iframe = document.getElementById('gameIframe')
|
|
|
+ var iframeWindow = iframe.contentWindow || window.frames['yourIframeId']
|
|
|
+ if (iframeWindow) {
|
|
|
+ iframeWindow.saveTitle(input1.value.length >= 7 ? input1.value + '\n' + input2.value : input1.value )
|
|
|
+ isShowToastFromGame.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
window.closeGame = () => {
|
|
|
isShowGamePage.value = false
|
|
|
}
|
|
|
+
|
|
|
+ window.isShowToastFromGame = () =>{
|
|
|
+ isShowToastFromGame.value = true
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
|
|
|
const {
|
|
@@ -489,6 +507,31 @@ const windowHeightDesign = 844
|
|
|
|
|
|
const scrollTarget = ref(null)
|
|
|
const { width: windowWidth, height: windowHeight } = useWindowSize()
|
|
|
+
|
|
|
+const time = ref()
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // windowWidth.value = document.documentElement.clientWidth
|
|
|
+ // windowHeight.value = document.documentElement.clientHeight
|
|
|
+ window.addEventListener(
|
|
|
+ "resize",
|
|
|
+ () => {
|
|
|
+ //@ts-ignore
|
|
|
+ clearTimeout(time.value)
|
|
|
+ //@ts-ignore
|
|
|
+ time.value = window.setTimeout(() => {
|
|
|
+ // 根元素
|
|
|
+ const dom = document.querySelector("#app")
|
|
|
+ if (dom && document.documentElement.clientWidth < 1000) {
|
|
|
+ dom.style.height = document.documentElement.clientHeight + "px"
|
|
|
+ dom.style.width = document.documentElement.clientWidth + "px"
|
|
|
+
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+ },
|
|
|
+ true
|
|
|
+ )
|
|
|
+})
|
|
|
const maxTranslateLength = computed(() => {
|
|
|
return windowHeight.value * windowWidthDesign / windowHeightDesign
|
|
|
})
|
|
@@ -497,9 +540,9 @@ const { onSwipeLeft, onswipeRight, haveSwipedThisTime, translateLength, currentA
|
|
|
maxTranslateLength,
|
|
|
viewportWidth: windowWidth,
|
|
|
anchorPosList: [
|
|
|
- maxTranslateLength.value * 216 / windowWidthDesign - windowWidth.value / 2,
|
|
|
+ maxTranslateLength.value * 236 / windowWidthDesign - windowWidth.value / 2,
|
|
|
maxTranslateLength.value * 967 / windowWidthDesign - windowWidth.value / 2,
|
|
|
- maxTranslateLength.value * 1860 / windowWidthDesign - windowWidth.value / 2,
|
|
|
+ maxTranslateLength.value * 1840 / windowWidthDesign - windowWidth.value / 2,
|
|
|
// maxTranslateLength.value - windowWidth.value
|
|
|
],
|
|
|
initialAnchorIdx: Number(route.query.anchorIdx) || 0
|