lhl 3 jaren geleden
bovenliggende
commit
cc4d434caa
5 gewijzigde bestanden met toevoegingen van 289 en 232 verwijderingen
  1. 210 185
      pages/form/certificatesList.vue
  2. 66 40
      pages/index/index.vue
  3. 3 1
      store/index.js
  4. 5 3
      utils/newRequest.js
  5. 5 3
      utils/request.js

+ 210 - 185
pages/form/certificatesList.vue

@@ -1,186 +1,211 @@
-<template>
-	<view class="container">
-		<!-- <view class="top">
-			普及培训
-		</view> -->
-		<swiper class="swiper-box" duration="300" @change="changeTab">
-			<swiper-item class="tab-content">
-				<scroll-view class="list-scroll-content" scroll-y >
-					<!-- 空白页 -->
-					<empty v-if="loadingType === true && list.length === 0"></empty>
-					<!-- 订单列表 -->
-					<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>
-						</view>
-					</view>
-				</scroll-view>
-			</swiper-item>
-		</swiper>
-	</view>
-</template>
-<script>
-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';
-import { myTrainingList } from '@/api/index.js';
-export default {
-	components: {
-		uniLoadMore,
-		empty,
-		uniPopup
-	},
-	data() {
-		return {
-			page: 1, //当前页数
-			limit: 6, //每次信息条数
-			list: [],
-			loadingType: 'more', //加载更多状态
-		};
-	},
-	onLoad() {
-		console.log(22)
-		this.loadData();
-	},
-	methods: {
-		//获取订单列表
-		loadData(type) {
-			//这里是将订单挂载到tab列表下
-			let obj = this;
-			if (type != 'refresh') {
-				console.log(obj.loadingType, '456');
-				//没有更多数据直接跳出方法
-				if (obj.loadingType === 'nomore') {
-					return;
-				} else {
-					// 设置当前为数据载入中
-					obj.loadingType = 'loading';
-				}
-			} else {
-				//当重新加载数据时更新状态为可继续添加数据
-				obj.loadingType = 'more';
-			}
-			myTrainingList({})
-				.then(data => {
-					if (type === 'refresh') {
-						obj.list = [];
-					}
-					let arr = data.data
-					obj.list = obj.list.concat(arr);
-					//判断是否还有下一页,有是more  没有是nomore
-					if (obj.limit == arr.length) {
-						obj.page++;
-						obj.loadingType = 'more';
-					} else {
-						obj.loadingType = 'nomore';
-					}
-					// 判断是否为刷新数据
-					if (type === 'refresh') {
-						console.log('refresh');
-						// 判断是否为点击搜索按钮跳转加载
-						if (obj.loading == 1) {
-							uni.hideLoading();
-						} else {
-							uni.stopPullDownRefresh();
-						}
-					}
-				})
-				.catch(e => {
-					obj.loadingType = 'nomore';
-					uni.hideLoading();
-				});
-		},
-		//跳转到详情
-		ToDetail(e) {
-			let type = e.type;
-			let id = e.id;
-			uni.navigateTo({
-				url: '/pages/form/certificates?type=' + type+'&id='+id
-			});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page {
-	background: #F2F2F2;
-	height: 100%;
-	padding-bottom: 25rpx;
-}
-.container {
-	height: 100%;
-	.top{
-		background-color: #FFFFFF;
-		height: 88rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		font-size: 36rpx;
-		font-weight: 500;
-		color: #333333;
-	}
-	.swiper-box {
-		height:100%;
-		.list-scroll-content {
-			height:100%;
-		}
-	}
-}
-.scroll-list {
-	width: 100%;
-	overflow: hidden;
-	white-space: nowrap;
-	background-color: #ffffff;
-	font-size: 32rpx;
-	.scoll-box {
-		text-align: center;
-		display: inline-block;
-		margin: 0rpx 38rpx;
-		padding: 15rpx 0rpx;
-		.scoll-img {
-			width: 130rpx;
-			height: 85rpx;
-			border-radius: 100%;
-			image {
-				width: 85rpx;
-				height: 100%;
-				border-radius: 100%;
-			}
-		}
-		.scoll-name {
-			padding-top: 15rpx;
-		}
-		&.active {
-			color: #ef3d28;
-			border-bottom: 6rpx solid #ef3d28;
-		}
-	}
-}
-
-.order-item {
-	width: 100%;
-	padding: 0rpx 25rpx;
-	padding-top: 25rpx !important;
-	.list-cell {
-		background-color: #ffffff;
-		border-radius: 20rpx;
-		width: 100%;
-		box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.06);
-		.image {
-			width: 100%;
-			height: 300rpx;
-			border-top-left-radius: 25rpx;
-			border-top-right-radius: 25rpx;
-		}
-		.list-tpl {
-			padding: 25rpx 25rpx;
-			padding-bottom: 35rpx !important;
-			font-size: 34rpx;
-			color: #222222;
-			font-weight:500;
-		}
-	}
-}
+<template>
+	<view class="container">
+		<!-- <view class="top">
+			普及培训
+		</view> -->
+		<swiper class="swiper-box" duration="300" @change="changeTab">
+			<swiper-item class="tab-content">
+				<scroll-view class="list-scroll-content" scroll-y>
+					<!-- 空白页 -->
+					<empty v-if="loadingType === true && list.length === 0"></empty>
+					<!-- 订单列表 -->
+					<view class="order-item" @click="ToDetail(item)" v-for="(item, index) in list" :key="index">
+						<view class="list-cell">
+							<image class="image" :src="baseURL + item.training.image"></image>
+							<view class="list-tpl">{{ item.training.title }}</view>
+						</view>
+						<view class="">
+							{{ item.training.title }}
+						</view>
+					</view>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+<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';
+	import {
+		myTrainingList
+	} from '@/api/index.js';
+	export default {
+		components: {
+			uniLoadMore,
+			empty,
+			uniPopup
+		},
+		data() {
+			return {
+				page: 1, //当前页数
+				limit: 6, //每次信息条数
+				list: [],
+				loadingType: 'more', //加载更多状态
+			};
+		},
+		onLoad() {
+			console.log(22)
+			this.loadData();
+		},
+		computed: {
+			...mapState(['baseURL'])
+		},
+		methods: {
+			//获取订单列表
+			loadData(type) {
+				//这里是将订单挂载到tab列表下
+				let obj = this;
+				if (type != 'refresh') {
+					console.log(obj.loadingType, '456');
+					//没有更多数据直接跳出方法
+					if (obj.loadingType === 'nomore') {
+						return;
+					} else {
+						// 设置当前为数据载入中
+						obj.loadingType = 'loading';
+					}
+				} else {
+					//当重新加载数据时更新状态为可继续添加数据
+					obj.loadingType = 'more';
+				}
+				myTrainingList({})
+					.then(data => {
+						if (type === 'refresh') {
+							obj.list = [];
+						}
+						let arr = data.data
+						obj.list = obj.list.concat(arr);
+						//判断是否还有下一页,有是more  没有是nomore
+						if (obj.limit == arr.length) {
+							obj.page++;
+							obj.loadingType = 'more';
+						} else {
+							obj.loadingType = 'nomore';
+						}
+						// 判断是否为刷新数据
+						if (type === 'refresh') {
+							console.log('refresh');
+							// 判断是否为点击搜索按钮跳转加载
+							if (obj.loading == 1) {
+								uni.hideLoading();
+							} else {
+								uni.stopPullDownRefresh();
+							}
+						}
+					})
+					.catch(e => {
+						obj.loadingType = 'nomore';
+						uni.hideLoading();
+					});
+			},
+			//跳转到详情
+			ToDetail(e) {
+				let type = e.type;
+				let id = e.id;
+				uni.navigateTo({
+					url: '/pages/form/certificates?type=' + type + '&id=' + id
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background: #F2F2F2;
+		height: 100%;
+		padding-bottom: 25rpx;
+	}
+
+	.container {
+		height: 100%;
+
+		.top {
+			background-color: #FFFFFF;
+			height: 88rpx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			font-size: 36rpx;
+			font-weight: 500;
+			color: #333333;
+		}
+
+		.swiper-box {
+			height: 100%;
+
+			.list-scroll-content {
+				height: 100%;
+			}
+		}
+	}
+
+	.scroll-list {
+		width: 100%;
+		overflow: hidden;
+		white-space: nowrap;
+		background-color: #ffffff;
+		font-size: 32rpx;
+
+		.scoll-box {
+			text-align: center;
+			display: inline-block;
+			margin: 0rpx 38rpx;
+			padding: 15rpx 0rpx;
+
+			.scoll-img {
+				width: 130rpx;
+				height: 85rpx;
+				border-radius: 100%;
+
+				image {
+					width: 85rpx;
+					height: 100%;
+					border-radius: 100%;
+				}
+			}
+
+			.scoll-name {
+				padding-top: 15rpx;
+			}
+
+			&.active {
+				color: #ef3d28;
+				border-bottom: 6rpx solid #ef3d28;
+			}
+		}
+	}
+
+	.order-item {
+		width: 100%;
+		padding: 0rpx 25rpx;
+		padding-top: 25rpx !important;
+
+		.list-cell {
+			// background-color: #ffffff;
+			border-radius: 20rpx;
+			width: 100%;
+			box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.06);
+
+			.image {
+				width: 100%;
+				height: 300rpx;
+				border-top-left-radius: 25rpx;
+				border-top-right-radius: 25rpx;
+			}
+
+			.list-tpl {
+				padding: 25rpx 25rpx;
+				padding-bottom: 35rpx !important;
+				font-size: 34rpx;
+				color: #222222;
+				font-weight: 500;
+			}
+		}
+	}
 </style>

+ 66 - 40
pages/index/index.vue

@@ -37,7 +37,7 @@
 			</view>
 		</view>
 
-		<!-- 爱心红会 -->
+		<!-- 荆州爱心红会 -->
 		<view class="red-box">
 			<top-title :title="'爱心红会'"></top-title>
 			<view class="red-nav flex">
@@ -51,6 +51,18 @@
 				</view>
 			</view>
 		</view>
+		<!-- 低配爱心红会 -->
+		<!-- <view class="red-box">
+			<top-title :title="'爱心红会'"></top-title>
+			<view class="red-nav">
+				<view class="nav-item" @click="navTo('/pages/applic/love')">
+					<image src="../../static/img/n1.png" mode=""></image>
+				</view>
+				<view class="nav-item" @click="navTo('/pages/applic/science')">
+					<image src="../../static/img/n2.png" mode=""></image>
+				</view>
+			</view>
+		</view> -->
 		<!--  sos急救系统 -->
 		<view class="system">
 			<top-title :title="'救在身边'" navurl="/pages/applic/location" :show_more="true"></top-title>
@@ -89,7 +101,7 @@
 							</view>
 						</view>
 						<view class="box-right">
-							<view class="img" v-if="item.is_create == 0"  @click="rescue(item,index)">
+							<view class="img" v-if="item.is_create == 0" @click="rescue(item,index)">
 								<image src="../../static/img/rescue.png" mode=""></image>
 							</view>
 							<view class="called" v-else>
@@ -106,7 +118,8 @@
 			</view>
 			<view id="container">
 				<map class="map-box" show-location :markers="jhzmarker" :scale="scale" :latitude="latitude4"
-					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="jhzmarkertap" :show-location="false"></map>
+					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="jhzmarkertap"
+					:show-location="false"></map>
 			</view>
 			<view class="">
 				<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in Mechanism"
@@ -121,7 +134,7 @@
 						<view class="image">
 							<image src="../../static/img/img10.png"></image>
 							<!-- <view class="tip" v-if="item.space > 999">>999m</view> -->
-							<view class="tip" >{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}m</view>
+							<view class="tip">{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}m</view>
 						</view>
 					</template>
 				</view>
@@ -134,7 +147,8 @@
 			</view>
 			<view id="container">
 				<map class="map-box" show-location :markers="aedmarker" :scale="scale" :latitude="latitude4"
-					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="aedmarkertap" :show-location="false"></map>
+					:longitude="longitude4" ref="map" style="height: 450rpx" @markertap="aedmarkertap"
+					:show-location="false"></map>
 			</view>
 			<view class="">
 				<view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
@@ -147,7 +161,7 @@
 						</view>
 						<view class="image">
 							<image src="../../static/img/img10.png"></image>
-							<view class="tip" >{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}m</view>
+							<view class="tip">{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}m</view>
 						</view>
 					</template>
 				</view>
@@ -185,15 +199,6 @@
 				</view>
 			</view>
 		</uni-popup>
-		<view class="ewm" @click="openewm()">
-			<image :src="wechat_qrcode" mode=""></image>
-		</view>
-		<uni-popup ref="popup" type="center">
-			<view class="popup-box">
-				<image :src="wechat_qrcode" mode="" class="gzhqr"></image>
-				<view>长按关注公众号</view>
-			</view>
-		</uni-popup>
 	</view>
 </template>
 
@@ -310,7 +315,7 @@
 					}
 				});
 			} else {
-				
+
 				// this.loadData();
 			}
 		},
