lhl преди 4 години
родител
ревизия
114c163e13

+ 26 - 0
pages.json

@@ -466,6 +466,32 @@
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "红会科普"
 			}
+		},
+		{
+			"path": "pages/applic/aid",
+			"style": {
+				// #ifndef MP
+				"app-plus": {
+					"titleNView": false
+				},
+				// #endif
+				"navigationBarBackgroundColor": "#457DBF",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "救护站"
+			}
+		},
+		{
+			"path": "pages/applic/aed",
+			"style": {
+				// #ifndef MP
+				"app-plus": {
+					"titleNView": false
+				},
+				// #endif
+				"navigationBarBackgroundColor": "#457DBF",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "智能AED"
+			}
 		},
 		{
 

+ 550 - 0
pages/applic/aed.vue

@@ -0,0 +1,550 @@
+<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;
+			}
+		}
+	}
+</style>

+ 554 - 0
pages/applic/aid.vue

@@ -0,0 +1,554 @@
+<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;
+			}
+		}
+	}
+</style>
+

+ 8 - 8
pages/applic/contribution.vue

@@ -111,15 +111,10 @@
 					<input type="text" placeholder="请输入联系地址" v-model="address" />
 				</view>
 			</view>
-		</view>
-		
-		
-		
-
+		</view>
 		<view class="submit" @click="confirm()">
 			立即提交
 		</view>
-
 		<uni-popup ref="popup" type="bottom" @click="close">
 			<view class="popup_row">
 				<view class="title">
