|
|
@@ -55,7 +55,7 @@
|
|
|
<view class="system">
|
|
|
<top-title :title="'救在身边'" navurl="/pages/applic/location" :show_more="true"></top-title>
|
|
|
<view class="system-map">
|
|
|
- <map class="map-box" id="map" show-location :markers="jzsbmarker" :scale="scale" :latitude="latitude4"
|
|
|
+ <map class="map-box" show-location :markers="jzsbmarker" :scale="scale" :latitude="latitude4"
|
|
|
:longitude="longitude4" ref="map" @markertap="markertap" :show-location="false"></map>
|
|
|
</view>
|
|
|
<view class="" style="padding-top: 80rpx;">
|
|
|
@@ -92,7 +92,7 @@
|
|
|
<view class="img" v-if="item.is_create == 0" @click="rescue(item,index)">
|
|
|
<image src="../../static/img/rescue.png" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="called" v-if="item.is">
|
|
|
+ <view class="called" v-else>
|
|
|
已呼叫
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -105,7 +105,7 @@
|
|
|
<top-title :title="'救护站'" :navurl="'/pages/applic/aid'" :show_more="true"></top-title>
|
|
|
</view>
|
|
|
<view id="container">
|
|
|
- <map class="map-box" id="map" show-location :markers="jhzmarker" :scale="scale" :latitude="latitude4"
|
|
|
+ <map class="map-box" show-location :markers="jhzmarker" :scale="scale" :latitude="latitude4"
|
|
|
:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="jhzmarkertap" :show-location="false"></map>
|
|
|
</view>
|
|
|
<view class="">
|
|
|
@@ -133,7 +133,7 @@
|
|
|
<top-title :title="'智能AED'" :navurl="'/pages/applic/aed'" :show_more="true"></top-title>
|
|
|
</view>
|
|
|
<view id="container">
|
|
|
- <map class="map-box" id="map" show-location :markers="aedmarker" :scale="scale" :latitude="latitude4"
|
|
|
+ <map class="map-box" show-location :markers="aedmarker" :scale="scale" :latitude="latitude4"
|
|
|
:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="aedmarkertap" :show-location="false"></map>
|
|
|
</view>
|
|
|
<view class="">
|
|
|
@@ -192,7 +192,8 @@
|
|
|
import {
|
|
|
getAed,
|
|
|
getAidList,
|
|
|
- getRescuerList
|
|
|
+ getRescuerList,
|
|
|
+ sos,
|
|
|
} from '@/api/category.js'
|
|
|
import {
|
|
|
loadIndexs,
|
|
|
@@ -231,6 +232,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ user_id: '',
|
|
|
rescuers_id: '',
|
|
|
name: '',
|
|
|
uid: '',
|
|
|
@@ -298,24 +300,52 @@
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
+
|
|
|
// this.loadData();
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ this.loadIndex()
|
|
|
saveUrl();
|
|
|
let obj = this;
|
|
|
- try {
|
|
|
- let locationAddress;
|
|
|
- // #ifdef H5
|
|
|
- let wxOjb = require('jweixin-module');
|
|
|
- locationAddress = wxOjb.getLocation;
|
|
|
- // #endif
|
|
|
- // #ifdef MP
|
|
|
- locationAddress = uni.getLocation;
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- wxOjb.ready(() => {
|
|
|
- console.log('加载完毕注册事件');
|
|
|
+ let weichatBrowser = uni.getStorageSync('weichatBrowser')
|
|
|
+ if(weichatBrowser) {
|
|
|
+ try {
|
|
|
+ let locationAddress;
|
|
|
+ // #ifdef H5
|
|
|
+ let wxOjb = require('jweixin-module');
|
|
|
+ locationAddress = wxOjb.getLocation;
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP
|
|
|
+ locationAddress = uni.getLocation;
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ wxOjb.ready(() => {
|
|
|
+ console.log('加载完毕注册事件');
|
|
|
+ locationAddress({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: function(res) {
|
|
|
+ console.log('获取经纬度', res);
|
|
|
+ obj.longitude4 = res.longitude;
|
|
|
+ obj.latitude4 = res.latitude;
|
|
|
+ obj.marker = [{
|
|
|
+ longitude: res.longitude,
|
|
|
+ latitude: res.latitude,
|
|
|
+ iconPath: '/static/img/img19.png',
|
|
|
+ width: '45',
|
|
|
+ height: '45'
|
|
|
+ }];
|
|
|
+ obj.loadData();
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log('失败', e);
|
|
|
+ // window.location.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef MP
|
|
|
locationAddress({
|
|
|
type: 'gcj02',
|
|
|
success: function(res) {
|
|
|
@@ -333,47 +363,38 @@
|
|
|
},
|
|
|
fail(e) {
|
|
|
console.log('失败', e);
|
|
|
- // window.location.reload();
|
|
|
obj.tishi()
|
|
|
}
|
|
|
});
|
|
|
- });
|
|
|
- // #endif
|
|
|
-
|
|
|
- // #ifdef MP
|
|
|
- locationAddress({
|
|
|
- type: 'gcj02',
|
|
|
- success: function(res) {
|
|
|
- console.log('获取经纬度', res);
|
|
|
- obj.longitude4 = res.longitude;
|
|
|
- obj.latitude4 = res.latitude;
|
|
|
- obj.marker = [{
|
|
|
- longitude: res.longitude,
|
|
|
- latitude: res.latitude,
|
|
|
- iconPath: '/static/img/img19.png',
|
|
|
- width: '45',
|
|
|
- height: '45'
|
|
|
- }];
|
|
|
- obj.loadData();
|
|
|
- },
|
|
|
- fail(e) {
|
|
|
- console.log('失败', e);
|
|
|
- obj.tishi()
|
|
|
- }
|
|
|
- });
|
|
|
- // #endif
|
|
|
- } catch (e) {
|
|
|
- let locationAddress;
|
|
|
- // #ifdef H5
|
|
|
- let wxOjb = require('jweixin-module');
|
|
|
- locationAddress = wxOjb.getLocation;
|
|
|
- // #endif
|
|
|
- // #ifdef MP
|
|
|
- locationAddress = uni.getLocation;
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- wxOjb.ready(() => {
|
|
|
- console.log('加载完毕注册事件');
|
|
|
+ // #endif
|
|
|
+ } catch (e) {
|
|
|
+ let locationAddress;
|
|
|
+ // #ifdef H5
|
|
|
+ let wxOjb = require('jweixin-module');
|
|
|
+ locationAddress = wxOjb.getLocation;
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP
|
|
|
+ locationAddress = uni.getLocation;
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ wxOjb.ready(() => {
|
|
|
+ console.log('加载完毕注册事件');
|
|
|
+ locationAddress({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: function(res) {
|
|
|
+ console.log('获取经纬度', res);
|
|
|
+ obj.longitude4 = res.longitude;
|
|
|
+ obj.latitude4 = res.latitude;
|
|
|
+ obj.loadData();
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log('失败', e);
|
|
|
+ obj.tishi()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // #endif
|
|
|
+ // #ifdef MP
|
|
|
locationAddress({
|
|
|
type: 'gcj02',
|
|
|
success: function(res) {
|
|
|
@@ -387,24 +408,31 @@
|
|
|
obj.tishi()
|
|
|
}
|
|
|
});
|
|
|
- });
|
|
|
- // #endif
|
|
|
- // #ifdef MP
|
|
|
- locationAddress({
|
|
|
+ // #endif
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ uni.getLocation({
|
|
|
type: 'gcj02',
|
|
|
success: function(res) {
|
|
|
console.log('获取经纬度', res);
|
|
|
obj.longitude4 = res.longitude;
|
|
|
obj.latitude4 = res.latitude;
|
|
|
+ obj.marker = [{
|
|
|
+ longitude: res.longitude,
|
|
|
+ latitude: res.latitude,
|
|
|
+ iconPath: '/static/img/img19.png',
|
|
|
+ width: '45',
|
|
|
+ height: '45'
|
|
|
+ }];
|
|
|
obj.loadData();
|
|
|
},
|
|
|
fail(e) {
|
|
|
console.log('失败', e);
|
|
|
- obj.tishi()
|
|
|
+ // window.location.reload();
|
|
|
}
|
|
|
- });
|
|
|
- // #endif
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState('user', ['userInfo', 'baseURL', 'hasLogin']),
|
|
|
@@ -416,6 +444,14 @@
|
|
|
// },
|
|
|
methods: {
|
|
|
...mapMutations('user', ['setUserInfo']),
|
|
|
+ loadIndex() {
|
|
|
+ loadIndexs({}).then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ console.log(data,'index')
|
|
|
+ this.carouselList = data.banner; //轮播图
|
|
|
+ });
|
|
|
+ },
|
|
|
tocontribution() {
|
|
|
uni.navigateTo({
|
|
|
// url: "/pages/applic/contribution"
|
|
|
@@ -543,18 +579,8 @@
|
|
|
data
|
|
|
}) => {
|
|
|
obj.setUserInfo(data);
|
|
|
- loadIndexs({}).then(({
|
|
|
- data
|
|
|
- }) => {
|
|
|
- console.log(data,'index')
|
|
|
- obj.carouselList = data.banner; //轮播图
|
|
|
- bannerlist().then(({
|
|
|
- data
|
|
|
- }) => {
|
|
|
- console.log(data);
|
|
|
- obj.science = data;
|
|
|
- });
|
|
|
- });
|
|
|
+ obj.to_phone = data.mobile || ''
|
|
|
+
|
|
|
});
|
|
|
if (obj.loadingType === 'noMore') {
|
|
|
//防止重复加载
|
|
|
@@ -695,20 +721,20 @@
|
|
|
content: '是否发起求救?',
|
|
|
success: res => {
|
|
|
if (res.confirm) {
|
|
|
- this.$refs.popup.open(item, index);
|
|
|
+ this.$refs.popup2.open(item, index);
|
|
|
obj.rescuers_id = item.id
|
|
|
obj.user_id = item.user_id
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ close2() {
|
|
|
+ this.$refs.popup2.close()
|
|
|
+ },
|
|
|
comfirm1: function() {
|
|
|
let obj = this
|
|
|
if (obj.to_phone.toString().trim() == '') {
|
|
|
- // uni.showModal({
|
|
|
- // title:'输入框为空',
|
|
|
- // // content:JSON.stringify(obj)
|
|
|
- // })
|
|
|
+ return obj.$api.msg('请输入手机号码')
|
|
|
} else {
|
|
|
console.log('obj.to_phone1111', obj.to_phone)
|
|
|
const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
|
|
|
@@ -716,22 +742,14 @@
|
|
|
obj.$api.msg('请填写正确的手机号码');
|
|
|
return;
|
|
|
}
|
|
|
- console.log('name:', obj.name)
|
|
|
- console.log('uid:', obj.uid)
|
|
|
- console.log('phone', obj.phone)
|
|
|
- console.log('to_phone', obj.to_phone)
|
|
|
- console.log('longitude', obj.longitude)
|
|
|
- console.log('latitude', obj.latitude)
|
|
|
- console.log('iscall', obj.iscall)
|
|
|
- tocall({
|
|
|
- name: obj.name,
|
|
|
- uid: obj.uid,
|
|
|
- phone: obj.phone,
|
|
|
- longitude: obj.longitude4,
|
|
|
- latitude: obj.latitude4,
|
|
|
- to_phone: obj.to_phone
|
|
|
- }).then((data) => {
|
|
|
- console.log(99988, data)
|
|
|
+ sos({
|
|
|
+ mobile: obj.to_phone,
|
|
|
+ address: obj.user_address,
|
|
|
+ latitude: obj.latitude,
|
|
|
+ longitude: obj.longitude,
|
|
|
+ rescuers_id: obj.rescuers_id,
|
|
|
+ rescuers_user_id: obj.user_id
|
|
|
+ }).then(res => {
|
|
|
uni.showModal({
|
|
|
title: '请耐心等待救援',
|
|
|
success: res => {
|
|
|
@@ -741,8 +759,6 @@
|
|
|
}
|
|
|
})
|
|
|
obj.$refs.popup2.close();
|
|
|
- obj.iscall = false
|
|
|
- console.log(123, obj.iscall)
|
|
|
})
|
|
|
}
|
|
|
},
|