Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李宁
/
Activity
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 94f30c22
authored
Aug 28, 2025
by
李宁
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
fd91ce25
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
30 deletions
huaian/css/demo.css
huaian/demo.html
huaian/js/demo.js
huaian/js/lang.js
huaian/js/util.js
huaian/css/demo.css
View file @
94f30c2
...
@@ -329,10 +329,13 @@ html,body{
...
@@ -329,10 +329,13 @@ html,body{
outline
:
none
outline
:
none
}
}
.alertDiv
.inner
.errorTs
{
.alertDiv
.inner
.errorTs
{
color
:
#
F00
;
color
:
#
666
;
font-size
:
.26rem
;
font-size
:
.26rem
;
margin-top
:
.16rem
;
margin-top
:
.16rem
;
}
}
.alertDiv
.inner
.tsRed
{
color
:
#F00
;
}
.alertDiv
.inner
.bot
{
.alertDiv
.inner
.bot
{
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -744,8 +747,9 @@ html,body{
...
@@ -744,8 +747,9 @@ html,body{
margin-bottom
:
.2rem
;
margin-bottom
:
.2rem
;
}
}
.paiZhaoCon
img
{
.paiZhaoCon
img
{
width
:
3.76rem
;
/* width: 3.76rem;
/* height: 6.68rem; */
height: 6.68rem; */
width
:
100%
;
display
:
block
;
display
:
block
;
margin
:
auto
;
margin
:
auto
;
}
}
...
...
huaian/demo.html
View file @
94f30c2
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
江苏移动
</title>
<title>
江苏移动
</title>
<link
rel=
"stylesheet"
href=
"https://xpo.oss-cn-beijing.aliyuncs.com/huaian/css/vant.css"
/>
<link
rel=
"stylesheet"
href=
"https://xpo.oss-cn-beijing.aliyuncs.com/huaian/css/vant.css"
/>
<link
rel=
"stylesheet"
href=
"css/demo.css?
11111
"
>
<link
rel=
"stylesheet"
href=
"css/demo.css?
3333
"
>
</head>
</head>
<body>
<body>
...
@@ -313,10 +313,10 @@
...
@@ -313,10 +313,10 @@
<script
src=
"js/jquery-3.4.1.min.js"
></script>
<script
src=
"js/jquery-3.4.1.min.js"
></script>
<script
src=
"js/axios.min.js"
></script>
<script
src=
"js/axios.min.js"
></script>
<script
src=
"js/AgoraRTC_N.js"
></script>
<script
src=
"js/AgoraRTC_N.js"
></script>
<script
src=
"js/util.js?
12312313
"
></script>
<script
src=
"js/util.js?
999999
"
></script>
<script
src=
"js/vue.min.js"
></script>
<script
src=
"js/vue.min.js"
></script>
<script
src=
"js/vant.min.js"
></script>
<script
src=
"js/vant.min.js"
></script>
<script
src=
"js/demo.js?
3333
"
></script>
<script
src=
"js/demo.js?
126466499
"
></script>
</script>
</script>
</body>
</body>
...
...
huaian/js/demo.js
View file @
94f30c2
...
@@ -135,8 +135,8 @@ var noShootClick = false
...
@@ -135,8 +135,8 @@ var noShootClick = false
var
jdhEaxmpleShow
=
false
var
jdhEaxmpleShow
=
false
var
cgmExampleShow
=
false
var
cgmExampleShow
=
false
var
zgmExampleShow
=
false
var
zgmExampleShow
=
false
var
snInputNum
=
window
.
snInputNum
||
5
var
snInputNum
var
noShootNum
=
window
.
noShootNum
||
5
var
noShootNum
function
getProcess
(){
function
getProcess
(){
if
(
!
window
.
location
.
href
.
includes
(
'demo.html'
)){
if
(
!
window
.
location
.
href
.
includes
(
'demo.html'
)){
...
@@ -162,6 +162,10 @@ function getProcess(){
...
@@ -162,6 +162,10 @@ function getProcess(){
$
(
'#waitting'
).
show
()
$
(
'#waitting'
).
show
()
$
(
"#mp3Source"
)[
0
].
pause
()
$
(
"#mp3Source"
)[
0
].
pause
()
//处理下图片提交的等待框
submitPictureSucc
()
$
(
'#pictureShowAlert'
).
hide
()
return
return
}
else
{
}
else
{
$
(
'#waitting'
).
hide
()
$
(
'#waitting'
).
hide
()
...
@@ -174,6 +178,7 @@ function getProcess(){
...
@@ -174,6 +178,7 @@ function getProcess(){
$
(
'#snAlertTile'
).
text
(
'请确认设备串号'
)
$
(
'#snAlertTile'
).
text
(
'请确认设备串号'
)
$
(
'#snErrorTs'
).
text
(
'如识别错误你可重新进行拍摄'
+
(
res
.
tryNum
>=
snInputNum
?
'或直接修改'
:
''
))
$
(
'#snErrorTs'
).
text
(
'如识别错误你可重新进行拍摄'
+
(
res
.
tryNum
>=
snInputNum
?
'或直接修改'
:
''
))
$
(
'#snErrorTs'
).
removeClass
(
'tsRed'
)
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
if
(
res
.
tryNum
<
snInputNum
){
if
(
res
.
tryNum
<
snInputNum
){
$
(
'#snValue'
).
prop
(
'readonly'
,
true
);
$
(
'#snValue'
).
prop
(
'readonly'
,
true
);
...
@@ -243,6 +248,7 @@ function getProcess(){
...
@@ -243,6 +248,7 @@ function getProcess(){
if
(
!
snConfirmFlag
&&
!
ifClickHide
){
if
(
!
snConfirmFlag
&&
!
ifClickHide
){
$
(
'#snAlertTile'
).
text
(
'请输入设备串号'
)
$
(
'#snAlertTile'
).
text
(
'请输入设备串号'
)
$
(
'#snErrorTs'
).
text
(
'串号多次未通过,你可手动输入设备串号'
)
$
(
'#snErrorTs'
).
text
(
'串号多次未通过,你可手动输入设备串号'
)
$
(
'#snErrorTs'
).
addClass
(
'tsRed'
)
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
$
(
"#snValue"
).
val
(
''
)
$
(
"#snValue"
).
val
(
''
)
$
(
"#snValue"
).
removeClass
(
'red'
)
$
(
"#snValue"
).
removeClass
(
'red'
)
...
@@ -655,6 +661,7 @@ $('#submitPicture').click(()=>{
...
@@ -655,6 +661,7 @@ $('#submitPicture').click(()=>{
util
.
httpRequest
({
util
.
httpRequest
({
url
:
'/takePhoto '
,
url
:
'/takePhoto '
,
time
:
5000
,
data
:
{
data
:
{
applyId
:
applyId
,
applyId
:
applyId
,
callId
:
callId
,
callId
:
callId
,
...
@@ -663,22 +670,29 @@ $('#submitPicture').click(()=>{
...
@@ -663,22 +670,29 @@ $('#submitPicture').click(()=>{
picData
:
picCode
picData
:
picCode
}
}
}).
then
(
res
=>
{
}).
then
(
res
=>
{
$
(
'#loading'
).
hide
()
submitPictureSucc
()
ifSnSubmitPicture
=
true
setTimeout
(()
=>
{
jdhAndCgmClickHide
=
false
zgmExampleShow
=
false
},
1000
);
if
(
res
.
code
==
200
){
if
(
res
.
code
==
200
){
$
(
'#pictureShowAlert'
).
hide
()
$
(
'#pictureShowAlert'
).
hide
()
}
else
{
}
else
{
toast
(
res
.
msg
)
toast
(
res
.
msg
)
}
}
}).
catch
(
e
=>
{
$
(
'#loading'
).
hide
()
toast
(
'网络有点拥挤,请重新提交'
)
})
})
})
})
function
submitPictureSucc
(){
$
(
'#loading'
).
hide
()
ifSnSubmitPicture
=
true
setTimeout
(()
=>
{
jdhAndCgmClickHide
=
false
zgmExampleShow
=
false
},
1000
);
}
//账号和设备串号的弹窗逻辑
//账号和设备串号的弹窗逻辑
$
(
"#accountAlertShow"
).
click
(()
=>
{
$
(
"#accountAlertShow"
).
click
(()
=>
{
$
(
"#accountValue"
).
val
(
''
)
$
(
"#accountValue"
).
val
(
''
)
...
@@ -732,6 +746,7 @@ function snInputSubmit(){
...
@@ -732,6 +746,7 @@ function snInputSubmit(){
}
else
if
(
res
.
code
==
5001
){
}
else
if
(
res
.
code
==
5001
){
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
$
(
'#snErrorTs'
).
css
(
'opacity'
,
'1'
)
$
(
"#snErrorTs"
).
text
(
res
.
msg
)
$
(
"#snErrorTs"
).
text
(
res
.
msg
)
$
(
'#snErrorTs'
).
addClass
(
'tsRed'
)
$
(
"#snValue"
).
addClass
(
'red'
)
$
(
"#snValue"
).
addClass
(
'red'
)
}
else
{
}
else
{
toast
(
'网络异常,请重新提交'
)
toast
(
'网络异常,请重新提交'
)
...
@@ -824,6 +839,9 @@ async function setEnabled(type, state) {
...
@@ -824,6 +839,9 @@ async function setEnabled(type, state) {
}
}
async
function
init
(){
async
function
init
(){
snInputNum
=
window
.
snInputNum
||
5
noShootNum
=
window
.
noShootNum
||
5
$
(
"#mp3Source"
).
attr
(
'src'
,
'https://lgyztest.obs.cidc-rp-12.joint.cmecloud.cn/file/temp/2025-01-08/hhT2XXAj.mp3'
)
$
(
"#mp3Source"
).
attr
(
'src'
,
'https://lgyztest.obs.cidc-rp-12.joint.cmecloud.cn/file/temp/2025-01-08/hhT2XXAj.mp3'
)
$
(
"#mp3Source"
)[
0
].
autoplay
=
true
$
(
"#mp3Source"
)[
0
].
autoplay
=
true
$
(
"#mp3Source"
)[
0
].
play
()
$
(
"#mp3Source"
)[
0
].
play
()
...
@@ -1018,19 +1036,39 @@ $(window).on('load', function() {
...
@@ -1018,19 +1036,39 @@ $(window).on('load', function() {
$
(
'#beginAlert'
).
css
(
'display'
,
'block'
)
$
(
'#beginAlert'
).
css
(
'display'
,
'block'
)
});
});
const
canvas
=
document
.
getElementById
(
'canvas'
);
const
canvas
=
document
.
getElementById
(
'canvas'
);
const
photo
=
document
.
getElementById
(
'photoImg'
);
const
photo
=
document
.
getElementById
(
'photoImg'
);
const
viewfinder
=
document
.
getElementById
(
'cameraArea'
);
const
viewfinder
=
document
.
getElementById
(
'cameraArea'
);
var
picCode
=
''
var
picCode
=
''
function
paiZhao
(){
function
paiZhao
(){
let
videoTest
=
$
(
'#local-player video'
)[
0
]
let
videoTest
=
$
(
'#local-player video'
)[
0
]
// 设置canvas尺寸与视频相同
canvas
.
width
=
videoTest
.
videoWidth
;
canvas
.
height
=
(
videoTest
.
videoHeight
*
1.2
)
/
3
;
// 在canvas上绘制视频帧
const
context
=
canvas
.
getContext
(
'2d'
);
context
.
drawImage
(
videoTest
,
0
,
videoTest
.
getBoundingClientRect
().
height
*
2.2
/
3
,
canvas
.
width
,
canvas
.
height
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
// canvas.toBlob((blob) => {
// let sizeKB = (blob.size / 1024).toFixed(2);
// console.log(sizeKB)
// }, 'image/png', 0.92);
// 将照片转换为数据URL并显示
const
data
=
canvas
.
toDataURL
(
'image/png'
);
photo
.
setAttribute
(
'src'
,
data
);
picCode
=
data
$
(
'#phone'
).
css
(
'height'
,
'100%'
)
$
(
'#phone'
).
css
(
'top'
,
'0'
)
}
function
paiZhao2
(){
let
videoTest
=
$
(
'#local-player video'
)[
0
]
// 设置canvas尺寸为取景框大小
// 设置canvas尺寸为取景框大小
canvas
.
width
=
viewfinder
.
offsetWidth
canvas
.
width
=
viewfinder
.
offsetWidth
canvas
.
height
=
viewfinder
.
offsetHeight
canvas
.
height
=
viewfinder
.
offsetHeight
...
@@ -1074,11 +1112,12 @@ function paiZhao(){
...
@@ -1074,11 +1112,12 @@ function paiZhao(){
// 在canvas上绘制视频帧
// 在canvas上绘制视频帧
const
context
=
canvas
.
getContext
(
'2d'
);
const
context
=
canvas
.
getContext
(
'2d'
);
context
.
drawImage
(
// context.drawImage(
videoTest
,
// videoTest,
captureX
,
captureY
,
captureWidth
,
captureHeight
);
// captureX, captureY, captureWidth, captureHeight,0, 0, canvas.width, canvas.height);
//context.drawImage(videoTest, 0, 200, canvas.width, canvas.height);
context
.
drawImage
(
// 源图像参数0, 0, canvas.width, canvas.height
videoTest
,
0
,
captureY
,
videoWidth
,
captureHeight
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
canvas
.
toBlob
((
blob
)
=>
{
canvas
.
toBlob
((
blob
)
=>
{
...
@@ -1096,7 +1135,6 @@ function paiZhao(){
...
@@ -1096,7 +1135,6 @@ function paiZhao(){
$
(
'#phone'
).
css
(
'top'
,
'0'
)
$
(
'#phone'
).
css
(
'top'
,
'0'
)
}
}
const
script
=
document
.
createElement
(
'script'
);
const
script
=
document
.
createElement
(
'script'
);
script
.
src
=
'js/lang.js?'
+
Date
.
now
();
script
.
src
=
'js/lang.js?'
+
Date
.
now
();
document
.
head
.
appendChild
(
script
);
document
.
head
.
appendChild
(
script
);
\ No newline at end of file
\ No newline at end of file
huaian/js/lang.js
View file @
94f30c2
window
.
noShootNum
=
5
window
.
noShootNum
=
5
window
.
snInputNum
=
1
\ No newline at end of file
\ No newline at end of file
window
.
snInputNum
=
3
\ No newline at end of file
\ No newline at end of file
huaian/js/util.js
View file @
94f30c2
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
axios
({
axios
({
method
:
'post'
,
method
:
'post'
,
url
:
origin
+
middle
+
param
.
url
,
url
:
origin
+
middle
+
param
.
url
,
timeout
:
15000
,
timeout
:
param
.
time
||
15000
,
data
:
param
.
data
,
data
:
param
.
data
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
reject
(
res
.
data
)
reject
(
res
)
})
})
})
})
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment