index.vue 27 KB

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