index.vue 32 KB

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