Browse Source

修改扫码倒计时问题

dev
corala 3 years ago
parent
commit
27f269f511
7 changed files with 41 additions and 21 deletions
  1. +20
    -15
      pages/AR/index.js
  2. +1
    -0
      pages/AR/index.wxml
  3. +10
    -0
      pages/AR/index.wxss
  4. +5
    -1
      pages/index/index.js
  5. +1
    -1
      pages/login/index.wxml
  6. +3
    -3
      pages/login/index.wxss
  7. +1
    -1
      pages/share/index.js

+ 20
- 15
pages/AR/index.js View File

@@ -8,14 +8,15 @@ const SELECT_TYPE = {
IMAGE: 1,
VIDEO: 2,
};
let timer = null

Page({
data: {
showtoast: false,
showOverlay: true,
showSelect: false,
SELECT_TYPE: SELECT_TYPE,
selectType: 0,

//CRS配置
config: {
apiKey: 'a9abd99b2dfb3a5bee964cbb0bced0ae', // EasyAR开发中心 - API KEY - API Key
@@ -50,16 +51,15 @@ Page({
last: undefined,

onLoad: function () {
this.daojishi() // 默认进入页面10S后退出
},
onReady: function () {
if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发
this.onCameraInit();
}

// 获取token
this.queryToken().then(msg => {
console.log('token1')
console.log(msg)
this.data.config.token = msg;
}).catch(err => {
@@ -67,27 +67,32 @@ Page({
});
},
onHide(){
console.log('tuichu')
clearInterval(timer);
this.setData({
runningCrs: false
})
},
daojishi(){
var t = 10;
var timer = setInterval(function(){
t--;
if(t<2){
wx.showToast({
icon: 'none',
title: '扫描时间过长,请退出后重新扫描!',
})
daojishi: function(){
let that = this
let seconds = 10
timer = setInterval(function(){
seconds--;
if(seconds<2){
that.setData({
showtoast: true
})
}
if(t<0){
if(seconds<0){
that.setData({
showtoast: false
})
clearInterval(timer);
wx.navigateBack({
delta: 1,
})
}
}, 1000)
},
},
showLoading(text) {
this.setData({
showLoading: true,


+ 1
- 0
pages/AR/index.wxml View File

@@ -15,6 +15,7 @@
</view>
</view> -->
<view id="loading" wx:if="{{showLoading}}">
<view class="toast" wx:if="{{showtoast}}">扫描时间过长,请退出后重新扫描!</view>
<image id="logoscan1" class="logoscan1" mode="widthFix" src="https://static.quhouse.com/55294240277f443fac7e7190224e7b44.png"></image>
<image id="logoscan2" class="logoscan2" mode="widthFix" src="https://static.quhouse.com/8c7d146f447546cea00776f3893237e8.png"></image>
<image id="logoscan3" class="logoscan3" mode="widthFix" src="https://static.quhouse.com/a4e924b079ed42f49f22b390d0651876.png"></image>


+ 10
- 0
pages/AR/index.wxss View File

@@ -159,4 +159,14 @@ camera {
.selected {
color: black;
background: linear-gradient(90deg, #ABABAB 0%, #D6D6D6 50%, #ABABAB 100%);
}
.toast{
height: 70rpx;
line-height: 70rpx;
font-size: 28rpx;
color: #fff;
background-color: rgba(0, 0, 0, 0.7);
border-radius: 8rpx;
margin: 300rpx auto 0;
padding: 0 20rpx;
}

+ 5
- 1
pages/index/index.js View File

@@ -12,8 +12,12 @@ Page({
tabindex() {
let userInfo = getApp().globalData.userInfo
console.log(userInfo)
let id = 0
if(userInfo.phone){
id = userInfo.id
}
wx.navigateTo({
url: '/pages/out/index?index=1&userid=' + userInfo.id + '&gameid=1'+ '&type=' + 1
url: '/pages/out/index?index=1&userid=' + id+ '&gameid=1&type=1'
})
},
tabsaoma() {


+ 1
- 1
pages/login/index.wxml View File

@@ -2,7 +2,7 @@
<view class="container">
<view class="cont">
<image class="sanjiao" src="https://static.quhouse.com/dbc18bc151dc4e839fb9cbe7e3d1d49e.png"></image>
<image class="title" src="https://static.quhouse.com/16d6832f581e4c4ba12b7fe4bb42fce6.png"></image>
<image class="title" src="https://static.quhouse.com/2a8f0df894f74d74befba9006c704789.png"></image>
<image class="search" src="https://static.quhouse.com/72cac48d2d804744bd83a2a882713a6f.png"></image>
<image class="logo" src="https://static.quhouse.com/fecdef9ed6a045aaade3d48980e33a35.png"></image>
<view class="btn" bindtap="shouquan">微信一键授权</view>


+ 3
- 3
pages/login/index.wxss View File

@@ -28,9 +28,9 @@
height: 44rpx;
}
.title{
width: 550rpx;
height: 176rpx;
margin-bottom: 56rpx;
width: 576rpx;
height: 122rpx;
margin-bottom: 66rpx;
}
.logo{
width: 542rpx;


+ 1
- 1
pages/share/index.js View File

@@ -70,7 +70,7 @@ Page({
console.log(e)
this.shareFun()
return {
title: '万套特惠房源5折起iPhone13 Pro Max免费赢',
title: '万套房源5折起iPhone13 Pro Max免费赢',
imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png',
path: '/pages/index/index'
}


Loading…
Cancel
Save