index.vue 29 KB

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