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
cc2ea96b
Commit
cc2ea96b
authored
Nov 04, 2020
by
gengchunlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
412ef2a5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
51 deletions
+77
-51
index.html
public/index.html
+1
-0
common.js
src/utils/common.js
+6
-2
choiceContraceptives.vue
src/views/choiceContraceptives.vue
+1
-1
myMap.vue
src/views/myMap.vue
+20
-3
siteDetails.vue
src/views/siteDetails.vue
+49
-45
No files found.
public/index.html
View file @
cc2ea96b
...
...
@@ -4,6 +4,7 @@
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"initial-scale=1.0, user-scalable=no"
>
<meta
name =
"format-detection"
content =
"telephone=yes"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"http://at.alicdn.com/t/font_2002967_absxhdgm27r.css"
>
<link
rel=
"stylesheet"
href=
"https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"
/>
...
...
src/utils/common.js
View file @
cc2ea96b
...
...
@@ -14,7 +14,7 @@ export function getQueryVariable(variable) {
// 判断ios还是安卓
export
function
isIOSWebKit
()
{
const
aa
=
window
.
navigator
.
userAgent
;
if
(
aa
.
indexOf
(
'client-iOS'
)
!==
-
1
)
{
// ios端
if
(
!!
aa
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
)
)
{
// ios端
return
true
;
}
else
if
(
aa
.
indexOf
(
'Android'
)
!==
-
1
||
aa
.
indexOf
(
'Adr'
)
!==
-
1
)
{
// 安卓端
return
false
;
...
...
@@ -33,7 +33,11 @@ export function callMobile(handlerInterface, parameters) {
try
{
if
(
isIOSWebKit
())
{
//ios
if
(
window
.
webkit
!==
undefined
)
{
window
.
webkit
.
messageHandlers
[
handlerInterface
].
postMessage
(
param
);
if
(
param
==
'{}'
)
{
window
.
webkit
.
messageHandlers
[
handlerInterface
].
postMessage
(
null
);
}
else
{
window
.
webkit
.
messageHandlers
[
handlerInterface
].
postMessage
(
param
);
}
}
}
else
if
(
isIOSWebKit
()
===
false
)
{
//安卓传输不了js json对象,只能传输string
...
...
src/views/choiceContraceptives.vue
View file @
cc2ea96b
...
...
@@ -122,7 +122,7 @@
let
pars
=
JSON
.
parse
(
this
.
checkedMedical
)
let
info
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'mobileTokenIno'
))
const
{
phone
=
''
,
userId
=
''
}
=
info
const
{
id
,
...
other
}
=
pars
const
{
id
,
expireDate
,
produceDate
,
...
other
}
=
pars
let
par
=
{
residentId
:
userId
,
telephone
:
phone
,
...
...
src/views/myMap.vue
View file @
cc2ea96b
...
...
@@ -94,7 +94,24 @@
this
.
$router
.
push
({
path
:
`/choiceContraceptives`
,
query
:{
info
:
result
}});
},
toCollectRecords
()
{
// this.$router.push( `/returnVisit`);
/* this.$router.push({path: `/siteDetails`,query:{info:JSON.stringify({"id": 1,
"createUnitId": 16625,
"netName": "网点1",
"netType": 1,
"netTypeName": "自助发放网点",
"distance": 0.6326,
"areaCode": "530111002004",
"areaName": "前卫路社区居委会",
"netAddress": "云南省昆明动物园",
"netLongitude": "102.719907",
"netLatitude": "25.029347",
"netPerson": "yang",
"netPhone": "15845254852",
"status": 0,
"statusName": "启用",
"created": "2020-11-02 11:48:15",
"updated": "2020-11-02 17:05:14",
})}});*/
// this.$router.push({path: `/choiceContraceptives`,query:{info:1986}});
this
.
$router
.
push
(
'/collectRecords'
);
},
...
...
@@ -275,7 +292,7 @@
if
(
isAndroid
)
{
//这个是安卓操作系统
// window.location.href="androidamap://viewMap?sourceApplication=appname&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0";
window
.
location
.
href
=
`https://uri.amap.com/marker?position=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
&name=
${
info
.
netAddress
}
`
;
window
.
location
.
href
=
`https://uri.amap.com/navigation?to=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
,
${
info
.
netAddress
}
&callnative=1&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1`
//判断是否切出浏览器
/* setTimeout(function(){
let hidden = window.document.hidden || window.document.mozHidden || window.document.msHidden ||window.document.webkitHidden
...
...
@@ -288,7 +305,7 @@
}
if
(
isIOS
)
{
//这个是ios操作系统
window
.
location
.
href
=
`https://uri.amap.com/marker?position=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
&name=
${
info
.
netAddress
}
`
;
window
.
location
.
href
=
`https://uri.amap.com/navigation?to=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
,
${
info
.
netAddress
}
&callnative=1&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1`
// window.location.href="iosamap://viewMap?sourceApplication=appname&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0"
//判断是否切出浏览器
...
...
src/views/siteDetails.vue
View file @
cc2ea96b
<
template
>
<div
class=
"siteDetails"
>
<mt-header
title=
"网点详情"
>
<div
slot=
"left"
@
click=
"goBack
"
>
<div
@
click=
"goBack"
slot=
"left
"
>
<mt-button
icon=
"back"
></mt-button>
</div>
</mt-header>
...
...
@@ -10,34 +10,36 @@
<div><label
style=
"font-size: 15px"
>
距离:
{{
siteDetail
.
distance
}}
km
</label><label
style=
"margin-left: 20px;font-size: 15px"
>
类型:
{{
siteDetail
.
netTypeName
}}
</label></div>
<div
class=
"ui-flex justify-center center"
style=
"line-height: 29px"
>
地址:
<label
class=
"btn"
@
click=
"clickAddress
"
>
{{
siteDetail
.
netAddress
}}
</label>
<label
@
click=
"clickAddress"
class=
"btn
"
>
{{
siteDetail
.
netAddress
}}
</label>
<div
class=
"cell"
><img
src=
"../assets/img/phone.png"
/></div>
</div>
<div
class=
"ui-flex justify-center center"
>
联系电话:
<label
class=
"btn"
@
click=
"clickPhone"
><a
:href=
"`tel:$
{siteDetail.netPhone}`">
{{
siteDetail
.
netPhone
}}
</a></label>
<label
@
click=
"clickPhone"
class=
"btn"
><a
:href=
"`tel:$
{siteDetail.netPhone}`">
{{
siteDetail
.
netPhone
}}
</a></label>
<div
class=
"cell"
><img
src=
"../assets/img/phone.png"
/></div>
</div>
</div>
<div
style=
"padding:0 20px;font-size: 15px"
>
该网点当前可领取的药具
</div>
<div
class=
"content-list"
>
<div
class=
"list-data"
v-infinite-scroll=
"loadMore"
:infinite-scroll-disabled=
"loading"
class=
"list-data"
infinite-scroll-distance=
"10"
v-infinite-scroll=
"loadMore"
>
<div
class=
"content-item ui-flex justify-center center"
<div
:key=
"item.id"
class=
"content-item ui-flex justify-center center"
v-for=
"item in stockInfo"
:key=
"item.id"
>
<div
class=
"cell"
>
<img
:src=
item.imgUrl
/>
<img
:src=
"item.imgUrl"
/>
</div>
<div
class=
"tradeInfo"
>
<div
class=
"tradeName"
>
{{
item
.
medicineName
}}
</div>
<div
style=
"margin-top: 5px"
><label
style=
"float: left;margin-bottom: 0"
>
数量:
{{
item
.
stockNum
}}
</label><label
<div
style=
"margin-top: 5px"
><label
style=
"float: left;margin-bottom: 0"
>
数量:
{{
item
.
stockNum
}}
</label><label
style=
"float: right;margin-right: 15px;margin-bottom: 0"
>
规格:
{{
item
.
specs
}}
</label>
<div
style=
"clear: both"
></div>
</div>
...
...
@@ -49,18 +51,18 @@
</div>
</div>
</div>
<div
v-if=
"noDataShow"
>
<NoData></NoData>
</div>
<div
v-if=
"noDataShow"
>
<NoData></NoData>
</div>
</div>
</
template
>
<
script
>
import
{
getStockInfo
}
from
"../utils/api"
;
import
NoData
from
"./component/noData"
;
import
{
Indicator
}
from
'mint-ui'
;
import
{
MessageBox
}
from
'mint-ui'
;
import
{
Indicator
}
from
'mint-ui'
;
export
default
{
name
:
"siteDetails"
,
...
...
@@ -117,44 +119,46 @@
})
},
clickAddress
()
{
let
info
=
this
.
siteDetail
var
u
=
navigator
.
userAgent
;
var
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
;
//android终端或者uc浏览器
var
isIOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
if
(
isAndroid
)
{
window
.
location
.
href
=
`https://uri.amap.com/marker?position=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
&name=
${
info
.
netAddress
}
`
;
//这个是安卓操作系统
// window.location.href="androidamap://viewMap?sourceApplication=appname&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0";
//判断是否切出浏览器
/* setTimeout(function(){
let hidden = window.document.hidden || window.document.mozHidden || window.document.msHidden ||window.document.webkitHidden
if(typeof hidden =="undefined" || hidden ==false){
//应用宝下载地址
MessageBox('提示', '请下载高德地图进行导航')
}
}, 2500);*/
}
if
(
isIOS
)
{
window
.
location
.
href
=
`https://uri.amap.com/marker?position=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
&name=
${
info
.
netAddress
}
`
;
let
info
=
this
.
siteDetail
var
u
=
navigator
.
userAgent
;
var
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
;
//android终端或者uc浏览器
var
isIOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
if
(
isAndroid
)
{
// window.location.href=`https://uri.amap.com/marker?position=${info.netLongitude}, ${info.netLatitude}&name=${info.netAddress}`;
window
.
location
.
href
=
`https://uri.amap.com/navigation?to=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
,
${
info
.
netAddress
}
&callnative=1&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`
//这个是安卓操作系统
// window.location.href="androidamap://viewMap?sourceApplication=amap&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0";
//判断是否切出浏览器
/* setTimeout(function(){
let hidden = window.document.hidden || window.document.mozHidden || window.document.msHidden ||window.document.webkitHidden
if(typeof hidden =="undefined" || hidden ==false){
//应用宝下载地址
MessageBox('提示', '请下载高德地图进行导航')
}
}, 2500);*/
}
if
(
isIOS
)
{
// window.location.href=`https://uri.amap.com/marker?position=${info.netLongitude}, ${info.netLatitude}&name=${info.netAddress}`;
window
.
location
.
href
=
`https://uri.amap.com/navigation?to=
${
info
.
netLongitude
}
,
${
info
.
netLatitude
}
,
${
info
.
netAddress
}
&callnative=1&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`
//这个是ios操作系统
// window.location.href="iosamap://viewMap?sourceApplication=appname
&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0"
//判断是否切出浏览器
/*
setTimeout(function(){
let hidden = window.document.hidden || window.document.mozHidden || window.document.msHidden ||window.document.webkitHidden
if(typeof hidden =="undefined" || hidden ==false){
//应用宝下载地址
MessageBox('提示', '请下载高德地图进行导航')
}
}, 2500);*/
}
/*
this.$router.push({path: '/navigation', query: {Lng: Lng, Lat: Lat}})*/
//这个是ios操作系统
// window.location.href="iosamap://viewMap?sourceApplication=amap
&poiname="+info.netName+"&lat="+info.netLatitude+"&lon="+info.netLongitude+"&dev=0"
//判断是否切出浏览器
/*
setTimeout(function(){
let hidden = window.document.hidden || window.document.mozHidden || window.document.msHidden ||window.document.webkitHidden
if(typeof hidden =="undefined" || hidden ==false){
//应用宝下载地址
MessageBox('提示', '请下载高德地图进行导航')
}
}, 2500);*/
}
/*
this.$router.push({path: '/navigation', query: {Lng: Lng, Lat: Lat}})*/
},
clickPhone
()
{
console
.
log
(
456
);
},
goBack
()
{
window
.
history
.
go
(
-
1
)
window
.
history
.
go
(
-
1
)
},
getDistance
(
latFrom
,
lngFrom
,
latTo
,
lngTo
)
{
var
rad
=
function
(
d
)
{
//计算角度
...
...
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