lhl 3 лет назад
Родитель
Сommit
95d05a9bbb

+ 7 - 7
pages.json

@@ -985,13 +985,13 @@
 			// 	"selectedIconPath": "static/tabBar/tab-fu-current.png",
 			// 	"text": "爱心帮扶"
 			// },
-			// {
-			// 	"pagePath": "pages/category/category",
-			// 	"iconPath": "static/tabBar/dengji.png",
-			// 	"selectedIconPath": "static/tabBar/dengji-action.png",
-			// 	"text": "救在身边"
-			// 	// "visible":false
-			// },
+			{
+				"pagePath": "pages/category/category",
+				"iconPath": "static/tabBar/dengji.png",
+				"selectedIconPath": "static/tabBar/dengji-action.png",
+				"text": "救在身边"
+				// "visible":false
+			},
 			// {
 			// 	"pagePath": "pages/cart/cart",
 			// 	"iconPath": "static/tabBar/zuce.png",

+ 741 - 720
pages/applic/aed.vue

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

+ 1 - 1
pages/applic/location.vue

@@ -44,7 +44,7 @@
 					</view>
 				</view>
 			</view>
-			<uni-load-more :status="loadingType"></uni-load-more>
+			<uni-load-more :status="loadingType" v-if="list.length != 0"></uni-load-more>
 			<!-- <empty v-if="list.length === 0 && loaded"></empty> -->
 			<espempty v-if="list.length === 0 && loaded"></espempty>
 		</view>

+ 1 - 1
pages/applic/rescuerecords.vue

@@ -38,7 +38,7 @@
 							<view class="red-font" v-if="item.status == -1">
 								已拒绝
 							</view>
-							<view class="sub-box3" v-if="item.status == 1">
+							<view class="sub-box3" v-if="item.status == 1" @click=" item.status == 1 ? tocall(item.user_phone): ''">
 								<image src="../../static/icon/call.png" mode="" class="call"></image>
 								拨打电话
 							</view>

+ 1 - 1
pages/applic/science.vue

