hwq 4 years ago
parent
commit
3d4f4f9009

+ 29 - 2
api/category.js

@@ -7,6 +7,24 @@ export function getMechanismList(data) {
 		method:'get',
 		data
 	})
+}
+
+// 获取aed列表
+export function getAed(data) {
+	return request({
+		url: '/api/institution/aed',
+		method: 'get',
+		data
+	})
+}
+
+// 获取救护站列表
+export function getAidList(data) {
+	return request({
+		url:'/api/institution/station',
+		method:'get',
+		data
+	})
 }
 
 //申请成为救援者
@@ -45,7 +63,7 @@ export function sos(data) {
 	})
 }
 
-//
+//逆解析地址
 export function geocoder(data) {
 	return request({
 		url:'/api/geocoder',
@@ -61,4 +79,13 @@ export function getRescueList(data) {
 		method:'get',
 		data
 	})
-}
+}
+
+// 处理救援申请
+export function changeRescue(data) {
+	return request({
+		url:'/api/rescue/setstatus',
+		method:'post',
+		data
+	})
+}

+ 16 - 14
api/index.js

@@ -1,5 +1,7 @@
 import request from '@/utils/request'
-import {upFilse} from '@/utils/request'
+import {
+	upFilse
+} from '@/utils/request'
 
 // 获取轮播图
 export function loadIndexs(data) {
@@ -90,7 +92,7 @@ export function joinSecc(data) {
 }
 
 // 获取定位
-export function getdis (data) {
+export function getdis(data) {
 	return request({
 		url: '/api/getdis',
 		method: 'get',
@@ -98,7 +100,7 @@ export function getdis (data) {
 	});
 }
 // 立即救援
-export function tocall (data) {
+export function tocall(data) {
 	return request({
 		url: '/api/do_getdis',
 		method: 'get',
@@ -126,11 +128,11 @@ export function getseek(data) {
 
 // getcomAddress 获取常用地址
 export function getcomAddress(data) {
- return request({
-  url: '/api/get_commonly',
-  method: 'get',
-  data
- });
+	return request({
+		url: '/api/get_commonly',
+		method: 'get',
+		data
+	});
 }
 
 // 救援记录 rescue
@@ -169,11 +171,11 @@ export function getDistance(data) {
 
 // deleteList 删除救援地址
 export function deleteList(data) {
- return request({
-  url: '/api/del_resc',
-  method: 'get',
-  data
- });
+	return request({
+		url: '/api/rescue/sos_del',
+		method: 'get',
+		data
+	});
 }
 //获取机构
 export function getListMechanism(data) {
@@ -208,4 +210,4 @@ export function getCompany(data) {
 		method: 'get',
 		data
 	});
-}
+}

+ 8 - 0
api/user.js

@@ -25,4 +25,12 @@ export function userinfoid(data) {
 		method: 'post',
 		data
 	});
+}
+
+export function getMyloveList(data) {
+	return request({
+		url: '/api/lave/mylst',
+		method: 'get',
+		data
+	})
 }

+ 1 - 1
components/uni-swipe-action-item/uni-swipe-action-item.vue

@@ -250,7 +250,7 @@
 			rightOptions: {
 				type: Array,
 				default () {
-					return []
+					return ['取消','删除']
 				}
 			}
 

+ 2 - 2
manifest.json

@@ -79,8 +79,8 @@
         "enable" : false
     },
     "h5" : {
-        "title" : "神农架林区红十字会",
-        "domain" : "slj.igxys.com",
+        "title" : "孝感市红十字会",
+        "domain" : "red.frp.liuniu946.com",
         "router" : {
             "mode" : "hash",
             "base" : "/index/"

+ 12 - 1
pages.json

@@ -557,6 +557,17 @@
 					// #endif
 				"navigationBarTitleText": "我的"
 			}
+		},
+		{
+			"path": "pages/user/jkjl",
+			"style": {
+				// #ifndef MP
+				"app-plus": {
+					"titleNView": false
+				},
+					// #endif
+				"navigationBarTitleText": "捐款记录"
+			}
 		},
 		{
 			"path": "pages/category/search",
@@ -901,7 +912,7 @@
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "神农架林区红十字会",
+		"navigationBarTitleText": "孝感市红十字会",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#F8F8F8"
 	},

+ 711 - 549
pages/applic/aed.vue

@@ -1,550 +1,712 @@
-<template>
-	<view class="content">
-		<view id="map" class="map">
-			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx; height: 600rpx" :latitude="latitude"
-				:longitude="longitude" :markers="aedmarker"></map>
-		</view>
-		<scroll-view scroll-y="true" class="scroll-wrapper" :style="{'height': height}" @scrolltolower="loadData">
-			<espempty v-if="loaded && AEDList.length === 0" :tit="'智能AED列表为空'"></espempty>
-			<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
-				<template>
-					<view class="list-left">
-						<view class="info">
-							<view class="title">{{ item.introduction }}</view>
-							<view class="addr">地址:{{ item.address }}</view>
-						</view>
-					</view>
-					<view class="image">
-						<image src="../../static/img/img10.png"></image>
-						<view class="tip" v-if="item.space > 999">>999m</view>
-						<view class="tip" v-else>{{ item.space }}m</view>
-					</view>
-				</template>
-			</view>
-			<uni-load-more :status="loadtype"></uni-load-more>
-		</scroll-view>
-		<uni-popup ref="popup" type="bottom" @click="close">
-			<view class="popup_row">
-				<view class="rows">
-					<view class="rows-item" @click="toGaodeMap">高德地图</view>
-					<view class="rows-item" @click="tobaiDuMap">百度地图</view>
-					<view class="rows-item" @click="totengxunMap">腾讯地图</view>
-				</view>
-			</view>
-		</uni-popup>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex';
-	import espempty from '@/components/espempty';
-	import uniPopup from '@/components/uni-popup/uni-popup.vue';
-	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import {
-		getdis,
-		tocall,
-		getListAED
-	} from '@/api/index.js';
-	import {
-		userinfo
-	} from '@/api/user.js';
-	import {
-		getcomAddress
-	} from '@/api/index.js';
-	export default {
-		components: {
-			uniPopup,
-			espempty,
-			uniLoadMore
-		},
-		//相关配置参数
-		data() {
-			return {
-				aedmarker: [],
-				loaded: false,
-				loadtype: 'more',
-				page: 1,
-				limit: 10,
-				AEDList: [],
-				height: '',
-				list: [],
-				latitude: '',
-				longitude: '',
-				current: 0,
-				name: '',
-				uid: '',
-				name: '',
-				phone: '',
-				to_phone: '',
-				marker: [],
-				specificAdd: '',
-				addressData: {
-					name: '',
-					mobile: '',
-					latitude: 0, //纬度
-					longitude: 0, //经度
-					address: {
-						province: '',
-						city: '',
-						district: '',
-						detail: '',
-					},
-					area: '',
-					default: false
-				},
-			}
-		},
-		onReady(res) {
-			var _this = this;
-			uni.getSystemInfo({
-				success: resu => {
-					const query = uni.createSelectorQuery();
-					query.select('.scroll-wrapper').boundingClientRect();
-					query.exec(function(res) {
-						console.log(res, 'ddddddddddddd');
-						_this.height = resu.windowHeight - res[0].top + 'px';
-						console.log('打印页面的剩余高度', _this.height);
-					});
-				},
-				fail: res => {}
-			});
-		},
-		onLoad() {
-			let obj = this;
-			console.log('开始加载事件');
-			// obj.loadBaseData();
-			// obj.loadData();
-			try {
-				let locationAddress
-				// #ifdef H5
-				let wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(() => {
-					console.log('加载完毕注册事件');
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.marker = [{
-								latitude: obj.latitude,
-								longitude: obj.longitude,
-								iconPath: '/static/img/img19.png',
-								width: '45',
-								height: '45',
-							}, ]
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-							window.location.reload();
-						}
-					});
-				})
-
-			} catch (e) {
-				console.log(e);
-				let locationAddress
-				// #ifdef H5
-				let wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(() => {
-					console.log('加载完毕注册事件');
-
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度1', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-						}
-					});
-				})
-
-			}
-		},
-		computed: {
-			...mapState('user', ['hasLogin', 'userInfo'])
-		},
-		methods: {
-			...mapMutations('user', ['setUserInfo']),
-			// 地图渲染完毕事件
-			mapChange(e) {
-				console.log(e);
-			},
-			// 载入数据
-			async loadData() {
-				let obj = this;
-				if(obj.loadtype == 'loading' || obj.loadtype == 'noMore') {
-					return 
-				}
-				obj.loadtype = 'loading'
-				getListAED({
-					page: obj.page,
-					limit: obj.limit,
-				}).then(({data}) => {
-					console.log(data, 999);
-					for (let i = 0; i < data.length; i++) {
-						data[i].space = obj.space(obj.latitude, obj.longitude, data[i].latitude, data[i].longitude);
-					}
-					obj.AEDList = obj.AEDList.concat(data);
-					console.log(obj.AEDList, 'obj.AEDList+++++++');
-					let arr = data.map(item => ({
-						latitude: item.latitude,
-						longitude: item.longitude,
-						iconPath: '/static/img/img014.png',
-						width: '35',
-						height: '35',
-						id: item.id,
-						address: item.address
-					}));
-					obj.aedmarker = obj.marker.concat(arr)
-					// obj.markerList = data;
-					obj.loaded = true
-					obj.page++;
-					if (obj.limit == data.length) {
-						obj.loadtype = 'more';
-						
-					} else {
-						obj.loadtype = 'noMore';
-					}
-				})
-			},
-			space(lat1, lng1, lat2, lng2) {
-				console.log(lat1, lng1, lat2, lng2);
-				var radLat1 = (lat1 * Math.PI) / 180.0;
-				var radLat2 = (lat2 * Math.PI) / 180.0;
-				var a = radLat1 - radLat2;
-				var b = (lng1 * Math.PI) / 180.0 - (lng2 * Math.PI) / 180.0;
-				var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
-				s = s * 6378.137;
-				s = Math.round(s * 10000) / 10000;
-				return s * 1000; // 单位米
-			},
-			openAddress(item) {
-				let obj = this;
-				obj.latitude2 = item.latitude;
-				obj.longitude2 = item.longitude;
-				obj.address = item.address;
-				this.$refs.popup.open();
-			},
-			// 调用高德
-			toGaodeMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let address = this.address;
-				console.log('选择高德', latitude, longitude, address);
-				window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`;
-			},
-			// 调用腾讯
-			totengxunMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let address = this.address;
-				console.log('选择腾讯', latitude, longitude);
-				window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
-			},
-			// 调用百度
-			tobaiDuMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let latitude6 = this.latitude;
-				let longitude6 = this.longitude;
-				let address = this.address;
-				console.log('选择百度', latitude, longitude);
-				console.log('获取当前经纬度', latitude6, longitude6);
-				window.location.href = `http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${address}&output=html&src=webapp.baidu.openAPIdemo`;
-				//`bdapp://map/navi?location=${longitude},${latitude}&coord_type=gc02&title=${address}&content=${address}&output=html&src=andr.baidu.openAPIdemo `
-			},
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	body,
-	page {
-		height: 100%;
-		width: 100%;
-		background-color: #fff;
-	}
-
-	.content {
-		height: 100%;
-		width: 100%;
-		background-color: #fff;
-	}
-
-	.map {
-		width: 100%;
-		height: 600rpx;
-	}
-
-	/* #ifdef H5 */
-	.location {
-		overflow-y: scroll; //溢出就滑动起来
-		// z-index: 990;
-		position: fixed;
-		bottom: 0;
-		height: 55%;
-		width: 100%;
-		background-color: #fff;
-		padding: 24rpx;
-
-		//搜索框
-		.Search-box {
-			// z-index: 999;
-			height: 80rpx;
-			// position: fixed;
-			// 		top: 0;
-			// 		left: 0;
-			// 		width: 100%;
-			// background: #FFFFFF;
-			// padding-top: 10rpx;
-			padding-right: 24rpx;
-			padding-left: 24rpx;
-
-			.Search-box-sort {
-				float: left;
-				margin-left: 32rpx;
-				margin-right: 19rpx;
-
-				.sort-text {
-					width: 57rpx;
-					height: 29rpx;
-					font-size: 30rpx;
-					font-weight: 500;
-					color: rgba(51, 51, 51, 1);
-					line-height: 58rpx;
-					margin-right: 19rpx;
-				}
-
-				.sort-img {
-					width: 21rpx;
-					height: 11rpx;
-					margin-bottom: 4rpx;
-				}
-			}
-
-			.Search-box-size {
-				// width:70%;
-				height: 58rpx;
-				border-radius: 32rpx;
-				background-color: #f1f1f1;
-				padding-left: 36rpx;
-				display: flex;
-				align-items: center;
-
-				.box-img {
-					height: 32rpx;
-					width: 32rpx;
-					margin-right: 16rpx;
-				}
-
-				// .box-right{
-				// 	height: 58rpx;
-				// 	// width: 100%;
-				// 	background-color: pink;
-				// }
-
-				.box-word {
-					width: 100%;
-					font-size: 26rpx;
-					font-weight: 500;
-					color: rgba(205, 203, 203, 1);
-					line-height: 55rpx;
-				}
-			}
-		}
-
-		.location-item {
-			z-index: 1000;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			border-bottom: 1rpx solid #E7E8EA;
-			padding: 15rpx 0;
-
-			.box-left {
-				display: flex;
-
-				.img01 {
-					width: 8rpx;
-					height: 28rpx;
-					margin-right: 18rpx;
-
-					image {
-						width: 8rpx;
-						height: 28rpx;
-					}
-				}
-
-				.img02 {
-					width: 117rpx;
-					height: 117rpx;
-					border-radius: 50%;
-
-					image {
-						width: 117rpx;
-						height: 117rpx;
-						border-radius: 50%;
-					}
-				}
-
-				.info {
-					margin-left: 16rpx;
-
-					.info-header {
-						display: flex;
-						align-items: center;
-
-						.name {
-							font-size: 32rpx;
-							color: #333333;
-						}
-
-						.distance {
-							margin-left: 25rpx;
-							font-size: 28rpx;
-							color: #303133;
-						}
-
-						.location-icon {
-							margin-left: 10rpx;
-							width: 20rpx;
-							height: 26rpx;
-
-							image {
-								width: 20rpx;
-								height: 26rpx;
-								display: inline;
-							}
-						}
-					}
-
-					.address {
-						font-size: 26rpx;
-						color: #333333;
-						margin-top: 33rpx;
-					}
-				}
-			}
-
-			.box-right {
-				.img {
-					height: 107rpx;
-
-					image {
-						width: 107rpx;
-						height: 107rpx;
-					}
-				}
-
-				.called {
-					margin-right: 16rpx;
-					height: 107rpx;
-					line-height: 107rpx;
-					font-size: 28rpx;
-					color: #CB131C;
-				}
-			}
-		}
-	}
-
-	/* #endif */
-
-	.list-tpl {
-		background-color: #ffffff;
-		margin: 25rpx 0rpx;
-		padding: 25rpx 25rpx;
-		font-size: 28rpx;
-		border-radius: 15rpx;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		border-bottom: 1px solid #f1f1f1;
-
-		.list-left {
-			display: flex;
-			width: 100%;
-
-			.number {
-				font-size: 32rpx;
-				margin-right: 14rpx;
-			}
-
-			.info {
-				width: 100%;
-
-				.title {
-					font-size: 32rpx;
-					color: #222222;
-					font-weight: 500;
-				}
-
-				.addr {
-					width: 400rpx;
-					margin-top: 20rpx;
-					font-size: 20rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #999999;
-				}
-			}
-		}
-
-		.image {
-			width: 10%;
-			text-align: center;
-
-			image {
-				width: 50rpx;
-				height: 50rpx;
-			}
-
-			.tip {
-				color: #7f7f7f;
-				font-size: 21rpx;
-			}
-		}
-	}
-	.popup_row {
-		width: 100%;
-		height: 500rpx;
-		background-color: #ffffff;
-		border-radius: 20rpx;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	
-		.rows {
-			width: 100%;
-			padding: 0 24rpx;
-	
-			.rows-item {
-				height: 80rpx;
-				line-height: 80rpx;
-				text-align: center;
-				width: 100%;
-				font-size: 32rpx;
-				color: #303133;
-			}
-		}
-	}
+<template>
+	<view class="content">
+		<view id="map" class="map">
+			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx;" :style="{'height': height}"
+				:latitude="latitude" :longitude="longitude" :markers="marker" @markertap="lookmore"></map>
+		</view>
+		<!-- <scroll-view scroll-y="true" class="scroll-wrapper" :style="{'height': height}" @scrolltolower="loadData">
+			<espempty v-if="loaded && AEDList.length === 0" :tit="'智能AED列表为空'"></espempty>
+			<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
+				<template>
+					<view class="list-left">
+						<view class="info">
+							<view class="title">{{ item.name }}</view>
+							<view class="addr">地址:{{ item.install_address }}</view>
+						</view>
+					</view>
+					<view class="image">
+						<image src="../../static/img/img10.png"></image>
+						<view class="tip">{{item.distance >= 1000 ? item.range + 'km': item.distance + 'm'}}</view>
+					</view>
+				</template>
+			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
+		</scroll-view> -->
+		<uni-popup ref="popup" type="bottom" @click="close">
+			<view class="popup_row">
+				<view class="rows">
+					<view class="rows-item" @click="toGaodeMap">高德地图</view>
+					<view class="rows-item" @click="tobaiDuMap">百度地图</view>
+					<view class="rows-item" @click="totengxunMap">腾讯地图</view>
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="aedxq" type="bottom" @click="closeAedXq">
+			<view class="aedxq-wrap">
+				<view class="xq-top">
+					<view class="aed-name">
+						{{showAed.name}}
+					</view>
+					<view class="aed-dis">
+						距离:{{showAed.dis}}
+					</view>
+					<view class="aed-address" style="padding-top: 10rpx;">
+						地址:{{showAed.address}}
+					</view>
+					<view class="aed-address" style="padding-top: 10rpx;">
+						安装位置:{{showAed.addressxq}}
+					</view>
+				</view>
+				<view class="xq-img-wrap">
+					<scroll-view scroll-x="true" class="aed-img-scroll">
+						<view class="" style="display: flex;flex-wrap: nowrap;">
+							<image :src="'http://red.frp.liuniu946.com'+item" mode="heightFix"
+								v-for="item in showAed.imgs" class="aed-img" @click="openimg(item)"></image>
+						</view>
+					</scroll-view>
+					<view class="aed-phone" @click="makecall(showAed.phone)">
+						电话
+					</view>
+				</view>
+				<view class="aed-dh" @click="opendh">
+					导航
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="lookimg" type="center">
+			<view class="pop-wrap" style="position: relative;">
+				<movable-area class="popup-box">
+					<movable-view class="popup-item" :scale="true" direction="all">
+						<image :src="chooseImg" mode="widthFix"></image>
+					</movable-view>
+				</movable-area>
+				<image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;"
+					@click="closePup"></image>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import espempty from '@/components/espempty';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import {
+		getAed
+	} from '@/api/category.js'
+	export default {
+		components: {
+			uniPopup,
+			espempty,
+			uniLoadMore
+		},
+		//相关配置参数
+		data() {
+			return {
+				aedmarker: [],
+				loaded: false,
+				loadingType: 'more',
+				page: 1,
+				limit: 100,
+				AEDList: [],
+				height: '',
+				list: [],
+				latitude: '',// 本地坐标
+				longitude: '',// 本地坐标
+				phone: '',
+				marker: [],
+				showAed: {
+					name: '',
+					address: '',
+					addressxq: '',
+					dis: '',
+					lat: '',
+					lon: '',
+					imgs: [],
+					phone: ''
+				},
+				chooseImg: '',
+			}
+		},
+		onReady(res) {
+			var _this = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.map').boundingClientRect();
+					query.exec(function(res) {
+						console.log(res, 'ddddddddddddd');
+						_this.height = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.height);
+					});
+				},
+				fail: res => {}
+			});
+		},
+		onLoad() {
+			let obj = this;
+			this.getLocal()
+
+		},
+		computed: {
+			...mapState('user', ['hasLogin', 'userInfo']),
+			...mapState(['baseURL'])
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			// 导航
+			opendh() {
+				console.log('导航')
+				this.$refs.aedxq.close()
+				this.$refs.popup.open();
+			},
+			// 关闭图片弹窗
+			closePup() {
+				this.$refs.lookimg.close()
+			},
+			// 打开图片弹窗
+			openimg(src) {
+				this.chooseImg = this.baseURL + src
+				this.$refs.lookimg.open()
+			},
+			// 拨打电话
+			makecall(num) {
+				uni.makePhoneCall({
+					phoneNumber: num + ''
+				})
+			},
+			// 关闭aed详情
+			closeAedXq() {
+				this.$refs.aedxq.close()
+			},
+			// 打开aed详情
+			lookmore(e) {
+				console.log(e)
+				let obj = this
+				obj.AEDList.forEach(item => {
+					if (item.id == e.detail.markerId) {
+						obj.showAed = {
+							name: item.name,
+							address: item.address,
+							addressxq: item.install_address,
+							dis: item.range >= 1 ? (item.range + 'km') : (item.distance + 'm'),
+							lat: item.latitude,
+							lon: item.longitude,
+							imgs: item.images.split(','),
+							phone: item.phone
+						}
+						// break
+					}
+				})
+				this.$refs.aedxq.open()
+			},
+			// 获取本地坐标
+			getLocal() {
+				let obj = this;
+				console.log('ddddddddddddddddddddddddd')
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(() => {
+					console.log('加载完毕注册事件');
+					wxOjb.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude = Math.abs(e.latitude)
+							obj.longitude = Math.abs(e.longitude)
+							console.log('本地坐标', obj.latitude, obj.longitude)
+							let item = {
+								id: 0,
+								latitude: obj.latitude,
+								longitude: obj.longitude,
+								iconPath: '/static/img/img19.png',
+								width: '35',
+								height: '35',
+							}
+							obj.marker.push(item)
+							obj.loadData()
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
+				})
+				
+			},
+			// 地图渲染完毕事件
+			mapChange(e) {
+				console.log(e);
+			},
+			// 载入数据
+			async loadData() {
+				let obj = this;
+				if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
+					return
+				}
+				obj.loadingType = 'loading'
+				getAed({
+					latitude: obj.latitude,
+					longitude: obj.longitude,
+					page: obj.page,
+					limit: obj.limit,
+				}).then(({
+					data
+				}) => {
+					console.log(data, 'aed++++++++++++++')
+					obj.AEDList = obj.AEDList.concat(data);
+					let arr = data.map(item => ({
+						latitude: item.latitude,
+						longitude: item.longitude,
+						iconPath: '/static/img/img014.png',
+						width: '35',
+						height: '35',
+						id: item.id,
+						address: item.address
+					}));
+					if (data.length == obj.limit) {
+						obj.loadingType = 'more'
+					} else {
+						obj.loadingType = 'noMore'
+					}
+					obj.marker = obj.marker.concat(arr)
+				})
+			},
+			// 调用高德
+			toGaodeMap() {
+				let latitude = this.showAed.lat;
+				let longitude = this.showAed.lon;
+				let address = this.showAed.name;
+				console.log(address)
+				console.log('选择高德', latitude, longitude, address);
+				window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`;
+			},
+			// 调用腾讯
+			totengxunMap() {
+				let latitude = this.showAed.lat;
+				let longitude = this.showAed.lon;
+				let address = this.showAed.name;
+				console.log('选择腾讯', latitude, longitude);
+				window.location.href =
+					`http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
+			},
+			// 调用百度
+			tobaiDuMap() {
+				let latlon = this.bd_encrypt(this.showAed.lon,this.showAed.lat)
+				let latlon1 = this.bd_encrypt( this.longitude,this.latitude)
+				let latitude = latlon.bd_lat;
+				let longitude = latlon.bd_lng;
+				let latitude6 = latlon1.bd_lat;
+				let longitude6 = latlon1.bd_lng;
+				let address = this.showAed.name;
+				console.log('选择百度', latitude, longitude);
+				console.log('获取当前经纬度', latitude6, longitude6);
+				window.location.href =
+					`http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${address}&output=html&src=webapp.baidu.openAPIdemo`;
+			},
+			// 高德坐标、腾讯坐标转百度坐标
+			bd_encrypt(gg_lng, gg_lat) {
+				var X_PI = Math.PI * 3000.0 / 180.0;
+				var x = gg_lng,
+					y = gg_lat;
+				var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * X_PI);
+				var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * X_PI);
+				var bd_lng = z * Math.cos(theta) + 0.0065;
+				var bd_lat = z * Math.sin(theta) + 0.006;
+				return {
+					bd_lat: bd_lat,
+					bd_lng: bd_lng
+				};
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	body,
+	page {
+		height: 100%;
+		width: 100%;
+		background-color: #fff;
+	}
+
+	.content {
+		height: 100%;
+		width: 100%;
+		background-color: #fff;
+	}
+
+	.map {
+		width: 100%;
+		height: 100%;
+	}
+
+	/* #ifdef H5 */
+	.location {
+		overflow-y: scroll; //溢出就滑动起来
+		// z-index: 990;
+		position: fixed;
+		bottom: 0;
+		height: 55%;
+		width: 100%;
+		background-color: #fff;
+		padding: 24rpx;
+
+		//搜索框
+		.Search-box {
+			// z-index: 999;
+			height: 80rpx;
+			// position: fixed;
+			// 		top: 0;
+			// 		left: 0;
+			// 		width: 100%;
+			// background: #FFFFFF;
+			// padding-top: 10rpx;
+			padding-right: 24rpx;
+			padding-left: 24rpx;
+
+			.Search-box-sort {
+				float: left;
+				margin-left: 32rpx;
+				margin-right: 19rpx;
+
+				.sort-text {
+					width: 57rpx;
+					height: 29rpx;
+					font-size: 30rpx;
+					font-weight: 500;
+					color: rgba(51, 51, 51, 1);
+					line-height: 58rpx;
+					margin-right: 19rpx;
+				}
+
+				.sort-img {
+					width: 21rpx;
+					height: 11rpx;
+					margin-bottom: 4rpx;
+				}
+			}
+
+			.Search-box-size {
+				// width:70%;
+				height: 58rpx;
+				border-radius: 32rpx;
+				background-color: #f1f1f1;
+				padding-left: 36rpx;
+				display: flex;
+				align-items: center;
+
+				.box-img {
+					height: 32rpx;
+					width: 32rpx;
+					margin-right: 16rpx;
+				}
+
+				// .box-right{
+				// 	height: 58rpx;
+				// 	// width: 100%;
+				// 	background-color: pink;
+				// }
+
+				.box-word {
+					width: 100%;
+					font-size: 26rpx;
+					font-weight: 500;
+					color: rgba(205, 203, 203, 1);
+					line-height: 55rpx;
+				}
+			}
+		}
+
+		.location-item {
+			z-index: 1000;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 1rpx solid #E7E8EA;
+			padding: 15rpx 0;
+
+			.box-left {
+				display: flex;
+
+				.img01 {
+					width: 8rpx;
+					height: 28rpx;
+					margin-right: 18rpx;
+
+					image {
+						width: 8rpx;
+						height: 28rpx;
+					}
+				}
+
+				.img02 {
+					width: 117rpx;
+					height: 117rpx;
+					border-radius: 50%;
+
+					image {
+						width: 117rpx;
+						height: 117rpx;
+						border-radius: 50%;
+					}
+				}
+
+				.info {
+					margin-left: 16rpx;
+
+					.info-header {
+						display: flex;
+						align-items: center;
+
+						.name {
+							font-size: 32rpx;
+							color: #333333;
+						}
+
+						.distance {
+							margin-left: 25rpx;
+							font-size: 28rpx;
+							color: #303133;
+						}
+
+						.location-icon {
+							margin-left: 10rpx;
+							width: 20rpx;
+							height: 26rpx;
+
+							image {
+								width: 20rpx;
+								height: 26rpx;
+								display: inline;
+							}
+						}
+					}
+
+					.address {
+						font-size: 26rpx;
+						color: #333333;
+						margin-top: 33rpx;
+					}
+				}
+			}
+
+			.box-right {
+				.img {
+					height: 107rpx;
+
+					image {
+						width: 107rpx;
+						height: 107rpx;
+					}
+				}
+
+				.called {
+					margin-right: 16rpx;
+					height: 107rpx;
+					line-height: 107rpx;
+					font-size: 28rpx;
+					color: #CB131C;
+				}
+			}
+		}
+	}
+
+	/* #endif */
+
+	.list-tpl {
+		background-color: #ffffff;
+		margin-bottom: 25rpx;
+		padding: 25rpx 25rpx;
+		font-size: 28rpx;
+		border-radius: 15rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		border-bottom: 1px solid #f1f1f1;
+
+		.list-left {
+			display: flex;
+			width: 100%;
+
+			.number {
+				font-size: 32rpx;
+				margin-right: 14rpx;
+			}
+
+			.info {
+				width: 100%;
+
+				.title {
+					font-size: 32rpx;
+					color: #222222;
+					font-weight: 500;
+				}
+
+				.addr {
+					width: 400rpx;
+					margin-top: 20rpx;
+					font-size: 20rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+				}
+			}
+		}
+
+		.image {
+			width: 20%;
+			text-align: center;
+
+			image {
+				width: 50rpx;
+				height: 50rpx;
+			}
+
+			.tip {
+				color: #7f7f7f;
+				font-size: 21rpx;
+			}
+		}
+	}
+
+	.popup_row {
+		width: 100%;
+		height: 500rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+
+		.rows {
+			width: 100%;
+			padding: 0 24rpx;
+
+			.rows-item {
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				width: 100%;
+				font-size: 32rpx;
+				color: #303133;
+			}
+		}
+	}
+
+	.scroll-wrapper {
+		padding-top: 20rpx;
+	}
+
+	.aedxq-wrap {
+		margin: auto;
+		width: 710rpx;
+		height: 462rpx;
+		border-radius: 20rpx;
+		padding: 0 25rpx;
+		background-color: rgba($color: #000000, $alpha: 0.9);
+		color: #fff;
+		position: relative;
+
+		.xq-top {
+			padding-top: 25rpx;
+			width: 660rpx;
+			height: 297rpx;
+			border-bottom: 1px solid #fff;
+
+			.aed-name {
+				font-size: 28rpx;
+				width: 479rpx;
+			}
+
+			.aed-dis {
+				padding-top: 10rpx;
+				font-size: 22rpx;
+				width: 479rpx;
+			}
+		}
+
+		.xq-img-wrap {
+			height: 165rpx;
+			width: 660rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.aed-img-scroll {
+				height: 107rpx;
+				width: 508rpx;
+				// background-color: #bfa;
+				// display: flex;
+				// // justify-content: ;
+				// // flex-direction: column;
+				// flex-wrap: nowrap;
+
+				.aed-img {
+					// display: inline-block;
+					height: 107rpx;
+					// width: 107rpx;
+					margin-right: 15rpx;
+					// background-color: red;
+					flex-shrink: 0;
+
+				}
+			}
+
+			.aed-phone {
+				width: 112rpx;
+				height: 52rpx;
+				line-height: 52rpx;
+				text-align: center;
+				border: 1px solid #fff;
+				border-radius: 10rpx;
+			}
+
+			// background-color: red;
+		}
+
+		.aed-dh {
+			width: 147rpx;
+			height: 82rpx;
+			line-height: 82rpx;
+			text-align: center;
+			background-color: #4d8bd6;
+			border-radius: 15rpx;
+			position: absolute;
+			right: 25rpx;
+			top: 25rpx;
+		}
+	}
+
+	.pop-wrap {
+		width: 522rpx;
+		height: 800rpx;
+		// background-color: red;
+	}
+
+	.popup-box {
+		width: 522rpx;
+		height: 800rpx;
+		border-radius: 20rpx;
+		position: relative;
+		overflow: hidden;
+		background-color: #fff;
+
+		.popup-item {
+			width: 100%;
+			height: 100%;
+
+
+			image {
+				width: 100%;
+				// height: 100%;
+			}
+		}
+
+	}
+
+	.close {
+		display: block;
+		width: 40rpx;
+		height: 40rpx;
+		border: 50%;
+		position: absolute;
+		// background-color: red;
+		bottom: -100rpx;
+		left: 0;
+		right: 0;
+		margin: 0 auto;
+	}
 </style>

+ 693 - 553
pages/applic/aid.vue

@@ -1,554 +1,694 @@
-<template>
-	<view class="content">
-		<view id="map" class="map">
-			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx; height: 600rpx" :latitude="latitude"
-				:longitude="longitude" :markers="jhzmarker"></map>
-		</view>
-		<scroll-view scroll-y="true" class="scroll-wrapper" :style="{'height': height}" @scrolltolower="loadData">
-			<espempty v-if="loaded && AEDList.length === 0" :tit="'救护站列表为空'"></espempty>
-			<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
-				<template>
-					<view class="list-left">
-						<view class="info">
-							<view class="title">{{ item.name }}</view>
-							<view class="addr">地址:{{ item.address }}</view>
-						</view>
-					</view>
-					<view class="image">
-						<image src="../../static/img/img10.png"></image>
-						<view class="tip" v-if="item.space > 999">>999m</view>
-						<view class="tip" v-else>{{ item.space }}m</view>
-					</view>
-				</template>
-			</view>
-			<uni-load-more :status="loadtype"></uni-load-more>
-		</scroll-view>
-		<uni-popup ref="popup" type="bottom" @click="close">
-			<view class="popup_row">
-				<view class="rows">
-					<view class="rows-item" @click="toGaodeMap">高德地图</view>
-					<view class="rows-item" @click="tobaiDuMap">百度地图</view>
-					<view class="rows-item" @click="totengxunMap">腾讯地图</view>
-				</view>
-			</view>
-		</uni-popup>
-	</view>
-</template>
-
-<script>
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex';
-	import espempty from '@/components/espempty';
-	import uniPopup from '@/components/uni-popup/uni-popup.vue';
-	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import {
-		getdis,
-		tocall,
-		getListMechanism
-	} from '@/api/index.js';
-	import {
-		userinfo
-	} from '@/api/user.js';
-	import {
-		getcomAddress
-	} from '@/api/index.js';
-	export default {
-		components: {
-			uniPopup,
-			espempty,
-			uniLoadMore
-		},
-		//相关配置参数
-		data() {
-			return {
-				loaded: false,
-				jhzmarker: [],
-				loadtype: 'more',
-				page: 1,
-				limit: 10,
-				AEDList: [],
-				height: '',
-				list: [],
-				latitude: '',
-				longitude: '',
-				current: 0,
-				name: '',
-				uid: '',
-				name: '',
-				phone: '',
-				to_phone: '',
-				marker: [],
-				specificAdd: '',
-				addressData: {
-					name: '',
-					mobile: '',
-					latitude: 0, //纬度
-					longitude: 0, //经度
-					address: {
-						province: '',
-						city: '',
-						district: '',
-						detail: '',
-					},
-					area: '',
-					default: false
-				},
-			}
-		},
-		onReady(res) {
-			var _this = this;
-			uni.getSystemInfo({
-				success: resu => {
-					const query = uni.createSelectorQuery();
-					query.select('.scroll-wrapper').boundingClientRect();
-					query.exec(function(res) {
-						console.log(res, 'ddddddddddddd');
-						_this.height = resu.windowHeight - res[0].top + 'px';
-						console.log('打印页面的剩余高度', _this.height);
-					});
-				},
-				fail: res => {}
-			});
-		},
-		onLoad() {
-			let obj = this;
-			console.log('开始加载事件');
-			// obj.loadBaseData();
-			// uni.showLoading({
-			// 	title: '加载中',
-			// 	mask: true
-			// });
-			// obj.loadData();
-			try {
-				let locationAddress
-				// #ifdef H5
-				let wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(() => {
-					console.log('加载完毕注册事件');
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.marker = [{
-								latitude: obj.latitude,
-								longitude: obj.longitude,
-								iconPath: '/static/img/img19.png',
-								width: '45',
-								height: '45',
-							}, ]
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-							window.location.reload();
-						}
-					});
-				})
-
-			} catch (e) {
-				console.log(e);
-				let locationAddress
-				// #ifdef H5
-				let wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(() => {
-					console.log('加载完毕注册事件');
-
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度1', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-						}
-					});
-				})
-
-			}
-		},
-		computed: {
-			...mapState('user', ['hasLogin', 'userInfo'])
-		},
-		methods: {
-			...mapMutations('user', ['setUserInfo']),
-			// 地图渲染完毕事件
-			mapChange(e) {
-				console.log(e);
-			},
-			// 载入数据
-			async loadData() {
-				let obj = this;
-				if(obj.loadtype == 'loading' || obj.loadtype == 'noMore') {
-					return 
-				}
-				getListMechanism({
-					page: obj.page,
-					limit: obj.limit,
-				}).then(({data}) => {
-					uni.hideLoading();
-					console.log(data, 999);
-					for (let i = 0; i < data.length; i++) {
-						data[i].space = obj.space(obj.latitude, obj.longitude, data[i].latitude, data[i].longitude);
-					}
-					let arr = data.map(item => ({
-						latitude: item.latitude,
-						longitude: item.longitude,
-						iconPath: '/static/img/img014.png',
-						width: '35',
-						height: '35',
-						id: item.id,
-						address: item.address
-					}));
-					obj.jhzmarker = obj.marker.concat(arr)
-					obj.AEDList = obj.AEDList.concat(data);
-					console.log(obj.AEDList, 'obj.AEDList+++++++');
-					// obj.markerList = data;
-					obj.loaded = true
-					if (obj.limit == data.length) {
-						obj.loadtype = 'more';
-						obj.page++;
-					} else {
-						obj.loadtype = 'noMore';
-					}
-				})
-			},
-			space(lat1, lng1, lat2, lng2) {
-				console.log(lat1, lng1, lat2, lng2);
-				var radLat1 = (lat1 * Math.PI) / 180.0;
-				var radLat2 = (lat2 * Math.PI) / 180.0;
-				var a = radLat1 - radLat2;
-				var b = (lng1 * Math.PI) / 180.0 - (lng2 * Math.PI) / 180.0;
-				var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
-				s = s * 6378.137;
-				s = Math.round(s * 10000) / 10000;
-				return s * 1000; // 单位米
-			},
-			openAddress(item) {
-				let obj = this;
-				obj.latitude2 = item.latitude;
-				obj.longitude2 = item.longitude;
-				obj.address = item.address;
-				this.$refs.popup.open();
-			},
-			// 调用高德
-			toGaodeMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let address = this.address;
-				console.log('选择高德', latitude, longitude, address);
-				window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`;
-			},
-			// 调用腾讯
-			totengxunMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let address = this.address;
-				console.log('选择腾讯', latitude, longitude);
-				window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
-			},
-			// 调用百度
-			tobaiDuMap() {
-				let latitude = this.latitude2;
-				let longitude = this.longitude2;
-				let latitude6 = this.latitude;
-				let longitude6 = this.longitude;
-				let address = this.address;
-				console.log('选择百度', latitude, longitude);
-				console.log('获取当前经纬度', latitude6, longitude6);
-				window.location.href = `http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${address}&output=html&src=webapp.baidu.openAPIdemo`;
-				//`bdapp://map/navi?location=${longitude},${latitude}&coord_type=gc02&title=${address}&content=${address}&output=html&src=andr.baidu.openAPIdemo `
-			},
-			
-		}
-	}
-</script>
-
-<style lang="scss">
-	body,
-	page {
-		height: 100%;
-		width: 100%;
-		background-color: #fff;
-	}
-
-	.content {
-		height: 100%;
-		width: 100%;
-		background-color: #fff;
-	}
-
-	.map {
-		width: 100%;
-		height: 600rpx;
-	}
-
-	/* #ifdef H5 */
-	.location {
-		overflow-y: scroll; //溢出就滑动起来
-		// z-index: 990;
-		position: fixed;
-		bottom: 0;
-		height: 55%;
-		width: 100%;
-		background-color: #fff;
-		padding: 24rpx;
-
-		//搜索框
-		.Search-box {
-			// z-index: 999;
-			height: 80rpx;
-			// position: fixed;
-			// 		top: 0;
-			// 		left: 0;
-			// 		width: 100%;
-			// background: #FFFFFF;
-			// padding-top: 10rpx;
-			padding-right: 24rpx;
-			padding-left: 24rpx;
-
-			.Search-box-sort {
-				float: left;
-				margin-left: 32rpx;
-				margin-right: 19rpx;
-
-				.sort-text {
-					width: 57rpx;
-					height: 29rpx;
-					font-size: 30rpx;
-					font-weight: 500;
-					color: rgba(51, 51, 51, 1);
-					line-height: 58rpx;
-					margin-right: 19rpx;
-				}
-
-				.sort-img {
-					width: 21rpx;
-					height: 11rpx;
-					margin-bottom: 4rpx;
-				}
-			}
-
-			.Search-box-size {
-				// width:70%;
-				height: 58rpx;
-				border-radius: 32rpx;
-				background-color: #f1f1f1;
-				padding-left: 36rpx;
-				display: flex;
-				align-items: center;
-
-				.box-img {
-					height: 32rpx;
-					width: 32rpx;
-					margin-right: 16rpx;
-				}
-
-				// .box-right{
-				// 	height: 58rpx;
-				// 	// width: 100%;
-				// 	background-color: pink;
-				// }
-
-				.box-word {
-					width: 100%;
-					font-size: 26rpx;
-					font-weight: 500;
-					color: rgba(205, 203, 203, 1);
-					line-height: 55rpx;
-				}
-			}
-		}
-
-		.location-item {
-			z-index: 1000;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			border-bottom: 1rpx solid #E7E8EA;
-			padding: 15rpx 0;
-
-			.box-left {
-				display: flex;
-
-				.img01 {
-					width: 8rpx;
-					height: 28rpx;
-					margin-right: 18rpx;
-
-					image {
-						width: 8rpx;
-						height: 28rpx;
-					}
-				}
-
-				.img02 {
-					width: 117rpx;
-					height: 117rpx;
-					border-radius: 50%;
-
-					image {
-						width: 117rpx;
-						height: 117rpx;
-						border-radius: 50%;
-					}
-				}
-
-				.info {
-					margin-left: 16rpx;
-
-					.info-header {
-						display: flex;
-						align-items: center;
-
-						.name {
-							font-size: 32rpx;
-							color: #333333;
-						}
-
-						.distance {
-							margin-left: 25rpx;
-							font-size: 28rpx;
-							color: #303133;
-						}
-
-						.location-icon {
-							margin-left: 10rpx;
-							width: 20rpx;
-							height: 26rpx;
-
-							image {
-								width: 20rpx;
-								height: 26rpx;
-								display: inline;
-							}
-						}
-					}
-
-					.address {
-						font-size: 26rpx;
-						color: #333333;
-						margin-top: 33rpx;
-					}
-				}
-			}
-
-			.box-right {
-				.img {
-					height: 107rpx;
-
-					image {
-						width: 107rpx;
-						height: 107rpx;
-					}
-				}
-
-				.called {
-					margin-right: 16rpx;
-					height: 107rpx;
-					line-height: 107rpx;
-					font-size: 28rpx;
-					color: #CB131C;
-				}
-			}
-		}
-	}
-
-	/* #endif */
-
-	.list-tpl {
-		background-color: #ffffff;
-		margin: 25rpx 0rpx;
-		padding: 25rpx 25rpx;
-		font-size: 28rpx;
-		border-radius: 15rpx;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		border-bottom: 1px solid #f1f1f1;
-
-		.list-left {
-			display: flex;
-			width: 100%;
-
-			.number {
-				font-size: 32rpx;
-				margin-right: 14rpx;
-			}
-
-			.info {
-				width: 100%;
-
-				.title {
-					font-size: 32rpx;
-					color: #222222;
-					font-weight: 500;
-				}
-
-				.addr {
-					width: 400rpx;
-					margin-top: 20rpx;
-					font-size: 20rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #999999;
-				}
-			}
-		}
-
-		.image {
-			width: 10%;
-			text-align: center;
-
-			image {
-				width: 50rpx;
-				height: 50rpx;
-			}
-
-			.tip {
-				color: #7f7f7f;
-				font-size: 21rpx;
-			}
-		}
-	}
-	.popup_row {
-		width: 100%;
-		height: 500rpx;
-		background-color: #ffffff;
-		border-radius: 20rpx;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	
-		.rows {
-			width: 100%;
-			padding: 0 24rpx;
-	
-			.rows-item {
-				height: 80rpx;
-				line-height: 80rpx;
-				text-align: center;
-				width: 100%;
-				font-size: 32rpx;
-				color: #303133;
-			}
-		}
-	}
+<template>
+	<view class="content">
+		<view id="map" class="map">
+			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx;" :style="{'height': height}"
+				:latitude="latitude" :longitude="longitude" :markers="marker" @markertap="lookmore"></map>
+		</view>
+		<!-- <scroll-view scroll-y="true" class="scroll-wrapper" :style="{'height': height}" @scrolltolower="loadData">
+			<espempty v-if="loaded && AEDList.length === 0" :tit="'智能AED列表为空'"></espempty>
+			<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
+				<template>
+					<view class="list-left">
+						<view class="info">
+							<view class="title">{{ item.name }}</view>
+							<view class="addr">地址:{{ item.install_address }}</view>
+						</view>
+					</view>
+					<view class="image">
+						<image src="../../static/img/img10.png"></image>
+						<view class="tip">{{item.distance >= 1000 ? item.range + 'km': item.distance + 'm'}}</view>
+					</view>
+				</template>
+			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
+		</scroll-view> -->
+		<uni-popup ref="popup" type="bottom" @click="close">
+			<view class="popup_row">
+				<view class="rows">
+					<view class="rows-item" @click="toGaodeMap">高德地图</view>
+					<view class="rows-item" @click="tobaiDuMap">百度地图</view>
+					<view class="rows-item" @click="totengxunMap">腾讯地图</view>
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="aedxq" type="bottom" @click="closeAedXq">
+			<view class="aedxq-wrap">
+				<view class="logo-wrap flex">
+					<image :src="baseURL + showAed.imgs" mode="" class="logo"></image>
+					<view class="aid-name">
+						{{showAed.name}}
+					</view>
+				</view>
+
+				<view class="aed-dis" style="padding-top: 20rpx;">
+					距离:{{showAed.dis}}
+				</view>
+				<view class="aed-address" style="padding-top: 10rpx;">
+					地址:{{showAed.address}}
+				</view>
+				<view class="aed-address" style="padding-top: 10rpx;">
+					联系方式:{{showAed.phone}}
+				</view>
+				<view class="aed-dh" @click="opendh">
+					导航
+				</view>
+				<view class="aed-phone" @click="makecall(showAed.phone)">
+					电话
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="lookimg" type="center">
+			<view class="pop-wrap" style="position: relative;">
+				<movable-area class="popup-box">
+					<movable-view class="popup-item" :scale="true" direction="all">
+						<image :src="chooseImg" mode="widthFix"></image>
+					</movable-view>
+				</movable-area>
+				<image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;"
+					@click="closePup"></image>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import espempty from '@/components/espempty';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import {
+		getAed,
+		getAidList
+	} from '@/api/category.js'
+	export default {
+		components: {
+			uniPopup,
+			espempty,
+			uniLoadMore
+		},
+		//相关配置参数
+		data() {
+			return {
+				aedmarker: [],
+				loaded: false,
+				loadingType: 'more',
+				page: 1,
+				limit: 100,
+				AEDList: [],
+				height: '',
+				list: [],
+				latitude: '', // 本地坐标
+				longitude: '', // 本地坐标
+				phone: '',
+				marker: [],
+				showAed: {
+					name: '',
+					address: '',
+					addressxq: '',
+					dis: '',
+					lat: '',
+					lon: '',
+					imgs: '',
+					phone: ''
+				},
+				chooseImg: '',
+			}
+		},
+		onReady(res) {
+			var _this = this;
+			uni.getSystemInfo({
+				success: resu => {
+					const query = uni.createSelectorQuery();
+					query.select('.map').boundingClientRect();
+					query.exec(function(res) {
+						console.log(res, 'ddddddddddddd');
+						_this.height = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.height);
+					});
+				},
+				fail: res => {}
+			});
+		},
+		onLoad() {
+			let obj = this;
+			this.getLocal()
+
+		},
+		computed: {
+			...mapState('user', ['hasLogin', 'userInfo']),
+			...mapState(['baseURL'])
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			// 导航
+			opendh() {
+				console.log('导航')
+				this.$refs.aedxq.close()
+				this.$refs.popup.open();
+			},
+			// 关闭图片弹窗
+			closePup() {
+				this.$refs.lookimg.close()
+			},
+			// 打开图片弹窗
+			openimg(src) {
+				this.chooseImg = this.baseURL + src
+				this.$refs.lookimg.open()
+			},
+			// 拨打电话
+			makecall(num) {
+				uni.makePhoneCall({
+					phoneNumber: num + ''
+				})
+			},
+			// 关闭aed详情
+			closeAedXq() {
+				this.$refs.aedxq.close()
+			},
+			// 打开aed详情
+			lookmore(e) {
+				console.log(e)
+				let obj = this
+				obj.AEDList.forEach(item => {
+					if (item.id == e.detail.markerId) {
+						obj.showAed = {
+							name: item.name,
+							address: item.address,
+							addressxq: item.install_address,
+							dis: item.range >= 1 ? (item.range + 'km') : (item.distance + 'm'),
+							lat: item.latitude,
+							lon: item.longitude,
+							imgs: item.image,
+							phone: item.phone
+						}
+						// break
+					}
+				})
+				this.$refs.aedxq.open()
+			},
+			// 获取本地坐标
+			getLocal() {
+				let obj = this;
+				console.log('ddddddddddddddddddddddddd')
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(()=> {
+					wxOjb.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude = Math.abs(e.latitude)
+							obj.longitude = Math.abs(e.longitude)
+							console.log('本地坐标', obj.latitude, obj.longitude)
+							let item = {
+								id: 0,
+								latitude: obj.latitude,
+								longitude: obj.longitude,
+								iconPath: '/static/img/img19.png',
+								width: '35',
+								height: '35',
+							}
+							obj.marker.push(item)
+							obj.loadData()
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
+				})
+			},
+			// 地图渲染完毕事件
+			mapChange(e) {
+				console.log(e);
+			},
+			// 载入数据
+			async loadData() {
+				let obj = this;
+				if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
+					return
+				}
+				obj.loadingType = 'loading'
+				getAidList({
+					latitude: obj.latitude,
+					longitude: obj.longitude,
+					page: obj.page,
+					limit: obj.limit,
+				}).then(({
+					data
+				}) => {
+					console.log(data, 'aed++++++++++++++')
+					obj.AEDList = obj.AEDList.concat(data);
+					let arr = data.map(item => ({
+						latitude: item.latitude,
+						longitude: item.longitude,
+						iconPath: '/static/img/img014.png',
+						width: '35',
+						height: '35',
+						id: item.id,
+						address: item.address
+					}));
+					if (data.length == obj.limit) {
+						obj.loadingType = 'more'
+					} else {
+						obj.loadingType = 'noMore'
+					}
+					obj.marker = obj.marker.concat(arr)
+				})
+			},
+			// 调用高德
+			toGaodeMap() {
+				let latitude = this.showAed.lat;
+				let longitude = this.showAed.lon;
+				let address = this.showAed.name;
+				console.log(address)
+				console.log('选择高德', latitude, longitude, address);
+				window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`;
+			},
+			// 调用腾讯
+			totengxunMap() {
+				let latitude = this.showAed.lat;
+				let longitude = this.showAed.lon;
+				let address = this.showAed.name;
+				console.log('选择腾讯', latitude, longitude);
+				window.location.href =
+					`http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
+			},
+			// 调用百度
+			tobaiDuMap() {
+				let latlon = this.bd_encrypt(this.showAed.lon, this.showAed.lat)
+				let latlon1 = this.bd_encrypt(this.longitude, this.latitude)
+				let latitude = latlon.bd_lat;
+				let longitude = latlon.bd_lng;
+				let latitude6 = latlon1.bd_lat;
+				let longitude6 = latlon1.bd_lng;
+				let address =this.showAed.name;
+				console.log('选择百度', latitude, longitude);
+				console.log('获取当前经纬度', latitude6, longitude6);
+				window.location.href =
+					`http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${address}&output=html&src=webapp.baidu.openAPIdemo`;
+			},
+			// 高德坐标、腾讯坐标转百度坐标
+			bd_encrypt(gg_lng, gg_lat) {
+				var X_PI = Math.PI * 3000.0 / 180.0;
+				var x = gg_lng,
+					y = gg_lat;
+				var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * X_PI);
+				var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * X_PI);
+				var bd_lng = z * Math.cos(theta) + 0.0065;
+				var bd_lat = z * Math.sin(theta) + 0.006;
+				return {
+					bd_lat: bd_lat,
+					bd_lng: bd_lng
+				};
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	body,
+	page {
+		height: 100%;
+		width: 100%;
+		background-color: #fff;
+	}
+
+	.content {
+		height: 100%;
+		width: 100%;
+		background-color: #fff;
+	}
+
+	.map {
+		width: 100%;
+		height: 100%;
+	}
+
+	/* #ifdef H5 */
+	.location {
+		overflow-y: scroll; //溢出就滑动起来
+		// z-index: 990;
+		position: fixed;
+		bottom: 0;
+		height: 55%;
+		width: 100%;
+		background-color: #fff;
+		padding: 24rpx;
+
+		//搜索框
+		.Search-box {
+			height: 80rpx;
+			padding-right: 24rpx;
+			padding-left: 24rpx;
+
+			.Search-box-sort {
+				float: left;
+				margin-left: 32rpx;
+				margin-right: 19rpx;
+
+				.sort-text {
+					width: 57rpx;
+					height: 29rpx;
+					font-size: 30rpx;
+					font-weight: 500;
+					color: rgba(51, 51, 51, 1);
+					line-height: 58rpx;
+					margin-right: 19rpx;
+				}
+
+				.sort-img {
+					width: 21rpx;
+					height: 11rpx;
+					margin-bottom: 4rpx;
+				}
+			}
+
+			.Search-box-size {
+				// width:70%;
+				height: 58rpx;
+				border-radius: 32rpx;
+				background-color: #f1f1f1;
+				padding-left: 36rpx;
+				display: flex;
+				align-items: center;
+
+				.box-img {
+					height: 32rpx;
+					width: 32rpx;
+					margin-right: 16rpx;
+				}
+
+				.box-word {
+					width: 100%;
+					font-size: 26rpx;
+					font-weight: 500;
+					color: rgba(205, 203, 203, 1);
+					line-height: 55rpx;
+				}
+			}
+		}
+
+		.location-item {
+			z-index: 1000;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 1rpx solid #E7E8EA;
+			padding: 15rpx 0;
+
+			.box-left {
+				display: flex;
+
+				.img01 {
+					width: 8rpx;
+					height: 28rpx;
+					margin-right: 18rpx;
+
+					image {
+						width: 8rpx;
+						height: 28rpx;
+					}
+				}
+
+				.img02 {
+					width: 117rpx;
+					height: 117rpx;
+					border-radius: 50%;
+
+					image {
+						width: 117rpx;
+						height: 117rpx;
+						border-radius: 50%;
+					}
+				}
+
+				.info {
+					margin-left: 16rpx;
+
+					.info-header {
+						display: flex;
+						align-items: center;
+
+						.name {
+							font-size: 32rpx;
+							color: #333333;
+						}
+
+						.distance {
+							margin-left: 25rpx;
+							font-size: 28rpx;
+							color: #303133;
+						}
+
+						.location-icon {
+							margin-left: 10rpx;
+							width: 20rpx;
+							height: 26rpx;
+
+							image {
+								width: 20rpx;
+								height: 26rpx;
+								display: inline;
+							}
+						}
+					}
+
+					.address {
+						font-size: 26rpx;
+						color: #333333;
+						margin-top: 33rpx;
+					}
+				}
+			}
+
+			.box-right {
+				.img {
+					height: 107rpx;
+
+					image {
+						width: 107rpx;
+						height: 107rpx;
+					}
+				}
+
+				.called {
+					margin-right: 16rpx;
+					height: 107rpx;
+					line-height: 107rpx;
+					font-size: 28rpx;
+					color: #CB131C;
+				}
+			}
+		}
+	}
+
+	/* #endif */
+
+	.list-tpl {
+		background-color: #ffffff;
+		margin-bottom: 25rpx;
+		padding: 25rpx 25rpx;
+		font-size: 28rpx;
+		border-radius: 15rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		border-bottom: 1px solid #f1f1f1;
+
+		.list-left {
+			display: flex;
+			width: 100%;
+
+			.number {
+				font-size: 32rpx;
+				margin-right: 14rpx;
+			}
+
+			.info {
+				width: 100%;
+
+				.title {
+					font-size: 32rpx;
+					color: #222222;
+					font-weight: 500;
+				}
+
+				.addr {
+					width: 400rpx;
+					margin-top: 20rpx;
+					font-size: 20rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+				}
+			}
+		}
+
+		.image {
+			width: 20%;
+			text-align: center;
+
+			image {
+				width: 50rpx;
+				height: 50rpx;
+			}
+
+			.tip {
+				color: #7f7f7f;
+				font-size: 21rpx;
+			}
+		}
+	}
+
+	.popup_row {
+		width: 100%;
+		height: 500rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+
+		.rows {
+			width: 100%;
+			padding: 0 24rpx;
+
+			.rows-item {
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				width: 100%;
+				font-size: 32rpx;
+				color: #303133;
+			}
+		}
+	}
+
+	.scroll-wrapper {
+		padding-top: 20rpx;
+	}
+
+	.aedxq-wrap {
+		margin: auto;
+		width: 710rpx;
+		min-height: 200rpx;
+		border-radius: 20rpx;
+		padding: 25rpx 25rpx 25rpx 25rpx;
+		background-color: rgba($color: #000000, $alpha: 0.9);
+		color: #fff;
+		position: relative;
+		.logo-wrap {
+			width: 460rpx;
+			// background-color: red;
+			align-items: center;
+			.logo {
+				width: 100rpx;
+				height: 100rpx;
+				border-radius: 50%;
+			}
+			.aid-name {
+				display: inline-block;
+				width: 340rpx;
+				padding-left: 20rpx;
+				font-size: 32rpx;
+				// background-color: #bfa;
+				// text-align: center;
+			}
+		}
+		.xq-top {
+			padding-top: 25rpx;
+			width: 660rpx;
+			height: 297rpx;
+			border-bottom: 1px solid #fff;
+			.aed-name {
+				font-size: 28rpx;
+				width: 479rpx;
+			}
+			
+			.aed-dis {
+				padding-top: 10rpx;
+				font-size: 22rpx;
+				width: 479rpx;
+			}
+			
+		}
+
+		.xq-img-wrap {
+			height: 165rpx;
+			width: 660rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.aed-img-scroll {
+				height: 107rpx;
+				width: 508rpx;
+				.aed-img {
+					height: 107rpx;
+					margin-right: 15rpx;
+					flex-shrink: 0;
+
+				}
+			}
+		}
+
+		.aed-dh {
+			width: 147rpx;
+			height: 82rpx;
+			line-height: 82rpx;
+			text-align: center;
+			background-color: #4d8bd6;
+			border-radius: 15rpx;
+			position: absolute;
+			right: 25rpx;
+			top: 25rpx;
+		}
+		.aed-phone {
+			width: 112rpx;
+			height: 52rpx;
+			line-height: 52rpx;
+			text-align: center;
+			border: 1px solid #fff;
+			border-radius: 10rpx;
+			position: absolute;
+			right: 25rpx;
+			top: 225rpx;
+		}
+	}
+	.pop-wrap {
+		width: 522rpx;
+		height: 800rpx;
+		// background-color: red;
+	}
+	.popup-box {
+		width: 522rpx;
+		height: 800rpx;
+		border-radius: 20rpx;
+		position: relative;
+		overflow: hidden;
+		background-color: #fff;
+
+		.popup-item {
+			width: 100%;
+			height: 100%;
+			image {
+				width: 100%;
+			}
+		}
+	}
+
+	.close {
+		display: block;
+		width: 40rpx;
+		height: 40rpx;
+		border: 50%;
+		position: absolute;
+		// background-color: red;
+		bottom: -100rpx;
+		left: 0;
+		right: 0;
+		margin: 0 auto;
+	}
 </style>
-

+ 3 - 2
pages/applic/contribution.vue

@@ -436,13 +436,14 @@
 					is_open: obj.is_public, //是否实名公开
 					is_ticket: obj.is_receipts, //是否开发票
 					pay_type:0,//支付方式0微信1支付宝
-					type: obj.way_id
+					type: obj.way_id,
+					// form: 
 				}).then(({
 					data
 				}) => {
 					console.log(345, data)
 					console.log(666, obj)
-					let res = data.result.jsConfig;
+					let res = data.jsConfig;
 					console.log(res)
 					// 仅作为示例,非真实参数信息。
 					obj.weichatObj.chooseWXPay({

+ 0 - 387
pages/applic/helprecords copy.vue

@@ -1,387 +0,0 @@
-<template>
-	<view class="container">
-		<uni-swipe-action>
-			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)" v-for="(item,index) in list">
-			<view class="list">
-				<view class="list-left" >
-					<view class="list-top">
-						救援者姓名:{{item.to_name}}
-					</view>
-					<view class="list-phone">
-						手机号:{{item.to_phone}}
-					</view>
-					<view class="list-time">
-						救援时间:{{item.add_time}}
-					</view>
-					<view class="list-box">
-						<view class="list-type" v-if="item.status == 1">
-							已接受
-						</view>
-						<view class="list-type" v-if="item.status == 0">
-							未接受
-						</view>
-						<view class="list-type" v-if="item.status == 2">
-							已拒绝
-						</view>
-						<view class="box-item" @click="tocall(item.to_phone)">
-							<image src="../../static/icon/call.png" mode="" class="call"></image>
-							拨打电话
-						</view>
-					</view>
-				</view>
-			</view>
-		
-			</uni-swipe-action-item>
-		</uni-swipe-action>
-		<!-- <view class="list" v-for="(item,index) in list" :key='index'>
-		</view> -->
-		<uni-popup ref="popup1" type="center">
-			<view class="popup-box">
-				<view class="img">
-					<image src="../../static/img/map.jpg" mode=""></image>
-				</view>
-				<view class="mian">
-					<view class="delivery">
-						求救记录
-						<!-- {{ i18n.qrhwsdm }} -->
-					</view>
-					<view class="nocancel">
-						确认删除该记录吗?
-						<!-- {{ i18n.wfcx }} -->
-					</view>
-					<view class="comfirm-box">
-						<view class="cancel" @click="cancel">
-							取消
-						</view>
-						<view class="comfirm" @click="comfirm(tmp)">
-							 确认
-						</view>
-					</view>
-				</view>
-			</view>
-		
-		</uni-popup>
-		<empty v-if="list.length === 0"></empty>
-		<uni-load-more :status="loadingType"></uni-load-more>
-	</view>
-</template>
-
-<script>
-	import {
-		deleteList,
-		getseek
-	} from '@/api/index.js';
-	import empty from '@/components/empty';
-	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
-	import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue';
-	export default {
-		components: {
-			empty,
-			uniLoadMore,
-			uniSwipeAction,
-			uniSwipeActionItem
-		},
-		data() {
-			return {
-				id:'',
-				options: [{
-					text: '取消',
-					style: {
-						backgroundColor: '#007aff'
-					}
-				}, {
-					text: '确认',
-					style: {
-						backgroundColor: '#C90F1B'
-					}
-				}],
-				page: 1,
-				limit: 10,
-				delBtnWidth: 60, //删除按钮宽度单位(rpx)
-				startX:'',
-				isDel:false,
-				list: [],
-				loadingType: 'more',
-			}
-		},
-		onLoad() {
-			this.loadData();
-		},
-		// 下拉加载
-		onReachBottom() {
-			this.loadData();
-		},
-		methods: {
-			bindClick(e) {
-				// console.log(333,e)
-				// console.log('e.index',e.index)
-				// console.log('this.tmp',this.tmp)
-				// console.log('点击了' + (e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')
-				if ( e.content.text == '取消' ) {
-					console.log('点击了左侧取消按钮')
-				} else {
-					console.log('点击了右侧确认按钮')
-					// this.$refs.popup1.open(this.tmp);
-					this.open(this.id)
-				}
-			},
-			swipeChange(e, id) {
-			// 	// console.log('当前状态:' + open + ',下标:' + index)
-				// console.log('index',index)
-				this.id = id
-				console.log('id111111111',id)
-			// 	if ( e == 'right' ) {
-			// 		this.index = index
-			// 		console.log('当前index值:',this.index)
-			// 	}
-			// 	// console.log(222,e)
-			},
-			// 确认删除吗?
-			comfirm (id) {
-				console.log(9999888,id)
-				deleteList({
-					id: this.id
-				}).then(({ data }) => {
-					window.location.reload(); //重新刷新页面
-					this.loadData()
-					this.cancel()
-				})
-			},
-			// 取消
-			cancel(){
-				this.$refs.popup1.close();
-			},
-			// 打开弹窗
-			open(tmp) {
-				console.log('打开弹窗',tmp)
-				this.$refs.popup1.open(tmp)
-			},
-			tocall(num) {
-				console.log(num);
-				uni.makePhoneCall({
-					phoneNumber: num //仅为示例
-				});
-			},
-			// touchS: function(e) {
-			// 	// console.log('touchS')
-			// 	if (e.touches.length == 1) {
-			// 		//设置触摸起始点水平方向位置
-			// 		this.startX = e.touches[0].clientX
-			// 		console.log(this.startX)
-			// 		this.isDel = true
-			// 	}
-			// },
-			// // 删除
-			// deleteMember() {
-			// 	console.log('删除')
-			// 	uni.showModal({
-			// 		title:'点击删除'
-			// 	})
-			// },
-			// cancelDel() {
-			// 	console.log('取消删除')
-			// 	this.isDel = false
-			// },
-			async loadData() {
-				let obj = this;
-				if (obj.loadingType === 'noMore') {
-					//防止重复加载
-					return;
-				}
-				// 修改当前对象状态为加载中
-				obj.loadingType = 'loading';
-				getseek({
-					page: obj.page,
-					limit: obj.limit
-				}).then(({
-					data
-				}) => {
-					obj.list = obj.list.concat(data);
-					obj.page++;
-					if (obj.limit == data.length) {
-						obj.loadingType = 'more';
-					} else {
-						obj.loadingType = 'noMore';
-					}
-				})
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.container {
-		line-height: 1;
-
-		.list {
-			width: 710rpx;
-			background: #FFFFFF;
-			box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
-			border-radius: 10rpx;
-			margin: 20rpx auto 0;
-			display: flex;
-			justify-content: space-between;
-			.list-left{
-				width: 100%;
-				padding: 24rpx 0 24rpx 24rpx;
-			}
-			.cancel{
-				background-color: #C9101B;
-				display: flex;
-				align-items: center;
-				padding: 0 30rpx;
-				color: #FFFFFF;
-			}
-
-			.list-top {
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #333333;
-				line-height: 36px;
-			}
-
-			.list-phone {
-				font-size: 24rpx;
-				font-weight: 500;
-				color: #666666;
-				margin-top: 20rpx;
-			}
-
-			.list-time {
-				font-size: 24rpx;
-				font-weight: 500;
-				color: #666666;
-				margin-top: 20rpx;
-			}
-
-			.list-type {
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #C9101B;
-				margin-top: 20rpx;
-			}
-
-			.list-box {
-				display: flex;
-				justify-content: space-between;
-				// justify-content: center;
-				padding: 0 40rpx;
-				margin-top: 20rpx;
-
-				.box-item {
-					width: 210rpx;
-					height: 65rpx;
-					background: #C9101B;
-					border-radius: 30rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #FFFFFF;
-
-					.call {
-						width: 28rpx;
-						height: 40rpx;
-						margin-right: 10rpx;
-					}
-
-				}
-
-				.box-item1 {
-					width: 210rpx;
-					height: 65rpx;
-					background: #FF4F4F;
-					border-radius: 30rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #FFFFFF;
-
-					.veo {
-						width: 40rpx;
-						height: 40rpx;
-						margin-right: 10rpx;
-					}
-				}
-			}
-
-		}
-		.popup-box {
-			width: 522rpx;
-			height: 605rpx;
-			background-color: #FFFFFF;
-			border-radius: 20rpx;
-		
-			.img {
-				border-radius: 20rpx 20rpx 0 0;
-				width: 522rpx;
-				height: 307rpx;
-		
-				image {
-					border-radius: 20rpx 20rpx 0 0;
-					width: 522rpx;
-					height: 307rpx;
-				}
-			}
-		
-			.mian {
-				display: flex;
-				flex-direction: column;
-				align-items: center;
-				padding: 32rpx 32rpx;
-				background-color: #FFFFFF;
-				border-radius: 0 0 20rpx 20rpx;
-				text-align: center;
-		
-				.delivery {
-					font-size: 36rpx;
-					color: #333333;
-					// margin-top: 46rpx;
-				}
-		
-				.nocancel {
-					font-size: 30rpx;
-					color: #999999;
-					margin-top: 26rpx;
-				}
-		
-				.comfirm-box {
-					margin-top: 52rpx;
-					display: flex;
-					// margin-bottom: 32rpx;
-		
-					// justify-content: space-around;
-					.cancel {
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						width: 197rpx;
-						height: 61rpx;
-						border: 1px solid #C90F1B;
-						border-radius: 31rpx;
-		
-						font-size: 24rpx;
-						color: #C90F1B;
-					}
-		
-					.comfirm {
-						margin-left: 32rpx;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						width: 197rpx;
-						height: 61rpx;
-						background: #C90F1B;
-						border-radius: 31px;
-						font-size: 24rpx;
-						color: #FFFFFF;
-					}
-				}
-			}
-		}
-	}
-</style>

+ 2 - 2
pages/applic/helprecords.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<uni-swipe-action>
-			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)"
+			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.sos_id)"
 				v-for="(item,index) in list">
 				<view class="list">
 					<view class="list-left">
@@ -30,7 +30,7 @@
 							<view class="list-type" v-if="item.status == -1">
 								拒绝
 							</view>
-							<view class="box-item" @click=" item.status == 1 ? tocall(item.to_phone): ''"
+							<view class="box-item" @click=" item.status == 1 ? tocall(item.rescue_phone): ''"
 								:class="{'action': (item.status == 1)}">
 								<image src="../../static/icon/call.png" mode="" class="call"></image>
 								拨打电话

+ 39 - 26
pages/applic/location.vue

@@ -44,7 +44,8 @@
 					</view>
 				</view>
 			</view>
-			<uni-load-more :status="loadingType"></uni-load-more>
+			<uni-load-more :status="loadingType"></uni-load-more>
+			<!-- <empty v-if="list.length === 0 && loaded"></empty> -->
 			<espempty v-if="list.length === 0 && loaded"></espempty>
 		</view>
 		<uni-popup ref="popup" type="center" @click="close">
@@ -155,33 +156,45 @@
 			...mapMutations('user', ['setUserInfo']),
 			// 获取本地坐标
 			getLocal() {
-				let obj = this;
-				console.log('ddddddddddddddddddddddddd')
+				let obj = this;
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(() => {
+					console.log('加载完毕注册事件');
+					wxOjb.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude = Math.abs(e.latitude)
+							obj.longitude = Math.abs(e.longitude)
+							console.log('本地坐标', obj.latitude, obj.longitude)
+							geocoder({
+								latitude: obj.latitude,
+								longitude: obj.longitude
+							}).then(res => {
+								console.log(res)
+								obj.user_address = res.data.result.address
+								console.log(obj.user_address, 'obj.user_address')
+							})
+							let item = {
+								id: 0,
+								latitude: obj.latitude,
+								longitude: obj.longitude,
+								iconPath: '/static/img/img19.png',
+								width: '35',
+								height: '35',
+							}
+							obj.marker.push(item)
+							obj.getRescuerList(obj.latitude, obj.longitude)
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
+				})
 				uni.getLocation({
 					type: 'gcj02',
 					success(e) {
-						console.log(e)
-						obj.latitude = Math.abs(e.latitude)
-						obj.longitude = Math.abs(e.longitude)
-						console.log('本地坐标', obj.latitude, obj.longitude)
-						geocoder({
-							latitude: obj.latitude,
-							longitude: obj.longitude
-						}).then(res => {
-							console.log(res)
-							obj.user_address = res.data.result.address
-							console.log(obj.user_address, 'obj.user_address')
-						})
-						let item = {
-							id: 0,
-							latitude: obj.latitude,
-							longitude: obj.longitude,
-							iconPath: '/static/img/img19.png',
-							width: '35',
-							height: '35',
-						}
-						obj.marker.push(item)
-						obj.getRescuerList(obj.latitude, obj.longitude)
+						
 					}
 				})
 			},
@@ -254,7 +267,7 @@
 						latitude: obj.latitude,
 						longitude: obj.longitude,
 						rescuers_id: obj.rescuers_id,
-						user_id: obj.user_id
+						rescuers_user_id: obj.user_id
 					}).then(res => {
 						uni.showModal({
 							title: '请耐心等待救援',

+ 755 - 733
pages/applic/rescuerecords.vue

@@ -1,734 +1,756 @@
-<template>
-	<view class="container">
-		<uni-swipe-action>
-			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)"
-				v-for="(item,index) in list">
-				<view :style="item.txtStyle" class="list">
-					<view class="box">
-						<view class="box-1">
-							<view class="box-2">
-								<view class="box-top">
-									求救者姓名:{{item.name}}
-								</view>
-								<view class="box-time">
-									求救时间:{{item.add_time}}
-								</view>
-							</view>
-							<view class="navImg" @click="toNav(item, index)">
-								<image src="../../static/img/img10.png" mode=""></image>
-								<view class="tip">导航</view>
-							</view>
-						</view>
-
-						<view class="box-sub-box" v-if="item.status == 0">
-							<view class="sub-box1" @click="agree(item,index)">
-								接受
-							</view>
-							<view class="sub-box2" @click="refuse(item,index)">
-								拒绝
-							</view>
-						</view>
-						<view class="box-sub-box" v-if="item.status === 1">
-							<view class="red-font" v-if="item.status == 1">
-								已接受
-							</view>
-							<view class="red-font" v-if="item.status == -1">
-								已拒绝
-							</view>
-							<view class="sub-box3" @click="tocall(item.phone)">
-								<image src="../../static/icon/call.png" mode="" class="call"></image>
-								拨打电话
-							</view>
-						</view>
-						<!-- <view class="remove" @click="delItem">删除</view> -->
-					</view>
-				</view>
-			</uni-swipe-action-item>
-		</uni-swipe-action>
-
-
-		<empty v-if="list.length === 0"></empty>
-		<uni-load-more :status="loadingType"></uni-load-more>
-		<uni-popup ref="popup" type="bottom" @click="close">
-			<view class="popup_row">
-				<view class="rows">
-					<view class="rows-item" @click="toGaodeMap">
-						高德地图
-					</view>
-					<view class="rows-item" @click="tobaiDuMap">
-						百度地图
-					</view>
-					<view class="rows-item" @click="totengxunMap">
-						腾讯地图
-					</view>
-				</view>
-			</view>
-		</uni-popup>
-
-		<uni-popup ref="popup1" type="center">
-			<view class="popup-box">
-				<view class="img">
-					<image src="../../static/img/map.jpg" mode=""></image>
-				</view>
-				<view class="mian">
-					<view class="delivery">
-						救援记录
-						<!-- {{ i18n.qrhwsdm }} -->
-					</view>
-					<view class="nocancel">
-						确认删除该记录吗?
-						<!-- {{ i18n.wfcx }} -->
-					</view>
-					<view class="comfirm-box">
-						<view class="cancel" @click="cancel">
-							取消
-						</view>
-						<view class="comfirm" @click="comfirm(tmp)">
-							确认
-						</view>
-					</view>
-				</view>
-			</view>
-
-		</uni-popup>
-	</view>
-</template>
-
-<script>
-	import {
-		deleteList,
-		getrescue,
-		change_rescue
-	} from '@/api/index.js';
-	import {
-		getRescueList
-	} from '@/api/category.js'
-
-	import empty from '@/components/empty';
-	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import uniPopup from '@/components/uni-popup/uni-popup.vue';
-	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
-	import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue';
-	export default {
-		components: {
-			empty,
-			uniPopup,
-			uniLoadMore,
-			uniSwipeAction,
-			uniSwipeActionItem
-		},
-		data() {
-			return {
-				id: '',
-				tmp: '',
-				options: [{
-					text: '取消',
-					style: {
-						backgroundColor: '#007aff'
-					}
-				}, {
-					text: '确认',
-					style: {
-						backgroundColor: '#C90F1B'
-					}
-				}],
-				page: 1,
-				limit: 10,
-				list: [],
-				loadingType: 'more',
-				latitude2: '',
-				longitude2: '',
-				longitude4: '',
-				latitude4: '',
-				address: '',
-			}
-		},
-		onLoad() {
-			this.loadData();
-			// this.getRescueList()
-			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('加载完毕注册事件');
-					locationAddress({
-						type: 'wgs84',
-						success: function(res) {
-							console.log('获取经纬度', res);
-							obj.longitude4 = res.longitude
-							obj.latitude4 = res.latitude
-							// obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-							window.location.reload();
-						}
-					});
-				})
-				// #endif
-
-				// #ifdef MP
-				locationAddress({
-					type: 'wgs84',
-					success: function(res) {
-						console.log('获取经纬度', res);
-						obj.longitude4 = res.longitude
-						obj.latitude4 = res.latitude
-						// obj.loadData();
-					},
-					fail(e) {
-						console.log('失败', e);
-						window.location.reload();
-					}
-				});
-				// #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: 'wgs84',
-						success: function(res) {
-							console.log('获取经纬度', res);
-							obj.longitude4 = res.longitude
-							obj.latitude4 = res.latitude
-							// obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-							window.location.reload();
-						}
-					});
-				})
-				// #endif
-				// #ifdef MP
-				locationAddress({
-					type: 'wgs84',
-					success: function(res) {
-						console.log('获取经纬度', res);
-						obj.longitude4 = res.longitude
-						obj.latitude4 = res.latitude
-						// obj.loadData();
-					},
-					fail(e) {
-						console.log('失败', e);
-						window.location.reload();
-					}
-				});
-				// #endif
-			}
-
-		},
-
-		methods: {
-			getRescueList() {
-				getRescueList({
-					type: 1,
-					page: 1,
-					limit: 10
-				}).then(res => {
-					console.log(res)
-				})
-			},
-			bindClick(e) {
-				// console.log(333,e)
-				// console.log('e.index',e.index)
-				// console.log('this.tmp',this.tmp)
-				// console.log('点击了' + (e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')
-				if (e.content.text == '取消') {
-					console.log('点击了左侧取消按钮')
-				} else {
-					console.log('点击了右侧确认按钮')
-					// this.$refs.popup1.open(this.tmp);
-					this.open(this.id)
-				}
-			},
-			swipeChange(e, id) {
-				// 	// console.log('当前状态:' + open + ',下标:' + index)
-				// console.log('index',index)
-				this.id = id
-				console.log('id111111111', id)
-				// 	if ( e == 'right' ) {
-				// 		this.index = index
-				// 		console.log('当前index值:',this.index)
-				// 	}
-				// 	// console.log(222,e)
-			},
-			// 确认删除吗?
-			comfirm(id) {
-				console.log(9999888, id)
-				deleteList({
-					id: this.id
-				}).then(({
-					data
-				}) => {
-					window.location.reload(); //重新刷新页面
-					this.loadData()
-					this.cancel()
-				})
-			},
-			// 取消
-			cancel() {
-				this.$refs.popup1.close();
-			},
-			// 打开弹窗
-			open(tmp) {
-				console.log('打开弹窗', tmp)
-				this.$refs.popup1.open(tmp)
-			},
-			// bindClick(){
-			// 	console.log(2222)
-			// },
-			async loadData() {
-				let obj = this;
-				if (obj.loadingType === 'noMore') {
-					//防止重复加载
-					return;
-				}
-				// 修改当前对象状态为加载中
-				obj.loadingType = 'loading';
-				getRescueList({
-					page: obj.page,
-					limit: obj.limit,
-					type: 1
-				}).then(({data}) => {
-					obj.list = obj.list.concat(data);
-					obj.page++;
-					if (obj.limit == data.length) {
-						obj.loadingType = 'more';
-					} else {
-						obj.loadingType = 'noMore';
-					}
-				})
-				// getrescue({
-				// 	page: obj.page,
-				// 	limit: obj.limit
-				// }).then(({
-				// 	data
-				// }) => {
-				// 	obj.list = obj.list.concat(data);
-				// 	obj.page++;
-				// 	if (obj.limit == data.length) {
-				// 		obj.loadingType = 'more';
-				// 	} else {
-				// 		obj.loadingType = 'noMore';
-				// 	}
-				// })
-			},
-			// 点击导航
-			toNav(item, index) {
-				console.log(item, index)
-				let obj = this
-				obj.latitude2 = item.latitude
-				obj.longitude2 = item.longitude
-				obj.address = item.address
-				this.$refs.popup.open();
-			},
-			// 调用高德
-			toGaodeMap() {
-				let latitude = this.latitude2
-				let longitude = this.longitude2
-				let address = this.address
-				console.log('选择高德', latitude, longitude, address)
-				// window.location.href =  'https://uri.amap.com/marker?position=30.537043,120.567191&name=浙江省嘉兴市桐乡市高桥镇高桥大道51号'
-				window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
-
-				// window.location.href = `http://uri.amap.com/navigation?from=114.02597366,22.54605355&to=114.029243,22.609562&mode=car&src=nyx_super`
-				// http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super
-			},
-			// 调用腾讯
-			totengxunMap() {
-				let latitude = this.latitude2
-				let longitude = this.longitude2
-				let address = this.address
-				console.log('选择腾讯', latitude, longitude)
-				window.location.href =
-					`http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
-			},
-			// 调用百度
-			tobaiDuMap() {
-				let latitude = this.latitude2
-				let longitude = this.longitude2
-				let latitude6 = this.latitude4
-				let longitude6 = this.longitude4
-				let address = this.address
-				console.log('选择百度', latitude, longitude)
-				console.log('获取当前经纬度', latitude6, longitude6)
-				window.location.href =
-					`http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${ address }&output=html&src=webapp.baidu.openAPIdemo`
-				//`bdapp://map/navi?location=${longitude},${latitude}&coord_type=gc02&title=${address}&content=${address}&output=html&src=andr.baidu.openAPIdemo `
-			},
-			// 拨打电话
-			tocall(num) {
-				console.log(num);
-				uni.makePhoneCall({
-					phoneNumber: num //仅为示例
-				});
-			},
-			//同意
-			agree(item, index) {
-				let obj = this;
-				uni.showModal({
-					content: '是否要接受该求救?',
-					success: res => {
-						if (res.confirm) {
-							change_rescue({
-								id: item.id,
-								status: 1
-							}).then((data) => {
-								obj.list[index].status = 1;
-								console.log(obj.list[index].status);
-							})
-						}
-					}
-				});
-			},
-			//拒绝
-			refuse(item, index) {
-				let obj = this;
-				uni.showModal({
-					content: '是否要拒绝该求救?',
-					success: res => {
-						if (res.confirm) {
-							change_rescue({
-								id: item.id,
-								status: 2
-							}).then((data) => {
-								obj.list[index].status = 2;
-								console.log(item);
-							})
-						}
-					}
-				})
-			},
-			// @touchstart="touchS" @touchmove="touchM" :data-index="index" @touchend="touchE"
-			// touchS(e) {
-			// 	uni.showModal({
-			// 		title: '执行touchS方法',
-			// 		content: JSON.stringify(e)
-			// 	})
-			// 	if (e.touches.length == 1) {
-			// 		//设置触摸起始点水平方向位置
-			// 		this.startX = e.touches[0].clientX
-			// 		// console.log(this.startX)
-			// 	}
-			// },
-			// touchM(e) {
-			// 	console.log('执行touchE方法', e)
-			// 	uni.showModal({
-			// 		title: '执行touchM方法',
-			// 		content: JSON.stringify(e)
-			// 	})
-			// 	if (e.touches.length == 1) {
-			// 		//手指移动时水平方向位置
-			// 		var moveX = e.touches[0].clientX;
-			// 		//手指起始点位置与移动期间的差值
-			// 		var disX = this.startX - moveX;
-			// 		var delBtnWidth = this.delBtnWidth;
-			// 		var txtStyle = "";
-			// 		if (disX == 0 || disX < 0) { //如果移动距离小于等于0,说明向右滑动,文本层位置不变
-			// 			txtStyle = "left:0px";
-			// 		} else if (disX > 0) { //移动距离大于0,文本层left值等于手指移动距离
-			// 			txtStyle = "left:-" + disX + "px";
-			// 			if (disX >= delBtnWidth) {
-			// 				//控制手指移动距离最大值为删除按钮的宽度
-			// 				txtStyle = "left:-" + delBtnWidth + "px";
-			// 			}
-			// 		}
-			// 		//获取手指触摸的是哪一项
-			// 		var index = e.currentTarget.dataset.index;
-			// 		var list = this.list;
-			// 		console.log(999, e.currentTarget.dataset)
-			// 		// list[index].txtStyle = txtStyle;
-			// 		// console.log(list[index].txtStyle)
-			// 		//更新列表的状态
-			// 		this.list = list;
-			// 	}
-			// },
-			// touchE(e) {
-			// 	console.log('执行touchE方法', e)
-			// 	uni.showModal({
-			// 		title: '执行touchE方法',
-			// 		content: JSON.stringify(e)
-			// 	})
-			// 	if (e.changedTouches.length == 1) {
-			// 		//手指移动结束后水平位置
-			// 		var endX = e.changedTouches[0].clientX;
-			// 		//触摸开始与结束,手指移动的距离
-			// 		var disX = this.startX - endX;
-			// 		var delBtnWidth = this.delBtnWidth;
-			// 		//如果距离小于删除按钮的1/2,不显示删除按钮
-			// 		var txtStyle = disX > delBtnWidth / 2 ? "left:-" + delBtnWidth + "px" : "left:0px";
-			// 		//获取手指触摸的是哪一项
-			// 		var index = e.currentTarget.dataset.index;
-			// 		var list = this.list;
-			// 		// list[index].txtStyle = txtStyle;
-			// 		// console.log(list[index].txtStyle)
-			// 		//更新列表的状态{
-			// 		this.list = list
-			// 	}
-			// }
-
-		}
-	}
-</script>
-
-<style lang="scss">
-	.container {
-		line-height: 1;
-
-		.box {
-			width: 750rpx;
-			background: #FFFFFF;
-			box-shadow: 0px 5rpx 5rpx 0px rgba(34, 24, 20, 0.06);
-			border-radius: 10rpx;
-			margin: 20rpx auto 0;
-			padding: 30rpx;
-			position: relative;
-
-			.box-top {
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #333333;
-			}
-
-			.box-time {
-				margin-top: 20rpx;
-				font-size: 24rpx;
-				font-weight: 500;
-				color: #666666;
-			}
-
-			.box-1 {
-				display: flex;
-				justify-content: space-between;
-			}
-
-			.navImg {
-				width: 50rpx;
-				height: 50rpx;
-
-				image {
-					width: 50rpx;
-					height: 50rpx;
-				}
-
-				.tip {
-					margin-top: 6rpx;
-					color: #7F7F7F;
-					font-size: 21rpx;
-					text-align: right;
-					// background-color: pink;
-				}
-			}
-
-			.box-sub-box {
-				margin-top: 44rpx;
-				display: flex;
-				justify-content: space-between;
-				padding: 0 80rpx;
-
-				.red-font {
-					width: 175rpx;
-					height: 59rpx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #C90F1B;
-				}
-
-				.sub-box1 {
-					width: 175rpx;
-					height: 59rpx;
-					background: #C90F1B;
-					border-radius: 29rpx;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #FFFFFF;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-				}
-
-				.sub-box2 {
-					width: 175rpx;
-					height: 59rpx;
-					background: #F3F3F3;
-					border-radius: 29rpx;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #333333;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-				}
-
-				.sub-box3 {
-					width: 200rpx;
-					height: 59rpx;
-					background: #C90F1B;
-					border-radius: 29rpx;
-					font-size: 28rpx;
-					font-weight: 500;
-					color: #FFFFFF;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-
-					.call {
-						width: 28rpx;
-						height: 40rpx;
-						margin-right: 10rpx;
-					}
-				}
-			}
-		}
-
-		.popup-box {
-			width: 522rpx;
-			height: 605rpx;
-			background-color: #FFFFFF;
-			border-radius: 20rpx;
-
-			.img {
-				border-radius: 20rpx 20rpx 0 0;
-				width: 522rpx;
-				height: 307rpx;
-
-				image {
-					border-radius: 20rpx 20rpx 0 0;
-					width: 522rpx;
-					height: 307rpx;
-				}
-			}
-
-			.mian {
-				display: flex;
-				flex-direction: column;
-				align-items: center;
-				padding: 32rpx 32rpx;
-				background-color: #FFFFFF;
-				border-radius: 0 0 20rpx 20rpx;
-				text-align: center;
-
-				.delivery {
-					font-size: 36rpx;
-					color: #333333;
-					// margin-top: 46rpx;
-				}
-
-				.nocancel {
-					font-size: 30rpx;
-					color: #999999;
-					margin-top: 26rpx;
-				}
-
-				.comfirm-box {
-					margin-top: 52rpx;
-					display: flex;
-					// margin-bottom: 32rpx;
-
-					// justify-content: space-around;
-					.cancel {
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						width: 197rpx;
-						height: 61rpx;
-						border: 1px solid #C90F1B;
-						border-radius: 31rpx;
-
-						font-size: 24rpx;
-						color: #C90F1B;
-					}
-
-					.comfirm {
-						margin-left: 32rpx;
-						display: flex;
-						align-items: center;
-						justify-content: center;
-						width: 197rpx;
-						height: 61rpx;
-						background: #C90F1B;
-						border-radius: 31px;
-						font-size: 24rpx;
-						color: #FFFFFF;
-					}
-				}
-			}
-		}
-
-		.popup_row {
-			width: 100%;
-			height: 500rpx;
-			background-color: #ffffff;
-			border-radius: 20rpx 20rpx 0 0;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-
-			.rows {
-				width: 100%;
-				padding: 0 24rpx;
-
-				.rows-item {
-					height: 80rpx;
-					line-height: 80rpx;
-					text-align: center;
-					width: 100%;
-					font-size: 32rpx;
-					color: #303133;
-					// border-bottom: 1rpx solid #f0f0f0;
-				}
-
-				// .row-1 {
-				// 	margin: auto;
-				// 	.first_aid {
-				// 		width: 300rpx;
-				// 		height: 300rpx;
-				// 	}
-				// }
-				// .row-2 {
-				// 	font-size: 38rpx;
-				// 	margin-top: 20rpx;
-				// }
-			}
-
-		}
-
-		.remove {
-			display: flex;
-			border-radius: 0 12rpx 12rpx 0;
-			align-items: center;
-			justify-content: center;
-			// margin-right: 22rpx;
-			position: absolute;
-			right: 0;
-			top: 0;
-			font-size: 30rpx;
-			width: 110rpx;
-			height: 100%;
-			color: #FFFFFF;
-			background-color: #C90F1B;
-			;
-		}
-	}
+<template>
+	<view class="container">
+		<uni-swipe-action>
+			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.sos_id)"
+				v-for="(item,index) in list">
+				<view class="list">
+					<view class="box">
+						<view class="box-1">
+							<view class="box-2">
+								<view class="box-time">
+									求救时间:{{item.createtime | time}}
+								</view>
+								<view class="box-time">
+									救援地址:{{item.address}}
+								</view>
+								<view class="box-time" v-if="item.status == 1">
+									联系方式:{{item.user_phone}}
+								</view>
+							</view>
+							<view class="navImg" @click="toNav(item, index)">
+								<image src="../../static/img/img10.png" mode=""></image>
+								<view class="tip">导航</view>
+							</view>
+						</view>
+
+						<view class="box-sub-box" v-if="item.status == 0">
+							<view class="sub-box1" @click="agree(item,index)">
+								接受
+							</view>
+							<view class="sub-box2" @click="refuse(item,index)">
+								拒绝
+							</view>
+						</view>
+						<view class="box-sub-box">
+							<view class="red-font" v-if="item.status == 1">
+								已接受
+							</view>
+							<view class="red-font" v-if="item.status == -1">
+								已拒绝
+							</view>
+							<view class="sub-box3" @click="tocall(item.user_phone)">
+								<image src="../../static/icon/call.png" mode="" class="call"></image>
+								拨打电话
+							</view>
+						</view>
+						<!-- <view class="remove" @click="delItem">删除</view> -->
+					</view>
+				</view>
+			</uni-swipe-action-item>
+		</uni-swipe-action>
+		<empty v-if="list.length === 0"></empty>
+		<uni-load-more :status="loadingType"></uni-load-more>
+		<uni-popup ref="popup" type="bottom" @click="close">
+			<view class="popup_row">
+				<view class="rows">
+					<view class="rows-item" @click="toGaodeMap">
+						高德地图
+					</view>
+					<view class="rows-item" @click="tobaiDuMap">
+						百度地图
+					</view>
+					<view class="rows-item" @click="totengxunMap">
+						腾讯地图
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+
+		<uni-popup ref="popup1" type="center">
+			<view class="popup-box">
+				<view class="img">
+					<image src="../../static/img/map.jpg" mode=""></image>
+				</view>
+				<view class="mian">
+					<view class="delivery">
+						救援记录
+						<!-- {{ i18n.qrhwsdm }} -->
+					</view>
+					<view class="nocancel">
+						确认删除该记录吗?
+						<!-- {{ i18n.wfcx }} -->
+					</view>
+					<view class="comfirm-box">
+						<view class="cancel" @click="cancel">
+							取消
+						</view>
+						<view class="comfirm" @click="comfirm(tmp)">
+							确认
+						</view>
+					</view>
+				</view>
+			</view>
+
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+	import {
+		deleteList,
+		getrescue,
+		change_rescue
+	} from '@/api/index.js';
+	import {
+		getRescueList,
+		changeRescue,
+		geocoder
+	} from '@/api/category.js'
+
+	import empty from '@/components/empty';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
+	import uniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue';
+	export default {
+		components: {
+			empty,
+			uniPopup,
+			uniLoadMore,
+			uniSwipeAction,
+			uniSwipeActionItem
+		},
+		filters: {
+			time(val) {
+				let str = ''
+				if (val) {
+					var time = new Date(val * 1000);
+					var y = time.getFullYear();
+					var m = time.getMonth() + 1;
+					var d = time.getDate();
+					var h = time.getHours();
+					var mm = time.getMinutes();
+					var s = time.getSeconds();
+					str = y + '-' + m + '-' + d + ' ' + h + ":" + mm
+					console.log(str)
+				}
+				return str
+			}
+		},
+		data() {
+			return {
+				id: '',
+				tmp: '',
+				options: [{
+					text: '取消',
+					style: {
+						backgroundColor: '#007aff'
+					}
+				}, {
+					text: '确认',
+					style: {
+						backgroundColor: '#C90F1B'
+					}
+				}],
+				page: 1,
+				limit: 10,
+				list: [],
+				loadingType: 'more',
+				latitude2: '',
+				longitude2: '',
+				longitude4: '',
+				latitude4: '',
+				address: '',
+			}
+		},
+		onLoad() {
+			this.loadData();
+			// this.getRescueList()
+			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('加载完毕注册事件');
+					locationAddress({
+						type: 'wgs84',
+						success: function(res) {
+							console.log('获取经纬度', res);
+							obj.longitude4 = res.longitude
+							obj.latitude4 = res.latitude
+							// obj.loadData();
+						},
+						fail(e) {
+							console.log('失败', e);
+							window.location.reload();
+						}
+					});
+				})
+				// #endif
+
+				// #ifdef MP
+				locationAddress({
+					type: 'wgs84',
+					success: function(res) {
+						console.log('获取经纬度', res);
+						obj.longitude4 = res.longitude
+						obj.latitude4 = res.latitude
+						// obj.loadData();
+					},
+					fail(e) {
+						console.log('失败', e);
+						window.location.reload();
+					}
+				});
+				// #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: 'wgs84',
+						success: function(res) {
+							console.log('获取经纬度', res);
+							obj.longitude4 = res.longitude
+							obj.latitude4 = res.latitude
+							// obj.loadData();
+						},
+						fail(e) {
+							console.log('失败', e);
+							window.location.reload();
+						}
+					});
+				})
+				// #endif
+				// #ifdef MP
+				locationAddress({
+					type: 'wgs84',
+					success: function(res) {
+						console.log('获取经纬度', res);
+						obj.longitude4 = res.longitude
+						obj.latitude4 = res.latitude
+						// obj.loadData();
+					},
+					fail(e) {
+						console.log('失败', e);
+						window.location.reload();
+					}
+				});
+				// #endif
+			}
+
+		},
+
+		methods: {
+			geocoder(lat, lon) {
+				geocoder({
+					latitude: lat,
+					longitude: lon
+				}).then(res => {
+					console.log(res.data.result.address)
+					return res.data.result.address
+				})
+			},
+			getRescueList() {
+				getRescueList({
+					type: 1,
+					page: 1,
+					limit: 10
+				}).then(res => {
+					console.log(res)
+				})
+			},
+			bindClick(e) {
+				if (e.content.text == '取消') {
+					console.log('点击了左侧取消按钮')
+				} else {
+					console.log('点击了右侧确认按钮')
+					// this.$refs.popup1.open(this.tmp);
+					this.open(this.id)
+				}
+			},
+			swipeChange(e, id) {
+				this.id = id
+				console.log('id111111111', id)
+			},
+			// 确认删除吗?
+			comfirm(id) {
+				console.log(9999888, id)
+				deleteList({
+					id: this.id
+				}).then(({
+					data
+				}) => {
+					window.location.reload(); //重新刷新页面
+					this.loadData()
+					this.cancel()
+				})
+			},
+			// 取消
+			cancel() {
+				this.$refs.popup1.close();
+			},
+			// 打开弹窗
+			open(tmp) {
+				console.log('打开弹窗', tmp)
+				this.$refs.popup1.open(tmp)
+			},
+			async loadData() {
+				let obj = this;
+				if (obj.loadingType === 'noMore') {
+					//防止重复加载
+					return;
+				}
+				// 修改当前对象状态为加载中
+				obj.loadingType = 'loading';
+				getRescueList({
+					page: obj.page,
+					limit: obj.limit,
+					type: 1
+				}).then(({
+					data
+				}) => {
+					obj.list = obj.list.concat(data);
+					obj.page++;
+					if (obj.limit == data.length) {
+						obj.loadingType = 'more';
+					} else {
+						obj.loadingType = 'noMore';
+					}
+				})
+			},
+			// 点击导航
+			toNav(item, index) {
+				console.log(item, index)
+				let obj = this
+				obj.latitude2 = item.latitude
+				obj.longitude2 = item.longitude
+				obj.address = item.address
+				this.$refs.popup.open();
+			},
+			// 调用高德
+			toGaodeMap() {
+				let latitude = this.latitude2
+				let longitude = this.longitude2
+				let address = this.address
+				console.log('选择高德', latitude, longitude, address)
+				window.location.href =
+					`https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
+
+			},
+			// 调用腾讯
+			totengxunMap() {
+				let latitude = this.latitude2
+				let longitude = this.longitude2
+				let address = this.address
+				console.log('选择腾讯', latitude, longitude)
+				window.location.href =
+					`http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
+			},
+			// 高德坐标、腾讯坐标转百度坐标
+			bd_encrypt(gg_lng, gg_lat) {
+				var X_PI = Math.PI * 3000.0 / 180.0;
+				var x = gg_lng,
+					y = gg_lat;
+				var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * X_PI);
+				var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * X_PI);
+				var bd_lng = z * Math.cos(theta) + 0.0065;
+				var bd_lat = z * Math.sin(theta) + 0.006;
+				return {
+					bd_lat: bd_lat,
+					bd_lng: bd_lng
+				};
+			},
+			// 调用百度
+			tobaiDuMap() {
+				let latlon = this.bd_encrypt(this.longitude2, tthis.latitude2)
+				let latlon1 = this.bd_encrypt(this.longitude4, this.latitude4)
+				let latitude = latlon.bd_lat;
+				let longitude = latlon.bd_lng;
+				let latitude6 = latlon1.bd_lat;
+				let longitude6 = latlon1.bd_lng;
+				
+				// let latitude = this.latitude2
+				// let longitude = this.longitude2
+				// let latitude6 = this.latitude4
+				// let longitude6 = this.longitude4
+				let address = this.address
+				console.log('选择百度', latitude, longitude)
+				console.log('获取当前经纬度', latitude6, longitude6)
+				window.location.href =
+					`http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${ address }&output=html&src=webapp.baidu.openAPIdemo`
+			},
+			// 拨打电话
+			tocall(num) {
+				console.log(num);
+				uni.makePhoneCall({
+					phoneNumber: num //仅为示例
+				});
+			},
+			//同意
+			agree(item, index) {
+				let obj = this;
+				uni.showModal({
+					content: '是否要接受该求救?',
+					success: res => {
+						if (res.confirm) {
+							changeRescue({
+								status: 1,
+								// process_remark: ,
+								id: item.id,
+							}).then((data) => {
+								obj.list[index].status = 1;
+								console.log(obj.list[index].status);
+							})
+						}
+					}
+				});
+			},
+			//拒绝
+			refuse(item, index) {
+				let obj = this;
+				uni.showModal({
+					content: '是否要拒绝该求救?',
+					success: res => {
+						if (res.confirm) {
+							changeRescue({
+								id: item.id,
+								status: -1
+							}).then((data) => {
+								obj.list[index].status = -1;
+								console.log(item);
+							})
+						}
+					}
+				})
+			},
+			// @touchstart="touchS" @touchmove="touchM" :data-index="index" @touchend="touchE"
+			// touchS(e) {
+			// 	uni.showModal({
+			// 		title: '执行touchS方法',
+			// 		content: JSON.stringify(e)
+			// 	})
+			// 	if (e.touches.length == 1) {
+			// 		//设置触摸起始点水平方向位置
+			// 		this.startX = e.touches[0].clientX
+			// 		// console.log(this.startX)
+			// 	}
+			// },
+			// touchM(e) {
+			// 	console.log('执行touchE方法', e)
+			// 	uni.showModal({
+			// 		title: '执行touchM方法',
+			// 		content: JSON.stringify(e)
+			// 	})
+			// 	if (e.touches.length == 1) {
+			// 		//手指移动时水平方向位置
+			// 		var moveX = e.touches[0].clientX;
+			// 		//手指起始点位置与移动期间的差值
+			// 		var disX = this.startX - moveX;
+			// 		var delBtnWidth = this.delBtnWidth;
+			// 		var txtStyle = "";
+			// 		if (disX == 0 || disX < 0) { //如果移动距离小于等于0,说明向右滑动,文本层位置不变
+			// 			txtStyle = "left:0px";
+			// 		} else if (disX > 0) { //移动距离大于0,文本层left值等于手指移动距离
+			// 			txtStyle = "left:-" + disX + "px";
+			// 			if (disX >= delBtnWidth) {
+			// 				//控制手指移动距离最大值为删除按钮的宽度
+			// 				txtStyle = "left:-" + delBtnWidth + "px";
+			// 			}
+			// 		}
+			// 		//获取手指触摸的是哪一项
+			// 		var index = e.currentTarget.dataset.index;
+			// 		var list = this.list;
+			// 		console.log(999, e.currentTarget.dataset)
+			// 		// list[index].txtStyle = txtStyle;
+			// 		// console.log(list[index].txtStyle)
+			// 		//更新列表的状态
+			// 		this.list = list;
+			// 	}
+			// },
+			// touchE(e) {
+			// 	console.log('执行touchE方法', e)
+			// 	uni.showModal({
+			// 		title: '执行touchE方法',
+			// 		content: JSON.stringify(e)
+			// 	})
+			// 	if (e.changedTouches.length == 1) {
+			// 		//手指移动结束后水平位置
+			// 		var endX = e.changedTouches[0].clientX;
+			// 		//触摸开始与结束,手指移动的距离
+			// 		var disX = this.startX - endX;
+			// 		var delBtnWidth = this.delBtnWidth;
+			// 		//如果距离小于删除按钮的1/2,不显示删除按钮
+			// 		var txtStyle = disX > delBtnWidth / 2 ? "left:-" + delBtnWidth + "px" : "left:0px";
+			// 		//获取手指触摸的是哪一项
+			// 		var index = e.currentTarget.dataset.index;
+			// 		var list = this.list;
+			// 		// list[index].txtStyle = txtStyle;
+			// 		// console.log(list[index].txtStyle)
+			// 		//更新列表的状态{
+			// 		this.list = list
+			// 	}
+			// }
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	.container {
+		line-height: 1;
+
+		.box {
+			width: 750rpx;
+			background: #FFFFFF;
+			box-shadow: 0px 5rpx 5rpx 0px rgba(34, 24, 20, 0.06);
+			border-radius: 10rpx;
+			margin: 20rpx auto 0;
+			padding: 30rpx;
+			position: relative;
+
+			.box-top {
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #333333;
+			}
+
+			.box-time {
+				margin-top: 20rpx;
+				font-size: 24rpx;
+				font-weight: 500;
+				color: #666666;
+			}
+
+			.box-1 {
+				display: flex;
+				justify-content: space-between;
+			}
+
+			.navImg {
+				width: 50rpx;
+				height: 50rpx;
+
+				image {
+					width: 50rpx;
+					height: 50rpx;
+				}
+
+				.tip {
+					margin-top: 6rpx;
+					color: #7F7F7F;
+					font-size: 21rpx;
+					text-align: right;
+					// background-color: pink;
+				}
+			}
+
+			.box-sub-box {
+				margin-top: 44rpx;
+				display: flex;
+				justify-content: space-between;
+				padding: 0 80rpx;
+
+				.red-font {
+					width: 175rpx;
+					height: 59rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					font-size: 28rpx;
+					font-weight: 500;
+					color: #C90F1B;
+				}
+
+				.sub-box1 {
+					width: 175rpx;
+					height: 59rpx;
+					background: #C90F1B;
+					border-radius: 29rpx;
+					font-size: 28rpx;
+					font-weight: 500;
+					color: #FFFFFF;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+				}
+
+				.sub-box2 {
+					width: 175rpx;
+					height: 59rpx;
+					background: #F3F3F3;
+					border-radius: 29rpx;
+					font-size: 28rpx;
+					font-weight: 500;
+					color: #333333;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+				}
+
+				.sub-box3 {
+					width: 200rpx;
+					height: 59rpx;
+					background: #C90F1B;
+					border-radius: 29rpx;
+					font-size: 28rpx;
+					font-weight: 500;
+					color: #FFFFFF;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+
+					.call {
+						width: 28rpx;
+						height: 40rpx;
+						margin-right: 10rpx;
+					}
+				}
+			}
+		}
+
+		.popup-box {
+			width: 522rpx;
+			height: 605rpx;
+			background-color: #FFFFFF;
+			border-radius: 20rpx;
+
+			.img {
+				border-radius: 20rpx 20rpx 0 0;
+				width: 522rpx;
+				height: 307rpx;
+
+				image {
+					border-radius: 20rpx 20rpx 0 0;
+					width: 522rpx;
+					height: 307rpx;
+				}
+			}
+
+			.mian {
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				padding: 32rpx 32rpx;
+				background-color: #FFFFFF;
+				border-radius: 0 0 20rpx 20rpx;
+				text-align: center;
+
+				.delivery {
+					font-size: 36rpx;
+					color: #333333;
+					// margin-top: 46rpx;
+				}
+
+				.nocancel {
+					font-size: 30rpx;
+					color: #999999;
+					margin-top: 26rpx;
+				}
+
+				.comfirm-box {
+					margin-top: 52rpx;
+					display: flex;
+					// margin-bottom: 32rpx;
+
+					// justify-content: space-around;
+					.cancel {
+						display: flex;
+						align-items: center;
+						justify-content: center;
+						width: 197rpx;
+						height: 61rpx;
+						border: 1px solid #C90F1B;
+						border-radius: 31rpx;
+
+						font-size: 24rpx;
+						color: #C90F1B;
+					}
+
+					.comfirm {
+						margin-left: 32rpx;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+						width: 197rpx;
+						height: 61rpx;
+						background: #C90F1B;
+						border-radius: 31px;
+						font-size: 24rpx;
+						color: #FFFFFF;
+					}
+				}
+			}
+		}
+
+		.popup_row {
+			width: 100%;
+			height: 500rpx;
+			background-color: #ffffff;
+			border-radius: 20rpx 20rpx 0 0;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			.rows {
+				width: 100%;
+				padding: 0 24rpx;
+
+				.rows-item {
+					height: 80rpx;
+					line-height: 80rpx;
+					text-align: center;
+					width: 100%;
+					font-size: 32rpx;
+					color: #303133;
+					// border-bottom: 1rpx solid #f0f0f0;
+				}
+
+				// .row-1 {
+				// 	margin: auto;
+				// 	.first_aid {
+				// 		width: 300rpx;
+				// 		height: 300rpx;
+				// 	}
+				// }
+				// .row-2 {
+				// 	font-size: 38rpx;
+				// 	margin-top: 20rpx;
+				// }
+			}
+
+		}
+
+		.remove {
+			display: flex;
+			border-radius: 0 12rpx 12rpx 0;
+			align-items: center;
+			justify-content: center;
+			// margin-right: 22rpx;
+			position: absolute;
+			right: 0;
+			top: 0;
+			font-size: 30rpx;
+			width: 110rpx;
+			height: 100%;
+			color: #FFFFFF;
+			background-color: #C90F1B;
+			;
+		}
+	}
 </style>

+ 32 - 24
pages/category/category.vue

@@ -247,21 +247,23 @@
 			// 选择当前位置
 			getLocation() {
 				console.log('选择当前位置');
-				let obj = this;
-				uni.chooseLocation({
-					success: function(res) {
-						console.log(res)
-						obj.addressData.area = res.name;
-						console.log('位置名称:' + res.name);
-						console.log('详细地址:' + res.address);
-						console.log('纬度:' + res.latitude);
-						console.log('经度:' + res.longitude);
-						obj.addressData.latitude = res.latitude;
-						obj.addressData.longitude = res.longitude;
-						// let	dizhi = obj.addressData.latitude + ','+ obj.addressData.longitude;
-						obj.showaddress = res.address;
-					}
+				let obj = this;
+				// let wxOjb = require('jweixin-module');
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res)
+						obj.addressData.area = res.name;
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						obj.addressData.latitude = res.latitude;
+						obj.addressData.longitude = res.longitude;
+						// let	dizhi = obj.addressData.latitude + ','+ obj.addressData.longitude;
+						obj.showaddress = res.address;
+					}
 				});
+				
 			},
 			onChange(val) {
 				let obj = this;
@@ -281,17 +283,23 @@
 			},
 			// 获取本地坐标
 			getLocal() {
-				let obj = this;
-				console.log('ddddddddddddddddddddddddd')
-				uni.getLocation({
-					type: 'gcj02',
-					success(e) {
-						console.log(e)
-						obj.latitude4 = Math.abs(e.latitude)
-						obj.longitude4 =  Math.abs(e.longitude)
-						obj.getRescuerList(obj.latitude4,obj.longitude4)
-					}
+				let obj = this;
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(()=> {
+					uni.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude4 = Math.abs(e.latitude)
+							obj.longitude4 =  Math.abs(e.longitude)
+							obj.getRescuerList(obj.latitude4,obj.longitude4)
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
 				})
+				
 			}
 		}
 	};

