From 224d1ac04a342df53cca0307909e0d523b99dbdf Mon Sep 17 00:00:00 2001 From: corala <18339694416@163.com> Date: Mon, 25 Apr 2022 11:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=AB=E6=8F=8F=E5=80=92?= =?UTF-8?q?=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- pages/AR/index.js | 22 +++++++++++++++++++++- pages/out/index.js | 8 ++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/app.json b/app.json index d3e10b0..c99c57c 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/login/index", "pages/index/index", + "pages/login/index", "pages/out/index", "pages/middle/index", "pages/rank/index", diff --git a/pages/AR/index.js b/pages/AR/index.js index 58a9695..bf4b711 100644 --- a/pages/AR/index.js +++ b/pages/AR/index.js @@ -50,6 +50,7 @@ Page({ last: undefined, onLoad: function () { + this.daojishi() // 默认进入页面10S后退出 }, onReady: function () { if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发 @@ -65,7 +66,26 @@ Page({ console.info(err); }); }, - + daojishi(){ + var t = 10; + var timer = setInterval(function(){ + t--; + if(t==3){ + wx.showToast({ + icon: 'none', + title: '扫描次数过多', + }) + } + if(t<0){ + clearInterval(timer); + wx.navigateBack({ + delta: 1, + }) + } + console.log(t) + }, 1000) + + }, showLoading(text) { this.setData({ showLoading: true, diff --git a/pages/out/index.js b/pages/out/index.js index 19c6b1e..b26f0ca 100644 --- a/pages/out/index.js +++ b/pages/out/index.js @@ -6,11 +6,11 @@ Page({ */ data: { web:null, - index:0, + index:1, userid: 0,// 用户ID gameid: 0,// 游戏ID type: 1, - allurl: 'https://cloudcreategameoss.sxycy.games/pro/games/test/3d_dance' + allurl: 'https://cloudcreategameoss.sxycy.games/pro/games/test/3d_dance/' }, /** * 生命周期函数--监听页面加载 @@ -25,6 +25,7 @@ Page({ type: options.type, allurl: this.data.allurl +`?userid=${options.userid||0}&gameid=${options.gameid||0}&type=${options.type==2?2:1}` }) + console.log(this.data.allurl) }, /** @@ -38,9 +39,8 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - }, - + /** * 生命周期函数--监听页面隐藏 */