@@ -70,7 +70,7 @@
 			},
 			loadData(){
 				let obj = this;
-				getArticList({ifyid:1}).then(({ data }) => {
+				getArticList({ifyid:11}).then(({ data }) => {
 					console.log(data,123456);
 					obj.science = obj.science.concat(data.list);
 					console.log(obj.science,'999999999999999999')

+ 942 - 651
pages/form/applicationForm.vue

@@ -1,652 +1,943 @@
-<template>
-	<view class="content">
-		<view class="top">
-			<view class="title">登记选择</view>
-			<view class="info-box">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
-			<view class="uni-list">
-				<radio-group class="radio-box" @change="radioChange">
-					<label v-for="(item, index) in items" :key="item.id">
-						<label class="radio">
-							{{ item.name }}
-							<radio :checked="index === current" color="#E62129" style="transform:scale(0.5)" :value="item.id+''" />
-							<text></text>
-						</label>
-					</label>
-				</radio-group>
-			</view>
-		</view>
-
-		<view class="box">
-			<view class="box-1">
-				<view class="box-left">姓名</view>
-				<input type="text" placeholder="请填写你的名字" placeholder-class="placeholder" value="" class="list-input" v-model="name" />
-			</view>
-			<view class="box-1">
-				<view class="box-left">出生年月</view>
-				<picker mode="date" :value="birthday" :start="startDate" :end="endDate" @change="bindDateChange" class="box-right">
-					<view>{{ birthday }}</view>
-				</picker>
-			</view>
-			<view class="box-1">
-				<view class="box-left">性别</view>
-				<picker @change="bindPickerSex" :value="index" :range="array" class="box-right">
-					<text>{{ sex == '0' ? '男' : sex == '1' ? '女' : sex }}</text>
-				</picker>
-			</view>
-			<view class="box-1">
-				<view class="box-left">学历</view>
-				<picker @change="bindPickerEdu" :value="index" :range="chooseEdu" class="box-right">
-					<text>{{ education }}</text>
-				</picker>
-			</view>
-			<view class="box-1">
-				<view class="box-left">身份证号</view>
-				<input type="text" placeholder="请填写你的身份证号" placeholder-class="placeholder" value="" class="list-input" v-model="card" />
-			</view>
-			<view class="box-1">
-				<view class="box-left">移动电话</view>
-				<input type="text" placeholder="请填写你的联系电话" placeholder-class="placeholder" value="" class="list-input" v-model="phone" />
-			</view>
-			<view class="box-1">
-				<view class="box-left">职业/职务</view>
-				<input type="text" value="" placeholder="请填写你的职业/职务" placeholder-class="placeholder" class="list-input" v-model="occupation" />
-			</view>
-		</view>
-
-		<view class="top">
-			<view class="title">个人声明</view>
-			<view class="info-box">遗体器官捐献是服务医疗事业,造福人类的高尚行为,是“人道、博爱、奉献”精神的崇高体现,我已了解遗体器官捐献的基本常识和有关政策法规。</view>
-			<view class="info-box" style="padding-top: 0;">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
-			<view class="uni-list" style="display: block;">
-				<checkbox-group v-if="type == '人体器官' && ready" @change="checkAllClick" style="padding-left: 50rpx;">
-					<label class="checkbox">
-						<checkbox :checked="checkAll.type" color="#E62129" style="transform:scale(0.6);margin: 0;padding: 0;" :value="checkAll.name" />
-						{{ checkAll.name }}
-					</label>
-				</checkbox-group>
-				<view style="display: flex;">
-					<view class="" v-if="type == '人体器官'" style="width: 50rpx;">或:</view>
-					<checkbox-group v-if="type == '人体器官'" style="display: inline-block;width: 600rpx;" @change="checkboxChange">
-						<label class="checkbox" v-for="item in apparatus" :key="item.name">
-							<checkbox :checked="item.type" color="#E62129" style="transform:scale(0.6);margin: 0;padding: 0;" :value="item.name" />
-							{{ item.name }}
-						</label>
-					</checkbox-group>
-				</view>
-
-				<view class="font">请执行人和所有亲属尊重我的决定。</view>
-			</view>
-		</view>
-		<view class="top">
-			<view class="title">人体器官捐献执行人信息</view>
-			<view class="info-box">我指定该亲属为我的器官捐献执行人,全权负责本人的器官捐献事宜,我保证填写的内容信息真实,如发生变更及时告知登记机构。</view>
-			<view class="uni-list" style="display: block;">
-				<view class="box-1" style="margin-top: 0rpx;">
-					<view class="box-left">捐献执行人</view>
-					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写执行人姓名" class="list-input" v-model="executor" />
-				</view>
-				<view class="box-1" style="margin-top: 20rpx;">
-					<view class="box-left">亲属关系</view>
-					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写与本人的关系" class="list-input" v-model="relation" />
-				</view>
-				<view class="box-1" style="margin-top: 20rpx;">
-					<view class="box-left">身份证号</view>
-					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属身份证号" class="list-input" v-model="sfz" />
-				</view>
-				<view class="box-1" style="margin-top: 20rpx;">
-					<view class="box-left">联系电话</view>
-					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属联系电话" class="list-input" v-model="n_phone" />
-				</view>
-			</view>
-		</view>
-
-		<view class="buttomBox"><view class="buttom" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view></view>
-	</view>
-</template>
-
-<script>
-import { joinSecc, getList, donate_ify } from '@/api/index.js';
-import { upload } from '@/api/ask.js';
-export default {
-	data() {
-		const currentDate = this.getDate({
-			format: true
-		});
-		return {
-			ready: true,
-			all: false,
-			isall: false,
-			type: '',
-			loding: false, //是否提交中
-			array: ['男', '女'],
-			chooseEdu: ['小学以下', '小学', '初中', '高中/中专', '大专/本科', '硕士', '博士', '博士后'],
-			chooseVol: ['是', '否'],
-			chooseExp: ['是', '否'],
-			items: [],
-			remark: '',
-			current: '',
-			index: 0,
-			mz: '',
-			cardimg: '', //证件照
-			checklist: [],
-			name: '',
-			sex: '请选择你的性别',
-			birthday: '请选择你的出生年月',
-			card: '',
-			occupation: '',
-			education: '请选择你的文化程度',
-			educationid: '',
-			phone: '',
-			executor: '', //执行人名字
-			relation: '', //执行人关系
-			n_phone: '', //执行人电话
-			sfz: '', //执行人身份证号
-			Getchecked: false,
-			Getcheckeds: false,
-			address: '',
-			work: '',
-			other: '',
-			friendOnename: '',
-			friendOnerelation: '',
-			friendOnephone: '',
-			friendOneaddress: '',
-			friendOneweixin: '',
-			friendTwoname: '',
-			friendTworelation: '',
-			friendTwophone: '',
-			friendTwoaddress: '',
-			friendTwoweixin: ''
-		};
-	},
-	computed: {
-		startDate() {
-			return this.getDate('start');
-		},
-		endDate() {
-			return this.getDate('end');
-		}
-	},
-	onLoad() {
-		donate_ify().then(e => {
-			this.items = e.data;
-		});
-	},
-	methods: {
-		async join() {
-			const obj = this
-			joinSecc({
-				full_name: obj.name, //姓名
-				sex: obj.sex, //性别0男1女
-				birthday: obj.birthday, //生日
-				id_card: obj.card, //身份证号
-				vocation: obj.occupation, //职业
-				education: obj.educationid, //学历
-				category_ids: obj.type, //捐献类型
-				mobile: obj.phone, //移动电话
-				executor: obj.executor, //捐献执行人
-				executor_id_card: obj.sfz, //执行人身份证号
-				executor_mobile: obj.n_phone, //执行人移动电话
-				executor_relation: obj.relation //执行人关系
-			})
-				.then(e => {
-					console.log(e, '2322222222222222222222222222222222222222');
-
-					obj.name = '';
-					obj.sex = '请选择你的性别';
-					obj.education = '请选择你的文化程度';
-					obj.birth = '请选择你的出生年月';
-					obj.executor = '';
-					obj.sfz = '';
-					obj.n_phone = '';
-					obj.relation = '';
-					uni.navigateTo({
-						url: '../joinSuc/joinNow'
-					});
-				})
-				.catch(function(e) {
-					console.log('出错了');
-					console.log(e);
-				});
-		},
-		imgsub() {
-			console.log('imgsub');
-			upload({
-				filename: ''
-			}).then(data => {
-				this.cardimg = data[0].url;
-			});
-		},
-		// 选择性别
-		bindPickerSex: function(e) {
-			this.sex = e.target.value;
-			this.index = e.target.value + 1;
-		},
-		// 选择教育程度
-		bindPickerEdu: function(e) {
-			this.education = this.chooseEdu[e.target.value];
-			this.educationid = e.target.value;
-			console.log(this.educationid);
-		},
-		// 选择日期
-		bindDateChange: function(e) {
-			console.log(e);
-			this.birthday = e.target.value;
-			console.log(this.birthday);
-		},
-		//选择填写日期
-		fillingDateChange: function(e) {
-			this.add_time = e.target.value;
-		},
-		// 是否参加志愿活动
-		bindPickerVol: function(e) {
-			this.is_vol = this.chooseVol[e.target.value];
-			this.index = e.target.value + 1;
-		},
-		// 有无服务经验
-		bindPickerExp: function(e) {
-			console.log('有无服务经验', e.target.value);
-			this.is_experience = this.chooseExp[e.target.value];
-			this.index = e.target.value + 1;
-		},
-		// 选择捐献
-		radioChange: function(evt) {
-			console.log('选择捐献', evt);
-			for (let i = 0; i < this.items.length; i++) {
-				console.log(this.items[i].id,evt.detail.value)
-				if (this.items[i].id == evt.detail.value) {
-					this.type = evt.detail.value;
-					console.log('this.type', this.type);
-					this.current = i;
-					console.log('this.current', this.current);
-					break;
-				}
-			}
-			if (this.type == '遗体捐献') {
-				this.remark = '遗体捐献';
-				this.all = true;
-			}
-		},
-		checkboxChangeAll(e) {
-			const obj = this;
-			for (let i = 0; i < obj.apparatus.length; i++) {
-				obj.apparatus[i].type = false;
-			}
-			if (obj.remark != ' ') {
-				obj.remark = '';
-			}
-			console.log(e, '`11111');
-			obj.remark = e.detail.value.join(',');
-			console.log(obj.remark);
-			obj.all = true;
-		},
-		//器官捐献时选择要捐献的器官
-		checkboxChange(e) {
-			const obj = this;
-			obj.all = false;
-			this.checkAll.type = false;
-			this.reload();
-			if (obj.remark != '') {
-				if (obj.remark.indexOf('all') != -1) {
-					obj.remark = '';
-				}
-			}
-			obj.remark = e.detail.value.join(',');
-			for (let i = 0; i < obj.apparatus.length; i++) {
-				if (obj.remark.indexOf(obj.apparatus[i].name) != -1) {
-					obj.apparatus[i].type = true;
-				}
-			}
-			console.log(obj.remark);
-		},
-		Getcheckbox() {
-			let obj = this;
-			obj.Getchecked = !obj.Getchecked;
-		},
-		Getcheckboxs() {
-			let obj = this;
-			obj.Getcheckeds = !obj.Getcheckeds;
-		},
-		getDate(type) {
-			const date = new Date();
-			let year = date.getFullYear();
-			let month = date.getMonth() + 1;
-			let day = date.getDate();
-
-			if (type === 'start') {
-				year = year - 60;
-			} else if (type === 'end') {
-				year = year + 2;
-			}
-			month = month > 9 ? month : '0' + month;
-			day = day > 9 ? day : '0' + day;
-			return `${year}-${month}-${day}`;
-		},
-		// 选择可提供时间
-
-		// this.quantum = item.detail.value.join(',');
-
-		checktime1(e) {
-			// var items = this.timeList,
-			// let quantum = [];
-			this.quantum = e.detail.value.join(',');
-			console.log(this.quantum);
-		},
-		checktime2(e) {
-			// var items = this.timeList,
-			let values = e.detail.value;
-			// let quantum = [];
-			console.log(values);
-		},
-		checktime3(e) {
-			// var items = this.timeList,
-			let values = e.detail.value;
-			// let quantum = [];
-			console.log(values);
-		},
-		//选择有兴趣参与的工作
-		checkjob(item) {
-			this.taste = item.detail.value.join(',');
-		},
-		// 选择专长checkspeciality
-		checkspeciality(item) {
-			this.speciali = item.detail.value.join(',');
-		},
-		reload() {
-			this.ready = false;
-			this.$nextTick(function() {
-				this.ready = true;
-			});
-		},
-		checkAllClick(e) {
-			let obj = this;
-			console.log(e.detail.value[0]);
-			if (e.detail.value[0]) {
-				this.remark = e.detail.value[0];
-				for (let i = 0; i < obj.apparatus.length; i++) {
-					obj.apparatus[i].type = false;
-				}
-			} else {
-				this.remark = '';
-			}
-			console.log(this.remark);
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	background: #f2f2f2;
-}
-
-.content {
-	background: #f2f2f2;
-	.top {
-		margin-top: 16rpx;
-		background: #ffffff;
-		position: relative;
-		.title {
-			height: 106rpx;
-			text-align: center;
-			line-height: 106rpx;
-			border-bottom: 2rpx #acacac dashed;
-			font-size: 34rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #101010;
-		}
-		.info-box {
-			font-size: 24rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #666666;
-			text-indent: 1em;
-			padding: 37rpx 60rpx 0rpx 36rpx;
-			text {
-				color: #101010;
-				font-family: PingFang-SC-Medium;
-				font-weight: bold;
-			}
-			// border: 3rpx solid #009100;
-		}
-		.uni-list {
-			padding: 26rpx 34rpx 50rpx 35rpx;
-			// .radio:first-child {
-			// 	margin: -6rpx;
-			// }
-			.radio {
-				margin-left: 50rpx;
-				flex: 1;
-				align-items: center;
-				font-size: 24rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #191919;
-			}
-			.checkbox {
-				display: inline-block;
-				font-size: 24rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #191919;
-			}
-			.box-2 {
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				width: 100%;
-				margin-top: 8rpx;
-				// height: 133rpx;
-
-				.box-left {
-					padding-left: 2rpx;
-					text-align: left;
-					width: 62rpx;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #191919;
-				}
-
-				input {
-					height: 66rpx;
-					line-height: 66rpx;
-					// height: 88rpx;
-				}
-
-				.list-input {
-					padding-left: 22rpx;
-					// margin: 12rpx 0 ;
-					font-size: 28rpx;
-					display: flex;
-					justify-content: center;
-					// line-height: 66rpx;
-					display: flex;
-					align-items: center;
-					flex: 1;
-					color: #000000;
-					border: 1px solid #d2d2d2;
-					text-align: left;
-
-					.input-placeholder {
-						height: 70rpx;
-						color: #959595;
-					}
-				}
-
-				.box-right {
-					display: flex;
-					padding-left: 22rpx;
-					height: 66rpx;
-					line-height: 66rpx;
-					border: 1px solid #d2d2d2;
-					// margin: 32rpx 36rpx 0 36rpx;
-					width: 500rpx;
-					font-size: 28rpx;
-					color: #959595;
-					text-align: left !important;
-					// line-height: 1;
-				}
-			}
-			.font {
-				margin-top: 22rpx;
-				font-size: 24rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #666666;
-			}
-		}
-		.agree {
-			display: flex;
-			align-items: center;
-			padding: 37rpx 60rpx 40rpx 36rpx;
-			font-size: 24rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #191919;
-		}
-	}
-
-	.buttomBox {
-		height: 100rpx;
-		// padding-bottom: 40rpx;
-	}
-	.buttom {
-		width: 100%;
-		height: 100rpx;
-		background: #f3392c;
-		font-size: 36rpx;
-		font-weight: 400;
-		color: #ffffff;
-		line-height: 100rpx;
-		text-align: center;
-
-		&.action {
-			background: #999999;
-		}
-	}
-
-	.box {
-		margin-top: 16rpx;
-		width: 100%;
-		background-color: #ffffff;
-		border-radius: 10rpx;
-		padding: 28rpx 20rpx 32rpx 20rpx;
-		position: relative;
-
-		.red-box {
-			width: 405rpx;
-			line-height: 66rpx;
-			text-align: center;
-			background: linear-gradient(0deg, #c90f1b, #f14d33);
-			border-radius: 10rpx;
-			font-size: 30rpx;
-			font-weight: 500;
-			color: #ffffff;
-			// position: relative;
-			position: absolute;
-			top: -36rpx;
-			left: 50%;
-			transform: translateX(-50%);
-			z-index: 1;
-		}
-
-		.box-check {
-			font-size: 28rpx;
-			font-weight: 500;
-			color: #666666;
-			line-height: 100rpx;
-		}
-
-		.upload-box {
-			width: 100%;
-			height: 247rpx;
-			background: #ffffff;
-			// border: 1px solid #E63931;
-			border-radius: 27rpx;
-			display: flex;
-			flex-direction: column;
-			padding: 30rpx 40rpx 30rpx 0;
-			margin: 42rpx auto 30rpx;
-
-			.upload-left {
-				font-weight: 400;
-				color: #000000;
-			}
-
-			.upload-right {
-				flex: 1;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-
-				.upload-img {
-					width: 150rpx;
-					height: 150rpx;
-					margin-top: 24rpx;
-				}
-			}
-		}
-	}
-	.box-1 {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		width: 100%;
-		margin-top: 42rpx;
-		// height: 133rpx;
-
-		.box-left {
-			padding-left: 2rpx;
-			width: 184rpx;
-			text-align: left;
-			font-size: 28rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #191919;
-		}
-
-		input {
-			height: 66rpx;
-			line-height: 66rpx;
-			// height: 88rpx;
-		}
-
-		.list-input {
-			padding-left: 22rpx;
-			// margin: 12rpx 0 ;
-			font-size: 28rpx;
-			// line-height: 66rpx;
-			display: flex;
-			align-items: center;
-			flex: 1;
-			color: #000000;
-			width: 500rpx;
-			border: 1px solid #d2d2d2;
-			text-align: left;
-
-			.input-placeholder {
-				height: 70rpx;
-				color: #959595;
-			}
-		}
-
-		.box-right {
-			display: flex;
-			padding-left: 22rpx;
-			height: 66rpx;
-			line-height: 66rpx;
-			border: 1px solid #d2d2d2;
-			// margin: 32rpx 36rpx 0 36rpx;
-			width: 500rpx;
-			font-size: 28rpx;
-			color: #959595;
-			text-align: left !important;
-			// line-height: 1;
-		}
-	}
-}
-.placeholder {
-	line-height: 66rpx;
-}
+<template>
+	<view class="content">
+		<view class="top">
+			<view class="title">登记选择</view>
+			<view class="info-box">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
+			<view class="uni-list">
+				<radio-group class="radio-box" @change="radioChange">
+					<label v-for="(item, index) in items" :key="item.name">
+						<label class="radio">
+							{{ item.name }}
+							<radio :checked="index === current" color="#E62129" style="transform:scale(0.5)"
+								:value="item.name" />
+							<text></text>
+						</label>
+					</label>
+				</radio-group>
+			</view>
+		</view>
+
+		<view class="box">
+			<view class="box-1">
+				<view class="box-left">姓名</view>
+				<input type="text" placeholder="请填写你的名字" placeholder-class="placeholder" value="" class="list-input"
+					v-model="name" />
+			</view>
+			<view class="box-1">
+				<view class="box-left">出生年月</view>
+				<picker mode="date" :value="birthday" :start="startDate" :end="endDate" @change="bindDateChange"
+					class="box-right">
+					<view>{{ birthday }}</view>
+				</picker>
+			</view>
+			<view class="box-1">
+				<view class="box-left">性别</view>
+				<picker @change="bindPickerSex" :value="index" :range="array" class="box-right">
+					<text>{{ sex }}</text>
+				</picker>
+			</view>
+			<view class="box-1">
+				<view class="box-left">学历</view>
+				<picker @change="bindPickerEdu" :value="index" :range="chooseEdu" class="box-right">
+					<text>{{ education }}</text>
+				</picker>
+			</view>
+			<view class="box-1">
+				<view class="box-left">身份证号</view>
+				<input type="text" placeholder="请填写你的身份证号" placeholder-class="placeholder" value="" class="list-input"
+					v-model="card" />
+			</view>
+			<view class="box-1">
+				<view class="box-left">移动电话</view>
+				<input type="text" placeholder="请填写你的联系电话" placeholder-class="placeholder" value="" class="list-input"
+					v-model="phone" />
+			</view>
+			<view class="box-1">
+				<view class="box-left">职业/职务</view>
+				<input type="text" value="" placeholder="请填写你的职业/职务" placeholder-class="placeholder" class="list-input"
+					v-model="occupation" />
+			</view>
+		</view>
+
+		<view class="top">
+			<view class="title">个人声明</view>
+			<view class="info-box">
+				遗体器官捐献是服务医疗事业,造福人类的高尚行为,是“人道、博爱、奉献”精神的崇高体现,我已了解遗体器官捐献的基本常识和有关政策法规。</view>
+			<view class="info-box" style="padding-top: 0;">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
+			<view class="uni-list" style="display: block;">
+				<checkbox-group v-if="type == '人体器官' && ready" @change="checkAllClick" style="padding-left: 50rpx;">
+					<label class="checkbox">
+						<checkbox :checked="checkAll.type" color="#E62129"
+							style="transform:scale(0.6);margin: 0;padding: 0;" :value="checkAll.name" />
+						{{checkAll.name}}
+					</label>
+				</checkbox-group>
+				<view style="display: flex;">
+					<view class="" v-if="type == '人体器官'" style="width: 50rpx;">
+						或:
+					</view>
+					<checkbox-group v-if="type == '人体器官'" style="display: inline-block;width: 600rpx;"
+						@change="checkboxChange">
+						<label class="checkbox" v-for="item in apparatus" :key="item.name">
+							<checkbox :checked="item.type" color="#E62129"
+								style="transform:scale(0.6);margin: 0;padding: 0;" :value="item.name" />{{ item.name }}
+						</label>
+					</checkbox-group>
+				</view>
+
+				<view class="font">请执行人和所有亲属尊重我的决定。</view>
+			</view>
+		</view>
+		<view class="top">
+			<view class="title">人体器官捐献执行人信息</view>
+			<view class="info-box">我指定该亲属为我的器官捐献执行人,全权负责本人的器官捐献事宜,我保证填写的内容信息真实,如发生变更及时告知登记机构。</view>
+			<view class="uni-list" style="display: block;">
+				<view class="box-1" style="margin-top: 0rpx;">
+					<view class="box-left">捐献执行人</view>
+					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写执行人姓名"
+						class="list-input" v-model="executor" />
+				</view>
+				<view class="box-1" style="margin-top: 20rpx;">
+					<view class="box-left">亲属关系</view>
+					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写与本人的关系"
+						class="list-input" v-model="relation" />
+				</view>
+				<view class="box-1" style="margin-top: 20rpx;">
+					<view class="box-left">身份证号</view>
+					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属身份证号"
+						class="list-input" v-model="sfz" />
+				</view>
+				<view class="box-1" style="margin-top: 20rpx;">
+					<view class="box-left">联系电话</view>
+					<input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属联系电话"
+						class="list-input" v-model="n_phone" />
+				</view>
+			</view>
+		</view>
+
+		<view class="buttomBox">
+			<view class="buttom" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		joinSecc,
+		getList,
+		donate_ify
+	} from '@/api/index.js';
+	// import {
+	// 	getList
+	// } from '@/api/index.js';
+	import {
+		upload
+	} from '@/api/ask.js';
+	export default {
+		data() {
+			const currentDate = this.getDate({
+				format: true
+			});
+			return {
+				ready: true,
+				all: false,
+				isall: false,
+				type: '',
+				loding: false, //是否提交中
+				array: ['男', '女'],
+				chooseEdu: ['小学以下', '小学', '初中', '高中/中专', '大专/本科', '硕士', '博士', '博士后'],
+				chooseVol: ['是', '否'],
+				chooseExp: ['是', '否'],
+				realyItems: [], //捐赠对照表
+				items: [{
+						name: '人体器官'
+					},
+					{
+						name: '眼角膜'
+					},
+					{
+						name: '遗体捐献'
+					}
+				],
+				checkAll: {
+					name: '全部器官',
+					type: false
+				},
+				apparatus: [{
+						name: '肾脏',
+						type: false
+					},
+					{
+						name: '肝脏',
+						type: false
+					},
+					{
+						name: '心脏',
+						type: false
+					},
+					{
+						name: '肺脏',
+						type: false
+					},
+					{
+						name: '胰腺',
+						type: false
+					},
+					{
+						name: '小肠',
+						type: false
+					},
+					{
+						name: '其他',
+						type: false
+					}
+				],
+				remark: '',
+				current: '',
+				index: 0,
+				mz: '',
+				cardimg: '', //证件照
+				checklist: [],
+				name: '',
+				sex: '请选择你的性别',
+				birthday: '请选择你的出生年月',
+				card: '',
+				occupation: '',
+				education: '请选择你的文化程度',
+				phone: '',
+				executor: '', //执行人名字
+				relation: '', //执行人关系
+				n_phone: '', //执行人电话
+				sfz: '', //执行人身份证号
+				Getchecked: false,
+				Getcheckeds: false,
+				address: '',
+				mail: '',
+				weixin: '',
+				major: '',
+				work: '',
+				other: '',
+				friendOnename: '',
+				friendOnerelation: '',
+				friendOnephone: '',
+				friendOneaddress: '',
+				friendOneweixin: '',
+				friendTwoname: '',
+				friendTworelation: '',
+				friendTwophone: '',
+				friendTwoaddress: '',
+				friendTwoweixin: '',
+				educationid: '', //学历id
+			};
+		},
+		computed: {
+			startDate() {
+				return this.getDate('start');
+			},
+			endDate() {
+				return this.getDate('end');
+			}
+		},
+		onLoad() {
+			this.getDonateList()
+		},
+		methods: {
+			// 获取捐赠对照列表
+			getDonateList() {
+				donate_ify().then(e => {
+					this.realyItems = e.data;
+					let arr = e.data.filter(item => {
+						item.type = false
+						return (item.name != '人体器官') && (item.name != '眼角膜') && (item.name != '遗体') && (
+							item.name != '全部器官')
+					})
+					this.apparatus = arr;
+					console.log(this.realyItems, '获取捐赠对照列表')
+
+				});
+			},
+			async join() {
+				let obj = this;
+				let arr = []
+				
+				console.log(obj.remark)
+				if (obj.type == '') {
+					obj.$api.msg('请选择你要捐献的器官');
+					return;
+				}
+				if (obj.name == '') {
+					obj.$api.msg('请输入您的姓名');
+					return;
+				}
+				if (obj.birth == '请选择你的出生年月') {
+					obj.$api.msg('请选择出生年月');
+					return;
+				}
+				if (obj.sex == '请选择你的性别') {
+					obj.$api.msg('请输入您的性别');
+					return;
+				}
+				if (obj.education == '请选择你的文化程度') {
+					obj.$api.msg('请选择您的文化程度');
+					return;
+				}
+				if (obj.card == '') {
+					obj.$api.msg('请填写您的身份证号');
+					return;
+				}
+				let reg1 =
+					/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
+				if (!reg1.test(obj.card)) {
+					obj.$api.msg('请填写正确的身份证号');
+					return;
+				}
+				if (obj.phone == '') {
+					obj.$api.msg('请填写您的移动电话');
+					return;
+				}
+				const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
+				if (!reg.test(obj.phone)) {
+					obj.$api.msg('请填写正确的移动电话');
+					return;
+				}
+				if (obj.specialty == '') {
+					obj.$api.msg('请填写您的职业/职务');
+					return;
+				}
+				console.log(obj.remark, '1111');
+				if (obj.type == '眼角膜') {
+					obj.remark = '眼角膜'
+				}
+				if (obj.remark == '') {
+					obj.$api.msg('请选择要捐献的器官');
+					return;
+				}
+				if (obj.executor == '') {
+					obj.$api.msg('请填写执行人姓名');
+					return;
+				}
+				if (obj.relation == '') {
+					obj.$api.msg('请填写亲属身份');
+					return;
+				}
+				if (obj.sfz == '') {
+					obj.$api.msg('请填写亲属身份证号');
+					return;
+				}
+				if (obj.n_phone == '') {
+					obj.$api.msg('请填写亲属联系电话');
+					return;
+				}
+				obj.loding = true;
+				obj.realyItems.forEach(item => {
+					console.log(item.name,obj.remark)
+					if(obj.remark.indexOf(item.name) != -1) {
+						arr.push(item.id + '')
+					}
+				})
+				console.log(arr.join(','),'ddddddddddd')
+				joinSecc({
+						full_name: obj.name, //姓名
+						sex: obj.sex == '男'? 0: 1, //性别0男1女
+						birthday: obj.birthday, //生日
+						id_card: obj.card, //身份证号
+						vocation: obj.occupation, //职业
+						education: obj.educationid, //学历
+						category_ids: arr.join(','), //捐献类型
+						mobile: obj.phone, //移动电话
+						executor: obj.executor, //捐献执行人
+						executor_id_card: obj.sfz, //执行人身份证号
+						executor_mobile: obj.n_phone, //执行人移动电话
+						executor_relation: obj.relation //执行人关系
+					})
+					.then(e => {
+						console.log(e, '2322222222222222222222222222222222222222');
+
+						obj.name = '';
+						obj.sex = '请选择你的性别';
+						obj.education = '请选择你的文化程度';
+						obj.birth = '请选择你的出生年月';
+						obj.executor = '';
+						obj.sfz = '';
+						obj.n_phone = '';
+						obj.relation = '';
+						uni.navigateTo({
+							url: '../joinSuc/joinNow'
+						});
+					})
+					.catch(function(e) {
+						console.log('出错了');
+						console.log(e);
+						obj.loding = false;
+					});
+				// obj.body(1)
+			},
+			//器官捐献
+			body(item) {
+				const obj = this;
+				joinSecc({
+						name: obj.name,
+						sex: obj.sex,
+						education: obj.education,
+						birthday: obj.birthday,
+						card: obj.card,
+						occupation: obj.occupation,
+						remark: obj.remark,
+						phone: obj.phone,
+						executor: obj.executor,
+						relation: obj.relation,
+						sfz: obj.sfz,
+						n_phone: obj.n_phone,
+						// other: obj.other //其他器官
+					})
+					.then(e => {
+						console.log(e, "2322222222222222222222222222222222222222")
+						if (e.status == 400) {
+							console.log(e.msg);
+							this.$api.msg("你已报名成功,不可重复报名")
+						} else {
+							// obj.name = '';
+							obj.sex = '请选择你的性别';
+							obj.education = '请选择你的文化程度';
+							obj.birth = '请选择你的出生年月';
+							(obj.mz = ''), (obj.phone = '');
+							obj.address = '';
+							obj.work = '';
+							obj.specialty = '';
+							(obj.cardimg = ''), (obj.card = '');
+							obj.mail = '';
+							(obj.weixin = ''), (obj.major = '');
+
+							let date = new Date()
+							let year = date.getFullYear()
+							let month = date.getMonth() >= 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)
+							let day = date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()
+							if (item == 1) {
+								uni.navigateTo({
+									url: '../joinSuc/certificate?name' + obj.name + '&time=' + year + '年' +
+										month + '月' + day + '日'
+								});
+							}
+						}
+					})
+					.catch(function(e) {
+						console.log('出错了');
+						console.log(e);
+					});
+			},
+			//造血干细胞捐献
+			bloud() {
+				const obj = this;
+				getList({
+						name: obj.name,
+						sex: obj.sex,
+						education: obj.education, //文化程度
+						birthday: obj.birthday,
+						card: obj.card, //身份证号
+						cardimg: obj.cardimg, //照片
+						occupation: obj.occupation, //职业或职务
+						phone: obj.phone,
+						address: obj.address, //地址
+						mail: obj.mail, // 邮箱
+						weixin: obj.weixin, //微信
+						major: obj.major, //专业或专长
+						work: obj.work, // 工作单位
+						friendOnename: obj.friendOnename, //亲友一的姓名
+						friendOnerelation: obj.friendOnerelation, //亲友一与全赠者的关系
+						friendOnephone: obj.friendOnephone, //亲友一的手机号
+						friendOneweixin: obj.friendOneweixin, //亲友一的微信号
+						friendOneaddress: obj.friendOneaddress, //亲友一的地址
+						friendTwoname: obj.friendTwoname, //亲友二的姓名
+						friendTworelation: obj.friendTworelation, //亲友二与全赠者的关系
+						friendTwophone: obj.friendTwophone, //亲友二的手机号
+						friendTwoweixin: obj.friendTwoweixin, //亲友二的微信号
+						friendTwoaddress: obj.friendTwoaddress //亲友二的地址
+					})
+					.then(e => {
+						console.log(e, "22222222222222222222222")
+						if (e.status == 400) {
+							console.log(e.msg);
+							this.$api.msg("你已报名成功,不可重复报名")
+						} else {
+							// obj.name = '';
+							obj.sex = '请选择你的性别';
+							obj.education = '请选择你的文化程度';
+							obj.birth = '请选择你的出生年月';
+							(obj.mz = ''), (obj.phone = '');
+							obj.address = '';
+							obj.work = '';
+							obj.specialty = '';
+							(obj.cardimg = ''), (obj.card = '');
+							obj.mail = '';
+							(obj.weixin = ''), (obj.major = '');
+							let date = new Date()
+							let year = date.getFullYear()
+							let month = date.getMonth() >= 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)
+							let day = date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()
+							uni.navigateTo({
+								url: '../joinSuc/certificate?name' + obj.name + '&time=' + year + '年' + month +
+									'月' + day + '日'
+							});
+						}
+
+					})
+					.catch(function(e) {
+						console.log('出错了');
+						console.log(e);
+					});
+			},
+			imgsub() {
+				console.log('imgsub');
+				upload({
+					filename: ''
+				}).then(data => {
+					this.cardimg = data[0].url;
+				});
+			},
+			// 选择性别
+			bindPickerSex: function(e) {
+				this.sex = this.array[e.target.value];
+				this.index = e.target.value + 1;
+			},
+			// 选择教育程度
+			bindPickerEdu: function(e) {
+				this.education = this.chooseEdu[e.target.value];
+				this.educationid = e.target.value;
+				console.log(this.educationid);
+			},
+			// 选择日期
+			bindDateChange: function(e) {
+				console.log(e);
+				this.birthday = e.target.value;
+				console.log(this.birthday);
+			},
+			//选择填写日期
+			fillingDateChange: function(e) {
+				this.add_time = e.target.value;
+			},
+			// 是否参加志愿活动
+			bindPickerVol: function(e) {
+				this.is_vol = this.chooseVol[e.target.value];
+				this.index = e.target.value + 1;
+			},
+			// 有无服务经验
+			bindPickerExp: function(e) {
+				console.log('有无服务经验', e.target.value);
+				this.is_experience = this.chooseExp[e.target.value];
+				this.index = e.target.value + 1;
+			},
+			// 选择捐献
+			radioChange: function(evt) {
+				console.log('选择捐献', evt);
+				for (let i = 0; i < this.items.length; i++) {
+					if (this.items[i].name === evt.detail.value) {
+						this.type = evt.detail.value;
+						console.log('this.type', this.type);
+						this.current = i;
+						console.log('this.current', this.current);
+						break;
+					}
+				}
+				if (this.type == '遗体捐献') {
+					this.remark = '遗体捐献';
+					this.all = true;
+				}
+			},
+			checkboxChangeAll(e) {
+				const obj = this;
+				for (let i = 0; i < obj.apparatus.length; i++) {
+					obj.apparatus[i].type = false;
+				}
+				if (obj.remark != ' ') {
+					obj.remark = '';
+				}
+				console.log(e, "`11111")
+				obj.remark = e.detail.value.join(',');
+				console.log(obj.remark);
+				obj.all = true;
+			},
+			//器官捐献时选择要捐献的器官
+			checkboxChange(e) {
+				const obj = this;
+				obj.all = false;
+				this.checkAll.type = false
+				this.reload()
+				if (obj.remark != '') {
+					if (obj.remark.indexOf('all') != -1) {
+						obj.remark = '';
+					}
+				}
+				obj.remark = e.detail.value.join(',');
+				for (let i = 0; i < obj.apparatus.length; i++) {
+					if (obj.remark.indexOf(obj.apparatus[i].name) != -1) {
+						obj.apparatus[i].type = true;
+					}
+				}
+				console.log(obj.remark);
+			},
+			Getcheckbox() {
+				let obj = this;
+				obj.Getchecked = !obj.Getchecked;
+			},
+			Getcheckboxs() {
+				let obj = this;
+				obj.Getcheckeds = !obj.Getcheckeds;
+			},
+			getDate(type) {
+				const date = new Date();
+				let year = date.getFullYear();
+				let month = date.getMonth() + 1;
+				let day = date.getDate();
+
+				if (type === 'start') {
+					year = year - 60;
+				} else if (type === 'end') {
+					year = year + 2;
+				}
+				month = month > 9 ? month : '0' + month;
+				day = day > 9 ? day : '0' + day;
+				return `${year}-${month}-${day}`;
+			},
+			// 选择可提供时间
+
+			// this.quantum = item.detail.value.join(',');
+
+			checktime1(e) {
+				// var items = this.timeList,
+				// let quantum = [];
+				this.quantum = e.detail.value.join(',');
+				console.log(this.quantum);
+			},
+			checktime2(e) {
+				// var items = this.timeList,
+				let values = e.detail.value;
+				// let quantum = [];
+				console.log(values);
+			},
+			checktime3(e) {
+				// var items = this.timeList,
+				let values = e.detail.value;
+				// let quantum = [];
+				console.log(values);
+			},
+			//选择有兴趣参与的工作
+			checkjob(item) {
+				this.taste = item.detail.value.join(',');
+			},
+			// 选择专长checkspeciality
+			checkspeciality(item) {
+				this.speciali = item.detail.value.join(',');
+			},
+			reload() {
+				this.ready = false
+				this.$nextTick(function() {
+					this.ready = true
+				})
+			},
+			checkAllClick(e) {
+				let obj = this
+				console.log(e.detail.value[0])
+				if (e.detail.value[0]) {
+					this.remark = e.detail.value[0]
+					for (let i = 0; i < obj.apparatus.length; i++) {
+						obj.apparatus[i].type = false;
+					}
+				} else {
+					this.remark = ''
+				}
+				console.log(this.remark)
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: #f2f2f2;
+	}
+
+	.content {
+		background: #f2f2f2;
+
+		.top {
+			margin-top: 16rpx;
+			background: #ffffff;
+			position: relative;
+
+			.title {
+				height: 106rpx;
+				text-align: center;
+				line-height: 106rpx;
+				border-bottom: 2rpx #acacac dashed;
+				font-size: 34rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #101010;
+			}
+
+			.info-box {
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #666666;
+				text-indent: 1em;
+				padding: 37rpx 60rpx 0rpx 36rpx;
+
+				text {
+					color: #101010;
+					font-family: PingFang-SC-Medium;
+					font-weight: bold;
+				}
+
+				// border: 3rpx solid #009100;
+			}
+
+			.uni-list {
+				padding: 26rpx 34rpx 50rpx 35rpx;
+
+				// .radio:first-child {
+				// 	margin: -6rpx;
+				// }
+				.radio {
+					margin-left: 50rpx;
+					flex: 1;
+					align-items: center;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #191919;
+				}
+
+				.checkbox {
+					display: inline-block;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #191919;
+				}
+
+				.box-2 {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					width: 100%;
+					margin-top: 8rpx;
+					// height: 133rpx;
+
+					.box-left {
+						padding-left: 2rpx;
+						text-align: left;
+						width: 62rpx;
+						font-size: 24rpx;
+						font-family: PingFang SC;
+						font-weight: 500;
+						color: #191919;
+					}
+
+					input {
+						height: 66rpx;
+						line-height: 66rpx;
+						// height: 88rpx;
+					}
+
+					.list-input {
+						padding-left: 22rpx;
+						// margin: 12rpx 0 ;
+						font-size: 28rpx;
+						display: flex;
+						justify-content: center;
+						// line-height: 66rpx;
+						display: flex;
+						align-items: center;
+						flex: 1;
+						color: #000000;
+						border: 1px solid #d2d2d2;
+						text-align: left;
+
+						.input-placeholder {
+							height: 70rpx;
+							color: #959595;
+						}
+					}
+
+					.box-right {
+						display: flex;
+						padding-left: 22rpx;
+						height: 66rpx;
+						line-height: 66rpx;
+						border: 1px solid #d2d2d2;
+						// margin: 32rpx 36rpx 0 36rpx;
+						width: 500rpx;
+						font-size: 28rpx;
+						color: #959595;
+						text-align: left !important;
+						// line-height: 1;
+					}
+				}
+
+				.font {
+					margin-top: 22rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #666666;
+				}
+			}
+
+			.agree {
+				display: flex;
+				align-items: center;
+				padding: 37rpx 60rpx 40rpx 36rpx;
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #191919;
+			}
+		}
+
+		.buttomBox {
+			height: 100rpx;
+			// padding-bottom: 40rpx;
+		}
+
+		.buttom {
+			width: 100%;
+			height: 100rpx;
+			background: #f3392c;
+			font-size: 36rpx;
+			font-weight: 400;
+			color: #ffffff;
+			line-height: 100rpx;
+			text-align: center;
+
+			&.action {
+				background: #999999;
+			}
+		}
+
+		.box {
+			margin-top: 16rpx;
+			width: 100%;
+			background-color: #ffffff;
+			border-radius: 10rpx;
+			padding: 28rpx 20rpx 32rpx 20rpx;
+			position: relative;
+
+			.red-box {
+				width: 405rpx;
+				line-height: 66rpx;
+				text-align: center;
+				background: linear-gradient(0deg, #c90f1b, #f14d33);
+				border-radius: 10rpx;
+				font-size: 30rpx;
+				font-weight: 500;
+				color: #ffffff;
+				// position: relative;
+				position: absolute;
+				top: -36rpx;
+				left: 50%;
+				transform: translateX(-50%);
+				z-index: 1;
+			}
+
+			.box-check {
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #666666;
+				line-height: 100rpx;
+			}
+
+			.upload-box {
+				width: 100%;
+				height: 247rpx;
+				background: #ffffff;
+				// border: 1px solid #E63931;
+				border-radius: 27rpx;
+				display: flex;
+				flex-direction: column;
+				padding: 30rpx 40rpx 30rpx 0;
+				margin: 42rpx auto 30rpx;
+
+				.upload-left {
+					font-weight: 400;
+					color: #000000;
+				}
+
+				.upload-right {
+					flex: 1;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+
+					.upload-img {
+						width: 150rpx;
+						height: 150rpx;
+						margin-top: 24rpx;
+					}
+				}
+			}
+		}
+
+		.box-1 {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			width: 100%;
+			margin-top: 42rpx;
+			// height: 133rpx;
+
+			.box-left {
+				padding-left: 2rpx;
+				width: 184rpx;
+				text-align: left;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #191919;
+			}
+
+			input {
+				height: 66rpx;
+				line-height: 66rpx;
+				// height: 88rpx;
+			}
+
+			.list-input {
+				padding-left: 22rpx;
+				// margin: 12rpx 0 ;
+				font-size: 28rpx;
+				// line-height: 66rpx;
+				display: flex;
+				align-items: center;
+				flex: 1;
+				color: #000000;
+				width: 500rpx;
+				border: 1px solid #d2d2d2;
+				text-align: left;
+
+				.input-placeholder {
+					height: 70rpx;
+					color: #959595;
+				}
+			}
+
+			.box-right {
+				display: flex;
+				padding-left: 22rpx;
+				height: 66rpx;
+				line-height: 66rpx;
+				border: 1px solid #d2d2d2;
+				// margin: 32rpx 36rpx 0 36rpx;
+				width: 500rpx;
+				font-size: 28rpx;
+				color: #959595;
+				text-align: left !important;
+				// line-height: 1;
+			}
+		}
+	}
+
+	.placeholder {
+		line-height: 66rpx;
+	}
 </style>

+ 640 - 587
pages/form/certificates.vue

@@ -1,588 +1,641 @@
-<template>
-	<view class="content">
-		<view class="team" v-if="!is_over">
-			<empty></empty>
-		</view>
-		<view class="certificates" v-if='is_over'>
-			
-			<canvas v-if="showcanvas" id="qrShareBox" canvas-id="qrShareBox" class="tki-qrcode-canvas" />
-			<image class="imgbox" v-else :src="img" mode=" aspectFill"></image>
-		</view>
-
-	</view>
-</template>
-<script>
-import { get_training, sign_training, detail_training} from '@/api/train.js';
-import jyfParser from "@/components/jyf-parser/jyf-parser";
-import {
-		weixindata,
-		weixinlocation
-	} from '@/utils/wxAuthorized.js';
-		import empty from '@/components/empty';
-	import {
-		userinfo
-	} from '@/api/user.js';
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex';
-export default {
-	components: {
-		empty,
-	  jyfParser
-	 },
-	data() {
-		return {
-			is_over:1,
-			type:'',//0是个人报名,1是团体报名
-			id:'',
-			description:'',
-			list:'',
-			//个人
-			name:'',
-			phone:'',
-			addr:'',
-			work:'',
-			//团队
-			company:'',
-			address:'',
-			companyName:'',
-			companyphone:'',
-			num:'',
-			people:'咸宁市红十字会',
-			signDate:'',
-			loading: true, //是否载入图片中
-			size: 180,
-			ratio: 1, //页面比例用于计算
-			canHeight: '',
-			canWeidth: '',
-			url:'',
-			img:'',
-			showcanvas:true,
-			uid:''
-		};
-	},
-	onLoad(option) {
-		this.type = option.type;
-		this.id = option.id;
-		this.IndexShare();
-		this.loadData();
-		
-	},
-	onReady() {
-		detail_training({
-			id:this.id,
-		}).then(({data}) => {
-			console.log(999,data)
-			this.name = data.name
-			this.signDate = data.add_time
-			this.is_over = data.is_over
-		console.log(3,data.add_time)
-		let obj = this;
-		let name = obj.name
-		let signDate = obj.signDate
-	
-		function getRecTime(timestamp, fmt) {
-			let d = new Date(timestamp * 1000)
-				// f = fmt || 'yyyy/MM/dd', 
-			let	f = fmt || 'yyyy.MM.dd'
-			let	o = {
-					'M+': d.getMonth() + 1, //月份 
-					'd+': d.getDate(), //日 
-					'h+': d.getHours(), //小时 
-					'm+': d.getMinutes(), //分 
-					's+': d.getSeconds(), //秒 
-					'q+': Math.floor((d.getMonth() + 3) / 3), //季度 
-					'S': d.getMilliseconds() //毫秒 
-				};
-			if (/(y+)/.test(f)) {
-				f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
-			}
-			for (let k in o) {
-				if (new RegExp('(' + k + ')').test(f)) {
-					f = f.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
-				}
-			}
-			return f;
-			console.log(f)
-		}
-		let m = getRecTime(signDate)
-		let query = uni.createSelectorQuery();
-		// this.loadData();
-		// 获取页面比例
-		query
-			.select('.certificates')
-			.fields({
-					size: true
-				},
-				e => {
-					console.log('获取页面比例',e)
-					// 保存比例
-					this.ratio = e.width / 750;
-				}
-			)
-			.exec();
-		// 获取画布宽高信息
-		query
-			.select('#qrShareBox')
-			.fields({
-					size: true
-				},
-				e => {
-					console.log('获取画布宽高信息',e)
-					obj.canHeight = e.height;
-					obj.canWeidth = e.width;
-				}
-			)
-			.exec();
-		let ctxBg = '/static/img/graduation.png'; //画布背景
-		let src = '/static/icon/erweima.jpg' // 二维码
-		let context = uni.createCanvasContext('qrShareBox');
-		// 插入背景图片
-		context.drawImage(ctxBg, 0, 0, obj.canWeidth, obj.canHeight);
-		
-		const codeSize = obj.size * obj.ratio; //计算二维码大小
-		const codeX = ((750 - obj.size) * obj.ratio) / 2; //二维码所在x轴位置
-		const codeY = 999 * obj.ratio; //二维码所在y轴位置
-		// console.log('二维码大小',codeSize)
-		// console.log('二维码所在x轴位置',codeX)
-		// console.log('二维码所在y轴位置',codeY)
-		const codeBoxColor = '#FFFFFF'; //包裹框颜色
-		const codeBoxWidht = 0; //包裹边框宽度
-		const codeBoxSize = (codeBoxWidht / 2) * obj.ratio; //计算二维码白色包裹框大小
-		const codeBoxX = codeX - codeBoxSize; //包裹框初始X轴
-		const codeBoxY = codeY - codeBoxSize; //包裹框初始Y轴
-		const codeBoxEnd = codeSize + codeBoxWidht * obj.ratio; //计算包裹框大小
-		const fontTop = codeY + codeBoxEnd + (codeBoxWidht + 20) * obj.ratio; //文字距离上边距高度
-		const fontSize = 24 * obj.ratio; //文字大小
-		const fontText = ''; //文字内容
-		const fontLeft = (codeSize - fontSize * fontText.length) / 2 + codeX; //文字左侧距离
-		// // 插入文字
-		context.setFontSize(32 * obj.ratio)
-		// 画横线
-		context.moveTo(90 * obj.ratio, 586 * obj.ratio)
-		context.lineTo(250 * obj.ratio, 586 * obj.ratio)
-		context.stroke();
-		context.setTextAlign('center')
-		context.fillText(name, 170 * obj.ratio, 574 * obj.ratio)
-		context.setTextAlign('left')
-		context.fillText('先生/女士', 260 * obj.ratio, 580 * obj.ratio)
-		
-		context.setFontSize(31 * obj.ratio)
-		
-		context.fillText('您已完成咸宁市红十字会普及培训', 105 * obj.ratio, 670 * obj.ratio)
-		context.fillText('的全部课程,特发此证。', 105 * obj.ratio, 720 * obj.ratio)
-		context.setFontSize(22 * obj.ratio)
-		context.fillText('签发人:', 300 * obj.ratio, 800 * obj.ratio)
-		context.fillText('Siger:', 300 * obj.ratio, 830 * obj.ratio)
-		// 画横线
-		context.moveTo(380 * obj.ratio, 830 * obj.ratio)
-		context.lineTo(660 * obj.ratio, 830 * obj.ratio)
-		context.stroke()
-		context.fillText('签发日期:', 300 * obj.ratio, 880 * obj.ratio)
-		context.fillText('Issuer Date:', 300 * obj.ratio, 910 * obj.ratio)
-		context.setFontSize(26 * obj.ratio)
-		context.fillText(m, 475 * obj.ratio, 908 * obj.ratio)
-		context.fillText('咸宁市红十字会', 440 * obj.ratio, 820 * obj.ratio)
-		// 画横线
-		context.moveTo(430 * obj.ratio, 915 * obj.ratio)
-		context.lineTo(660 * obj.ratio, 915 * obj.ratio)
-		context.stroke()
-		context.setFontSize(fontSize);
-		context.fillText(fontText, fontLeft, fontTop);
-		
-		// 插入边框
-		context.beginPath();
-		context.setLineJoin('round'); //边框类型
-		context.setLineWidth(codeBoxWidht * obj.ratio);
-		context.setStrokeStyle(codeBoxColor); //设置包裹框颜色
-		context.strokeRect(codeBoxX, codeBoxY, codeBoxEnd, codeBoxEnd);
-		context.stroke();
-		// 插入二维码
-		context.drawImage(src, codeX, codeY, codeSize, codeSize);
-		context.draw(false,(e) => {
-			uni.canvasToTempFilePath({
-			  x: 0,
-			  y: 0,
-			  width: obj.canWeidth,
-			  height: obj.canHeight,
-			  destWidth: obj.canWeidth,
-			  destHeight: obj.canHeight,
-			  canvasId: 'qrShareBox',
-			  success: function(res) {
-				  console.log(res)
-					// uni.showModal({
-					// 	title:'zhi1'
-					// })
-			    // 在H5平台下,tempFilePath 为 base64
-					// console.log(res.tempFilePath)
-					obj.showcanvas = false;
-					obj.img = res.tempFilePath
-			  } 
-			})
-		})
-			})
-	
-	},
-
-	onShow() {
-		this.uid = this.userInfo.uid;
-		console.log('this.uid',this.uid)
-	},
-	computed: {
-		...mapState('user', ['hasLogin', 'userInfo'])
-	},
-	methods: {
-		...mapMutations('user', ['setUserInfo']),
-		// 分享
-		IndexShare() {
-			let obj = this;
-			let item = {
-				link:  'http://slj.igxys.com/index/#/pages/train/sign?type=' + obj.type + '&id=' + obj.id + '&uid=' + obj.userInfo.uid,// 分享链接
-				imgUrl: '/index/static/img/002.png',
-				desc: '结业证书',
-				title: '咸宁市红十字会',
-			};
-			console.log('分享加',item)
-			weixindata(item);
-		},
-		async loadData() {
-			let obj = this;
-			console.log('当前is_over',obj.is_over)
-			if( obj.is_over == 1 ) {
-				let uid = obj.userInfo.uid
-				console.log(9090,uid)
-			}
-			get_training({
-				id:obj.id,
-				// uid:uid
-			}).then(({ data }) => {
-				obj.list = data;
-				console.log(9988,data)
-				if(obj.list.content != null){
-					obj.description = obj.list.content.replace(/<img/g,"<img style='max-width:100%;height:auto;'");
-				}
-			});
-		
-		},		
-		submit(){
-			let obj = this;
-			let data = {};
-			if(obj.type==0){
-				if(!obj.name){
-					obj.$api.msg('请填写姓名!');
-					return;
-				}
-				if(!obj.phone){
-					obj.$api.msg('请输入联系方式!');
-					return;
-				}
-				if(!obj.addr){
-					obj.$api.msg('请输入联系方式!');
-					return;
-				}
-				data={
-					name:obj.name,
-					work:obj.addr,
-					phone:obj.phone,
-					tid:obj.id,
-					type:0
-				}
-			}
-			if(obj.type==1){
-				if(!obj.company){
-					obj.$api.msg('请填写企业名称!');
-					return;
-				}
-				if(!obj.address){
-					obj.$api.msg('请填写企业地址!');
-					return;
-				}
-				if(!obj.companyName){
-					obj.$api.msg('请填写负责人姓名!');
-					return;
-				}
-				if(!obj.companyphone){
-					obj.$api.msg('请输入联系方式!');
-					return;
-				}
-				if(!obj.num){
-					obj.$api.msg('请输入参加培训人数!');
-					return;
-				}
-				data={
-					company:obj.company,
-					address:obj.address,
-					name:obj.companyName,
-					phone:obj.companyphone,
-					num:obj.num,
-					tid:obj.id,
-					type:1
-				}
-			}
-			sign_training(data).then(function(e) {
-				console.log(data.type)
-				let type = data.type
-				uni.setStorageSync('type', type)
-				obj.$api.msg(e.msg);
-				setTimeout(function(){ 
-					uni.navigateTo({
-						url:'/pages/train/index'
-					})
-				}, 1000);
-			}).catch(e => {
-				obj.$api.msg(e.message);
-				setTimeout(function(){
-					uni.navigateTo({
-						url:'/pages/train/index'
-					})
-				}, 1000);
-			});;
-			
-		},
-		getRecTime(timestamp, fmt) {
-			let d = new Date(timestamp * 1000),
-				// f = fmt || 'yyyy/MM/dd', 
-				f = fmt || 'yyyy.MM.dd hh:mm:ss',
-				o = {
-					'M+': d.getMonth() + 1, //月份 
-					'd+': d.getDate(), //日 
-					'h+': d.getHours(), //小时 
-					'm+': d.getMinutes(), //分 
-					's+': d.getSeconds(), //秒 
-					'q+': Math.floor((d.getMonth() + 3) / 3), //季度 
-					'S': d.getMilliseconds() //毫秒 
-				};
-			if (/(y+)/.test(f)) {
-				f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
-			}
-			for (let k in o) {
-				if (new RegExp('(' + k + ')').test(f)) {
-					f = f.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
-				}
-			}
-			return f;
-			console.log(f)
-		},
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	background: #FFFFFF;
-	width: 100%;
-	height: 100%;
-	.content {
-		height: 100%;
-	}
-}
-.box{
-	padding: 0rpx 25rpx;
-	width: 100%;
-}
-.top-image{
-	width: 100%;
-	height: 300rpx;
-}
-.top-title{
-	width: 100%;
-	text-align: center;
-	padding: 25rpx 0rpx;
-	font-size: 34rpx;
-	border-bottom:1rpx dashed #B5B5B5;
-}
-.canten{
-	text-align: center !important;
-}
-.addr{
-	color: #222222;
-	font-size: 28rpx;
-	padding: 25rpx 35rpx;
-}
-.text-box{
-	padding: 25rpx 25rpx;
-	padding-bottom: 0rpx !important;
-}
-.text{
-	color: #222222;
-	font-size: 28rpx;
-	padding-bottom: 15rpx;
-}
-.weixin-icon{
-	width: 100%;
-	text-align: center;
-	padding-top: 45rpx;
-	image{
-		width: 248rpx;
-		height: 248rpx;
-	}
-}
-.tip{
-	color: #222222;
-	font-size: 28rpx;
-	width: 100%;
-	text-align: center;
-	padding-bottom: 50rpx;
-}
-.sign-tip{
-	padding: 25rpx 0rpx;
-	text-align: center;
-	color: #222222;
-	font-size: 28rpx;
-}
-.form-box{
-	padding: 0rpx 35rpx;
-	.label{
-		font-size: 34rpx;
-		padding: 25rpx 0rpx;
-		text{
-			color: #E62129;
-			padding-left: 5rpx;
-		}
-	}
-	input{
-		font-size: 28rpx;
-		color: #222222;
-		border: 2rpx solid #979797;
-		padding: 0rpx 15rpx;
-		border-radius: 15rpx;
-		height: 80rpx;
-	}
-}
-.submit{
-	width: 70%;
-	margin: 0rpx auto;
-	margin-top: 80rpx;
-	margin-bottom: 80rpx;
-	padding: 25rpx 0;
-	text-align: center;
-	background-color: #E62129;
-	color: #FFFFFF;
-	font-size: 32rpx;
-	border-radius: 10rpx;
-}
-.grey{
-	background-color: #9B9B9B !important;
-}
-.certificates{
-	// padding: 24rpx;
-	width: 100%;
-	height: 100vh;
-
-}
-
-		.tki-qrcode-canvas {
-			// width: 700rpx;
-			// height: 1245rpx;
-			width: 750rpx;
-			// padding: 32rpx;
-			height: 1350rpx;
-			margin: 0 auto;
-		}
-	.bgimg{
-		width: 100%;
-		height: 100%;
-		image{
-			width: 100%;
-			height: 100%;
-		}
-	}
-	.box-mian{
-		
-			width: 100%;
-			height: 100%;
-			position: absolute;
-			padding:380rpx 94rpx 200rpx 94rpx;
-			color: #333;
-			left: 0;
-			top: 0;
-			display: flex;
-			flex-direction: column;
-			justify-content: center;
-			// align-items: center;
-			.name{
-				display: flex;
-				font-size: 32rpx;
-				.name-left{
-					text-align: center;
-					// padding: 0 24rpx;
-					width: 150rpx;
-					border-bottom: 2rpx solid #333;
-				}
-			}
-			.info{
-				margin-top: 68rpx;
-				text-indent: 64rpx;
-				line-height: 58rpx;
-			}
-			.signName{
-				margin-top: 32rpx;
-				display: flex;
-				.signName-left{
-					line-height: 34rpx;
-					.signName-1{
-						
-					}
-					.signName-2{
-						font-size: 28rpx;
-					}
-				}
-				.signName-right{
-					text-align: left;
-					// width: 100%;
-					padding: 0 12rpx;
-					margin-left: 12rpx;
-					
-					// width: 288rpx;
-					border-bottom: 2rpx solid #333;
-					// margin-bottom: 12rpx;
-					.list-input {
-						width: 100%;
-						padding: 0 12rpx;
-						height: 70rpx;
-						font-size: 32rpx;
-						text-align: left;
-						
-					}
-					.signDate{
-						display: flex;
-						align-items: center;
-					}
-				}
-			}
-			.signDate{
-				margin-top: 22rpx;
-				display: flex;
-				.signName-left{
-					line-height: 34rpx;
-					.signName-1{
-						
-					}
-					.signName-2{
-						font-size: 28rpx;
-					}
-				}
-				.signName-right{
-					text-align: left;
-					padding-left: 12rpx;
-					margin-left: 12rpx;
-					width: 288rpx;
-					border-bottom: 2rpx solid #333;
-					.list-input {
-						height: 70rpx;
-						font-size: 32rpx;
-						text-align: left;
-						
-					}
-					// margin-bottom: 12rpx;
-				}
-			}
-			// background-color: pink;
-		
-	}
-	.imgbox{
-		height: 1350rpx;
-		width:750rpx;
-	}
+<template>
+	<view class="content">
+		<view class="team" v-if="!is_over">
+			<empty></empty>
+		</view>
+		<view class="certificates" v-if='is_over'>
+			<canvas v-if="showcanvas" id="qrShareBox" canvas-id="qrShareBox" class="tki-qrcode-canvas" />
+			<image class="imgbox" v-else :src="img" mode=" aspectFill"></image>
+		</view>
+
+	</view>
+</template>
+<script>
+	import {
+		get_training,
+		sign_training,
+		detail_training
+	} from '@/api/train.js';
+	import jyfParser from "@/components/jyf-parser/jyf-parser";
+	import {
+		weixindata,
+		weixinlocation
+	} from '@/utils/wxAuthorized.js';
+	import empty from '@/components/empty';
+	import {
+		userinfo
+	} from '@/api/user.js';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	export default {
+		components: {
+			empty,
+			jyfParser
+		},
+		data() {
+			return {
+				send_time: 0,//发证时间
+				is_over: 1,
+				type: '', //0是个人报名,1是团体报名
+				id: '',
+				description: '',
+				list: '',
+				//个人
+				name: '',
+				phone: '',
+				addr: '',
+				work: '',
+				//团队
+				company: '',
+				address: '',
+				companyName: '',
+				companyphone: '',
+				num: '',
+				people: '咸宁市红十字会',
+				signDate: '',
+				loading: true, //是否载入图片中
+				size: 180,
+				ratio: 1, //页面比例用于计算
+				canHeight: '',
+				canWeidth: '',
+				url: '',
+				img: '',
+				showcanvas: true,
+				uid: ''
+			};
+		},
+		onLoad(option) {
+			this.type = option.type;
+			// this.id = option.id;
+			this.send_time = option.send_time
+			// this.
+			this.name = decodeURI(option.name)
+			this.IndexShare();
+			// this.loadData();
+
+		},
+		onReady() {
+			// detail_training({
+			// 	id: this.id,
+			// }).then(({
+			// 	data
+			// }) => {
+				// console.log(999, data)
+				// this.name = data.name
+				// this.signDate = data.add_time
+				// this.is_over = data.is_over
+				// console.log(3, data.add_time)
+				let obj = this;
+				let name = obj.name
+				let signDate = obj.signDate
+
+				function getRecTime(timestamp, fmt) {
+					let d = new Date(timestamp * 1000)
+					// f = fmt || 'yyyy/MM/dd', 
+					let f = fmt || 'yyyy.MM.dd'
+					let o = {
+						'M+': d.getMonth() + 1, //月份 
+						'd+': d.getDate(), //日 
+						'h+': d.getHours(), //小时 
+						'm+': d.getMinutes(), //分 
+						's+': d.getSeconds(), //秒 
+						'q+': Math.floor((d.getMonth() + 3) / 3), //季度 
+						'S': d.getMilliseconds() //毫秒 
+					};
+					if (/(y+)/.test(f)) {
+						f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
+					}
+					for (let k in o) {
+						if (new RegExp('(' + k + ')').test(f)) {
+							f = f.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr((
+								'' + o[k]).length)));
+						}
+					}
+					return f;
+					console.log(f)
+				}
+				let send_time = getRecTime(obj.send_time)
+				let query = uni.createSelectorQuery();
+				// this.loadData();
+				// 获取页面比例
+				query
+					.select('.certificates')
+					.fields({
+							size: true
+						},
+						e => {
+							console.log('获取页面比例', e)
+							// 保存比例
+							this.ratio = e.width / 750;
+						}
+					)
+					.exec();
+				// 获取画布宽高信息
+				query
+					.select('#qrShareBox')
+					.fields({
+							size: true
+						},
+						e => {
+							console.log('获取画布宽高信息', e)
+							obj.canHeight = e.height;
+							obj.canWeidth = e.width;
+						}
+					)
+					.exec();
+				let ctxBg = '/static/img/graduation.png'; //画布背景
+				let src = '/static/icon/erweima.jpg' // 二维码
+				let context = uni.createCanvasContext('qrShareBox');
+				// 插入背景图片
+				context.drawImage(ctxBg, 0, 0, obj.canWeidth, obj.canHeight);
+
+				const codeSize = obj.size * obj.ratio; //计算二维码大小
+				const codeX = ((750 - obj.size) * obj.ratio) / 2; //二维码所在x轴位置
+				const codeY = 999 * obj.ratio; //二维码所在y轴位置
+				// console.log('二维码大小',codeSize)
+				// console.log('二维码所在x轴位置',codeX)
+				// console.log('二维码所在y轴位置',codeY)
+				const codeBoxColor = '#FFFFFF'; //包裹框颜色
+				const codeBoxWidht = 0; //包裹边框宽度
+				const codeBoxSize = (codeBoxWidht / 2) * obj.ratio; //计算二维码白色包裹框大小
+				const codeBoxX = codeX - codeBoxSize; //包裹框初始X轴
+				const codeBoxY = codeY - codeBoxSize; //包裹框初始Y轴
+				const codeBoxEnd = codeSize + codeBoxWidht * obj.ratio; //计算包裹框大小
+				const fontTop = codeY + codeBoxEnd + (codeBoxWidht + 20) * obj.ratio; //文字距离上边距高度
+				const fontSize = 24 * obj.ratio; //文字大小
+				const fontText = ''; //文字内容
+				const fontLeft = (codeSize - fontSize * fontText.length) / 2 + codeX; //文字左侧距离
+				// // 插入文字
+				context.setFontSize(32 * obj.ratio)
+				// 画横线
+				context.moveTo(90 * obj.ratio, 586 * obj.ratio)
+				context.lineTo(250 * obj.ratio, 586 * obj.ratio)
+				context.stroke();
+				context.setTextAlign('center')
+				context.fillText(name, 170 * obj.ratio, 574 * obj.ratio)
+				context.setTextAlign('left')
+				context.fillText('先生/女士', 260 * obj.ratio, 580 * obj.ratio)
+
+				context.setFontSize(31 * obj.ratio)
+
+				context.fillText('您已完成咸宁市红十字会普及培训', 105 * obj.ratio, 670 * obj.ratio)
+				context.fillText('的全部课程,特发此证。', 105 * obj.ratio, 720 * obj.ratio)
+				context.setFontSize(22 * obj.ratio)
+				context.fillText('签发人:', 300 * obj.ratio, 800 * obj.ratio)
+				context.fillText('Siger:', 300 * obj.ratio, 830 * obj.ratio)
+				// 画横线
+				context.moveTo(380 * obj.ratio, 830 * obj.ratio)
+				context.lineTo(660 * obj.ratio, 830 * obj.ratio)
+				context.stroke()
+				context.fillText('签发日期:', 300 * obj.ratio, 880 * obj.ratio)
+				context.fillText('Issuer Date:', 300 * obj.ratio, 910 * obj.ratio)
+				context.setFontSize(26 * obj.ratio)
+				context.fillText(send_time, 475 * obj.ratio, 908 * obj.ratio)
+				context.fillText('咸宁市红十字会', 440 * obj.ratio, 820 * obj.ratio)
+				// 画横线
+				context.moveTo(430 * obj.ratio, 915 * obj.ratio)
+				context.lineTo(660 * obj.ratio, 915 * obj.ratio)
+				context.stroke()
+				context.setFontSize(fontSize);
+				context.fillText(fontText, fontLeft, fontTop);
+
+				// 插入边框
+				context.beginPath();
+				context.setLineJoin('round'); //边框类型
+				context.setLineWidth(codeBoxWidht * obj.ratio);
+				context.setStrokeStyle(codeBoxColor); //设置包裹框颜色
+				context.strokeRect(codeBoxX, codeBoxY, codeBoxEnd, codeBoxEnd);
+				context.stroke();
+				// 插入二维码
+				context.drawImage(src, codeX, codeY, codeSize, codeSize);
+				context.draw(false, (e) => {
+					uni.canvasToTempFilePath({
+						x: 0,
+						y: 0,
+						width: obj.canWeidth,
+						height: obj.canHeight,
+						destWidth: obj.canWeidth,
+						destHeight: obj.canHeight,
+						canvasId: 'qrShareBox',
+						success: function(res) {
+							console.log(res)
+							// uni.showModal({
+							// 	title:'zhi1'
+							// })
+							// 在H5平台下,tempFilePath 为 base64
+							// console.log(res.tempFilePath)
+							obj.showcanvas = false;
+							obj.img = res.tempFilePath
+
+						}
+					})
+				})
+			// })
+
+		},
+
+		onShow() {
+			this.uid = this.userInfo.uid;
+			console.log('this.uid', this.uid)
+		},
+		computed: {
+			...mapState('user', ['hasLogin', 'userInfo']),
+			...mapState(['baseURL'])
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			// 分享
+			IndexShare() {
+				let obj = this;
+				let item = {
+					link: obj.baseURL + '/index/#/pages/form/certificates?type=' + obj.type + '&send_time=' + obj.send_time + '&name=' + encodeURI(obj.name), 
+					imgUrl: '/index/static/img/002.png',
+					desc: '结业证书',
+					title: '咸宁市红十字会',
+				};
+				console.log('分享加', item)
+				weixindata(item);
+			},
+			async loadData() {
+				let obj = this;
+				console.log('当前is_over', obj.is_over)
+				if (obj.is_over == 1) {
+					let uid = obj.userInfo.uid
+					console.log(9090, uid)
+				}
+				get_training({
+					id: obj.id,
+					// uid:uid
+				}).then(({
+					data
+				}) => {
+					obj.list = data;
+					console.log(9988, data)
+					if (obj.list.content != null) {
+						obj.description = obj.list.content.replace(/<img/g,
+							"<img style='max-width:100%;height:auto;'");
+					}
+				});
+
+			},
+			submit() {
+				let obj = this;
+				let data = {};
+				if (obj.type == 0) {
+					if (!obj.name) {
+						obj.$api.msg('请填写姓名!');
+						return;
+					}
+					if (!obj.phone) {
+						obj.$api.msg('请输入联系方式!');
+						return;
+					}
+					if (!obj.addr) {
+						obj.$api.msg('请输入联系方式!');
+						return;
+					}
+					data = {
+						name: obj.name,
+						work: obj.addr,
+						phone: obj.phone,
+						tid: obj.id,
+						type: 0
+					}
+				}
+				if (obj.type == 1) {
+					if (!obj.company) {
+						obj.$api.msg('请填写企业名称!');
+						return;
+					}
+					if (!obj.address) {
+						obj.$api.msg('请填写企业地址!');
+						return;
+					}
+					if (!obj.companyName) {
+						obj.$api.msg('请填写负责人姓名!');
+						return;
+					}
+					if (!obj.companyphone) {
+						obj.$api.msg('请输入联系方式!');
+						return;
+					}
+					if (!obj.num) {
+						obj.$api.msg('请输入参加培训人数!');
+						return;
+					}
+					data = {
+						company: obj.company,
+						address: obj.address,
+						name: obj.companyName,
+						phone: obj.companyphone,
+						num: obj.num,
+						tid: obj.id,
+						type: 1
+					}
+				}
+				sign_training(data).then(function(e) {
+					console.log(data.type)
+					let type = data.type
+					uni.setStorageSync('type', type)
+					obj.$api.msg(e.msg);
+					setTimeout(function() {
+						uni.navigateTo({
+							url: '/pages/train/index'
+						})
+					}, 1000);
+				}).catch(e => {
+					obj.$api.msg(e.message);
+					setTimeout(function() {
+						uni.navigateTo({
+							url: '/pages/train/index'
+						})
+					}, 1000);
+				});;
+
+			},
+			getRecTime(timestamp, fmt) {
+				let d = new Date(timestamp * 1000),
+					// f = fmt || 'yyyy/MM/dd', 
+					f = fmt || 'yyyy.MM.dd hh:mm:ss',
+					o = {
+						'M+': d.getMonth() + 1, //月份 
+						'd+': d.getDate(), //日 
+						'h+': d.getHours(), //小时 
+						'm+': d.getMinutes(), //分 
+						's+': d.getSeconds(), //秒 
+						'q+': Math.floor((d.getMonth() + 3) / 3), //季度 
+						'S': d.getMilliseconds() //毫秒 
+					};
+				if (/(y+)/.test(f)) {
+					f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
+				}
+				for (let k in o) {
+					if (new RegExp('(' + k + ')').test(f)) {
+						f = f.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k])
+							.length)));
+					}
+				}
+				return f;
+				console.log(f)
+			},
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: #FFFFFF;
+		width: 100%;
+		height: 100%;
+
+		.content {
+			height: 100%;
+		}
+	}
+
+	.box {
+		padding: 0rpx 25rpx;
+		width: 100%;
+	}
+
+	.top-image {
+		width: 100%;
+		height: 300rpx;
+	}
+
+	.top-title {
+		width: 100%;
+		text-align: center;
+		padding: 25rpx 0rpx;
+		font-size: 34rpx;
+		border-bottom: 1rpx dashed #B5B5B5;
+	}
+
+	.canten {
+		text-align: center !important;
+	}
+
+	.addr {
+		color: #222222;
+		font-size: 28rpx;
+		padding: 25rpx 35rpx;
+	}
+
+	.text-box {
+		padding: 25rpx 25rpx;
+		padding-bottom: 0rpx !important;
+	}
+
+	.text {
+		color: #222222;
+		font-size: 28rpx;
+		padding-bottom: 15rpx;
+	}
+
+	.weixin-icon {
+		width: 100%;
+		text-align: center;
+		padding-top: 45rpx;
+
+		image {
+			width: 248rpx;
+			height: 248rpx;
+		}
+	}
+
+	.tip {
+		color: #222222;
+		font-size: 28rpx;
+		width: 100%;
+		text-align: center;
+		padding-bottom: 50rpx;
+	}
+
+	.sign-tip {
+		padding: 25rpx 0rpx;
+		text-align: center;
+		color: #222222;
+		font-size: 28rpx;
+	}
+
+	.form-box {
+		padding: 0rpx 35rpx;
+
+		.label {
+			font-size: 34rpx;
+			padding: 25rpx 0rpx;
+
+			text {
+				color: #E62129;
+				padding-left: 5rpx;
+			}
+		}
+
+		input {
+			font-size: 28rpx;
+			color: #222222;
+			border: 2rpx solid #979797;
+			padding: 0rpx 15rpx;
+			border-radius: 15rpx;
+			height: 80rpx;
+		}
+	}
+
+	.submit {
+		width: 70%;
+		margin: 0rpx auto;
+		margin-top: 80rpx;
+		margin-bottom: 80rpx;
+		padding: 25rpx 0;
+		text-align: center;
+		background-color: #E62129;
+		color: #FFFFFF;
+		font-size: 32rpx;
+		border-radius: 10rpx;
+	}
+
+	.grey {
+		background-color: #9B9B9B !important;
+	}
+
+	.certificates {
+		// padding: 24rpx;
+		width: 100%;
+		height: 100vh;
+
+	}
+
+	.tki-qrcode-canvas {
+		// width: 700rpx;
+		// height: 1245rpx;
+		width: 750rpx;
+		// padding: 32rpx;
+		height: 1350rpx;
+		margin: 0 auto;
+	}
+
+	.bgimg {
+		width: 100%;
+		height: 100%;
+
+		image {
+			width: 100%;
+			height: 100%;
+		}
+	}
+
+	.box-mian {
+
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		padding: 380rpx 94rpx 200rpx 94rpx;
+		color: #333;
+		left: 0;
+		top: 0;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+
+		// align-items: center;
+		.name {
+			display: flex;
+			font-size: 32rpx;
+
+			.name-left {
+				text-align: center;
+				// padding: 0 24rpx;
+				width: 150rpx;
+				border-bottom: 2rpx solid #333;
+			}
+		}
+
+		.info {
+			margin-top: 68rpx;
+			text-indent: 64rpx;
+			line-height: 58rpx;
+		}
+
+		.signName {
+			margin-top: 32rpx;
+			display: flex;
+
+			.signName-left {
+				line-height: 34rpx;
+
+				.signName-1 {}
+
+				.signName-2 {
+					font-size: 28rpx;
+				}
+			}
+
+			.signName-right {
+				text-align: left;
+				// width: 100%;
+				padding: 0 12rpx;
+				margin-left: 12rpx;
+
+				// width: 288rpx;
+				border-bottom: 2rpx solid #333;
+
+				// margin-bottom: 12rpx;
+				.list-input {
+					width: 100%;
+					padding: 0 12rpx;
+					height: 70rpx;
+					font-size: 32rpx;
+					text-align: left;
+
+				}
+
+				.signDate {
+					display: flex;
+					align-items: center;
+				}
+			}
+		}
+
+		.signDate {
+			margin-top: 22rpx;
+			display: flex;
+
+			.signName-left {
+				line-height: 34rpx;
+
+				.signName-1 {}
+
+				.signName-2 {
+					font-size: 28rpx;
+				}
+			}
+
+			.signName-right {
+				text-align: left;
+				padding-left: 12rpx;
+				margin-left: 12rpx;
+				width: 288rpx;
+				border-bottom: 2rpx solid #333;
+
+				.list-input {
+					height: 70rpx;
+					font-size: 32rpx;
+					text-align: left;
+
+				}
+
+				// margin-bottom: 12rpx;
+			}
+		}
+
+		// background-color: pink;
+
+	}
+
+	.imgbox {
+		height: 1350rpx;
+		width: 750rpx;
+	}
 </style>

+ 13 - 6
pages/form/certificatesList.vue

@@ -11,8 +11,8 @@
 					<!-- 订单列表 -->
 					<view class="order-item" @click="ToDetail(item)" v-for="(item, index) in list" :key="index">
 						<view class="list-cell">
-							<image class="image" :src="item.img"></image>
-							<view class="list-tpl">{{ item.title }}</view>
+							<image class="image" :src="baseURL + item.training.image"></image>
+							<view class="list-tpl">{{ item.training.title }}</view>
 						</view>
 					</view>
 				</scroll-view>
@@ -20,7 +20,11 @@
 		</swiper>
 	</view>
 </template>
-<script>
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
 import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 import empty from '@/components/empty';
 import uniPopup from '@/components/uni-popup/uni-popup.vue';
@@ -30,6 +34,9 @@ export default {
 		uniLoadMore,
 		empty,
 		uniPopup
+	},
+	computed: {
+		...mapState(['baseURL'])
 	},
 	data() {
 		return {
@@ -93,10 +100,10 @@ export default {
 		},
 		//跳转到详情
 		ToDetail(e) {
-			let type = e.type;
-			let id = e.id;
+			let type = e.num == 1 ? '0': '1';//0是个人报名,1是团体报名
+			// let id = e.id;
 			uni.navigateTo({
-				url: '/pages/form/certificates?type=' + type+'&id='+id
+				url: '/pages/form/certificates?type=' + type+ '&send_time=' + e.sendtime + '&name=' + encodeURI(e.name)
 			});
 		}
 	}

+ 17 - 11
pages/form/tovolApply.vue

@@ -64,7 +64,7 @@
 				<input type="text" placeholder="请填写电子邮件" value="" class="list-input" v-model="email" />
 			</view>
 			<view class="box-1">
-				<view class="box-left">联系地址(选填)</view>
+				<view class="box-left">联系地址<text class="imp">*</text></view>
 				<input type="text" value="" placeholder="请填写联系地址" class="list-input" v-model="address" />
 			</view>
 			<view class="box-1">
@@ -77,7 +77,7 @@
 			</view>
 
 			<view class="box-1">
-				<view class="box-left">教育程度(选填)</view>
+				<view class="box-left">教育程度<text class="imp">*</text></view>
 				<picker @change="bindPickerEdu" :value="index" :range="chooseEdu">
 					<view class="box-right">{{ education }}</view>
 				</picker>
@@ -471,10 +471,10 @@ export default {
 				obj.$api.msg('请填写正确的移动电话');
 				return;
 			}
-			// if (obj.address == '') {
-			// 	obj.$api.msg('请填写您的地址');
-			// 	return;
-			// }
+			if (obj.address == '') {
+				obj.$api.msg('请填写您的地址');
+				return;
+			}
 			// /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
 
 			if (obj.checked1 === '') {
@@ -485,10 +485,10 @@ export default {
 				obj.$api.msg('请选择是否接受过志愿者服务');
 				return;
 			}
-			// if (obj.cardimg == '') {
-			// 	obj.$api.msg('请上传您的证件');
-			// 	return;
-			// }
+			if (obj.cardimg == '') {
+				obj.$api.msg('请上传您的证件');
+				return;
+			}
 			if (!obj.start_hour){
 				this.$api.msg('请选择开始时间!');
 				return;
@@ -500,11 +500,17 @@ export default {
 			if (!obj.dates) {
 				this.$api.msg('请选择日期!');
 				return;
+			}
+			
+			if(obj.education == '') {
+				this.$api.msg('请选择教育程度!');
+				return;
 			}
 			if (obj.Getchecked == false) {
 				this.$api.msg('请阅读并同意个人声明!');
 				return;
-			}
+			}
+			
 			// let reg1 = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
 			// if (!reg1.test(obj.card)) {
 			// 	obj.$api.msg('请填写正确的身份证信息');

+ 5 - 5
pages/index/index.vue

@@ -35,7 +35,7 @@
 				</view>
 				<view class="item-title">红十字志愿者</view>
 			</view>
-			<view class="cate-item flex" @click="tohelpActi">
+			<view class="cate-item flex" @click="navTo('/pages/train/index')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/index01.png" mode="" class="img"></image>
 				</view>
@@ -47,25 +47,25 @@
 				</view>
 				<view class="item-title">红十字会员</view>
 			</view>
-			<view class="cate-item flex" @click="tohelpActi">
+			<view class="cate-item flex" @click="navTo('/pages/applic/location')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/index09.png" mode="" class="img"></image>
 				</view>
 				<view class="item-title">救在身边系统</view>
 			</view>
-			<view class="cate-item flex" @click="tohelpActi">
+			<view class="cate-item flex" @click="navTo('/pages/applic/aed')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/index08.png" mode="" class="img"></image>
 				</view>
 				<view class="item-title">AED智能系统</view>
 			</view>
-			<view class="cate-item flex" @click="tohelpActi">
+			<view class="cate-item flex" @click="navTo('/pages/applic/aid')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/index06.png" mode="" class="img"></image>
 				</view>
 				<view class="item-title">救护站智能系统</view>
 			</view>
-			<view class="cate-item flex" @click="tohelpActi">
+			<view class="cate-item flex" @click="navTo('/pages/applic/science')">
 				<view class="img-wrapper flex">
 					<image src="../../static/index/index05.png" mode="" class="img"></image>
 				</view>

BIN
static/icon/aed-a.png


BIN
static/icon/aed-na.png


BIN
static/icon/gan.png


+ 3 - 1
store/index.js

@@ -22,7 +22,9 @@ const store = new Vuex.Store({
 		weichatBrowser: '' ,//当前是否为微信内置浏览器
 		// #endif
 		// shareData:'',//分享信息
-		project_area: 0
+		project_area: 0,
+		sys_appid: 'xnshszh2022120',//系统AppID
+		sys_appsecret: '2022120xnshszh',//系统AppSecret
 	},
 	mutations: {
 	

+ 2 - 2
utils/request.js

@@ -67,8 +67,8 @@ service.interceptors.request(
 	config => {
 		let token = uni.getStorageSync('token') || '';
 		let sign_time = new Date().getTime();
-		let sys_appid = 'xgred20211207'
-		let sys_appsecret = '70211202dergxxgred20211207'
+		let sys_appid = store.state.sys_appid
+		let sys_appsecret = store.state.sys_appsecret
 		let sys_token = md5(md5(sys_appid + sys_appsecret) + sign_time + sha1(sys_appsecret + sign_time))
 
 		if (!config.header) {