+ 70 - 89
pages/form/tovolApply.vue

@@ -24,7 +24,7 @@
 					
 				</view>
 				<picker @change="bindPickerSex" :value="index" :range="array">
-					<view class="box-right">{{ sex }}</view>
+					<view class="box-right">{{ sex == '0'? '男' : sex == '1'? '女' : sex }}</view>
 				</picker>
 			</view>
 
@@ -58,35 +58,15 @@
 				<input type="text" placeholder="请填写移动电话" value="" class="list-input" v-model="phone" />
 			</view>
 
-			<view class="box-1">
-				<view class="box-left">固定电话(选填)</view>
-				<input type="text" placeholder="请填写固定电话" value="" class="list-input" v-model="mobile" />
-			</view>
-			<!-- 		<view class="box-1">
-				<view class="box-left">
-					办公电话(选填):
-				</view>
-				<input type="text" value="" class="list-input" v-model="phone" />
-			</view> -->
 
 			<view class="box-1">
 				<view class="box-left">电子邮件(选填)</view>
 				<input type="text" placeholder="请填写电子邮件" value="" class="list-input" v-model="email" />
 			</view>
-			<!-- <view class="box-1">
-				<view class="box-left">
-					QQ(选填):
-				</view>
-				<input type="text" value="" class="list-input" v-model="phone" />
-			</view> -->
 			<view class="box-1">
 				<view class="box-left">联系地址(选填)</view>
 				<input type="text" value="" placeholder="请填写联系地址" class="list-input" v-model="address" />
 			</view>