@@ -263,7 +258,7 @@
 			// console.log(333,options)
 		},
 		onShow() {
-			saveUrl()
+			// saveUrl()
 			// let token = uni.getStorageSync('token');
 			console.log(1, this);
 			// uni.showModal({
@@ -278,6 +273,7 @@
 					content: '您未登录,是否马上登陆?',
 					success: e => {
 						if (e.confirm) {
+							saveUrl()
 							interceptor();
 						}
 					},
@@ -446,8 +442,12 @@
 						paySign: res.paySign,
 						success: function(res) {
 							// obj.$api.msg('支付成功')
+							let date = new Date()
+							let year = date.getFullYear()
+							let month = date.getMonth() >= 9 ? date.getMonth() + 1 : '0'+(date.getMonth() +1 )
+							let day = date.getDay() >= 10 ? date.getDay() : '0' + date.getDay()
 							uni.navigateTo({
-								url: '/pages/form/donaSuccess?money=' + obj.money
+								url: '/pages/form/donaSuccess?money=' + obj.money + '&name=' + obj.donate_er + '&time=' + year + '年' + month + '月' + day +'日'
 							})
 						},
 						fail: function(res) {

+ 2 - 9
pages/applic/donaSuccess.vue

@@ -7,15 +7,8 @@
 		<view class="box">
 			<view class="music">
 				<view class="player playing" :class="playing?'none':'keepgo'" @click.stop="play">
-					<image src="../../static/img/music.png" style="width: 68rpx;height: 68rpx;" :animation="animationData"></image>
-					<!-- <view class="">
-						<image src="../../static/img/forbid.png" mode="" style="width: 52rpx;height: 52rpx;"></image>
-					</view> -->
+					<image src="../../static/img/music.png" style="width: 68rpx;height: 68rpx;" :animation="animationData"></image>
 				</view>
-				<!-- <view class="page-section page-section-gap" style="text-align: center;"> -->
-					<!-- <audio style="text-align: left" :src="current.src" 
-					 :action="audioAction" controls></audio> -->
-				<!-- </view> -->
 			</view>
 			<view class="title">
 				感谢信
@@ -178,7 +171,7 @@
 			display: flex;
 			flex-direction: column;
 			align-items: center;
-			color: #FFFFFF;
+			color: #000;
 			padding: 0rpx 32rpx 0 32rpx;
 
 			.music {

+ 2 - 2
pages/applic/tohelpActi.vue

@@ -35,10 +35,10 @@
 				6.福利事业:兴办康复、养老、医疗等非营利性实体,为孤老残疾等弱势群体提供服务。因人道救助项目涉及面广,具体申请人可根据实际情况,通过直接登录各级红十字会网站,或者直接联系各级红十字会进行申请。
 			</view> -->
 			<view class="box-5">
-				余姚市红十字会人道救助联系电话:
+				荆州区红十字会人道救助联系电话:
 			</view>
 			<view class="phone">
-				0574-62619330
+				****
 			</view>
 		</view>
 	</view>

+ 1 - 17
pages/applic/toknowledge.vue

@@ -103,23 +103,7 @@
 			</view>
 			<view class="list-tips" style="text-align: center;">
 				*************
-			</view>
-			<!-- <view class="list01">
-				具体入库办法:
-			</view> -->
-		<!-- 	<view class="list-info">
-				一、直接到余姚市红十字会(余姚市兰江街道新西门路219-1号)报名登记、抽取血样,每个工作日均可(8:30-16:00);
-			</view>
-			<view class="list-info">
-				二、到余姚市桐江桥献血屋或者献血车上参加无偿献血,一并参加报名登记、留取血样;
-			</view>
-			<view class="list-info">
-				三、每年“五·八”世界红十字日前后,市红十字会会在市中心开展包括造血干细胞捐献在内的系列活动,届时可前往报名抽样。请留意新闻媒体的报道。
-			</view>
-			<view class="phone">
-				余姚市红十字会报名咨询电话:62619095
-			</view> -->
-				<!-- <jyf-parser :html="description" ref="article"></jyf-parser> -->
+			</view>
 		</view>
 	</view>
 </template>

+ 28 - 22
pages/form/donaSuccess.vue

@@ -39,7 +39,10 @@ export default {
 			},
 			ran: -1,
 			isStop: true,
-			demo: 0
+			demo: 0,
+			name: '',
+			add_time: '',
+			
 		};
 	},
 	onReady() {
@@ -74,7 +77,7 @@ export default {
 				}
 			)
 			.exec();
-		let ctxBg = '/index/static/img/thanks.png'; //画布背景
+		let ctxBg = '/index/static/img/thanks1.png'; //画布背景
 		let src = '/index/static/icon/erweima.jpg'; // 二维码
 
 		let context = uni.createCanvasContext('qrShareBox');
@@ -100,26 +103,27 @@ export default {
 		// // 插入文字
 		context.setFontSize(28);
 		context.setFillStyle('#d5493b');
-		// context.fillText('感谢信', ((750 - obj.size) * obj.ratio) / 2, 260 * obj.ratio)
+		context.fillText('感谢信', ((750 - obj.size) * obj.ratio) / 2, 260 * obj.ratio)
 		context.setFontSize(30 * obj.ratio);
-		context.fillText('尊敬的捐赠人:', 40 * obj.ratio, 400 * obj.ratio);
-		context.fillText('衷心感谢您对荆州区红十字事业的信任与支持', 100 * obj.ratio, 460 * obj.ratio);
-		context.fillText('!我们已收到您的捐款', 40 * obj.ratio, 515 * obj.ratio);
+		context.fillText('尊敬的' + this.name + ':', 60 * obj.ratio, 350 * obj.ratio);
+		context.fillText('衷心感谢您对荆州区红十字事业的信任与支', 120 * obj.ratio, 410 * obj.ratio);
+		context.fillText('持!我们已收到您的捐款', 60 * obj.ratio, 465 * obj.ratio);
 		// 画横线
-		context.moveTo(340 * obj.ratio, 520 * obj.ratio);
-		context.lineTo(500 * obj.ratio, 520 * obj.ratio);
+		context.moveTo(380 * obj.ratio, 470 * obj.ratio);
+		context.lineTo(540 * obj.ratio, 470 * obj.ratio);
 		context.stroke();
-		context.fillText('¥' + obj.money, 355 * obj.ratio, 512 * obj.ratio);
-		context.fillText('元。我们承诺,', 500 * obj.ratio, 515 * obj.ratio);
-		context.fillText('绝不辜负大家的信任,遵照您的意愿,将捐款全部', 40 * obj.ratio, 570 * obj.ratio);
-		context.fillText('用于相关救助项目。您的善举将给受助人带去温暖', 40 * obj.ratio, 625 * obj.ratio);
-		context.fillText('!', 40 * obj.ratio, 680 * obj.ratio);
-		context.fillText('爱心无界,情义无价。谨以此信表达谢意,我', 100 * obj.ratio, 730 * obj.ratio);
-
-		context.fillText('们因您更有力量,因您倍感温暖!', 40 * obj.ratio, 785 * obj.ratio);
-		// context.fillText('谨表谢意', (580 * obj.ratio), 680 * obj.ratio)
-		context.fillText('荆州市红十字会', 450 * obj.ratio, 900 * obj.ratio);
+		context.setTextAlign('center')
+		context.fillText('¥' + obj.money, 460 * obj.ratio, 465 * obj.ratio);
+		context.setTextAlign('left')
+		context.fillText('元。我们承', 540 * obj.ratio, 465 * obj.ratio);
+		context.fillText('诺绝不辜负大家的信任,遵照您的意愿,将捐款', 60 * obj.ratio, 520 * obj.ratio);
+		context.fillText('全部用于相关救助项目。您的善举将给受助人带', 60 * obj.ratio, 575 * obj.ratio);
+		context.fillText('去温暖!', 60 * obj.ratio, 630 * obj.ratio);
+		context.fillText('爱心无界,情义无价。谨以此信表达谢意,', 120 * obj.ratio, 680 * obj.ratio);
 
+		context.fillText('我们因您更有力量,因您倍感温暖!', 60 * obj.ratio, 735 * obj.ratio);
+		context.fillText('荆州区红十字会', 450 * obj.ratio, 850 * obj.ratio);
+        context.fillText(obj.add_time, 450 * obj.ratio, 910 * obj.ratio);
 		// 插入二维码
 		// console.log(codeX, codeY, codeSize, 999)
 		context.drawImage(src, codeX, codeY, codeSize, codeSize);
@@ -161,6 +165,8 @@ export default {
 	onLoad(option) {
 		console.log(333, option);
 		this.money = option.money;
+		this.name = option.name
+		this.add_time = option.time
 		this.IndexShare();
 		this.ScanAudio(true);
 	},
@@ -184,8 +190,8 @@ export default {
 			let obj = this;
 			// let money = obj.money;
 			let item = {
-				link: 'http://http://jz.red.igxys.com/index/#/pages/form/donaSuccess?money=' + obj.money, // 分享链接
-				imgUrl: 'http://http://jz.red.igxys.com/index/#/static/img/thinks.png',
+				link: 'http://jz.red.igxys.com/index/#/pages/form/donaSuccess?money=' + obj.money, // 分享链接
+				imgUrl: 'http://jz.red.igxys.com/static/img/22.jpg',
 				desc: '感谢信',
 				title: '荆州区红十字会',
 				success: console.log('分享加载成功')
@@ -302,8 +308,8 @@ page {
 			border-radius: 28rpx;
 			// background-color: pink;
 			position: absolute;
-			left: 12rpx;
-			top: 250rpx;
+			left: 40rpx;
+			top: 100rpx;
 			z-index: 999;
 		}
 

+ 1115 - 806
pages/index/index.vue

@@ -3,7 +3,9 @@
 		<!-- 轮播 -->
 		<view class="carousel-section">
 			<swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
-				<swiper-item v-for="item in carouselList" :key="item.id"><image :src="item.pic"></image></swiper-item>
+				<swiper-item v-for="item in carouselList" :key="item.id">
+					<image :src="item.pic"></image>
+				</swiper-item>
 			</swiper>
 		</view>
 
@@ -50,42 +52,65 @@
 			</view>
 		</view>
 		<!--  sos急救系统 -->
-		<view class="system" @click="tolocation">
-			<top-title :title="'救在身边'" @click="tolocation"></top-title>
+		<view class="system">
+			<top-title :title="'救在身边'" navurl="/pages/applic/location" :show_more="true"></top-title>
 			<view class="system-map">
-				<map
-					class="map-box"
-					id="map"
-					show-location
-					:markers="marker"
-					:scale="scale"
-					:latitude="latitude4"
-					:longitude="longitude4"
-					ref="map"
-					@markertap="markertap"
-				></map>
-				<!-- <view class="map-box" ><image src="../../static/img/map.jpg" mode=""></image></view> -->
+				<map class="map-box" id="map" show-location :markers="marker" :scale="scale" :latitude="latitude4"
+					:longitude="longitude4" ref="map" @markertap="markertap"></map>
+			</view>
+			<view class="" style="padding-top: 80rpx;">
+				<view v-for="(item,index) in jzsblist" :key="item.id">
+					<view class="location-item">
+						<view class="box-left">
+							<view class="img01">
+								<image src="../../static/img/line01.png" mode=""></image>
+							</view>
+							<view class="img02" v-if="item.info !=null">
+								<image src="../../static/img/002.png" mode=""></image>
+							</view>
+							<view class="img02" v-else>
+								<image src="../../static/img/002.png" mode=""></image>
+							</view>
+							<view class="info">
+								<view class="info-header">
+									<view class="name">
+										救护员{{ index +1 }}
+									</view>
+									<view class="distance">
+										{{ item.num }}km
+									</view>
+									<view class="location-icon">
+										<image src="../../static/img/location-icon.png" mode=""></image>
+									</view>
+								</view>
+								<view class="address">
+									{{ item.address }}
+								</view>
+							</view>
+						</view>
+						<view class="box-right" @click="rescue(item,index)">
+							<view class="img" v-if="!item.is">
+								<image src="../../static/img/rescue.png" mode=""></image>
+							</view>
+							<view class="called" v-if="item.is">
+								已呼叫
+							</view>
+						</view>
+					</view>
+				</view>
 			</view>
 		</view>
-
 		<view class="list-box">
-			<view class="system-title"><top-title :title="'救护站'" @click="tolocation"></top-title></view>
+			<view class="system-title">
+				<top-title :title="'救护站'" :navurl="'/pages/applic/aid'" :show_more="true"></top-title>
+			</view>
 			<view id="container">
-				<map
-					class="map-box"
-					id="map"
-					show-location
-					:markers="markerJHZ"
-					:scale="scale"
-					:latitude="latitude4"
-					:longitude="longitude4"
-					ref="map"
-					style="height: 450rpx"
-					@markertap="markertap"
-				></map>
+				<map class="map-box" id="map" show-location :markers="jhzmarker" :scale="scale" :latitude="latitude4"
+					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="jhzmarkertap"></map>
 			</view>
 			<view class="">
-				<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in Mechanism" :key="item.id">
+				<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in Mechanism"
+					:key="item.id">
 					<template>
 						<view class="list-left">
 							<view class="info">
@@ -104,24 +129,16 @@
 			</view>
 		</view>
 		<view class="list-box" style="margin-top: 20rpx;">
-			<view class="system-title"><top-title :title="'智能AED'" @click="tolocation"></top-title></view>
+			<view class="system-title">
+				<top-title :title="'智能AED'" :navurl="'/pages/applic/aed'" :show_more="true"></top-title>
+			</view>
 			<view id="container">
-				<map
-					class="map-box"
-					id="map"
-					show-location
-					:markers="marker"
-					:scale="scale"
-					:latitude="latitude4"
-					:longitude="longitude4"
-					ref="map"
-					style="height: 450rpx"
-					@markertap="markertap"
-				></map>
+				<map class="map-box" id="map" show-location :markers="aedmarker" :scale="scale" :latitude="latitude4"
+					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="aedmarkertap"></map>
 			</view>
 			<view class="">
 				<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
-					<template >
+					<template>
 						<view class="list-left">
 							<view class="info">
 								<view class="title">{{ item.introduction }}</view>
@@ -135,7 +152,6 @@
 						</view>
 					</template>
 				</view>
-				<!-- <uni-load-more :status="loadingType"></uni-load-more> -->
 			</view>
 		</view>
 		<uni-popup ref="popup" type="bottom" @click="close">
@@ -144,11 +160,29 @@
 					<view class="rows-item" @click="toGaodeMap">高德地图</view>
 					<view class="rows-item" @click="tobaiDuMap">百度地图</view>
 					<view class="rows-item" @click="totengxunMap">腾讯地图</view>
-					<!-- <view class="rows-item" @click="toGoogleMap">
-						Google地图
-					</view> -->
-					<!-- <view class="row-1"><image class="first_aid" src="../../static/img/img03.jpg"></image></view> -->
-					<!-- <view class="row-2">扫码进入急救平台</view> -->
+				</view>
+			</view>
+		</uni-popup>
+		<uni-popup ref="popup2" type="center" @click="close2">
+			<view class="popup_row2">
+				<view class="title">
+					<view class="title-left">
+						请输入您的手机号,等待救援!
+					</view>
+					<view class="cancel" @click="cancel">
+						<image src="../../static/img/cancel1.png" mode=""></image>
+					</view>
+				</view>
+				<view class="inpBox">
+					<input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone" />
+				</view>
+				<view class="inpedit">
+					可在方框中修改您的手机号
+				</view>
+				<view class="comfirm">
+					<view class="comfirm1" @click="comfirm1()">
+						确认
+					</view>
 				</view>
 			</view>
 		</uni-popup>
@@ -156,179 +190,209 @@
 </template>
 
 <script>
-import { loadIndexs, bannerlist, getListAED, getDistance ,getListMechanism} from '@/api/index.js';
-import { saveUrl, interceptor } from '@/utils/loginUtils.js';
-import { mapState, mapMutations } from 'vuex';
-import { userinfo } from '@/api/user.js';
-import uniPopup from '@/components/uni-popup/uni-popup.vue';
-import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-import { getLoca } from '@/utils/wxAuthorized.js';
-import { getcomAddress } from '@/api/index.js';
-import topTitle from '../../components/top-title/top-title.vue';
-export default {
-	components: {
-		uniPopup,
-		uniLoadMore,
-		topTitle
-	},
-	data() {
-		return {
-			carouselList: [], //轮播
-			science: [], //文章列表
-			page: 1,
-			limit: 10,
-			AEDList: [],
-			Mechanism: [],
-			latitude2: '',
-			longitude2: '',
-			latitude4: '',
-			longitude4: '',
-			address: '',
-			loadingType: 'more',
-			markerList: [],
-			marker: [],
-			markerJHZ: [],
-			longitude: '121.15829821166992',
-			latitude: '30.044394499237708',
-			longitude1: '120.553638',
-			latitude1: '30.547011',
-			scale: '12', //地图缩放程度
-			scale1: '15',
-			showbox: false,
-			showTEXT: false,
-			addressData: {
+	import {
+		loadIndexs,
+		bannerlist,
+		getListAED,
+		getDistance,
+		getListMechanism,
+		getdis,
+		tocall
+	} from '@/api/index.js';
+	import {
+		saveUrl,
+		interceptor
+	} from '@/utils/loginUtils.js';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	import {
+		userinfo
+	} from '@/api/user.js';
+	import uniPopup from '@/components/uni-popup/uni-popup.vue';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import {
+		getLoca
+	} from '@/utils/wxAuthorized.js';
+	import {
+		getcomAddress
+	} from '@/api/index.js';
+	import topTitle from '../../components/top-title/top-title.vue';
+	export default {
+		components: {
+			uniPopup,
+			uniLoadMore,
+			topTitle
+		},
+		data() {
+			return {
 				name: '',
-				mobile: '',
-				latitude: 0, //纬度
-				longitude: 0, //经度
-				address: {
-					province: '',
-					city: '',
-					district: '',
-					detail: ''
-				},
-				area: '',
-				default: false
-			}
-		};
-	},
-	onShow() {
-		saveUrl();
-		// let token = uni.getStorageSync('token');
-		console.log(11, this);
-		if (!this.hasLogin) {
-			// 登录拦截
-			// interceptor();
-			uni.showModal({
-				title: '登录',
-				content: '您未登录,是否马上登陆?',
-				success: e => {
-					if (e.confirm) {
-						interceptor();
-					}
-				},
-				fail: e => {
-					console.log(e);
+				uid: '',
+				phone: '',
+				to_phone: '',
+				jzsbmarker: [],
+				jzsblist: [],
+				jhzmarker: [],
+				aedmarker: [],
+				carouselList: [], //轮播
+				science: [], //文章列表
+				page: 1,
+				limit: 10,
+				AEDList: [],
+				Mechanism: [],
+				latitude2: '',
+				longitude2: '',
+				latitude4: '',
+				longitude4: '',
+				address: '',
+				loadingType: 'more',
+				markerList: [],
+				marker: [],
+				longitude: '121.15829821166992',
+				latitude: '30.044394499237708',
+				longitude1: '120.553638',
+				latitude1: '30.547011',
+				scale: '12', //地图缩放程度
+				scale1: '15',
+				showbox: false,
+				showTEXT: false,
+				addressData: {
+					name: '',
+					mobile: '',
+					latitude: 0, //纬度
+					longitude: 0, //经度
+					address: {
+						province: '',
+						city: '',
+						district: '',
+						detail: ''
+					},
+					area: '',
+					default: false
 				}
-			});
-		} else {
-			this.loadData();
-		}
-	},
-	onLoad() {
-		// uni.showModal({
-		// 	content: '请选择您当前位置',
-		// 	success: res => {
-		// 		if (res.confirm) {
-		// 			this.chooseAddress()
-		// 		}
-		// 	}
-		// })
-		saveUrl();
-		let obj = this;
-		try {
-			let locationAddress;
-			// #ifdef H5
-			let wxOjb = require('jweixin-module');
-			locationAddress = wxOjb.getLocation;
-			// #endif
-			// #ifdef MP
-			locationAddress = uni.getLocation;
-			// #endif
-			// #ifdef H5
-			wxOjb.ready(() => {
-				console.log('加载完毕注册事件');
+			};
+		},
+		onShow() {
+			saveUrl();
+			// let token = uni.getStorageSync('token');
+			console.log(11, this);
+			if (!this.hasLogin) {
+				// 登录拦截
+				// interceptor();
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+			} else {
+				this.loadData();
+			}
+		},
+		onLoad() {
+			// uni.showModal({
+			// 	content: '请选择您当前位置',
+			// 	success: res => {
+			// 		if (res.confirm) {
+			// 			this.chooseAddress()
+			// 		}
+			// 	}
+			// })
+			saveUrl();
+			let obj = this;
+			try {
+				let locationAddress;
+				// #ifdef H5
+				let wxOjb = require('jweixin-module');
+				locationAddress = wxOjb.getLocation;
+				// #endif
+				// #ifdef MP
+				locationAddress = uni.getLocation;
+				// #endif
+				// #ifdef H5
+				wxOjb.ready(() => {
+					console.log('加载完毕注册事件');
+					locationAddress({
+						type: 'wgs84',
+						success: function(res) {
+							console.log('获取经纬度', res);
+							obj.longitude4 = res.longitude;
+							obj.latitude4 = res.latitude;
+							obj.marker = [{
+								longitude: res.longitude,
+								latitude: res.latitude,
+								iconPath: '/static/img/img19.png',
+								width: '45',
+								height: '45'
+							}];
+							obj.loadData();
+						},
+						fail(e) {
+							console.log('失败', e);
+							// window.location.reload();
+							obj.tishi()
+						}
+					});
+				});
+				// #endif
+
+				// #ifdef MP
 				locationAddress({
 					type: 'wgs84',
 					success: function(res) {
 						console.log('获取经纬度', res);
 						obj.longitude4 = res.longitude;
 						obj.latitude4 = res.latitude;
-						obj.marker = [
-							{
-								longitude: res.longitude,
-								latitude: res.latitude,
-								iconPath: '/static/img/img19.png',
-								width: '45',
-								height: '45'
-							}
-						];
-						obj.markerJHZ = [
-							{
-								longitude: res.longitude,
-								latitude: res.latitude,
-								iconPath: '/static/img/jhzlogo.png',
-								width: '45',
-								height: '45'
-							}
-						]; 
+						obj.marker = [{
+							longitude: res.longitude,
+							latitude: res.latitude,
+							iconPath: '/static/img/img19.png',
+							width: '45',
+							height: '45'
+						}];
 						obj.loadData();
 					},
 					fail(e) {
 						console.log('失败', e);
-						// window.location.reload();
 						obj.tishi()
 					}
 				});
-			});
-			// #endif
-
-			// #ifdef MP
-			locationAddress({
-				type: 'wgs84',
-				success: function(res) {
-					console.log('获取经纬度', res);
-					obj.longitude4 = res.longitude;
-					obj.latitude4 = res.latitude;
-					obj.marker = [
-						{
-							longitude: res.longitude,
-							latitude: res.latitude,
-							iconPath: '/static/img/img19.png',
-							width: '45',
-							height: '45'
+				// #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);
+							obj.tishi()
 						}
-					];
-					obj.loadData();
-				},
-				fail(e) {
-					console.log('失败', e);
-					obj.tishi()
-				}
-			});
-			// #endif
-		} catch (e) {
-			let locationAddress;
-			// #ifdef H5
-			let wxOjb = require('jweixin-module');
-			locationAddress = wxOjb.getLocation;
-			// #endif
-			// #ifdef MP
-			locationAddress = uni.getLocation;
-			// #endif
-			// #ifdef H5
-			wxOjb.ready(() => {
-				console.log('加载完毕注册事件');
+					});
+				});
+				// #endif
+				// #ifdef MP
 				locationAddress({
 					type: 'wgs84',
 					success: function(res) {
@@ -342,699 +406,944 @@ export default {
 						obj.tishi()
 					}
 				});
-			});
-			// #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);
-					obj.tishi()
-				}
-			});
-			// #endif
-		}
-	},
-	computed: {
-		...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
-	},
-	// 下拉加载
-	onReachBottom() {
-		this.loadData();
-	},
-	methods: {
-		...mapMutations('user', ['setUserInfo']),
-		tocontribution() {
-			uni.navigateTo({
-				// url: "/pages/applic/contribution"
-				url: '/pages/form/applicationForm'
-			});
-		},
-		//提示
-		tishi(){
-			uni.showModal({
-				title: '提示',
-				content:'获取当前位置信息失败,是否刷新页面。',
-				success: function(res){
-					if (res.confirm) {
-						window.location.reload();
-						console.log('用户点击确定');
-					} else if (res.cancel) {
-						console.log('用户点击取消');
-					}
-				}
-			})
-		},
-		// 调用高德
-		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 `
-		},
-		// 调用谷歌
-		toGoogleMap() {
-			let latitude = this.latitude2;
-			let longitude = this.longitude2;
-			console.log('选择谷歌', latitude, longitude);
-		},
-		tolocation() {
-			uni.navigateTo({
-				url: '/pages/applic/location'
-			});
-		},
-		toapplic() {
-			uni.navigateTo({
-				url: '/pages/applic/appliSystem'
-			});
+				// #endif
+			}
 		},
-		tohelpActi() {
-			uni.navigateTo({
-				// url: "/pages/applic/tohelpActi"
-				url: '/pages/form/tovolApply'
-			});
+		computed: {
+			...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
 		},
-		toOrgan() {
-			console.log('kepuxingbaoming');
-			uni.navigateTo({
-				url: '/pages/train/index'
-			});
+		// 下拉加载
+		onReachBottom() {
+			this.loadData();
 		},
-		// 点击图标
-		markertap(e) {
-			console.log(e.target.markerId);
-			this.$refs.popup.open();
-			let obj = this;
-			for (let i = 0; i < obj.marker.length; i++) {
-				if (e.target.markerId == obj.marker[i].id) {
-					obj.latitude2 = obj.marker[i].latitude;
-					obj.longitude2 = obj.marker[i].longitude;
-					obj.address = obj.marker[i].address;
-					// uni.showModal({
-					// 	title: '坐标',
-					// 	content: JSON.stringify(obj.marker[i]),
-					// 	success() {
-					// 		uni.showModal({
-					// 			title: '成功',
-					// 			content: obj.marker[i].latitude
-					// 		})
-					// 	}
-					// })
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			tocontribution() {
+				uni.navigateTo({
+					// url: "/pages/applic/contribution"
+					url: '/pages/form/applicationForm'
+				});
+			},
+			//提示
+			tishi() {
+				uni.showModal({
+					title: '提示',
+					content: '获取当前位置信息失败,是否刷新页面。',
+					success: function(res) {
+						if (res.confirm) {
+							window.location.reload();
+							console.log('用户点击确定');
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				})
+			},
+			// 调用高德
+			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 `
+			},
+			// 调用谷歌
+			toGoogleMap() {
+				let latitude = this.latitude2;
+				let longitude = this.longitude2;
+				console.log('选择谷歌', latitude, longitude);
+			},
+			tolocation() {
+				uni.navigateTo({
+					url: '/pages/applic/location'
+				});
+			},
+			toapplic() {
+				uni.navigateTo({
+					url: '/pages/applic/appliSystem'
+				});
+			},
+			tohelpActi() {
+				uni.navigateTo({
+					// url: "/pages/applic/tohelpActi"
+					url: '/pages/form/tovolApply'
+				});
+			},
+			toOrgan() {
+				console.log('kepuxingbaoming');
+				uni.navigateTo({
+					url: '/pages/train/index'
+				});
+			},
+			// 点击图标
+			markertap(e) {
+				console.log(e.target.markerId);
+				this.$refs.popup.open();
+				let obj = this;
+				for (let i = 0; i < obj.marker.length; i++) {
+					if (e.target.markerId == obj.marker[i].id) {
+						obj.latitude2 = obj.marker[i].latitude;
+						obj.longitude2 = obj.marker[i].longitude;
+						obj.address = obj.marker[i].address;
+						// uni.showModal({
+						// 	title: '坐标',
+						// 	content: JSON.stringify(obj.marker[i]),
+						// 	success() {
+						// 		uni.showModal({
+						// 			title: '成功',
+						// 			content: obj.marker[i].latitude
+						// 		})
+						// 	}
+						// })
+					}
 				}
-			}
-		},
-		loadData() {
-			let obj = this;
-			console.log('打印当前经纬度', obj.longitude4, obj.latitude4);
-			userinfo({}).then(({ data }) => {
-				obj.setUserInfo(data);
-				loadIndexs({}).then(({ data }) => {
-					obj.carouselList = data.banner; //轮播图
-					bannerlist().then(({ data }) => {
-						console.log(data);
-						obj.science = data;
+			},
+			aedmarkertap(e) {
+				console.log(e.target.markerId);
+				let obj = this;
+				for (let i = 0; i < obj.aedmarker.length; i++) {
+					if (e.target.markerId == obj.marker[i].id) {
+						obj.latitude2 = obj.marker[i].latitude;
+						obj.longitude2 = obj.marker[i].longitude;
+						obj.address = obj.marker[i].address;
+					}
+				}
+				obj.$refs.popup.open();
+			},
+			jhzmarkertap(e) {
+				console.log(e.target.markerId);
+				let obj = this;
+				for (let i = 0; i < obj.jhzmarker.length; i++) {
+					if (e.target.markerId == obj.marker[i].id) {
+						obj.latitude2 = obj.marker[i].latitude;
+						obj.longitude2 = obj.marker[i].longitude;
+						obj.address = obj.marker[i].address;
+					}
+				}
+				obj.$refs.popup.open();
+			},
+			loadData() {
+				let obj = this;
+				console.log('打印当前经纬度', obj.longitude4, obj.latitude4);
+				userinfo({}).then(({
+					data
+				}) => {
+					obj.setUserInfo(data);
+					loadIndexs({}).then(({
+						data
+					}) => {
+						obj.carouselList = data.banner; //轮播图
+						bannerlist().then(({
+							data
+						}) => {
+							console.log(data);
+							obj.science = data;
+						});
 					});
 				});
-			});
-			if (obj.loadingType === 'noMore') {
-				//防止重复加载
-				return;
-			}
-			// 修改当前对象状态为加载中
-			obj.loadingType = 'loading';
-			getListAED({
-				page: obj.page,
-				limit: obj.limit
-			}).then(({ data }) => {
-				console.log(data, 999);
-				// obj.AEDList = data
-				for (let i = 0; i < data.length; i++) {
-					data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i].longitude);
+				if (obj.loadingType === 'noMore') {
+					//防止重复加载
+					return;
 				}
-				obj.AEDList = obj.AEDList.concat(data);
-				console.log(obj.AEDList, '999++++++++++++++++++++++++++');
-				obj.markerList = data;
-				obj.page++;
-				if (obj.limit == data.length) {
-					obj.loadingType = 'more';
-				} else {
-					obj.loadingType = 'noMore';
-				}
-			});
-			getListMechanism({
-				page: obj.page,
-				limit: obj.limit
-			}).then(({data}) => {
-				console.log(data,'机构+++++++++++++')
-				for (let i = 0; i < data.length; i++) {
-					data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i].longitude);
+				// 修改当前对象状态为加载中
+				obj.loadingType = 'loading';
+				getListAED({
+					page: 1,
+					limit: 2
+				}).then(({
+					data
+				}) => {
+					console.log(data, 999);
+					// obj.AEDList = data
+					for (let i = 0; i < data.length; i++) {
+						data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i].longitude);
+					}
+					obj.AEDList = 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
+					}));
+					obj.aedmarker = obj.marker.concat(arr)
+					console.log(obj.AEDList, '999++++++++++++++++++++++++++');
+					obj.markerList = data;
+				});
+				getListMechanism({
+					page: 1,
+					limit: 2
+				}).then(({
+					data
+				}) => {
+					console.log(data, '机构+++++++++++++')
+					for (let i = 0; i < data.length; i++) {
+						data[i].space = obj.space(obj.latitude4, obj.longitude4, 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.Mechanism = data;
+					console.log(obj.Mechanism, '888++++++++++++++++++++++++++');
+				})
+				getdis({
+					lng1: obj.longitude4,
+					lat1: obj.latitude4,
+					page: 1,
+					limit: 2
+				}).then((res) => {
+					let data = res.data;
+					data = data.slice(0,2)
+					console.log('就在身边请求数据', data);
+					console.log('data.phone333', data.phone)
+					data = data.map(d => {
+						return {
+							...d,
+							iscall: true
+						}
+					})
+					obj.jzsblist = 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
+					}))
+					obj.jzsbtmarker = obj.marker.concat(arr)
+				}).catch(err => {
+					console.log(err);
+				});
+			},
+			// 导航
+			openAddress(item) {
+				let obj = this;
+				obj.latitude2 = item.latitude;
+				obj.longitude2 = item.longitude;
+				obj.address = item.address;
+				this.$refs.popup.open();
+			},
+			Jump(item) {
+				// console.log(item);
+				if (item.url != '') {
+					window.open(item.url);
+					return;
 				}
-				obj.Mechanism = obj.Mechanism.concat(data);
-				console.log(obj.Mechanism, '888++++++++++++++++++++++++++');
-				// obj.markerList = data;
-				obj.page2++;
-				if (obj.limit2 == data.length) {
-					obj.loadingType2 = 'more';
+				uni.navigateTo({
+					url: '/pages/applic/info?id=' + item.id
+				});
+			},
+			open() {
+				this.$refs.popup.open();
+			},
+			close() {
+				this.$refs.popup.close();
+			},
+			navTo(url) {
+				uni.navigateTo({
+					url
+				});
+			},
+			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; // 单位米
+			},
+			// 立即救援
+			rescue(item, index) {
+				let obj = this;
+				uni.showModal({
+					content: '是否发起求救?',
+					success: res => {
+						if (res.confirm) {
+							this.$refs.popup2.open(item, index);
+							obj.name = item.name;
+							obj.uid = item.uid;
+							obj.phone = item.phone;
+							obj.iscall = false
+							console.log('点击救援时item.phone:', obj.phone)
+						}
+					}
+				})
+			},
+			comfirm1: function() {
+				let obj = this
+				if (obj.to_phone.toString().trim() == '') {
+					// uni.showModal({
+					// 	title:'输入框为空',
+					// 	// content:JSON.stringify(obj)
+					// })
 				} else {
-					obj.loadingType2 = 'noMore';
+					console.log('obj.to_phone1111', obj.to_phone)
+					const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
+					if (!reg.test(obj.to_phone)) {
+						obj.$api.msg('请填写正确的手机号码');
+						return;
+					}
+					console.log('name:', obj.name)
+					console.log('uid:', obj.uid)
+					console.log('phone', obj.phone)
+					console.log('to_phone', obj.to_phone)
+					console.log('longitude', obj.longitude)
+					console.log('latitude', obj.latitude)
+					console.log('iscall', obj.iscall)
+					tocall({
+						name: obj.name,
+						uid: obj.uid,
+						phone: obj.phone,
+						longitude: obj.longitude,
+						latitude: obj.latitude,
+						to_phone: obj.to_phone
+					}).then((data) => {
+						console.log(99988, data)
+						uni.showModal({
+							title: '请耐心等待救援',
+							success: res => {
+								if (res.confirm) {
+									window.location.reload(); //重新刷新页面
+								}
+							}
+						})
+						obj.$refs.popup2.close();
+						obj.iscall = false
+						console.log(123, obj.iscall)
+					})
 				}
-			})
-			getDistance({
-				lng1: obj.longitude4,
-				lat1: obj.latitude4
-			}).then(({ data }) => {
-				console.log(data, 980);
-				obj.AEDList = data;
-				obj.AEDList = data.slice(0, 5);
-				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.marker = obj.marker.concat(arr);
-				obj.marker = obj.marker.slice(0, 6);
-				// uni.showModal({
-				// 	title: '提示',
-				// 	content: JSON.stringify(obj.marker)
-				// })
-			});
-		},
-		// 选择当前位置
-		// chooseAddress() {
-		// 	console.log('233')
-		// 	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.longitude);
-		// 			console.log('纬度:' + res.latitude);
-		// 			obj.addressData.latitude = res.latitude;
-		// 			obj.addressData.longitude = res.longitude;
-		// 			obj.addressDetail = res.address;
-		// 			console.log('common_address123',obj.addressDetail )
-		// 			console.log('latitude123',obj.addressData.latitude )
-		// 			console.log('longitude123',obj.addressData.longitude )
-		// 			getcomAddress({
-		// 				common_address: obj.addressDetail,
-		// 				longitude: obj.addressData.longitude,
-		// 				latitude: obj.addressData.latitude
-		// 			}).then(data => {
-		// 				console.log(333)
-		// 				console.log(data);
-		// 				if (data.status == 200) {
-		// 					obj.$api.msg('保存成功')
-		// 				}
-		// 			})
-		// 		}
-		// 	});
-		// },
-		// 导航
-		openAddress(item) {
-			let obj = this;
-			obj.latitude2 = item.latitude;
-			obj.longitude2 = item.longitude;
-			obj.address = item.address;
-			this.$refs.popup.open();
-		},
-		Jump(item) {
-			// console.log(item);
-			if (item.url != '') {
-				window.open(item.url);
-				return;
-			}
-			uni.navigateTo({
-				url: '/pages/applic/info?id=' + item.id
-			});
-		},
-		open() {
-			this.$refs.popup.open();
-		},
-		close() {
-			this.$refs.popup.close();
-		},
-		navTo(url) {
-			uni.navigateTo({
-				url
-			});
-		},
-		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; // 单位米
+			},
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-a {
-	text-decoration: none;
-	color: #5f5f5f;
-}
-
-.content {
-	// line-height: 1;
-	background-color: #ffabab;
-	// padding-bottom: 60rpx;
-}
-
-.popup_row {
-	width: 100%;
-	height: 500rpx;
-	background-color: #ffffff;
-	border-radius: 20rpx;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-
-	.rows {
+	a {
+		text-decoration: none;
+		color: #5f5f5f;
+	}
+
+	.content {
+		// line-height: 1;
+		background-color: #ffabab;
+		// padding-bottom: 60rpx;
+	}
+
+	.popup_row {
 		width: 100%;
-		padding: 0 24rpx;
+		height: 500rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
 
-		.rows-item {
-			height: 80rpx;
-			line-height: 80rpx;
-			text-align: center;
+		.rows {
 			width: 100%;
-			font-size: 32rpx;
-			color: #303133;
-			// border-bottom: 1rpx solid #f0f0f0;
-		}
+			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;
-		// }
+			// .row-1 {
+			// 	margin: auto;
+			// 	.first_aid {
+			// 		width: 300rpx;
+			// 		height: 300rpx;
+			// 	}
+			// }
+			// .row-2 {
+			// 	font-size: 38rpx;
+			// 	margin-top: 20rpx;
+			// }
+		}
 	}
-}
 
-.content {
-	background-color: #f8f8f8;
-	height: 100%;
+	.content {
+		background-color: #f8f8f8;
+		height: 100%;
 
-	/* 头部 轮播图 */
-	.carousel-section {
-		// padding-top: 10px;
-		overflow: hidden;
-		background-color: #fff;
-		.carousel {
-			width: 705rpx;
-			height: 375rpx;
-			margin: 0 auto;
-			border-radius: 20rpx;
+		/* 头部 轮播图 */
+		.carousel-section {
+			// padding-top: 10px;
 			overflow: hidden;
-			.carousel-item {
-				width: 100%;
-				height: 100%;
-				padding-left: 30rpx;
-				padding-right: 30rpx;
-				overflow: hidden;
-			}
+			background-color: #fff;
 
-			image {
-				width: 100%;
+			.carousel {
+				width: 705rpx;
 				height: 375rpx;
+				margin: 0 auto;
 				border-radius: 20rpx;
-			}
-		}
-	}
+				overflow: hidden;
+
+				.carousel-item {
+					width: 100%;
+					height: 100%;
+					padding-left: 30rpx;
+					padding-right: 30rpx;
+					overflow: hidden;
+				}
 
-	// 分类
-	.cate-section {
-		justify-content: space-around;
-		background-color: #fff;
-		padding: 46rpx 0 30rpx;
-		.cate-item {
-			width: 25%;
-			flex-direction: column;
-			text-align: center;
-			align-items: center;
-			justify-content: center;
-			.img-wrapper {
-				width: 100rpx;
-				height: 88rpx;
-				background: #eef4ff;
-				border-radius: 14rpx;
-				position: relative;
 				image {
-					position: absolute;
-					left: 50%;
-					top: 50%;
-					transform: translate(-50%, -50%);
+					width: 100%;
+					height: 375rpx;
+					border-radius: 20rpx;
 				}
-				.img1 {
+			}
+		}
+
+		// 分类
+		.cate-section {
+			justify-content: space-around;
+			background-color: #fff;
+			padding: 46rpx 0 30rpx;
+
+			.cate-item {
+				width: 25%;
+				flex-direction: column;
+				text-align: center;
+				align-items: center;
+				justify-content: center;
+
+				.img-wrapper {
 					width: 100rpx;
-					height: 84rpx;
+					height: 88rpx;
+					background: #eef4ff;
+					border-radius: 14rpx;
+					position: relative;
+
+					image {
+						position: absolute;
+						left: 50%;
+						top: 50%;
+						transform: translate(-50%, -50%);
+					}
+
+					.img1 {
+						width: 100rpx;
+						height: 84rpx;
+					}
+
+					.img2 {
+						width: 100rpx;
+						height: 85rpx;
+					}
+
+					.img3 {
+						width: 100rpx;
+						height: 84rpx;
+
+					}
+
+					.img4 {
+						width: 100rpx;
+						height: 88rpx;
+					}
+
 				}
-				.img2 {
-					width: 100rpx;
-					height: 85rpx;
+
+				.item-title {
+					margin-top: 15rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #333333;
 				}
-				.img3 {
-					width: 100rpx;
-					height: 84rpx;
-					
+			}
+		}
+
+		// 红会科普
+		.science-section {
+			width: 100%;
+			background-color: #ffffff;
+			margin-top: 18rpx;
+			padding-top: 30rpx;
+
+			.science-title {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				padding-bottom: 22rpx;
+
+				.title {
+					width: 285rpx;
+					height: 64rpx;
+					background-color: #ca121e;
+					border-radius: 32rpx;
+					color: #ffffff;
+					font-size: 32rpx;
+					line-height: 64rpx;
+					text-align: center;
 				}
-				.img4 {
-					width: 100rpx;
-					height: 88rpx;
+
+				image {
+					width: 68rpx;
+					height: 43rpx;
+					margin-left: 16rpx;
+					margin-right: 16rpx;
 				}
-				
 			}
-			.item-title {
-				margin-top: 15rpx;
-				font-size: 24rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #333333;
-			}
-		}
-	}
 
-	// 红会科普
-	.science-section {
-		width: 100%;
-		background-color: #ffffff;
-		margin-top: 18rpx;
-		padding-top: 30rpx;
+			.science-box {
+				padding-left: 15rpx;
+				padding-right: 15rpx;
+				padding-bottom: 20rpx;
+				border-bottom: 1rpx solid #f0f0f0;
+				white-space: nowrap;
+				display: flex;
+				width: 100%;
 
-		.science-title {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			padding-bottom: 22rpx;
-
-			.title {
-				width: 285rpx;
-				height: 64rpx;
-				background-color: #ca121e;
-				border-radius: 32rpx;
-				color: #ffffff;
-				font-size: 32rpx;
-				line-height: 64rpx;
-				text-align: center;
+				// .uni-scroll-view-content{
+				// 	display: flex;
+				// }
+				.science-content {
+					// width: 100%;
+
+					// display: flex;
+					display: -webkit-box;
+
+					.science-item {
+						margin-right: 24rpx;
+						width: 198rpx;
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+						text-align: center;
+
+						image {
+							width: 100%;
+							height: 145rpx;
+						}
+
+						.article-title {
+							width: 198rpx;
+							color: #333;
+							font-size: 25rpx;
+							padding-top: 20rpx;
+							padding-bottom: 16rpx;
+							font-weight: 900;
+						}
+
+						.article-content {
+							width: 198rpx;
+							color: #999999;
+							font-size: 18rpx;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							word-break: break-all;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 2;
+						}
+					}
+				}
 			}
 
-			image {
-				width: 68rpx;
-				height: 43rpx;
-				margin-left: 16rpx;
-				margin-right: 16rpx;
+			.science-more {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				color: #cb131c;
+				font-size: 30rpx;
+				padding-top: 18rpx;
+				padding-bottom: 18rpx;
+
+				image {
+					width: 20rpx;
+					height: 27rpx;
+				}
 			}
 		}
 
-		.science-box {
-			padding-left: 15rpx;
-			padding-right: 15rpx;
-			padding-bottom: 20rpx;
-			border-bottom: 1rpx solid #f0f0f0;
-			white-space: nowrap;
-			display: flex;
+		// sos急救中心
+		.system {
 			width: 100%;
+			background-color: #ffffff;
+			margin-top: 18rpx;
+			padding: 40rpx 30rpx 35rpx 30rpx;
+			margin-bottom: 20rpx;
 
-			// .uni-scroll-view-content{
-			// 	display: flex;
-			// }
-			.science-content {
-				// width: 100%;
+			.system-map {
+				margin: 30rpx auto 0;
+				width: 689rpx;
+				height: 312rpx;
+				background-color: #ffffff;
+				// padding: 0 30rpx;
+				padding-bottom: 45rpx;
+				// .map-box {
+				// 	width: 100%;
+				// 	height: 312rpx;
+				// 	// background-color: #fff;
 
-				// display: flex;
-				display: -webkit-box;
+				// }
+			}
+		}
 
-				.science-item {
-					margin-right: 24rpx;
-					width: 198rpx;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
+		// AED
+		.list-box {
+			padding: 0rpx 25rpx 24rpx;
+			// margin-bottom: 84rpx;
+			background-color: #fff;
+
+			.system-title {
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+				height: 130rpx;
+				// padding-bottom: 22rpx;
+				background-color: #ffffff;
+
+				.title {
+					width: 285rpx;
+					height: 64rpx;
+					background-color: #ca121e;
+					border-radius: 32rpx;
+					color: #ffffff;
+					font-size: 32rpx;
+					line-height: 64rpx;
 					text-align: center;
+				}
+
+				.img {
+					width: 68rpx;
+					height: 43rpx;
+					margin-left: 16rpx;
+					margin-right: 16rpx;
 
 					image {
-						width: 100%;
-						height: 145rpx;
+						width: 68rpx;
+						height: 43rpx;
 					}
+				}
+			}
+		}
 
-					.article-title {
-						width: 198rpx;
-						color: #333;
-						font-size: 25rpx;
-						padding-top: 20rpx;
-						padding-bottom: 16rpx;
-						font-weight: 900;
+		.map-box {
+			width: 100%;
+			height: 366rpx;
+		}
+
+		.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;
 					}
 
-					.article-content {
-						width: 198rpx;
+					.addr {
+						width: 400rpx;
+						margin-top: 20rpx;
+						font-size: 20rpx;
+						font-family: PingFang SC;
+						font-weight: 500;
 						color: #999999;
-						font-size: 18rpx;
-						overflow: hidden;
-						text-overflow: ellipsis;
-						display: -webkit-box;
-						word-break: break-all;
-						-webkit-box-orient: vertical;
-						-webkit-line-clamp: 2;
 					}
 				}
 			}
-		}
 
-		.science-more {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			color: #cb131c;
-			font-size: 30rpx;
-			padding-top: 18rpx;
-			padding-bottom: 18rpx;
-
-			image {
-				width: 20rpx;
-				height: 27rpx;
-			}
-		}
-	}
+			.image {
+				width: 10%;
+				text-align: center;
 
-	// sos急救中心
-	.system {
-		width: 100%;
-		background-color: #ffffff;
-		margin-top: 18rpx;
-		padding: 40rpx 30rpx 35rpx 30rpx;
-		margin-bottom: 20rpx;
-		.system-map {
-			margin: 30rpx auto 0;
-			width: 689rpx;
-			height: 312rpx;
-			background-color: #ffffff;
-			// padding: 0 30rpx;
-			padding-bottom: 45rpx;
-			// .map-box {
-			// 	width: 100%;
-			// 	height: 312rpx;
-			// 	// background-color: #fff;
-				
-			// }
+				image {
+					width: 50rpx;
+					height: 50rpx;
+				}
+
+				.tip {
+					color: #7f7f7f;
+					font-size: 21rpx;
+				}
+			}
 		}
 	}
 
-	// AED
-	.list-box {
-		padding: 0rpx 25rpx 24rpx;
-		// margin-bottom: 84rpx;
+	.red-box {
+		margin: 20rpx 0;
+		height: 521rpx;
+		padding: 40rpx 23rpx 35rpx 23rpx;
 		background-color: #fff;
 
-		.system-title {
-			display: flex;
-			justify-content: flex-start;
-			align-items: center;
-			height: 130rpx;
-			// padding-bottom: 22rpx;
-			background-color: #ffffff;
+		.red-nav {
+			justify-content: space-between;
+			margin-top: 23rpx;
 
-			.title {
-				width: 285rpx;
-				height: 64rpx;
-				background-color: #ca121e;
-				border-radius: 32rpx;
-				color: #ffffff;
-				font-size: 32rpx;
-				line-height: 64rpx;
-				text-align: center;
+			.left-nav {
+				width: 332rpx;
+				height: 392rpx;
+				background: #FFF3F5;
+				background-image: url(../../static/img/m1.png);
+				background-size: 100% 100%;
 			}
 
-			.img {
-				width: 68rpx;
-				height: 43rpx;
-				margin-left: 16rpx;
-				margin-right: 16rpx;
+			.right-nav {
+				width: 357rpx;
+				height: 392rpx;
+				flex-direction: column;
+				justify-content: space-between;
 
-				image {
-					width: 68rpx;
-					height: 43rpx;
+				// background: #F6F6FF;
+				.right-top-nav {
+					width: 357rpx;
+					height: 204rpx;
+					background: #F6F6FF;
+					background-image: url(../../static/img/m2.png);
+					background-size: 100% 100%;
+				}
+
+				.right-bottom-nav {
+					width: 357rpx;
+					height: 173rpx;
+					justify-content: space-between;
+
+					view {
+						width: 171rpx;
+						height: 173rpx;
+					}
+
+					.left-item {
+						background: #F5EFFE;
+						background-image: url(../../static/img/m3.png);
+						background-size: 100% 100%;
+					}
+
+					.right-item {
+						background: #EDFEFE;
+						background-image: url(../../static/img/m4.png);
+						background-size: 100% 100%;
+					}
 				}
 			}
 		}
 	}
 
-	.map-box {
+	.popup_row2 {
+		// margin-top: 108rpx;
+		height: 440rpx;
+		border-radius: 25rpx;
 		width: 100%;
-		height: 366rpx;
+		padding: 24rpx;
+		background-color: #f8f8f8;
+		z-index: 999;
+
+		.title {
+			border-bottom: 2rpx solid #F2F2F2;
+			color: #E63931;
+			font-size: 32rpx;
+			padding-left: 4rpx;
+			padding-bottom: 16rpx;
+			display: flex;
+			justify-content: space-between;
+
+			// align-items: center;
+			.cancel {
+				margin-left: 52rpx;
+				width: 36rpx;
+				height: 36rpx;
+
+				image {
+					width: 36rpx;
+					height: 36rpx;
+				}
+			}
+		}
+
+		.inpBox {
+			margin-top: 52rpx;
+			border: 2px solid #f2f2f2;
+			padding: 12rpx 24rpx;
+			color: #FF9797;
+			border-radius: 8rpx;
+
+			.input-placeholder {
+				// height: 70rpx;
+				font-size: 32rpx;
+				color: #FF9797;
+			}
+		}
+
+		.inpedit {
+			margin-top: 24rpx;
+			margin-left: 14rpx;
+			font-size: 28rpx;
+			color: #FF9797;
+		}
+
+		.comfirm {
+			display: flex;
+			justify-content: flex-end;
+			margin-top: 54rpx;
+
+			.comfirm1 {
+				padding: 12rpx 24rpx;
+				border-radius: 12rpx;
+				color: #FFFFFF;
+				background-color: #E63931;
+			}
+		}
 	}
 
-	.list-tpl {
-		background-color: #ffffff;
-		margin: 25rpx 0rpx;
-		padding: 25rpx 25rpx;
-		font-size: 28rpx;
-		border-radius: 15rpx;
+	.location-item {
+		z-index: 1000;
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
-		border-bottom: 1px solid #f1f1f1;
-		.list-left {
+		border-bottom: 1rpx solid #E7E8EA;
+		padding: 15rpx 0;
+
+		.box-left {
 			display: flex;
-			width: 100%;
 
-			.number {
-				font-size: 32rpx;
-				margin-right: 14rpx;
+			.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 {
-				width: 100%;
+				margin-left: 16rpx;
 
-				.title {
-					font-size: 32rpx;
-					color: #222222;
-					font-weight: 500;
+				.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;
+						}
+					}
 				}
 
-				.addr {
-					width: 400rpx;
-					margin-top: 20rpx;
-					font-size: 20rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #999999;
+				.address {
+					font-size: 26rpx;
+					color: #333333;
+					margin-top: 33rpx;
 				}
 			}
 		}
 
-		.image {
-			width: 10%;
-			text-align: center;
+		.box-right {
+			.img {
+				height: 107rpx;
 
-			image {
-				width: 50rpx;
-				height: 50rpx;
+				image {
+					width: 107rpx;
+					height: 107rpx;
+				}
 			}
 
-			.tip {
-				color: #7f7f7f;
-				font-size: 21rpx;
-			}
-		}
-	}
-}
-.red-box {
-	margin: 20rpx 0;
-	height: 521rpx;
-	padding: 40rpx 23rpx 35rpx 23rpx;
-	background-color: #fff;
-	.red-nav {
-		justify-content: space-between;
-		margin-top: 23rpx;
-		.left-nav {
-			width: 332rpx;
-			height: 392rpx;
-			background: #FFF3F5;
-			background-image: url(../../static/img/m1.png);
-			background-size: 100% 100%;
-		}
-		.right-nav {
-			width: 357rpx;
-			height: 392rpx;
-			flex-direction: column;
-			justify-content: space-between;
-			// background: #F6F6FF;
-			.right-top-nav {
-				width: 357rpx;
-				height: 204rpx;
-				background: #F6F6FF;
-				background-image: url(../../static/img/m2.png);
-				background-size: 100% 100%;
-			}
-			.right-bottom-nav {
-				width: 357rpx;
-				height: 173rpx;
-				justify-content: space-between;
-				view {
-					width: 171rpx;
-					height: 173rpx;
-				}
-				.left-item {
-					background: #F5EFFE;
-					background-image: url(../../static/img/m3.png);
-					background-size: 100% 100%;
-				}
-				.right-item {
-					background: #EDFEFE;
-					background-image: url(../../static/img/m4.png);
-					background-size: 100% 100%;
-				}
+			.called {
+				margin-right: 16rpx;
+				height: 107rpx;
+				line-height: 107rpx;
+				font-size: 28rpx;
+				color: #CB131C;
 			}
 		}
 	}
-}
 </style>

+ 1 - 1
pages/user/thank.vue

@@ -150,7 +150,7 @@ export default {
 		}
 		
 		context.setFontSize(38 * obj.ratio);
-		context.fillText("感谢您于" + obj.showtime + "对", 180* obj.ratio, 560* obj.ratio)
+		context.fillText("感谢您于" + obj.showtime + "对", 180* obj.ratio, 560* obj.ratio)
 		let str = '“' + obj.itemName + "”" + '的爱心捐赠。'
 		if(str.length < 15) {
 			context.fillText(str ,90* obj.ratio, 615* obj.ratio )

BIN
static/img/music.png


BIN
static/img/thanks1.png


BIN
static/img/zszs.png


+ 683 - 0
utils/md5.js

@@ -0,0 +1,683 @@
+/**
+ * [js-md5]{@link https://github.com/emn178/js-md5}
+ *
+ * @namespace md5
+ * @version 0.7.3
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
+ * @copyright Chen, Yi-Cyuan 2014-2017
+ * @license MIT
+ */
+(function () {
+  'use strict';
+
+  var ERROR = 'input is invalid type';
+  var WINDOW = typeof window === 'object';
+  var root = WINDOW ? window : {};
+  if (root.JS_MD5_NO_WINDOW) {
+    WINDOW = false;
+  }
+  var WEB_WORKER = !WINDOW && typeof self === 'object';
+  var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
+  if (NODE_JS) {
+    root = global;
+  } else if (WEB_WORKER) {
+    root = self;
+  }
+  var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && typeof module === 'object' && module.exports;
+  var AMD = typeof define === 'function' && define.amd;
+  var ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
+  var HEX_CHARS = '0123456789abcdef'.split('');
+  var EXTRA = [128, 32768, 8388608, -2147483648];
+  var SHIFT = [0, 8, 16, 24];
+  var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer', 'base64'];
+  var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
+
+  var blocks = [], buffer8;
+  if (ARRAY_BUFFER) {
+    var buffer = new ArrayBuffer(68);
+    buffer8 = new Uint8Array(buffer);
+    blocks = new Uint32Array(buffer);
+  }
+
+  if (root.JS_MD5_NO_NODE_JS || !Array.isArray) {
+    Array.isArray = function (obj) {
+      return Object.prototype.toString.call(obj) === '[object Array]';
+    };
+  }
+
+  if (ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
+    ArrayBuffer.isView = function (obj) {
+      return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
+    };
+  }
+
+  /**
+   * @method hex
+   * @memberof md5
+   * @description Output hash as hex string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} Hex string
+   * @example
+   * md5.hex('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * md5('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method digest
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.digest('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method array
+   * @memberof md5
+   * @description Output hash as bytes array
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Array} Bytes array
+   * @example
+   * md5.array('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method arrayBuffer
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.arrayBuffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof md5
+   * @description Output hash as ArrayBuffer
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @example
+   * md5.buffer('The quick brown fox jumps over the lazy dog');
+   */
+  /**
+   * @method base64
+   * @memberof md5
+   * @description Output hash as base64 string
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {String} base64 string
+   * @example
+   * md5.base64('The quick brown fox jumps over the lazy dog');
+   */
+  var createOutputMethod = function (outputType) {
+    return function (message) {
+      return new Md5(true).update(message)[outputType]();
+    };
+  };
+
+  /**
+   * @method create
+   * @memberof md5
+   * @description Create Md5 object
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.create();
+   */
+  /**
+   * @method update
+   * @memberof md5
+   * @description Create and update Md5 object
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @example
+   * var hash = md5.update('The quick brown fox jumps over the lazy dog');
+   * // equal to
+   * var hash = md5.create();
+   * hash.update('The quick brown fox jumps over the lazy dog');
+   */
+  var createMethod = function () {
+    var method = createOutputMethod('hex');
+    if (NODE_JS) {
+      method = nodeWrap(method);
+    }
+    method.create = function () {
+      return new Md5();
+    };
+    method.update = function (message) {
+      return method.create().update(message);
+    };
+    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
+      var type = OUTPUT_TYPES[i];
+      method[type] = createOutputMethod(type);
+    }
+    return method;
+  };
+
+  var nodeWrap = function (method) {
+    var crypto = eval("require('crypto')");
+    var Buffer = eval("require('buffer').Buffer");
+    var nodeMethod = function (message) {
+      if (typeof message === 'string') {
+        return crypto.createHash('md5').update(message, 'utf8').digest('hex');
+      } else {
+        if (message === null || message === undefined) {
+          throw ERROR;
+        } else if (message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        }
+      }
+      if (Array.isArray(message) || ArrayBuffer.isView(message) ||
+        message.constructor === Buffer) {
+        return crypto.createHash('md5').update(new Buffer(message)).digest('hex');
+      } else {
+        return method(message);
+      }
+    };
+    return nodeMethod;
+  };
+
+  /**
+   * Md5 class
+   * @class Md5
+   * @description This is internal class.
+   * @see {@link md5.create}
+   */
+  function Md5(sharedMemory) {
+    if (sharedMemory) {
+      blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      this.blocks = blocks;
+      this.buffer8 = buffer8;
+    } else {
+      if (ARRAY_BUFFER) {
+        var buffer = new ArrayBuffer(68);
+        this.buffer8 = new Uint8Array(buffer);
+        this.blocks = new Uint32Array(buffer);
+      } else {
+        this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      }
+    }
+    this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0;
+    this.finalized = this.hashed = false;
+    this.first = true;
+  }
+
+  /**
+   * @method update
+   * @memberof Md5
+   * @instance
+   * @description Update hash
+   * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+   * @returns {Md5} Md5 object.
+   * @see {@link md5.update}
+   */
+  Md5.prototype.update = function (message) {
+    if (this.finalized) {
+      return;
+    }
+
+    var notString, type = typeof message;
+    if (type !== 'string') {
+      if (type === 'object') {
+        if (message === null) {
+          throw ERROR;
+        } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
+          message = new Uint8Array(message);
+        } else if (!Array.isArray(message)) {
+          if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
+            throw ERROR;
+          }
+        }
+      } else {
+        throw ERROR;
+      }
+      notString = true;
+    }
+    var code, index = 0, i, length = message.length, blocks = this.blocks;
+    var buffer8 = this.buffer8;
+
+    while (index < length) {
+      if (this.hashed) {
+        this.hashed = false;
+        blocks[0] = blocks[16];
+        blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+        blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+        blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+        blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+      }
+
+      if (notString) {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            buffer8[i++] = message[index];
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
+          }
+        }
+      } else {
+        if (ARRAY_BUFFER) {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              buffer8[i++] = code;
+            } else if (code < 0x800) {
+              buffer8[i++] = 0xc0 | (code >> 6);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else if (code < 0xd800 || code >= 0xe000) {
+              buffer8[i++] = 0xe0 | (code >> 12);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              buffer8[i++] = 0xf0 | (code >> 18);
+              buffer8[i++] = 0x80 | ((code >> 12) & 0x3f);
+              buffer8[i++] = 0x80 | ((code >> 6) & 0x3f);
+              buffer8[i++] = 0x80 | (code & 0x3f);
+            }
+          }
+        } else {
+          for (i = this.start; index < length && i < 64; ++index) {
+            code = message.charCodeAt(index);
+            if (code < 0x80) {
+              blocks[i >> 2] |= code << SHIFT[i++ & 3];
+            } else if (code < 0x800) {
+              blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else if (code < 0xd800 || code >= 0xe000) {
+              blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            } else {
+              code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
+              blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+              blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+            }
+          }
+        }
+      }
+      this.lastByteIndex = i;
+      this.bytes += i - this.start;
+      if (i >= 64) {
+        this.start = i - 64;
+        this.hash();
+        this.hashed = true;
+      } else {
+        this.start = i;
+      }
+    }
+    if (this.bytes > 4294967295) {
+      this.hBytes += this.bytes / 4294967296 << 0;
+      this.bytes = this.bytes % 4294967296;
+    }
+    return this;
+  };
+
+  Md5.prototype.finalize = function () {
+    if (this.finalized) {
+      return;
+    }
+    this.finalized = true;
+    var blocks = this.blocks, i = this.lastByteIndex;
+    blocks[i >> 2] |= EXTRA[i & 3];
+    if (i >= 56) {
+      if (!this.hashed) {
+        this.hash();
+      }
+      blocks[0] = blocks[16];
+      blocks[16] = blocks[1] = blocks[2] = blocks[3] =
+      blocks[4] = blocks[5] = blocks[6] = blocks[7] =
+      blocks[8] = blocks[9] = blocks[10] = blocks[11] =
+      blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
+    }
+    blocks[14] = this.bytes << 3;
+    blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
+    this.hash();
+  };
+
+  Md5.prototype.hash = function () {
+    var a, b, c, d, bc, da, blocks = this.blocks;
+
+    if (this.first) {
+      a = blocks[0] - 680876937;
+      a = (a << 7 | a >>> 25) - 271733879 << 0;
+      d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209;
+      b = (b << 22 | b >>> 10) + c << 0;
+    } else {
+      a = this.h0;
+      b = this.h1;
+      c = this.h2;
+      d = this.h3;
+      a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936;
+      a = (a << 7 | a >>> 25) + b << 0;
+      d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586;
+      d = (d << 12 | d >>> 20) + a << 0;
+      c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819;
+      c = (c << 17 | c >>> 15) + d << 0;
+      b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330;
+      b = (b << 22 | b >>> 10) + c << 0;
+    }
+
+    a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[10] - 42063;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682;
+    a = (a << 7 | a >>> 25) + b << 0;
+    d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101;
+    d = (d << 12 | d >>> 20) + a << 0;
+    c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290;
+    c = (c << 17 | c >>> 15) + d << 0;
+    b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329;
+    b = (b << 22 | b >>> 10) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501;
+    b = (b << 20 | b >>> 12) + c << 0;
+    a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467;
+    a = (a << 5 | a >>> 27) + b << 0;
+    d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784;
+    d = (d << 9 | d >>> 23) + a << 0;
+    c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473;
+    c = (c << 14 | c >>> 18) + d << 0;
+    b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734;
+    b = (b << 20 | b >>> 12) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[5] - 378558;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[8] - 2022574463;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[11] + 1839030562;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[14] - 35309556;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[1] - 1530992060;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[4] + 1272893353;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[7] - 155497632;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[10] - 1094730640;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[13] + 681279174;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[0] - 358537222;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[3] - 722521979;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[6] + 76029189;
+    b = (b << 23 | b >>> 9) + c << 0;
+    bc = b ^ c;
+    a += (bc ^ d) + blocks[9] - 640364487;
+    a = (a << 4 | a >>> 28) + b << 0;
+    d += (bc ^ a) + blocks[12] - 421815835;
+    d = (d << 11 | d >>> 21) + a << 0;
+    da = d ^ a;
+    c += (da ^ b) + blocks[15] + 530742520;
+    c = (c << 16 | c >>> 16) + d << 0;
+    b += (da ^ c) + blocks[2] - 995338651;
+    b = (b << 23 | b >>> 9) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[0] - 198630844;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[7] + 1126891415;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[14] - 1416354905;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[5] - 57434055;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[12] + 1700485571;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[3] - 1894986606;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[10] - 1051523;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[1] - 2054922799;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[8] + 1873313359;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[15] - 30611744;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[6] - 1560198380;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[13] + 1309151649;
+    b = (b << 21 | b >>> 11) + c << 0;
+    a += (c ^ (b | ~d)) + blocks[4] - 145523070;
+    a = (a << 6 | a >>> 26) + b << 0;
+    d += (b ^ (a | ~c)) + blocks[11] - 1120210379;
+    d = (d << 10 | d >>> 22) + a << 0;
+    c += (a ^ (d | ~b)) + blocks[2] + 718787259;
+    c = (c << 15 | c >>> 17) + d << 0;
+    b += (d ^ (c | ~a)) + blocks[9] - 343485551;
+    b = (b << 21 | b >>> 11) + c << 0;
+
+    if (this.first) {
+      this.h0 = a + 1732584193 << 0;
+      this.h1 = b - 271733879 << 0;
+      this.h2 = c - 1732584194 << 0;
+      this.h3 = d + 271733878 << 0;
+      this.first = false;
+    } else {
+      this.h0 = this.h0 + a << 0;
+      this.h1 = this.h1 + b << 0;
+      this.h2 = this.h2 + c << 0;
+      this.h3 = this.h3 + d << 0;
+    }
+  };
+
+  /**
+   * @method hex
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.hex();
+   */
+  Md5.prototype.hex = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+
+    return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
+      HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
+      HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
+      HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
+      HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
+      HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
+      HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
+      HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
+      HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
+      HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
+      HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
+      HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
+      HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
+      HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
+      HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
+      HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F];
+  };
+
+  /**
+   * @method toString
+   * @memberof Md5
+   * @instance
+   * @description Output hash as hex string
+   * @returns {String} Hex string
+   * @see {@link md5.hex}
+   * @example
+   * hash.toString();
+   */
+  Md5.prototype.toString = Md5.prototype.hex;
+
+  /**
+   * @method digest
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.digest}
+   * @example
+   * hash.digest();
+   */
+  Md5.prototype.digest = function () {
+    this.finalize();
+
+    var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3;
+    return [
+      h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF,
+      h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF,
+      h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF,
+      h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF
+    ];
+  };
+
+  /**
+   * @method array
+   * @memberof Md5
+   * @instance
+   * @description Output hash as bytes array
+   * @returns {Array} Bytes array
+   * @see {@link md5.array}
+   * @example
+   * hash.array();
+   */
+  Md5.prototype.array = Md5.prototype.digest;
+
+  /**
+   * @method arrayBuffer
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.arrayBuffer}
+   * @example
+   * hash.arrayBuffer();
+   */
+  Md5.prototype.arrayBuffer = function () {
+    this.finalize();
+
+    var buffer = new ArrayBuffer(16);
+    var blocks = new Uint32Array(buffer);
+    blocks[0] = this.h0;
+    blocks[1] = this.h1;
+    blocks[2] = this.h2;
+    blocks[3] = this.h3;
+    return buffer;
+  };
+
+  /**
+   * @method buffer
+   * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead.
+   * @memberof Md5
+   * @instance
+   * @description Output hash as ArrayBuffer
+   * @returns {ArrayBuffer} ArrayBuffer
+   * @see {@link md5.buffer}
+   * @example
+   * hash.buffer();
+   */
+  Md5.prototype.buffer = Md5.prototype.arrayBuffer;
+
+  /**
+   * @method base64
+   * @memberof Md5
+   * @instance
+   * @description Output hash as base64 string
+   * @returns {String} base64 string
+   * @see {@link md5.base64}
+   * @example
+   * hash.base64();
+   */
+  Md5.prototype.base64 = function () {
+    var v1, v2, v3, base64Str = '', bytes = this.array();
+    for (var i = 0; i < 15;) {
+      v1 = bytes[i++];
+      v2 = bytes[i++];
+      v3 = bytes[i++];
+      base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+        BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
+        BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
+        BASE64_ENCODE_CHAR[v3 & 63];
+    }
+    v1 = bytes[i];
+    base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
+      BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
+      '==';
+    return base64Str;
+  };
+
+  var exports = createMethod();
+
+  if (COMMON_JS) {
+    module.exports = exports;
+  } else {
+    /**
+     * @method md5
+     * @description Md5 hash function, export to global in browsers.
+     * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash
+     * @returns {String} md5 hashes
+     * @example
+     * md5(''); // d41d8cd98f00b204e9800998ecf8427e
+     * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6
+     * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0
+     *
+     * // It also supports UTF-8 encoding
+     * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07
+     *
+     * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer`
+     * md5([]); // d41d8cd98f00b204e9800998ecf8427e
+     * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e
+     */
+    root.md5 = exports;
+    if (AMD) {
+      define(function () {
+        return exports;
+      });
+    }
+  }
+})();

+ 16 - 4
utils/request.js

@@ -1,5 +1,7 @@
 import service from './newRequest.js'
 import store from '../store';
+import md5 from './md5.js'
+import sha1 from './sha1.js'
 import {
 	saveUrl,
 	interceptor
@@ -61,17 +63,27 @@ service.interceptors.response(
 // 请求前拦截器
 service.interceptors.request(
 	config => {
-		// config.data.token = getToken();
-		// console.log(config);
-		let token = uni.getStorageSync('token');
-		// console.log(token);
+		let token = uni.getStorageSync('token') || '';
+		var timestamp = new Date().getTime();
+		var appSecret = '55dc12c813b6131578780dcd9cfd9d90';
+		var Appid = 'wx9e9cda4611521ed4';
+		let Sign = md5(sha1(Appid + timestamp + appSecret + timestamp + Appid + appSecret))
+		
+		console.log(Sign,Sign.length,'md5+++++++++++')
+		console.log(timestamp,'timestamp')
 		if (!config.header) {
 			config.header = {
 				"Authori-zation": 'Bearer ' + token,
+				"App-id": Appid,
+				"Sign": Sign,
+				"Sign-time": timestamp
 			}
 		} else {
 			// 添加key请求头
 			config.header["Authori-zation"] = 'Bearer ' + token;
+			config.header["App-id"] = Appid;
+			config.header['Sign-time'] = timestamp;
+			config.header['Sign'] = Sign;
 		}
 		return config
 	},

+ 51 - 0
utils/sha1.js

@@ -0,0 +1,51 @@
+function encodeUTF8(s) {
+  var i, r = [], c, x;
+  for (i = 0; i < s.length; i++)
+    if ((c = s.charCodeAt(i)) < 0x80) r.push(c);
+    else if (c < 0x800) r.push(0xC0 + (c >> 6 & 0x1F), 0x80 + (c & 0x3F));
+    else {
+      if ((x = c ^ 0xD800) >> 10 == 0) //对四字节UTF-16转换为Unicode
+        c = (x << 10) + (s.charCodeAt(++i) ^ 0xDC00) + 0x10000,
+          r.push(0xF0 + (c >> 18 & 0x7), 0x80 + (c >> 12 & 0x3F));
+      else r.push(0xE0 + (c >> 12 & 0xF));
+      r.push(0x80 + (c >> 6 & 0x3F), 0x80 + (c & 0x3F));
+    };
+  return r;
+}
+
+// 字符串加密成 hex 字符串
+function sha1(s) {
+  var data = new Uint8Array(encodeUTF8(s))
+  var i, j, t;
+  var l = ((data.length + 8) >>> 6 << 4) + 16, s = new Uint8Array(l << 2);
+  s.set(new Uint8Array(data.buffer)), s = new Uint32Array(s.buffer);
+  for (t = new DataView(s.buffer), i = 0; i < l; i++)s[i] = t.getUint32(i << 2);
+  s[data.length >> 2] |= 0x80 << (24 - (data.length & 3) * 8);
+  s[l - 1] = data.length << 3;
+  var w = [], f = [
+    function () { return m[1] & m[2] | ~m[1] & m[3]; },
+    function () { return m[1] ^ m[2] ^ m[3]; },
+    function () { return m[1] & m[2] | m[1] & m[3] | m[2] & m[3]; },
+    function () { return m[1] ^ m[2] ^ m[3]; }
+  ], rol = function (n, c) { return n << c | n >>> (32 - c); },
+    k = [1518500249, 1859775393, -1894007588, -899497514],
+    m = [1732584193, -271733879, null, null, -1009589776];
+  m[2] = ~m[0], m[3] = ~m[1];
+  for (i = 0; i < s.length; i += 16) {
+    var o = m.slice(0);
+    for (j = 0; j < 80; j++)
+      w[j] = j < 16 ? s[i + j] : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1),
+        t = rol(m[0], 5) + f[j / 20 | 0]() + m[4] + w[j] + k[j / 20 | 0] | 0,
+        m[1] = rol(m[1], 30), m.pop(), m.unshift(t);
+    for (j = 0; j < 5; j++)m[j] = m[j] + o[j] | 0;
+  };
+  t = new DataView(new Uint32Array(m).buffer);
+  for (var i = 0; i < 5; i++)m[i] = t.getUint32(i << 2);
+
+  var hex = Array.prototype.map.call(new Uint8Array(new Uint32Array(m).buffer), function (e) {
+    return (e < 16 ? "0" : "") + e.toString(16);
+  }).join("");
+  return hex;
+}
+
+export default sha1