@@ -319,7 +324,7 @@
 			saveUrl();
 			let obj = this;
 			let weichatBrowser = uni.getStorageSync('weichatBrowser')
-			if(weichatBrowser) {
+			if (weichatBrowser) {
 				try {
 					let locationAddress;
 					// #ifdef H5
@@ -354,7 +359,7 @@
 						});
 					});
 					// #endif
-				
+
 					// #ifdef MP
 					locationAddress({
 						type: 'gcj02',
@@ -420,7 +425,7 @@
 					});
 					// #endif
 				}
-			}else {
+			} else {
 				uni.getLocation({
 					type: 'gcj02',
 					success: function(res) {
@@ -442,7 +447,7 @@
 					}
 				})
 			}
-			
+
 		},
 		computed: {
 			...mapState('user', ['userInfo', 'baseURL', 'hasLogin']),
@@ -458,7 +463,7 @@
 				loadIndexs({}).then(({
 					data
 				}) => {
-					console.log(data,'index')
+					console.log(data, 'index')
 					this.carouselList = data.banner; //轮播图
 				});
 			},
@@ -590,7 +595,7 @@
 				}) => {
 					obj.setUserInfo(data);
 					obj.to_phone = data.mobile || ''
-					
+
 				});
 				if (obj.loadingType === 'noMore') {
 					//防止重复加载
@@ -609,7 +614,8 @@
 					console.log(data, 999);
 					// obj.AEDList = data
 					for (let i = 0; i < data.length; i++) {
-						data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i].longitude);
+						data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i]
+							.longitude);
 					}
 					obj.AEDList = data;
 					let arr = data.map(item => ({
@@ -635,7 +641,8 @@
 				}) => {
 					console.log(data, '机构+++++++++++++')
 					for (let i = 0; i < data.length; i++) {
-						data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i].longitude);
+						data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i]
+							.longitude);
 					}
 					let arr = data.map(item => ({
 						latitude: item.latitude,
@@ -657,7 +664,7 @@
 					limit: 2
 				}).then((res) => {
 					let data = res.data;
-					data = data.slice(0,2)
+					data = data.slice(0, 2)
 					console.log('就在身边请求数据', data);
 					console.log('data.phone333', data.phone)
 					data = data.map(d => {
@@ -667,7 +674,7 @@
 						}
 					})
 					obj.jzsblist = data;
-				
+
 					let arr = data.map(item => ({
 						latitude: item.latitude,
 						longitude: item.longitude,
@@ -1034,21 +1041,13 @@
 				width: 689rpx;
 				height: 312rpx;
 				background-color: #ffffff;
-				// padding: 0 30rpx;
 				padding-bottom: 45rpx;
-				// .map-box {
-				// 	width: 100%;
-				// 	height: 312rpx;
-				// 	// background-color: #fff;
-
-				// }
 			}
 		}
 
 		// AED
 		.list-box {
 			padding: 0rpx 25rpx 24rpx;
-			// margin-bottom: 84rpx;
 			background-color: #fff;
 
 			.system-title {
@@ -1146,6 +1145,7 @@
 		}
 	}
 
+	// 高配爱心红会
 	.red-box {
 		margin: 20rpx 0;
 		height: 521rpx;
@@ -1205,6 +1205,31 @@
 		}
 	}
 
+	// 低配爱心红会
+	// .red-box {
+	// 	margin: 20rpx 0;
+	// 	padding: 30rpx 30rpx 40rpx 30rpx;
+	// 	background-color: #fff;
+
+	// 	.red-nav {
+	// 		padding-top: 25rpx;
+	// 		display: flex;
+	// 		justify-content: space-between;
+
+	// 		.nav-item {
+	// 			width: 330rpx;
+	// 			height: 175rpx;
+	// 			background: #FFF4F2;
+	// 			border-radius: 15rpx;
+
+	// 			image {
+	// 				width: 330rpx;
+	// 				height: 175rpx;
+	// 			}
+	// 		}
+	// 	}
+	// }
+
 	.popup_row2 {
 		// margin-top: 108rpx;
 		height: 440rpx;
@@ -1363,6 +1388,7 @@
 			}
 		}
 	}
+
 	.ewm {
 		width: 75rpx;
 		height: 75rpx;
@@ -1371,9 +1397,9 @@
 		bottom: 200rpx;
 		background-color: #fff;
 		border-radius: 50%;
-	
+
 		box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: 0.6);
-	
+
 		image {
 			width: 50rpx;
 			height: 50rpx;
@@ -1384,25 +1410,25 @@
 			right: 0;
 			margin: auto;
 		}
-	
+
 		.ewm-tit {
 			position: absolute;
 			bottom: 10rpx;
 			font-size: 10rpx;
 		}
-	
+
 		.closeEwm {
 			width: 40rpx;
 			height: 40rpx;
 			position: absolute;
 			top: -40rpx;
 			right: -20rpx;
-	
+
 			image {
 				width: 100%;
 				height: 100%;
 			}
 		}
-	
+
 	}
 </style>

+ 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: 'xgred20211207',//系统AppID
+		sys_appsecret: '70211202dergxxgred20211207',//系统AppSecret
 	},
 	mutations: {
 	

+ 5 - 3
utils/newRequest.js

@@ -123,9 +123,11 @@ let service = {
 							title: '上传中'
 						})
 						let token = uni.getStorageSync('token') || '';
-						let sign_time = new Date().getTime();
-						let sys_appid = 'xgred20211207'
-						let sys_appsecret = '70211202dergxxgred20211207'
+						let sign_time = new Date().getTime();
+						let sys_appid = store.state.sys_appid
+						let sys_appsecret = store.state.sys_appsecret
+						// let sys_appid = 'xgred20211207'
+						// let sys_appsecret = '70211202dergxxgred20211207'
 						let sys_token = md5(md5(sys_appid + sys_appsecret) + sign_time + sha1(sys_appsecret + sign_time))
 						
 						uni.uploadFile({

+ 5 - 3
utils/request.js

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