-			<view class="box-1">
-				<view class="box-left">邮编(选填)</view>
-				<input type="text" value="" placeholder="请填写邮编" class="list-input" v-model="zip" />
-			</view>
 			<view class="box-1">
 				<view class="box-left">工作单位(选填)</view>
 				<input type="text" value="" placeholder="请填写工作单位" class="list-input" v-model="work" />
@@ -112,8 +92,8 @@
 			<view class="uni-list">
 				<radio-group @change="radioChange">
 					<view class="radio-list flex_item">
-						<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in is_vol" :key="item.name">
-							<view><radio style="transform:scale(0.7)" color="#E71F2C" :value="item.name" :checked="index === current" /></view>
+						<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in is_vol" :key="item.id">
+							<view><radio style="transform:scale(0.7)" color="#E71F2C" :value="item.id" :checked="index === current" /></view>
 							<view>{{ item.name }}</view>
 						</label>
 					</view>
@@ -129,8 +109,8 @@
 			<view class="uni-list">
 				<radio-group @change="radioChange1">
 					<view class="radio-list flex_item">
-						<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in is_experience" :key="item.name">
-							<view><radio style="transform:scale(0.7)" color="#E71F2C" :value="item.name" :checked="index === current" /></view>
+						<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="(item, index) in is_experience" :key="item.id">
+							<view><radio style="transform:scale(0.7)" color="#E71F2C" :value="item.id" :checked="index === current" /></view>
 							<view>{{ item.name }}</view>
 						</label>
 					</view>
