Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
panyongping
uni-pdtravel
Commits
dbdc1c5d
Commit
dbdc1c5d
authored
Apr 04, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加亮度
parent
a2ea0cf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
60 deletions
+34
-60
electronicTicket.vue
pages/my/order/electronicTicket/electronicTicket.vue
+34
-60
No files found.
pages/my/order/electronicTicket/electronicTicket.vue
View file @
dbdc1c5d
...
...
@@ -418,8 +418,6 @@
codeStart
:
''
,
//开始时间
codes
:[],
//我二维码数组
percentage
:
0
,
//进度条百分比
percentpage
:
0
,
percentType
:
true
,
orderExtendList
:[],
//订单拓展信息
touristInfo
:[],
//游客信息
orderTypeNum
:
1
,
//订单是否展开
...
...
@@ -477,7 +475,7 @@
this
.
timer2
=
null
}
uni
.
setScreenBrightness
({
// 恢复之前屏幕亮度
value
:
this
.
Brightness
value
:
this
.
Brightness
})
},
methods
:
{
...
...
@@ -655,68 +653,44 @@
let
now
=
new
Date
().
getTime
()
let
nowTime
=
(
now
-
this
.
codeStart
)
/
1000
let
code
=
null
// // 寻找到当前时间的二维码
// for(let i = 0 ; i
<
codes
.
length
;
i
++
){
// let item = codes[i]
// nowTime -= item.timeout
// if(nowTime
<=
0
){
// code = item
// 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
})
// 寻找到当前时间的二维码
for
(
let
i
=
0
;
i
<
codes
.
length
;
i
++
){
let
item
=
codes
[
i
]
nowTime
-=
item
.
timeout
if
(
nowTime
<=
0
){
code
=
item
break
}
}
// if(code == null){
// this.dynamicCode()
// } else if( code.code!=this.codeNo ){
// this.codeNo = code.code
// // if(document.querySelector('#qrcode img')){//移除子元素
// // document.querySelector('#qrcode img').remove()
// // document.querySelector('#qrcode canvas').remove()
// // }
// // let qrcode = new QRCode('qrcode',{//进入先获取二维码
// // width: 180,
// // height: 180,
// // text:this.codeNo
// // })
// 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
()
}
else
if
(
code
.
code
!=
this
.
codeNo
){
this
.
codeNo
=
code
.
code
// if(document.querySelector('#qrcode img')){//移除子元素
// document.querySelector('#qrcode img').remove()
// document.querySelector('#qrcode canvas').remove()
// }
// let qrcode = new QRCode('qrcode',{//进入先获取二维码
// width: 180,
// height: 180,
// text:this.codeNo
// })
uQRCode
.
make
({
canvasId
:
'qrcode'
,
componentInstance
:
this
,
text
:
this
.
codeNo
,
size
:
180
,
margin
:
10
,
backgroundColor
:
'#ffffff'
,
foregroundColor
:
'#000000'
,
fileType
:
'jpg'
,
errorCorrectLevel
:
uQRCode
.
errorCorrectLevel
.
H
})
}
this
.
percentage
+=
1
if
(
this
.
percentage
>=
100
){
this
.
percentage
=
0
this
.
percentpage
++
this
.
percentType
=
true
}
},
dynamicCode
(){
//动态码
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment