소스 검색

2021-12-15

hwq 3 년 전
부모
커밋
187e53beae

+ 1 - 1
App.vue

@@ -32,7 +32,7 @@
 			let userInfo = uni.getStorageSync('userInfo') || '';
 			console.log(userInfo,'bba');
 			// 判断是否拥有用户信息
-			if (userInfo.project_area == obj.project_area) {
+			if (userInfo.id) {
 				//更新登陆状态
 				uni.getStorage({
 					key: 'userInfo',

+ 2 - 2
api/ask.js

@@ -13,7 +13,7 @@ export function addrescuer(data){
 //上传图片
 export function upload(data){
 	return upFilse({
-		url:'/api/upload/image',
+		url:'/api/upload',
 		method:'post',
 		data
 	})
@@ -75,7 +75,7 @@ export function mechanism(data) {
 // 捐款意向 chosintention
 export function chosintention(data) {
 	return request({
-		url: '/api/intention',
+		url: '/api/lave/ify',
 		method: 'get',
 		data
 	});

+ 59 - 5
api/category.js

@@ -1,10 +1,64 @@
 import request from '@/utils/request'
 
-// 获取商品分类
-export function getList(data) {
+//获取机构列表
+export function getMechanismList(data) {
 	return request({
-		url: '/api/category',
-		method: 'get',
+		url:'/api/institution/institution',
+		method:'get',
 		data
-	});
+	})
 }
+
+//申请成为救援者
+export function applyRescuer(data) {
+	return request({
+		url:'/api/rescue/create',
+		method:'post',
+		data
+	})
+}
+
+// 获取志愿者列表
+export function getRescuerList(data) {
+	return request({
+		url:'/api/rescue/index',
+		method:'get',
+		data
+	})
+}
+
+// 申请记录applyList
+export function getApplyList(data) {
+	return request({
+		url:'/api/rescue/applylst',
+		method:'get',
+		data
+	})
+}
+
+// 求救
+export function sos(data) {
+	return request({
+		url:'/api/rescue/sos',
+		method:'post',
+		data
+	})
+}
+
+//
+export function geocoder(data) {
+	return request({
+		url:'/api/geocoder',
+		method:'get',
+		data
+	})
+}
+
+// 获取求救记录/救援记录 type:  0-> 求救   1->救援
+export function getRescueList(data) {
+	return request({
+		url:'/api/rescue/lst',
+		method:'get',
+		data
+	})
+}

+ 9 - 25
api/index.js

@@ -9,6 +9,7 @@ export function loadIndexs(data) {
 		data
 	});
 }
+
 // 获取科普文章列表
 export function getArticList(data,id) {
 	return request({
@@ -42,33 +43,8 @@ export function groom4(data) {
 		data
 	});
 }
-// 精品推荐
-export function groom1(data) {
-	return request({
-		url: '/api/groom/list/1',
-		method: 'get',
-		data
-	});
-}
-// 新品首发
-export function groom3(data) {
-	return request({
-		url: '/api/groom/list/3',
-		method: 'get',
-		data
-	});
-}
 
 
-// 获取我创建的圈子
-export function myCreateCircle(data) {
-	return request({
-		url: '/api/circle/mycreate',
-		method: 'post',
-		data
-	});
-}
-
 // 造血干细胞捐献
 export function getList(data) {
 	return request({
@@ -224,4 +200,12 @@ export function one_help(data) {
 		method: 'get',
 		data
 	});
+}
+
+export function getCompany(data) {
+	return request({
+		url: '/api/index/company',
+		method: 'get',
+		data
+	});
 }

+ 1 - 1
api/money.js

@@ -13,7 +13,7 @@ export function computedOrderkey(data) {
 // 创建订单
 export function createOrderkey(data,key) {
 	return request({
-		url: '/api/donate/create',
+		url: '/api/lave/create',
 		method: 'post',
 		data
 	});

+ 0 - 8
api/order.js

@@ -67,12 +67,4 @@ export function orderTake(data) {
 		method: 'post',
 		data
 	});
-}
-
-export function loveList(data) {
-	return request({
-		url: '/api/bulletin',
-		method: 'get',
-		data
-	});
 }

+ 5 - 6
manifest.json

@@ -79,23 +79,22 @@
         "enable" : false
     },
     "h5" : {
-        "title" : "孝感红十字会",
-        "domain" : "xg.igxys.com",
+        "title" : "神农架林区红十字会",
+        "domain" : "slj.igxys.com",
         "router" : {
-            "mode" : "history",
+            "mode" : "hash",
             "base" : "/index/"
         },
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "http://xg.igxys.com", //请求的目标域名
+                    "target" : "http://red.frp.liuniu946.com", //请求的目标域名
                     "changeOrigin" : true,
                     // "secure": false,
                     "pathRewrite" : {}
                 }
             },
-            "port" : "",
-            "https" : true
+            "port" : ""
         },
         // "^/api" : ""
         "template" : "",

+ 8 - 8
pages.json

@@ -17,7 +17,7 @@
 					"titleNView": false
 				},
 				// #endif
-				"navigationBarTitleText": "孝感红十字会"
+				"navigationBarTitleText": "孝感红十字会"
 
 			}
 		},
@@ -214,7 +214,7 @@
 					"titleNView": false
 				},
 				// #endif
-				"navigationBarTitleText": "孝感红十字会"
+				"navigationBarTitleText": "孝感红十字会"
 			}
 		},
 		{
@@ -915,22 +915,22 @@
 				"pagePath": "pages/index/index",
 				"iconPath": "./static/tabBar/home.png",
 				"selectedIconPath": "static/tabBar/home-action.png",
-				"text": "首页",
-				"visible":false
+				"text": "首页"
+				// "visible":false
 			},
 			{
 				"pagePath": "pages/category/category",
 				"iconPath": "static/tabBar/dengji.png",
 				"selectedIconPath": "static/tabBar/dengji-action.png",
-				"text": "救在身边",
-				"visible":false
+				"text": "救在身边"
+				// "visible":false
 			},
 			{
 				"pagePath": "pages/user/user",
 				"iconPath": "static/tabBar/user.png",
 				"selectedIconPath": "static/tabBar/user-action.png",
-				"text": "我的",
-				"visible":false
+				"text": "我的"
+				// "visible":false
 			}
 		]
 	}

+ 60 - 71
pages/applic/contribution.vue

@@ -14,21 +14,12 @@
 					</picker>
 				</view>
 			</view>
-			<view class="box-item" v-if="intention == '其他'">
-				<!-- <view class="box-left">
-					<text class="imp">*</text>捐款意向
-				</view> -->
-				<!-- <view class="box-right"> -->
-				<!-- <picker :value="index" @change="PickerDire" :range="chooseDire" class="box-right" @click="addType"> -->
-				<input type="text" placeholder="请输入捐款意向" v-model="jkyx" />
-				<!-- </picker> -->
-				<!-- </view> -->
-			</view>
 			<view class="box-item">
 				<view class="box-left">
 					<text class="imp">*</text>捐款方式
 				</view>
 				<view class="box-right">
+					<!-- <input type="text" placeholder="请选择捐款方式" /> -->
 					<picker @change="PickerType" :value="index" :range="chooseType" class="box-right">
 						<text>{{ way || '请选择捐款方式'}}</text>
 					</picker>
@@ -60,7 +51,7 @@
 				</view>
 
 				<view class="box-bottom">
-					个人捐款500元以上,单位捐款2000元以上可寄送纸质证书
+					个人满500,单位满2000可打印纸质证书
 				</view>
 			</view>
 
@@ -97,18 +88,16 @@
 				实名公开
 			</view>
 			<view class="switch-right">
-				<switch :checked="is_public" color='#E63931' style="transform: scale(0.7,0.7)"
-					@change="switch1Change" />
+				<switch :checked="public" color='#E63931' style="transform: scale(0.7,0.7)" @change="switch1Change" />
 			</view>
 		</view>
 
 		<view class="switch-box">
 			<view class="switch-left">
-				寄证书
+				寄发票
 			</view>
 			<view class="switch-right">
-				<switch :checked="is_receipts" color='#E63931' style="transform: scale(0.7,0.7)"
-					@change="switch2Change" />
+				<switch :checked="receipts" color='#E63931' style="transform: scale(0.7,0.7)" @change="switch2Change" />
 			</view>
 
 		</view>
@@ -180,12 +169,12 @@
 							取消
 						</view>
 						<view class="comfirm" @click="comfirmExit()">
-							确认
+							 确认
 						</view>
 					</view>
 				</view>
 			</view>
-
+		
 		</uni-popup>
 	</view>
 </template>
@@ -222,12 +211,13 @@
 			return {
 				index: 0,
 				intention: '', // 捐款意向
+				category_id:'',// 捐款意向ID
 				way: '', // 捐款方式
+				way_id: '',// 捐款方式id
 				money: '', // 捐款金额
 				// elsemoney: '', // 其他金额
 				popmoney: '', // 按钮金额 弹窗金额
 				is_show: true,
-				jkyx: '', //手动输入捐款意向
 				moneyList: [{
 						id: 0,
 						money: 500
@@ -249,14 +239,17 @@
 						money: 20
 					},
 				],
-				is_public: true, // 是否实名公开
-				is_receipts: false, // 是否开发票
+				is_public: '0', // 是否实名公开
+				is_receipts: '1', // 是否开发票
+				public: true, // 是否实名公开
+				receipts: false, // 是否开发票
 				donate_er: '', // 捐款人/单位
 				mobile: '', // 手机号
 				isshowMoney: false, // 其他金额是否展示
 				address: '', // 联系地址
 				// chooseDire: ['请选择捐款意向','红十字人道事业(非定向捐赠)','疫情防控','其他','红十字博爱送万家','AED救护及科普','青少年生命安全教育基地建设项目','关注重度失能老人项目','青少年白血病救护项目','地芯行动-关爱地中海贫血儿童','会费缴纳'],
 				chooseDire: [],
+				chooseList: [],//捐款意向真实列表
 				chooseType: ['个人', '单位'],
 				chooseMoney: ['5元', '10元', '50元', '其他金额'],
 				payLoding: false, //判断是否支付中
@@ -303,21 +296,22 @@
 				chosintention({}).then(({
 					data
 				}) => {
-					console.log(data)
-					this.chooseDire = data.map(item => item.title)
+					this.chooseDire = data.map(item => item.name)
+					this.chooseList = data
 				}).catch()
 			},
 			// 选择捐赠意向
 			PickerDire: function(e) {
-				console.log(334, this.chooseDire)
+				console.log(334, e)
 				this.intention = this.chooseDire[e.target.value];
-				this.index = e.target.value + 1;
+				this.category_id = this.chooseList[e.target.value].id;
 			},
 			// 选择捐款方式
 			PickerType: function(e) {
 				this.way = this.chooseType[e.target.value];
-				this.index = e.target.value + 1;
-				console.log('选择捐款方式', this.index)
+				this.way_id = e.target.value;
+				this.index = e.target.value;
+				console.log('选择捐款方式', this.way_id)
 				if (this.index == 1) {
 					this.is_show = true
 				} else {
@@ -368,32 +362,33 @@
 				console.log('点击comfirmExit')
 				this.$refs.popup1.close()
 				uni.switchTab({
-					url: '/pages/home/home'
+				    url: '/pages/home/home'
 				});
-
+				
 			},
 			// 是否实名公开
 			switch1Change(e) {
-				this.is_public = e.detail.value
+				this.public = e.detail.value
+				if(e.detail.value){
+					this.is_public = '1'
+				}else {
+					this.is_public = '0'
+				}
 				console.log(this.is_public)
 			},
 			//是都寄发票
 			switch2Change(e) {
 				this.is_receipts = e.detail.value
+				if(e.detail.value){
+					this.is_receipts = '1'
+				}else {
+					this.is_receipts = '0'
+				}
 				console.log('is_receipts', this.is_receipts)
 			},
 			// 提交
 			confirm: async function() {
 				let obj = this
-				if(!obj.intention) {
-					return this.$api.msg('请选择捐款意向!');
-				}else {
-					if(obj.intention == '其他') {
-						if(obj.jkyx == '') {
-							return this.$api.msg('请输入捐款意向!');
-						}
-					}
-				}
 				if (!obj.way) {
 					this.$api.msg('请选择捐款方式!');
 					return;
@@ -419,7 +414,7 @@
 					obj.$api.msg('请填写正确的手机号码');
 					return;
 				}
-				if (this.is_receipts == true) {
+				if (this.is_receipts == '0') {
 					// obj.address = '用户未填写联系地址'
 					if (!obj.address) {
 						this.$api.msg('请输入联系地址');
@@ -431,14 +426,17 @@
 					obj.address = '用户未填写联系地址'
 				}
 				createOrderkey({
-					money: obj.money, //捐款金额
-					intention: obj.intention == '其他' ? obj.jkyx : obj.intention, //捐款意向
-					way: obj.way, //捐款方式
-					is_public: obj.is_public, //是否实名公开
-					is_receipts: obj.is_receipts, //是否开发票
-					donate_er: obj.donate_er, //捐款人/单位
-					mobile: obj.mobile, //手机号
+					order_name: obj.intention, //捐款意向
+					category_id: obj.category_id,//捐款意向id
+					amount: obj.money, //捐款金额
+					name: obj.donate_er, //捐款人/单位
+					// contact: obj, //单位联系人(企业有效)
+					tel: obj.mobile, //手机号
 					address: obj.address, //联系地址
+					is_open: obj.is_public, //是否实名公开
+					is_ticket: obj.is_receipts, //是否开发票
+					pay_type:0,//支付方式0微信1支付宝
+					type: obj.way_id
 				}).then(({
 					data
 				}) => {
@@ -457,13 +455,10 @@
 							// obj.$api.msg('支付成功')
 							let date = new Date()
 							let year = date.getFullYear()
-							let month = date.getMonth() >= 9 ? date.getMonth() + 1 : '0' + (date
-								.getMonth() + 1)
+							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: '/pages/form/donaSuccess?money=' + obj.money +
-									'&name=' + obj.donate_er + '&time=' + year + '年' +
-									month + '月' + day + '日'
+								url: '/pages/form/donaSuccess?money=' + obj.money + '&name=' + obj.donate_er + '&time=' + year + '年' + month + '月' + day +'日'
 							})
 						},
 						fail: function(res) {
@@ -494,31 +489,26 @@
 
 	.box {
 		margin-top: 10rpx;
-
-		.box-item2 {
+		.box-item2{
 			background-color: #FFFFFF;
 			padding: 18rpx 24rpx;
 			// display: flex;
 			border-bottom: 1rpx solid #F2F2F2;
-
-			.box-left {
+			.box-left{
 				color: #E63931;
 			}
-
-			.box-info {
+			.box-info{
 				text-indent: 68rpx;
 				margin-top: 16rpx;
 				color: #7b7b7b;
 			}
-
-			.box-phone {
+			.box-phone{
 				text-indent: 68rpx;
 				margin-top: 6rpx;
 				// text-align: center;
 				color: #7b7b7b;
 			}
 		}
-
 		.box-item1 {
 			background-color: #FFFFFF;
 			padding: 18rpx 24rpx;
@@ -695,25 +685,24 @@
 			}
 		}
 	}
-
 	.popup-box {
 		width: 522rpx;
 		height: 605rpx;
 		background-color: #FFFFFF;
 		border-radius: 20rpx;
-
+	
 		.img {
 			border-radius: 20rpx 20rpx 0 0;
 			width: 522rpx;
 			height: 307rpx;
-
+	
 			image {
 				border-radius: 20rpx 20rpx 0 0;
 				width: 522rpx;
 				height: 307rpx;
 			}
 		}
-
+	
 		.mian {
 			display: flex;
 			flex-direction: column;
@@ -722,24 +711,24 @@
 			background-color: #FFFFFF;
 			border-radius: 0 0 20rpx 20rpx;
 			text-align: center;
-
+	
 			.delivery {
 				font-size: 36rpx;
 				color: #333333;
 				// margin-top: 46rpx;
 			}
-
+	
 			.nocancel {
 				font-size: 30rpx;
 				color: #999999;
 				margin-top: 26rpx;
 			}
-
+	
 			.comfirm-box {
 				margin-top: 52rpx;
 				display: flex;
 				// margin-bottom: 32rpx;
-
+	
 				// justify-content: space-around;
 				.cancel {
 					display: flex;
@@ -749,11 +738,11 @@
 					height: 61rpx;
 					border: 1px solid #C90F1B;
 					border-radius: 31rpx;
-
+	
 					font-size: 24rpx;
 					color: #C90F1B;
 				}
-
+	
 				.comfirm {
 					margin-left: 32rpx;
 					display: flex;

+ 95 - 55
pages/applic/helprecords.vue

@@ -1,36 +1,44 @@
 <template>
 	<view class="container">
 		<uni-swipe-action>
-			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)" v-for="(item,index) in list">
-			<view class="list">
-				<view class="list-left" >
-					<view class="list-top">
+			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)"
+				v-for="(item,index) in list">
+				<view class="list">
+					<view class="list-left">
+						<!-- <view class="list-top">
 						救援者姓名:{{item.to_name}}
-					</view>
-					<view class="list-phone">
-						手机号:{{item.to_phone}}
-					</view>
-					<view class="list-time">
-						救援时间:{{item.add_time}}
-					</view>
-					<view class="list-box">
-						<view class="list-type" v-if="item.status == 1">
-							已接受
-						</view>
-						<view class="list-type" v-if="item.status == 0">
-							未接受
+					</view> -->
+						<view class="list-phone">
+							救援者联系方式:{{item.rescue_phone}}
 						</view>
-						<view class="list-type" v-if="item.status == 2">
-							已拒绝
+						<view class="list-time">
+							发起救援时间:{{item.createtime | time}}
 						</view>
-						<view class="box-item" @click="tocall(item.to_phone)">
-							<image src="../../static/icon/call.png" mode="" class="call"></image>
-							拨打电话
+						<view class="list-box">
+							<view class="list-type" v-if="item.status == 1">
+								已接受
+							</view>
+							<view class="list-type" v-if="item.status == 0">
+								待接收
+							</view>
+							<view class="list-type" v-if="item.status == 2">
+								处理中
+							</view>
+							<view class="list-type" v-if="item.status == -2">
+								已超时
+							</view>
+							<view class="list-type" v-if="item.status == -1">
+								拒绝
+							</view>
+							<view class="box-item" @click=" item.status == 1 ? tocall(item.to_phone): ''"
+								:class="{'action': (item.status == 1)}">
+								<image src="../../static/icon/call.png" mode="" class="call"></image>
+								拨打电话
+							</view>
 						</view>
 					</view>
 				</view>
-			</view>
-		
+
 			</uni-swipe-action-item>
 		</uni-swipe-action>
 		<!-- <view class="list" v-for="(item,index) in list" :key='index'>
@@ -54,12 +62,12 @@
 							取消
 						</view>
 						<view class="comfirm" @click="comfirm(tmp)">
-							 确认
+							确认
 						</view>
 					</view>
 				</view>
 			</view>
-		
+
 		</uni-popup>
 		<empty v-if="list.length === 0"></empty>
 		<uni-load-more :status="loadingType"></uni-load-more>
@@ -71,6 +79,10 @@
 		deleteList,
 		getseek
 	} from '@/api/index.js';
+	import {
+		getRescueList
+	} from '@/api/category.js'
+
 	import empty from '@/components/empty';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import uniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
@@ -82,9 +94,26 @@
 			uniSwipeAction,
 			uniSwipeActionItem
 		},
+		filters: {
+			time(val) {
+				let str = ''
+				if (val) {
+					var time = new Date(val * 1000);
+					var y = time.getFullYear();
+					var m = time.getMonth() + 1;
+					var d = time.getDate();
+					var h = time.getHours();
+					var mm = time.getMinutes();
+					var s = time.getSeconds();
+					str = y + '-' + m + '-' + d + ' ' + h + ":" + mm
+					console.log(str)
+				}
+				return str
+			}
+		},
 		data() {
 			return {
-				id:'',
+				id: '',
 				options: [{
 					text: '取消',
 					style: {
@@ -99,8 +128,8 @@
 				page: 1,
 				limit: 10,
 				delBtnWidth: 60, //删除按钮宽度单位(rpx)
-				startX:'',
-				isDel:false,
+				startX: '',
+				isDel: false,
 				list: [],
 				loadingType: 'more',
 			}
@@ -118,7 +147,7 @@
 				// console.log('e.index',e.index)
 				// console.log('this.tmp',this.tmp)
 				// console.log('点击了' + (e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')
-				if ( e.content.text == '取消' ) {
+				if (e.content.text == '取消') {
 					console.log('点击了左侧取消按钮')
 				} else {
 					console.log('点击了右侧确认按钮')
@@ -127,34 +156,36 @@
 				}
 			},
 			swipeChange(e, id) {
-			// 	// console.log('当前状态:' + open + ',下标:' + index)
+				// 	// console.log('当前状态:' + open + ',下标:' + index)
 				// console.log('index',index)
 				this.id = id
-				console.log('id111111111',id)
-			// 	if ( e == 'right' ) {
-			// 		this.index = index
-			// 		console.log('当前index值:',this.index)
-			// 	}
-			// 	// console.log(222,e)
+				console.log('id111111111', id)
+				// 	if ( e == 'right' ) {
+				// 		this.index = index
+				// 		console.log('当前index值:',this.index)
+				// 	}
+				// 	// console.log(222,e)
 			},
 			// 确认删除吗?
-			comfirm (id) {
-				console.log(9999888,id)
+			comfirm(id) {
+				console.log(9999888, id)
 				deleteList({
 					id: this.id
-				}).then(({ data }) => {
+				}).then(({
+					data
+				}) => {
 					window.location.reload(); //重新刷新页面
 					this.loadData()
 					this.cancel()
 				})
 			},
 			// 取消
-			cancel(){
+			cancel() {
 				this.$refs.popup1.close();
 			},
 			// 打开弹窗
 			open(tmp) {
-				console.log('打开弹窗',tmp)
+				console.log('打开弹窗', tmp)
 				this.$refs.popup1.open(tmp)
 			},
 			tocall(num) {
@@ -191,7 +222,8 @@
 				}
 				// 修改当前对象状态为加载中
 				obj.loadingType = 'loading';
-				getseek({
+				getRescueList({
+					type: 0,
 					page: obj.page,
 					limit: obj.limit
 				}).then(({
@@ -222,11 +254,13 @@
 			margin: 20rpx auto 0;
 			display: flex;
 			justify-content: space-between;
-			.list-left{
+
+			.list-left {
 				width: 100%;
 				padding: 24rpx 0 24rpx 24rpx;
 			}
-			.cancel{
+
+			.cancel {
 				background-color: #C9101B;
 				display: flex;
 				align-items: center;
@@ -262,6 +296,10 @@
 				margin-top: 20rpx;
 			}
 
+			.action {
+				background-color: #C9101B !important;
+			}
+
 			.list-box {
 				display: flex;
 				justify-content: space-between;
@@ -272,7 +310,8 @@
 				.box-item {
 					width: 210rpx;
 					height: 65rpx;
-					background: #C9101B;
+					// background: #C9101B;、
+					background-color: #aaa;
 					border-radius: 30rpx;
 					display: flex;
 					align-items: center;
@@ -310,24 +349,25 @@
 			}
 
 		}
+
 		.popup-box {
 			width: 522rpx;
 			height: 605rpx;
 			background-color: #FFFFFF;
 			border-radius: 20rpx;
-		
+
 			.img {
 				border-radius: 20rpx 20rpx 0 0;
 				width: 522rpx;
 				height: 307rpx;
-		
+
 				image {
 					border-radius: 20rpx 20rpx 0 0;
 					width: 522rpx;
 					height: 307rpx;
 				}
 			}
-		
+
 			.mian {
 				display: flex;
 				flex-direction: column;
@@ -336,24 +376,24 @@
 				background-color: #FFFFFF;
 				border-radius: 0 0 20rpx 20rpx;
 				text-align: center;
-		
+
 				.delivery {
 					font-size: 36rpx;
 					color: #333333;
 					// margin-top: 46rpx;
 				}
-		
+
 				.nocancel {
 					font-size: 30rpx;
 					color: #999999;
 					margin-top: 26rpx;
 				}
-		
+
 				.comfirm-box {
 					margin-top: 52rpx;
 					display: flex;
 					// margin-bottom: 32rpx;
-		
+
 					// justify-content: space-around;
 					.cancel {
 						display: flex;
@@ -363,11 +403,11 @@
 						height: 61rpx;
 						border: 1px solid #C90F1B;
 						border-radius: 31rpx;
-		
+
 						font-size: 24rpx;
 						color: #C90F1B;
 					}
-		
+
 					.comfirm {
 						margin-left: 32rpx;
 						display: flex;

+ 187 - 228
pages/applic/location.vue

@@ -2,16 +2,10 @@
 	<view class="content">
 		<view id="map" class="map">
 			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx; height: 600rpx" :latitude="latitude"
-			 :longitude="longitude" :markers="marker"></map>
-		</view>i
-			<view class="location">
-				<!-- <view class="Search-box"  @click="getLocation">
-					<view class="Search-box-size">
-						<image class="box-img" src="https://zhxc2030.com/img/img01.png"></image>
-						<input class="box-word" placeholder="搜索地址" v-model="specificAdd" @input="searchlist">
-					</view>
-				</view> -->
-				<view v-for="(item,index) in list" :key="item.id">
+				:longitude="longitude" :markers="marker"></map>
+		</view>
+		<view class="location">
+			<view v-for="(item,index) in list" :key="item.id">
 				<view class="location-item">
 					<view class="box-left">
 						<view class="img01">
@@ -26,10 +20,10 @@
 						<view class="info">
 							<view class="info-header">
 								<view class="name">
-								   救护员{{ index +1 }}
+									救护员{{ index +1 }}
 								</view>
 								<view class="distance">
-									{{ item.num }}km
+									{{item.range >= 1 ?(item.range + 'km'):(item.distance + 'm')}}
 								</view>
 								<view class="location-icon">
 									<image src="../../static/img/location-icon.png" mode=""></image>
@@ -40,18 +34,19 @@
 							</view>
 						</view>
 					</view>
-					<view class="box-right" @click="rescue(item,index)"  >
-						<view class="img" v-if="!item.is">
+					<view class="box-right">
+						<view class="img" v-if="item.is_create == 0" @click="rescue(item,index)">
 							<image src="../../static/img/rescue.png" mode=""></image>
 						</view>
-						<view class="called" v-if="item.is">
+						<view class="called" v-else>
 							已呼叫
 						</view>
 					</view>
 				</view>
-				</view>
-				<espempty v-if="list.length === 0"></espempty>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
+			<espempty v-if="list.length === 0 && loaded"></espempty>
+		</view>
 		<uni-popup ref="popup" type="center" @click="close">
 			<view class="popup_row">
 				<view class="title">
@@ -63,15 +58,15 @@
 					</view>
 				</view>
 				<view class="inpBox">
-					<input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone"/>
-				</view>	
-					<view class="inpedit">
-						可在方框中修改您的手机号
-					</view>
+					<input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone" />
+				</view>
+				<view class="inpedit">
+					可在方框中修改您的手机号
+				</view>
 				<view class="comfirm">
 					<view class="comfirm1" @click="comfirm1()">
 						确认
-					</view>			
+					</view>
 				</view>
 			</view>
 		</uni-popup>
@@ -95,6 +90,15 @@
 	import {
 		getcomAddress
 	} from '@/api/index.js';
+	import {
+		getMechanismList,
+		applyRescuer,
+		getRescuerList,
+		getApplyList,
+		sos,
+		geocoder
+	} from '@/api/category.js'
+
 	export default {
 		components: {
 			uniPopup,
@@ -103,17 +107,24 @@
 		//相关配置参数
 		data() {
 			return {
+				user_id: '',
+				rescuers_id: 0,
+				loadingType: 'more',
+				loaded: false,
+				page: 1,
+				limit: 100,
 				list: [],
 				latitude: '',
 				longitude: '',
-				current: 0, 
+				current: 0,
 				name: '',
 				uid: '',
 				name: '',
 				phone: '',
-				to_phone:'',
+				to_phone: '',
 				marker: [],
-				specificAdd:'',
+				specificAdd: '',
+				user_address: '', //用户地址逆解析
 				addressData: {
 					name: '',
 					mobile: '',
@@ -132,88 +143,90 @@
 		},
 		onLoad() {
 			let obj = this;
+			obj.getLocal()
 			console.log('开始加载事件');
 			obj.loadBaseData();
-			uni.showLoading({
-				title: '加载中',
-				mask: true
-			});
-			obj.loadData();
-			try {
-				let locationAddress
-				// #ifdef H5
-				let wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(()=>{
-					console.log('加载完毕注册事件');
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.marker = [
-								{ 
-									latitude: obj.latitude,
-									longitude: obj.longitude,
-									iconPath: '/static/img/img19.png',
-									width: '45',
-									height: '45',
-								},
-							]	
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-							window.location.reload();
-						}
-					});
-				})
-				
-			} catch (e) {
-				console.log(e);
-				let locationAddress
-				// #ifdef H5
-				let  wxOjb = require('jweixin-module');
-				locationAddress = wxOjb.getLocation;
-				// #endif
-				// #ifdef MP
-				locationAddress = uni.getLocation;
-				// #endif
-				wxOjb.ready(()=>{
-					console.log('加载完毕注册事件');
-					
-					locationAddress({
-						type: 'gcj02',
-						success: function(res) {
-							console.log('获取经纬度1', res);
-							obj.longitude = res.longitude
-							obj.latitude = res.latitude
-							obj.loadData();
-						},
-						fail(e) {
-							console.log('失败', e);
-						}
-					});
-				})
-				
-			}
+
 		},
 		computed: {
 			...mapState('user', ['hasLogin', 'userInfo'])
 		},
 		methods: {
 			...mapMutations('user', ['setUserInfo']),
+			// 获取本地坐标
+			getLocal() {
+				let obj = this;
+				console.log('ddddddddddddddddddddddddd')
+				uni.getLocation({
+					type: 'gcj02',
+					success(e) {
+						console.log(e)
+						obj.latitude = Math.abs(e.latitude)
+						obj.longitude = Math.abs(e.longitude)
+						console.log('本地坐标', obj.latitude, obj.longitude)
+						geocoder({
+							latitude: obj.latitude,
+							longitude: obj.longitude
+						}).then(res => {
+							console.log(res)
+							obj.user_address = res.data.result.address
+							console.log(obj.user_address, 'obj.user_address')
+						})
+						let item = {
+							id: 0,
+							latitude: obj.latitude,
+							longitude: obj.longitude,
+							iconPath: '/static/img/img19.png',
+							width: '35',
+							height: '35',
+						}
+						obj.marker.push(item)
+						obj.getRescuerList(obj.latitude, obj.longitude)
+					}
+				})
+			},
+			// 获取救援者列表
+			getRescuerList(lat, lon) {
+				let obj = this
+				if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
+					return
+				}
+				obj.loadingType = 'loading'
+				getRescuerList({
+					page: obj.page,
+					limit: obj.limit,
+					latitude: lat,
+					longitude: lon,
+				}).then(res => {
+					// this.peoplelist = res.data
+					let arr = []
+					res.data.forEach(item => {
+						let pro = {
+							id: item.id * 1,
+							latitude: item.latitude,
+							longitude: item.longitude,
+							iconPath: '/static/img/img014.png',
+							width: '35',
+							height: '35',
+						}
+						arr.push(pro)
+					})
+					obj.list = obj.list.concat(res.data)
+					obj.marker = obj.marker.concat(arr)
+					if (res.data.length == obj.limit) {
+						obj.loadingType = 'more'
+					} else {
+						obj.loadingType = 'noMore'
+					}
+					obj.$set(obj, 'loaded', true)
+				})
+			},
 			loadBaseData() {
 				userinfo({}).then(({
 					data
 				}) => {
-					console.log(123,data)
-					this.to_phone = data.phone
+					console.log(123, data)
+					this.to_phone = data.mobile
 					this.setUserInfo(data);
 				});
 			},
@@ -221,119 +234,51 @@
 			mapChange(e) {
 				console.log(e);
 			},
-			// 载入数据
-			async loadData() {
-				let obj = this;
-				getdis({
-					lng1: obj.longitude,
-					lat1: obj.latitude
-				}).then((res) => {
-					// uni.showModal({
-					// 	title:'值',
-					// 	content:JSON.stringify(res)
-					// })
-					let data = res.data;
-					uni.hideLoading();
-					console.log('请求数据', data);
-					// obj.phone = data.phone
-					console.log('data.phone333',data.phone)
-					data = data.map(d => {
-						return {
-							...d,
-							iscall: true
-						}
-					})
-					obj.list = data;
-					
-					let arr = data.map(item => ({
-						latitude: item.latitude,
-						longitude: item.longitude,
-						iconPath: '/static/img/img014.png',
-						width: '35',
-						height: '35',
-						id: item.id,
-						address: item.address
-					}))
-					obj.marker = obj.marker.concat(arr)
-					
-					
-					
-					
-					
-				}).catch(err => {
-					console.log(err);
-					uni.hideLoading();
-					// uni.showModal({
-					// 	title: '失败',
-					// 	content: JSON.stringify(err)
-					// });
-				});
-			},
-			cancel(){
+			cancel() {
 				this.$refs.popup.close();
 			},
-			comfirm1:function () {
-			let obj = this
-				if ( obj.to_phone.toString().trim() == '' ){
-					// uni.showModal({
-					// 	title:'输入框为空',
-					// 	// content:JSON.stringify(obj)
-					// })
+			comfirm1: function() {
+				let obj = this
+				if (obj.to_phone.toString().trim() == '') {
+					return obj.$api.msg('请输入手机号码')
 				} else {
-					console.log('obj.to_phone1111',obj.to_phone)
+					console.log('obj.to_phone1111', obj.to_phone)
 					const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
 					if (!reg.test(obj.to_phone)) {
 						obj.$api.msg('请填写正确的手机号码');
 						return;
 					}
-					console.log('name:',obj.name)
-					console.log('uid:',obj.uid)
-					console.log('phone',obj.phone)
-					console.log('to_phone',obj.to_phone)
-					console.log('longitude',obj.longitude)
-					console.log('latitude',obj.latitude)
-					console.log('iscall',obj.iscall)
-					tocall({
-							name: obj.name,
-							uid: obj.uid,
-							phone: obj.phone,
-							longitude: obj.longitude,
-							latitude: obj.latitude,
-							to_phone:obj.to_phone
-						}).then((data) => {
-							console.log(99988,data)
-							uni.showModal({
-									title:'请耐心等待救援',
-									success: res => {
-										if (res.confirm) {
-											window.location.reload(); //重新刷新页面
-										}
-									}
-							})
-							obj.$refs.popup.close();
-							obj.iscall = false
-							console.log(123,obj.iscall)
+					sos({
+						mobile: obj.to_phone,
+						address: obj.user_address,
+						latitude: obj.latitude,
+						longitude: obj.longitude,
+						rescuers_id: obj.rescuers_id,
+						user_id: obj.user_id
+					}).then(res => {
+						uni.showModal({
+							title: '请耐心等待救援',
+							success: res => {
+								if (res.confirm) {
+									window.location.reload(); //重新刷新页面
+								}
+							}
 						})
-					}
-				},		
-	
-			// comfirm2:function (item,index) {
-			// 	let obj = this
-									
-			// },
+						obj.$refs.popup.close();
+					})
+				}
+			},
 			// 立即救援 
 			rescue(item, index) {
 				let obj = this;
+				console.log(item, 'jiuzhu item')
 				uni.showModal({
 					content: '是否发起求救?',
 					success: res => {
 						if (res.confirm) {
-							this.$refs.popup.open(item,index);
-							obj.name = item.name;
-							obj.uid = item.uid;
-							obj.phone = item.phone;
-							obj.iscall = false
-							console.log('点击救援时item.phone:',obj.phone)
+							this.$refs.popup.open(item, index);
+							obj.rescuers_id = item.id
+							obj.user_id = item.user_id
 						}
 					}
 				})
@@ -355,7 +300,8 @@
 		width: 100%;
 		background-color: #fff;
 	}
-	.map{
+
+	.map {
 		width: 100%;
 		height: 600rpx;
 	}
@@ -370,24 +316,25 @@
 		width: 100%;
 		background-color: #fff;
 		padding: 24rpx;
+
 		//搜索框
 		.Search-box {
 			// z-index: 999;
 			height: 80rpx;
-	// position: fixed;
-	// 		top: 0;
-	// 		left: 0;
-	// 		width: 100%;
+			// 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;
@@ -397,14 +344,14 @@
 					line-height: 58rpx;
 					margin-right: 19rpx;
 				}
-		
+
 				.sort-img {
 					width: 21rpx;
 					height: 11rpx;
 					margin-bottom: 4rpx;
 				}
 			}
-		
+
 			.Search-box-size {
 				// width:70%;
 				height: 58rpx;
@@ -413,21 +360,21 @@
 				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%;
+					width: 100%;
 					font-size: 26rpx;
 					font-weight: 500;
 					color: rgba(205, 203, 203, 1);
@@ -435,6 +382,7 @@
 				}
 			}
 		}
+
 		.location-item {
 			z-index: 1000;
 			display: flex;
@@ -442,54 +390,56 @@
 			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;
@@ -497,7 +447,7 @@
 							}
 						}
 					}
-	
+
 					.address {
 						font-size: 26rpx;
 						color: #333333;
@@ -505,17 +455,17 @@
 					}
 				}
 			}
-	
+
 			.box-right {
 				.img {
 					height: 107rpx;
-	
+
 					image {
 						width: 107rpx;
 						height: 107rpx;
 					}
 				}
-	
+
 				.called {
 					margin-right: 16rpx;
 					height: 107rpx;
@@ -526,7 +476,8 @@
 			}
 		}
 	}
-	.popup_row{
+
+	.popup_row {
 		// margin-top: 108rpx;
 		height: 440rpx;
 		border-radius: 25rpx;
@@ -534,7 +485,8 @@
 		padding: 24rpx;
 		background-color: #f8f8f8;
 		z-index: 999;
-		.title{
+
+		.title {
 			border-bottom: 2rpx solid #F2F2F2;
 			color: #E63931;
 			font-size: 32rpx;
@@ -542,40 +494,47 @@
 			padding-bottom: 16rpx;
 			display: flex;
 			justify-content: space-between;
+
 			// align-items: center;
-			.cancel{
+			.cancel {
 				margin-left: 52rpx;
 				width: 36rpx;
 				height: 36rpx;
-				image{
+
+				image {
 					width: 36rpx;
 					height: 36rpx;
 				}
 			}
 		}
-		.inpBox{
+
+		.inpBox {
 			margin-top: 52rpx;
 			border: 2px solid #f2f2f2;
 			padding: 12rpx 24rpx;
 			color: #FF9797;
 			border-radius: 8rpx;
+
 			.input-placeholder {
 				// height: 70rpx;
 				font-size: 32rpx;
 				color: #FF9797;
 			}
 		}
-		.inpedit{
+
+		.inpedit {
 			margin-top: 24rpx;
 			margin-left: 14rpx;
 			font-size: 28rpx;
 			color: #FF9797;
 		}
-		.comfirm{
+
+		.comfirm {
 			display: flex;
 			justify-content: flex-end;
 			margin-top: 54rpx;
-			.comfirm1{
+
+			.comfirm1 {
 				padding: 12rpx 24rpx;
 				border-radius: 12rpx;
 				color: #FFFFFF;
@@ -583,6 +542,6 @@
 			}
 		}
 	}
-	/* #endif */
 
+	/* #endif */
 </style>

+ 101 - 67
pages/applic/rescuerecords.vue

@@ -1,47 +1,48 @@
 <template>
 	<view class="container">
 		<uni-swipe-action>
-			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)" v-for="(item,index) in list">
-					<view :style="item.txtStyle" class="list">
-						<view class="box">
-							<view class="box-1">
-								<view class="box-2">
-									<view class="box-top">
-										求救者姓名:{{item.name}}
-									</view>
-									<view class="box-time">
-										求救时间:{{item.add_time}}
-									</view>
+			<uni-swipe-action-item :right-options="options" @click="bindClick" @change="swipeChange($event, item.id)"
+				v-for="(item,index) in list">
+				<view :style="item.txtStyle" class="list">
+					<view class="box">
+						<view class="box-1">
+							<view class="box-2">
+								<view class="box-top">
+									求救者姓名:{{item.name}}
 								</view>
-								<view class="navImg" @click="toNav(item, index)">
-									<image src="../../static/img/img10.png" mode=""></image>
-									<view class="tip">导航</view>
+								<view class="box-time">
+									求救时间:{{item.add_time}}
 								</view>
 							</view>
-					
-							<view class="box-sub-box" v-if="item.status==0">
-								<view class="sub-box1" @click="agree(item,index)">
-									接受
-								</view>
-								<view class="sub-box2" @click="refuse(item,index)">
-									拒绝
-								</view>
+							<view class="navImg" @click="toNav(item, index)">
+								<image src="../../static/img/img10.png" mode=""></image>
+								<view class="tip">导航</view>
 							</view>
-							<view class="box-sub-box" v-if="item.status !==0">
-								<view class="red-font" v-if="item.status == 1">
-									已接受
-								</view>
-								<view class="red-font" v-if="item.status == 2">
-									已拒绝
-								</view>
-								<view class="sub-box3" @click="tocall(item.phone)">
-									<image src="../../static/icon/call.png" mode="" class="call"></image>
-									拨打电话
-								</view>
+						</view>
+
+						<view class="box-sub-box" v-if="item.status == 0">
+							<view class="sub-box1" @click="agree(item,index)">
+								接受
+							</view>
+							<view class="sub-box2" @click="refuse(item,index)">
+								拒绝
 							</view>
-							<!-- <view class="remove" @click="delItem">删除</view> -->
 						</view>
+						<view class="box-sub-box" v-if="item.status === 1">
+							<view class="red-font" v-if="item.status == 1">
+								已接受
+							</view>
+							<view class="red-font" v-if="item.status == -1">
+								已拒绝
+							</view>
+							<view class="sub-box3" @click="tocall(item.phone)">
+								<image src="../../static/icon/call.png" mode="" class="call"></image>
+								拨打电话
+							</view>
+						</view>
+						<!-- <view class="remove" @click="delItem">删除</view> -->
 					</view>
+				</view>
 			</uni-swipe-action-item>
 		</uni-swipe-action>
 
@@ -63,7 +64,7 @@
 				</view>
 			</view>
 		</uni-popup>
-		
+
 		<uni-popup ref="popup1" type="center">
 			<view class="popup-box">
 				<view class="img">
@@ -83,12 +84,12 @@
 							取消
 						</view>
 						<view class="comfirm" @click="comfirm(tmp)">
-							 确认
+							确认
 						</view>
 					</view>
 				</view>
 			</view>
-		
+
 		</uni-popup>
 	</view>
 </template>
@@ -99,6 +100,10 @@
 		getrescue,
 		change_rescue
 	} from '@/api/index.js';
+	import {
+		getRescueList
+	} from '@/api/category.js'
+
 	import empty from '@/components/empty';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import uniPopup from '@/components/uni-popup/uni-popup.vue';
@@ -114,8 +119,8 @@
 		},
 		data() {
 			return {
-				id:'',
-				tmp:'',
+				id: '',
+				tmp: '',
 				options: [{
 					text: '取消',
 					style: {
@@ -140,6 +145,7 @@
 		},
 		onLoad() {
 			this.loadData();
+			// this.getRescueList()
 			let obj = this;
 			try {
 				let locationAddress
@@ -231,12 +237,21 @@
 		},
 
 		methods: {
+			getRescueList() {
+				getRescueList({
+					type: 1,
+					page: 1,
+					limit: 10
+				}).then(res => {
+					console.log(res)
+				})
+			},
 			bindClick(e) {
 				// console.log(333,e)
 				// console.log('e.index',e.index)
 				// console.log('this.tmp',this.tmp)
 				// console.log('点击了' + (e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')
-				if ( e.content.text == '取消' ) {
+				if (e.content.text == '取消') {
 					console.log('点击了左侧取消按钮')
 				} else {
 					console.log('点击了右侧确认按钮')
@@ -245,34 +260,36 @@
 				}
 			},
 			swipeChange(e, id) {
-			// 	// console.log('当前状态:' + open + ',下标:' + index)
+				// 	// console.log('当前状态:' + open + ',下标:' + index)
 				// console.log('index',index)
 				this.id = id
-				console.log('id111111111',id)
-			// 	if ( e == 'right' ) {
-			// 		this.index = index
-			// 		console.log('当前index值:',this.index)
-			// 	}
-			// 	// console.log(222,e)
+				console.log('id111111111', id)
+				// 	if ( e == 'right' ) {
+				// 		this.index = index
+				// 		console.log('当前index值:',this.index)
+				// 	}
+				// 	// console.log(222,e)
 			},
 			// 确认删除吗?
-			comfirm (id) {
-				console.log(9999888,id)
+			comfirm(id) {
+				console.log(9999888, id)
 				deleteList({
 					id: this.id
-				}).then(({ data }) => {
+				}).then(({
+					data
+				}) => {
 					window.location.reload(); //重新刷新页面
 					this.loadData()
 					this.cancel()
 				})
 			},
 			// 取消
-			cancel(){
+			cancel() {
 				this.$refs.popup1.close();
 			},
 			// 打开弹窗
 			open(tmp) {
-				console.log('打开弹窗',tmp)
+				console.log('打开弹窗', tmp)
 				this.$refs.popup1.open(tmp)
 			},
 			// bindClick(){
@@ -286,12 +303,11 @@
 				}
 				// 修改当前对象状态为加载中
 				obj.loadingType = 'loading';
-				getrescue({
+				getRescueList({
 					page: obj.page,
-					limit: obj.limit
-				}).then(({
-					data
-				}) => {
+					limit: obj.limit,
+					type: 1
+				}).then(({data}) => {
 					obj.list = obj.list.concat(data);
 					obj.page++;
 					if (obj.limit == data.length) {
@@ -300,6 +316,20 @@
 						obj.loadingType = 'noMore';
 					}
 				})
+				// getrescue({
+				// 	page: obj.page,
+				// 	limit: obj.limit
+				// }).then(({
+				// 	data
+				// }) => {
+				// 	obj.list = obj.list.concat(data);
+				// 	obj.page++;
+				// 	if (obj.limit == data.length) {
+				// 		obj.loadingType = 'more';
+				// 	} else {
+				// 		obj.loadingType = 'noMore';
+				// 	}
+				// })
 			},
 			// 点击导航
 			toNav(item, index) {
@@ -328,7 +358,8 @@
 				let longitude = this.longitude2
 				let address = this.address
 				console.log('选择腾讯', latitude, longitude)
-				window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
+				window.location.href =
+					`http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
 			},
 			// 调用百度
 			tobaiDuMap() {
@@ -461,6 +492,7 @@
 <style lang="scss">
 	.container {
 		line-height: 1;
+
 		.box {
 			width: 750rpx;
 			background: #FFFFFF;
@@ -569,24 +601,25 @@
 				}
 			}
 		}
+
 		.popup-box {
 			width: 522rpx;
 			height: 605rpx;
 			background-color: #FFFFFF;
 			border-radius: 20rpx;
-		
+
 			.img {
 				border-radius: 20rpx 20rpx 0 0;
 				width: 522rpx;
 				height: 307rpx;
-		
+
 				image {
 					border-radius: 20rpx 20rpx 0 0;
 					width: 522rpx;
 					height: 307rpx;
 				}
 			}
-		
+
 			.mian {
 				display: flex;
 				flex-direction: column;
@@ -595,24 +628,24 @@
 				background-color: #FFFFFF;
 				border-radius: 0 0 20rpx 20rpx;
 				text-align: center;
-		
+
 				.delivery {
 					font-size: 36rpx;
 					color: #333333;
 					// margin-top: 46rpx;
 				}
-		
+
 				.nocancel {
 					font-size: 30rpx;
 					color: #999999;
 					margin-top: 26rpx;
 				}
-		
+
 				.comfirm-box {
 					margin-top: 52rpx;
 					display: flex;
 					// margin-bottom: 32rpx;
-		
+
 					// justify-content: space-around;
 					.cancel {
 						display: flex;
@@ -622,11 +655,11 @@
 						height: 61rpx;
 						border: 1px solid #C90F1B;
 						border-radius: 31rpx;
-		
+
 						font-size: 24rpx;
 						color: #C90F1B;
 					}
-		
+
 					.comfirm {
 						margin-left: 32rpx;
 						display: flex;
@@ -642,6 +675,7 @@
 				}
 			}
 		}
+
 		.popup_row {
 			width: 100%;
 			height: 500rpx;

+ 481 - 555
pages/category/category.vue

@@ -1,20 +1,18 @@
 <template>
 	<view class="content">
-		<view class="top"><image src="../../static/img/jiuzai.png" mode="widthFix" class="bgi"></image></view>
-<!-- 		<view class="top-xtitle">
-			红十字
+		<view class="top">
+			<image src="../../static/img/jiuzai.png" mode="widthFix" class="bgi"></image>
 		</view>
-		<view class="top-title">
-			救护员招募
-		</view> -->
 		<view class="pop-box">公众参与</view>
 		<view class="pop-list">
 			<view class="list-box1" v-for="(item, index) in peoplelist" :key="index" v-if="index < 20">
-				<view class="list-top"><image :src="item.avatar" mode="" class="avatar-img"></image></view>
+				<view class="list-top">
+					<image src="../../static/img/002.png" mode="" class="avatar-img"></image>
+				</view>
 				<view class="nickname">{{ item.name }}</view>
 			</view>
 		</view>
-		<view class="red-box">活动报名</view>
+		<view class="red-box">救在身边报名</view>
 		<!-- 	<view class="people">
 			
 		</view> -->
@@ -24,7 +22,7 @@
 				<input type="text" v-model="name" class="list-input" placeholder="请填写您的姓名" />
 			</view>
 			<view class="list">
-				<view class="list-left">手机 <text>*</text></view>
+				<view class="list-left">手机号码 <text>*</text></view>
 				<input type="text" v-model="phone" class="list-input" placeholder="请填写您的联系方式" />
 			</view>
 			<view class="list" @click="getLocation">
@@ -32,30 +30,28 @@
 				<!-- <picker-address class="box-right" @change="onCityClick">{{ address }}</picker-address> -->
 				<input type="text" v-model="showaddress" class="list-input" placeholder="请选择常用地址" />
 			</view>
-			<!-- <view class="list" @click="Toshow">
+			<view class="list">
 				<view class="list-left">机构 <text>*</text></view>
-				<input type="text" v-model="mechanism" class="list-input" placeholder="请填写您的所在机构" disabled />
-			</view> -->
-
+				<picker @change="bindPickerChange" :range="chooseMechanismList" style="width: 100%;">
+					<input type="text" v-model="mechanism" class="list-input" placeholder="请填写您的所在机构" disabled />
+					<!-- <view class="list-input">{{'请填写您的所在机构'}}</view> -->
+				</picker>
+			</view>
+			<view class="list">
+				<view class="list-left">志愿者编号 / 证书编号</view>
+				<input type="text" v-model="volunteer_id" class="list-input" placeholder="请填写您的志愿者编号 / 证书编号" />
+			</view>
 			<view class="upload-box">
 				<view class="upload-left">证件 <text>*</text></view>
 				<view class="upload-right">
-					<image :src="certificates" mode="" class="upload-img" @click.stop="imgsub" v-if="certificates"></image>
-					<image src="../../static/images/upload.png" class="upload-img" mode="" v-if="!certificates" @click.stop="imgsub"></image>
+					<image :src="certificates" mode="" class="upload-img" @click.stop="imgsub" v-if="certificates">
+					</image>
+					<image src="../../static/images/upload.png" class="upload-img" mode="" v-if="!certificates"
+						@click.stop="imgsub"></image>
 				</view>
 			</view>
-			<zhilin-picker
-				v-model="show"
-				:title="title"
-				:data="list"
-				:initSelected="initSelected"
-				:showSearch="true"
-				@change="onChange"
-				@searchInput="onSearchInput"
-				@confirm="onConfirm1"
-			/>
 		</view>
-		<view class="sub" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view>
+		<view class="sub" :class="{ action: loding }" @click="!loding ? applyRescuer() : ''">提交申请</view>
 	</view>
 </template>
 
@@ -68,323 +64,237 @@
 		saveUrl,
 		interceptor
 	} from '@/utils/loginUtils.js';
-import { mechanism } from '@/api/ask.js';
-import { getNumber } from '@/api/index.js';
-import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
-import zhilinPicker from '@/components/zhilin-picker/zhilin-picker.vue';
-import { upload, addrescuer } from '@/api/ask.js';
-export default {
-	components: {
-		pickerAddress
-	},
-	data() {
-		return {
-			longitude4: '',
-			latitude4: '',
-			longitude: '',
-			latitude: '',
-			name: '',
-			phone: '',
-			mechanism: '',
-			title: '选择机构',
-			show: false,
-			list: [],
-			initSelected: [],
-			searchVal: '',
-			address: '',
-			certificates: '',
-			loding: false, //是否提交中
-			showaddress: '', //显示用的地址
-			count: 0,
-			peoplelist: [],
-			addressData: {
+	import {
+		mechanism
+	} from '@/api/ask.js';
+	import {
+		getNumber,
+		getInstitution
+	} from '@/api/index.js';
+	import {
+		upload,
+		addrescuer
+	} from '@/api/ask.js';
+	import {
+		getMechanismList,
+		applyRescuer,
+		getRescuerList,
+		getApplyList
+	} from '@/api/category.js'
+
+	import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
+	export default {
+		components: {
+			pickerAddress
+		},
+		data() {
+			return {
+				longitude4: '',
+				latitude4: '',
+				longitude: '',
+				latitude: '',
 				name: '',
-				mobile: '',
-				latitude: 0, //纬度
-				longitude: 0, //经度
-				address: {
-					province: '',
-					city: '',
-					district: '',
-					detail: ''
-				},
-				area: '',
-				default: false
-			}
-		};
-	},
-	onLoad() {
-		let obj = this;
-		console.log('开始加载事件');
-		// obj.loadBaseData();
-		// obj.loadData();
-		try {
-			let locationAddress
-			// #ifdef H5
-			let wxOjb = require('jweixin-module');
-			locationAddress = wxOjb.getLocation;
-			// #endif
-			// #ifdef MP
-			locationAddress = uni.getLocation;
-			// #endif
-			wxOjb.ready(() => {
-				console.log('加载完毕注册事件');
-				locationAddress({
-					type: 'gcj02',
-					success: function(res) {
-						console.log('获取经纬度', res);
-						obj.longitude = res.longitude
-						obj.latitude = res.latitude
-						obj.marker = [{
-							latitude: obj.latitude,
-							longitude: obj.longitude,
-							iconPath: '/static/img/img19.png',
-							width: '45',
-							height: '45',
-						}, ]
-						obj.loadData();
+				phone: '',
+				mechanism: '',
+				title: '选择机构',
+				show: false,
+				list: [],
+				initSelected: [],
+				searchVal: '',
+				address: '',
+				certificates: '',
+				loding: false, //是否提交中
+				showaddress: '', //显示用的地址
+				count: 0,
+				peoplelist: [],
+				addressData: {
+					name: '',
+					mobile: '',
+					latitude: 0, //纬度
+					longitude: 0, //经度
+					address: {
+						province: '',
+						city: '',
+						district: '',
+						detail: ''
 					},
-					fail(e) {
-						console.log('失败', e);
-						window.location.reload();
-					}
-				});
-			})
-		
-		} catch (e) {
-			console.log(e);
-			let locationAddress
-			// #ifdef H5
-			let wxOjb = require('jweixin-module');
-			locationAddress = wxOjb.getLocation;
-			// #endif
-			// #ifdef MP
-			locationAddress = uni.getLocation;
-			// #endif
-			wxOjb.ready(() => {
-				console.log('加载完毕注册事件');
-		
-				locationAddress({
-					type: 'gcj02',
-					success: function(res) {
-						console.log('获取经纬度1', res);
-						obj.longitude4 = res.longitude
-						obj.latitude4 = res.latitude
-						obj.loadData();
-					},
-					fail(e) {
-						console.log('失败', e);
-					}
-				});
-			})
-		
-		}
-	},
-	computed: {
-		...mapState('user', ['hasLogin', 'userInfo']),
-	},
-	onShow() {
-		this.loadData();
-		if (this.hasLogin) {
-			// this.loadBaseData();
-		} else {
-			saveUrl();
-			uni.showModal({
-				title: '登录',
-				content: '您未登录,是否马上登陆?',
-				success: e => {
-					if (e.confirm) {
-						interceptor();
-					}
+					area: '',
+					default: false
 				},
-				fail: e => {
-					console.log(e);
-				}
-			});
-		}
-	},
-	watch: {
-		searchVal() {
-			this.ListDate();
-		}
-	},
-	methods: {
-		tosearch() {
-			console.log(123);
-			uni.navigateTo({
-				url: '/pages/category/search'
-			});
-		},
-		async loadData() {
-			let obj = this;
-			getNumber({}).then(({ data }) => {
-				// console.log(12)
-				// console.log(data)
-				obj.count = data.count;
-				obj.peoplelist = data.data;
-			});
-		},
-		// 选择当前位置
-		getLocation() {
-			console.log('选择当前位置');
-			let obj = this;
-			uni.chooseLocation({
-				latitude: obj.latitude4,
-				longitude: obj.longitude4,
-				success: function(res) {
-					obj.addressData.area = res.name;
-					console.log('位置名称:' + res.name);
-					console.log('详细地址:' + res.address);
-					console.log('纬度:' + res.latitude);
-					console.log('经度:' + res.longitude);
-					obj.addressData.latitude = res.latitude;
-					obj.addressData.longitude = res.longitude;
-					// let	dizhi = obj.addressData.latitude + ','+ obj.addressData.longitude;
-					obj.showaddress = res.address;
-				}
-			});
-		},
-		// 机构
-		Toshow() {
-			console.log('点击选择机构');
-			this.show = true;
+				chooseMechanismList: [], //供选择的机构列表
+				mechanismList: [], //完整机构列表
+				volunteer_id: '', //志愿者标号
+				institution_id: '', //机构id
+			};
 		},
-		onChange(val) {
+		onLoad() {
 			let obj = this;
-			console.log(val, 'onChange');
-			// let arr = val.split(',');
-			// console.log(999,arr)
-			// obj.hospital = arr[1];
-			// obj.hospital_id = arr[0];
-			// obj.city = arr[2];
-			// obj.city_id = arr[3];
-			// obj.district = arr[4];
-			// obj.district_id = arr[5];
-			// obj.province = arr[6];
-			// obj.province_id = arr[7];
-			// obj.addr = obj.province + obj.city + obj.district;
-			// console.log(obj.hospital,obj.hospital_id)
-			// console.log(obj.city,obj.city_id)
-			// console.log(obj.district,obj.district_id)
-			// console.log(obj.province,obj.province_id)
+			obj.name = obj.userInfo.username || ''
+			obj.phone = obj.userInfo.mobile
+			console.log('开始加载事件');
 		},
-		onSearchInput(val) {
-			this.searchVal = val.value;
+		computed: {
+			...mapState('user', ['hasLogin', 'userInfo']),
 		},
-		// 选择机构
-		ListDate() {
-			let obj = this;
-			let data = '';
-			console.log('obj.searchVal', obj.searchVal);
-			if (!obj.searchVal) {
-				console.log('!obj.searchVal');
-				data = {
-					keyword: '',
-					// sort:'id desc',
-					page: 1,
-					limit: 1500
-				};
-			} else {
-				console.log('else');
-				console.log('当前input值', obj.searchVal);
-				data = {
-					keyword: obj.searchVal,
-					// sort:'id desc',
-					page: 1,
-					limit: 1500
-				};
+		onShow() {
+			this.loadData();
+			this.getApplyList()
+			this.getMechanismList()
+			if (this.hasLogin) {} else {
+				saveUrl();
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
 			}
-			mechanism(data).then(data => {
-				console.log('请求成功', data);
-				this.list = data.data.map(item => item);
-				// this.show = true
-			});
-			// getHospitalList(data).then(e => {
-			// 	obj.list = e.data.list;
-			// }).catch((e) => {
-			// 	console.log(e)
-			// });
-		},
-		onConfirm1(e) {
-			console.log('点击确认');
-			// let arr = e
-			this.mechanism = e.split(',')[1];
-			this.list = [];
 		},
-		imgsub() {
-			console.log('imgsub');
-			upload({
-				filename: ''
-			}).then(data => {
-				this.certificates = data[0].url;
-			});
-		},
-		join() {
-			let obj = this;
-			if (obj.name == '') {
-				obj.$api.msg('请输入您的姓名');
-				return;
+		watch: {
+			searchVal() {
+				this.ListDate();
 			}
+		},
+		methods: {
+			getApplyList() {
+				getApplyList().then(res => {
+					console.log(res,'getApplyList')
+				})
+			},
+			// 获取救援者列表
+			getRescuerList(lat, lon) {
+				getRescuerList({
+					page: 1,
+					limit: 20,
+					latitude: lat,
+					longitude: lon,
+				}).then(res => {
+					console.log(res, 'getRescuerList++++++++++')
+					this.peoplelist = res.data
+				})
+			},
+			// 获取机构
+			getMechanismList() {
+				getMechanismList().then(({
+					data
+				}) => {
+					this.mechanismList = data
+					if (data) {
+						this.chooseMechanismList = data.map(item => {
+							return item.name
+						})
+					}
+				})
+			},
+			// 选择机构
+			bindPickerChange(e) {
+				this.mechanism = this.chooseMechanismList[e.detail.value]
+				this.institution_id = this.mechanismList[e.detail.value].id
+			},
+			applyRescuer() {
+				let obj = this
+				if (obj.name == '') {
+					obj.$api.msg('请输入您的姓名');
+					return;
+				}
 
-			const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
-			if (!reg.test(obj.phone)) {
-				obj.$api.msg('请填写正确的手机号码');
-				return;
-			}
-			if (obj.showaddress == '') {
-				obj.$api.msg('请选择您的所在地区');
-				return;
-			}
-
-			// if (obj.mechanism == '') {
-			// 	obj.$api.msg('请输入机构关键字');
-			// 	return;
-			// }
-
-			if (obj.certificates == '') {
-				obj.$api.msg('请上传救护员证书或身份证');
-				return;
-			}
-			obj.loding = true;
-			addrescuer({
-				name: obj.name,
-				phone: obj.phone,
-				address: obj.showaddress,
-				latitude: obj.addressData.latitude,
-				longitude: obj.addressData.longitude,
-				mechanism: obj.mechanism,
-				certificates: obj.certificates
-			})
-				.then(data => {
+				const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
+				if (!reg.test(obj.phone)) {
+					obj.$api.msg('请填写正确的手机号码');
+					return;
+				}
+				if (obj.showaddress == '') {
+					obj.$api.msg('请选择您的所在地区');
+					return;
+				}
+				if (obj.mechanism == '') {
+					obj.$api.msg('请选择机构');
+					return;
+				}
+				if (obj.certificates == '') {
+					obj.$api.msg('请上传救护员证书或身份证');
+					return;
+				}
+				let data = {
+					name: obj.name,
+					phone: obj.phone,
+					institution_id: obj.institution_id,
+					volunteer_id: obj.volunteer_id,
+					address: obj.showaddress,
+					latitude: obj.addressData.latitude,
+					longitude: obj.addressData.longitude,
+					certificateimage: obj.certificates
+				}
+				applyRescuer(data).then(res => {
+					console.log(res, '申请+++++++++')
 					obj.loding = false;
-
-					if (data.status == 200) {
-						(obj.name = ''),
-							(obj.phone = ''),
-							(obj.showaddress = ''),
-							(obj.certificates = ''),
-							(obj.mechanism = ''),
-							(obj.addressData.latitude = ''),
-							(obj.addressData.longitude = ''),
-							uni.removeStorage({
-								key: 'institution',
-								success: function(res) {
-									console.log('success');
-								}
-							});
-						uni.navigateTo({
-							url: '../joinSuc/joinNow'
-						});
-					} else if (data.status == 400) {
-						obj.$api.msg(data.msg);
-					}
+					uni.navigateTo({
+						url: '../joinSuc/joinNow'
+					});
 				})
-				.catch(err => {
-					console.log(err);
+			},
+			async loadData() {
+				let obj = this;
+				// obj.getRescuerList()
+				obj.getLocal()
+			},
+			// 选择当前位置
+			getLocation() {
+				console.log('选择当前位置');
+				let obj = this;
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res)
+						obj.addressData.area = res.name;
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						obj.addressData.latitude = res.latitude;
+						obj.addressData.longitude = res.longitude;
+						// let	dizhi = obj.addressData.latitude + ','+ obj.addressData.longitude;
+						obj.showaddress = res.address;
+					}
+				});
+			},
+			onChange(val) {
+				let obj = this;
+				console.log(val, 'onChange');
+			},
+			onSearchInput(val) {
+				this.searchVal = val.value;
+			},
+			// 上传图片
+			imgsub() {
+				console.log('imgsub');
+				upload({
+					filename: ''
+				}).then(data => {
+					this.certificates = data[0].fullurl;
 				});
+			},
+			// 获取本地坐标
+			getLocal() {
+				let obj = this;
+				console.log('ddddddddddddddddddddddddd')
+				uni.getLocation({
+					type: 'gcj02',
+					success(e) {
+						console.log(e)
+						obj.latitude4 = Math.abs(e.latitude)
+						obj.longitude4 =  Math.abs(e.longitude)
+						obj.getRescuerList(obj.latitude4,obj.longitude4)
+					}
+				})
+			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
@@ -392,270 +302,286 @@ export default {
 		// background-color: #FD3B34;
 		background-image: url();
 	}
-.content {
-	line-height: 1;
-	// background-color: #FD3B34;
-	.top {
-		width: 750rpx;
-		
-		.bgi {
-			display: block;
-			
-			width: 564rpx;
-			height: 678rpx;
-			margin: 53rpx auto;
-			// position: relative;
-			// top: -20rpx;
+
+	.content {
+		line-height: 1;
+
+		// background-color: #FD3B34;
+		.top {
+			width: 750rpx;
+
+			.bgi {
+				display: block;
+
+				width: 564rpx;
+				height: 678rpx;
+				margin: 53rpx auto;
+				// position: relative;
+				// top: -20rpx;
+			}
 		}
-	}
-	.top-xtitle {
-		font-size: 65rpx;
-		font-family: Microsoft YaHei;
-		font-weight: bold;
-		color: #FFFFFF;
-		line-height: 110rpx;
-		text-shadow: 0px 5px 8px rgba(96, 1, 0, 0.61);
-		text-align: center;
-	}
-	.top-title {
-		font-size: 85rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #FD424B;
-		font-family: Microsoft YaHei;
-		font-weight: bold;
-		color: #FFFFFF;
-		line-height: 110rpx;
-		text-shadow: 0px 5px 8px rgba(96, 1, 0, 0.61);
-		text-align: center;
-		padding-bottom: 69rpx;
-	}
 
-	.pop-box {
-		padding-top: 31rpx;
-		margin: 0 auto;
-		position: relative;
-		z-index: 99;
-		width: 156rpx;
-		height: 36rpx;
-		font-size: 38rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #000;
-		&::before {
-			content: '';
-			width: 220rpx;
-			height: 17rpx;
-			background: rgba(254, 166, 78, 1);
-			opacity: 0.26;
-			position: absolute;
-			bottom: -35rpx;
-			left: -40rpx;
+		.top-xtitle {
+			font-size: 65rpx;
+			font-family: Microsoft YaHei;
+			font-weight: bold;
+			color: #FFFFFF;
+			line-height: 110rpx;
+			text-shadow: 0px 5px 8px rgba(96, 1, 0, 0.61);
+			text-align: center;
 		}
-	}
 
-	.red-box {
-		padding-top: 31rpx;
-		margin: 0 auto ;
-		position: relative;
-		z-index: 99;
-		width: 156rpx;
-		height: 36rpx;
-		font-size: 38rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #000;
-		&::after {
-			content: '';
-			width: 220rpx;
-			height: 17rpx;
-			background:rgba(254, 166, 78, 1);
-			opacity: 0.26;
-			position: absolute;
-			bottom: -35rpx;
-			left: -40rpx;
+		.top-title {
+			font-size: 85rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #FD424B;
+			font-family: Microsoft YaHei;
+			font-weight: bold;
+			color: #FFFFFF;
+			line-height: 110rpx;
+			text-shadow: 0px 5px 8px rgba(96, 1, 0, 0.61);
+			text-align: center;
+			padding-bottom: 69rpx;
 		}
-	}
 
-	.red-box2 {
-		position: relative;
-		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;
-		margin: -80rpx auto 0;
-		position: relative;
-		z-index: 1;
-	}
+		.pop-box {
+			padding-top: 31rpx;
+			margin: 0 auto;
+			position: relative;
+			z-index: 99;
+			width: 156rpx;
+			height: 36rpx;
+			font-size: 38rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #000;
 
-	.pop-list {
-		width: 686rpx;
-		background: #ffffff;
-		border-radius: 29rpx;
-		position: relative;
-		margin: -33rpx auto 78rpx;
-		padding: 150rpx 0rpx 30rpx 30rpx;
-		display: flex;
-		flex-wrap: wrap;
-		box-shadow: 0px 10rpx 20rpx 0px rgba(254, 0, 8, 0.28);
-		.list-box1 {
+			&::before {
+				content: '';
+				width: 220rpx;
+				height: 17rpx;
+				background: rgba(254, 166, 78, 1);
+				opacity: 0.26;
+				position: absolute;
+				bottom: -35rpx;
+				left: -40rpx;
+			}
+		}
+
+		.red-box {
+			padding-top: 31rpx;
+			margin: 0 auto;
+			position: relative;
+			z-index: 99;
+			width: 300rpx;
 			text-align: center;
-			margin-right: 30rpx;
-			margin-bottom: 30rpx;
+			height: 36rpx;
+			font-size: 38rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #000;
 
-			.list-top {
-				width: 100rpx;
-				height: 100rpx;
+			&::after {
+				content: '';
+				width: 300rpx;
+				height: 17rpx;
+				background: rgba(254, 166, 78, 1);
+				opacity: 0.26;
+				position: absolute;
+				bottom: -35rpx;
+				left: 0rpx;
+				right: 0;
+				margin: auto;
+			}
+		}
+
+		.red-box2 {
+			position: relative;
+			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;
+			margin: -80rpx auto 0;
+			position: relative;
+			z-index: 1;
+		}
+
+		.pop-list {
+			width: 686rpx;
+			background: #ffffff;
+			border-radius: 29rpx;
+			position: relative;
+			margin: -33rpx auto 78rpx;
+			padding: 150rpx 0rpx 30rpx 30rpx;
+			display: flex;
+			flex-wrap: wrap;
+			box-shadow: 0px 10rpx 20rpx 0px rgba(254, 0, 8, 0.28);
 
-				.avatar-img {
+			.list-box1 {
+				text-align: center;
+				margin-right: 30rpx;
+				margin-bottom: 30rpx;
+
+				.list-top {
 					width: 100rpx;
 					height: 100rpx;
-					border-radius: 50%;
+
+					.avatar-img {
+						width: 100rpx;
+						height: 100rpx;
+						border-radius: 50%;
+					}
+				}
+
+				.nickname {
+					margin-top: 12rpx;
 				}
-			}
-			.nickname {
-				margin-top: 12rpx;
 			}
 		}
-	}
 
-	.list-box {
-		width: 686rpx;
-		background: #ffffff;
-		border-radius: 29rpx;
-		position: relative;
-		margin: -33rpx auto 0;
-		padding: 100rpx 30rpx 0rpx 30rpx;
-		display: flex;
-		flex-wrap: wrap;
-		box-shadow: 0px 10rpx 20rpx 0px rgba(254, 0, 8, 0.28);
-		.upload-box {
-			width: 100%;
-			height: 290rpx;
+		.list-box {
+			width: 686rpx;
 			background: #ffffff;
-			// border: 1px solid #E63931;
-			border-radius: 15rpx;
+			border-radius: 29rpx;
+			position: relative;
+			margin: -33rpx auto 0;
+			padding: 100rpx 30rpx 0rpx 30rpx;
 			display: flex;
-			flex-direction: column;
-			padding-top: 24rpx;
-			margin: 0 auto 50rpx;
-
-			.upload-left {
-				font-weight: 400;
-				color: #000;
-				text {
-					color: #FD424B;
-					font-size: 30rpx;
-				}
-			}
+			flex-wrap: wrap;
+			box-shadow: 0px 10rpx 20rpx 0px rgba(254, 0, 8, 0.28);
 
-			.upload-right {
-				margin-top: 16rpx;
+			.upload-box {
 				width: 100%;
-				height: 100%;
-				border: 1px solid #888888;
+				height: 290rpx;
+				background: #ffffff;
+				// border: 1px solid #E63931;
 				border-radius: 15rpx;
-				flex: 1;
 				display: flex;
-				align-items: center;
-				justify-content: center;
-
-				.upload-img {
-					width: 102rpx;
-					height: 102rpx;
-					// border: 1px solid #888888;
-					// border-radius: 3rpx;
-					// width: 133rpx;
-					// height: 133rpx;
-					// margin-top: 44rpx;
-				}
-			}
-		}
+				flex-direction: column;
+				padding-top: 24rpx;
+				margin: 0 auto 50rpx;
 
-		.list {
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			width: 100%;
-			margin-top: 32rpx;
-			// height: 133rpx;
+				.upload-left {
+					font-weight: 400;
+					color: #000;
 
-			.list-left {
-				width: 100%;
-				text-align: left;
-				color: #000;
-				text {
-					color: #FD424B;
-					font-size: 30rpx;
+					text {
+						color: #FD424B;
+						font-size: 30rpx;
+					}
 				}
-			}
 
-			input {
-				height: 66rpx;
-				// line-height: 66rpx;
-				margin-top: 32rpx;
-				// height: 88rpx;
-			}
+				.upload-right {
+					margin-top: 16rpx;
+					width: 100%;
+					height: 100%;
+					border: 1px solid #888888;
+					border-radius: 15rpx;
+					flex: 1;
+					display: flex;
+					align-items: center;
+					justify-content: center;
 
-			.list-input {
-				padding-left: 24rpx;
-				// margin: 12rpx 0 ;
+					.upload-img {
+						width: 102rpx;
+						height: 102rpx;
+						// border: 1px solid #888888;
+						// border-radius: 3rpx;
+						// width: 133rpx;
+						// height: 133rpx;
+						// margin-top: 44rpx;
+					}
+				}
+			}
 
-				line-height: 66rpx;
+			.list {
 				display: flex;
+				flex-direction: column;
 				align-items: center;
 				width: 100%;
-				font-size: 26rpx;
-				flex: 1;
-				color: #000;
-				border: 1rpx solid #929292;
-				border-radius: 15rpx;
-				text-align: left;
+				margin-top: 32rpx;
+				// height: 133rpx;
+
+				.list-left {
+					width: 100%;
+					text-align: left;
+					color: #000;
 
-				.input-placeholder {
-					height: 70rpx;
-					color: #929292;
+					text {
+						color: #FD424B;
+						font-size: 30rpx;
+					}
+				}
+
+				input {
+					height: 66rpx;
+					// line-height: 66rpx;
+					margin-top: 32rpx;
+					// height: 88rpx;
+				}
+
+				.list-input {
+					padding-left: 24rpx;
+					// margin: 12rpx 0 ;
+					height: 66rpx;
+					line-height: 66rpx;
+					// display: flex;
+					// align-items: center;
+					width: 100%;
 					font-size: 26rpx;
+					// flex: 1;
+					color: #000;
+					border: 1rpx solid #929292;
+					border-radius: 15rpx;
+					text-align: left;
+
+					.input-placeholder {
+						// height: 70rpx;
+						color: #929292;
+						font-size: 26rpx;
+					}
 				}
-			}
 
-			.box-right {
-				display: flex;
-				align-items: center;
-				padding-left: 24rpx;
-				height: 66rpx;
-				line-height: 66rpx;
-				border: 1rpx solid #f3afad;
-				border-radius: 22rpx;
-				margin: 32rpx 36rpx 0 36rpx;
-
-				width: 96%;
-				font-size: 36rpx;
-				color: #ff9797;
-				text-align: left;
-				line-height: 1;
+				.box-right {
+					display: flex;
+					align-items: center;
+					padding-left: 24rpx;
+					height: 66rpx;
+					line-height: 66rpx;
+					border: 1rpx solid #f3afad;
+					border-radius: 22rpx;
+					margin: 32rpx 36rpx 0 36rpx;
+
+					width: 96%;
+					font-size: 36rpx;
+					color: #ff9797;
+					text-align: left;
+					line-height: 1;
+				}
 			}
 		}
-	}
-	.sub {
-		width: 690rpx;
-		height: 83rpx;
-		background: #f95349;
-		border-radius: 42rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #FFFFFF;
-		line-height: 83rpx;
-		text-align: center;
-		margin: 53rpx auto 60rpx;
-		&.action {
-			background: #999999;
+
+		.sub {
+			width: 690rpx;
+			height: 83rpx;
+			background: #f95349;
+			border-radius: 42rpx;
+			font-size: 32rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #FFFFFF;
+			line-height: 83rpx;
+			text-align: center;
+			margin: 53rpx auto 60rpx;
+
+			&.action {
+				background: #999999;
+			}
 		}
 	}
-}
 </style>

+ 2 - 4
pages/form/donaSuccess.vue

@@ -192,11 +192,9 @@ export default {
 			let obj = this;
 			// let money = obj.money;
 			let item = {
-				link: 'http://xg.igxys.com/index/pages/form/donaSuccess?money=' + obj.money + '&name=' + encodeURI(obj.name) + '&time=' + encodeURI(obj.add_time),
-				// link: 'http://xg.igxys.com/index/#/pages/form/donaSuccess?money=' + obj.money + '&name=' + encodeURI(obj.name) + '&time=' + encodeURI(obj.add_time), // 分享链接
-				imgUrl: 'http://xg.igxys.com/index/static/img/002.png',
+				link: 'http://slj.igxys.com/index/#/pages/form/donaSuccess?money=' + obj.money + '&name=' + encodeURI(obj.name) + '&time=' + encodeURI(obj.add_time), // 分享链接
+				imgUrl: 'http://slj.igxys.com/index/static/img/002.png',
 				desc: '弘扬红十字精神,传播红十字观念,宣传红十字工作,这是一个汇聚爱心、救助之家力量的平台!',
-				// desc: 'http://xg.igxys.com/index/#/pages/form/donaSuccess?money=' + obj.money + '&name=' + encodeURI(obj.name) + '&time=' + encodeURI(obj.add_time),
 				title: '来自孝感市红十字会的感谢信',
 				success: console.log('分享加载成功')
 			};

+ 827 - 210
pages/index/index.vue

@@ -1,70 +1,45 @@
 <template>
 	<view class="content">
-		<view class="bg-img">
-			<image src="../../static/img/ctbt.png" mode=""></image>
+		<!-- 轮播 -->
+		<view class="carousel-section">
+			<swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
+				<swiper-item v-for="item in carouselList" :key="item.id">
+					<!-- #ifdef H5 -->
+					<image :src="baseURL + item.image"></image>
+					<!-- #endif -->
+
+				</swiper-item>
+			</swiper>
 		</view>
-		<view class="over-content">
-			<view class="item-wrapper" style="height: 318rpx;padding: 70rpx 34rpx 0;">
-				<view class="item-tit">
-					线上捐款
-				</view>
-				<view class="item-info">
-					孝感市红十字会现已开通线上捐款通道 ,点击下方按钮可直接进行线上捐款。
-				</view>
-				<view class="item-btn flex" >
-					<image src="../../static/img/wings-left.png" mode="" class="xcb"></image>
-					<view class="item-btn-btn" @click="goto()">
-						立即捐款
-					</view>
-					<image src="../../static/img/wings-right.png" mode="" class="xcb"></image>
-				</view>
+		<!-- 上半部分菜单 -->
+		<view class="box-top"></view>
+		<view class="top-box flex">
+			<view class="top-item" v-for="item in navList" @click="navTo(item.path)">
+				<view class="item-tit">{{item.tit}}</view>
+				<view class="item-content">{{item.content}}</view>
+				<image :src="item.bgimg" mode="" class="item-logo"
+					:style="{width:item.bgwidth,height:item.bgheight,top:item.bgtop,left:item.bgleft}"></image>
 			</view>
-			
-			<view class="item-wrapper" style="height: 259rpx;padding: 60rpx 34rpx;">
-				<view class="item-tit">
-					银行转账
-				</view>
-				<view class="item-info">
-					<view class="">户名:孝感市红十字会</view>
-					<view class="">银行账户:42001688608050002590</view>
-					<view class="">开户行:建行孝感直属支行</view>
-				</view>
+		</view>
+		<!-- 下半部分菜单 -->
+		<view class="bottom-box flex">
+			<view class="btm-left" @click="navTo('/pages/applic/location')">
+				<view class="tit">救在身边救护员</view>
+				<view class="left-content">实时救护,就在身边</view>
+				<image src="../../static/icon/tb-5.png" mode="" class="bglogo"></image>
 			</view>
-			<view class="item-wrapper" style="height: 259rpx;padding: 40rpx 34rpx;">
-				<view class="item-tit">
-					线下捐赠
+			<view class="btm-right">
+				<view class="b-l-item" @click="navTo('/pages/applic/aid')">
+					<view class="tit">救护站</view>
+					<view class="left-content">附近的救护站都在这里</view>
+					<image src="../../static/icon/tb-6.png" mode="" class="right-logo"></image>
 				</view>
-				<view class="item-info">
-					<!-- <view class="">负责人:捐款杨敏,捐物宋欢</view> -->
-					<view class="">咨询电话:捐款 0712-2875087</view>
-					<view class="" style="padding-left: 160rpx;">捐物 0712-2851023</view>
-					<view class="">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:孝感市城站路75号</view>
+				<view class="b-l-item" @click="navTo('/pages/applic/aed')">
+					<view class="tit">智能AED</view>
+					<view class="left-content">查找附近AED设备</view>
+					<image src="../../static/icon/tb-7.png" mode="" class="right-logo right-logo-2"></image>
 				</view>
 			</view>
-			<view class="item-wrapper" style="height: 410rpx;">
-				<view class="item-tit">
-					爱心榜
-				</view>
-				<scroll-view class="tab-wrap" >
-					<view class="empty" style="width: 100%;height: 100%;text-align: center;line-height: 220rpx;font-size: 32rpx;color: #ed4530;" v-if="loveList.length == 0">
-						暂无捐款数据
-					</view>
-					<view class="tab-item flex" v-for="item in loveList" v-if="loveList.length > 0">
-						<view class="tab-item-name clamp" style="width: 200rpx;">{{item.donate_er}}</view>
-						<view class="tab-item-time clamp" style="width: 180rpx;text-align: center;">{{item.pay_time | getTime}}</view>           
-						<view class="tab-item-num clamp" style="width: 180rpx;text-align: right;">¥{{item.money}}</view>
-					</view>
-					<!-- <uni-load-more :status="loadingType" v-if="loveList.length > 0"></uni-load-more> -->
-				</scroll-view>
-				<!-- <view class="tab-wrap">
-					
-					<view class="tab-item flex" v-for="item in 7">
-						<view class="tab-item-name">强儿</view>
-						<view class="tab-item-time">2021/11/20</view>           
-						<view class="tab-item-num">¥200</view>
-					</view>
-				</view> -->
-			</view>
 		</view>
 	</view>
 </template>
@@ -77,7 +52,8 @@
 		getDistance,
 		getListMechanism,
 		getdis,
-		tocall
+		tocall,
+		getCompany
 	} from '@/api/index.js';
 	import {
 		saveUrl,
@@ -92,8 +68,6 @@
 	} from '@/api/user.js';
 	import uniPopup from '@/components/uni-popup/uni-popup.vue';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import empty from '@/components/empty';
-	
 	import {
 		getLoca
 	} from '@/utils/wxAuthorized.js';
@@ -101,204 +75,847 @@
 		getcomAddress
 	} from '@/api/index.js';
 	import topTitle from '../../components/top-title/top-title.vue';
-	// import { getInfo,getWxconfig } from '@/api/wx.js'
-	import store from '@/store/index.js';
-	import { loveList } from '@/api/order.js'
 	export default {
 		components: {
 			uniPopup,
 			uniLoadMore,
-			topTitle,
-			empty
-		},
-		filters: {
-			getTime(val) {
-				let date = new Date(val * 1000);
-				let Y = date.getFullYear();
-				let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
-				let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
-				return Y + '/' + M + '/' + D;
-			},
+			topTitle
 		},
 		data() {
 			return {
+				navList: [{
+						tit: '我要报名',
+						content: '志愿者捐献者报名',
+						path: '/pages/applic/applicList',
+						bgimg: '../../static/icon/tb-1.png',
+						bgwidth: '84rpx',
+						bgheight: '111rpx',
+						bgtop: '84rpx',
+						bgleft: '210rpx'
+					}, {
+						tit: '红十字事业',
+						content: '红十字事业介绍',
+						path: '/pages/applic/cause',
+						bgimg: '../../static/icon/tb-2.png',
+						bgwidth: '128rpx',
+						bgheight: '127rpx',
+						bgtop: '69rpx',
+						bgleft: '181rpx'
+					},
+					{
+						tit: '我要捐赠',
+						content: '在线捐款渠道',
+						path: '/pages/applic/love',
+						bgimg: '../../static/icon/tb-3.png',
+						bgwidth: '120rpx',
+						bgheight: '120rpx',
+						bgtop: '75rpx',
+						bgleft: '192rpx'
+					},
+					{
+						tit: '红十字知识',
+						content: '急救知识科普',
+						path: '/pages/applic/science',
+						bgimg: '../../static/icon/tb-4.png',
+						bgwidth: '120rpx',
+						bgheight: '120rpx',
+						bgtop: '75rpx',
+						bgleft: '192rpx'
+					}
+				],
 				carouselList: [], //轮播
-				loveList: [],//
-				loadingType: 'more',
-				page: 1,
-				limit: 30,
-				timer: '',
 			};
 		},
 		onShow() {
 			saveUrl();
+			// let token = uni.getStorageSync('token');
 			console.log(11, this);
-			
-			if (!this.hasLogin) {
+			console.log(this.userInfo, 'this.userInfo++++++++++++++++')
+			if (!this.userInfo.id) {
 				// 登录拦截
-				interceptor();
+
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						if (e.confirm) {
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
 			}
-			
+			this.loadData();
+			getCompany().then(res => {
+				console.log(res)
+			})
 		},
 		onLoad() {
-			uni.hideTabBar()
 			saveUrl();
-			this.getLoveList()			
 		},
 		computed: {
-			...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
+			...mapState('user', ['userInfo', 'hasLogin']),
+			...mapState(['baseURL']),
 		},
-		// 下拉加载
 		methods: {
-			goto() {
-				// uni.showModal({
-				// 	title: '提示',
-				// 	content: '在线捐款渠道正在建设中'
-				// })
-				this.navto('/pages/applic/contribution')
+			...mapMutations('user', ['setUserInfo']),
+			//提示
+			tishi() {
+				uni.showModal({
+					title: '提示',
+					content: '获取当前位置信息失败,是否刷新页面。',
+					success: function(res) {
+						if (res.confirm) {
+							window.location.reload();
+							console.log('用户点击确定');
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				})
 			},
-			gundong() {
+			loadData() {
 				let obj = this;
-				if(obj.timer) {
-					clearTimeout(obj.timer)
-				}
-				obj.timer = setTimeout(() => {
-					obj.loveList.push(obj.loveList.shift());
-					// console.log(obj.moreJxList)
-					obj.gundong();
-				}, 2000);
+				loadIndexs({}).then(({
+					data
+				}) => {
+					obj.carouselList = data.banner
+					// obj.carouselList = data.banner; //轮播图
+				});
 			},
-			navto(url) {
+			navTo(url) {
 				uni.navigateTo({
-					url,
-					fail() {
-						uni.switchTab({
-							url
-						})
-					}
-				})
+					url
+				});
 			},
-			// 获取爱心榜数据
-			getLoveList() {
-				let obj = this
-				if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
-					return
-				}
-				obj.loadingType = 'loading'
-				loveList({
-					page: obj.page,
-					limit: obj.limit
-				}).then(({data}) => {
-					obj.loveList = obj.loveList.concat(data.list)
-					obj.gundong()
-					// obj.page++
-					// if(data.list.length == obj.limit) {
-					// 	obj.loadingType = 'more'
-					// }else {
-					// 	obj.loadingType = 'noMore'
-					// }
-				})
-			}
 		}
 	};
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
+	a {
+		text-decoration: none;
+		color: #5f5f5f;
+	}
+
 	.content {
-		position: relative;
+		// line-height: 1;
+		background-color: #ffabab;
+		// padding-bottom: 60rpx;
 	}
 
-	.bg-img {
-		position: absolute;
-		top: 0;
-		left: 0;
-		width: 750rpx;
-		height: 2323rpx;
+	.popup_row {
+		width: 100%;
+		height: 500rpx;
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
 
-		image {
+		.rows {
 			width: 100%;
-			height: 100%;
+			padding: 0 24rpx;
+
+			.rows-item {
+				height: 80rpx;
+				line-height: 80rpx;
+				text-align: center;
+				width: 100%;
+				font-size: 32rpx;
+				color: #303133;
+				// border-bottom: 1rpx solid #f0f0f0;
+			}
+
+			// .row-1 {
+			// 	margin: auto;
+			// 	.first_aid {
+			// 		width: 300rpx;
+			// 		height: 300rpx;
+			// 	}
+			// }
+			// .row-2 {
+			// 	font-size: 38rpx;
+			// 	margin-top: 20rpx;
+			// }
 		}
 	}
-	.over-content {
-		position: relative;
-		top: 669rpx;
-	}
-	.item-wrapper {
-		width: 636rpx;
-		margin:0 auto 76rpx;
-		border: 1px solid #C9101B;
-		// background: #fff;
-		border-radius: 10px;
-		position: relative;
-		.item-tit {
-			width: 199rpx;
-			height: 55rpx;
-			background: linear-gradient(0,#C9101B, #F24D33);
-			border-radius: 10rpx;
-			text-align: center;
-			line-height: 55rpx;
-			font-size: 34rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #FFFFFF;
-			position: absolute;
-			top: -28rpx;
-			left: 64rpx;
+
+	.content {
+		background-color: #f8f8f8;
+		height: 100%;
+
+		/* 头部 轮播图 */
+		.carousel-section {
+			// padding-top: 10px;
+			overflow: hidden;
+			background-color: #fff;
+
+			.carousel {
+				width: 750rpx;
+				height: 504rpx;
+				margin: 0 auto;
+				overflow: hidden;
+
+				.carousel-item {
+					width: 100%;
+					height: 100%;
+					overflow: hidden;
+				}
+
+				image {
+					width: 100%;
+					height: 100%;
+				}
+			}
 		}
-		.item-info {
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #ed4530;
-			line-height: 49rpx;
-			// background: linear-gradient(0deg, #C9101B 0%, #F24D33 99.267578125%);
-			// -webkit-background-clip: text;
-			// -webkit-text-fill-color: transparent;
+
+		// 分类
+		.cate-section {
+			justify-content: space-around;
+			background-color: #fff;
+			padding: 46rpx 0 30rpx;
+
+			.cate-item {
+				width: 25%;
+				flex-direction: column;
+				text-align: center;
+				align-items: center;
+				justify-content: center;
+
+				.img-wrapper {
+					width: 100rpx;
+					height: 88rpx;
+					background: #eef4ff;
+					border-radius: 14rpx;
+					position: relative;
+
+					image {
+						position: absolute;
+						left: 50%;
+						top: 50%;
+						transform: translate(-50%, -50%);
+					}
+
+					.img1 {
+						width: 100rpx;
+						height: 84rpx;
+					}
+
+					.img2 {
+						width: 100rpx;
+						height: 85rpx;
+					}
+
+					.img3 {
+						width: 100rpx;
+						height: 84rpx;
+
+					}
+
+					.img4 {
+						width: 100rpx;
+						height: 88rpx;
+					}
+
+				}
+
+				.item-title {
+					margin-top: 15rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #333333;
+				}
+			}
+		}
+
+		// 红会科普
+		.science-section {
+			width: 100%;
+			background-color: #ffffff;
+			margin-top: 18rpx;
+			padding-top: 30rpx;
+
+			.science-title {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				padding-bottom: 22rpx;
+
+				.title {
+					width: 285rpx;
+					height: 64rpx;
+					background-color: #ca121e;
+					border-radius: 32rpx;
+					color: #ffffff;
+					font-size: 32rpx;
+					line-height: 64rpx;
+					text-align: center;
+				}
+
+				image {
+					width: 68rpx;
+					height: 43rpx;
+					margin-left: 16rpx;
+					margin-right: 16rpx;
+				}
+			}
+
+			.science-box {
+				padding-left: 15rpx;
+				padding-right: 15rpx;
+				padding-bottom: 20rpx;
+				border-bottom: 1rpx solid #f0f0f0;
+				white-space: nowrap;
+				display: flex;
+				width: 100%;
+
+				// .uni-scroll-view-content{
+				// 	display: flex;
+				// }
+				.science-content {
+					// width: 100%;
+
+					// display: flex;
+					display: -webkit-box;
+
+					.science-item {
+						margin-right: 24rpx;
+						width: 198rpx;
+						display: flex;
+						flex-direction: column;
+						align-items: center;
+						text-align: center;
+
+						image {
+							width: 100%;
+							height: 145rpx;
+						}
+
+						.article-title {
+							width: 198rpx;
+							color: #333;
+							font-size: 25rpx;
+							padding-top: 20rpx;
+							padding-bottom: 16rpx;
+							font-weight: 900;
+						}
+
+						.article-content {
+							width: 198rpx;
+							color: #999999;
+							font-size: 18rpx;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							word-break: break-all;
+							-webkit-box-orient: vertical;
+							-webkit-line-clamp: 2;
+						}
+					}
+				}
+			}
+
+			.science-more {
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				color: #cb131c;
+				font-size: 30rpx;
+				padding-top: 18rpx;
+				padding-bottom: 18rpx;
+
+				image {
+					width: 20rpx;
+					height: 27rpx;
+				}
+			}
+		}
+
+		// sos急救中心
+		.system {
 			width: 100%;
+			background-color: #ffffff;
+			margin-top: 18rpx;
+			padding: 40rpx 30rpx 35rpx 30rpx;
+			margin-bottom: 20rpx;
+
+			.system-map {
+				margin: 30rpx auto 0;
+				width: 689rpx;
+				height: 312rpx;
+				background-color: #ffffff;
+				// padding: 0 30rpx;
+				padding-bottom: 45rpx;
+				// .map-box {
+				// 	width: 100%;
+				// 	height: 312rpx;
+				// 	// background-color: #fff;
+
+				// }
+			}
 		}
-		.item-btn {
-			justify-content: center;
+
+		// AED
+		.list-box {
+			padding: 0rpx 25rpx 24rpx;
+			// margin-bottom: 84rpx;
+			background-color: #fff;
+
+			.system-title {
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+				height: 130rpx;
+				// padding-bottom: 22rpx;
+				background-color: #ffffff;
+
+				.title {
+					width: 285rpx;
+					height: 64rpx;
+					background-color: #ca121e;
+					border-radius: 32rpx;
+					color: #ffffff;
+					font-size: 32rpx;
+					line-height: 64rpx;
+					text-align: center;
+				}
+
+				.img {
+					width: 68rpx;
+					height: 43rpx;
+					margin-left: 16rpx;
+					margin-right: 16rpx;
+
+					image {
+						width: 68rpx;
+						height: 43rpx;
+					}
+				}
+			}
+		}
+
+		.map-box {
+			width: 100%;
+			height: 366rpx;
+		}
+
+		.list-tpl {
+			background-color: #ffffff;
+			margin: 25rpx 0rpx;
+			padding: 25rpx 25rpx;
+			font-size: 28rpx;
+			border-radius: 15rpx;
+			display: flex;
+			justify-content: space-between;
 			align-items: center;
-			height: 72rpx;
-			position: absolute;
-			bottom: 50rpx;
-			width: 568rpx;
-			.xcb {
-				width: 80rpx;
-				height: 50rpx;
+			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;
+					}
+				}
 			}
-			.item-btn-btn {
-				width: 303rpx;
-				height: 72rpx;
-				margin: 0 10rpx;
-				background: linear-gradient(0deg, #C9101B, #F24D33);
-				border-radius: 36rpx;
-				line-height: 72rpx;
+
+			.image {
+				width: 10%;
 				text-align: center;
-				font-size: 34rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
+
+				image {
+					width: 50rpx;
+					height: 50rpx;
+				}
+
+				.tip {
+					color: #7f7f7f;
+					font-size: 21rpx;
+				}
+			}
+		}
+	}
+
+	// .red-box {
+	// 	margin: 20rpx 0;
+	// 	height: 521rpx;
+	// 	padding: 40rpx 23rpx 35rpx 23rpx;
+	// 	background-color: #fff;
+
+	// 	.red-nav {
+	// 		justify-content: space-between;
+	// 		margin-top: 23rpx;
+
+	// 		.left-nav {
+	// 			width: 332rpx;
+	// 			height: 392rpx;
+	// 			background: #FFF3F5;
+	// 			background-image: url(../../static/img/m1.png);
+	// 			background-size: 100% 100%;
+	// 		}
+
+	// 		.right-nav {
+	// 			width: 357rpx;
+	// 			height: 392rpx;
+	// 			flex-direction: column;
+	// 			justify-content: space-between;
+
+	// 			// background: #F6F6FF;
+	// 			.right-top-nav {
+	// 				width: 357rpx;
+	// 				height: 204rpx;
+	// 				background: #F6F6FF;
+	// 				background-image: url(../../static/img/m2.png);
+	// 				background-size: 100% 100%;
+	// 			}
+
+	// 			.right-bottom-nav {
+	// 				width: 357rpx;
+	// 				height: 173rpx;
+	// 				justify-content: space-between;
+
+	// 				view {
+	// 					width: 171rpx;
+	// 					height: 173rpx;
+	// 				}
+
+	// 				.left-item {
+	// 					background: #F5EFFE;
+	// 					background-image: url(../../static/img/m3.png);
+	// 					background-size: 100% 100%;
+	// 				}
+
+	// 				.right-item {
+	// 					background: #EDFEFE;
+	// 					background-image: url(../../static/img/m4.png);
+	// 					background-size: 100% 100%;
+	// 				}
+	// 			}
+	// 		}
+	// 	}
+	// }
+	.red-box {
+		margin: 20rpx 0;
+		// height: 393rpx;
+		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;
+		border-radius: 25rpx;
+		width: 100%;
+		padding: 24rpx;
+		background-color: #f8f8f8;
+		z-index: 999;
+
+		.title {
+			border-bottom: 2rpx solid #F2F2F2;
+			color: #E63931;
+			font-size: 32rpx;
+			padding-left: 4rpx;
+			padding-bottom: 16rpx;
+			display: flex;
+			justify-content: space-between;
+
+			// align-items: center;
+			.cancel {
+				margin-left: 52rpx;
+				width: 36rpx;
+				height: 36rpx;
+
+				image {
+					width: 36rpx;
+					height: 36rpx;
+				}
+			}
+		}
+
+		.inpBox {
+			margin-top: 52rpx;
+			border: 2px solid #f2f2f2;
+			padding: 12rpx 24rpx;
+			color: #FF9797;
+			border-radius: 8rpx;
+
+			.input-placeholder {
+				// height: 70rpx;
+				font-size: 32rpx;
+				color: #FF9797;
+			}
+		}
+
+		.inpedit {
+			margin-top: 24rpx;
+			margin-left: 14rpx;
+			font-size: 28rpx;
+			color: #FF9797;
+		}
+
+		.comfirm {
+			display: flex;
+			justify-content: flex-end;
+			margin-top: 54rpx;
+
+			.comfirm1 {
+				padding: 12rpx 24rpx;
+				border-radius: 12rpx;
 				color: #FFFFFF;
+				background-color: #E63931;
 			}
 		}
-		.tab-wrap {
-			padding: 53rpx 40rpx 28rpx 33rpx;
-			height: 410rpx;
-			.tab-item {
-				line-height: 45rpx;
-				height: 45rpx;
-				align-items: center;
-				justify-content: space-between;
-				font-size: 30rpx;
+	}
+
+	.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;
+			}
+		}
+	}
+
+	.box-top {
+		height: 36rpx;
+		height: 36rpx;
+		border-radius: 36rpx 36rpx 0 0;
+		// margin: -36rpx auto;
+		margin-bottom: -36rpx;
+		position: relative;
+		top: -36rpx;
+		background-color: #fff;
+		z-index: 9;
+	}
+
+	.top-box {
+		background-color: #fff;
+		flex-wrap: wrap;
+		justify-content: center;
+		padding: 14rpx 0 50rpx;
+		margin-bottom: 20rpx;
+
+		.top-item {
+			margin: 10rpx;
+			width: 327rpx;
+			height: 210rpx;
+			background: linear-gradient(0deg, #FFF0ED, #FFFFFF, #FFF0ED);
+			box-shadow: 0px 0px 20rpx 0px rgba(255, 52, 52, 0.06);
+			border-radius: 10rpx;
+			position: relative;
+			padding: 25rpx 20rpx;
+
+			.item-tit {
+				font-size: 32rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
-				color: #ed4530;
-				// background: linear-gradient(0deg, #C9101B 0%, #F24D33 99.267578125%);
-				// -webkit-background-clip: text;
-				// -webkit-text-fill-color: transparent;
+				color: #333333;
+			}
+
+			.item-content {
+				font-size: 22rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #C3C3C3;
+				padding-top: 10rpx;
+			}
+
+			.item-logo {
+				position: absolute;
+			}
+		}
+	}
+
+	.bottom-box {
+		justify-content: center;
+		flex-wrap: wrap;
+		background-color: #fff;
+
+		.tit {
+			font-size: 28rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+			color: #333333;
+		}
+
+		.left-content {
+			padding-top: 5rpx;
+			font-size: 20rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			max-width: 210rpx;
+			color: #C3C3C3;
+		}
+
+		.btm-left {
+			height: 334rpx;
+			width: 261rpx;
+			// background-color: #009100;
+			padding: 30rpx 20rpx;
+			position: relative;
+
+			.bglogo {
+				position: absolute;
+				width: 189rpx;
+				height: 194rpx;
+				bottom: 23rpx;
+				left: 35rpx;
+			}
+		}
+
+		.btm-right {
+			width: 438rpx;
+			height: 334rpx;
+
+			// background-color: #03A9F4;
+			.b-l-item {
+				width: 438rpx;
+				height: 167rpx;
+				// background-color: red;
+				position: relative;
+				padding: 50rpx 36rpx;
+
+				.right-logo {
+					position: absolute;
+					width: 195rpx;
+					height: 137rpx;
+					top: 6rpx;
+					left: 240rpx;
+				}
+
+				.right-logo-2 {
+					width: 90rpx;
+					height: 130rpx;
+					top: 13rpx;
+					left: 290rpx;
+				}
 			}
 		}
-		
 	}
 </style>

+ 7 - 5
pages/login/login.vue

@@ -112,15 +112,17 @@ export default {
 				password:obj.passward
 			})
 				.then(function(e) {
-					uni.setStorageSync('token',e.data.token);
+					uni.setStorageSync('token',e.data.userinfo.token);
+					console.log(e.data.userinfo.token,'u++++++++++++++++++++')
+					//调用注册接口,成功跳转首页
 					getUserInfo({}).then((e)=> {
+						console.log(e,'userInfo000000000000000000000')
 						obj.login();
 						// 保存返回用户数据
 						obj.setUserInfo(e.data);
-					})
-					//调用注册接口,成功跳转首页
-					uni.switchTab({
-						url: '/pages/index/index'
+						uni.switchTab({
+							url: '/pages/index/index'
+						})
 					})
 				})
 				.catch(function(e) {

+ 15 - 3
pages/login/register.vue

@@ -5,7 +5,15 @@
 		<view class="login_text">
 			<view class="login_input flex">
 				<!-- <view class="login_img"><image src="/static/icon/img03.png"></image></view> -->
-				<view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入用户名" /></view>
+				<view class="login_name"><input class="uni-input" v-model="username" focus placeholder="请输入用户名" /></view>
+			</view>
+			<view class="login_input flex">
+				<!-- <view class="login_img"><image src="/static/icon/img03.png"></image></view> -->
+				<view class="login_name"><input class="uni-input" v-model="phone" focus placeholder="请输入手机号" /></view>
+			</view>
+			<view class="login_input flex">
+				<!-- <view class="login_img"><image src="/static/icon/img03.png"></image></view> -->
+				<view class="login_name"><input class="uni-input" v-model="email" focus placeholder="请输入邮箱" /></view>
 			</view>
 			<view class="login_input flex">
 				<!-- <view class="login_img"><image src="/static/icon/img04.png"></image></view> -->
@@ -38,7 +46,9 @@ import { register, verify } from '@/api/login.js';
 export default {
 	data() {
 		return {
-			phone: '', //用户
+			email: '',//邮箱
+			username: '',//用户名
+			phone: '', //手机号
 			password: '', //密码
 			repassword: '',
 			invitation: '', //邀请码
@@ -90,7 +100,9 @@ export default {
 			}
 
 			register({
-				account: obj.phone, //账号
+				email: obj.email,
+				username: obj.username,
+				mobile: obj.phone, //账号
 				captcha: obj.code, //验证码
 				password: obj.password //密码
 			}).then(function(e) {

+ 3 - 3
pages/redirect/redirect.vue

@@ -41,9 +41,9 @@
 				let obj = this;
 				let url = window.location.href;
 				let code = url.match(/code=([0-9]|[a-z]|[A-Z])*/g)[0].replace('code=', '');
-				// history.replaceState({
-				// 	name: '首页'
-				// }, '首页', obj.urlFile + '/#/pages/index/index');
+				history.replaceState({
+					name: '首页'
+				}, '首页', obj.urlFile + '/#/pages/index/index');
 				let spread = uni.getStorageSync('spread') || '';
 				wechatAuth({
 					code: code,

+ 16 - 16
pages/user/user.vue

@@ -134,14 +134,14 @@
 		},
 		onReady() {
 			console.log(99999)
-			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
-			})
+			// 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
+			// })
 		},
 		computed: {
 			...mapState('user', ['hasLogin', 'userInfo'])
@@ -157,14 +157,14 @@
 				// #ifdef H5
 				weixindata();
 				// #endif
-				detail_training({
-					id:this.id,
-				}).then(({data}) => {
-					console.log(9,data)
-					this.name = data.name
-					this.signDate = data.add_time
-					this.is_over = data.is_over
-				})
+				// detail_training({
+				// 	id:this.id,
+				// }).then(({data}) => {
+				// 	console.log(9,data)
+				// 	this.name = data.name
+				// 	this.signDate = data.add_time
+				// 	this.is_over = data.is_over
+				// })
 			},
 			toMyfu() {
 				uni.navigateTo({

BIN
static/icon/erweima.jpg


+ 2 - 2
store/index.js

@@ -5,10 +5,10 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
 		// #ifdef MP
-		baseURL: 'http://xg.igxys.com', //请求地址配置
+		baseURL: 'http://red.frp.liuniu946.com', //请求地址配置
 		// #endif
 		// #ifndef MP
-		baseURL: 'http://xg.igxys.com', //请求地址配置
+		baseURL: 'http://red.frp.liuniu946.com', //请求地址配置
 		// #endif
 		// baseURL: 'http://yrh.liuniu946.com', //请求地址配置
 		urlFile: '/index', //项目部署所在文件夹

+ 22 - 84
utils/loginUtils.js

@@ -1,32 +1,7 @@
-// 获取当前页面
 export function getActionPage() {
 	let pages = getCurrentPages();
 	return pages[pages.length - 1]
 }
-
-
-// 处理分享链接地址
-export function getPageUrl(config) {
-	let page = getActionPage();
-	let path = '/' + page.route;
-	let url = '';
-	// 获取对象可枚举键值列表
-	let objKeys = Object.keys(page.options);
-	// 判断有无传值
-	if (objKeys.length > 0) {
-		// 循环赋值对象数据
-		for (let a in page.options) {
-			// 判断有无邀请人
-			if (a != 'spread') {
-				url += a + "=" + page.options[a] + "&"
-			}
-		}
-		path += '?' + url.substr(0, url.length - 1);
-	}
-	// 返回处理邀请人后的邀请地址
-	return path
-}
-
 //登录拦截
 export function interceptor() {
 	let pages = getActionPage();
@@ -35,37 +10,19 @@ export function interceptor() {
 	let url = '/pages/login/login'
 	// #ifdef H5
 	// 判断是否为公众号调用微信授权登录
-	// let ua = 
-
-	if (navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger') {
-		let weichatBrowser = uni.getStorageSync('weichatBrowser');
-		if (weichatBrowser) {
-			url = '/pages/public/wxLogin';
-		}
-		if (pageUrl != url) {
-			uni.navigateTo({
-				url
-			})
-		}
-
-	} else {
-		uni.showModal({
-			title: '提示',
-			content: '请使用微信扫码!',
-		})
+	let weichatBrowser = uni.getStorageSync('weichatBrowser');
+	if (weichatBrowser) {
+		url = '/pages/public/wxLogin';
 	}
-
-
 	// #endif
 	// #ifdef MP-WEIXIN
 	url = '/pages/public/wxLogin';
+	// #endif
 	if (pageUrl != url) {
 		uni.navigateTo({
 			url
 		})
 	}
-	// #endif
-	
 }
 
 // 保存页面
@@ -74,44 +31,25 @@ export function saveUrl() {
 	let page = getActionPage();
 	// 获取跳转前路由地址
 	let path = '/' + page.route;
-	let url = '';
-	// 获取对象可枚举键值列表
-	let objKeys = Object.keys(page.options);
-	// 判断有无传值
-	if (objKeys.length > 0) {
-		// 循环赋值对象数据
-		for (let a in page.options) {
-			url += a + "=" + page.options[a] + "&"
+	// 判断是否在商品页
+	if (path == '/pages/product/product') {
+		path = path + '?id=' + page.goodsid;
+		// 判断是否不是普通商品
+		if(page.goodsType>0){
+			path+='&type='+page.goodsType
+		}
+		// 判断是否为秒杀商品
+		if(page.goodsType==1){
+			path+="&stoptime="+page.seckillObj.stopTime
+		}
+	}
+	if (path == '/pages/groupBooking/detail') {
+		path +=  '?id=' + page.gp_id;
+		// // 判断是否有邀请人
+		if(page.spread){
+			path +="&spread=" +page.spread
 		}
-		path += '?' + url.substr(0, url.length - 1);
 	}
-	// uni.showModal({
-	// 	title: '地址',
-	// 	content: path,
-	// 	fail: function (res) {
-	// 		console.log(res.errMsg);
-	// 		uni.showModal({
-	// 			title: 'error',
-	// 			content: res.errMsg
-	// 		})
-	// 	}
-	// })
+	// 保存当前过去页面
 	uni.setStorageSync('present', path);
-	// // 获取当前页面
-	// let page = getActionPage();
-	// // 获取跳转前路由地址
-	// let path = '/' + page.route;
-	// let url = '';
-	// // 获取对象可枚举键值列表
-	// let objKeys = Object.keys(page.options);
-	// // 判断有无传值
-	// if (objKeys.length > 0) {
-	// 	// 循环赋值对象数据
-	// 	for (let a in page.options) {
-	// 		url += a + "=" + page.options[a] + "&"
-	// 	}
-	// 	path += '?' + url.substr(0, url.length - 1);
-	// }
-	// console.log(path,1)
-	// uni.setStorageSync('present', path);
 }

+ 10 - 8
utils/newRequest.js

@@ -121,19 +121,21 @@ let service = {
 						uni.showLoading({
 							title: '上传中'
 						})
-						let timestamp = new Date().getTime();
-						let appSecret = 'cda5fc1eae1c06793ebe9704f92271c4';
-						let Appid = 'wxef214ed34884df7b';
-						let Sign = md5(sha1(Appid + timestamp + appSecret + timestamp + Appid + appSecret))
+						let token = uni.getStorageSync('token') || '';
+						let sign_time = new Date().getTime();
+						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({
 							url: config.upload_img_url, //仅为示例,非真实的接口地址
 							filePath: path,
 							name: 'file',
 							header: {
-								"Authori-zation": 'Bearer ' + uni.getStorageSync('token'),
-								"App-id": Appid,
-								"Sign": Sign,
-								"Sign-time": timestamp
+								"sys-appid": sys_appid,
+								"sign-time": sign_time,
+								"sys-token": sys_token,
+								"token": token
 							},
 							success: (uploadFileRes) => {
 								if ("string" === typeof uploadFileRes.data) {

+ 21 - 23
utils/request.js

@@ -12,26 +12,26 @@ service.interceptors.response(
 		try {
 			let res = response.data;
 			// 解析字符串为数字
-			if (res.status !== 200) {
-				if (res.status == 410000) {
+			if (res.code != 1) {
+				if (res.code == 401) {
+					console.log('登录过期')
 					// 存储当前地址
 					saveUrl()
 					// 调用退出登录方法清空用户信息
 					store.commit('user/logout');
 					// 判断是否开启强制登录
 					// 跳转页面
-					interceptor()
 					uni.showModal({
 						title: "您未登录!是否马上登录?",
 						success: (e) => {
 							if (e.confirm) {
 								// 保存当前页面地址
-						
+								interceptor()
 							}
 						}
 					})
 				} else {
-					if(res.msg!='系统出现异常'){
+					if (res.msg != '系统出现异常') {
 						uni.showToast({
 							title: res.msg,
 							duration: 1500,
@@ -40,8 +40,8 @@ service.interceptors.response(
 						})
 					}
 				}
-				console.log(res);
-				//return Promise.reject(new Error(res.msg || 'Error'))
+				console.log(res,'扑街');
+				return Promise.reject(new Error(res.msg || 'Error'))
 			} else {
 				return res
 			}
@@ -64,26 +64,24 @@ service.interceptors.response(
 service.interceptors.request(
 	config => {
 		let token = uni.getStorageSync('token') || '';
-		let timestamp = new Date().getTime();
-		let appSecret = 'cda5fc1eae1c06793ebe9704f92271c4';
-		let Appid = 'wxef214ed34884df7b';
-		let Sign = md5(sha1(Appid + timestamp + appSecret + timestamp + Appid + appSecret))
-		
-		console.log(Sign,Sign.length,'md5+++++++++++')
-		console.log(timestamp,'timestamp')
+		let sign_time = new Date().getTime();
+		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) {
 			config.header = {
-				"Authori-zation": 'Bearer ' + token,
-				"App-id": Appid,
-				"Sign": Sign,
-				"Sign-time": timestamp
+				"sys-appid": sys_appid,
+				"sign-time": sign_time,
+				"sys-token": sys_token,
+				"token": token
 			}
 		} else {
-			// 添加key请求头
-			config.header["Authori-zation"] = 'Bearer ' + token;
-			config.header["App-id"] = Appid;
-			config.header['Sign-time'] = timestamp;
-			config.header['Sign'] = Sign;
+
+			config.header['sys-appid'] = sys_appid
+			config.header['sign-time'] = sign_time
+			config.header['sys-token'] = sys_token
+			config.header['token'] = token
 		}
 		return config
 	},

+ 95 - 64
utils/wxAuthorized.js

@@ -1,7 +1,11 @@
 import {
 	wechatConfig,
-	share
+	share,
+	getWxconfig
 } from '@/api/wx';
+import {
+	getCompany
+} from '@/api/index.js'
 import store from '../store';
 // 保存wx对象
 let weixinObj = require('jweixin-module');
@@ -51,10 +55,10 @@ export function loginWinxin() {
 function weixinSq(data, path) {
 	// 微信授权后跳转页面
 	try {
-		let ul = encodeURIComponent(store.state.baseURL + store.state.urlFile + '/pages/redirect/redirect');
+		let ul = encodeURIComponent(store.state.baseURL + store.state.urlFile + '/#/pages/redirect/redirect');
 		console.log(ul, "ul")
 		// 打开微信授权页面
-		
+
 		let url =
 			'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
 			appId +
@@ -63,7 +67,7 @@ function weixinSq(data, path) {
 			'&response_type=code&scope=snsapi_userinfo&state=' +
 			new Date().getTime() +
 			'#wechat_redirect';
-			console.log(url, "url")
+		console.log(url, "url")
 		window.location.href = url;
 	} catch (e) {
 		console.log(e);
@@ -78,54 +82,86 @@ export function weixindata(config) {
 	// 保存微信对象到全局仓库
 	store.commit('setWeiChatObj', weixinObj)
 	console.log(window.location.href);
-	console.log('当前注册url地址',window.location.href);
-	wechatConfig({
-			// url: 'pages/applic/location',			
-			url: store.state.baseURL+ store.state.urlFile+'/',
-		})
-		.then(({
-			data
-		}) => {
-			// uni.showModal({ 
-			// 	// url: 'http://yyred.igxys.com/index/',
-			// 	title:'地址',
-			// 	content: window.location.href
-			// })
-			
-			// 保存appId
-			store.commit('setWeiChatInfo', data)
-			
-			appId = data.appId;
-			// 微信信息配置
-			weixinObj.config({
-				debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-				appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
-				timestamp: data.timestamp, // 必填,生成签名的时间戳
-				nonceStr: data.nonceStr, // 必填,生成签名的随机串
-				signature: data.signature, // 必填,签名,见附录1
-				jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-			});
-			weixinObj.ready((e) => {
-				console.log('分享数据',shareData);
-				if (shareData == '') {
-					share({}).then(({
-						data
-					}) => {
-						shareData = data.data
-						// uni.showModal({
-						// 	title: 'shareData',
-						// 	content: JSON.justifySelf(shareData)
-						// })
-						shareLoad(config)
-					});
-				} else {
+	console.log('当前注册url地址', window.location.href);
+	getWxconfig({
+		url: store.state.baseURL + store.state.urlFile + '/',
+	}).then(({
+		data
+	}) => {
+		appId = data.appId;
+		// 微信信息配置
+		weixinObj.config({
+			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+			appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+			timestamp: data.timestamp, // 必填,生成签名的时间戳
+			nonceStr: data.nonceStr, // 必填,生成签名的随机串
+			signature: data.signature, // 必填,签名,见附录1
+			jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+		});
+		weixinObj.ready((e) => {
+			console.log('分享数据', shareData);
+			if (shareData == '') {
+				getCompany().then(({
+					data
+				}) => {
+					// 保存appId
+					shareData = {
+						title: data.company_name,
+						imgUrl: data.wechat_share_image,
+						desc: data.share_info,
+					}
 					shareLoad(config)
-				}
-			})
+				})
+				
+			} else {
+				shareLoad(config)
+			}
 		})
-		.catch(e => {
-			console.log(e);
-		});
+	})
+
+	// wechatConfig({
+	// 		// url: 'pages/applic/location',			
+	// 		url: store.state.baseURL+ store.state.urlFile+'/',
+	// 	})
+	// 	.then(({
+	// 		data
+	// 	}) => {
+	// 		// uni.showModal({ 
+	// 		// 	// url: 'http://yyred.igxys.com/index/',
+	// 		// 	title:'地址',
+	// 		// 	content: window.location.href
+	// 		// })
+
+	// 		// 保存appId
+	// 		store.commit('setWeiChatInfo', data)
+
+	// 		appId = data.appId;
+	// 		// 微信信息配置
+	// 		weixinObj.config({
+	// 			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+	// 			appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+	// 			timestamp: data.timestamp, // 必填,生成签名的时间戳
+	// 			nonceStr: data.nonceStr, // 必填,生成签名的随机串
+	// 			signature: data.signature, // 必填,签名,见附录1
+	// 			jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+	// 		});
+	// 		weixinObj.ready((e) => {
+	// 			console.log('分享数据',shareData);
+	// 			if (shareData == '') {
+	// 				share({}).then(({
+	// 					data
+	// 				}) => {
+	// 					shareData = data.data
+	// 					shareLoad(config)
+	// 				});
+	// 			} else {
+	// 				shareLoad(config)
+	// 			}
+	// 		})
+	// 	})
+	// 	.catch(e => {
+	// 		console.log(e);
+	// 	});
 }
 // 加载分享数据
 function shareLoad(config) {
@@ -137,17 +173,13 @@ function shareLoad(config) {
 			desc: config.desc,
 			title: config.title,
 			success: config.success,
-			fail: config.fail||function (e) {
+			fail: config.fail || function(e) {
 				console.log(e);
 			}
 		}
 	} else {
 		// console.log(window.location.href, 55)
 		// let url = window.location.href + '?spread=' + store.state.userInfo.uid;
-		// uni.showModal({
-		// 	title: '确认',
-		// 	content: '确认分享'
-		// })
 		let url = window.location.href;
 		url = url.replace(/[\?,&]{0,1}from=singlemessage/g, '');
 		mess = {
@@ -155,20 +187,19 @@ function shareLoad(config) {
 			link: url, // 分享链接
 			imgUrl: shareData.img, // 分享图标
 			desc: shareData.synopsis,
-			success: function() {
-			},
-			fail:function (e) {
+			success: function() {},
+			fail: function(e) {
 				console.log(e);
 			}
 		}
 	}
 	// 获取仓库数据
 	// 分享好友
-	weixinObj.updateAppMessageShareData(mess);
-	// weixinObj.onMenuShareAppMessage(mess);// 即将废弃
+	// weixinObj.updateAppMessageShareData(mess);
+	weixinObj.onMenuShareAppMessage(mess); // 即将废弃
 	// 分享朋友圈
-	weixinObj.updateTimelineShareData(mess)
-	// weixinObj.onMenuShareTimeline(mess);// 即将废弃
+	// weixinObj.updateTimelineShareData(mess)
+	weixinObj.onMenuShareTimeline(mess); // 即将废弃
 }
 
 // 隐藏功能按钮
@@ -179,7 +210,7 @@ export function weixinhideMenu(config) {
 			menuList: config, // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
 		});
 	})
-	
+
 }
 
 // export function getLoca(config) {
@@ -199,7 +230,7 @@ export function weixinhideMenu(config) {
 // 		    }
 // 		});
 // 	})
-	
+
 // }
 
 export default {