@@ -140,19 +120,25 @@
 				<view class="list-title">可提供服务的时间</view>
 				<view class="tip">请选择适当方格,可选多项</view>
 				<view class="content_box">
-					<view class="list-name">
-						时间段
-						<text class="icon">*</text>
+					<view class="box-1" style="margin: 10rpx;">
+						<view class="box-left">
+							开始时间
+							<text class="imp">*</text>
+							
+						</view>
+						<picker mode="time" :value="start_hour" @change="startTimeChange">
+							<view class="box-right">{{ start_hour }}</view>
+						</picker>
 					</view>
-					<view class="uni-list">
-						<checkbox-group @change="checkboxChange">
-							<view class="radio-list flex_item">
-								<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="item in days" :key="item.name">
-									<view><checkbox :value="item.name" style="transform:scale(0.7)" color="#E71F2C" :checked="item.checked" /></view>
-									<view>{{ item.name }}</view>
-								</label>
-							</view>
-						</checkbox-group>
+					<view class="box-1" style="margin: 10rpx;">
+						<view class="box-left">
+							结束时间
+							<text class="imp">*</text>
+							
+						</view>
+						<picker mode="time" :value="end_hour" :start="start_hour" @change="endTimeChange">
+							<view class="box-right">{{ end_hour }}</view>
+						</picker>
 					</view>
 				</view>
 				<view class="content_box">
