index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219
  1. <template>
  2. <view class="content">
  3. <!-- 轮播 -->
  4. <view class="carousel-section">
  5. <swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
  6. <swiper-item v-for="item in carouselList" :key="item.id">
  7. <image :src="item.pic"></image>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <!-- 分类 -->
  12. <view class="cate-section">
  13. <view class="cate-item" @click="navTo('/pages/applic/appliSystem1')">
  14. <image src="../../static/icon/icon1.png" style="width: 70rpx;height: 64rpx;"></image>
  15. <text>爱心捐赠</text>
  16. </view>
  17. <view class="cate-item" @click="navTo('/pages/applic/appliSystem')">
  18. <view class="cate-item">
  19. <image src="../../static/icon/icon2.png" style="width: 66rpx;height: 66rpx;"></image>
  20. <text>造血干细胞捐献</text>
  21. </view>
  22. </view>
  23. <view class="cate-item" @click="navTo('/pages/applic/organDonation')">
  24. <image src="../../static/icon/icon3.png" style="width: 80rpx;height: 68rpx;"></image>
  25. <text>器官捐献</text>
  26. </view>
  27. <!-- </a> -->
  28. <view>
  29. <view class="cate-item" @click="navTo('/pages/form/tovolApply')">
  30. <image src="../../static/icon/icon4.png" style="width: 66rpx;height: 66rpx;"></image>
  31. <text>志愿者登记</text>
  32. </view>
  33. </view>
  34. <view>
  35. <view class="cate-item" @click="navTo('/pages/train/index')">
  36. <image src="../../static/icon/icon5.png" style="width: 66rpx;height: 65rpx;"></image>
  37. <text>普及培训</text>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 红会科普 -->
  42. <view class="science-section">
  43. <view class="science-title">
  44. <image src="../../static/img/wings-left.png" mode=""></image>
  45. <view class="title">红会科普</view>
  46. <image src="../../static/img/wings-right.png" mode=""></image>
  47. </view>
  48. <scroll-view class="science-box" scroll-x>
  49. <view class="science-content">
  50. <view class="science-item" v-for="(item, index) in science" :key="index" @click="Jump(item)">
  51. <image :src="item.image_input[0]" mode=""></image>
  52. <view class="article-title word1_ellipsis">{{ item.title }}</view>
  53. <view class="article-content">{{ item.synopsis }}</view>
  54. </view>
  55. </view>
  56. </scroll-view>
  57. <navigator class="science-more" url="/pages/applic/science">
  58. 查看更多
  59. <image src="../../static/icon/moreRight.png" mode=""></image>
  60. <image src="../../static/icon/moreRight.png" mode=""></image>
  61. </navigator>
  62. </view>
  63. <!-- sos急救系统 -->
  64. <view class="system">
  65. <view class="system-title">
  66. <view class="img">
  67. <image src="../../static/img/wings-left.png"></image>
  68. </view>
  69. <view class="title" @click="tolocation">救在身边</view>
  70. <view class="img">
  71. <image src="../../static/img/wings-right.png"></image>
  72. </view>
  73. </view>
  74. <view class="system-map">
  75. <map @click="tolocation" :show-location="false" class="map-box" id="mapjzsb" :markers="markerjzsb"
  76. :scale="scale" :latitude="latitude4" :longitude="longitude4" ref="mapjzsb"
  77. style="height: 450rpx"></map>
  78. </view>
  79. </view>
  80. <view v-for="(item, index) in jzsbList" :key="item.id">
  81. <view class="location-item">
  82. <view class="box-left">
  83. <view class="img01">
  84. <image src="../../static/img/line01.png" mode=""></image>
  85. </view>
  86. <view class="img02">
  87. <image src="../../static/img/002.png" mode=""></image>
  88. </view>
  89. <!-- <view class="img02" v-else><image src="../../static/img/missing-face.png" mode=""></image></view> -->
  90. <view class="info">
  91. <view class="info-header">
  92. <view class="name">救护员{{ index + 1 }}</view>
  93. <view class="distance">{{ item.num }}km</view>
  94. <view class="location-icon">
  95. <image src="../../static/img/location-icon.png" mode=""></image>
  96. </view>
  97. </view>
  98. <view class="address">{{ item.address }}</view>
  99. </view>
  100. </view>
  101. <view class="box-right" @click="rescue(item, index)">
  102. <view class="img" v-if="!item.is">
  103. <image src="../../static/img/rescue.png" mode=""></image>
  104. </view>
  105. <view class="called" v-if="item.is">已呼叫</view>
  106. </view>
  107. </view>
  108. </view>
  109. <navigator class="science-more" url="/pages/applic/location">
  110. 查看更多
  111. <image src="../../static/icon/moreRight.png" mode=""></image>
  112. <image src="../../static/icon/moreRight.png" mode=""></image>
  113. </navigator>
  114. <view class="list-box">
  115. <view class="system-title">
  116. <view class="img">
  117. <image src="../../static/img/wings-left.png"></image>
  118. </view>
  119. <view class="title">救护站</view>
  120. <view class="img">
  121. <image src="../../static/img/wings-right.png"></image>
  122. </view>
  123. </view>
  124. <view id="container">
  125. <map class="map-box" id="map" :show-location="false" :markers="marker" :scale='scale'
  126. :latitude="latitude4" :longitude="longitude4" ref="map" style="height: 450rpx"
  127. @markertap='markertap'>
  128. </map>
  129. </view>
  130. <view class="">
  131. <view class="list-tpl flex" @click="openAddress(item)" v-for="(item,index) in AEDList" :key="item.id">
  132. <view class="list-left">
  133. <view class="number">{{ index + 1 }}</view>
  134. <view class="info">
  135. <view class="title">{{ item.introduction }}</view>
  136. <view class="addr">地址:{{ item.address }}</view>
  137. </view>
  138. </view>
  139. <view class="image">
  140. <image src="../../static/img/img10.png"></image>
  141. <view class="tip">导航</view>
  142. </view>
  143. </view>
  144. <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
  145. </view>
  146. </view>
  147. <navigator class="science-more" url="/pages/applic/aid">
  148. 查看更多
  149. <image src="../../static/icon/moreRight.png" mode=""></image>
  150. <image src="../../static/icon/moreRight.png" mode=""></image>
  151. </navigator>
  152. <uni-popup ref="popup" type="bottom" @click="close">
  153. <view class="popup_row">
  154. <view class="rows">
  155. <view class="rows-item" @click="toGaodeMap">
  156. 高德地图
  157. </view>
  158. <view class="rows-item" @click="tobaiDuMap">
  159. 百度地图
  160. </view>
  161. <view class="rows-item" @click="totengxunMap">
  162. 腾讯地图
  163. </view>
  164. <!-- <view class="rows-item" @click="toGoogleMap">
  165. Google地图
  166. </view> -->
  167. <!-- <view class="row-1"><image class="first_aid" src="../../static/img/img03.jpg"></image></view> -->
  168. <!-- <view class="row-2">扫码进入急救平台</view> -->
  169. </view>
  170. </view>
  171. </uni-popup>
  172. <uni-popup ref="popups" type="center">
  173. <view class="popup_rows">
  174. <view class="title">
  175. <view class="title-left">请输入您的手机号,等待救援!</view>
  176. <view class="cancel" @click="cancel">
  177. <image src="../../static/img/cancel1.png" mode=""></image>
  178. </view>
  179. </view>
  180. <view class="inpBox"><input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone" /></view>
  181. <view class="inpedit">可在方框中修改您的手机号</view>
  182. <view class="comfirm">
  183. <view class="comfirm1" @click="comfirm1()">确认</view>
  184. </view>
  185. </view>
  186. </uni-popup>
  187. </view>
  188. </template>
  189. <script>
  190. import {
  191. loadIndexs,
  192. bannerlist,
  193. getListAED,
  194. getDistance,
  195. getdis
  196. } from '@/api/index.js';
  197. import {
  198. saveUrl,
  199. interceptor
  200. } from '@/utils/loginUtils.js';
  201. import {
  202. mapState,
  203. mapMutations
  204. } from 'vuex';
  205. import {
  206. userinfo
  207. } from '@/api/user.js';
  208. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  209. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  210. import {
  211. getLoca
  212. } from '@/utils/wxAuthorized.js';
  213. export default {
  214. components: {
  215. uniPopup,
  216. uniLoadMore
  217. },
  218. data() {
  219. return {
  220. jzsbList: [],
  221. carouselList: [], //轮播
  222. science: [], //文章列表
  223. page: 1,
  224. limit: 10,
  225. AEDList: [],
  226. latitude2: '',
  227. longitude2: '',
  228. latitude4: '',
  229. longitude4: '',
  230. // longitude4: '121.15829821166992',
  231. // latitude4: "30.044394499237708",
  232. address: '',
  233. loadingType: 'more',
  234. markerList: [],
  235. marker: [],
  236. markerjzsb: [],
  237. marker1: [],
  238. longitude: '121.15829821166992',
  239. latitude: "30.044394499237708",
  240. longitude1: '120.553638',
  241. latitude1: "30.547011",
  242. scale: '12', //地图缩放程度
  243. scale1: '15',
  244. showbox: false,
  245. showTEXT: false,
  246. to_phone: '',
  247. };
  248. },
  249. onShow() {
  250. // let token = uni.getStorageSync('token');
  251. console.log(11, this);
  252. if (!this.hasLogin) {
  253. // 登录拦截
  254. // interceptor();
  255. uni.showModal({
  256. title: '登录',
  257. content: '您未登录,是否马上登陆?',
  258. success: e => {
  259. if (e.confirm) {
  260. saveUrl();
  261. interceptor();
  262. }
  263. },
  264. fail: e => {
  265. console.log(e);
  266. }
  267. });
  268. } else {
  269. this.loadData();
  270. }
  271. },
  272. onLoad() {
  273. let obj = this;
  274. try {
  275. let locationAddress
  276. // #ifdef H5
  277. let wxOjb = require('jweixin-module');
  278. locationAddress = wxOjb.getLocation;
  279. // #endif
  280. // #ifdef MP
  281. locationAddress = uni.getLocation;
  282. // #endif
  283. // #ifdef H5
  284. wxOjb.ready(() => {
  285. console.log('加载完毕注册事件');
  286. locationAddress({
  287. type: 'gcj02',
  288. success: function(res) {
  289. console.log('获取经纬度', res);
  290. obj.longitude4 = res.longitude
  291. obj.latitude4 = res.latitude
  292. obj.marker = [{
  293. longitude: res.longitude,
  294. latitude: res.latitude,
  295. iconPath: '/static/img/img19.png',
  296. width: '45',
  297. height: '45',
  298. }]
  299. obj.marker1 = [{
  300. longitude: res.longitude,
  301. latitude: res.latitude,
  302. iconPath: '/static/img/img19.png',
  303. width: '45',
  304. height: '45',
  305. }]
  306. obj.loadData();
  307. obj.getJzsb()
  308. },
  309. fail(e) {
  310. console.log('失败', e);
  311. window.location.reload();
  312. }
  313. });
  314. })
  315. // #endif
  316. // #ifdef MP
  317. locationAddress({
  318. type: 'gcj02',
  319. success: function(res) {
  320. console.log('获取经纬度', res);
  321. obj.longitude4 = res.longitude
  322. obj.latitude4 = res.latitude
  323. obj.loadData();
  324. obj.getJzsb()
  325. },
  326. fail(e) {
  327. console.log('失败', e);
  328. window.location.reload();
  329. }
  330. });
  331. // #endif
  332. } catch (e) {
  333. let locationAddress
  334. // #ifdef H5
  335. let wxOjb = require('jweixin-module');
  336. locationAddress = wxOjb.getLocation;
  337. // #endif
  338. // #ifdef MP
  339. locationAddress = uni.getLocation;
  340. // #endif
  341. // #ifdef H5
  342. wxOjb.ready(() => {
  343. console.log('加载完毕注册事件');
  344. locationAddress({
  345. type: 'wgs84',
  346. success: function(res) {
  347. console.log('获取经纬度', res);
  348. obj.longitude4 = res.longitude
  349. obj.latitude4 = res.latitude
  350. obj.loadData();
  351. obj.getJzsb()
  352. },
  353. fail(e) {
  354. console.log('失败', e);
  355. window.location.reload();
  356. }
  357. });
  358. })
  359. // #endif
  360. // #ifdef MP
  361. locationAddress({
  362. type: 'wgs84',
  363. success: function(res) {
  364. console.log('获取经纬度', res);
  365. obj.longitude4 = res.longitude
  366. obj.latitude4 = res.latitude
  367. obj.loadData();
  368. obj.getJzsb()
  369. },
  370. fail(e) {
  371. console.log('失败', e);
  372. window.location.reload();
  373. }
  374. });
  375. // #endif
  376. }
  377. },
  378. computed: {
  379. ...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
  380. },
  381. // 下拉加载
  382. onReachBottom() {
  383. // this.loadData();
  384. },
  385. methods: {
  386. ...mapMutations('user', ['setUserInfo']),
  387. cancel() {
  388. this.$refs.popups.close();
  389. },
  390. comfirm1: function() {
  391. let obj = this;
  392. if (obj.to_phone.toString().trim() == '') {
  393. // uni.showModal({
  394. // title:'输入框为空',
  395. // // content:JSON.stringify(obj)
  396. // })
  397. } else {
  398. console.log('obj.to_phone1111', obj.to_phone);
  399. const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
  400. if (!reg.test(obj.to_phone)) {
  401. obj.$api.msg('请填写正确的手机号码');
  402. return;
  403. }
  404. console.log('name:', obj.name);
  405. console.log('uid:', obj.uid);
  406. console.log('phone', obj.phone);
  407. console.log('to_phone', obj.to_phone);
  408. console.log('longitude', obj.longitude);
  409. console.log('latitude', obj.latitude);
  410. console.log('iscall', obj.iscall);
  411. tocall({
  412. name: obj.name,
  413. uid: obj.uid,
  414. phone: obj.phone,
  415. longitude: obj.longitude4,
  416. latitude: obj.latitude4,
  417. to_phone: obj.to_phone
  418. }).then(data => {
  419. console.log(99988, data);
  420. uni.showModal({
  421. title: '请耐心等待救援',
  422. success: res => {
  423. if (res.confirm) {
  424. window.location.reload(); //重新刷新页面
  425. }
  426. }
  427. });
  428. obj.$refs.popups.close();
  429. obj.iscall = false;
  430. console.log(123, obj.iscall);
  431. });
  432. }
  433. },
  434. // 立即救援
  435. rescue(item, index) {
  436. let obj = this;
  437. uni.showModal({
  438. content: '是否发起求救?',
  439. success: res => {
  440. if (res.confirm) {
  441. this.$refs.popups.open(item, index);
  442. obj.name = item.name;
  443. obj.uid = item.uid;
  444. obj.phone = item.phone;
  445. obj.iscall = false;
  446. console.log('点击救援时item.phone:', obj.phone);
  447. }
  448. }
  449. });
  450. },
  451. // 调用高德
  452. toGaodeMap() {
  453. let latitude = this.latitude2
  454. let longitude = this.longitude2
  455. let address = this.address
  456. console.log('选择高德', latitude, longitude, address)
  457. // window.location.href = 'https://uri.amap.com/marker?position=30.537043,120.567191&name=浙江省嘉兴市桐乡市高桥镇高桥大道51号'
  458. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  459. // window.location.href = `http://uri.amap.com/navigation?from=114.02597366,22.54605355&to=114.029243,22.609562&mode=car&src=nyx_super`
  460. // http://uri.amap.com/navigation?from=" + fromLongitude + "," + fromLatitude + "&to="+ longitude + "," + latitude + "&mode=car&src=nyx_super
  461. },
  462. // 调用腾讯
  463. totengxunMap() {
  464. let latitude = this.latitude2
  465. let longitude = this.longitude2
  466. let address = this.address
  467. console.log('选择腾讯', latitude, longitude)
  468. window.location.href =
  469. `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  470. },
  471. // 调用百度
  472. tobaiDuMap() {
  473. let latitude = this.latitude2
  474. let longitude = this.longitude2
  475. let latitude6 = this.latitude4
  476. let longitude6 = this.longitude4
  477. let address = this.address
  478. console.log('选择百度', latitude, longitude)
  479. console.log('获取当前经纬度', latitude6, longitude6)
  480. window.location.href =
  481. `http://api.map.baidu.com/direction?origin=latlng:${latitude6},${longitude6}|name:我的位置&destination=${latitude},${longitude}&mode=driving&region=${ address }&output=html&src=webapp.baidu.openAPIdemo`
  482. //`bdapp://map/navi?location=${longitude},${latitude}&coord_type=gc02&title=${address}&content=${address}&output=html&src=andr.baidu.openAPIdemo `
  483. },
  484. // 调用谷歌
  485. toGoogleMap() {
  486. let latitude = this.latitude2
  487. let longitude = this.longitude2
  488. console.log('选择谷歌', latitude, longitude)
  489. },
  490. navTo(url) {
  491. if (!this.hasLogin) {
  492. uni.showModal({
  493. title: '登录',
  494. content: '您未登录,是否马上登陆?',
  495. success: e => {
  496. if (e.confirm) {
  497. interceptor();
  498. }
  499. },
  500. fail: e => {
  501. console.log(e);
  502. }
  503. });
  504. return;
  505. }
  506. uni.navigateTo({
  507. url,
  508. fail(e) {
  509. uni.switchTab({
  510. url
  511. })
  512. }
  513. });
  514. },
  515. tolocation() {
  516. uni.navigateTo({
  517. url: "/pages/applic/location"
  518. })
  519. },
  520. // 点击图标
  521. markertap(e) {
  522. console.log(e.target.markerId);
  523. this.$refs.popup.open();
  524. let obj = this;
  525. for (let i = 0; i < obj.marker.length; i++) {
  526. if (e.target.markerId == obj.marker[i].id) {
  527. obj.latitude2 = obj.marker[i].latitude;
  528. obj.longitude2 = obj.marker[i].longitude;
  529. obj.address = obj.marker[i].address;
  530. // uni.showModal({
  531. // title: '坐标',
  532. // content: JSON.stringify(obj.marker[i]),
  533. // success() {
  534. // uni.showModal({
  535. // title: '成功',
  536. // content: obj.marker[i].latitude
  537. // })
  538. // }
  539. // })
  540. }
  541. }
  542. },
  543. loadData() {
  544. let obj = this;
  545. console.log('打印当前经纬度', obj.longitude4, obj.latitude4)
  546. userinfo({}).then(({
  547. data
  548. }) => {
  549. obj.setUserInfo(data);
  550. loadIndexs({}).then(({
  551. data
  552. }) => {
  553. obj.carouselList = data.banner; //轮播图
  554. bannerlist().then(({
  555. data
  556. }) => {
  557. console.log(data);
  558. obj.science = data;
  559. });
  560. });
  561. });
  562. if (obj.loadingType === 'noMore') {
  563. //防止重复加载
  564. return;
  565. }
  566. // 修改当前对象状态为加载中
  567. obj.loadingType = 'loading';
  568. // getListAED({
  569. // page: obj.page,
  570. // limit: obj.limit
  571. // }).then(({
  572. // data
  573. // }) => {
  574. // console.log(data, 999)
  575. // // obj.AEDList = data
  576. // obj.AEDList = obj.AEDList.concat(data);
  577. // obj.markerList = data
  578. // obj.page++;
  579. // if (obj.limit == data.length) {
  580. // obj.loadingType = 'more';
  581. // } else {
  582. // obj.loadingType = 'noMore';
  583. // }
  584. // })
  585. getDistance({
  586. lng1: obj.longitude4,
  587. lat1: obj.latitude4
  588. }).then(({
  589. data
  590. }) => {
  591. console.log(data, 980)
  592. obj.AEDList = data
  593. obj.AEDList = data.slice(0, 5)
  594. let arr = data.map(item => ({
  595. latitude: item.latitude,
  596. longitude: item.longitude,
  597. iconPath: '/static/icon/jzsb.png',
  598. width: '35',
  599. height: '35',
  600. id: item.id,
  601. address: item.address
  602. }))
  603. obj.marker = obj.marker.concat(arr)
  604. obj.marker = obj.marker.slice(0, 6)
  605. console.log('obj.marker', obj.marker)
  606. // uni.showModal({
  607. // title: '提示',
  608. // content: JSON.stringify(obj.marker)
  609. // })
  610. })
  611. obj.getJzsb()
  612. },
  613. // 导航
  614. openAddress(item) {
  615. let obj = this
  616. obj.latitude2 = item.latitude
  617. obj.longitude2 = item.longitude
  618. obj.address = item.address
  619. this.$refs.popup.open();
  620. },
  621. Jump(item) {
  622. // console.log(item);
  623. if (item.url != '') {
  624. window.open(item.url);
  625. return
  626. }
  627. uni.navigateTo({
  628. url: "/pages/applic/info?id=" + item.id
  629. })
  630. },
  631. open() {
  632. this.$refs.popup.open();
  633. },
  634. close() {
  635. this.$refs.popup.close();
  636. },
  637. // 获取就在身边
  638. getJzsb() {
  639. let obj = this;
  640. getdis({
  641. lng1: obj.longitude4,
  642. lat1: obj.latitude4,
  643. page: 1,
  644. limit: 3
  645. }).then((res) => {
  646. let data = res.data;
  647. console.log(data, 'jzsb')
  648. this.jzsbList = res.data.slice(0, 3)
  649. let arr = data.map(item => ({
  650. latitude: item.latitude,
  651. longitude: item.longitude,
  652. iconPath: '/static/img/img014.png',
  653. width: '35',
  654. height: '35',
  655. id: item.id,
  656. address: item.address
  657. }))
  658. obj.markerjzsb = obj.marker1.concat(arr)
  659. console.log(obj.markerjzsb, 'obj.markerjzsb')
  660. }).catch(err => {
  661. console.log(err);
  662. uni.hideLoading();
  663. // uni.showModal({
  664. // title: '失败',
  665. // content: JSON.stringify(err)
  666. // });
  667. });
  668. }
  669. }
  670. };
  671. </script>
  672. <style lang="scss">
  673. a {
  674. text-decoration: none;
  675. color: #5f5f5f;
  676. }
  677. .content {
  678. // line-height: 1;
  679. background-color: #FFABAB;
  680. // padding-bottom: 60rpx;
  681. }
  682. .popup_row {
  683. width: 100%;
  684. height: 500rpx;
  685. background-color: #ffffff;
  686. border-radius: 20rpx;
  687. display: flex;
  688. justify-content: center;
  689. align-items: center;
  690. .rows {
  691. width: 100%;
  692. padding: 0 24rpx;
  693. .rows-item {
  694. height: 80rpx;
  695. line-height: 80rpx;
  696. text-align: center;
  697. width: 100%;
  698. font-size: 32rpx;
  699. color: #303133;
  700. // border-bottom: 1rpx solid #f0f0f0;
  701. }
  702. // .row-1 {
  703. // margin: auto;
  704. // .first_aid {
  705. // width: 300rpx;
  706. // height: 300rpx;
  707. // }
  708. // }
  709. // .row-2 {
  710. // font-size: 38rpx;
  711. // margin-top: 20rpx;
  712. // }
  713. }
  714. }
  715. .content {
  716. background-color: #f8f8f8;
  717. height: 100%;
  718. /* 头部 轮播图 */
  719. .carousel-section {
  720. // padding-top: 10px;
  721. overflow: hidden;
  722. .carousel {
  723. width: 100%;
  724. height: 398rpx;
  725. .carousel-item {
  726. width: 100%;
  727. height: 100%;
  728. padding-left: 30rpx;
  729. padding-right: 30rpx;
  730. overflow: hidden;
  731. }
  732. image {
  733. width: 100%;
  734. height: 398rpx;
  735. }
  736. }
  737. }
  738. // 分类
  739. .cate-section {
  740. display: flex;
  741. justify-items: center;
  742. align-items: center;
  743. justify-content: space-around;
  744. height: 214rpx;
  745. width: 750rpx;
  746. background-color: #ffffff;
  747. .cate-item {
  748. display: flex;
  749. flex-direction: column;
  750. justify-content: center;
  751. align-items: center;
  752. color: #5f5f5f;
  753. font-size: 26rpx;
  754. image {
  755. height: 88rpx;
  756. width: 88rpx;
  757. margin-bottom: 14rpx;
  758. // border-radius: 50%;
  759. opacity: 0.7;
  760. }
  761. }
  762. }
  763. // 红会科普
  764. .science-section {
  765. width: 100%;
  766. background-color: #ffffff;
  767. margin-top: 18rpx;
  768. padding-top: 30rpx;
  769. .science-title {
  770. display: flex;
  771. justify-content: center;
  772. align-items: center;
  773. padding-bottom: 22rpx;
  774. .title {
  775. width: 285rpx;
  776. height: 64rpx;
  777. background-color: #FF727E;
  778. border-radius: 32rpx;
  779. color: #ffffff;
  780. font-size: 32rpx;
  781. line-height: 64rpx;
  782. text-align: center;
  783. }
  784. image {
  785. width: 68rpx;
  786. height: 43rpx;
  787. margin-left: 16rpx;
  788. margin-right: 16rpx;
  789. }
  790. }
  791. .science-box {
  792. padding-left: 15rpx;
  793. padding-right: 15rpx;
  794. padding-bottom: 20rpx;
  795. border-bottom: 1rpx solid #f0f0f0;
  796. white-space: nowrap;
  797. display: flex;
  798. width: 100%;
  799. // .uni-scroll-view-content{
  800. // display: flex;
  801. // }
  802. .science-content {
  803. // width: 100%;
  804. // display: flex;
  805. display: -webkit-box;
  806. .science-item {
  807. margin-right: 24rpx;
  808. width: 198rpx;
  809. display: flex;
  810. flex-direction: column;
  811. align-items: center;
  812. text-align: center;
  813. image {
  814. width: 100%;
  815. height: 145rpx;
  816. }
  817. .article-title {
  818. width: 198rpx;
  819. color: #333;
  820. font-size: 25rpx;
  821. padding-top: 20rpx;
  822. padding-bottom: 16rpx;
  823. font-weight: 900;
  824. }
  825. .article-content {
  826. width: 198rpx;
  827. color: #999999;
  828. font-size: 18rpx;
  829. overflow: hidden;
  830. text-overflow: ellipsis;
  831. display: -webkit-box;
  832. word-break: break-all;
  833. -webkit-box-orient: vertical;
  834. -webkit-line-clamp: 2;
  835. }
  836. }
  837. }
  838. }
  839. .science-more {
  840. display: flex;
  841. justify-content: center;
  842. align-items: center;
  843. color: $motif-color;
  844. font-size: 30rpx;
  845. padding-top: 18rpx;
  846. padding-bottom: 18rpx;
  847. image {
  848. width: 20rpx;
  849. height: 27rpx;
  850. }
  851. }
  852. }
  853. // sos急救中心
  854. .system {
  855. width: 100%;
  856. background-color: #ffffff;
  857. margin-top: 18rpx;
  858. padding-top: 40rpx;
  859. // padding-bottom: 45rpx;
  860. // margin-bottom: 43rpx;
  861. .system-title {
  862. display: flex;
  863. justify-content: center;
  864. align-items: center;
  865. padding-bottom: 22rpx;
  866. .title {
  867. width: 285rpx;
  868. height: 64rpx;
  869. background-color: #FF727E;
  870. border-radius: 32rpx;
  871. color: #ffffff;
  872. font-size: 32rpx;
  873. line-height: 64rpx;
  874. text-align: center;
  875. }
  876. .img {
  877. width: 68rpx;
  878. height: 43rpx;
  879. margin-left: 16rpx;
  880. margin-right: 16rpx;
  881. image {
  882. width: 68rpx;
  883. height: 43rpx;
  884. }
  885. }
  886. }
  887. .system-map {
  888. width: 750rpx;
  889. height: 500rpx;
  890. background-color: #ffffff;
  891. padding: 0 24rpx;
  892. padding-bottom: 45rpx;
  893. .map-box {
  894. width: 100%;
  895. height: 500rpx;
  896. background-color: #f8f8f8;
  897. image {
  898. width: 100%;
  899. height: 500rpx;
  900. }
  901. }
  902. }
  903. }
  904. // AED
  905. .list-box {
  906. // padding: 0rpx 25rpx 24rpx;
  907. // margin-bottom: 84rpx;
  908. .system-title {
  909. display: flex;
  910. justify-content: center;
  911. align-items: center;
  912. height: 130rpx;
  913. // padding-bottom: 22rpx;
  914. background-color: #FFFFFF;
  915. .title {
  916. width: 285rpx;
  917. height: 64rpx;
  918. background-color: #FF727E;
  919. border-radius: 32rpx;
  920. color: #ffffff;
  921. font-size: 32rpx;
  922. line-height: 64rpx;
  923. text-align: center;
  924. }
  925. .img {
  926. width: 68rpx;
  927. height: 43rpx;
  928. margin-left: 16rpx;
  929. margin-right: 16rpx;
  930. image {
  931. width: 68rpx;
  932. height: 43rpx;
  933. }
  934. }
  935. }
  936. }
  937. .map-box {
  938. // background-color: #FFFFFF;
  939. width: 100%;
  940. height: 366rpx;
  941. // border: 2rpx solid #F2F2F2;
  942. box-shadow: 5px 15px 15px 5px #F2F2F2;
  943. }
  944. .list-tpl {
  945. background-color: #FFFFFF;
  946. margin: 25rpx 0rpx;
  947. padding: 25rpx 25rpx;
  948. font-size: 28rpx;
  949. border-radius: 15rpx;
  950. display: flex;
  951. justify-content: space-between;
  952. // &:last-of-type {
  953. // margin-bottom: 0;
  954. // }
  955. .list-left {
  956. display: flex;
  957. width: 100%;
  958. .number {
  959. font-size: 32rpx;
  960. margin-right: 14rpx;
  961. }
  962. .info {
  963. width: 100%;
  964. .title {
  965. font-size: 32rpx;
  966. color: #222222;
  967. font-weight: 500;
  968. }
  969. .addr {
  970. margin-top: 20rpx;
  971. }
  972. }
  973. }
  974. .image {
  975. width: 10%;
  976. text-align: center;
  977. image {
  978. width: 50rpx;
  979. height: 50rpx;
  980. }
  981. .tip {
  982. color: #7F7F7F;
  983. font-size: 21rpx;
  984. }
  985. }
  986. }
  987. }
  988. .location-item {
  989. // width: 710rpx;
  990. background-color: #fff;
  991. z-index: 10;
  992. display: flex;
  993. justify-content: space-between;
  994. align-items: center;
  995. border-bottom: 1rpx solid #e7e8ea;
  996. padding: 15rpx 30rpx;
  997. // margin: auto;
  998. .box-left {
  999. display: flex;
  1000. .img01 {
  1001. width: 8rpx;
  1002. height: 28rpx;
  1003. margin-right: 18rpx;
  1004. image {
  1005. width: 8rpx;
  1006. height: 28rpx;
  1007. }
  1008. }
  1009. .img02 {
  1010. width: 117rpx;
  1011. height: 117rpx;
  1012. border-radius: 50%;
  1013. image {
  1014. width: 117rpx;
  1015. height: 117rpx;
  1016. border-radius: 50%;
  1017. }
  1018. }
  1019. .info {
  1020. margin-left: 16rpx;
  1021. .info-header {
  1022. display: flex;
  1023. align-items: center;
  1024. .name {
  1025. font-size: 32rpx;
  1026. color: #333333;
  1027. }
  1028. .distance {
  1029. margin-left: 25rpx;
  1030. font-size: 28rpx;
  1031. color: #303133;
  1032. }
  1033. .location-icon {
  1034. margin-left: 10rpx;
  1035. width: 20rpx;
  1036. height: 26rpx;
  1037. image {
  1038. width: 20rpx;
  1039. height: 26rpx;
  1040. display: inline;
  1041. }
  1042. }
  1043. }
  1044. .address {
  1045. font-size: 26rpx;
  1046. color: #333333;
  1047. margin-top: 33rpx;
  1048. }
  1049. }
  1050. }
  1051. .box-right {
  1052. .img {
  1053. height: 107rpx;
  1054. image {
  1055. width: 107rpx;
  1056. height: 107rpx;
  1057. }
  1058. }
  1059. .called {
  1060. margin-right: 16rpx;
  1061. height: 107rpx;
  1062. line-height: 107rpx;
  1063. font-size: 28rpx;
  1064. color: #cb131c;
  1065. }
  1066. }
  1067. }
  1068. .popup_rows {
  1069. // margin-top: 108rpx;
  1070. height: 440rpx;
  1071. border-radius: 25rpx;
  1072. width: 100%;
  1073. padding: 24rpx;
  1074. background-color: #f8f8f8;
  1075. z-index: 999;
  1076. .title {
  1077. border-bottom: 2rpx solid #f2f2f2;
  1078. color: #e63931;
  1079. font-size: 32rpx;
  1080. padding-left: 4rpx;
  1081. padding-bottom: 16rpx;
  1082. display: flex;
  1083. justify-content: space-between;
  1084. // align-items: center;
  1085. .cancel {
  1086. margin-left: 52rpx;
  1087. width: 36rpx;
  1088. height: 36rpx;
  1089. image {
  1090. width: 36rpx;
  1091. height: 36rpx;
  1092. }
  1093. }
  1094. }
  1095. .inpBox {
  1096. margin-top: 52rpx;
  1097. border: 2px solid #f2f2f2;
  1098. padding: 12rpx 24rpx;
  1099. color: #ff9797;
  1100. border-radius: 8rpx;
  1101. .input-placeholder {
  1102. // height: 70rpx;
  1103. font-size: 32rpx;
  1104. color: #ff9797;
  1105. }
  1106. }
  1107. .inpedit {
  1108. margin-top: 24rpx;
  1109. margin-left: 14rpx;
  1110. font-size: 28rpx;
  1111. color: #ff9797;
  1112. }
  1113. .comfirm {
  1114. display: flex;
  1115. justify-content: flex-end;
  1116. margin-top: 54rpx;
  1117. .comfirm1 {
  1118. padding: 12rpx 24rpx;
  1119. border-radius: 12rpx;
  1120. color: #ffffff;
  1121. background-color: #e63931;
  1122. }
  1123. }
  1124. }
  1125. .science-more {
  1126. background-color: #fff;
  1127. display: flex;
  1128. justify-content: center;
  1129. align-items: center;
  1130. color: $motif-color;
  1131. font-size: 30rpx;
  1132. padding-top: 18rpx;
  1133. padding-bottom: 18rpx;
  1134. image {
  1135. width: 20rpx;
  1136. height: 27rpx;
  1137. }
  1138. }
  1139. </style>