index.vue 33 KB

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