Commit 2ef907dd authored by gengchunlei's avatar gengchunlei

微信端扫码改造以及药具领取改造

parent 87887ad8
NODE_ENV=prod
VUE_APP_PATH = https://ynfymds-service.yiboshi.com
VUE_APP_BASE_URL = https://yaoju-service.yiboshi.com
VUE_APP_BASE_URL1 = https://beta-yjservice.yiboshi.com
# contraceptives_app
药具发放系统-APP端
\ No newline at end of file
药具发放系统-APP端
......@@ -15,7 +15,7 @@
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title>
<title>云南省免费提供避孕药具服务平台</title>
</head>
<body>
<div id="app"></div>
......@@ -23,6 +23,6 @@
</body>
<script>
var vConsole =new VConsole();
console.log('Hello world');
// console.log('Hello world');
</script>
</html>
......@@ -9,6 +9,7 @@ import SiteDetails from '../views/siteDetails'
import ReceiveSuccess from '../views/receiveSuccess'
import ManualCollection from "../views/medicalCollection/manualCollection";
import ManualSuccess from "../views/medicalCollection/manualSuccess";
import ManualDistribution from '../views/manualDistribution/manualDistribution'
Vue.use(VueRouter)
......@@ -20,6 +21,7 @@ const routes = [
{path: '/choiceContraceptives', name: 'choiceContraceptives', component: ChoiceContraceptives},
{path: '/siteDetails', name: 'siteDetails', component: SiteDetails},
{path: '/receiveSuccess', name: 'receiveSuccess', component: ReceiveSuccess},
{path: '/resident/manualDistribution', name: 'manualDistribution', component: ManualDistribution},
{path: '/manualCollection', name: 'manualCollection', component: ManualCollection},
{path: '/manualSuccess', name: 'manualSuccess', component: ManualSuccess},
......
......@@ -10,17 +10,17 @@ var apiInstance=axios.create({
/*为请求添加请求头中的token*/
apiInstance.interceptors.request.use(config=>{
let tokenInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).token
if (tokenInfo) {
config.headers.Authorization = tokenInfo;
// let tokenInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).token
// if (tokenInfo) {
// config.headers.Authorization = tokenInfo;
if (typeof (config.params) == "undefined") {
config.params = {}
}
return config;//赋值完后把config返回回去
} else {
callMobile("goIndex", {});
return
}
// } else {
// callMobile("goIndex", {});
// return
// }
// return config;//赋值完后把config返回回去
},error => {
// 请求错误后把我们的error返回回去
......@@ -30,7 +30,6 @@ apiInstance.interceptors.request.use(config=>{
//拦截请求结果判断token是否失效
apiInstance.interceptors.response.use( res =>{
debugger
let data = res
let result = res.data
//比如响应一些报错信息
......@@ -44,8 +43,8 @@ apiInstance.interceptors.response.use( res =>{
}
return data
}, error => {
/* callMobile("goIndex", {});
return*/
callMobile("goIndex", {});
return
})
/*获取网点*/
......@@ -92,3 +91,18 @@ export const getManualNetworkMedical = params => {
export const addManualMedicalRecord = params => {
return apiInstance.post(`/stock-info/v1/api/phone-h5/admin/stock-provide-record/artificial-receive`, params)
}
//人工网点单个药具领取
export const addSingleManualMedicalRecord = params => {
return apiInstance.post(`/stock-info/v1/api/phone-h5/stock-provide-record/artificial-receive-of-phone`, params)
}
//药具领取发送短息验证码
export const getShortMessage = params => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/sms/send`, {params})
}
//药具领取验证短息验证码
export const getCheckShortMessage = params => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/sms/check`, {params})
}
//获取url参数
export function getQueryVariable(variable) {
let url = window.location.href
export function getQueryVariable(variable, urlInfo) {
let url = decodeURI(decodeURI(urlInfo || window.location.href))
console.log(url)
let i = url.indexOf('?')
let queryStr = url.substr(i+1)
let vars = queryStr.split("&");
......
export const GPS = {
PI: 3.14159265358979324,
x_pi: 3.14159265358979324 * 3000.0 / 180.0,
delta: function (lat, lon) {
var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; // ee: 椭球的偏心率。
var dLat = this.transformLat(lon - 105.0, lat - 35.0);
var dLon = this.transformLon(lon - 105.0, lat - 35.0);
var radLat = lat / 180.0 * this.PI;
var magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
var sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * this.PI);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * this.PI);
return {
'lat': dLat,
'lon': dLon
};
},
//WGS-84 to GCJ-02
gcj_encrypt: function (wgsLat, wgsLon) {
if (this.outOfChina(wgsLat, wgsLon))
return {
'lat': wgsLat,
'lon': wgsLon
};
var d = this.delta(wgsLat, wgsLon);
return {
'lat': wgsLat + d.lat,
'lon': wgsLon + d.lon
};
},
outOfChina: function (lat, lon) {
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
},
transformLat: function (x, y) {
var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * this.PI) + 40.0 * Math.sin(y / 3.0 * this.PI)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * this.PI) + 320 * Math.sin(y * this.PI / 30.0)) * 2.0 / 3.0;
return ret;
},
transformLon: function (x, y) {
var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * this.PI) + 40.0 * Math.sin(x / 3.0 * this.PI)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * this.PI) + 300.0 * Math.sin(x / 30.0 * this.PI)) * 2.0 / 3.0;
return ret;
}
};
......@@ -23,7 +23,7 @@
</div>
<div class="item">
<label class="item-left">领取数量:</label>
<label class="item-right">{{item.number || '--'}} {{item.unit}}</label>
<label class="item-right">{{item.receivedNum || '--'}} {{item.receivedUnit}}</label>
</div>
<div class="item">
<label class="item-left">领取时间:</label>
......@@ -67,6 +67,7 @@
loadText:'加载中...',
noDataShow: false,
param: {
telephone: undefined,
pageIndex: 0,
pageSize: 10
}
......@@ -75,6 +76,7 @@
methods: {
getRecordInfo(callBack) {
Indicator.open();
this.param.telephone = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).phone
getUserCollectRecord(this.param).then(({data = {}}) => {
const {dataList = []} = data.data
this.detailInfo = this.detailInfo.concat(dataList)
......@@ -127,8 +129,10 @@
.content .title {
font-weight: bold;
line-height: 30px;
line-height: 1.5;
font-size: 14px!important;
border-bottom: 1px solid #F3F3F3;
padding: 0px 0px 3px 0px;
}
.content .details .item {
......
......@@ -7,7 +7,9 @@
</div>
</div>
<div class="backHome">
<slot name="btn">
<mt-button type="primary" @click="backHome">返回首页</mt-button>
</slot>
</div>
</div>
</template>
......
<template>
<div>
<div v-if="!isNoData">
<mt-header title="人工发放"></mt-header>
<div class="flex_center top_info">
<div>
<div class="netType_div"
:style="{background: (urlParamsDetail.netType == 1 ? '#13C2C2': '#1890FF')}"
>
<span>{{urlParamsDetail.netTypeName}}</span>
</div>
<div class="netNameTitle">{{urlParamsDetail.netName}}</div>
</div>
<div>
<img src="../../assets/img/Vector.png" style="width: 36px;height: 40px">
</div>
</div>
<div class="listTitle"><span class="listTitle_span">领取人信息</span></div>
<div class="inp_pad_resident">
<mt-field label="领取人姓名" placeholder="请输入领取人姓名(必填)" v-model="formData.residentName"></mt-field>
<mt-field label="身份证号" placeholder="请输入领取人身份证号" v-model="formData.idCar"></mt-field>
<mt-field label="手机号码" placeholder="请输入领取人手机号(必填)" v-model="formData.telephone"></mt-field>
<mt-field label="验证码" placeholder="请输入验证码(必填)" v-model="formData.code">
<span style="color: forestgreen;font-size: 12px" @click="getCode" v-if="sendFlag">发送验证码</span>
<span style="color: forestgreen;font-size: 12px" v-if="countDownTimeFlag" disabled>{{countDownTime}}s后重新获取</span>
<span style="color: forestgreen;font-size: 12px" @click="getCode" v-if="replaceSendFlag">重新获取验证码</span>
</mt-field>
</div>
<div class="bottom_btn">
<mt-button type="primary" @click="nextStep" size="large"> 下一步</mt-button>
</div>
</div>
<no-data v-if="isNoData">
<span slot="content">该网点目前非营业中...!</span>
<div slot="btn"></div>
</no-data>
</div>
</template>
<script>
import {Toast} from 'mint-ui'
import {getQueryVariable} from "../../utils/common";
import {getCheckShortMessage, getShortMessage} from "../../utils/api";
import NoData from "../component/noData";
export default {
components: {NoData},
data() {
return {
formData: {
residentName: undefined,
idCar: undefined,
telephone: undefined,
code: undefined
},
routerDetail: {},//路由信息
urlParamsDetail: {},//微信扫一扫所带参数信息
countDownTime: 60,
sendFlag: true,//发送显示
countDownTimeFlag: false,//倒计时显示
replaceSendFlag: false,//重新发送显示
isNoData: false,
}
},
created() {
// this.routerDetail = this.$route.query
// console.log( this.routerDetail)
// if (this.routerDetail.telephone) {
// this.formData = {
// residentName: this.routerDetail.residentName,
// idCar: this.routerDetail.idCar,
// telephone: this.routerDetail.telephone,
// }
// }
this.urltext()
},
methods: {
// 接收url后的数据
urltext() {
let id = getQueryVariable('id')
let netType = getQueryVariable('netType')
let netTypeName = getQueryVariable('netTypeName')
let netName = getQueryVariable('netName')
let netStauts = getQueryVariable('status')
let urlParams = {
id,
netType,
netTypeName,
netName,
status: netStauts
}
if (urlParams.status == 1) {
this.isNoData = true
}
this.urlParamsDetail = urlParams
},
getCode() {
var ckPhone = /^1(?:3[0-9]|4[5-9]|5[0-9]|6[12456]|7[0-8]|8[0-9]|9[0-9])[0-9]{8}$/;
var cktel = /^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/;
if (ckPhone.test(this.formData.telephone) || cktel.test(this.formData.telephone)) {
this.countDownTime = 60
this.sendFlag = false
this.countDownTimeFlag = true
this.replaceSendFlag = false
let par = {
mobile: this.formData.telephone
}
getShortMessage(par)
this.getTimeDown()
} else {
return Toast({
message: '请输入正确的手机号!',
duration: 2000
});
}
},
getTimeDown() {
this.timer = setInterval(() => {
this.countDownTime--
if (this.countDownTime == 0) {
this.replaceSendFlag = true
this.countDownTimeFlag = false
clearInterval(this.timer)
}
}, 1000)
},
nextStep() {
if (!this.formData.residentName || this.formData.residentName.trim() == '') {
return Toast({
message: '请输入领取人姓名!',
duration: 2000
});
}
if (this.formData.idCar) {
let result = /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(this.formData.idCar)
if (!result) {
return Toast({
message: '请输入正确的身份证号!',
duration: 2000
});
}
}
if (!this.formData.telephone) {
return Toast({
message: '请输入领取人手机号!',
duration: 2000
});
}
if (this.formData.telephone) {
var ckPhone = /^1(?:3[0-9]|4[5-9]|5[0-9]|6[12456]|7[0-8]|8[0-9]|9[0-9])[0-9]{8}$/;
var cktel = /^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/;
if (ckPhone.test(this.formData.telephone) || cktel.test(this.formData.telephone)) {}
else {
return Toast({
message: '请输入正确的手机号!',
duration: 2000
});
}
}
let params = {
code: this.formData.code,
mobile: this.formData.telephone
}
getCheckShortMessage(params).then(({data}) => {
if (data.data) {
let par = {
...this.urlParamsDetail,
...this.formData
}
this.$router.push({path:'/manualCollection', query: par})
} else {
return Toast({
message: '请输入正确的验证码!',
duration: 2000
});
}
})
},
}
}
</script>
<style lang="less">
.inp_pad_resident {
padding: 0px 16px!important;
color: #42526E!important;
span {
font-size: 14px!important;
margin-left: 5px;
}
.mint-cell {
border-bottom: 0.5px solid rgba(0, 0, 0, 0.05)!important;
/*.mint-cell-title {*/
/* width: 80px!important;*/
/* flex: none;*/
/*}*/
}
::-webkit-input-placeholder
{
text-align: right!important;
color: #C1C7D0!important;
font-size: 14px!important;
}
input[type=text] {
border: 0px!important;
}
input[type=text]:focus {
box-shadow: 0 0 0 0!important;
}
}
.bottom_btn {
position: fixed;
z-index: 2;
bottom: 0px;
width: 100%;
}
.top_info {
border: 1px solid #F3F3F3;
border-radius: 0px 0px 16px 16px;
padding: 12px;
box-shadow: darkgrey 0px 2px 20px -10px;
}
.netType_div {
text-align: center;
color: white;
border-radius: 8px 2px;
padding: 4px 9px;
/*width: 50px;*/
font-size: 10px
}
.netNameTitle {
font-size: 14px!important;
font-weight: 500;
margin-top: 11px
}
.listTitle {
margin: 20px 0px 12px 16px;
.listTitle_span {
font-weight: 600;
font-size: 16px;
line-height: 22px;
}
}
</style>
......@@ -19,7 +19,7 @@
<div>
<div><span class="manualPel">申领人</span></div>
<div class="netNameTitle"><span>{{sessionInfo.phone || '未知'}}</span></div>
<div class="netNameTitle"><span>{{routerDetail.telephone || '未知'}}</span></div>
</div>
</div>
......@@ -33,11 +33,15 @@
v-if="!noDataShow"
>
<div class="content" v-for="item in detailInfo" :key="item.id">
<div class="title_bor flex_baseline">
<div class="title">{{item.medicalName}}</div>
<div class="leftManual">还可申领
<div class="title_bor">
<div class="title">
{{item.medicalName}}
</div>
<!--<div class="leftManual">
还可申领
<span style="color: #1890FF;margin: 0px 2px">{{item.available}}</span>
<span>{{item.unit}}</span></div>
<span>{{item.unit}}</span>
</div>-->
</div>
<div class="details">
<div class="item">
......@@ -55,23 +59,25 @@
<div class="flex_center">
<div class="item">
<label class="item-left">已申领</label>
<label class="item-right">{{item.received}} {{item.unit}}</label>
<label class="item-right">{{item.received}} {{item.receivedUnit}}</label>
</div>
<div class="item">
<div class="item-left del" @click="delNumber(item)">-</div>
<input type="number" class="item_input" v-model="item.number" @keyup="changeNumber(item)">
<div class="item-right add" @click="addNumber(item)">+</div>
<div class="item-left del" @click="delSingleNumber(item)">-</div> <!--@click="delNumber(item)"-->
<input type="number" class="item_input" v-model="item.number" > <!--@keyup="changeNumber(item)"-->
<div class="item-right add" @click="addSingleNumber(item)">+</div> <!--@click="addNumber(item)"-->
</div>
</div>
<!--class="item-right add sub"-->
<div class="sub" @click="singleSub(item)">申请领取</div>
</div>
</div>
</div>
<div class="loading" v-if="loading">
<span id="load-text">{{loadText}}</span>
</div>
<div class="sumi_medical" v-if="!noDataShow">
<!-- <div class="sumi_medical" v-if="!noDataShow">
<mt-button type="primary" style="width: 200px" @click="onSubmit">申领药具</mt-button>
</div>
</div>-->
<div v-if="noDataShow">
<NoData>
<template v-slot:content>
......@@ -88,9 +94,10 @@
import {
addManualMedicalRecord,
getManualNetworkMedical,
addSingleManualMedicalRecord
} from "../../utils/api";
import NoData from '../component/noData';
import { Toast } from 'mint-ui';
import { Toast,Indicator } from 'mint-ui';
import {receiveWay} from "../../utils/dictionaries";
export default {
......@@ -112,13 +119,13 @@
},
created() {
this.routerDetail = this.$route.query
this.sessionInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
// this.sessionInfo = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
},
methods: {
getRecordInfo(callBack) {
let par = {
relationId: this.routerDetail.id,
telephone: this.sessionInfo.phone,
telephone: this.routerDetail.telephone,
...this.param
}
getManualNetworkMedical(par).then(({data = {}}) => {
......@@ -189,6 +196,15 @@
})
},
delSingleNumber(val) {
this.detailInfo.forEach(item => {
if (item.id == val.id) {
if (item.number > 0) {
item.number --
}
}
})
},
addNumber(val) {
this.detailInfo.forEach(item => {
if (item.id == val.id ) {
......@@ -223,6 +239,13 @@
})
},
addSingleNumber(val) {
this.detailInfo.forEach(item => {
if (item.id == val.id ) {
item.number ++
}
})
},
changeNumber(val) {
this.detailInfo.forEach(item => {
if (item.id == val.id ) {
......@@ -301,6 +324,44 @@
}
})
},
//单条确认申领
singleSub(record) {
if (+record.number >0) {
Indicator.open()
// let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
// const {phone = '', userId =''} = info
let par = {
...record,
phone: this.routerDetail.telephone,
networkId: this.routerDetail.id,
receiveWay: receiveWay[1].id,
number: +record.number,
produceDate: record.produceDate + ' '+'00:00:00',
expireDate: record.expireDate + ' '+'00:00:00',
residentName: this.routerDetail.residentName
}
// console.log(JSON.stringify(par))
addSingleManualMedicalRecord(par).then(({data}) => {
if (data.code == 'SUCCESS') {
Indicator.close()
this.$router.push({path:"/manualSuccess",query:{info: data.data}});
} else {
Indicator.close()
Toast({
message: `${data.msg}`,
duration: 2000
});
}
}).catch(() => {
Indicator.close()
})
} else {
Toast({
message: `请输入领取数量`,
duration: 2000
});
}
},
goBack() {
window.history.go(-1)
},
......@@ -321,20 +382,30 @@
box-shadow: darkgrey 0px 2px 20px -10px;
.title {
font-weight: bold;
line-height: 30px;
line-height: 1.5;
font-size: 14px!important;
width: 70%;
padding: 0px 0px 3px 0px;
/*width: 70%;*/
}
.leftManual {
font-size: 12px;
color: #595959;
}
.sub {
background: #1bd09f;
/*width: 70px;*/
color: #F3F3F3!important;
padding: 5px 10px;
border-radius: 5px;
text-align: center;
margin: 10px 0px 0px 0px;
}
}
.manualPel {
color: #595959;
font-size: 11px;
font-size: 12px;
}
.content .title_bor {
border-bottom: 1px solid #F3F3F3;
......@@ -360,22 +431,30 @@
display: inline-block;
/*padding: 0px 8px;*/
}
.sub {
margin-left: 60px!important;
background: #26a2ff;
color: #F3F3F3!important;
padding: 3px 10px;
border-radius: 5px;
}
}
.content .details .item .item-right {
/*float: right;*/
font-size: 11px;
font-size: 12px;
margin-left: 8px;
color: #262626;
}
.content .details .item .item-left {
color: #595959;
font-size: 11px;
font-size: 12px;
}
.list-data{
/*height: calc(100% - 40px);*/
max-height: calc(100vh - 250px);
max-height: calc(100vh - 180px);
overflow-y: auto;
margin-bottom: 10px;
}
.loading{
height: 80px;
......
......@@ -18,9 +18,9 @@
<div class="content" v-for="item in detailInfo" :key="item.id">
<div class="title_bor flex_baseline">
<div class="title">{{item.medicalName}}</div>
<div class="leftManual">本次申领
<!-- <div class="leftManual">本次申领
<span style="color: #1890FF;margin: 0px 2px">{{item.number}}</span>
<span>{{item.unit}}</span></div>
<span>{{item.unit}}</span></div>-->
</div>
<div class="details">
<div class="item">
......@@ -41,9 +41,9 @@
<div class="loading" v-if="loading">
<span id="load-text">{{loadText}}</span>
</div>
<div v-if="noDataShow">
<!-- <div v-if="noDataShow">
<NoData></NoData>
</div>
</div>-->
</div>
</div>
......@@ -119,9 +119,10 @@
box-shadow: darkgrey 0px 2px 20px -10px;
.title {
font-weight: bold;
line-height: 30px;
line-height: 1.5;
font-size: 14px!important;
width: 70%;
padding: 0px 0px 3px 0px;
/*width: 70%;*/
}
.leftManual {
font-size: 12px;
......@@ -141,6 +142,7 @@
line-height: 24px;
}
.content .details .item .item-right {
/*float: right;*/
margin-left: 8px;
......
......@@ -42,6 +42,7 @@
import {getNetworkInfo, getUserReceiveNum} from '../utils/api';
import {callMobile, getQueryVariable, isIOSWebKit} from "../utils/common";
import {Toast} from 'mint-ui';
import {GPS} from "../utils/mapCalculation";
export default {
name: "myMap",
......@@ -91,20 +92,32 @@
} else {
callMobile("qrcode", {});
}
})
},
subscanQRCallBack(val) {
// result = {id: 20, type: 2, typeName: '人工发放', netName: '昆明市官渡区医学会'}
// let result = val
let result = {}
let ios = isIOSWebKit()
if (ios) {
result = JSON.parse(val)
} else {
result = val
// window.sessionStorage.setItem('test', val)
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId = ''} = info
let urlP = ''
// let ios = isIOSWebKit()
// if (ios) {
urlP = val
// } else {
// urlP = JSON.parse(val)
// }
let id = getQueryVariable('id',urlP)
let netType = getQueryVariable('netType',urlP)
let netTypeName = getQueryVariable('netTypeName',urlP)
let netName = getQueryVariable('netName',urlP)
let netStauts = getQueryVariable('status',urlP)
let result = {
id,
netType,
netTypeName,
netName,
status: netStauts,
telephone: phone
}
console.log(JSON.stringify(result))
if (!result.netType) {
return
}
......@@ -151,15 +164,15 @@
},
toRealHome() {
callMobile("goIndex", {});
// let resultT = {id: 4, type: 2, typeName: '人工发放', netName: '昆明市官渡区医学会'}
// this.$router.push({path:'/manualCollection', query: resultT})
// let resultT = {id: 1, type: 2, netTypeName: '人工发放网点', netName: '昆明市官渡区医学会'}
// this.$router.push({path:'/resident/manualDistribution', query: resultT})
},
createMap() {
let self = this
// let geolocation = location.initMap("map-container"); //定位
let mapObj;
let geolocation;
mapObj = new AMap.Map('map-container', {zoom: 13, mapStyle: "amap://styles/macaron"});
mapObj = new AMap.Map('map-container', {zoom: 15, mapStyle: "amap://styles/macaron"});
mapObj.plugin('AMap.Geolocation', function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true,//是否使用高精度定位,默认:true
......@@ -174,21 +187,6 @@
panToLocation: true, //定位成功后将定位到的位置作为地图中心点,默认:true
zoomToAccuracy: false //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
});
/* // 解决ios 4g 网络获取不到经纬度的问题
// ios环境切换到使用远程https定位
if (AMap.UA.ios) {
//使用远程定位,见 remogeo.js
var remoGeo = new RemoGeoLocation();
//替换方法
navigator.geolocation.getCurrentPosition = function() {
return remoGeo.getCurrentPosition.apply(remoGeo, arguments);
};
//替换方法
navigator.geolocation.watchPosition = function() {
return remoGeo.watchPosition.apply(remoGeo, arguments);
};
}
*/
mapObj.addControl(geolocation);
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, 'complete', onComplete)
......@@ -197,6 +195,8 @@
function onComplete(data) {
// data是具体的定位信息
console.log('定位成功信息:', data)
// let gpsPoint = GPS.gcj_encrypt(data.position.getLat(), data.position.getLng());
// console.log(gpsPoint)
self.creatNetwork(data)
}
......
......@@ -16,7 +16,7 @@
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<!--<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>-->
<title>contraceptives_app</title>
<title>避孕药具领取</title>
</head>
<body>
<div id="app"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment