Selaa lähdekoodia

添加扫描倒计时

dev
corala 3 vuotta sitten
vanhempi
commit
224d1ac04a
3 muutettua tiedostoa jossa 26 lisäystä ja 6 poistoa
  1. +1
    -1
      app.json
  2. +21
    -1
      pages/AR/index.js
  3. +4
    -4
      pages/out/index.js

+ 1
- 1
app.json Näytä tiedosto

@@ -1,7 +1,7 @@
{ {
"pages": [ "pages": [
"pages/login/index",
"pages/index/index", "pages/index/index",
"pages/login/index",
"pages/out/index", "pages/out/index",
"pages/middle/index", "pages/middle/index",
"pages/rank/index", "pages/rank/index",


+ 21
- 1
pages/AR/index.js Näytä tiedosto

@@ -50,6 +50,7 @@ Page({
last: undefined, last: undefined,


onLoad: function () { onLoad: function () {
this.daojishi() // 默认进入页面10S后退出
}, },
onReady: function () { onReady: function () {
if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发 if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发
@@ -65,7 +66,26 @@ Page({
console.info(err); 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) { showLoading(text) {
this.setData({ this.setData({
showLoading: true, showLoading: true,


+ 4
- 4
pages/out/index.js Näytä tiedosto

@@ -6,11 +6,11 @@ Page({
*/ */
data: { data: {
web:null, web:null,
index:0,
index:1,
userid: 0,// 用户ID userid: 0,// 用户ID
gameid: 0,// 游戏ID gameid: 0,// 游戏ID
type: 1, 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, type: options.type,
allurl: this.data.allurl +`?userid=${options.userid||0}&gameid=${options.gameid||0}&type=${options.type==2?2:1}` 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 () { onShow: function () {

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


Ladataan…
Peruuta
Tallenna