index.vue 29 KB

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