index.vue 29 KB

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