map.nvue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. <template>
  2. <view class="main-container">
  3. <map id="map" ref="mapRef" :show-location="true" :latitude="latitude" :longitude="longitude" :scale="scale"
  4. :key="mapKey" :markers="markersData" :circles="circles"
  5. :style="{'width':windowWidth+'px','height':windowHeight+'px'}" @tap="clickMap" @markertap="markertap"></map>
  6. <!-- 遮罩层 -->
  7. <!-- <view class="search-bg" v-if="showMask"
  8. :style="{'width':windowWidth+'px','height':windowHeight+'px','z-index': 2}"
  9. @click.stop="e => {return false}" @touchend.prevent="aaaaa()">
  10. </view> -->
  11. <!-- 更多地图 statusBarHeight top: 200rpx;-->
  12. <view class="top-btn-box" :style="{'top': setTop(statusBarHeight)}">
  13. <view
  14. :class="['top-btn' , pageListMap01 && pageListMap01.themeModuleVoList && pageListMap01.themeModuleVoList.length > 0 ? '' : 'hide-element' ]">
  15. <template
  16. v-if="pageListMap01 && pageListMap01.themeModuleVoList && pageListMap01.themeModuleVoList.length > 0">
  17. <view class="top-btn-item top-btn-item-l" v-for="(item,index) in pageListMap01.themeModuleVoList"
  18. :key="`MapType_${index}`" @click="toApp(item)">
  19. <image class="top-img" :src="item.moduleImage" mode="aspectFill"></image>
  20. <text class="top-txt">{{item.moduleName}}</text>
  21. </view>
  22. </template>
  23. <view class="top-btn-item more-map" @click="onMoerMap()">
  24. <image class="top-img" src="@/static/map/more.png" mode=""></image>
  25. <!-- <text class="iconfont_nvue">&#xe7ce;</text> -->
  26. <text class="top-txt">更多地图</text>
  27. </view>
  28. </view>
  29. <view
  30. :class="['top-btn-item data-type' , [1,2].includes(DataType) && addressList.length > 0 ? '' : 'hide-element' ]"
  31. @click="DataType === 1 ? DataType = 2 : DataType = 1">
  32. <text class="data-type-icon iconfont_nvue">&#xe676;</text>
  33. <!-- <image class="top-img" src="@/static/map/list.png" mode=""></image> -->
  34. <text class="top-txt">{{DataType === 1 ? '列表' : '轮播'}}</text>
  35. </view>
  36. <!-- 定位我的当前位置 -->
  37. <view class="data-type my-location" @click.stop="backMyLocation()">
  38. <image class="my-img" src="@/static/map/my.png" mode="aspectFill"></image>
  39. </view>
  40. </view>
  41. <!-- 搜索框 -->
  42. <search ref="searchRefs" :statusBarHeight="statusBarHeight" :keyWord="keyWord" :showMask="showMask"
  43. :searchType="searchType" :hotClassify="hotClassify" :classifyList="classifyList"
  44. :classifyTree="classifyTree" :activeClassify="activeClassify" :oneClassifyIndex="oneClassifyIndex"
  45. @clearSearch="clearSearch" :activeDistance="activeDistance" :twoClassifyIndex="twoClassifyIndex"
  46. @onSearchFocus="onSearchFocus" @onSelectClassify="onSelectClassify" @selectLabel="e => searchType = e"
  47. @selectHotClassify="selectHotClassify" @onSearch="onSearch" />
  48. <!-- 点位信息卡片 -->
  49. <swiperList :DataType="DataType" :addressList="addressList" :classifyList="classifyList"
  50. :key="`swiperList_${addressList.length}`" @onCurrent="onCurrent" :keyWord="keyWord"
  51. :activeClassify="activeClassify" />
  52. <dataList :DataType="DataType" :addressList="addressList" :classifyList="classifyList" :loading="loading"
  53. :keyWord="keyWord" :activeClassify="activeClassify" />
  54. <view v-if="DataType === 3">
  55. <babTouchbox :minHeight="0.35" :maxHeight="0.8" :touchHeight="64" @currentHeight="setTouchHeight"
  56. @maxtHeight="setScrollMaxHeight">
  57. <view class="map-headline">
  58. <text class="headline-lr"></text>
  59. <text class="headline-text">更多地图</text>
  60. <text class="headline-lr iconfont_nvue"
  61. @click.stop="DataType = oldDataType ? oldDataType : 1">&#xe867;</text>
  62. </view>
  63. <scroll-view :style="{'height':TouchHeight - 40 +'px' }" scroll-y="true" :show-scrollbar="false">
  64. <template>
  65. <view class="map-type"
  66. v-if="pageListMap01 && pageListMap01.themeModuleVoList && pageListMap01.themeModuleVoList.length > 0">
  67. <view class="map-type-lable">
  68. <text class="label-line"></text>
  69. <text class="lable-name">{{pageListMap01.themeVo.themeName }}</text>
  70. </view>
  71. <view class="map-type-list">
  72. <view class="map-type-item" v-for="(item , index) in pageListMap01.themeModuleVoList"
  73. :key="`themeModule_${index}`" @click.stop="toApp(item)">
  74. <image class="map-type-icon" :src="item.moduleImage" mode=""></image>
  75. <text class="map-type-name">{{item.moduleName}}</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="map-type"
  80. v-if="pageListMap02 && pageListMap02.themeModuleVoList && pageListMap02.themeModuleVoList.length > 0">
  81. <view class="map-type-lable">
  82. <text class="label-line"></text>
  83. <text class="lable-name">{{pageListMap02.themeVo.themeName }}</text>
  84. </view>
  85. <view class="map-type-list">
  86. <view class="map-type-item" v-for="(item , index) in pageListMap02.themeModuleVoList"
  87. :key="`themeModule_two_${index}`">
  88. <image class="map-type-icon" :src="item.moduleImage" mode=""></image>
  89. <text class="map-type-name">{{item.moduleName}}</text>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. </scroll-view>
  95. </babTouchbox>
  96. </view>
  97. </view>
  98. </template>
  99. <script src="https://webapi.amap.com/maps?v=1.4.15&key=bde3903093d0eff03b0052192a67e1c0"></script>
  100. <script>
  101. let app = getApp();
  102. import babTouchbox from '@/components/bab-Touchbox/bab-Touchbox';
  103. import EmptyDate from '@/components/EmptyDate/EmptyDate';
  104. import swiperList from "./mapModule/swiperList"
  105. import dataList from "./mapModule/dataList"
  106. import search from "./mapModule/search"
  107. import {
  108. getThemeModule,
  109. getLocationClassify,
  110. getLocationNearbyList,
  111. getCircumList,
  112. getLocationIinfo
  113. } from "@/api/government.js"
  114. export default {
  115. components: {
  116. babTouchbox,
  117. EmptyDate,
  118. swiperList,
  119. dataList,
  120. search
  121. },
  122. data() {
  123. return {
  124. statusBarHeight: 0,
  125. mapKey: 1,
  126. map: null,
  127. latitude: 30.635607,
  128. longitude: 111.389431,
  129. myLatitude: 30.635607,
  130. myLongitude: 111.389431,
  131. showMask: false,
  132. keyWord: '',
  133. scale: 13,
  134. // 搜索
  135. searchType: 2, // 1: 默认收索框; 2:选择热门搜索类型; 3:选择筛选条件, 4: 选择地址 , 5:选择分类
  136. // 分类
  137. classifyList: [],
  138. hotClassify: [],
  139. classifyTree: [],
  140. oneClassifyIndex: 1,
  141. twoClassifyIndex: null,
  142. activeClassify: null,
  143. TouchHeight: 0,
  144. scrollMaxHeight: 0,
  145. windowHeight: 0,
  146. windowWidth: 0,
  147. activeDistance: null,
  148. // 列表
  149. loading: false,
  150. oldDataType: null,
  151. DataType: 0, // 1 轮播 2:列表 , 3 更多地图
  152. addressList: [], // 地址点位列表
  153. markersData: [],
  154. circles: [],
  155. // 更多地图类型
  156. pageListMap01: null,
  157. pageListMap02: null,
  158. };
  159. },
  160. onUnload() {
  161. // uni.$off('initPop')
  162. // uni.$off('mapJump')
  163. // uni.$off('onMapNextPage')
  164. // console.log('卸载')
  165. },
  166. created() {
  167. // console.log('创建')
  168. uni.$on('NextMap', (data) => {
  169. if (data) {
  170. this.selectHotClassify(data);
  171. }
  172. });
  173. uni.$on('NextMapKwd', (data) => {
  174. if (data) {
  175. this.onSearch(data);
  176. }
  177. });
  178. uni.$on('initMap', res => {
  179. if (res.init) this.clearSearch(true);
  180. });
  181. const {
  182. statusBarHeight,
  183. screenHeight,
  184. screenWidth
  185. } = app.globalData;
  186. this.statusBarHeight = statusBarHeight;
  187. this.windowHeight = screenHeight
  188. this.windowWidth = screenWidth
  189. // #ifdef APP-NVUE
  190. try {
  191. var domModule = weex.requireModule('dom');
  192. domModule.addRule('fontFace', {
  193. fontFamily: 'iconfont_nvue',
  194. src: "url('../../../static/font/yige/iconfont.ttf')",
  195. });
  196. } catch (e) {
  197. //TODO handle the exception
  198. }
  199. // #endif
  200. uni.getLocation({
  201. type: 'gcj02',
  202. isHighAccuracy: true, //高精度
  203. geocode: true, //将位置解析成地址
  204. success: res => {
  205. this.latitude = res.latitude;
  206. this.longitude = res.longitude;
  207. this.myLatitude = res.latitude;
  208. this.myLongitude = res.longitude;
  209. // _this.getTypeOptions();
  210. },
  211. fail: function(res) {
  212. console.log('res = ', res)
  213. },
  214. });
  215. this.clearSearch(true);
  216. },
  217. // beforeDestroy() {
  218. // uni.$off('initPop');
  219. // },
  220. computed: {
  221. },
  222. onReady() {
  223. // this.map = plus.maps.create('map', {});
  224. this.map = uni.createMapContext('map', this);
  225. plus.key.addEventListener('backbutton', function() {
  226. // console.log('backbutton');
  227. });
  228. plus.webview.currentWebview().setStyle({
  229. popGesture: 'none',
  230. });
  231. },
  232. watch: {
  233. loading: {
  234. handler: function(newLoad, oldLoad) {
  235. if (newLoad) {
  236. uni.showLoading()
  237. } else {
  238. uni.hideLoading()
  239. }
  240. },
  241. immediate: true
  242. },
  243. searchType: {
  244. handler: function(newType, oldType) {
  245. // this.showMask = newType > 1 && newType !== 3;
  246. this.showMask = [1, 2].includes(newType);
  247. console.log('newType === ', newType, this.showMask)
  248. },
  249. immediate: true
  250. },
  251. classifyList: {
  252. handler: function(newArr, oldArr) {
  253. if (newArr && newArr.length) {
  254. const hot = [];
  255. const parentC = [];
  256. newArr.forEach(el => {
  257. if (hot.length < 5) {
  258. // 获取前五个二级分类为热门分类
  259. if (el.parentId) {
  260. hot.push(el)
  261. }
  262. }
  263. if (!el.parentId) {
  264. parentC.push(el)
  265. }
  266. })
  267. this.hotClassify = hot
  268. parentC.forEach(el => {
  269. el.children = newArr.filter(vl => el.id === vl.parentId)
  270. });
  271. this.classifyTree = parentC;
  272. // console.log('this.classifyTree = ', this.classifyTree)
  273. } else {
  274. }
  275. },
  276. immediate: true
  277. },
  278. DataType: {
  279. handler: function(newT, oldT) {
  280. this.hideJianpan()
  281. // if ([1, 2].includes(newT)) {
  282. // this.oldDataType = newT
  283. // } else {
  284. // this.oldDataType = 1
  285. // }
  286. },
  287. immediate: true
  288. },
  289. },
  290. methods: {
  291. setTop: function(statusBarH) {
  292. const searchH = uni.upx2px(160) + uni.upx2px(80)
  293. return searchH + statusBarH + 'px'
  294. },
  295. backMyLocation() {
  296. // console.log('scale = ', this.scale)
  297. this.hideJianpan()
  298. this.scale = 18;
  299. this.$refs.mapRef.moveToLocation();
  300. },
  301. setTouchHeight(val) {
  302. // console.log('setScrollHeight = ', val)
  303. // 实时返回的滑动组件高度
  304. this.TouchHeight = val;
  305. },
  306. setScrollMaxHeight(val) {
  307. //最大高度
  308. this.scrollMaxHeight = val;
  309. },
  310. toHere(item) {
  311. uni.openLocation({
  312. latitude: parseFloat(item.latitude), // 要去的地址经度,浮点数
  313. longitude: parseFloat(item.longitude), // 要去的地址纬度,浮点数
  314. name: item.name, // 位置名
  315. address: item.detailedAddress, // 要去的地址详情说明
  316. scale: 16, // 地图缩放级别,整形值,范围从1~28。默认为最大
  317. });
  318. },
  319. initialize() {
  320. this.getMapType();
  321. this.getClassify();
  322. },
  323. toApp(PageInfo) {
  324. uni.$emit('mapJump', PageInfo);
  325. },
  326. clearSearch(initial = false) {
  327. this.searchType = 2;
  328. this.showMask = false;
  329. this.keyWord = '';
  330. this.DataType = 0;
  331. this.addressList = [];
  332. this.markersData = [];
  333. this.circles = [];
  334. this.oneClassifyIndex = 1;
  335. this.twoClassifyIndex = null;
  336. this.activeClassify = null;
  337. // if (initial) {
  338. // this.pageListMap01 = null;
  339. // this.pageListMap02 = null;
  340. // this.classifyList = [];
  341. // this.hotClassify = [];
  342. // this.classifyTree = [];
  343. // };
  344. this.initialize();
  345. },
  346. // 选中热门分类
  347. selectHotClassify(item) {
  348. this.activeClassify = item
  349. console.log('activeClassify = ', item)
  350. // oneClassifyIndex activeClassify
  351. const f = this.classifyList.find(el => el.id === item.parentId || el.id === item.id);
  352. try {
  353. this.classifyTree.forEach((el, index) => {
  354. if (el.id === f.id) {
  355. this.oneClassifyIndex = index;
  356. throw new Error('')
  357. }
  358. })
  359. } catch (e) {
  360. //TODO handle the exception
  361. }
  362. setTimeout(() => {
  363. this.searchType = 3;
  364. this.keyWord = '';
  365. this.getMapList();
  366. }, 10);
  367. },
  368. onSelectClassify(data) {
  369. const {
  370. level,
  371. val,
  372. index
  373. } = data
  374. // console.log('valvalvalvalval level= ', level , val.name)
  375. switch (level) {
  376. case 1:
  377. // 选择一级分类
  378. this.oneClassifyIndex = index;
  379. if (!val.children || val.children.length === 0) {
  380. console.log('valvalvalvalval = ', val.children.length, val.children)
  381. // 直接选中分类
  382. this.activeClassify = val;
  383. this.onClassifySearch();
  384. }
  385. break;
  386. case 2:
  387. // 选择二级分类
  388. this.twoClassifyIndex = index;
  389. this.activeClassify = val
  390. this.onClassifySearch();
  391. break;
  392. case 3:
  393. // 选择范围
  394. this.activeDistance = val
  395. this.onClassifySearch();
  396. break;
  397. }
  398. // classifyList
  399. },
  400. onClassifySearch() {
  401. this.searchType = 3;
  402. this.getMapList()
  403. },
  404. onCurrent(index) {
  405. this.markersData = this.markersData.map((el, idx) => {
  406. // if (index === idx) {
  407. // el.width = '45rpx';
  408. // el.height = '60rpx';
  409. // } else {
  410. // el.width = '30rpx';
  411. // el.height = '40rpx';
  412. // delete el.iconPath
  413. // };
  414. return el
  415. })
  416. if (this.markersData && this.markersData.length > 0) {
  417. this.latitude = this.markersData[index].latitude;
  418. this.longitude = this.markersData[index].longitude;
  419. }
  420. },
  421. setCovers(list) {
  422. this.markersData = list.map(el => {
  423. // el.width = '30rpx';
  424. // el.height = '40rpx';
  425. el.locationType = 'zx';
  426. return el
  427. });
  428. // console.log('this.markersData = ', this.markersData)
  429. },
  430. // 聚合组题
  431. getMapType() {
  432. const type = ['map001', 'map002']
  433. type.forEach((el, index) => {
  434. getThemeModule(el).then(res => {
  435. const data = res.data || null;
  436. if (el === type[0]) {
  437. this.pageListMap01 = data || null
  438. }
  439. if (el === type[1]) {
  440. this.pageListMap02 = data || null
  441. };
  442. })
  443. })
  444. },
  445. aaaaa() {
  446. console.log('aaaaa ======= ')
  447. },
  448. // 获取分类
  449. getClassify() {
  450. getLocationClassify().then(res => {
  451. try {
  452. const data = res.data || []
  453. this.classifyList = data;
  454. } catch (e) {
  455. //TODO handle the exception
  456. }
  457. }).finally(() => {
  458. // setTimeout(() => {
  459. // this.getMapList();
  460. // }, 10);
  461. })
  462. },
  463. // 获取地图列表
  464. getMapList() {
  465. this.loading = true;
  466. setTimeout(() => {
  467. const radius = this.activeDistance?.value || 3000;
  468. this.circles = [{
  469. latitude: this.myLatitude,
  470. longitude: this.myLongitude,
  471. fillColor: 'rgba(156,207,209,0.5)',
  472. radius: radius,
  473. color: 'transparent',
  474. strokeWidth: 2
  475. }];
  476. const classifyId = this.activeClassify?.id || '';
  477. const params = {
  478. latitude: this.myLatitude,
  479. longitude: this.myLongitude,
  480. classifyId: classifyId,
  481. name: this.keyWord,
  482. radius: radius,
  483. }
  484. getLocationNearbyList(params).then(res => {
  485. console.log('getLocationNearbyList = ', res.data)
  486. this.addressList = res.data || [];
  487. this.scale = 13;
  488. this.setCovers(this.addressList)
  489. this.getCircum(radius)
  490. }).catch(err => {
  491. this.getCircum(radius)
  492. })
  493. }, 300);
  494. },
  495. onMoerMap() {
  496. this.hideJianpan()
  497. this.oldDataType = this.DataType;
  498. this.searchType = 2;
  499. this.DataType = 3
  500. },
  501. hideJianpan() {
  502. try {
  503. this.$refs.searchRefs.blur();
  504. } catch (e) {
  505. //TODO handle the exception
  506. };
  507. uni.hideKeyboard()
  508. },
  509. clickMap(e) {
  510. this.hideJianpan();
  511. // switch (this.searchType){
  512. // case 2:
  513. // break;
  514. // default:
  515. // break;
  516. // }
  517. // searchType: 1, // 1: 默认收索框; 2:选择热门搜索类型; 3:选择筛选条件, 4: 选择地址 , 5:选择分类
  518. },
  519. markertap(e) {
  520. console.log('e = ' , e)
  521. this.hideJianpan();
  522. const markerId = e.detail.markerId;
  523. const markerVal = this.addressList.find(el => el.id === markerId);
  524. if (markerVal) {
  525. uni.navigateTo({
  526. url: '/pages/government/subNVue/mapLocationInfo',
  527. success: res => {
  528. uni.$emit('onMapNextPage')
  529. res.eventChannel.emit('MapInfo', {
  530. data: {
  531. val: markerVal,
  532. classifyList: this.classifyList,
  533. keyWord: this.keyWord,
  534. activeClassify: this.activeClassify
  535. }
  536. })
  537. },
  538. fail: err => {
  539. console.log('跳转', err)
  540. },
  541. })
  542. }
  543. },
  544. // 搜索周边
  545. getCircum(radius = 0) {
  546. console.log('getCircum = ', 1)
  547. try {
  548. this.$refs.searchRefs.blur();
  549. } catch (e) {
  550. //TODO handle the exception
  551. }
  552. const name = this.keyWord || this.activeClassify?.name;
  553. try {
  554. if (!name) {
  555. this.showMask = false;
  556. this.loading = false;
  557. throw new Error(' ')
  558. }
  559. const radius = radius || this.activeDistance?.value || 3000;
  560. const params = {
  561. keywords: name,
  562. location: this.myLongitude + ',' + this.myLatitude,
  563. pageNum: 1,
  564. pageSize: 20,
  565. radius: radius,
  566. }
  567. const t_n = new Date().getTime();
  568. getCircumList(params).then(res => {
  569. const data = res.data || [];
  570. // console.log('daya=====' , data)
  571. const covers = JSON.parse(JSON.stringify(this.markersData));
  572. data.forEach((e , index) => {
  573. // e.width = '30rpx';
  574. // e.height = '40rpx';
  575. e.classifyId = this.acticeId;
  576. e.longitude = e.location.split(',')[0];
  577. e.latitude = e.location.split(',')[1];
  578. e.locationType = 'gd';
  579. e.detailedAddress = e.address;
  580. e.intro = e.type;
  581. e.id = t_n + index;
  582. covers.push(e);
  583. this.addressList.push(e);
  584. // e.iconPath = that.$getImgPath(that.getTypeIcon(e.classifyId));
  585. // e.iconPath = '';
  586. });
  587. this.showMask = false;
  588. this.markersData = covers
  589. }).finally(() => {
  590. this.loading = false;
  591. })
  592. } catch (e) {
  593. //TODO handle the exception
  594. }
  595. this.DataType = 2
  596. console.log('this.DataType = ', this.DataType)
  597. },
  598. // 搜索 - 获取焦点
  599. onSearchFocus() {
  600. if (this.searchType === 1) {
  601. this.searchType = 2;
  602. }
  603. this.showMask = true;
  604. // this.DataType = 5;
  605. // setTimeout(() => {
  606. // this.showMask = true;
  607. // this.searchType = 2;
  608. // }, 10);
  609. },
  610. onSearchBlur() {
  611. // console.log('shiqijiaodian')
  612. // this.showMask = false;
  613. // setTimeout(() => {
  614. // this.DataType = this.oldDataType
  615. // }, 10);
  616. // console.log('shiqijiaodian', this.DataType)
  617. },
  618. // 收索
  619. onSearch(e) {
  620. this.keyWord = e;
  621. this.activeClassify = null;
  622. this.getMapList(e)
  623. }
  624. // getLabel(list, id) {
  625. // let name = '';
  626. // try {
  627. // list.forEach(el => {
  628. // if (el.id === id) {
  629. // name = el.name;
  630. // throw new Error()
  631. // }
  632. // })
  633. // } catch (e) {
  634. // //TODO handle the exception
  635. // }
  636. // },
  637. },
  638. };
  639. </script>
  640. <style lang="scss" scoped>
  641. @import url("./mapModule/style.scss");
  642. $ZIndex: 1;
  643. .iconfont_nvue {
  644. font-family: iconfont_nvue;
  645. }
  646. .main-container {
  647. // position: relative;
  648. }
  649. .my-location {
  650. // position: absolute;
  651. // align-items: center;
  652. justify-content: center;
  653. // right: 20rpx;
  654. // top: 800rpx;
  655. width: 100rpx;
  656. height: 100rpx;
  657. border-radius: 22rpx;
  658. background-color: #fff;
  659. .my-img {
  660. width: 54rpx;
  661. height: 54rpx;
  662. }
  663. }
  664. .search-bg {
  665. position: absolute;
  666. z-index: 1;
  667. background-color: rgba(0, 0, 0, 0.4);
  668. }
  669. // .address-list {
  670. // .address-item {
  671. // height: 176rpx;
  672. // border-bottom-width: 1rpx;
  673. // border-bottom-style: solid;
  674. // border-bottom-color: #EDEDED;
  675. // padding: 30rpx 0 20rpx;
  676. // flex-direction: column;
  677. // justify-content: space-between;
  678. // .address-headline {
  679. // flex-direction: row;
  680. // justify-content: space-between;
  681. // align-items: center;
  682. // .headline-name {
  683. // flex: 1;
  684. // font-size: 28rpx;
  685. // font-weight: 500;
  686. // color: #1a1a1a;
  687. // }
  688. // .headline-distance {
  689. // width: 200rpx;
  690. // flex-direction: row;
  691. // justify-content: flex-end;
  692. // align-items: center;
  693. // .distance-text {
  694. // font-size: 24rpx;
  695. // font-weight: 300;
  696. // text-align: left;
  697. // color: #666666;
  698. // }
  699. // .distance-icon {
  700. // width: 28rpx;
  701. // height: 28rpx;
  702. // }
  703. // }
  704. // }
  705. // .location-info {
  706. // flex-direction: row;
  707. // align-items: center;
  708. // .location-icon {
  709. // width: 21.54rpx;
  710. // height: 25.96rpx;
  711. // }
  712. // .location-text {
  713. // flex: 1;
  714. // padding-left: 5rpx;
  715. // font-size: 24rpx;
  716. // font-weight: 300;
  717. // color: #808080;
  718. // }
  719. // }
  720. // .times {
  721. // .time-info {
  722. // font-size: 24rpx;
  723. // font-weight: 300;
  724. // color: #808080;
  725. // }
  726. // }
  727. // }
  728. // }
  729. .top-btn-box {
  730. position: absolute;
  731. right: 20rpx;
  732. z-index: 1;
  733. .top-btn {
  734. width: 100rpx;
  735. background-color: #fff;
  736. border-radius: 20rpx;
  737. box-shadow: 0 0 20rpx #ccc;
  738. // padding: 0 15rpx;
  739. .top-btn-item-l {
  740. border-bottom-width: 1rpx;
  741. border-bottom-style: solid;
  742. border-bottom-color: #efefef;
  743. }
  744. .top-btn-item {
  745. // width: 64rpx;
  746. padding: 20rpx 0;
  747. display: flex;
  748. flex-direction: column;
  749. justify-content: center;
  750. align-items: center;
  751. .top-img {
  752. width: 60rpx !important;
  753. height: 60rpx !important;
  754. }
  755. .top-txt {
  756. font-size: 20rpx;
  757. margin-top: 3rpx;
  758. }
  759. }
  760. .more-map {
  761. .iconfont_nvue {
  762. color: #48AAB2;
  763. }
  764. // .top-img{
  765. // }
  766. .top-txt {
  767. color: #48AAB2;
  768. }
  769. // <text class="iconfont_nvue">&#xe7ce;</text>
  770. // <text class="top-txt" style="color: #48AAB2;">更多地图</text>
  771. }
  772. }
  773. .data-type {
  774. flex-direction: column;
  775. justify-content: center;
  776. align-items: center;
  777. background-color: #fff;
  778. width: 100rpx;
  779. padding: 10rpx 0;
  780. border-radius: 20rpx;
  781. margin-top: 30rpx;
  782. .data-type-icon {
  783. color: #1a1a1a;
  784. font-size: 50rpx;
  785. }
  786. .top-txt {
  787. font-size: 24rpx;
  788. font-family: PingFang SC, PingFang SC-Regular;
  789. font-weight: 400;
  790. text-align: center;
  791. color: #1a1a1a;
  792. }
  793. }
  794. // .top-btn {
  795. // flex-direction: column;
  796. // padding: 20rpx 10rpx;
  797. // border-radius: 20rpx;
  798. // background-color: #fff;
  799. // box-shadow: 0 0 20rpx #ccc;
  800. // .top-btn-item {
  801. // flex-direction: column;
  802. // align-items: center;
  803. // margin-bottom: 15rpx;
  804. // }
  805. // .top-btn-item-l {
  806. // margin-bottom: 0;
  807. // }
  808. // .top-img {
  809. // width: 60rpx;
  810. // height: 60rpx;
  811. // }
  812. // .top-txt {
  813. // font-size: 20rpx;
  814. // margin-top: 3rpx;
  815. // }
  816. // .btn-more {
  817. // margin-top: 30rpx;
  818. // }
  819. // }
  820. }
  821. .map-headline {
  822. flex-direction: row;
  823. justify-content: space-between;
  824. align-items: center;
  825. padding: 0 20rpx;
  826. height: 60rpx;
  827. .headline-lr {
  828. width: 100rpx;
  829. }
  830. .iconfont_nvue {
  831. text-align: right;
  832. font-size: 40rpx;
  833. color: #999999;
  834. }
  835. .headline-text {
  836. font-size: 36rpx;
  837. font-family: PingFang SC, PingFang SC-Bold;
  838. font-weight: 700;
  839. text-align: center;
  840. color: #1a1a1a;
  841. }
  842. }
  843. .map-type {
  844. padding: 30rpx 0 10rpx;
  845. .map-type-lable {
  846. flex-direction: row;
  847. align-items: center;
  848. .label-line {
  849. width: 8rpx;
  850. height: 35rpx;
  851. border-radius: 4rpx;
  852. background-color: #44c6d4;
  853. }
  854. .lable-name {
  855. font-size: 32rpx;
  856. font-family: PingFang SC, PingFang SC-Regular;
  857. font-weight: 400;
  858. text-align: left;
  859. color: #1a1a1a;
  860. line-height: 30px;
  861. padding-left: 22rpx;
  862. }
  863. }
  864. .map-type-list {
  865. flex-direction: row;
  866. align-items: stretch;
  867. flex-wrap: wrap;
  868. .map-type-item {
  869. width: 175rpx;
  870. flex-direction: column;
  871. justify-content: center;
  872. align-items: center;
  873. margin-top: 30rpx;
  874. .map-type-icon {
  875. width: 86rpx;
  876. height: 86rpx;
  877. }
  878. .map-type-name {
  879. padding: 13rpx 4rpx 0;
  880. font-size: 26rpx;
  881. font-family: PingFang SC, PingFang SC-Regular;
  882. font-weight: 400;
  883. text-align: center;
  884. color: #666666;
  885. }
  886. }
  887. }
  888. }
  889. .auto-width-item {
  890. overflow: hidden;
  891. flex-direction: row;
  892. }
  893. .nvue-one-row {
  894. text-overflow: ellipsis; //文字超出省略号
  895. lines: 1; //文字行数
  896. }
  897. .nvue-two-row {
  898. text-overflow: ellipsis; //文字超出省略号
  899. lines: 2; //文字行数
  900. }
  901. </style>