1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450 |
- <template>
- <view class="content">
- <!-- 轮播 -->
- <view class="carousel-section">
- <swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
- <swiper-item v-for="item in carouselList" :key="item.id">
- <image :src="baseURL + item.image"></image>
- </swiper-item>
- </swiper>
- </view>
- <!-- 分类 -->
- <view class="cate-section flex">
- <view class="cate-item flex" @click="tocontribution">
- <view class="img-wrapper flex">
- <image src="../../static/icon/icon1.png" mode="" class="img1"></image>
- </view>
- <view class="item-title">遗体器官捐献</view>
- </view>
- <view class="cate-item flex" @click="toapplic">
- <view class="img-wrapper flex">
- <image src="../../static/icon/icon2.png" mode="" class="img2"></image>
- </view>
- <view class="item-title">造血干细胞捐献</view>
- </view>
- <view class="cate-item flex" @click="toOrgan">
- <view class="img-wrapper flex">
- <image src="../../static/icon/icon3.png" mode="" class="img3"></image>
- </view>
- <view class="item-title">培训报名</view>
- </view>
- <view class="cate-item flex" @click="tohelpActi">
- <view class="img-wrapper flex">
- <image src="../../static/icon/icon4.png" mode="" class="img4"></image>
- </view>
- <view class="item-title">志愿者登记</view>
- </view>
- </view>
- <!-- 荆州爱心红会 -->
- <!-- <view class="red-box">
- <top-title :title="'爱心红会'"></top-title>
- <view class="red-nav flex">
- <view class="left-nav" @click="navTo('/pages/donate/donate')"></view>
- <view class="right-nav flex">
- <view class="right-top-nav" @click="navTo('/pages/donate/idonate?type=1')"></view>
- <view class="right-bottom-nav flex">
- <view class="left-item" @click="navTo('/pages/applic/love')"></view>
- <view class="right-item" @click="navTo('/pages/applic/science')"></view>
- </view>
- </view>
- </view>
- </view> -->
- <!-- 低配爱心红会 -->
- <view class="red-box">
- <top-title :title="'爱心红会'"></top-title>
- <view class="red-nav">
- <view class="nav-item" @click="navTo('/pages/applic/love')">
- <image src="../../static/img/n1.png" mode=""></image>
- </view>
- <view class="nav-item" @click="navTo('/pages/applic/science')">
- <image src="../../static/img/n2.png" mode=""></image>
- </view>
- </view>
- </view>
- <!-- sos急救系统 -->
- <view class="system">
- <top-title :title="'救在身边'" navurl="/pages/applic/location" :show_more="true"></top-title>
- <view class="system-map">
- <map class="map-box" show-location :markers="jzsbmarker" :scale="scale" :latitude="latitude4"
- :longitude="longitude4" ref="map" @markertap="markertap" :show-location="false"></map>
- </view>
- <view class="" style="padding-top: 80rpx;">
- <view v-for="(item,index) in jzsblist" :key="item.id">
- <view class="location-item">
- <view class="box-left">
- <view class="img01">
- <image src="../../static/img/line01.png" mode=""></image>
- </view>
- <view class="img02" v-if="item.info !=null">
- <image src="../../static/img/002.png" mode=""></image>
- </view>
- <view class="img02" v-else>
- <image src="../../static/img/002.png" mode=""></image>
- </view>
- <view class="info">
- <view class="info-header">
- <view class="name">
- 救护员{{ index +1 }}
- </view>
- <view class="distance">
- {{item.range >= 1 ? (item.range + 'km') : (item.distance + 'm')}}
- </view>
- <view class="location-icon">
- <image src="../../static/img/location-icon.png" mode=""></image>
- </view>
- </view>
- <view class="address">
- {{ item.address }}
- </view>
- </view>
- </view>
- <view class="box-right">
- <view class="img" v-if="item.is_create == 0" @click="rescue(item,index)">
- <image src="../../static/img/rescue.png" mode=""></image>
- </view>
- <view class="called" v-else>
- 已呼叫
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="list-box">
- <view class="system-title">
- <top-title :title="'救护站'" :navurl="'/pages/applic/aid'" :show_more="true"></top-title>
- </view>
- <view id="container">
- <map class="map-box" show-location :markers="jhzmarker" :scale="scale" :latitude="latitude4"
- :longitude="longitude4" ref="map" style="height: 450rpx" @markertap="jhzmarkertap"
- :show-location="false"></map>
- </view>
- <view class="">
- <view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in Mechanism"
- :key="item.id">
- <template>
- <view class="list-left">
- <view class="info">
- <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">{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}</view>
- </view>
- </template>
- </view>
- <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
- </view>
- </view>
- <view class="list-box" style="margin-top: 20rpx;">
- <view class="system-title">
- <top-title :title="'智能AED'" :navurl="'/pages/applic/aed'" :show_more="true"></top-title>
- </view>
- <view id="container">
- <map class="map-box" show-location :markers="aedmarker" :scale="scale" :latitude="latitude4"
- :longitude="longitude4" ref="map" style="height: 450rpx" @markertap="aedmarkertap"
- :show-location="false"></map>
- </view>
- <view class="">
- <view class="list-tpl flex" @click="openAddress(item)" v-for="(item, index) in AEDList" :key="item.id">
- <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">{{ item.range >=1 ? (item.range + 'km') : (item.distance + 'm') }}m</view>
- </view>
- </template>
- </view>
- </view>
- </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="popup2" type="center" @click="close2">
- <view class="popup_row2">
- <view class="title">
- <view class="title-left">
- 请输入您的手机号,等待救援!
- </view>
- <view class="cancel" @click="cancel">
- <image src="../../static/img/cancel1.png" mode=""></image>
- </view>
- </view>
- <view class="inpBox">
- <input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone" />
- </view>
- <view class="inpedit">
- 可在方框中修改您的手机号
- </view>
- <view class="comfirm">
- <view class="comfirm1" @click="comfirm1()">
- 确认
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- getAed,
- getAidList,
- getRescuerList,
- sos,
- geocoder
- } from '@/api/category.js'
- import {
- loadIndexs,
- bannerlist,
- getListAED,
- getDistance,
- getListMechanism,
- getdis,
- tocall
- } from '@/api/index.js';
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- userinfo
- } from '@/api/user.js';
- import uniPopup from '@/components/uni-popup/uni-popup.vue';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import {
- getLoca
- } from '@/utils/wxAuthorized.js';
- import {
- getcomAddress
- } from '@/api/index.js';
- import topTitle from '../../components/top-title/top-title.vue';
- export default {
- components: {
- uniPopup,
- uniLoadMore,
- topTitle
- },
- data() {
- return {
- user_address: '',
- shareShow: true,
- user_id: '',
- rescuers_id: '',
- name: '',
- uid: '',
- phone: '',
- to_phone: '',
- jzsbmarker: [],
- jzsblist: [],
- jhzmarker: [],
- aedmarker: [],
- carouselList: [], //轮播
- science: [], //文章列表
- page: 1,
- limit: 10,
- AEDList: [],
- Mechanism: [],
- latitude2: '',
- longitude2: '',
- latitude4: '',
- longitude4: '',
- address: '',
- loadingType: 'more',
- markerList: [],
- marker: [],
- longitude: '121.15829821166992',
- latitude: '30.044394499237708',
- longitude1: '120.553638',
- latitude1: '30.547011',
- scale: '12', //地图缩放程度
- scale1: '15',
- showbox: false,
- showTEXT: false,
- addressData: {
- name: '',
- mobile: '',
- latitude: 0, //纬度
- longitude: 0, //经度
- address: {
- province: '',
- city: '',
- district: '',
- detail: ''
- },
- area: '',
- default: false
- }
- };
- },
- onShow() {
- saveUrl();
- // let token = uni.getStorageSync('token');
- console.log(11, this);
- if (!this.hasLogin) {
- // 登录拦截
- // interceptor();
- uni.showModal({
- title: '登录',
- content: '您未登录,是否马上登陆?',
- success: e => {
- if (e.confirm) {
- interceptor();
- }
- },
- fail: e => {
- console.log(e);
- }
- });
- } else {
- // this.loadData();
- }
- },
- onLoad() {
- this.loadIndex()
- saveUrl();
- let obj = this;
- let weichatBrowser = uni.getStorageSync('weichatBrowser')
- if (weichatBrowser) {
- 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: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude;
- obj.latitude4 = res.latitude;
- obj.marker = [{
- longitude: res.longitude,
- latitude: res.latitude,
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45'
- }];
- obj.loadData();
- },
- fail(e) {
- console.log('失败', e);
- // window.location.reload();
- }
- });
- });
- // #endif
- // #ifdef MP
- locationAddress({
- type: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude;
- obj.latitude4 = res.latitude;
- obj.marker = [{
- longitude: res.longitude,
- latitude: res.latitude,
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45'
- }];
- obj.loadData();
- },
- fail(e) {
- console.log('失败', e);
- obj.tishi()
- }
- });
- // #endif
- } catch (e) {
- let locationAddress;
- // #ifdef H5
- let wxOjb = require('jweixin-module');
- locationAddress = wxOjb.getLocation;
- // #endif
- // #ifdef MP
- locationAddress = uni.getLocation;
- // #endif
- // #ifdef H5
- wxOjb.ready(() => {
- console.log('加载完毕注册事件');
- locationAddress({
- type: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude;
- obj.latitude4 = res.latitude;
- obj.loadData();
- },
- fail(e) {
- console.log('失败', e);
- obj.tishi()
- }
- });
- });
- // #endif
- // #ifdef MP
- locationAddress({
- type: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude;
- obj.latitude4 = res.latitude;
- obj.loadData();
- },
- fail(e) {
- console.log('失败', e);
- obj.tishi()
- }
- });
- // #endif
- }
- } else {
- uni.getLocation({
- type: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude;
- obj.latitude4 = res.latitude;
- obj.marker = [{
- longitude: res.longitude,
- latitude: res.latitude,
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45'
- }];
- obj.loadData();
- },
- fail(e) {
- console.log('失败', e);
- // window.location.reload();
- }
- })
- }
- },
- computed: {
- ...mapState('user', ['userInfo', 'hasLogin']),
- ...mapState(['baseURL']),
- },
- // 下拉加载
- // onReachBottom() {
- // this.loadData();
- // },
- methods: {
- ...mapMutations('user', ['setUserInfo']),
- loadIndex() {
- let obj = this;
- loadIndexs({}).then(({
- data
- }) => {
- console.log(data, 'index')
- // this.carouselList = data.banner.map((e) => {
- // if(e.image.indexOf('http')<0){
- // e.image += obj.baseURL
- // }
- // return e
- // }); //轮播图
- this.carouselList = data.banner
- });
- },
- tocontribution() {
- uni.navigateTo({
- // url: "/pages/applic/contribution"
- url: '/pages/form/applicationForm'
- });
- },
- //提示
- tishi() {
- uni.showModal({
- title: '提示',
- content: '获取当前位置信息失败,是否刷新页面。',
- success: function(res) {
- if (res.confirm) {
- window.location.reload();
- console.log('用户点击确定');
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- },
- // 调用高德
- toGaodeMap() {
- let latitude = this.latitude2;
- let longitude = this.longitude2;
- let address = this.address;
- console.log('选择高德', latitude, longitude, address);
- // window.location.href = 'https://uri.amap.com/marker?position=30.537043,120.567191&name=浙江省嘉兴市桐乡市高桥镇高桥大道51号'
- window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`;
- // window.location.href = `http://uri.amap.com/navigation?from=114.02597366,22.54605355&to=114.029243,22.609562&mode=car&src=nyx_super`
- // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super
- },
- // 调用腾讯
- totengxunMap() {
- let latitude = this.latitude2;
- let longitude = this.longitude2;
- let address = this.address;
- console.log('选择腾讯', latitude, longitude);
- window.location.href =
- `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
- },
- // 调用百度
- tobaiDuMap() {
- let latitude = this.latitude2;
- let longitude = this.longitude2;
- let latitude6 = this.latitude4;
- let longitude6 = this.longitude4;
- let address = this.address;
- console.log('选择百度', latitude, longitude);
- console.log('获取当前经纬度', latitude6, longitude6);
- window.location.href =
- `http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving®ion=${address}&output=html&src=webapp.baidu.openAPIdemo`;
- //`bdapp://map/navi?location=${longitude},${latitude}&coord_type=gc02&title=${address}&content=${address}&output=html&src=andr.baidu.openAPIdemo `
- },
- // 调用谷歌
- toGoogleMap() {
- let latitude = this.latitude2;
- let longitude = this.longitude2;
- console.log('选择谷歌', latitude, longitude);
- },
- tolocation() {
- uni.navigateTo({
- url: '/pages/applic/location'
- });
- },
- toapplic() {
- uni.navigateTo({
- url: '/pages/applic/appliSystem'
- });
- },
- tohelpActi() {
- uni.navigateTo({
- // url: "/pages/applic/tohelpActi"
- url: '/pages/form/tovolApply'
- });
- },
- toOrgan() {
- console.log('kepuxingbaoming');
- uni.navigateTo({
- url: '/pages/train/index'
- });
- },
- // 点击图标
- markertap(e) {
- console.log(e.target.markerId);
- this.$refs.popup.open();
- let obj = this;
- for (let i = 0; i < obj.marker.length; i++) {
- if (e.target.markerId == obj.marker[i].id) {
- obj.latitude2 = obj.marker[i].latitude;
- obj.longitude2 = obj.marker[i].longitude;
- obj.address = obj.marker[i].address;
- }
- }
- },
- aedmarkertap(e) {
- console.log(e.target.markerId);
- let obj = this;
- for (let i = 0; i < obj.aedmarker.length; i++) {
- if (e.target.markerId == obj.marker[i].id) {
- obj.latitude2 = obj.marker[i].latitude;
- obj.longitude2 = obj.marker[i].longitude;
- obj.address = obj.marker[i].address;
- }
- }
- obj.$refs.popup.open();
- },
- jhzmarkertap(e) {
- console.log(e.target.markerId);
- let obj = this;
- for (let i = 0; i < obj.jhzmarker.length; i++) {
- if (e.target.markerId == obj.marker[i].id) {
- obj.latitude2 = obj.marker[i].latitude;
- obj.longitude2 = obj.marker[i].longitude;
- obj.address = obj.marker[i].address;
- }
- }
- obj.$refs.popup.open();
- },
- loadData() {
- let obj = this;
- console.log('打印当前经纬度', obj.longitude4, obj.latitude4);
- geocoder({
- latitude: obj.latitude4,
- longitude: obj.longitude4
- }).then(ress => {
- console.log(ress)
- obj.user_address = ress.data.result.address
- console.log(obj.user_address, 'obj.user_address')
- })
- userinfo({}).then(({
- data
- }) => {
- obj.setUserInfo(data);
- obj.to_phone = data.mobile || ''
- });
- if (obj.loadingType === 'noMore') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- obj.loadingType = 'loading';
- getAed({
- longitude: obj.longitude4,
- latitude: obj.latitude4,
- page: 1,
- limit: 2
- }).then(({
- data
- }) => {
- console.log(data, 999);
- // obj.AEDList = data
- for (let i = 0; i < data.length; i++) {
- data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i]
- .longitude);
- }
- obj.AEDList = data;
- let arr = data.map(item => ({
- latitude: item.latitude,
- longitude: item.longitude,
- iconPath: '/static/img/img014.png',
- width: '35',
- height: '35',
- id: item.id,
- address: item.address
- }));
- obj.aedmarker = obj.marker.concat(arr)
- console.log(obj.AEDList, '999++++++++++++++++++++++++++');
- obj.markerList = data;
- });
- getAidList({
- page: 1,
- limit: 2,
- longitude: obj.longitude4,
- latitude: obj.latitude4,
- }).then(({
- data
- }) => {
- console.log(data, '机构+++++++++++++')
- for (let i = 0; i < data.length; i++) {
- data[i].space = obj.space(obj.latitude4, obj.longitude4, data[i].latitude, data[i]
- .longitude);
- }
- let arr = data.map(item => ({
- latitude: item.latitude,
- longitude: item.longitude,
- iconPath: '/static/img/img014.png',
- width: '35',
- height: '35',
- id: item.id,
- address: item.address
- }));
- obj.jhzmarker = obj.marker.concat(arr)
- obj.Mechanism = data;
- console.log(obj.Mechanism, '888++++++++++++++++++++++++++');
- })
- getRescuerList({
- longitude: obj.longitude4,
- latitude: obj.latitude4,
- page: 1,
- limit: 2
- }).then((res) => {
- let data = res.data;
- data = data.slice(0, 2)
- console.log('就在身边请求数据', data);
- console.log('data.phone333', data.phone)
- data = data.map(d => {
- return {
- ...d,
- iscall: true
- }
- })
- obj.jzsblist = data;
- let arr = data.map(item => ({
- latitude: item.latitude,
- longitude: item.longitude,
- iconPath: '/static/img/img014.png',
- width: '35',
- height: '35',
- id: item.id,
- address: item.address
- }))
- obj.jzsbmarker = obj.marker.concat(arr)
- }).catch(err => {
- console.log(err);
- });
- },
- // 导航
- openAddress(item) {
- let obj = this;
- obj.latitude2 = item.latitude;
- obj.longitude2 = item.longitude;
- obj.address = item.address;
- this.$refs.popup.open();
- },
- Jump(item) {
- // console.log(item);
- if (item.url != '') {
- window.open(item.url);
- return;
- }
- uni.navigateTo({
- url: '/pages/applic/info?id=' + item.id
- });
- },
- open() {
- this.$refs.popup.open();
- },
- close() {
- this.$refs.popup.close();
- },
- navTo(url) {
- uni.navigateTo({
- url
- });
- },
- space(lat1, lng1, lat2, lng2) {
- console.log(lat1, lng1, lat2, lng2);
- var radLat1 = (lat1 * Math.PI) / 180.0;
- var radLat2 = (lat2 * Math.PI) / 180.0;
- var a = radLat1 - radLat2;
- var b = (lng1 * Math.PI) / 180.0 - (lng2 * Math.PI) / 180.0;
- var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math
- .pow(Math.sin(b / 2), 2)));
- s = s * 6378.137;
- s = Math.round(s * 10000) / 10000;
- return s * 1000; // 单位米
- },
- // 立即救援
- rescue(item, index) {
- let obj = this;
- console.log(item, 'jiuzhu item')
- uni.showModal({
- content: '是否发起求救?',
- success: res => {
- if (res.confirm) {
- this.$refs.popup2.open(item, index);
- obj.rescuers_id = item.id
- obj.user_id = item.user_id
- }
- }
- })
- },
- close2() {
- this.$refs.popup2.close()
- },
- comfirm1: function() {
- let obj = this
- if (obj.to_phone.toString().trim() == '') {
- return obj.$api.msg('请输入手机号码')
- } else {
- console.log('obj.to_phone1111', obj.to_phone)
- const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
- if (!reg.test(obj.to_phone)) {
- obj.$api.msg('请填写正确的手机号码');
- return;
- }
- sos({
- mobile: obj.to_phone,
- address: obj.user_address,
- latitude: obj.latitude4,
- longitude: obj.longitude4,
- rescuers_id: obj.rescuers_id,
- rescuers_user_id: obj.user_id,
- re_url: obj.$store.state.baseURL + '/index/#/pages/applic/rescuerecords'
- }).then(res => {
- uni.showModal({
- title: '请耐心等待救援',
- success: res => {
- if (res.confirm) {
- window.location.reload(); //重新刷新页面
- }
- }
- })
- obj.$refs.popup2.close();
- })
- }
- },
- }
- };
- </script>
- <style lang="scss">
- a {
- text-decoration: none;
- color: #5f5f5f;
- }
- .content {
- // line-height: 1;
- background-color: #ffabab;
- // padding-bottom: 60rpx;
- }
- .popup_row {
- width: 100%;
- height: 500rpx;
- background-color: #ffffff;
- border-radius: 20rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- .rows {
- 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;
- // }
- }
- }
- .content {
- background-color: #f8f8f8;
- height: 100%;
- /* 头部 轮播图 */
- .carousel-section {
- // padding-top: 10px;
- overflow: hidden;
- background-color: #fff;
- .carousel {
- width: 705rpx;
- height: 375rpx;
- margin: 0 auto;
- border-radius: 20rpx;
- overflow: hidden;
- .carousel-item {
- width: 100%;
- height: 100%;
- padding-left: 30rpx;
- padding-right: 30rpx;
- overflow: hidden;
- }
- image {
- width: 100%;
- height: 375rpx;
- border-radius: 20rpx;
- }
- }
- }
- // 分类
- .cate-section {
- justify-content: space-around;
- background-color: #fff;
- padding: 46rpx 0 30rpx;
- .cate-item {
- width: 25%;
- flex-direction: column;
- text-align: center;
- align-items: center;
- justify-content: center;
- .img-wrapper {
- width: 100rpx;
- height: 88rpx;
- background: #eef4ff;
- border-radius: 14rpx;
- position: relative;
- image {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- .img1 {
- width: 100rpx;
- height: 84rpx;
- }
- .img2 {
- width: 100rpx;
- height: 85rpx;
- }
- .img3 {
- width: 100rpx;
- height: 84rpx;
- }
- .img4 {
- width: 100rpx;
- height: 88rpx;
- }
- }
- .item-title {
- margin-top: 15rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- }
- }
- // 红会科普
- .science-section {
- width: 100%;
- background-color: #ffffff;
- margin-top: 18rpx;
- padding-top: 30rpx;
- .science-title {
- display: flex;
- justify-content: center;
- align-items: center;
- padding-bottom: 22rpx;
- .title {
- width: 285rpx;
- height: 64rpx;
- background-color: #ca121e;
- border-radius: 32rpx;
- color: #ffffff;
- font-size: 32rpx;
- line-height: 64rpx;
- text-align: center;
- }
- image {
- width: 68rpx;
- height: 43rpx;
- margin-left: 16rpx;
- margin-right: 16rpx;
- }
- }
- .science-box {
- padding-left: 15rpx;
- padding-right: 15rpx;
- padding-bottom: 20rpx;
- border-bottom: 1rpx solid #f0f0f0;
- white-space: nowrap;
- display: flex;
- width: 100%;
- // .uni-scroll-view-content{
- // display: flex;
- // }
- .science-content {
- // width: 100%;
- // display: flex;
- display: -webkit-box;
- .science-item {
- margin-right: 24rpx;
- width: 198rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- image {
- width: 100%;
- height: 145rpx;
- }
- .article-title {
- width: 198rpx;
- color: #333;
- font-size: 25rpx;
- padding-top: 20rpx;
- padding-bottom: 16rpx;
- font-weight: 900;
- }
- .article-content {
- width: 198rpx;
- color: #999999;
- font-size: 18rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- }
- }
- }
- .science-more {
- display: flex;
- justify-content: center;
- align-items: center;
- color: #cb131c;
- font-size: 30rpx;
- padding-top: 18rpx;
- padding-bottom: 18rpx;
- image {
- width: 20rpx;
- height: 27rpx;
- }
- }
- }
- // sos急救中心
- .system {
- width: 100%;
- background-color: #ffffff;
- margin-top: 18rpx;
- padding: 40rpx 30rpx 35rpx 30rpx;
- margin-bottom: 20rpx;
- .system-map {
- margin: 30rpx auto 0;
- width: 689rpx;
- height: 312rpx;
- background-color: #ffffff;
- padding-bottom: 45rpx;
- }
- }
- // AED
- .list-box {
- padding: 0rpx 25rpx 24rpx;
- 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;
- 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;
- }
- }
- }
- }
- // 高配爱心红会
- // .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;
- // .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;
- padding: 30rpx 30rpx 40rpx 30rpx;
- background-color: #fff;
- .red-nav {
- padding-top: 25rpx;
- display: flex;
- justify-content: space-between;
- .nav-item {
- width: 330rpx;
- height: 175rpx;
- background: #FFF4F2;
- border-radius: 15rpx;
- image {
- width: 330rpx;
- height: 175rpx;
- }
- }
- }
- }
- .popup_row2 {
- // margin-top: 108rpx;
- height: 440rpx;
- border-radius: 25rpx;
- width: 100%;
- padding: 24rpx;
- background-color: #f8f8f8;
- z-index: 999;
- .title {
- border-bottom: 2rpx solid #F2F2F2;
- color: #E63931;
- font-size: 32rpx;
- padding-left: 4rpx;
- padding-bottom: 16rpx;
- display: flex;
- justify-content: space-between;
- // align-items: center;
- .cancel {
- margin-left: 52rpx;
- width: 36rpx;
- height: 36rpx;
- image {
- width: 36rpx;
- height: 36rpx;
- }
- }
- }
- .inpBox {
- margin-top: 52rpx;
- border: 2px solid #f2f2f2;
- padding: 12rpx 24rpx;
- color: #FF9797;
- border-radius: 8rpx;
- .input-placeholder {
- // height: 70rpx;
- font-size: 32rpx;
- color: #FF9797;
- }
- }
- .inpedit {
- margin-top: 24rpx;
- margin-left: 14rpx;
- font-size: 28rpx;
- color: #FF9797;
- }
- .comfirm {
- display: flex;
- justify-content: flex-end;
- margin-top: 54rpx;
- .comfirm1 {
- padding: 12rpx 24rpx;
- border-radius: 12rpx;
- color: #FFFFFF;
- background-color: #E63931;
- }
- }
- }
- .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;
- }
- }
- }
- .ewm {
- width: 75rpx;
- height: 75rpx;
- position: absolute;
- right: 10rpx;
- bottom: 200rpx;
- background-color: #fff;
- border-radius: 50%;
- box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: 0.6);
- image {
- width: 50rpx;
- height: 50rpx;
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- margin: auto;
- }
- .ewm-tit {
- position: absolute;
- bottom: 10rpx;
- font-size: 10rpx;
- }
- .closeEwm {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- top: -40rpx;
- right: -20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- </style>
|