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
05b02f17
Commit
05b02f17
authored
Oct 22, 2020
by
gengchunlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
e5752a6e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
131 additions
and
56 deletions
+131
-56
.env.dev
.env.dev
+1
-1
.env.prod
.env.prod
+1
-1
index.js
src/router/index.js
+1
-1
api.js
src/utils/api.js
+9
-8
common.js
src/utils/common.js
+27
-11
choiceContraceptives.vue
src/views/choiceContraceptives.vue
+10
-2
collectRecords.vue
src/views/collectRecords.vue
+7
-0
noData.vue
src/views/component/noData.vue
+3
-1
myMap.vue
src/views/myMap.vue
+38
-27
receiveSuccess.vue
src/views/receiveSuccess.vue
+4
-3
siteDetails.vue
src/views/siteDetails.vue
+30
-1
No files found.
.env.dev
View file @
05b02f17
NODE_ENV=dev
VUE_APP_
PATH=http://123.56.183.13:8889
VUE_APP_
BASE_URL=http://123.56.183.13:8889/
.env.prod
View file @
05b02f17
NODE_ENV=prod
VUE_APP_PATH=https://ynfymds-service.yiboshi.com
VUE_APP_BASE_URL = http://123.56.183.13:8889/
src/router/index.js
View file @
05b02f17
...
...
@@ -24,7 +24,7 @@ const routes = [
]
const
router
=
new
VueRouter
({
mode
:
'h
ash
'
,
mode
:
'h
istory
'
,
base
:
process
.
env
.
BASE_URL
,
routes
})
...
...
src/utils/api.js
View file @
05b02f17
import
axios
from
'axios'
;
var
apiInstance
=
axios
.
create
({
baseURL
:
''
,
baseURL
:
process
.
env
.
VUE_APP_BASE_URL
,
timeout
:
10000
,
withCredentials
:
true
})
...
...
@@ -9,7 +9,8 @@ var apiInstance=axios.create({
/*为请求添加请求头中的token*/
apiInstance
.
interceptors
.
request
.
use
(
config
=>
{
if
(
sessionStorage
.
token
){
config
.
headers
.
Authorization
=
"bearer "
+
sessionStorage
.
getItem
(
'token'
);
/*sessionStorage.getItem('tokenMobile')*/
config
.
headers
.
Authorization
=
''
;
if
(
typeof
(
config
.
params
)
==
"undefined"
){
config
.
params
=
{}
}
...
...
@@ -21,30 +22,30 @@ apiInstance.interceptors.request.use(config=>{
})
/*获取网点*/
export
const
getNetworkInfo
=
params
=>
{
return
apiInstance
.
get
(
`/
api/
basic-info/v1/basic-info/basic-network-info/get-network-info`
,{
params
});
return
apiInstance
.
get
(
`/basic-info/v1/basic-info/basic-network-info/get-network-info`
,{
params
});
};
//获取用领取记录
export
const
getUserCollectRecord
=
params
=>
{
return
apiInstance
.
get
(
`/
api/
stock-info/v1/stock-info/stock-provide-record`
,
{
params
})
return
apiInstance
.
get
(
`/stock-info/v1/stock-info/stock-provide-record`
,
{
params
})
}
//获取库存信息
export
const
getStockInfo
=
params
=>
{
return
apiInstance
.
get
(
`/
api/
stock-info/v1/stock-info/stock-basic-info/basic-info`
,
{
params
})
return
apiInstance
.
get
(
`/stock-info/v1/stock-info/stock-basic-info/basic-info`
,
{
params
})
}
//用户领取次数
export
const
getUserReceiveNum
=
params
=>
{
return
apiInstance
.
get
(
`/
api/
stock-info/v1/stock-info/stock-provide-record/number/
${
params
.
residentId
}
`
,
{
params
})
return
apiInstance
.
get
(
`/stock-info/v1/stock-info/stock-provide-record/number/
${
params
.
residentId
}
`
,
{
params
})
}
//填写随访记录
export
const
addVisitRecord
=
params
=>
{
return
apiInstance
.
post
(
`/
api/
stock-info/v1/stock-info/stock-visit-info`
,
params
)
return
apiInstance
.
post
(
`/stock-info/v1/stock-info/stock-visit-info`
,
params
)
}
//确认领取药具
export
const
getMedical
=
params
=>
{
return
apiInstance
.
post
(
`/
api/
stock-info/v1/stock-info/stock-provide-record`
,
params
)
return
apiInstance
.
post
(
`/stock-info/v1/stock-info/stock-provide-record`
,
params
)
}
src/utils/common.js
View file @
05b02f17
//获取url参数
export
function
getQueryVariable
(
variable
)
{
let
url
=
window
.
location
.
href
let
i
=
url
.
indexOf
(
'?'
)
let
queryStr
=
url
.
substr
(
i
+
1
)
let
vars
=
queryStr
.
split
(
"&"
);
for
(
let
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
let
pair
=
vars
[
i
].
split
(
"="
);
if
(
pair
[
0
]
==
variable
){
return
pair
[
1
];}
}
return
''
;
}
// 判断
// 判断
ios还是安卓
export
function
isIOSWebKit
()
{
const
aa
=
window
.
navigator
.
userAgent
;
if
(
aa
.
indexOf
(
'client-iOS'
)
!==
-
1
){
// ios端
if
(
aa
.
indexOf
(
'client-iOS'
)
!==
-
1
)
{
// ios端
return
true
;
}
else
if
(
aa
.
indexOf
(
'Android'
)
!==
-
1
||
aa
.
indexOf
(
'Adr'
)
!==
-
1
)
{
// 安卓端
}
else
if
(
aa
.
indexOf
(
'Android'
)
!==
-
1
||
aa
.
indexOf
(
'Adr'
)
!==
-
1
)
{
// 安卓端
return
false
;
}
}
//当前方法传参数两种 字符串或者map
export
function
callMobile
(
handlerInterface
,
parameters
)
{
export
function
callMobile
(
handlerInterface
,
parameters
)
{
let
classStr
=
Object
.
prototype
.
toString
.
call
(
parameters
);
if
(
classStr
===
'[object String]'
||
classStr
===
'[object Object]'
)
{
if
(
classStr
===
'[object String]'
||
classStr
===
'[object Object]'
)
{
let
param
=
parameters
;
if
(
classStr
===
"[object Object]"
)
{
//判断传参是str ,还是object
if
(
classStr
===
"[object Object]"
)
{
//判断传参是str ,还是object
//handlerInterface由iOS addScriptMessageHandler与andorid addJavascriptInterface 代码注入而来。
param
=
JSON
.
stringify
(
parameters
);
//参数必须转化成json格式
}
try
{
if
(
isIOSWebKit
()){
//ios
if
(
window
.
webkit
!==
undefined
)
{
if
(
isIOSWebKit
())
{
//ios
if
(
window
.
webkit
!==
undefined
)
{
window
.
webkit
.
messageHandlers
[
handlerInterface
].
postMessage
(
param
);
}
}
else
if
(
isIOSWebKit
()
===
false
)
{
}
else
if
(
isIOSWebKit
()
===
false
)
{
//安卓传输不了js json对象,只能传输string
window
.
ecloud
[
handlerInterface
](
param
);
if
(
param
==
'{}'
)
{
window
.
H5page
[
handlerInterface
]();
}
else
{
window
.
H5page
[
handlerInterface
](
param
);
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
...
...
src/views/choiceContraceptives.vue
View file @
05b02f17
...
...
@@ -54,11 +54,13 @@
<
script
>
import
{
getMedical
,
getStockInfo
}
from
"../utils/api"
;
import
{
callMobile
}
from
"../utils/common"
;
export
default
{
name
:
"choiceContraceptives"
,
data
(){
return
{
routerDetail
:{},
loading
:
false
,
checkedMedical
:
''
,
detailInfo
:
[],
...
...
@@ -72,6 +74,12 @@
},
methods
:{
getStockListInfo
(
callBack
)
{
this
.
routerDetail
=
JSON
.
parse
(
this
.
$route
.
query
.
info
)
Toast
({
message
:
'测试'
+
this
.
routerDetail
,
position
:
'bottom'
,
duration
:
5000
});
let
par
=
{
relationId
:
4
,
...
this
.
param
...
...
@@ -100,8 +108,8 @@
this
.
getStockListInfo
()
},
backHome
(){
this
.
$router
.
push
(
"/"
);
},
callMobile
(
"goIndex"
,
{}
);
},
receiveContraceptives
(){
let
pars
=
JSON
.
parse
(
this
.
checkedMedical
)
let
par
=
{
...
...
src/views/collectRecords.vue
View file @
05b02f17
...
...
@@ -54,6 +54,7 @@
<
script
>
import
{
getUserCollectRecord
}
from
'../utils/api'
;
import
NoData
from
"./component/noData"
;
import
{
Toast
}
from
'mint-ui'
;
export
default
{
name
:
"collectRecords"
,
...
...
@@ -86,6 +87,12 @@
this
.
loading
=
false
}
callBack
&&
callBack
()
}).
catch
(
res
=>
{
Toast
({
message
:
res
,
position
:
'top'
,
duration
:
2000
});
}).
finally
(()
=>
{
this
.
loading
=
false
})
...
...
src/views/component/noData.vue
View file @
05b02f17
...
...
@@ -13,11 +13,13 @@
</
template
>
<
script
>
import
{
callMobile
}
from
"../../utils/common"
;
export
default
{
name
:
"noData"
,
methods
:
{
backHome
(){
this
.
$router
.
push
(
"/"
);
callMobile
(
"goIndex"
,
{}
);
},
}
}
...
...
src/views/myMap.vue
View file @
05b02f17
...
...
@@ -23,7 +23,7 @@
<label>
人工网点
</label>
</div>
<div
class=
"item"
>
<div
class=
"img"
>
<div
class=
"img"
@
click=
"toRealHome"
>
<img
src=
"../assets/img/homePage.png"
/>
</div>
<label>
返回首页
</label>
...
...
@@ -41,12 +41,13 @@
import
sharpImg
from
'../assets/img/sharp.png'
;
import
{
MessageBox
}
from
'mint-ui'
;
import
{
getNetworkInfo
,
getUserReceiveNum
}
from
'../utils/api'
;
import
{
callMobile
}
from
"../utils/common"
;
import
{
callMobile
,
getQueryVariable
}
from
"../utils/common"
;
import
{
Toast
}
from
'mint-ui'
;
export
default
{
name
:
"myMap"
,
data
()
{
return
{
recordNum
:
0
,
jumpHref
:
{},
lngLat
:
[],
showMap
:
false
,
...
...
@@ -54,6 +55,7 @@
}
},
created
()
{
this
.
urltext
()
},
mounted
()
{
this
.
createMap
();
...
...
@@ -64,36 +66,45 @@
document
.
removeEventListener
(
"qrcodeContent"
,
this
.
subscanQRCallBack
);
},
methods
:
{
// 接收url后的数据
urltext
()
{
let
mobileToken
=
getQueryVariable
(
'token'
)
let
userId
=
getQueryVariable
(
'userId'
)
let
mobilePhone
=
getQueryVariable
(
'mobile'
)
let
mobileTokenIno
=
{
token
:
mobileToken
,
userId
:
userId
,
phone
:
mobilePhone
}
window
.
sessionStorage
.
setItem
(
'mobileTokenIno'
,
JSON
.
stringify
(
mobileTokenIno
))
},
ScanCode
()
{
let
pars
=
{
'callback'
:
'qrcodeContent'
,
}
// window.android.qrcode()
callMobile
(
"qrcode"
,
pars
);
callMobile
(
"qrcode"
,
{});
},
async
subscanQRCallBack
(
result
){
/*先判断是否有没有回访的领取记录*/
let
par
=
{
residentId
:
1
}
getUserReceiveNum
(
par
).
then
(({
data
})
=>
{
if
(
data
.
data
<
0
)
{
this
.
$router
.
push
(
'/returnVisit'
);
}
else
{
this
.
$router
.
push
(
'/choiceContraceptives'
);
// this.$router.push('/returnVisit');
/*打开摄像头扫码*/
/*扫描成功拿到发货机id跳转到选择药具页面*/
/*扫描失败弹出提示信息*/
}
let
par
=
{
residentId
:
1
}
//居民id
await
getUserReceiveNum
(
par
).
then
(({
data
})
=>
{
this
.
recordNum
=
data
.
data
})
},
subscanQRCallBack
(
result
){
alert
(
'扫码结果:'
+
result
);
Toast
({
message
:
'测试'
+
result
,
position
:
'bottom'
,
duration
:
5000
});
Toast
({
message
:
'ceshi'
+
this
.
recordNum
,
position
:
'top'
,
duration
:
100000
});
if
(
this
.
recordNum
=
0
)
{
this
.
$router
.
push
({
path
:
`/choiceContraceptives`
,
query
:{
info
:
result
}});
}
else
{
this
.
$router
.
push
({
path
:
`/returnVisit`
,
query
:{
info
:
result
}});
}
},
toCollectRecords
()
{
this
.
$router
.
push
(
'/collectRecords'
);
this
.
$router
.
push
({
path
:
`/returnVisit`
,
query
:{
info
:
4
}});
// this.$router.push('/collectRecords');
},
toRealHome
()
{
callMobile
(
"goIndex"
,
{});
},
createMap
()
{
let
geolocation
=
location
.
initMap
(
"map-container"
);
//定位
...
...
src/views/receiveSuccess.vue
View file @
05b02f17
...
...
@@ -18,11 +18,13 @@
</
template
>
<
script
>
import
{
callMobile
}
from
"../utils/common"
;
export
default
{
name
:
"receiveSuccess"
,
methods
:{
backHome
(){
this
.
$router
.
push
(
"/"
);
callMobile
(
"goIndex"
,
{}
);
}
}
}
...
...
@@ -51,4 +53,4 @@
border-radius
:
22px
;
box-shadow
:
0px
5px
10px
0px
rgba
(
0
,
0
,
0
,
0.1
);
}
</
style
>
\ No newline at end of file
</
style
>
src/views/siteDetails.vue
View file @
05b02f17
...
...
@@ -59,6 +59,7 @@
import
{
getStockInfo
}
from
"../utils/api"
;
import
NoData
from
"./component/noData"
;
import
{
MessageBox
}
from
'mint-ui'
;
export
default
{
name
:
"siteDetails"
,
...
...
@@ -113,7 +114,35 @@
})
},
clickAddress
()
{
console
.
log
(
123
);
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
=
"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
)
{
//这个是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}})*/
},
clickPhone
()
{
console
.
log
(
456
);
...
...
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