ソースを参照

添加扫描倒计时

dev
corala 3年前
コミット
224d1ac04a
3個のファイルの変更26行の追加6行の削除
  1. +1
    -1
      app.json
  2. +21
    -1
      pages/AR/index.js
  3. +4
    -4
      pages/out/index.js

+ 1
- 1
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",


+ 21
- 1
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,


+ 4
- 4
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 () {

},
/**
* 生命周期函数--监听页面隐藏
*/


読み込み中…
キャンセル
保存