Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
contraceptives_app
Project
Project
Details
Activity
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
ynby
contraceptives_app
Commits
2b2f83f2
Commit
2b2f83f2
authored
Feb 12, 2025
by
gengchunlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楚雄小程序 隐藏地图
parent
ad577f78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
9 deletions
+140
-9
common.js
src/utils/common.js
+24
-2
jsQR.js
src/utils/jsQR.js
+0
-0
analyzeQRCode.vue
src/views/component/analyzeQRCode.vue
+98
-0
myMap.vue
src/views/myMap.vue
+14
-4
siteDetails.vue
src/views/siteDetails.vue
+4
-3
No files found.
src/utils/common.js
View file @
2b2f83f2
...
...
@@ -148,4 +148,27 @@ export function showNav() {
res
=
true
}
return
res
}
\ No newline at end of file
}
// 判断是否是ios
export
function
isIOSWebKit1
()
{
const
aa
=
window
.
navigator
.
userAgent
;
if
(
!!
aa
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
// ios端
return
true
;
}
}
// 判断是否安卓
export
function
isAndroid
()
{
const
aa
=
window
.
navigator
.
userAgent
;
if
(
aa
.
indexOf
(
'Android'
)
!==
-
1
||
aa
.
indexOf
(
'Adr'
)
!==
-
1
)
{
return
true
}
}
// 判断是否在微信中
export
function
isWeiXin
()
{
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
()
return
/micromessenger/
.
test
(
ua
)
}
src/utils/jsQR.js
0 → 100644
View file @
2b2f83f2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/views/component/analyzeQRCode.vue
0 → 100644
View file @
2b2f83f2
<
template
>
<div>
<van-popup
v-model=
"show"
position=
"right"
:style=
"
{ height: '100%',width: '100%' }" >
<video
style=
"display: none"
ref=
"video"
></video>
<canvas
style=
"width: 100vw; margin-top: 13vw"
id=
"canvas"
></canvas>
<canvas
style=
"display: none"
id=
"2d"
></canvas>
</van-popup>
</div>
</
template
>
<
script
>
import
"@/utils/jsQR.js"
;
import
{
jsQR
}
from
"../../utils/jsQR"
;
// 添加关闭摄像头的函数
export
default
{
name
:
'analyzeQRCode'
,
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
streams
:
null
,
}
},
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
anaQR
()
})
},
methods
:
{
//解析二维码
anaQR
()
{
// if (this.streams) {
// this.streams.getTracks().forEach((track) => track.stop());
// }
// video.srcObject = null;
var
video
=
document
.
createElement
(
"video"
);
var
canvasElement
=
document
.
getElementById
(
"canvas"
);
var
canvas
=
canvasElement
.
getContext
(
"2d"
);
console
.
log
(
navigator
.
mediaDevices
);
// 尝试打开手机上安装后置摄像头
navigator
.
mediaDevices
.
getUserMedia
({
video
:
{
facingMode
:
"environment"
},
})
.
then
(
function
(
stream
)
{
debugger
this
.
streams
.
value
=
stream
;
video
.
srcObject
=
stream
;
// 阻止IOS视频全屏
video
.
setAttribute
(
"playsinline"
,
true
);
video
.
play
();
requestAnimationFrame
(
tick
);
});
function
tick
()
{
if
(
video
.
readyState
===
video
.
HAVE_ENOUGH_DATA
)
{
canvasElement
.
hidden
=
false
;
canvasElement
.
height
=
video
.
videoHeight
;
canvasElement
.
width
=
video
.
videoWidth
;
canvas
.
drawImage
(
video
,
0
,
0
,
canvasElement
.
width
,
canvasElement
.
height
);
var
imageData
=
canvas
.
getImageData
(
0
,
0
,
canvasElement
.
width
,
canvasElement
.
height
);
// QR码解析
var
code
=
jsQR
(
imageData
.
data
,
// 图像数据
imageData
.
width
,
// 宽度
imageData
.
height
,
// 高度
{
inversionAttempts
:
"dontInvert"
,
}
);
if
(
code
)
{
console
.
log
(
code
.
data
);
alert
(
code
.
data
);
}
}
requestAnimationFrame
(
tick
);
}
}
}
}
</
script
>
\ No newline at end of file
src/views/myMap.vue
View file @
2b2f83f2
...
...
@@ -29,6 +29,7 @@
<label>
返回首页
</label>
</div>
</div>
<!--
<analyze-q-r-code
:show=
"showPop"
v-if=
"showPop"
></analyze-q-r-code>
-->
</div>
</
template
>
...
...
@@ -39,14 +40,16 @@
import
closeImg
from
'../assets/img/close.png'
;
import
presonImg
from
'../assets/img/preson.png'
;
import
sharpImg
from
'../assets/img/sharp.png'
;
import
{
getNetworkInfo
,
getUserReceiveNum
}
from
'../utils/api'
;
import
{
callMobile
,
getQueryVariable
,
isIOSWebKit
}
from
"../utils/common"
;
import
{
getNetworkInfo
}
from
'../utils/api'
;
import
{
callMobile
,
getQueryVariable
}
from
"../utils/common"
;
import
{
Toast
}
from
'mint-ui'
;
import
{
GPS
}
from
"../utils/mapCalculation"
;
import
AnalyzeQRCode
from
"./component/analyzeQRCode"
;
export
default
{
name
:
"myMap"
,
inject
:
[
'showNav'
],
// components: {AnalyzeQRCode},
inject
:
[
'showNav'
],
data
()
{
return
{
recordNum
:
0
,
...
...
@@ -54,7 +57,8 @@
lngLat
:
[],
showMap
:
false
,
machines
:
[],
locationInfo
:
undefined
locationInfo
:
undefined
,
showPop
:
false
,
}
},
created
()
{
...
...
@@ -100,6 +104,12 @@
// }
// })
// this.subscanQRCallBack(111)
// if (isWeiXin()){
// this.showPop = true
// } else {
// callMobile("qrcode", {});
// }
},
subscanQRCallBack
(
val
)
{
let
info
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'mobileTokenIno'
))
...
...
src/views/siteDetails.vue
View file @
2b2f83f2
...
...
@@ -17,10 +17,11 @@
<label
style=
"margin-left: 20px;font-size: 15px"
>
类型:
{{
siteDetail
.
netTypeName
}}
</label>
</div>
<div
class=
"ui-flex justify-center center"
style=
"line-height: 29px;margin-top: 5px"
>
地址:
<label
@
click=
"clickAddress"
class=
"btns"
>
{{
siteDetail
.
netAddress
}}
</label>
<div
class=
"cell"
>
<!-- @click="clickAddress"-->
地址:
<label
class=
"btns"
>
{{
siteDetail
.
netAddress
}}
</label>
<!--
<div
class=
"cell"
>
<img
src=
"../assets/img/mark.png"
style=
"width: 24px;height: 24px"
/>
</div>
</div>
-->
</div>
<div
class=
"ui-flex justify-center center"
style=
"margin-top: 5px"
>
联系电话:
<label
@
click=
"clickPhone"
class=
"btns"
>
...
...
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