index.vue 26 KB

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