index.vue 36 KB

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