Commit dbdc1c5d authored by qipeng's avatar qipeng

增加亮度

parent a2ea0cf0
...@@ -418,8 +418,6 @@ ...@@ -418,8 +418,6 @@
codeStart:'',//开始时间 codeStart:'',//开始时间
codes:[],//我二维码数组 codes:[],//我二维码数组
percentage:0,//进度条百分比 percentage:0,//进度条百分比
percentpage:0,
percentType:true,
orderExtendList:[],//订单拓展信息 orderExtendList:[],//订单拓展信息
touristInfo:[],//游客信息 touristInfo:[],//游客信息
orderTypeNum:1,//订单是否展开 orderTypeNum:1,//订单是否展开
...@@ -477,7 +475,7 @@ ...@@ -477,7 +475,7 @@
this.timer2 = null this.timer2 = null
} }
uni.setScreenBrightness({// 恢复之前屏幕亮度 uni.setScreenBrightness({// 恢复之前屏幕亮度
value: this.Brightness value: this.Brightness
}) })
}, },
methods: { methods: {
...@@ -655,68 +653,44 @@ ...@@ -655,68 +653,44 @@
let now = new Date().getTime() let now = new Date().getTime()
let nowTime = (now - this.codeStart)/1000 let nowTime = (now - this.codeStart)/1000
let code = null let code = null
// // 寻找到当前时间的二维码 // 寻找到当前时间的二维码
// for(let i = 0 ; i < codes.length ; i++ ){ for(let i = 0 ; i < codes.length ; i++ ){
// let item = codes[i] let item = codes[i]
// nowTime -= item.timeout nowTime -= item.timeout
// if(nowTime <= 0 ){ if(nowTime <= 0 ){
// code = item code = item
// break break
// }
// }
// 全部遍历完成后,需要重新获取新的二维码
if(this.percentType==true){
if(this.percentpage>=codes.length){
this.percentpage = 0
code = null
this.dynamicCode();
}else{
code = codes[this.percentpage]
this.codeNo = code.code
this.percentType=false
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
text: this.codeNo,
size: 180,
margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H
})
} }
} }
// if(code == null){ // 全部遍历完成后,需要重新获取新的二维码
// this.dynamicCode() if(code == null){
// } else if( code.code!=this.codeNo ){ this.dynamicCode()
// this.codeNo = code.code } else if( code.code!=this.codeNo ){
// // if(document.querySelector('#qrcode img')){//移除子元素 this.codeNo = code.code
// // document.querySelector('#qrcode img').remove() // if(document.querySelector('#qrcode img')){//移除子元素
// // document.querySelector('#qrcode canvas').remove() // document.querySelector('#qrcode img').remove()
// // } // document.querySelector('#qrcode canvas').remove()
// // let qrcode = new QRCode('qrcode',{//进入先获取二维码 // }
// // width: 180, // let qrcode = new QRCode('qrcode',{//进入先获取二维码
// // height: 180, // width: 180,
// // text:this.codeNo // height: 180,
// // }) // text:this.codeNo
// uQRCode.make({ // })
// canvasId: 'qrcode', uQRCode.make({
// componentInstance: this, canvasId: 'qrcode',
// text: this.codeNo, componentInstance: this,
// size: 180, text: this.codeNo,
// margin: 10, size: 180,
// backgroundColor: '#ffffff', margin: 10,
// foregroundColor: '#000000', backgroundColor: '#ffffff',
// fileType: 'jpg', foregroundColor: '#000000',
// errorCorrectLevel: uQRCode.errorCorrectLevel.H fileType: 'jpg',
// }) errorCorrectLevel: uQRCode.errorCorrectLevel.H
// } })
}
this.percentage+=1 this.percentage+=1
if(this.percentage>=100){ if(this.percentage>=100){
this.percentage=0 this.percentage=0
this.percentpage++
this.percentType=true
} }
}, },
dynamicCode(){//动态码 dynamicCode(){//动态码
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment