123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437 |
- <template>
- <view class="content">
- <!-- 轮播 -->
- <view class="carousel-section">
- <swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
- <swiper-item v-for="item in carouselList">
- <image :src="item.pic"></image>
- </swiper-item>
- </swiper>
- </view>
- <!-- 分类 -->
- <view class="cate-section">
- <view class="cate-item" @click="tocontribution">
- <image src="../../static/icon/icon1.png"></image>
- <text>器官捐献</text>
- </view>
- <!-- <a href="http://yyhszh.yygrwhg.com/willsoft/deyy/MobileView_look.aspx?news_id=1" title="爱心捐赠">
- <view class="cate-item">
- <image src="../../static/icon/icon3.png" style="width: 87(vw/7.5);height: 64(vw/7.5);"></image>
- <text>爱心捐赠</text>
- </view>
- </a> -->
- <view class="cate-item" @click="toapplic">
- <view class="cate-item">
- <image src="../../static/icon/icon2.png"></image>
- <text>造血干细胞捐献</text>
- </view>
- </view>
- <!-- <navigator 知识>
- <view class="cate-item">
- <image src="../../static/img/icon.png"></image>
- <a title="器官捐赠" href="https://register.codac.org.cn/wx/html/notice.htm">器官捐赠</a>
- </view>
- </navigator> pages/applic/tohelpActi organ-->
- <!-- <a href="https://register.codac.org.cn/wx/html/notice.htm" title="器官捐献"> -->
- <view class="cate-item" @click="toOrgan">
- <image src="../../static/icon/icon3.png"></image>
- <text>普及培训报名</text>
- </view>
- <!-- </a> -->
- <view>
- <view class="cate-item" @click="tohelpActi">
- <image src="../../static/icon/icon4.png" image>
- <text>志愿者登记</text>
- </view>
- </view>
- </view>
- <!-- 红会科普 -->
- <view class="science-section">
- <view class="science-title">
- <image src="../../static/img/wings-left.png" mode=""></image>
- <view class="title">红会科普</view>
- <image src="../../static/img/wings-right.png" mode=""></image>
- </view>
- <scroll-view class="science-box" scroll-x>
- <view class="science-content">
- <view class="science-item" v-for="(item, index) in science" @click="Jump(item)">
- <image :src="item.image_input[0]" mode=""></image>
- <view class="article-title word1_ellipsis">{{ item.title }}</view>
- <view class="article-content">{{ item.synopsis }}</view>
- </view>
- </view>
- </scroll-view>
- <navigator class="science-more" url="/pages/applic/science">
- 查看更多
- <image src="../../static/icon/moreRight.png" mode=""></image>
- <image src="../../static/icon/moreRight.png" mode=""></image>
- </navigator>
- </view>
- <!-- sos急救系统 -->
- <view class="system">
- <view class="system-title">
- <view class="img">
- <image src="../../static/img/wings-left.png"></image>
- </view>
- <view class="title" @click="tolocation">救在身边</view>
- <view class="img">
- <image src="../../static/img/wings-right.png"></image>
- </view>
- </view>
- <view class="system-map">
- <map @click="tolocation" :show-location="false" class="map-box" id="mapjzsb" :markers="markerjzsb"
- :scale="scale" :latitude="latitude4" :longitude="longitude4" ref="mapjzsb"
- style="height: 60vw"></map>
- <!-- <view class="map-box" @click="tolocation"><image src="../../static/img/map.jpg" mode=""></image></view> -->
- </view>
- </view>
- <view v-for="(item, index) in jzsbList">
- <view class="location-item">
- <view class="box-left">
- <view class="img01">
- <image src="../../static/img/line01.png" mode=""></image>
- </view>
- <view class="img02">
- <image src="../../static/img/002.png" mode=""></image>
- </view>
- <!-- <view class="img02" v-else><image src="../../static/img/missing-face.png" mode=""></image></view> -->
- <view class="info">
- <view class="info-header">
- <view class="name">救护员{{ index + 1 }}</view>
- <view class="distance">{{ item.num }}km</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" @click="rescue(item, index)">
- <view class="img" v-if="!item.is">
- <image src="../../static/img/rescue.png" mode=""></image>
- </view>
- <view class="called" v-if="item.is">已呼叫</view>
- </view>
- </view>
- </view>
- <navigator class="science-more" url="/pages/applic/location">
- 查看更多
- <image src="../../static/icon/moreRight.png" mode=""></image>
- <image src="../../static/icon/moreRight.png" mode=""></image>
- </navigator>
- <view class="list-box">
- <view class="system-title">
- <view class="img">
- <image src="../../static/img/wings-left.png"></image>
- </view>
- <view class="title">救护站</view>
- <view class="img">
- <image src="../../static/img/wings-right.png"></image>
- </view>
- </view>
- <view>
- <map class="map-box" id="map" :show-location="false" :markers="marker" :scale='scale'
- :latitude="latitude4" :longitude="longitude4" ref="map" style="height: 60vw" @markertap='markertap'>
- </map>
- </view>
- <view class="">
- <view class="list-tpl flex" @click="openAddress(item)" v-for="(item,index) in AEDList">
- <view class="list-left">
- <view class="number">{{ index + 1 }}</view>
- <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">导航</view>
- </view>
- </view>
- <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
- </view>
- <navigator class="science-more" url="/pages/applic/aid">
- 查看更多
- <image src="../../static/icon/moreRight.png" mode=""></image>
- <image src="../../static/icon/moreRight.png" mode=""></image>
- </navigator>
- </view>
- <!-- 博爱驿站 -->
- <view class="list-box">
- <view class="system-title">
- <view class="img">
- <image src="../../static/img/wings-left.png"></image>
- </view>
- <view class="title">博爱驿站</view>
- <view class="img">
- <image src="../../static/img/wings-right.png"></image>
- </view>
- </view>
- <view>
- <map class="map-box" id="map" :show-location="false" :markers="yzmarker" :scale='scale'
- :latitude="latitude4" :longitude="longitude4" ref="map" style="height: 60vw" @markertap='markertap'>
- </map>
- </view>
- <view class="">
- <view class="list-tpl flex" @click="openAddress(item)" v-for="(item,index) in yzList">
- <view class="list-left">
- <view class="number">{{ index + 1 }}</view>
- <view class="info">
- <view class="title">{{ item.name }}</view>
- <view class="addr">地址:{{ item.detailed_address }}</view>
- </view>
- </view>
- <view class="image">
- <image src="../../static/img/img10.png"></image>
- <view class="tip">导航</view>
- </view>
- </view>
- <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
- </view>
- <navigator class="science-more" url="/pages/applic/yz">
- 查看更多
- <image src="../../static/icon/moreRight.png" mode=""></image>
- <image src="../../static/icon/moreRight.png" mode=""></image>
- </navigator>
- </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="popups" type="center">
- <view class="popup_rows">
- <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 {
- loadIndexs,
- bannerlist,
- getListAED,
- getDistance,
- getdis,
- getListMechanism
- } 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';
- export default {
- components: {
- uniPopup,
- uniLoadMore
- },
- data() {
- return {
- yzList: [],
- yzmarker: [],
- to_phone: '',
- jzsbList: [],
- carouselList: [], //轮播
- science: [], //文章列表
- page: 1,
- limit: 10,
- AEDList: [],
- latitude2: '',
- longitude2: '',
- latitude4: '',
- longitude4: '',
- address: '',
- loadingType: 'more',
- markerList: [],
- marker: [],
- marker1: [],
- markerjzsb: [],
- longitude: '121.44297',
- latitude: "28.67307",
- 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
- },
- baseLongitude: 114.316738,
- baseLatitude: 30.353495,
- baseMarker: [{
- id: 'baseAddr',
- latitude: 30.353495,
- longitude: 114.316738,
- iconPath: '../../static/img/location-icon.png'
- }]
- };
- },
- 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.getJzsb()
- // uni.showModal({
- // content: '请选择您当前位置',
- // success: res => {
- // if (res.confirm) {
- // this.chooseAddress()
- // }
- // }
- // })
- saveUrl()
- 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: '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.marker1 = [{
- longitude: res.longitude,
- latitude: res.latitude,
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- },
- fail(e) {
- console.log('失败', e);
- obj.longitude4 = '114.316738'
- obj.latitude4 = '30.353495'
- obj.marker = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }, ]
- obj.marker1 = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- }
- });
- })
- // #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.marker1 = [{
- longitude: res.longitude,
- latitude: res.latitude,
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- },
- fail(e) {
- console.log('失败', e);
- obj.longitude4 = '114.316738'
- obj.latitude4 = '30.353495'
- obj.marker = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }, ]
- obj.marker1 = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- }
- });
- // #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();
- obj.getJzsb()
- },
- fail(e) {
- console.log('失败', e);
- obj.longitude4 = '114.316738'
- obj.latitude4 = '30.353495'
- obj.marker = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }, ]
- obj.marker1 = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- }
- });
- })
- // #endif
- // #ifdef MP
- locationAddress({
- type: 'gcj02',
- success: function(res) {
- console.log('获取经纬度', res);
- obj.longitude4 = res.longitude
- obj.latitude4 = res.latitude
- obj.loadData();
- obj.getJzsb()
- },
- fail(e) {
- console.log('失败', e);
- obj.longitude4 = '114.316738'
- obj.latitude4 = '30.353495'
- obj.marker = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }, ]
- obj.marker1 = [{
- longitude: '114.316738',
- latitude: '30.353495',
- iconPath: '/static/img/img19.png',
- width: '45',
- height: '45',
- }]
- obj.loadData();
- obj.getJzsb()
- }
- });
- // #endif
- }
- },
- computed: {
- ...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
- },
- // 下拉加载
- onReachBottom() {
- this.loadData();
- },
- methods: {
- ...mapMutations('user', ['setUserInfo']),
- cancel() {
- this.$refs.popups.close();
- },
- comfirm1: function() {
- let obj = this;
- if (obj.to_phone.toString().trim() == '') {
- // uni.showModal({
- // title:'输入框为空',
- // // content:JSON.stringify(obj)
- // })
- } 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;
- }
- 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.longitude4,
- latitude: obj.latitude4,
- to_phone: obj.to_phone
- }).then(data => {
- console.log(99988, data);
- uni.showModal({
- title: '请耐心等待救援',
- success: res => {
- if (res.confirm) {
- window.location.reload(); //重新刷新页面
- }
- }
- });
- obj.$refs.popups.close();
- obj.iscall = false;
- console.log(123, obj.iscall);
- });
- }
- },
- // 立即救援
- rescue(item, index) {
- let obj = this;
- uni.showModal({
- content: '是否发起求救?',
- success: res => {
- if (res.confirm) {
- this.$refs.popups.open(item, index);
- obj.name = item.name;
- obj.uid = item.uid;
- obj.phone = item.phone;
- obj.iscall = false;
- console.log('点击救援时item.phone:', obj.phone);
- }
- }
- });
- },
- tocontribution() {
- uni.navigateTo({
- // url: "/pages/applic/contribution"
- url: "/pages/form/applicationForm"
- })
- },
- // 调用高德
- 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"
- })
- },
- space(lat1 = 0, lng1 = 0, 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; // 单位米
- },
- 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;
- // uni.showModal({
- // title: '坐标',
- // content: JSON.stringify(obj.marker[i]),
- // success() {
- // uni.showModal({
- // title: '成功',
- // content: obj.marker[i].latitude
- // })
- // }
- // })
- }
- }
- },
- loadData() {
- let obj = this;
- console.log('打印当前经纬度', obj.longitude4, obj.latitude4)
- if(!obj.longitude4) {
- obj.longitude4 = '114.316738'
- obj.latitude4 = '30.353495'
- }
- userinfo({}).then(({
- data
- }) => {
- obj.setUserInfo(data);
- loadIndexs({}).then(({
- data
- }) => {
- obj.carouselList = data.banner; //轮播图
- bannerlist().then(({
- data
- }) => {
- console.log(data);
- obj.science = data;
- });
- });
- });
- if (obj.loadingType === 'noMore') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- obj.loadingType = 'loading';
- // getListAED({
- // page: obj.page,
- // limit: obj.limit
- // }).then(({
- // data
- // }) => {
- // console.log(data, 999)
- // // obj.AEDList = data
- // obj.AEDList = obj.AEDList.concat(data);
- // obj.markerList = data
- // obj.page++;
- // if (obj.limit == data.length) {
- // obj.loadingType = 'more';
- // } else {
- // obj.loadingType = 'noMore';
- // }
- // })
- getDistance({
- lng1: obj.longitude4,
- lat1: obj.latitude4
- }).then(({
- data
- }) => {
- console.log(data, 980)
- obj.AEDList = data
- obj.AEDList = data.slice(0, 5)
- let arr = data.map(item => ({
- latitude: item.latitude,
- longitude: item.longitude,
- iconPath: '/static/icon/jzsb.png',
- width: '35',
- height: '35',
- id: item.id,
- address: item.address
- }))
- obj.marker = obj.marker.concat(arr)
- obj.marker = obj.marker.slice(0, 6)
- // uni.showModal({
- // title: '提示',
- // content: JSON.stringify(obj.marker)
- // })
- })
- getListMechanism({
- page: 1,
- limit: 100
- }).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 arr1 = data.sort(obj.sortBy('space'))
- let arr = arr1.map(item => ({
- latitude: item.latitude,
- longitude: item.longitude,
- iconPath: '/static/icon/yz.png',
- width: '35',
- height: '35',
- id: item.id,
- address: item.address
- }));
- obj.yzmarker = obj.marker1.concat(arr)
- obj.yzList = arr1.slice(0, 3)
- })
- },
- sortBy(field) {
- //根据传过来的字段进行排序,y-x 得分从高到低,x-y 从低到高
- return (x, y) => {
- return x[field] - y[field]
- }
- },
- // 选择当前位置
- // chooseAddress() {
- // console.log('233')
- // let obj = this;
- // uni.chooseLocation({
- // success: function(res) {
- // console.log(res)
- // obj.addressData.area = res.name;
- // console.log('位置名称:' + res.name);
- // console.log('详细地址:' + res.address);
- // console.log('经度:' + res.longitude);
- // console.log('纬度:' + res.latitude);
- // obj.addressData.latitude = res.latitude;
- // obj.addressData.longitude = res.longitude;
- // obj.addressDetail = res.address;
- // console.log('common_address123',obj.addressDetail )
- // console.log('latitude123',obj.addressData.latitude )
- // console.log('longitude123',obj.addressData.longitude )
- // getcomAddress({
- // common_address: obj.addressDetail,
- // longitude: obj.addressData.longitude,
- // latitude: obj.addressData.latitude
- // }).then(data => {
- // console.log(333)
- // console.log(data);
- // if (data.status == 200) {
- // obj.$api.msg('保存成功')
- // }
- // })
- // }
- // });
- // },
- // 导航
- openAddress(item) {
- let obj = this
- obj.latitude2 = item.latitude
- obj.longitude2 = item.longitude
- obj.address = item.detailed_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();
- },
- // 获取就在身边
- getJzsb() {
- let obj = this;
- getdis({
- lng1: obj.longitude4,
- lat1: obj.latitude4
- }).then((res) => {
- let data = res.data;
- this.jzsbList = res.data.slice(0, 3)
- 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.markerjzsb = obj.marker1.concat(arr)
- console.log(obj.markerjzsb, 'obj.markerjzsb')
- }).catch(err => {
- console.log(err);
- uni.hideLoading();
- uni.showModal({
- title: '失败',
- content: JSON.stringify(err)
- });
- });
- }
- }
- };
- </script>
- <style lang="scss">
- a {
- text-decoration: none;
- color: #5f5f5f;
- }
- .content {
- // line-height: 1;
- background-color: #ffabab;
- // padding-bottom: 60(vw/7.5);
- }
- .popup_row {
- width: 100%;
- height: (500vw/7.5);
- background-color: #ffffff;
- border-radius: (20vw/7.5);
- display: flex;
- justify-content: center;
- align-items: center;
- .rows {
- width: 100%;
- padding: 0 (24vw/7.5);
- .rows-item {
- height: (80vw/7.5);
- line-height: (80vw/7.5);
- text-align: center;
- width: 100%;
- font-size: (32vw/7.5);
- color: #303133;
- }
- }
- }
- .content {
- background-color: #f8f8f8;
- height: 100%;
- /* 头部 轮播图 */
- .carousel-section {
- overflow: hidden;
- .carousel {
- width: 100vw;
- height: 53vw;
- .carousel-item {
- width: 100%;
- height: 100%;
- padding-left: (30vw/7.5);
- padding-right: (30vw/7.5);
- overflow: hidden;
- }
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- // 分类
- .cate-section {
- display: flex;
- justify-items: center;
- align-items: center;
- justify-content: space-around;
- height: (214vw/7.5);
- width: (750vw/7.5);
- background-color: #ffffff;
- .cate-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- color: #5f5f5f;
- font-size: (26vw/7.5);
- image {
- height: 11vw;
- width: (88vw/7.45);
- margin-bottom: (14vw/7.5);
- opacity: 0.7;
- }
- }
- }
- // 红会科普
- .science-section {
- width: 100%;
- background-color: #ffffff;
- margin-top: (18vw/7.5);
- padding-top: (30vw/7.5);
- .science-title {
- display: flex;
- justify-content: center;
- align-items: center;
- padding-bottom: (22vw/7.5);
- .title {
- width: (285vw/7.5);
- height: (64vw/7.5);
- background-color: #ca121e;
- border-radius: (32vw/7.5);
- color: #ffffff;
- font-size: (32vw/7.5);
- line-height: (64vw/7.5);
- text-align: center;
- }
- image {
- width: (68vw/7.5);
- height: (43vw/7.5);
- margin-left: (16vw/7.5);
- margin-right: (16vw/7.5);
- }
- }
- .science-box {
- padding-left: (15vw/7.5);
- padding-right: (15vw/7.5);
- padding-bottom: (20vw/7.5);
- border-bottom: (1vw/7.5) 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: (24vw/7.5);
- width: (198vw/7.5);
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- image {
- width: 100%;
- height: (145vw/7.5);
- }
- .article-title {
- width: (198vw/7.5);
- color: #333;
- font-size: (25vw/7.5);
- padding-top: (20vw/7.5);
- padding-bottom: (16vw/7.5);
- font-weight: 900;
- }
- .article-content {
- width: (198vw/7.5);
- color: #999999;
- font-size: (18vw/7.5);
- 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: (30vw/7.5);
- padding-top: (18vw/7.5);
- padding-bottom: (18vw/7.5);
- image {
- width: (20vw/7.5);
- height: (27vw/7.5);
- }
- }
- }
- // sos急救中心
- .system {
- width: 100%;
- background-color: #ffffff;
- margin-top: (18vw/7.5);
- padding-top: (40vw/7.5);
- // padding-bottom: 45(vw/7.5);
- // margin-bottom: 43(vw/7.5);
- .system-title {
- display: flex;
- justify-content: center;
- align-items: center;
- padding-bottom: (22vw/7.5);
- .title {
- width: (285vw/7.5);
- height: (64vw/7.5);
- background-color: #ca121e;
- border-radius: (32vw/7.5);
- color: #ffffff;
- font-size: (32vw/7.5);
- line-height: (64vw/7.5);
- text-align: center;
- }
- .img {
- width: (68vw/7.5);
- height: (43vw/7.5);
- margin-left: (16vw/7.5);
- margin-right: (16vw/7.5);
- image {
- width: (68vw/7.5);
- height: (43vw/7.5);
- }
- }
- }
- .system-map {
- width: (750vw/7.5);
- height: (500vw/7.5);
- background-color: #ffffff;
- padding: 0 (24vw/7.5);
- padding-bottom: (45vw/7.5);
- .map-box {
- width: 100%;
- // height: 500(vw/7.5);
- background-color: #f8f8f8;
- image {
- width: 100%;
- height: (500vw/7.5);
- }
- }
- }
- }
- // AED
- .list-box {
- padding: (0vw/7.5) (25vw/7.5) (24vw/7.5);
- margin-top: (20vw/7.5);
- // margin-bottom: 84(vw/7.5);
- .system-title {
- display: flex;
- justify-content: center;
- align-items: center;
- height: (130vw/7.5);
- // padding-bottom: 22(vw/7.5);
- background-color: #ffffff;
- .title {
- width: (285vw/7.5);
- height: (64vw/7.5);
- background-color: #ca121e;
- border-radius: (32vw/7.5);
- color: #ffffff;
- font-size: (32vw/7.5);
- line-height: (64vw/7.5);
- text-align: center;
- }
- .img {
- width: (68vw/7.5);
- height: (43vw/7.5);
- margin-left: (16vw/7.5);
- margin-right: (16vw/7.5);
- image {
- width: (68vw/7.5);
- height: (43vw/7.5);
- }
- }
- }
- }
- .map-box {
- width: 100%;
- height: (450vw/7.5);
- box-shadow: 5px 15px 15px 5px #f2f2f2;
- }
- .list-tpl {
- background-color: #ffffff;
- margin: (25vw/7.5) 0;
- padding: (25vw/7.5) (25vw/7.5);
- font-size: (28vw/7.5);
- border-radius: (15vw/7.5);
- display: flex;
- justify-content: space-between;
- .list-left {
- display: flex;
- width: 100%;
- .number {
- font-size: (32vw/7.5);
- margin-right: (14vw/7.5);
- }
- .info {
- width: 100%;
- .title {
- font-size: (32vw/7.5);
- color: #222222;
- font-weight: 500;
- }
- .addr {
- margin-top: (20vw/7.5);
- }
- }
- }
- .image {
- width: 10%;
- text-align: center;
- image {
- width: (50vw/7.5);
- height: (50vw/7.5);
- }
- .tip {
- color: #7f7f7f;
- font-size: (21vw/7.5);
- }
- }
- }
- }
- .popup_rows {
- // margin-top: 108(vw/7.5);
- height: (440vw/7.5);
- border-radius: (25vw/7.5);
- width: 100%;
- padding: (24vw/7.5);
- background-color: #f8f8f8;
- z-index: 999;
- .title {
- border-bottom: (2vw/7.5) solid #f2f2f2;
- color: #e63931;
- font-size: (32vw/7.5);
- padding-left: (4vw/7.5);
- padding-bottom: (16vw/7.5);
- display: flex;
- justify-content: space-between;
- // align-items: center;
- .cancel {
- margin-left: (52vw/7.5);
- width: (36vw/7.5);
- height: (36vw/7.5);
- image {
- width: (36vw/7.5);
- height: (36vw/7.5);
- }
- }
- }
- .inpBox {
- margin-top: (52vw/7.5);
- border: 2px solid #f2f2f2;
- padding: (12vw/7.5) (24vw/7.5);
- color: #ff9797;
- border-radius: (8vw/7.5);
- .input-placeholder {
- // height: 70(vw/7.5);
- font-size: (32vw/7.5);
- color: #ff9797;
- }
- }
- .inpedit {
- margin-top: (24vw/7.5);
- margin-left: (14vw/7.5);
- font-size: (28vw/7.5);
- color: #ff9797;
- }
- .comfirm {
- display: flex;
- justify-content: flex-end;
- margin-top: (54vw/7.5);
- .comfirm1 {
- padding: (12vw/7.5) (24vw/7.5);
- border-radius: (12vw/7.5);
- color: #ffffff;
- background-color: #e63931;
- }
- }
- }
- .science-more {
- background-color: #fff;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #e63931;
- font-size: (30vw/7.5);
- padding-top: (18vw/7.5);
- padding-bottom: (18vw/7.5);
- image {
- width: (20vw/7.5);
- height: (27vw/7.5);
- }
- }
- .location-item {
- // width: 710(vw/7.5);
- background-color: #fff;
- z-index: 10;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: (1vw/7.5) solid #e7e8ea;
- padding: (15vw/7.5) (30vw/7.5);
- // margin: auto;
- .box-left {
- display: flex;
- .img01 {
- width: (8vw/7.5);
- height: (28vw/7.5);
- margin-right: (18vw/7.5);
- image {
- width: (8vw/7.5);
- height: (28vw/7.5);
- }
- }
- .img02 {
- width: (117vw/7.5);
- height: (117vw/7.5);
- border-radius: 50%;
- image {
- width: (117vw/7.5);
- height: (117vw/7.5);
- border-radius: 50%;
- }
- }
- .info {
- margin-left: (16vw/7.5);
- .info-header {
- display: flex;
- align-items: center;
- .name {
- font-size: (32vw/7.5);
- color: #333333;
- }
- .distance {
- margin-left: (25vw/7.5);
- font-size: (28vw/7.5);
- color: #303133;
- }
- .location-icon {
- margin-left: (10vw/7.5);
- width: (20vw/7.5);
- height: (26vw/7.5);
- image {
- width: (20vw/7.5);
- height: (26vw/7.5);
- display: inline;
- }
- }
- }
- .address {
- font-size: (26vw/7.5);
- color: #333333;
- margin-top: (33vw/7.5);
- }
- }
- }
- .box-right {
- .img {
- height: (107vw/7.5);
- image {
- width: (107vw/7.5);
- height: (107vw/7.5);
- }
- }
- .called {
- margin-right: (16vw/7.5);
- height: (107vw/7.5);
- line-height: (107vw/7.5);
- font-size: (28vw/7.5);
- color: #cb131c;
- }
- }
- }
- </style>
|