Browse Source

Merge branch 'master' of http://git.liuniu946.com/xuhaolan/xhlred

xuhaolan 4 years ago
parent
commit
1a0bf8f13c

+ 1 - 1
App.vue

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

+ 2 - 2
api/ask.js

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

+ 86 - 5
api/category.js

@@ -1,10 +1,91 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
 
 
-// 获取商品分类
-export function getList(data) {
+//获取机构列表
+export function getMechanismList(data) {
 	return request({
 	return request({
-		url: '/api/category',
-		method: 'get',
+		url:'/api/institution/institution',
+		method:'get',
 		data
 		data
-	});
+	})
+}
+
+// 获取aed列表
+export function getAed(data) {
+	return request({
+		url: '/api/institution/aed',
+		method: 'get',
+		data
+	})
+}
+
+// 获取救护站列表
+export function getAidList(data) {
+	return request({
+		url:'/api/institution/station',
+		method:'get',
+		data
+	})
 }
 }
+
+//申请成为救援者
+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
+	})
+}
+
+// 处理救援申请
+export function changeRescue(data) {
+	return request({
+		url:'/api/rescue/setstatus',
+		method:'post',
+		data
+	})
+}

+ 212 - 226
api/index.js

@@ -1,227 +1,213 @@
-import request from '@/utils/request'
-import {upFilse} from '@/utils/request'
-
-// 获取轮播图
-export function loadIndexs(data) {
-	return request({
-		url: '/api/index',
-		method: 'get',
-		data
-	});
+import request from '@/utils/request'
+import {
+	upFilse
+} from '@/utils/request'
+
+// 获取轮播图
+export function loadIndexs(data) {
+	return request({
+		url: '/api/index',
+		method: 'get',
+		data
+	});
+}
+
+// 获取科普文章列表
+export function getArticList(data, id) {
+	return request({
+		url: '/api/article/list/' + id,
+		method: 'get',
+		data
+	});
+}
+
+// 获取博爱项目文章列表
+export function itemList(data) {
+	return request({
+		url: '/api/article/list/4',
+		method: 'get',
+		data
+	});
+}
+//上传图片
+export function upload(data) {
+	return upFilse({
+		url: '/api/upload/image',
+		method: 'post',
+		data
+	});
+}
+// 促销商品
+export function groom4(data) {
+	return request({
+		url: '/api/groom/list/4',
+		method: 'get',
+		data
+	});
+}
+
+
+// 造血干细胞捐献
+export function getList(data) {
+	return request({
+		url: '/api/sign_cell',
+		method: 'post',
+		data
+	});
+}
+
+// 救护者页面获取参与人数  
+export function getNumber(data) {
+	return request({
+		url: '/api/get_rescuer',
+		method: 'get',
+		data
+	});
+}
+
+// 志愿者报名
+export function add_volunteers(data) {
+	return request({
+		url: '/api/add_registration',
+		method: 'post',
+		data
+	});
+}
+
+// joinSec
+export function joinSec(data) {
+	return request({
+		url: '/api/add_volunteers',
+		method: 'post',
+		data
+	});
+}
+// joinSecc 器官捐赠
+export function joinSecc(data) {
+	return request({
+		url: '/api/add_donation',
+		method: 'post',
+		data
+	});
+}
+
+// 获取定位
+export function getdis(data) {
+	return request({
+		url: '/api/getdis',
+		method: 'get',
+		data
+	});
+}
+// 立即救援
+export function tocall(data) {
+	return request({
+		url: '/api/do_getdis',
+		method: 'get',
+		data
+	});
+}
+
+// 救护培训报名 
+export function training(data) {
+	return request({
+		url: '/api/training',
+		method: 'get',
+		data
+	});
+}
+
+// 求助记录 getsee
+export function getseek(data) {
+	return request({
+		url: '/api/seek',
+		method: 'get',
+		data
+	});
+}
+
+// getcomAddress 获取常用地址
+export function getcomAddress(data) {
+	return request({
+		url: '/api/get_commonly',
+		method: 'get',
+		data
+	});
+}
+
+// 救援记录 rescue
+export function getrescue(data) {
+	return request({
+		url: '/api/rescueee',
+		method: 'get',
+		data
+	});
+}
+
+export function change_rescue(data) {
+	return request({
+		url: '/api/change_rescue',
+		method: 'get',
+		data
+	});
+}
+
+// 获取ADE经纬度 getListAED getDistance
+export function getListAED(data) {
+	return request({
+		url: '/api/getAed',
+		method: 'get',
+		data
+	});
+}
+
+export function getDistance(data) {
+	return request({
+		url: '/api/aeddiss',
+		method: 'get',
+		data
+	});
+}
+
+// deleteList 删除救援地址
+export function deleteList(data) {
+	return request({
+		url: '/api/rescue/sos_del',
+		method: 'get',
+		data
+	});
+}
+//获取机构
+export function getListMechanism(data) {
+	return request({
+		url: '/api/mechanism',
+		method: 'get',
+		data
+	});
+}
+
+
+export function add_company(data) {
+	return request({
+		url: '/api/add_company',
+		method: 'post',
+		data
+	});
+}
+
+// 爱心帮扶
+export function one_help(data) {
+	return request({
+		url: '/api/one_help',
+		method: 'get',
+		data
+	});
+}
+
+export function getCompany(data) {
+	return request({
+		url: '/api/index/company',
+		method: 'get',
+		data
+	});
 }
 }
-// 获取科普文章列表
-export function getArticList(data,id) {
-	return request({
-		url: '/api/article/list/' + id,
-		method: 'get',
-		data
-	});
-}
-
-// 获取博爱项目文章列表
-export function itemList(data) {
-	return request({
-		url: '/api/article/list/4',
-		method: 'get',
-		data
-	});
-}
-//上传图片
-export function upload(data) {
-	return upFilse({
-		url: '/api/upload/image',
-		method: 'post',
-		data
-	});
-}
-// 促销商品
-export function groom4(data) {
-	return request({
-		url: '/api/groom/list/4',
-		method: 'get',
-		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({
-		url: '/api/sign_cell',
-		method: 'post',
-		data
-	});
-}
-
-// 救护者页面获取参与人数  
-export function getNumber(data) {
-	return request({
-		url: '/api/get_rescuer',
-		method: 'get',
-		data
-	});
-}
-
-// 志愿者报名
-export function add_volunteers(data) {
-	return request({
-		url: '/api/add_registration',
-		method: 'post',
-		data
-	});
-}
-
-// joinSec
-export function joinSec(data) {
-	return request({
-		url: '/api/add_volunteers',
-		method: 'post',
-		data
-	});
-}
-// joinSecc 器官捐赠
-export function joinSecc(data) {
-	return request({
-		url: '/api/add_donation',
-		method: 'post',
-		data
-	});
-}
-
-// 获取定位
-export function getdis (data) {
-	return request({
-		url: '/api/getdis',
-		method: 'get',
-		data
-	});
-}
-// 立即救援
-export function tocall (data) {
-	return request({
-		url: '/api/do_getdis',
-		method: 'get',
-		data
-	});
-}
-
-// 救护培训报名 
-export function training(data) {
-	return request({
-		url: '/api/training',
-		method: 'get',
-		data
-	});
-}
-
-// 求助记录 getsee
-export function getseek(data) {
-	return request({
-		url: '/api/seek',
-		method: 'get',
-		data
-	});
-}
-
-// getcomAddress 获取常用地址
-export function getcomAddress(data) {
- return request({
-  url: '/api/get_commonly',
-  method: 'get',
-  data
- });
-}
-
-// 救援记录 rescue
-export function getrescue(data) {
-	return request({
-		url: '/api/rescueee',
-		method: 'get',
-		data
-	});
-}
-
-export function change_rescue(data) {
-	return request({
-		url: '/api/change_rescue',
-		method: 'get',
-		data
-	});
-}
-
-// 获取ADE经纬度 getListAED getDistance
-export function getListAED(data) {
-	return request({
-		url: '/api/getAed',
-		method: 'get',
-		data
-	});
-}
-
-export function getDistance(data) {
-	return request({
-		url: '/api/aeddiss',
-		method: 'get',
-		data
-	});
-}
-
-// deleteList 删除救援地址
-export function deleteList(data) {
- return request({
-  url: '/api/del_resc',
-  method: 'get',
-  data
- });
-}
-//获取机构
-export function getListMechanism(data) {
-	return request({
-		url: '/api/mechanism',
-		method: 'get',
-		data
-	});
-}
-
-
-export function add_company(data) {
-	return request({
-		url: '/api/add_company',
-		method: 'post',
-		data
-	});
-}
-
-// 爱心帮扶
-export function one_help(data) {
-	return request({
-		url: '/api/one_help',
-		method: 'get',
-		data
-	});
-}

+ 1 - 1
api/money.js

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

+ 0 - 8
api/order.js

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

+ 8 - 0
api/user.js

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

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

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

+ 5 - 6
manifest.json

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

+ 20 - 9
pages.json

@@ -17,7 +17,7 @@
 					"titleNView": false
 					"titleNView": false
 				},
 				},
 				// #endif
 				// #endif
-				"navigationBarTitleText": "孝感红十字会"
+				"navigationBarTitleText": "孝感红十字会"
 
 
 			}
 			}
 		},
 		},
@@ -214,7 +214,7 @@
 					"titleNView": false
 					"titleNView": false
 				},
 				},
 				// #endif
 				// #endif
-				"navigationBarTitleText": "孝感红十字会"
+				"navigationBarTitleText": "孝感红十字会"
 			}
 			}
 		},
 		},
 		{
 		{
@@ -557,6 +557,17 @@
 					// #endif
 					// #endif
 				"navigationBarTitleText": "我的"
 				"navigationBarTitleText": "我的"
 			}
 			}
+		},
+		{
+			"path": "pages/user/jkjl",
+			"style": {
+				// #ifndef MP
+				"app-plus": {
+					"titleNView": false
+				},
+					// #endif
+				"navigationBarTitleText": "捐款记录"
+			}
 		},
 		},
 		{
 		{
 			"path": "pages/category/search",
 			"path": "pages/category/search",
@@ -901,7 +912,7 @@
 	],
 	],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "神农架林区红十字会",
+		"navigationBarTitleText": "孝感市红十字会",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#F8F8F8"
 		"backgroundColor": "#F8F8F8"
 	},
 	},
@@ -915,22 +926,22 @@
 				"pagePath": "pages/index/index",
 				"pagePath": "pages/index/index",
 				"iconPath": "./static/tabBar/home.png",
 				"iconPath": "./static/tabBar/home.png",
 				"selectedIconPath": "static/tabBar/home-action.png",
 				"selectedIconPath": "static/tabBar/home-action.png",
-				"text": "首页",
-				"visible":false
+				"text": "首页"
+				// "visible":false
 			},
 			},
 			{
 			{
 				"pagePath": "pages/category/category",
 				"pagePath": "pages/category/category",
 				"iconPath": "static/tabBar/dengji.png",
 				"iconPath": "static/tabBar/dengji.png",
 				"selectedIconPath": "static/tabBar/dengji-action.png",
 				"selectedIconPath": "static/tabBar/dengji-action.png",
-				"text": "救在身边",
-				"visible":false
+				"text": "救在身边"
+				// "visible":false
 			},
 			},
 			{
 			{
 				"pagePath": "pages/user/user",
 				"pagePath": "pages/user/user",
 				"iconPath": "static/tabBar/user.png",
 				"iconPath": "static/tabBar/user.png",
 				"selectedIconPath": "static/tabBar/user-action.png",
 				"selectedIconPath": "static/tabBar/user-action.png",
-				"text": "我的",
-				"visible":false
+				"text": "我的"
+				// "visible":false
 			}
 			}
 		]
 		]
 	}
 	}

+ 711 - 549
pages/applic/aed.vue

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

+ 693 - 553
pages/applic/aid.vue

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

+ 62 - 72
pages/applic/contribution.vue

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

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

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

+ 95 - 55
pages/applic/helprecords.vue

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

+ 200 - 228
pages/applic/location.vue

@@ -2,16 +2,10 @@
 	<view class="content">
 	<view class="content">
 		<view id="map" class="map">
 		<view id="map" class="map">
 			<map @updated='mapChange' id="map_1" ref='map_1' style="width:750rpx; height: 600rpx" :latitude="latitude"
 			<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="location-item">
 					<view class="box-left">
 					<view class="box-left">
 						<view class="img01">
 						<view class="img01">
@@ -26,10 +20,10 @@
 						<view class="info">
 						<view class="info">
 							<view class="info-header">
 							<view class="info-header">
 								<view class="name">
 								<view class="name">
-								   救护员{{ index +1 }}
+									救护员{{ index +1 }}
 								</view>
 								</view>
 								<view class="distance">
 								<view class="distance">
-									{{ item.num }}km
+									{{item.range >= 1 ?(item.range + 'km'):(item.distance + 'm')}}
 								</view>
 								</view>
 								<view class="location-icon">
 								<view class="location-icon">
 									<image src="../../static/img/location-icon.png" mode=""></image>
 									<image src="../../static/img/location-icon.png" mode=""></image>
@@ -40,18 +34,20 @@
 							</view>
 							</view>
 						</view>
 						</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>
 							<image src="../../static/img/rescue.png" mode=""></image>
 						</view>
 						</view>
-						<view class="called" v-if="item.is">
+						<view class="called" v-else>
 							已呼叫
 							已呼叫
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
-				</view>
-				<espempty v-if="list.length === 0"></espempty>
 			</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
+			<!-- <empty v-if="list.length === 0 && loaded"></empty> -->
+			<espempty v-if="list.length === 0 && loaded"></espempty>
+		</view>
 		<uni-popup ref="popup" type="center" @click="close">
 		<uni-popup ref="popup" type="center" @click="close">
 			<view class="popup_row">
 			<view class="popup_row">
 				<view class="title">
 				<view class="title">
@@ -63,15 +59,15 @@
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="inpBox">
 				<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="comfirm">
 					<view class="comfirm1" @click="comfirm1()">
 					<view class="comfirm1" @click="comfirm1()">
 						确认
 						确认
-					</view>			
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
@@ -95,6 +91,15 @@
 	import {
 	import {
 		getcomAddress
 		getcomAddress
 	} from '@/api/index.js';
 	} from '@/api/index.js';
+	import {
+		getMechanismList,
+		applyRescuer,
+		getRescuerList,
+		getApplyList,
+		sos,
+		geocoder
+	} from '@/api/category.js'
+
 	export default {
 	export default {
 		components: {
 		components: {
 			uniPopup,
 			uniPopup,
@@ -103,17 +108,24 @@
 		//相关配置参数
 		//相关配置参数
 		data() {
 		data() {
 			return {
 			return {
+				user_id: '',
+				rescuers_id: 0,
+				loadingType: 'more',
+				loaded: false,
+				page: 1,
+				limit: 100,
 				list: [],
 				list: [],
 				latitude: '',
 				latitude: '',
 				longitude: '',
 				longitude: '',
-				current: 0, 
+				current: 0,
 				name: '',
 				name: '',
 				uid: '',
 				uid: '',
 				name: '',
 				name: '',
 				phone: '',
 				phone: '',
-				to_phone:'',
+				to_phone: '',
 				marker: [],
 				marker: [],
-				specificAdd:'',
+				specificAdd: '',
+				user_address: '', //用户地址逆解析
 				addressData: {
 				addressData: {
 					name: '',
 					name: '',
 					mobile: '',
 					mobile: '',
@@ -132,88 +144,102 @@
 		},
 		},
 		onLoad() {
 		onLoad() {
 			let obj = this;
 			let obj = this;
+			obj.getLocal()
 			console.log('开始加载事件');
 			console.log('开始加载事件');
 			obj.loadBaseData();
 			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: {
 		computed: {
 			...mapState('user', ['hasLogin', 'userInfo'])
 			...mapState('user', ['hasLogin', 'userInfo'])
 		},
 		},
 		methods: {
 		methods: {
 			...mapMutations('user', ['setUserInfo']),
 			...mapMutations('user', ['setUserInfo']),
+			// 获取本地坐标
+			getLocal() {
+				let obj = this;
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(() => {
+					console.log('加载完毕注册事件');
+					wxOjb.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude = Math.abs(e.latitude)
+							obj.longitude = Math.abs(e.longitude)
+							console.log('本地坐标', obj.latitude, obj.longitude)
+							geocoder({
+								latitude: obj.latitude,
+								longitude: obj.longitude
+							}).then(res => {
+								console.log(res)
+								obj.user_address = res.data.result.address
+								console.log(obj.user_address, 'obj.user_address')
+							})
+							let item = {
+								id: 0,
+								latitude: obj.latitude,
+								longitude: obj.longitude,
+								iconPath: '/static/img/img19.png',
+								width: '35',
+								height: '35',
+							}
+							obj.marker.push(item)
+							obj.getRescuerList(obj.latitude, obj.longitude)
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
+				})
+				uni.getLocation({
+					type: 'gcj02',
+					success(e) {
+						
+					}
+				})
+			},
+			// 获取救援者列表
+			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() {
 			loadBaseData() {
 				userinfo({}).then(({
 				userinfo({}).then(({
 					data
 					data
 				}) => {
 				}) => {
-					console.log(123,data)
-					this.to_phone = data.phone
+					console.log(123, data)
+					this.to_phone = data.mobile
 					this.setUserInfo(data);
 					this.setUserInfo(data);
 				});
 				});
 			},
 			},
@@ -221,119 +247,51 @@
 			mapChange(e) {
 			mapChange(e) {
 				console.log(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();
 				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 {
 				} 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}$/;
 					const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
 					if (!reg.test(obj.to_phone)) {
 					if (!reg.test(obj.to_phone)) {
 						obj.$api.msg('请填写正确的手机号码');
 						obj.$api.msg('请填写正确的手机号码');
 						return;
 						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,
+						rescuers_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) {
 			rescue(item, index) {
 				let obj = this;
 				let obj = this;
+				console.log(item, 'jiuzhu item')
 				uni.showModal({
 				uni.showModal({
 					content: '是否发起求救?',
 					content: '是否发起求救?',
 					success: res => {
 					success: res => {
 						if (res.confirm) {
 						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 +313,8 @@
 		width: 100%;
 		width: 100%;
 		background-color: #fff;
 		background-color: #fff;
 	}
 	}
-	.map{
+
+	.map {
 		width: 100%;
 		width: 100%;
 		height: 600rpx;
 		height: 600rpx;
 	}
 	}
@@ -370,24 +329,25 @@
 		width: 100%;
 		width: 100%;
 		background-color: #fff;
 		background-color: #fff;
 		padding: 24rpx;
 		padding: 24rpx;
+
 		//搜索框
 		//搜索框
 		.Search-box {
 		.Search-box {
 			// z-index: 999;
 			// z-index: 999;
 			height: 80rpx;
 			height: 80rpx;
-	// position: fixed;
-	// 		top: 0;
-	// 		left: 0;
-	// 		width: 100%;
+			// position: fixed;
+			// 		top: 0;
+			// 		left: 0;
+			// 		width: 100%;
 			// background: #FFFFFF;
 			// background: #FFFFFF;
 			// padding-top: 10rpx;
 			// padding-top: 10rpx;
 			padding-right: 24rpx;
 			padding-right: 24rpx;
 			padding-left: 24rpx;
 			padding-left: 24rpx;
-		
+
 			.Search-box-sort {
 			.Search-box-sort {
 				float: left;
 				float: left;
 				margin-left: 32rpx;
 				margin-left: 32rpx;
 				margin-right: 19rpx;
 				margin-right: 19rpx;
-		
+
 				.sort-text {
 				.sort-text {
 					width: 57rpx;
 					width: 57rpx;
 					height: 29rpx;
 					height: 29rpx;
@@ -397,14 +357,14 @@
 					line-height: 58rpx;
 					line-height: 58rpx;
 					margin-right: 19rpx;
 					margin-right: 19rpx;
 				}
 				}
-		
+
 				.sort-img {
 				.sort-img {
 					width: 21rpx;
 					width: 21rpx;
 					height: 11rpx;
 					height: 11rpx;
 					margin-bottom: 4rpx;
 					margin-bottom: 4rpx;
 				}
 				}
 			}
 			}
-		
+
 			.Search-box-size {
 			.Search-box-size {
 				// width:70%;
 				// width:70%;
 				height: 58rpx;
 				height: 58rpx;
@@ -413,21 +373,21 @@
 				padding-left: 36rpx;
 				padding-left: 36rpx;
 				display: flex;
 				display: flex;
 				align-items: center;
 				align-items: center;
-		
+
 				.box-img {
 				.box-img {
 					height: 32rpx;
 					height: 32rpx;
 					width: 32rpx;
 					width: 32rpx;
 					margin-right: 16rpx;
 					margin-right: 16rpx;
 				}
 				}
-		
+
 				// .box-right{
 				// .box-right{
 				// 	height: 58rpx;
 				// 	height: 58rpx;
 				// 	// width: 100%;
 				// 	// width: 100%;
 				// 	background-color: pink;
 				// 	background-color: pink;
 				// }
 				// }
-		
+
 				.box-word {
 				.box-word {
-						width: 100%;
+					width: 100%;
 					font-size: 26rpx;
 					font-size: 26rpx;
 					font-weight: 500;
 					font-weight: 500;
 					color: rgba(205, 203, 203, 1);
 					color: rgba(205, 203, 203, 1);
@@ -435,6 +395,7 @@
 				}
 				}
 			}
 			}
 		}
 		}
+
 		.location-item {
 		.location-item {
 			z-index: 1000;
 			z-index: 1000;
 			display: flex;
 			display: flex;
@@ -442,54 +403,56 @@
 			align-items: center;
 			align-items: center;
 			border-bottom: 1rpx solid #E7E8EA;
 			border-bottom: 1rpx solid #E7E8EA;
 			padding: 15rpx 0;
 			padding: 15rpx 0;
+
 			.box-left {
 			.box-left {
 				display: flex;
 				display: flex;
-	
+
 				.img01 {
 				.img01 {
 					width: 8rpx;
 					width: 8rpx;
 					height: 28rpx;
 					height: 28rpx;
 					margin-right: 18rpx;
 					margin-right: 18rpx;
-	
+
 					image {
 					image {
 						width: 8rpx;
 						width: 8rpx;
 						height: 28rpx;
 						height: 28rpx;
 					}
 					}
 				}
 				}
-	
+
 				.img02 {
 				.img02 {
 					width: 117rpx;
 					width: 117rpx;
 					height: 117rpx;
 					height: 117rpx;
 					border-radius: 50%;
 					border-radius: 50%;
+
 					image {
 					image {
 						width: 117rpx;
 						width: 117rpx;
 						height: 117rpx;
 						height: 117rpx;
 						border-radius: 50%;
 						border-radius: 50%;
 					}
 					}
 				}
 				}
-	
+
 				.info {
 				.info {
 					margin-left: 16rpx;
 					margin-left: 16rpx;
-	
+
 					.info-header {
 					.info-header {
 						display: flex;
 						display: flex;
 						align-items: center;
 						align-items: center;
-	
+
 						.name {
 						.name {
 							font-size: 32rpx;
 							font-size: 32rpx;
 							color: #333333;
 							color: #333333;
 						}
 						}
-	
+
 						.distance {
 						.distance {
 							margin-left: 25rpx;
 							margin-left: 25rpx;
 							font-size: 28rpx;
 							font-size: 28rpx;
 							color: #303133;
 							color: #303133;
 						}
 						}
-	
+
 						.location-icon {
 						.location-icon {
 							margin-left: 10rpx;
 							margin-left: 10rpx;
 							width: 20rpx;
 							width: 20rpx;
 							height: 26rpx;
 							height: 26rpx;
-	
+
 							image {
 							image {
 								width: 20rpx;
 								width: 20rpx;
 								height: 26rpx;
 								height: 26rpx;
@@ -497,7 +460,7 @@
 							}
 							}
 						}
 						}
 					}
 					}
-	
+
 					.address {
 					.address {
 						font-size: 26rpx;
 						font-size: 26rpx;
 						color: #333333;
 						color: #333333;
@@ -505,17 +468,17 @@
 					}
 					}
 				}
 				}
 			}
 			}
-	
+
 			.box-right {
 			.box-right {
 				.img {
 				.img {
 					height: 107rpx;
 					height: 107rpx;
-	
+
 					image {
 					image {
 						width: 107rpx;
 						width: 107rpx;
 						height: 107rpx;
 						height: 107rpx;
 					}
 					}
 				}
 				}
-	
+
 				.called {
 				.called {
 					margin-right: 16rpx;
 					margin-right: 16rpx;
 					height: 107rpx;
 					height: 107rpx;
@@ -526,7 +489,8 @@
 			}
 			}
 		}
 		}
 	}
 	}
-	.popup_row{
+
+	.popup_row {
 		// margin-top: 108rpx;
 		// margin-top: 108rpx;
 		height: 440rpx;
 		height: 440rpx;
 		border-radius: 25rpx;
 		border-radius: 25rpx;
@@ -534,7 +498,8 @@
 		padding: 24rpx;
 		padding: 24rpx;
 		background-color: #f8f8f8;
 		background-color: #f8f8f8;
 		z-index: 999;
 		z-index: 999;
-		.title{
+
+		.title {
 			border-bottom: 2rpx solid #F2F2F2;
 			border-bottom: 2rpx solid #F2F2F2;
 			color: #E63931;
 			color: #E63931;
 			font-size: 32rpx;
 			font-size: 32rpx;
@@ -542,40 +507,47 @@
 			padding-bottom: 16rpx;
 			padding-bottom: 16rpx;
 			display: flex;
 			display: flex;
 			justify-content: space-between;
 			justify-content: space-between;
+
 			// align-items: center;
 			// align-items: center;
-			.cancel{
+			.cancel {
 				margin-left: 52rpx;
 				margin-left: 52rpx;
 				width: 36rpx;
 				width: 36rpx;
 				height: 36rpx;
 				height: 36rpx;
-				image{
+
+				image {
 					width: 36rpx;
 					width: 36rpx;
 					height: 36rpx;
 					height: 36rpx;
 				}
 				}
 			}
 			}
 		}
 		}
-		.inpBox{
+
+		.inpBox {
 			margin-top: 52rpx;
 			margin-top: 52rpx;
 			border: 2px solid #f2f2f2;
 			border: 2px solid #f2f2f2;
 			padding: 12rpx 24rpx;
 			padding: 12rpx 24rpx;
 			color: #FF9797;
 			color: #FF9797;
 			border-radius: 8rpx;
 			border-radius: 8rpx;
+
 			.input-placeholder {
 			.input-placeholder {
 				// height: 70rpx;
 				// height: 70rpx;
 				font-size: 32rpx;
 				font-size: 32rpx;
 				color: #FF9797;
 				color: #FF9797;
 			}
 			}
 		}
 		}
-		.inpedit{
+
+		.inpedit {
 			margin-top: 24rpx;
 			margin-top: 24rpx;
 			margin-left: 14rpx;
 			margin-left: 14rpx;
 			font-size: 28rpx;
 			font-size: 28rpx;
 			color: #FF9797;
 			color: #FF9797;
 		}
 		}
-		.comfirm{
+
+		.comfirm {
 			display: flex;
 			display: flex;
 			justify-content: flex-end;
 			justify-content: flex-end;
 			margin-top: 54rpx;
 			margin-top: 54rpx;
-			.comfirm1{
+
+			.comfirm1 {
 				padding: 12rpx 24rpx;
 				padding: 12rpx 24rpx;
 				border-radius: 12rpx;
 				border-radius: 12rpx;
 				color: #FFFFFF;
 				color: #FFFFFF;
@@ -583,6 +555,6 @@
 			}
 			}
 		}
 		}
 	}
 	}
-	/* #endif */
 
 
+	/* #endif */
 </style>
 </style>

+ 755 - 699
pages/applic/rescuerecords.vue

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

+ 489 - 555
pages/category/category.vue

@@ -1,20 +1,18 @@
 <template>
 <template>
 	<view class="content">
 	<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>
-		<view class="top-title">
-			救护员招募
-		</view> -->
 		<view class="pop-box">公众参与</view>
 		<view class="pop-box">公众参与</view>
 		<view class="pop-list">
 		<view class="pop-list">
 			<view class="list-box1" v-for="(item, index) in peoplelist" :key="index" v-if="index < 20">
 			<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 class="nickname">{{ item.name }}</view>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="red-box">活动报名</view>
+		<view class="red-box">救在身边报名</view>
 		<!-- 	<view class="people">
 		<!-- 	<view class="people">
 			
 			
 		</view> -->
 		</view> -->
@@ -24,7 +22,7 @@
 				<input type="text" v-model="name" class="list-input" placeholder="请填写您的姓名" />
 				<input type="text" v-model="name" class="list-input" placeholder="请填写您的姓名" />
 			</view>
 			</view>
 			<view class="list">
 			<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="请填写您的联系方式" />
 				<input type="text" v-model="phone" class="list-input" placeholder="请填写您的联系方式" />
 			</view>
 			</view>
 			<view class="list" @click="getLocation">
 			<view class="list" @click="getLocation">
@@ -32,30 +30,28 @@
 				<!-- <picker-address class="box-right" @change="onCityClick">{{ address }}</picker-address> -->
 				<!-- <picker-address class="box-right" @change="onCityClick">{{ address }}</picker-address> -->
 				<input type="text" v-model="showaddress" class="list-input" placeholder="请选择常用地址" />
 				<input type="text" v-model="showaddress" class="list-input" placeholder="请选择常用地址" />
 			</view>
 			</view>
-			<!-- <view class="list" @click="Toshow">
+			<view class="list">
 				<view class="list-left">机构 <text>*</text></view>
 				<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-box">
 				<view class="upload-left">证件 <text>*</text></view>
 				<view class="upload-left">证件 <text>*</text></view>
 				<view class="upload-right">
 				<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>
 			</view>
 			</view>
-			<zhilin-picker
-				v-model="show"
-				:title="title"
-				:data="list"
-				:initSelected="initSelected"
-				:showSearch="true"
-				@change="onChange"
-				@searchInput="onSearchInput"
-				@confirm="onConfirm1"
-			/>
 		</view>
 		</view>
-		<view class="sub" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view>
+		<view class="sub" :class="{ action: loding }" @click="!loding ? applyRescuer() : ''">提交申请</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -68,323 +64,245 @@
 		saveUrl,
 		saveUrl,
 		interceptor
 		interceptor
 	} from '@/utils/loginUtils.js';
 	} 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: '',
 				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'
-			});
+				chooseMechanismList: [], //供选择的机构列表
+				mechanismList: [], //完整机构列表
+				volunteer_id: '', //志愿者标号
+				institution_id: '', //机构id
+			};
 		},
 		},
-		async loadData() {
+		onLoad() {
 			let obj = this;
 			let obj = this;
-			getNumber({}).then(({ data }) => {
-				// console.log(12)
-				// console.log(data)
-				obj.count = data.count;
-				obj.peoplelist = data.data;
-			});
+			obj.name = obj.userInfo.username || ''
+			obj.phone = obj.userInfo.mobile
+			console.log('开始加载事件');
 		},
 		},
-		// 选择当前位置
-		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;
-		},
-		onChange(val) {
-			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)
-		},
-		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;
-			}
-
-			const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
-			if (!reg.test(obj.phone)) {
-				obj.$api.msg('请填写正确的手机号码');
-				return;
+		watch: {
+			searchVal() {
+				this.ListDate();
 			}
 			}
-			if (obj.showaddress == '') {
-				obj.$api.msg('请选择您的所在地区');
-				return;
-			}
-
-			// if (obj.mechanism == '') {
-			// 	obj.$api.msg('请输入机构关键字');
-			// 	return;
-			// }
+		},
+		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;
+				}
 
 
-			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;
 					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;
+				// let wxOjb = require('jweixin-module');
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res)
+						obj.addressData.area = res.name;
+						console.log('位置名称:' + res.name);
+						console.log('详细地址:' + res.address);
+						console.log('纬度:' + res.latitude);
+						console.log('经度:' + res.longitude);
+						obj.addressData.latitude = res.latitude;
+						obj.addressData.longitude = res.longitude;
+						// let	dizhi = obj.addressData.latitude + ','+ obj.addressData.longitude;
+						obj.showaddress = res.address;
+					}
+				});
+				
+			},
+			onChange(val) {
+				let obj = this;
+				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;
+				let wxOjb = require('jweixin-module');
+				wxOjb.ready(()=> {
+					uni.getLocation({
+						type: 'gcj02',
+						success(e) {
+							console.log(e)
+							obj.latitude4 = Math.abs(e.latitude)
+							obj.longitude4 =  Math.abs(e.longitude)
+							obj.getRescuerList(obj.latitude4,obj.longitude4)
+						},
+						fail(err) {
+							obj.getLocal()
+						}
+					})
+				})
+				
+			}
 		}
 		}
-	}
-};
+	};
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
@@ -392,270 +310,286 @@ export default {
 		// background-color: #FD3B34;
 		// background-color: #FD3B34;
 		background-image: url();
 		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;
+
+			&::before {
+				content: '';
+				width: 220rpx;
+				height: 17rpx;
+				background: rgba(254, 166, 78, 1);
+				opacity: 0.26;
+				position: absolute;
+				bottom: -35rpx;
+				left: -40rpx;
+			}
+		}
 
 
-	.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 {
+		.red-box {
+			padding-top: 31rpx;
+			margin: 0 auto;
+			position: relative;
+			z-index: 99;
+			width: 300rpx;
 			text-align: center;
 			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;
+			}
+		}
 
 
-				.avatar-img {
+		.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);
+
+			.list-box1 {
+				text-align: center;
+				margin-right: 30rpx;
+				margin-bottom: 30rpx;
+
+				.list-top {
 					width: 100rpx;
 					width: 100rpx;
 					height: 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;
 			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;
 			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%;
 				width: 100%;
-				height: 100%;
-				border: 1px solid #888888;
+				height: 290rpx;
+				background: #ffffff;
+				// border: 1px solid #E63931;
 				border-radius: 15rpx;
 				border-radius: 15rpx;
-				flex: 1;
 				display: flex;
 				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;
 				display: flex;
+				flex-direction: column;
 				align-items: center;
 				align-items: center;
 				width: 100%;
 				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;
+
+					text {
+						color: #FD424B;
+						font-size: 30rpx;
+					}
+				}
+
+				input {
+					height: 66rpx;
+					// line-height: 66rpx;
+					margin-top: 32rpx;
+					// height: 88rpx;
+				}
 
 
-				.input-placeholder {
-					height: 70rpx;
-					color: #929292;
+				.list-input {
+					padding-left: 24rpx;
+					// margin: 12rpx 0 ;
+					height: 66rpx;
+					line-height: 66rpx;
+					// display: flex;
+					// align-items: center;
+					width: 100%;
 					font-size: 26rpx;
 					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>
 </style>

+ 2 - 4
pages/form/donaSuccess.vue

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

+ 827 - 210
pages/index/index.vue

@@ -1,70 +1,45 @@
 <template>
 <template>
 	<view class="content">
 	<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>
-		<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>
-			
-			<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>
-			<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>
-				<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>
 			</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>
 	</view>
 	</view>
 </template>
 </template>
@@ -77,7 +52,8 @@
 		getDistance,
 		getDistance,
 		getListMechanism,
 		getListMechanism,
 		getdis,
 		getdis,
-		tocall
+		tocall,
+		getCompany
 	} from '@/api/index.js';
 	} from '@/api/index.js';
 	import {
 	import {
 		saveUrl,
 		saveUrl,
@@ -92,8 +68,6 @@
 	} from '@/api/user.js';
 	} from '@/api/user.js';
 	import uniPopup from '@/components/uni-popup/uni-popup.vue';
 	import uniPopup from '@/components/uni-popup/uni-popup.vue';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import empty from '@/components/empty';
-	
 	import {
 	import {
 		getLoca
 		getLoca
 	} from '@/utils/wxAuthorized.js';
 	} from '@/utils/wxAuthorized.js';
@@ -101,204 +75,847 @@
 		getcomAddress
 		getcomAddress
 	} from '@/api/index.js';
 	} from '@/api/index.js';
 	import topTitle from '../../components/top-title/top-title.vue';
 	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 {
 	export default {
 		components: {
 		components: {
 			uniPopup,
 			uniPopup,
 			uniLoadMore,
 			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() {
 		data() {
 			return {
 			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: [], //轮播
 				carouselList: [], //轮播
-				loveList: [],//
-				loadingType: 'more',
-				page: 1,
-				limit: 30,
-				timer: '',
 			};
 			};
 		},
 		},
 		onShow() {
 		onShow() {
 			saveUrl();
 			saveUrl();
+			// let token = uni.getStorageSync('token');
 			console.log(11, this);
 			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() {
 		onLoad() {
-			uni.hideTabBar()
 			saveUrl();
 			saveUrl();
-			this.getLoveList()			
 		},
 		},
 		computed: {
 		computed: {
-			...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
+			...mapState('user', ['userInfo', 'hasLogin']),
+			...mapState(['baseURL']),
 		},
 		},
-		// 下拉加载
 		methods: {
 		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;
 				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({
 				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>
 </script>
 
 
-<style lang="scss" scoped>
+<style lang="scss">
+	a {
+		text-decoration: none;
+		color: #5f5f5f;
+	}
+
 	.content {
 	.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%;
 			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%;
 			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;
 			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;
 				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;
 				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-family: PingFang SC;
 				font-weight: bold;
 				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>
 </style>

+ 7 - 5
pages/login/login.vue

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

+ 15 - 3
pages/login/register.vue

@@ -5,7 +5,15 @@
 		<view class="login_text">
 		<view class="login_text">
 			<view class="login_input flex">
 			<view class="login_input flex">
 				<!-- <view class="login_img"><image src="/static/icon/img03.png"></image></view> -->
 				<!-- <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>
 			<view class="login_input flex">
 			<view class="login_input flex">
 				<!-- <view class="login_img"><image src="/static/icon/img04.png"></image></view> -->
 				<!-- <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 {
 export default {
 	data() {
 	data() {
 		return {
 		return {
-			phone: '', //用户
+			email: '',//邮箱
+			username: '',//用户名
+			phone: '', //手机号
 			password: '', //密码
 			password: '', //密码
 			repassword: '',
 			repassword: '',
 			invitation: '', //邀请码
 			invitation: '', //邀请码
@@ -90,7 +100,9 @@ export default {
 			}
 			}
 
 
 			register({
 			register({
-				account: obj.phone, //账号
+				email: obj.email,
+				username: obj.username,
+				mobile: obj.phone, //账号
 				captcha: obj.code, //验证码
 				captcha: obj.code, //验证码
 				password: obj.password //密码
 				password: obj.password //密码
 			}).then(function(e) {
 			}).then(function(e) {

+ 3 - 3
pages/redirect/redirect.vue

@@ -41,9 +41,9 @@
 				let obj = this;
 				let obj = this;
 				let url = window.location.href;
 				let url = window.location.href;
 				let code = url.match(/code=([0-9]|[a-z]|[A-Z])*/g)[0].replace('code=', '');
 				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') || '';
 				let spread = uni.getStorageSync('spread') || '';
 				wechatAuth({
 				wechatAuth({
 					code: code,
 					code: code,

+ 82 - 0
pages/user/jkjl.vue

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

+ 31 - 17
pages/user/user.vue

@@ -29,6 +29,15 @@
 				<view class="item-right">
 				<view class="item-right">
 					>
 					>
 				</view>
 				</view>
+			</view>
+			<view class="nav-item flex" @click="tojkjl">
+				<view class="item-left flex">
+					<image src="../../static/icon/i6.png" mode="" class="img1"></image>
+					<view class="title">捐款记录</view>
+				</view>
+				<view class="item-right">
+					>
+				</view>
 			</view>
 			</view>
 			<view class="nav-item flex" @click="commonaddress">
 			<view class="nav-item flex" @click="commonaddress">
 				<view class="item-left flex">
 				<view class="item-left flex">
@@ -134,20 +143,25 @@
 		},
 		},
 		onReady() {
 		onReady() {
 			console.log(99999)
 			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: {
 		computed: {
 			...mapState('user', ['hasLogin', 'userInfo'])
 			...mapState('user', ['hasLogin', 'userInfo'])
 		},
 		},
 		methods: {
 		methods: {
-			...mapMutations('user', ['setUserInfo']),
+			...mapMutations('user', ['setUserInfo']),
+			tojkjl() {
+				uni.navigateTo({
+					url: '/pages/user/jkjl'
+				})
+			},
 			loadBaseData() {
 			loadBaseData() {
 				userinfo({}).then(({
 				userinfo({}).then(({
 					data
 					data
@@ -157,14 +171,14 @@
 				// #ifdef H5
 				// #ifdef H5
 				weixindata();
 				weixindata();
 				// #endif
 				// #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() {
 			toMyfu() {
 				uni.navigateTo({
 				uni.navigateTo({

BIN
static/icon/close.png


BIN
static/icon/erweima.jpg


+ 2 - 2
store/index.js

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

+ 22 - 84
utils/loginUtils.js

@@ -1,32 +1,7 @@
-// 获取当前页面
 export function getActionPage() {
 export function getActionPage() {
 	let pages = getCurrentPages();
 	let pages = getCurrentPages();
 	return pages[pages.length - 1]
 	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() {
 export function interceptor() {
 	let pages = getActionPage();
 	let pages = getActionPage();
@@ -35,37 +10,19 @@ export function interceptor() {
 	let url = '/pages/login/login'
 	let url = '/pages/login/login'
 	// #ifdef H5
 	// #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
 	// #endif
 	// #ifdef MP-WEIXIN
 	// #ifdef MP-WEIXIN
 	url = '/pages/public/wxLogin';
 	url = '/pages/public/wxLogin';
+	// #endif
 	if (pageUrl != url) {
 	if (pageUrl != url) {
 		uni.navigateTo({
 		uni.navigateTo({
 			url
 			url
 		})
 		})
 	}
 	}
-	// #endif
-	
 }
 }
 
 
 // 保存页面
 // 保存页面
@@ -74,44 +31,25 @@ export function saveUrl() {
 	let page = getActionPage();
 	let page = getActionPage();
 	// 获取跳转前路由地址
 	// 获取跳转前路由地址
 	let path = '/' + page.route;
 	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);
 	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({
 						uni.showLoading({
 							title: '上传中'
 							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({
 						uni.uploadFile({
 							url: config.upload_img_url, //仅为示例,非真实的接口地址
 							url: config.upload_img_url, //仅为示例,非真实的接口地址
 							filePath: path,
 							filePath: path,
 							name: 'file',
 							name: 'file',
 							header: {
 							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) => {
 							success: (uploadFileRes) => {
 								if ("string" === typeof uploadFileRes.data) {
 								if ("string" === typeof uploadFileRes.data) {

+ 21 - 23
utils/request.js

@@ -12,26 +12,26 @@ service.interceptors.response(
 		try {
 		try {
 			let res = response.data;
 			let res = response.data;
 			// 解析字符串为数字
 			// 解析字符串为数字
-			if (res.status !== 200) {
-				if (res.status == 410000) {
+			if (res.code != 1) {
+				if (res.code == 401) {
+					console.log('登录过期')
 					// 存储当前地址
 					// 存储当前地址
 					saveUrl()
 					saveUrl()
 					// 调用退出登录方法清空用户信息
 					// 调用退出登录方法清空用户信息
 					store.commit('user/logout');
 					store.commit('user/logout');
 					// 判断是否开启强制登录
 					// 判断是否开启强制登录
 					// 跳转页面
 					// 跳转页面
-					interceptor()
 					uni.showModal({
 					uni.showModal({
 						title: "您未登录!是否马上登录?",
 						title: "您未登录!是否马上登录?",
 						success: (e) => {
 						success: (e) => {
 							if (e.confirm) {
 							if (e.confirm) {
 								// 保存当前页面地址
 								// 保存当前页面地址
-						
+								interceptor()
 							}
 							}
 						}
 						}
 					})
 					})
 				} else {
 				} else {
-					if(res.msg!='系统出现异常'){
+					if (res.msg != '系统出现异常') {
 						uni.showToast({
 						uni.showToast({
 							title: res.msg,
 							title: res.msg,
 							duration: 1500,
 							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 {
 			} else {
 				return res
 				return res
 			}
 			}
@@ -64,26 +64,24 @@ service.interceptors.response(
 service.interceptors.request(
 service.interceptors.request(
 	config => {
 	config => {
 		let token = uni.getStorageSync('token') || '';
 		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) {
 		if (!config.header) {
 			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 {
 		} 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
 		return config
 	},
 	},

+ 95 - 64
utils/wxAuthorized.js

@@ -1,7 +1,11 @@
 import {
 import {
 	wechatConfig,
 	wechatConfig,
-	share
+	share,
+	getWxconfig
 } from '@/api/wx';
 } from '@/api/wx';
+import {
+	getCompany
+} from '@/api/index.js'
 import store from '../store';
 import store from '../store';
 // 保存wx对象
 // 保存wx对象
 let weixinObj = require('jweixin-module');
 let weixinObj = require('jweixin-module');
@@ -51,10 +55,10 @@ export function loginWinxin() {
 function weixinSq(data, path) {
 function weixinSq(data, path) {
 	// 微信授权后跳转页面
 	// 微信授权后跳转页面
 	try {
 	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")
 		console.log(ul, "ul")
 		// 打开微信授权页面
 		// 打开微信授权页面
-		
+
 		let url =
 		let url =
 			'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
 			'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
 			appId +
 			appId +
@@ -63,7 +67,7 @@ function weixinSq(data, path) {
 			'&response_type=code&scope=snsapi_userinfo&state=' +
 			'&response_type=code&scope=snsapi_userinfo&state=' +
 			new Date().getTime() +
 			new Date().getTime() +
 			'#wechat_redirect';
 			'#wechat_redirect';
-			console.log(url, "url")
+		console.log(url, "url")
 		window.location.href = url;
 		window.location.href = url;
 	} catch (e) {
 	} catch (e) {
 		console.log(e);
 		console.log(e);
@@ -78,54 +82,86 @@ export function weixindata(config) {
 	// 保存微信对象到全局仓库
 	// 保存微信对象到全局仓库
 	store.commit('setWeiChatObj', weixinObj)
 	store.commit('setWeiChatObj', weixinObj)
 	console.log(window.location.href);
 	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: true, // 开启调试模式,调用的所有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)
 					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) {
 function shareLoad(config) {
@@ -137,17 +173,13 @@ function shareLoad(config) {
 			desc: config.desc,
 			desc: config.desc,
 			title: config.title,
 			title: config.title,
 			success: config.success,
 			success: config.success,
-			fail: config.fail||function (e) {
+			fail: config.fail || function(e) {
 				console.log(e);
 				console.log(e);
 			}
 			}
 		}
 		}
 	} else {
 	} else {
 		// console.log(window.location.href, 55)
 		// console.log(window.location.href, 55)
 		// let url = window.location.href + '?spread=' + store.state.userInfo.uid;
 		// let url = window.location.href + '?spread=' + store.state.userInfo.uid;
-		// uni.showModal({
-		// 	title: '确认',
-		// 	content: '确认分享'
-		// })
 		let url = window.location.href;
 		let url = window.location.href;
 		url = url.replace(/[\?,&]{0,1}from=singlemessage/g, '');
 		url = url.replace(/[\?,&]{0,1}from=singlemessage/g, '');
 		mess = {
 		mess = {
@@ -155,20 +187,19 @@ function shareLoad(config) {
 			link: url, // 分享链接
 			link: url, // 分享链接
 			imgUrl: shareData.img, // 分享图标
 			imgUrl: shareData.img, // 分享图标
 			desc: shareData.synopsis,
 			desc: shareData.synopsis,
-			success: function() {
-			},
-			fail:function (e) {
+			success: function() {},
+			fail: function(e) {
 				console.log(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
 			menuList: config, // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
 		});
 		});
 	})
 	})
-	
+
 }
 }
 
 
 // export function getLoca(config) {
 // export function getLoca(config) {
@@ -199,7 +230,7 @@ export function weixinhideMenu(config) {
 // 		    }
 // 		    }
 // 		});
 // 		});
 // 	})
 // 	})
-	
+
 // }
 // }
 
 
 export default {
 export default {