Commit a01abadf authored by gengchunlei's avatar gengchunlei

小程序 楚晓康小程序对接

parent c121de7f
......@@ -131,3 +131,9 @@ export const addDestroyApply = params => {
export const getUserInfoByIdCard = 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)
}
......@@ -159,6 +159,7 @@ export function isIOSWebKit1() {
}
}
// 判断是否安卓
export function isAndroid() {
const aa = window.navigator.userAgent;
......@@ -172,3 +173,18 @@ export function isWeiXin() {
const ua = window.navigator.userAgent.toLowerCase()
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
......@@ -34,19 +34,19 @@
</template>
<script>
import AMap from 'AMap';
// import {location} from "../utils/mapUtils";
import machinesImg from '../assets/img/machines.png';
import closeImg from '../assets/img/close.png';
import presonImg from '../assets/img/preson.png';
import sharpImg from '../assets/img/sharp.png';
import {getNetworkInfo} from '../utils/api';
import {callMobile, getQueryVariable, isWeiXin, showNav} from "../utils/common";
import {Toast} from 'mint-ui';
import {GPS} from "../utils/mapCalculation";
import AnalyzeQRCode from "./component/analyzeQRCode";
export default {
import AMap from 'AMap';
// import {location} from "../utils/mapUtils";
import machinesImg from '../assets/img/machines.png';
import closeImg from '../assets/img/close.png';
import presonImg from '../assets/img/preson.png';
import sharpImg from '../assets/img/sharp.png';
import {getNetworkInfo, getPhoneByXCXToken} from '../utils/api';
import {backHome, callMobile, getQueryVariable, isWeiXin, showNav} from "../utils/common";
import {Toast} from 'mint-ui';
import {GPS} from "../utils/mapCalculation";
import AnalyzeQRCode from "./component/analyzeQRCode";
export default {
name: "myMap",
components: {AnalyzeQRCode},
inject: ['showNav'],
......@@ -81,11 +81,24 @@
},
methods: {
// 接收url后的数据
urltext() {
async urltext() {
let mobileToken = getQueryVariable('token')
let userId = getQueryVariable('userId')
let mobilePhone = getQueryVariable('mobile')
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 = {
token: mobileToken,
userId: userId,
......@@ -108,7 +121,7 @@
// this.subscanQRCallBack(111)
// 微信环境下 打开js扫码 (暂时关闭)
if (isWeiXin()){
if (isWeiXin()) {
this.showPop = true
} else {
callMobile("qrcode", {});
......@@ -128,11 +141,11 @@
// } 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 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,
......@@ -152,7 +165,7 @@
});
return;
}
if (result.netType == 2){
if (result.netType == 2) {
this.$router.push({path: `/manualCollection`, query: result});
} else {
this.$router.push({path: `/choiceContraceptives`, query: result});
......@@ -201,6 +214,7 @@
AMap.event.addListener(geolocation, 'complete', onComplete)
AMap.event.addListener(geolocation, 'error', onError)
self.locationInfo = mapObj
function onComplete(data) {
// data是具体的定位信息
console.log('定位成功信息:', data)
......@@ -350,106 +364,106 @@
}
,
},
}
}
</script>
<style>
.right_item {
.right_item {
position: absolute;
z-index: 2;
right: 15px;
top: 60%
}
}
.right_item .item .img {
.right_item .item .img {
padding: 9px;
width: 36px;
height: 36px;
margin: 0 auto;
border-radius: 1.5rem;
background: white;
}
}
.right_item .item {
.right_item .item {
color: #00CA9D;
margin-top: 20px;
}
}
.myMap {
.myMap {
height: 100%;
margin: 0px;
padding: 0px;
}
}
.containerMap {
.containerMap {
width: 100%;
height: calc(100% - 40px);
margin: 0px;
font-size: 13px;
position: relative;
z-index: 1;
}
}
.scanCode {
.scanCode {
position: fixed;
z-index: 2;
left: calc(50% - 155px);
bottom: 20px;
}
}
.scanCode .mint-button {
.scanCode .mint-button {
width: 311px;
height: 44px;
background: linear-gradient(242deg, #dff9b9 -27%, #1bd09f 85%);
border-radius: 22px;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
}
}
.content-window-card {
.content-window-card {
position: relative;
box-shadow: none;
bottom: 0;
left: 0;
width: auto;
padding: 0;
}
}
.content-window-card p {
.content-window-card p {
height: 2rem;
}
}
.custom-info {
.custom-info {
border: solid 1px silver;
}
}
div.info-top {
div.info-top {
position: relative;
background: none repeat scroll 0 0 #F9F9F9;
border-bottom: 1px solid #CCC;
border-radius: 5px 5px 0 0;
}
}
div.info-top div {
div.info-top div {
display: inline-block;
color: #333333;
font-size: 14px;
font-weight: bold;
line-height: 31px;
padding: 0 10px;
}
}
div.info-top img {
div.info-top img {
position: absolute;
top: 10px;
right: 10px;
transition-duration: 0.25s;
}
}
div.info-top img:hover {
div.info-top img:hover {
box-shadow: 0px 0px 5px #000;
}
}
div.info-middle {
div.info-middle {
padding: 5px;
width: 196px;
height: 118px;
......@@ -457,47 +471,47 @@
line-height: 17px;
background: rgba(0, 0, 0, 0.7);;
border-radius: 2px;
}
}
.input-card {
.input-card {
background-color: transparent !important;
}
}
div.info-top div {
div.info-top div {
color: #ffffff;
background: #000000;
margin-right: 20px;
}
}
div.info-top {
div.info-top {
width: 196px;
background: #000000;
}
}
div.info-bottom {
div.info-bottom {
height: 0px;
width: 100%;
clear: both;
text-align: center;
}
}
div.info-bottom img {
div.info-bottom img {
position: relative;
z-index: 104;
}
}
span {
span {
margin-left: 5px;
font-size: 11px;
}
}
.info-middle img {
.info-middle img {
float: left;
margin-right: 6px;
}
}
/*弹窗内按钮样式预留*/
.text-button {
/*弹窗内按钮样式预留*/
.text-button {
border: 0px;
height: 24px;
width: 60px;
......@@ -507,19 +521,19 @@
margin-top: 10px;
opacity: 1;
border-radius: 12px;
}
}
.button-right {
.button-right {
margin-right: 20px;
float: right;
}
}
#container {
#container {
width: 100%;
height: 100%;
}
}
#panel {
#panel {
position: fixed;
background-color: white;
max-height: 90%;
......@@ -527,32 +541,32 @@
top: 10px;
right: 10px;
width: 280px;
}
}
#panel .amap-call {
#panel .amap-call {
background-color: #009cf9;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
}
#panel .amap-lib-walking {
#panel .amap-lib-walking {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
overflow: hidden;
}
}
.showMap {
.showMap {
width: 100%;
height: 100%;
}
}
div.info-top img {
div.info-top img {
width: 15px;
}
}
.myMap >>> .pg-navigation .nearby_top_goback {
.myMap >>> .pg-navigation .nearby_top_goback {
margin-left: 10px;
width: 0px !important;
height: 0px !important;
}
}
</style>
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