| @@ -8,14 +8,15 @@ const SELECT_TYPE = { | |||||
| IMAGE: 1, | IMAGE: 1, | ||||
| VIDEO: 2, | VIDEO: 2, | ||||
| }; | }; | ||||
| let timer = null | |||||
| Page({ | Page({ | ||||
| data: { | data: { | ||||
| showtoast: false, | |||||
| showOverlay: true, | showOverlay: true, | ||||
| showSelect: false, | showSelect: false, | ||||
| SELECT_TYPE: SELECT_TYPE, | SELECT_TYPE: SELECT_TYPE, | ||||
| selectType: 0, | selectType: 0, | ||||
| //CRS配置 | //CRS配置 | ||||
| config: { | config: { | ||||
| apiKey: 'a9abd99b2dfb3a5bee964cbb0bced0ae', // EasyAR开发中心 - API KEY - API Key | apiKey: 'a9abd99b2dfb3a5bee964cbb0bced0ae', // EasyAR开发中心 - API KEY - API Key | ||||
| @@ -50,16 +51,15 @@ Page({ | |||||
| last: undefined, | last: undefined, | ||||
| onLoad: function () { | onLoad: function () { | ||||
| this.daojishi() // 默认进入页面10S后退出 | this.daojishi() // 默认进入页面10S后退出 | ||||
| }, | }, | ||||
| onReady: function () { | onReady: function () { | ||||
| if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发 | if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发 | ||||
| this.onCameraInit(); | this.onCameraInit(); | ||||
| } | } | ||||
| // 获取token | // 获取token | ||||
| this.queryToken().then(msg => { | this.queryToken().then(msg => { | ||||
| console.log('token1') | |||||
| console.log(msg) | console.log(msg) | ||||
| this.data.config.token = msg; | this.data.config.token = msg; | ||||
| }).catch(err => { | }).catch(err => { | ||||
| @@ -67,27 +67,32 @@ Page({ | |||||
| }); | }); | ||||
| }, | }, | ||||
| onHide(){ | onHide(){ | ||||
| console.log('tuichu') | |||||
| clearInterval(timer); | 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); | clearInterval(timer); | ||||
| wx.navigateBack({ | wx.navigateBack({ | ||||
| delta: 1, | delta: 1, | ||||
| }) | }) | ||||
| } | } | ||||
| }, 1000) | }, 1000) | ||||
| }, | |||||
| }, | |||||
| showLoading(text) { | showLoading(text) { | ||||
| this.setData({ | this.setData({ | ||||
| showLoading: true, | showLoading: true, | ||||
| @@ -15,6 +15,7 @@ | |||||
| </view> | </view> | ||||
| </view> --> | </view> --> | ||||
| <view id="loading" wx:if="{{showLoading}}"> | <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="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="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> | <image id="logoscan3" class="logoscan3" mode="widthFix" src="https://static.quhouse.com/a4e924b079ed42f49f22b390d0651876.png"></image> | ||||
| @@ -159,4 +159,14 @@ camera { | |||||
| .selected { | .selected { | ||||
| color: black; | color: black; | ||||
| background: linear-gradient(90deg, #ABABAB 0%, #D6D6D6 50%, #ABABAB 100%); | 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; | |||||
| } | } | ||||
| @@ -12,8 +12,12 @@ Page({ | |||||
| tabindex() { | tabindex() { | ||||
| let userInfo = getApp().globalData.userInfo | let userInfo = getApp().globalData.userInfo | ||||
| console.log(userInfo) | console.log(userInfo) | ||||
| let id = 0 | |||||
| if(userInfo.phone){ | |||||
| id = userInfo.id | |||||
| } | |||||
| wx.navigateTo({ | 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() { | tabsaoma() { | ||||
| @@ -2,7 +2,7 @@ | |||||
| <view class="container"> | <view class="container"> | ||||
| <view class="cont"> | <view class="cont"> | ||||
| <image class="sanjiao" src="https://static.quhouse.com/dbc18bc151dc4e839fb9cbe7e3d1d49e.png"></image> | <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="search" src="https://static.quhouse.com/72cac48d2d804744bd83a2a882713a6f.png"></image> | ||||
| <image class="logo" src="https://static.quhouse.com/fecdef9ed6a045aaade3d48980e33a35.png"></image> | <image class="logo" src="https://static.quhouse.com/fecdef9ed6a045aaade3d48980e33a35.png"></image> | ||||
| <view class="btn" bindtap="shouquan">微信一键授权</view> | <view class="btn" bindtap="shouquan">微信一键授权</view> | ||||
| @@ -28,9 +28,9 @@ | |||||
| height: 44rpx; | height: 44rpx; | ||||
| } | } | ||||
| .title{ | .title{ | ||||
| width: 550rpx; | |||||
| height: 176rpx; | |||||
| margin-bottom: 56rpx; | |||||
| width: 576rpx; | |||||
| height: 122rpx; | |||||
| margin-bottom: 66rpx; | |||||
| } | } | ||||
| .logo{ | .logo{ | ||||
| width: 542rpx; | width: 542rpx; | ||||
| @@ -70,7 +70,7 @@ Page({ | |||||
| console.log(e) | console.log(e) | ||||
| this.shareFun() | this.shareFun() | ||||
| return { | return { | ||||
| title: '万套特惠房源5折起iPhone13 Pro Max免费赢', | |||||
| title: '万套房源5折起iPhone13 Pro Max免费赢', | |||||
| imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', | imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', | ||||
| path: '/pages/index/index' | path: '/pages/index/index' | ||||
| } | } | ||||