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
a01abadf
Commit
a01abadf
authored
Jun 05, 2025
by
gengchunlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序 楚晓康小程序对接
parent
c121de7f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
85 deletions
+122
-85
api.js
src/utils/api.js
+6
-0
common.js
src/utils/common.js
+17
-0
myMap.vue
src/views/myMap.vue
+99
-85
No files found.
src/utils/api.js
View file @
a01abadf
...
@@ -131,3 +131,9 @@ export const addDestroyApply = params => {
...
@@ -131,3 +131,9 @@ export const addDestroyApply = params => {
export
const
getUserInfoByIdCard
=
params
=>
{
export
const
getUserInfoByIdCard
=
params
=>
{
return
apiInstance
.
get
(
`/stock-info/v1/api/phone-h5/stock-provide-record/get-residents-info-by-id-card`
,
{
params
})
return
apiInstance
.
get
(
`/stock-info/v1/api/phone-h5/stock-provide-record/get-residents-info-by-id-card`
,
{
params
})
}
}
//小程序根据token获取手机号
export
const
getPhoneByXCXToken
=
params
=>
{
return
apiInstance
.
post
(
`/stock-info/api/yzdj-api-app/base-member-phone`
,
params
)
}
src/utils/common.js
View file @
a01abadf
...
@@ -159,6 +159,7 @@ export function isIOSWebKit1() {
...
@@ -159,6 +159,7 @@ export function isIOSWebKit1() {
}
}
}
}
// 判断是否安卓
// 判断是否安卓
export
function
isAndroid
()
{
export
function
isAndroid
()
{
const
aa
=
window
.
navigator
.
userAgent
;
const
aa
=
window
.
navigator
.
userAgent
;
...
@@ -172,3 +173,18 @@ export function isWeiXin() {
...
@@ -172,3 +173,18 @@ export function isWeiXin() {
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
()
const
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
()
return
/micromessenger/
.
test
(
ua
)
return
/micromessenger/
.
test
(
ua
)
}
}
//关闭页面
export
function
backHome
()
{
if
(
isIOSWebKit1
())
{
//ios
console
.
log
(
'ios'
)
callMobile
(
"goIndex"
,
{})
}
else
if
(
isAndroid
())
{
console
.
log
(
'Android'
)
callMobile
(
"goIndex"
,
{})
}
if
(
isWeiXin
())
{
// 微信中
console
.
log
(
'weixin'
)
WeixinJSBridge
.
call
(
'closeWindow'
)
}
}
\ No newline at end of file
src/views/myMap.vue
View file @
a01abadf
...
@@ -34,19 +34,19 @@
...
@@ -34,19 +34,19 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
AMap
from
'AMap'
;
import
AMap
from
'AMap'
;
// import {location} from "../utils/mapUtils";
// import {location} from "../utils/mapUtils";
import
machinesImg
from
'../assets/img/machines.png'
;
import
machinesImg
from
'../assets/img/machines.png'
;
import
closeImg
from
'../assets/img/close.png'
;
import
closeImg
from
'../assets/img/close.png'
;
import
presonImg
from
'../assets/img/preson.png'
;
import
presonImg
from
'../assets/img/preson.png'
;
import
sharpImg
from
'../assets/img/sharp.png'
;
import
sharpImg
from
'../assets/img/sharp.png'
;
import
{
getNetworkInfo
}
from
'../utils/api'
;
import
{
getNetworkInfo
,
getPhoneByXCXToken
}
from
'../utils/api'
;
import
{
callMobile
,
getQueryVariable
,
isWeiXin
,
showNav
}
from
"../utils/common"
;
import
{
backHome
,
callMobile
,
getQueryVariable
,
isWeiXin
,
showNav
}
from
"../utils/common"
;
import
{
Toast
}
from
'mint-ui'
;
import
{
Toast
}
from
'mint-ui'
;
import
{
GPS
}
from
"../utils/mapCalculation"
;
import
{
GPS
}
from
"../utils/mapCalculation"
;
import
AnalyzeQRCode
from
"./component/analyzeQRCode"
;
import
AnalyzeQRCode
from
"./component/analyzeQRCode"
;
export
default
{
export
default
{
name
:
"myMap"
,
name
:
"myMap"
,
components
:
{
AnalyzeQRCode
},
components
:
{
AnalyzeQRCode
},
inject
:
[
'showNav'
],
inject
:
[
'showNav'
],
...
@@ -81,11 +81,24 @@
...
@@ -81,11 +81,24 @@
},
},
methods
:
{
methods
:
{
// 接收url后的数据
// 接收url后的数据
urltext
()
{
async
urltext
()
{
let
mobileToken
=
getQueryVariable
(
'token'
)
let
mobileToken
=
getQueryVariable
(
'token'
)
let
userId
=
getQueryVariable
(
'userId'
)
let
userId
=
getQueryVariable
(
'userId'
)
let
mobilePhone
=
getQueryVariable
(
'mobile'
)
let
mobilePhone
=
getQueryVariable
(
'mobile'
)
let
realName
=
getQueryVariable
(
'realName'
)
let
realName
=
getQueryVariable
(
'realName'
)
let
system
=
getQueryVariable
(
'system'
)
//对接楚雄楚晓康小程序方案
if
(
system
&&
system
==
'cxk'
)
{
let
result
=
await
getPhoneByXCXToken
({
'token'
:
mobileToken
})
console
.
log
(
result
)
mobilePhone
=
result
.
data
.
data
}
//手机号不存在 直接返回
if
(
!
mobilePhone
)
{
return
backHome
()
}
let
mobileTokenIno
=
{
let
mobileTokenIno
=
{
token
:
mobileToken
,
token
:
mobileToken
,
userId
:
userId
,
userId
:
userId
,
...
@@ -108,7 +121,7 @@
...
@@ -108,7 +121,7 @@
// this.subscanQRCallBack(111)
// this.subscanQRCallBack(111)
// 微信环境下 打开js扫码 (暂时关闭)
// 微信环境下 打开js扫码 (暂时关闭)
if
(
isWeiXin
())
{
if
(
isWeiXin
())
{
this
.
showPop
=
true
this
.
showPop
=
true
}
else
{
}
else
{
callMobile
(
"qrcode"
,
{});
callMobile
(
"qrcode"
,
{});
...
@@ -128,11 +141,11 @@
...
@@ -128,11 +141,11 @@
// } else {
// } else {
// urlP = JSON.parse(val)
// urlP = JSON.parse(val)
// }
// }
let
id
=
getQueryVariable
(
'id'
,
urlP
)
let
id
=
getQueryVariable
(
'id'
,
urlP
)
let
netType
=
getQueryVariable
(
'netType'
,
urlP
)
let
netType
=
getQueryVariable
(
'netType'
,
urlP
)
let
netTypeName
=
getQueryVariable
(
'netTypeName'
,
urlP
)
let
netTypeName
=
getQueryVariable
(
'netTypeName'
,
urlP
)
let
netName
=
getQueryVariable
(
'netName'
,
urlP
)
let
netName
=
getQueryVariable
(
'netName'
,
urlP
)
let
netStauts
=
getQueryVariable
(
'status'
,
urlP
)
let
netStauts
=
getQueryVariable
(
'status'
,
urlP
)
let
result
=
{
let
result
=
{
id
,
id
,
netType
,
netType
,
...
@@ -152,7 +165,7 @@
...
@@ -152,7 +165,7 @@
});
});
return
;
return
;
}
}
if
(
result
.
netType
==
2
)
{
if
(
result
.
netType
==
2
)
{
this
.
$router
.
push
({
path
:
`/manualCollection`
,
query
:
result
});
this
.
$router
.
push
({
path
:
`/manualCollection`
,
query
:
result
});
}
else
{
}
else
{
this
.
$router
.
push
({
path
:
`/choiceContraceptives`
,
query
:
result
});
this
.
$router
.
push
({
path
:
`/choiceContraceptives`
,
query
:
result
});
...
@@ -201,6 +214,7 @@
...
@@ -201,6 +214,7 @@
AMap
.
event
.
addListener
(
geolocation
,
'complete'
,
onComplete
)
AMap
.
event
.
addListener
(
geolocation
,
'complete'
,
onComplete
)
AMap
.
event
.
addListener
(
geolocation
,
'error'
,
onError
)
AMap
.
event
.
addListener
(
geolocation
,
'error'
,
onError
)
self
.
locationInfo
=
mapObj
self
.
locationInfo
=
mapObj
function
onComplete
(
data
)
{
function
onComplete
(
data
)
{
// data是具体的定位信息
// data是具体的定位信息
console
.
log
(
'定位成功信息:'
,
data
)
console
.
log
(
'定位成功信息:'
,
data
)
...
@@ -350,106 +364,106 @@
...
@@ -350,106 +364,106 @@
}
}
,
,
},
},
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.right_item
{
.right_item
{
position
:
absolute
;
position
:
absolute
;
z-index
:
2
;
z-index
:
2
;
right
:
15px
;
right
:
15px
;
top
:
60%
top
:
60%
}
}
.right_item
.item
.img
{
.right_item
.item
.img
{
padding
:
9px
;
padding
:
9px
;
width
:
36px
;
width
:
36px
;
height
:
36px
;
height
:
36px
;
margin
:
0
auto
;
margin
:
0
auto
;
border-radius
:
1.5rem
;
border-radius
:
1.5rem
;
background
:
white
;
background
:
white
;
}
}
.right_item
.item
{
.right_item
.item
{
color
:
#00CA9D
;
color
:
#00CA9D
;
margin-top
:
20px
;
margin-top
:
20px
;
}
}
.myMap
{
.myMap
{
height
:
100%
;
height
:
100%
;
margin
:
0px
;
margin
:
0px
;
padding
:
0px
;
padding
:
0px
;
}
}
.containerMap
{
.containerMap
{
width
:
100%
;
width
:
100%
;
height
:
calc
(
100%
-
40px
);
height
:
calc
(
100%
-
40px
);
margin
:
0px
;
margin
:
0px
;
font-size
:
13px
;
font-size
:
13px
;
position
:
relative
;
position
:
relative
;
z-index
:
1
;
z-index
:
1
;
}
}
.scanCode
{
.scanCode
{
position
:
fixed
;
position
:
fixed
;
z-index
:
2
;
z-index
:
2
;
left
:
calc
(
50%
-
155px
);
left
:
calc
(
50%
-
155px
);
bottom
:
20px
;
bottom
:
20px
;
}
}
.scanCode
.mint-button
{
.scanCode
.mint-button
{
width
:
311px
;
width
:
311px
;
height
:
44px
;
height
:
44px
;
background
:
linear-gradient
(
242deg
,
#dff9b9
-27%
,
#1bd09f
85%
);
background
:
linear-gradient
(
242deg
,
#dff9b9
-27%
,
#1bd09f
85%
);
border-radius
:
22px
;
border-radius
:
22px
;
box-shadow
:
0px
5px
10px
0px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
0px
5px
10px
0px
rgba
(
0
,
0
,
0
,
0.1
);
}
}
.content-window-card
{
.content-window-card
{
position
:
relative
;
position
:
relative
;
box-shadow
:
none
;
box-shadow
:
none
;
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
width
:
auto
;
width
:
auto
;
padding
:
0
;
padding
:
0
;
}
}
.content-window-card
p
{
.content-window-card
p
{
height
:
2rem
;
height
:
2rem
;
}
}
.custom-info
{
.custom-info
{
border
:
solid
1px
silver
;
border
:
solid
1px
silver
;
}
}
div
.info-top
{
div
.info-top
{
position
:
relative
;
position
:
relative
;
background
:
none
repeat
scroll
0
0
#F9F9F9
;
background
:
none
repeat
scroll
0
0
#F9F9F9
;
border-bottom
:
1px
solid
#CCC
;
border-bottom
:
1px
solid
#CCC
;
border-radius
:
5px
5px
0
0
;
border-radius
:
5px
5px
0
0
;
}
}
div
.info-top
div
{
div
.info-top
div
{
display
:
inline-block
;
display
:
inline-block
;
color
:
#333333
;
color
:
#333333
;
font-size
:
14px
;
font-size
:
14px
;
font-weight
:
bold
;
font-weight
:
bold
;
line-height
:
31px
;
line-height
:
31px
;
padding
:
0
10px
;
padding
:
0
10px
;
}
}
div
.info-top
img
{
div
.info-top
img
{
position
:
absolute
;
position
:
absolute
;
top
:
10px
;
top
:
10px
;
right
:
10px
;
right
:
10px
;
transition-duration
:
0.25s
;
transition-duration
:
0.25s
;
}
}
div
.info-top
img
:hover
{
div
.info-top
img
:hover
{
box-shadow
:
0px
0px
5px
#000
;
box-shadow
:
0px
0px
5px
#000
;
}
}
div
.info-middle
{
div
.info-middle
{
padding
:
5px
;
padding
:
5px
;
width
:
196px
;
width
:
196px
;
height
:
118px
;
height
:
118px
;
...
@@ -457,47 +471,47 @@
...
@@ -457,47 +471,47 @@
line-height
:
17px
;
line-height
:
17px
;
background
:
rgba
(
0
,
0
,
0
,
0.7
);
;
background
:
rgba
(
0
,
0
,
0
,
0.7
);
;
border-radius
:
2px
;
border-radius
:
2px
;
}
}
.input-card
{
.input-card
{
background-color
:
transparent
!important
;
background-color
:
transparent
!important
;
}
}
div
.info-top
div
{
div
.info-top
div
{
color
:
#ffffff
;
color
:
#ffffff
;
background
:
#000000
;
background
:
#000000
;
margin-right
:
20px
;
margin-right
:
20px
;
}
}
div
.info-top
{
div
.info-top
{
width
:
196px
;
width
:
196px
;
background
:
#000000
;
background
:
#000000
;
}
}
div
.info-bottom
{
div
.info-bottom
{
height
:
0px
;
height
:
0px
;
width
:
100%
;
width
:
100%
;
clear
:
both
;
clear
:
both
;
text-align
:
center
;
text-align
:
center
;
}
}
div
.info-bottom
img
{
div
.info-bottom
img
{
position
:
relative
;
position
:
relative
;
z-index
:
104
;
z-index
:
104
;
}
}
span
{
span
{
margin-left
:
5px
;
margin-left
:
5px
;
font-size
:
11px
;
font-size
:
11px
;
}
}
.info-middle
img
{
.info-middle
img
{
float
:
left
;
float
:
left
;
margin-right
:
6px
;
margin-right
:
6px
;
}
}
/*弹窗内按钮样式预留*/
/*弹窗内按钮样式预留*/
.text-button
{
.text-button
{
border
:
0px
;
border
:
0px
;
height
:
24px
;
height
:
24px
;
width
:
60px
;
width
:
60px
;
...
@@ -507,19 +521,19 @@
...
@@ -507,19 +521,19 @@
margin-top
:
10px
;
margin-top
:
10px
;
opacity
:
1
;
opacity
:
1
;
border-radius
:
12px
;
border-radius
:
12px
;
}
}
.button-right
{
.button-right
{
margin-right
:
20px
;
margin-right
:
20px
;
float
:
right
;
float
:
right
;
}
}
#container
{
#container
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
#panel
{
#panel
{
position
:
fixed
;
position
:
fixed
;
background-color
:
white
;
background-color
:
white
;
max-height
:
90%
;
max-height
:
90%
;
...
@@ -527,32 +541,32 @@
...
@@ -527,32 +541,32 @@
top
:
10px
;
top
:
10px
;
right
:
10px
;
right
:
10px
;
width
:
280px
;
width
:
280px
;
}
}
#panel
.amap-call
{
#panel
.amap-call
{
background-color
:
#009cf9
;
background-color
:
#009cf9
;
border-top-left-radius
:
4px
;
border-top-left-radius
:
4px
;
border-top-right-radius
:
4px
;
border-top-right-radius
:
4px
;
}
}
#panel
.amap-lib-walking
{
#panel
.amap-lib-walking
{
border-bottom-left-radius
:
4px
;
border-bottom-left-radius
:
4px
;
border-bottom-right-radius
:
4px
;
border-bottom-right-radius
:
4px
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.showMap
{
.showMap
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
div
.info-top
img
{
div
.info-top
img
{
width
:
15px
;
width
:
15px
;
}
}
.myMap
>>>
.pg-navigation
.nearby_top_goback
{
.myMap
>>>
.pg-navigation
.nearby_top_goback
{
margin-left
:
10px
;
margin-left
:
10px
;
width
:
0px
!important
;
width
:
0px
!important
;
height
:
0px
!important
;
height
:
0px
!important
;
}
}
</
style
>
</
style
>
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