index.vue 31 KB

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