@@ -164,7 +150,7 @@
 						<checkbox-group @change="checkboxChange1">
 							<view class="radio-list flex_item">
 								<label class="uni-list-cell uni-list-cell-pd flex_item" v-for="item in items" :key="item.name">
-									<view><checkbox :value="item.name" style="transform:scale(0.7)" color="#E71F2C" :checked="item.checked" /></view>
+									<view><checkbox :value="item.value" style="transform:scale(0.7)" color="#E71F2C" :checked="item.checked" /></view>
 									<view>{{ item.name }}</view>
 								</label>
 							</view>
@@ -242,64 +228,51 @@ export default {
 			otherspe: '',
 			loding: false, //是否提交中
 			array: ['男', '女'],
-			chooseEdu: ['博士后', '博士', '硕士', '本科', '专科', '其他'],
+			chooseEdu: ['小学以下', '小学', '初中', '高中/中专', '大专/本科', '硕士','博士','博士后'],
 			chooseVol: ['有', '无'],
 			is_experience: [
 				{
-					id: 1,
+					id: '1',
 					name: '有'
 				},
 				{
-					id: 2,
+					id: '2',
 					name: '无'
 				}
 			],
 			// is_experience: '',
 			chooseExp: ['是', '否'],
-			//时间段
-			days: [
-				{
-					value: '1',
-					name: '早上'
-				},
-				{
-					value: '2',
-					name: '中午'
-				},
-				{
-					value: '3',
-					name: '晚上'
-				}
-			],
+			start_hour:'选择开始时间',//开始时间
+			end_hour:'选择结束时间',//
 			quantum: '',
 			//日期
 			items: [
 				{
-					value: '1',
+					value: '2',
 					name: '星期一'
 				},
 				{
-					value: '2',
+					value: '3',
 					name: '星期二'
 				},
 				{
-					value: '3',
+					value: '4',
 					name: '星期三'
 				},
 				{
-					value: '4',
+					value: '5',
 					name: '星期四'
 				},
 				{
-					value: '5',
+					value: '6',
 					name: '星期五'
 				},
 				{
-					value: '6',
+					value: '7',
 					name: '星期六'
 				},
 				{
-					value: '7',
+					value: '1',
 					name: '星期日'
 				}
 			],
@@ -416,11 +389,11 @@ export default {
 			current: '',
 			is_vol: [
 				{
-					id: 1,
+					id: '1',
 					name: '有'
 				},
 				{
-					id: 2,
+					id: '2',
 					name: '无'
 				}
 			],
@@ -430,17 +403,16 @@ export default {
 			cardimg: '', //证件照
 			// card: '',
 			// checklist: [],
-			zip: '',
 			name: '',
 			sex: '请选择你的性别',
 			birth: '请选择你的生日',
 			fillingDate: '',
 			phone: '',
-			mobile: '', //固定电话
 			address: '',
 			work: '',
 			specialty: '',
 			education: '请选择教育程度',
+			educationid:'',
 			checked1: '',
 			checked: '',
 			expertiseText: '', //专长其他
@@ -482,7 +454,7 @@ export default {
 				obj.$api.msg('请输入您的姓名');
 				return;
 			}
-			if (obj.sex == '' || obj.sex == '请选择你的性别') {
+			if (obj.sex == '') {
 				obj.$api.msg('请输入您的性别');
 				return;
 			}
@@ -545,27 +517,25 @@ export default {
 
 			obj.loding = true;
 			add_volunteers({
-				name: obj.name,
-				sex: obj.sex,
-				birth: obj.birth,
-				picture: obj.cardimg,
-				phone: obj.phone,
-				mobile: obj.mobile,
-				email: obj.email,
-				address: obj.address,
-				zip: obj.zip, //邮编
+				name: obj.name,//姓名
+				phone: obj.phone,//手机号
+				sex: obj.sex,//性别
+				birth: obj.birth,//生日
+				image: obj.cardimg,//照片
+				email: obj.email,//邮件
+				address: obj.address,//地址
 				work: obj.work, //工作单位
 				specialty: obj.specialty, //职业/职务/专业
-				zy:obj.zy,
-				education: obj.education == '请选择教育程度' ? '' : obj.education , //教育程度
-				is_vol: obj.checked,
-				is_experience: obj.checked1,
-				quantum: obj.quantum,
-				date: obj.dates,
-				taste: obj.taste,
-				make_taste: obj.worksText,
-				speciali: obj.speciali,
-				make_speciali: obj.expertiseText,
+				education: obj.educationid, //教育程度
+				is_vol: obj.checked,//是否受过志愿者服务
+				is_experience: obj.checked1,//有无工作经验
+				start_hour: obj.start_hour,
+				end_hour: obj.end_hour,
+				date: obj.dates,//星期几
+				taste: obj.taste,//有兴趣参与的工作
+				taste_title: obj.worksText, //工作其他
+				speciali: obj.speciali,//专长
+				speciali_title: obj.expertiseText,//其他专长
 			})
 				.then(e => {
 					obj.sex = '请选择你的性别';
@@ -585,23 +555,34 @@ export default {
 			upload({
 				filename: ''
 			}).then(data => {
+				console.log(data,'2222')
 				this.cardimg = data[0].url;
 			});
 		},
 		// 选择性别
 		bindPickerSex: function(e) {
-			this.sex = this.array[e.target.value];
+			this.sex = e.target.value
 			this.index = e.target.value + 1;
 		},
 		// 选择教育程度
 		bindPickerEdu: function(e) {
 			this.education = this.chooseEdu[e.target.value];
-			this.index = e.target.value + 1;
+			this.educationid = e.target.value;
+			console.log(this.educationid)
 		},
 		// 选择日期
 		bindDateChange: function(e) {
 			this.birth = e.target.value;
 		},
+		// 选择开始时间
+		startTimeChange: function(e) {
+			console.log(e,'开始时间')
+			this.start_hour = e.target.value;
+		},
+		// 选择结束时间
+		endTimeChange: function(e) {
+			this.end_hour = e.target.value;
+		},
 		//选择填写日期
 		fillingDateChange: function(e) {
 			this.fillingDate = e.target.value;

+ 82 - 0
pages/user/jkjl.vue

@@ -0,0 +1,82 @@
+<template>
+	<view class="content">
+		<view class="jg" style="height: 20rpx;">
+			
+		</view>
+		<view class="love-item" v-for="item in list" :key="item.id">
+			<view class="">
+				证书编号:{{item.SN}}
+			</view>
+			<view class="">
+				捐赠时间:{{item.paytime | time}}
+			</view>
+			<view class="">
+				捐赠意向:{{item.order_name}}
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { getMyloveList } from '@/api/user.js'
+	export default {
+		data() {
+			return {
+				list: [],
+				page: 1,
+				limit: 10,
+				loaded: false,
+				loadingType: 'more'
+			}
+		},
+		filters: {
+			time(val) {
+				let str = ''
+				if (val) {
+					var time = new Date(val * 1000);
+					var y = time.getFullYear();
+					var m = time.getMonth() + 1;
+					var d = time.getDate();
+					var h = time.getHours();
+					var mm = time.getMinutes();
+					var s = time.getSeconds();
+					str = y + '-' + m + '-' + d + ' ' + h + ":" + mm
+					console.log(str)
+				}
+				return str
+			}
+		},
+		onLoad() {
+			this.getMyloveList()
+		},
+		onReachBottom() {
+			this.getMyloveList()
+		},
+		methods:{
+			getMyloveList() {
+				let obj = this
+				getMyloveList({
+					page: obj.page,
+					limit: obj.limit,
+					status: 1
+				}).then(({data}) => {
+					obj.list = obj.list.concat(data)
+					obj.page++
+					if(obj.limit == data.length) {
+						obj.loadingType = 'more'
+					}else {
+						obj.loadingType = 'noMore'
+					}
+					obj.$set(obj,'loaded',true)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.love-item {
+		padding: 10rpx;
+		margin-bottom: 20rpx;
+	}
+</style>

+ 15 - 1
pages/user/user.vue

@@ -29,6 +29,15 @@
 				<view class="item-right">
 					>
 				</view>
+			</view>
+			<view class="nav-item flex" @click="tojkjl">
+				<view class="item-left flex">
+					<image src="../../static/icon/i6.png" mode="" class="img1"></image>
+					<view class="title">捐款记录</view>
+				</view>
+				<view class="item-right">
+					>
+				</view>
 			</view>
 			<view class="nav-item flex" @click="commonaddress">
 				<view class="item-left flex">
@@ -147,7 +156,12 @@
 			...mapState('user', ['hasLogin', 'userInfo'])
 		},
 		methods: {
-			...mapMutations('user', ['setUserInfo']),
+			...mapMutations('user', ['setUserInfo']),
+			tojkjl() {
+				uni.navigateTo({
+					url: '/pages/user/jkjl'
+				})
+			},
 			loadBaseData() {
 				userinfo({}).then(({
 					data

BIN
static/icon/close.png


+ 1 - 1
utils/wxAuthorized.js

@@ -91,7 +91,7 @@ export function weixindata(config) {
 		appId = data.appId;
 		// 微信信息配置
 		weixinObj.config({
-			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+			debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
 			appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
 			timestamp: data.timestamp, // 必填,生成签名的时间戳
 			nonceStr: data.nonceStr, // 必填,生成签名的随机串