mapContent.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  1. <template>
  2. <view>
  3. <!-- pages/jsCase/citySel/index.wxml -->
  4. <!-- <sjs module="utils" src="../../../utils/formatFuc.sjs" /> -->
  5. <view :class="'head ' + (search && 'r_head')">
  6. <!-- 搜索框 -->
  7. <view class="flex-row search-box">
  8. <view class="city-block" @tap="switchCity">
  9. <view>{{ current_city }}</view>
  10. <image :class="'arrow-img ' + (cityShow ? 'arrow-up' : '')" mode="aspectFit"
  11. src="https://mall.zhaijieshi.cc/file/jzmall-dy/arrow-down.png"></image>
  12. </view>
  13. <view class="head_input">
  14. <image src="https://mall.zhaijieshi.cc/file/wx-dy/icon-search.png" class="search_icon"></image>
  15. <input type="text" placeholder="搜索" placeholder-class="place_holder" @input="getValue"
  16. :value="search" @focus="mapFocus" class="input-view" confirm-type="search"
  17. @confirm="confSearch" />
  18. </view>
  19. <view class="sha_icon" @tap.stop.prevent="clear_input" v-if="!mapShow">取消</view>
  20. </view>
  21. <view class="flex-row head_curr" v-if="cityShow">
  22. <image src="https://mall.zhaijieshi.cc/file/wx-dy/address-map.png" class="h_c_icon" />
  23. <view>当前定位城市: {{ current_city }}</view>
  24. </view>
  25. </view>
  26. <scroll-view v-if="cityShow" :scroll-y="true" class="sy_container" :scroll-into-view="scrollViewId">
  27. <view class="hot_city">
  28. <view class="title">热门城市</view>
  29. <view class="flex-row flex-wrap box">
  30. <block v-for="(item, index) in hot_city" :key="index">
  31. <view class="name" hover-class="sel_city" hover-stay-time="150" @tap="cityTap"
  32. :data-city="item.name">
  33. {{ item.name }}
  34. </view>
  35. </block>
  36. </view>
  37. </view>
  38. <view class="all_city">
  39. <view v-if="item.data.length > 0" v-for="(item, index) in city_list" :key="index">
  40. <view class="letter_name" :id="item.letter">{{ item.letter }}</view>
  41. <view class="city">
  42. <block v-for="(item0, index0) in item.data" :key="index0">
  43. <view class="name flex-row" hover-class="city_hover" hover-stay-time="150" @tap="cityTap"
  44. :data-city="item0.cityName">{{ item0.cityName }}</view>
  45. </block>
  46. </view>
  47. </view>
  48. </view>
  49. </scroll-view>
  50. <!-- 侧边选择索引 -->
  51. <view v-if="cityShow">
  52. <view class="fixed_bar" :style="'height: ' + barHeight + 'px;'" @touchstart.stop.prevent="touchStart"
  53. @touchmove.stop.prevent="touchMove" @touchend.stop.prevent="touchEnd"
  54. @touchcancel.stop.prevent="touchCancel">
  55. <view :style="'height: ' + barHeight / 22 + 'px;'" v-for="(item, index) in city_list" :key="index">
  56. <view :class="'bar_item flex-column j_c ' + (curr == index && 'bar_item_active')"
  57. :style="'width: ' + (barHeight / 22) * 0.75 + 'px;height: ' + (barHeight / 22) * 0.75 + 'px;'">
  58. {{ item.letter }}
  59. </view>
  60. </view>
  61. </view>
  62. <view v-if="showLetter && city_list[curr].letter" class="fixed_letter">{{ city_list[curr].letter }}</view>
  63. </view>
  64. <view v-if="resultShow" class="result_list">
  65. <view v-if="result.length > 0">
  66. <block v-for="(item, index) in result" :key="index">
  67. <view class="r_item" hover-stay-time="150" hover-class="r_item_hover" @tap="resultTap"
  68. :data-location="item.location" :data-name="item.name">
  69. <view>{{ item.name }}</view>
  70. <view>{{ item.district + item.address }}</view>
  71. </view>
  72. </block>
  73. </view>
  74. <view v-else class="flex-column no_data">
  75. <image src="https://mall.zhaijieshi.cc/file/jzmall-dy/no-data.png" />
  76. <view>未搜到相关地址</view>
  77. <view>输入地址后请点击搜索</view>
  78. </view>
  79. </view>
  80. <!-- tt-if="{{mapShow}}" -->
  81. <map :enable-rotate="true" :min-scale="3" :max-scale="19" id="myMap" :enable-scroll="true"
  82. :enable-overlooking="true" :longitude="lng" @tap="mapTap" :show-location="true" :latitude="lat" :scale="15"
  83. @regionchange="regionChange" :enable-zoom="true" @updated="mapUpdated"></map>
  84. <view class="marker-name" v-if="mapShow && currentName && currentName.length > 0">{{ currentName }}</view>
  85. <image src="https://mall.zhaijieshi.cc/file/jzmall-dy/icon-marker.png" class="map-icon" v-if="mapShow"></image>
  86. <scroll-view class="poi-list" :scroll-y="true" v-if="mapShow">
  87. <view class="poi-item" @tap="poiTap" :data-poi="item" v-for="(item, index) in poiList" :key="index">
  88. <view class="poi-left">
  89. <view class="poi-name">{{ item.name }}</view>
  90. <view class="poi-address">{{ item.address }}</view>
  91. </view>
  92. <view class="poi-right">{{ formatDistance(item.distance) }}米</view>
  93. </view>
  94. </scroll-view>
  95. </view>
  96. </template>
  97. <script>
  98. // pages/jsCase/citySel/index.js
  99. const {
  100. cityData
  101. } = require('./city.js');
  102. var map = require('../../../utils/map.js');
  103. var util = require('../../../utils/util.js');
  104. var api = require('../../../config/api.js');
  105. var app = getApp();
  106. export default {
  107. data() {
  108. return {
  109. index: 0,
  110. current_city: '当前定位',
  111. search: '',
  112. hot_city: [{
  113. name: '上海'
  114. },
  115. {
  116. name: '北京'
  117. },
  118. {
  119. name: '深圳'
  120. },
  121. {
  122. name: '南京'
  123. },
  124. {
  125. name: '苏州'
  126. },
  127. {
  128. name: '杭州'
  129. },
  130. {
  131. name: '青岛'
  132. },
  133. {
  134. name: '广州'
  135. },
  136. {
  137. name: '成都'
  138. },
  139. {
  140. name: '重庆'
  141. },
  142. {
  143. name: '昆山'
  144. },
  145. {
  146. name: '武汉'
  147. },
  148. {
  149. name: '西安'
  150. },
  151. {
  152. name: '长沙'
  153. }
  154. ],
  155. city_list: [],
  156. barHeight: 0,
  157. curr: -1,
  158. scrollViewId: '',
  159. barTop: 0,
  160. showLetter: true,
  161. result: [],
  162. //搜索结果
  163. mapShow: true,
  164. resultShow: false,
  165. cityShow: false,
  166. currentMarker: [
  167. // {longitude: 116.40159,
  168. // latitude: 39.90511,
  169. // title: '当前位置',}
  170. ],
  171. lng: '',
  172. lat: '',
  173. poiList: [],
  174. timer: '',
  175. loadTime: 0,
  176. isTouchMap: true,
  177. addressName: '',
  178. currentName: '',
  179. letter: ''
  180. };
  181. },
  182. onUnload: function() {
  183. // 页面关闭
  184. clearInterval(this.timer);
  185. },
  186. onLoad: function(options) {
  187. // this.getUserLocation();
  188. let timer = setInterval(() => {
  189. if (this.loadTime < 10) {
  190. this.setData({
  191. loadTime: this.loadTime + 1
  192. });
  193. } else {
  194. clearInterval(that.timer);
  195. }
  196. }, 1000);
  197. this.setData({
  198. timer: timer
  199. });
  200. this.setData({
  201. city_list: cityData
  202. });
  203. uni.getSystemInfo({
  204. success: (res) => {
  205. console.log(res);
  206. let winHeight = res.windowHeight;
  207. let barHeight = winHeight - (res.windowWidth / 750) * 300;
  208. this.setData({
  209. barHeight: barHeight,
  210. barTop: (res.windowWidth / 750) * 180
  211. });
  212. }
  213. });
  214. this.mapCtx = uni.createMapContext('myMap');
  215. let that = this;
  216. console.log(options);
  217. if (options.lng && options.lat) {
  218. that.setData({
  219. addressName: options.addressname,
  220. current_city: options.city,
  221. lng: options.lng,
  222. lat: options.lat
  223. });
  224. that.getPoiList();
  225. } else {
  226. // wx.authorize({
  227. // scope: "scope.userLocation",
  228. // success(res) {
  229. // console.log("已允许授权定位权限: ", res);
  230. uni.getLocation({
  231. type: 'wgs84',
  232. success: function(res) {
  233. let latitude = res.latitude;
  234. let longitude = res.longitude;
  235. app.globalData.lat = latitude; //
  236. app.globalData.lng = longitude; //把onload定位时候的经纬度存到全局
  237. app.globalData.currentLocationName = res.city;
  238. app.globalData.city = res.city;
  239. that.setData({
  240. addressName: app.globalData.currentLocationName,
  241. current_city: app.globalData.city,
  242. lng: app.globalData.lng,
  243. lat: app.globalData.lat
  244. });
  245. console.log('当前经纬度:' + longitude + ',' + latitude);
  246. that.getPoiList();
  247. },
  248. fail: function(res) {
  249. console.log('fail' + JSON.stringify(res));
  250. }
  251. });
  252. }
  253. //将地图中心移动到定位点
  254. // setTimeout(() => {
  255. // that.mapCtx.moveToLocation({
  256. // success: (res) => {
  257. // console.log(res);
  258. // },
  259. // fail: (res) => {
  260. // },
  261. // });
  262. // }, 2000);
  263. },
  264. onReady() {},
  265. methods: {
  266. formatDistance(value) {
  267. var result = Number(value).toFixed(0);
  268. return result;
  269. },
  270. getUserLocation: function() {
  271. map.getUserLocation();
  272. console.log(app.globalData);
  273. let that = this;
  274. setTimeout(() => {
  275. that.setData({
  276. addressName: app.globalData.currentLocationName,
  277. current_city: app.globalData.city,
  278. lng: app.globalData.lng,
  279. lat: app.globalData.lat
  280. });
  281. this.getPoiList();
  282. }, 1000);
  283. },
  284. /**
  285. * 获取value值
  286. * @param {*} e
  287. */
  288. getValue(e) {
  289. this.setData({
  290. search: e.detail.value
  291. },
  292. () => {
  293. // this.search(e.detail.value);
  294. }
  295. );
  296. },
  297. confSearch(e) {
  298. this.searchFun(this.search);
  299. },
  300. /**
  301. * 搜索成功
  302. */
  303. searchFun(e) {
  304. // let result = [], { city_list } = this.data;
  305. // city_list.forEach((item1) => {
  306. // item1.data.forEach((item2) => {
  307. // if (item2.keyword.indexOf(e.toLocaleUpperCase()) !== -1) {
  308. // result.push({ name: item2.cityName })
  309. // }
  310. // })
  311. // })
  312. // this.setData({
  313. // result,
  314. // })
  315. util.request(api.gdSearchUrl, {
  316. keywords: e,
  317. output: 'JSON',
  318. city: this.current_city,
  319. key: api.gdKey
  320. }).then((res) => {
  321. console.log(res);
  322. if (res.info == 'OK') {
  323. let list = res.tips;
  324. let result = list;
  325. if (list.length > 1) {
  326. // result=list.splice(1);
  327. this.setData({
  328. result: result
  329. });
  330. } else {
  331. this.setData({
  332. result: []
  333. });
  334. }
  335. }
  336. });
  337. },
  338. /**
  339. * 清空验证码
  340. */
  341. clear_input() {
  342. this.setData({
  343. search: '',
  344. mapShow: true,
  345. cityShow: false,
  346. resultShow: false
  347. });
  348. },
  349. touch(e) {
  350. let pageY = e.touches[0].pageY;
  351. let index = Math.floor((pageY - this.barTop) / (this.barHeight / 22)); //向下取整
  352. let item = this.city_list[index];
  353. if (item) {
  354. this.setData({
  355. scrollViewId: item.letter,
  356. curr: index
  357. });
  358. }
  359. },
  360. touchStart(e) {
  361. this.setData({
  362. showLetter: true
  363. });
  364. this.touch(e);
  365. },
  366. touchMove(e) {
  367. this.touch(e);
  368. },
  369. touchEnd() {
  370. this.setData({
  371. showLetter: false
  372. });
  373. },
  374. touchCancel() {
  375. this.setData({
  376. showLetter: false
  377. });
  378. },
  379. mapFocus() {
  380. this.setData({
  381. mapShow: false,
  382. resultShow: true,
  383. cityShow: false,
  384. result: []
  385. });
  386. },
  387. switchCity() {
  388. if (this.cityShow) {
  389. this.setData({
  390. mapShow: true,
  391. cityShow: false,
  392. resultShow: false
  393. });
  394. } else {
  395. this.setData({
  396. mapShow: false,
  397. cityShow: true,
  398. resultShow: false,
  399. search: ''
  400. });
  401. }
  402. },
  403. msg(title, duration = 1500) {
  404. uni.showToast({
  405. title,
  406. duration,
  407. icon: 'none'
  408. });
  409. },
  410. regionChange(e) {
  411. console.log('isTouchMap', this.isTouchMap);
  412. if (this.isTouchMap == false) {
  413. return;
  414. }
  415. console.log(e);
  416. // #ifdef MP-TOUTIAO
  417. console.log('region变化' + this.index + ':' + e.detail.type, e);
  418. const {
  419. centerLocation
  420. } = e.detail;
  421. let latitude = Number(centerLocation.latitude).toFixed(4);
  422. let longitude = Number(centerLocation.longitude).toFixed(4);
  423. console.log('当前中心点经纬度', latitude, longitude);
  424. // this.msg(this.data.index+'');
  425. // this.msg(`region: latitude: ${ latitude }, longitude: ${ longitude }`);
  426. // 经度范围:73°33′E至135°05′E 东经
  427. // 纬度范围:3°51′N至53°33′N 北纬
  428. if (this.loadTime > 3 && e.detail.type == 'end' && longitude > 72 && longitude < 136 && latitude > 3 &&
  429. latitude < 54) {
  430. if (latitude == this.lat) {
  431. return;
  432. }
  433. this.setData({
  434. lng: longitude,
  435. lat: latitude,
  436. index: this.index + 1
  437. });
  438. this.getPoiList();
  439. }
  440. // #endif
  441. // #ifdef MP-ALIPAY
  442. let latitude = Number(e.latitude).toFixed(4);
  443. let longitude = Number(e.longitude).toFixed(4);
  444. console.log('当前中心点经纬度', latitude, longitude);
  445. // this.msg(this.data.index+'');
  446. // this.msg(`region: latitude: ${ latitude }, longitude: ${ longitude }`);
  447. // 经度范围:73°33′E至135°05′E 东经
  448. // 纬度范围:3°51′N至53°33′N 北纬
  449. if (this.loadTime > 3 && e.type == 'end' && longitude > 72 && longitude < 136 && latitude > 3 && latitude <
  450. 54) {
  451. if (latitude == this.lat) {
  452. return;
  453. }
  454. this.setData({
  455. lng: longitude,
  456. lat: latitude,
  457. index: this.index + 1
  458. });
  459. this.getPoiList();
  460. }
  461. // #endif
  462. },
  463. mapTap(e) {
  464. console.log(e.detail);
  465. },
  466. getPoiList() {
  467. util.request(api.gdUrl, {
  468. // location:'116.40159,39.90511',
  469. location: this.lng + ',' + this.lat,
  470. extensions: 'all',
  471. // poitype:'',
  472. key: api.gdKey,
  473. radius: 3000
  474. }).then((res) => {
  475. console.log('poi', res);
  476. if (res.info == 'OK') {
  477. let list = res.regeocode.pois;
  478. var t = '';
  479. var length = list.length;
  480. for (var i = 0; i < length; i++) {
  481. for (var j = 0; j < length - i - 1; j++) {
  482. if (Number(list[j].distance) > Number(list[j + 1].distance)) {
  483. t = list[j];
  484. list[j] = list[j + 1];
  485. list[j + 1] = t;
  486. }
  487. }
  488. }
  489. this.setData({
  490. currentName: list.length > 0 ? list[0].name : res.regeocode.addressComponent
  491. .streetNumber.street,
  492. poiList: list
  493. });
  494. }
  495. });
  496. },
  497. resultTap(e) {
  498. // adcode: "110101"
  499. // address: "1号线/八通线"
  500. // city: []
  501. // district: "北京市东城区"
  502. // id: "BV10006499"
  503. // location: "116.401216,39.907780"
  504. // name: "天安门东(地铁站)"
  505. // typecode: "150500"
  506. let location = e.currentTarget.dataset.location;
  507. let name = e.currentTarget.dataset.name;
  508. this.setData({
  509. currentName: name,
  510. lng: location.split(',')[0],
  511. lat: location.split(',')[1],
  512. resultShow: false,
  513. mapShow: true
  514. });
  515. this.getPoiList();
  516. },
  517. cityTap(e) {
  518. // this.setData({
  519. // isTouchMap: false
  520. // });
  521. console.log('isTouchMap', this.isTouchMap);
  522. let city = e.currentTarget.dataset.city;
  523. console.log(city);
  524. util.request(api.gdCityUrl, {
  525. address: city,
  526. output: 'JSON',
  527. key: api.gdKey
  528. }).then((res) => {
  529. console.log(res);
  530. if (res.info == 'OK') {
  531. let location = res.geocodes[0].location;
  532. this.setData({
  533. current_city: city,
  534. lng: location.split(',')[0],
  535. lat: location.split(',')[1],
  536. cityShow: false,
  537. mapShow: true
  538. });
  539. this.getPoiList();
  540. // setTimeout(() => {
  541. // this.setData({
  542. // isTouchMap: true
  543. // })
  544. // }, 500);
  545. }
  546. });
  547. },
  548. poiTap(e) {
  549. // address: "菖蒲河沿9号(天安门东地铁站B东北口步行200米)"
  550. // businessarea: "东单"
  551. // direction: "东"
  552. // distance: "210.116"
  553. // id: "B0FFFLJW2Q"
  554. // location: "116.403456,39.908566"
  555. // name: "菖蒲河公园"
  556. // poiweight: "0.426156"
  557. // tel: []
  558. // type: "风景名胜;公园广场;公园"
  559. let poi = e.currentTarget.dataset.poi;
  560. console.log(poi);
  561. app.globalData.mapSelectFinish = true;
  562. app.globalData.mapSelectPoi = poi;
  563. uni.navigateBack();
  564. },
  565. mapUpdated(e) {
  566. console.log('mapupdated');
  567. console.log(e);
  568. // this.mapCtx = wx.createMapContext("myMap");
  569. this.mapCtx.getCenterLocation({
  570. success: (res) => {
  571. console.log(res);
  572. },
  573. fail: (res) => {}
  574. });
  575. }
  576. }
  577. };
  578. </script>
  579. <style>
  580. /* pages/jsCase/citySel/index.wxss */
  581. page {
  582. height: 100%;
  583. background: #f2f5f7;
  584. }
  585. .head {
  586. position: fixed;
  587. top: 0;
  588. left: 0;
  589. width: 100%;
  590. box-sizing: border-box;
  591. padding: 20rpx 20rpx 20rpx;
  592. background: #fff;
  593. z-index: 99999;
  594. }
  595. .search-box {
  596. display: flex;
  597. align-items: center;
  598. }
  599. .r_head {
  600. height: 90rpx;
  601. }
  602. .head_input {
  603. flex: 1;
  604. display: flex;
  605. align-items: center;
  606. height: 60rpx;
  607. padding-left: 16rpx;
  608. border-radius: 30rpx;
  609. background: #f2f5f7;
  610. }
  611. .search_icon {
  612. width: 30rpx;
  613. height: 30rpx;
  614. margin-right: 12rpx;
  615. }
  616. .head input {
  617. height: 60rpx;
  618. /* padding-left : 75rpx; */
  619. font-size: 28rpx;
  620. }
  621. .place_holder {
  622. font-size: 28rpx;
  623. color: #999999;
  624. }
  625. .sha_icon {
  626. margin-left: 18rpx;
  627. font-size: 28rpx;
  628. color: #333333;
  629. }
  630. .head_curr {
  631. height: 80rpx;
  632. display: flex;
  633. align-items: center;
  634. color: #333;
  635. font-size: 28rpx;
  636. /* padding-top: 20rpx; */
  637. box-sizing: border-box;
  638. }
  639. .h_c_icon {
  640. flex-shrink: 0;
  641. margin-right: 15rpx;
  642. width: 32rpx;
  643. height: 32rpx;
  644. margin-left: 12rpx;
  645. }
  646. .sy_container {
  647. box-sizing: border-box;
  648. width: 100%;
  649. height: 100vh;
  650. padding-top: 170rpx;
  651. position: relative;
  652. z-index: 9999;
  653. }
  654. .hot_city .title {
  655. padding: 10rpx 30rpx;
  656. color: #999;
  657. font-size: 26rpx;
  658. }
  659. .hot_city .box {
  660. background-color: #fff;
  661. padding: 5rpx 30rpx 15rpx 40rpx;
  662. box-sizing: border-box;
  663. }
  664. .hot_city .box .name {
  665. vertical-align: top;
  666. display: inline-block;
  667. min-width: 140rpx;
  668. line-height: 56rpx;
  669. height: 56rpx;
  670. border-radius: 28rpx;
  671. font-size: 28rpx;
  672. color: #333;
  673. text-align: center;
  674. padding: 0 20rpx;
  675. box-sizing: border-box;
  676. margin-top: 10rpx;
  677. margin-right: 20rpx;
  678. position: relative;
  679. }
  680. .hot_city .box .name::after {
  681. content: '';
  682. position: absolute;
  683. width: 200%;
  684. height: 200%;
  685. -webkit-transform-origin: 0 0;
  686. transform-origin: 0 0;
  687. -webkit-transform: scale(0.5, 0.5);
  688. transform: scale(0.5, 0.5);
  689. -webkit-box-sizing: border-box;
  690. box-sizing: border-box;
  691. left: 0;
  692. top: 0;
  693. border-radius: 56rpx;
  694. border: 2rpx solid rgb(235, 225, 225);
  695. }
  696. .sel_city {
  697. color: #fff !important;
  698. background: pink;
  699. }
  700. .all_city .letter_name {
  701. height: 48rpx;
  702. font-size: 24rpx;
  703. color: #999;
  704. background: #f2f5f7;
  705. padding: 0 30rpx;
  706. line-height: 48rpx;
  707. }
  708. .all_city .city {
  709. background-color: #fff;
  710. }
  711. .all_city .city .name {
  712. width: 100%;
  713. padding: 30rpx;
  714. font-size: 28rpx;
  715. color: #333;
  716. position: relative;
  717. overflow: hidden;
  718. }
  719. .all_city .city .name::after {
  720. content: '';
  721. position: absolute;
  722. border-bottom: 1rpx solid #eaeef1;
  723. -webkit-transform: scaleY(0.5);
  724. transform: scaleY(0.5);
  725. bottom: 0;
  726. right: 0;
  727. left: 30rpx;
  728. }
  729. .city_hover {
  730. background-color: #eee !important;
  731. }
  732. .fixed_bar {
  733. position: fixed;
  734. z-index: 99999;
  735. top: 180rpx;
  736. right: 0px;
  737. padding-right: 10rpx;
  738. width: 50rpx;
  739. font-size: 22rpx;
  740. text-align: center;
  741. }
  742. .bar_item {
  743. background-color: rgb(233, 228, 220);
  744. border-radius: 50%;
  745. }
  746. @media screen and (max-width: 320px) {
  747. .fixed_bar {
  748. font-size: 20rpx;
  749. }
  750. }
  751. .bar_item_active {
  752. background-color: #fff;
  753. /* box-shadow : 5rpx 5rpx 5rpx #f7c3ee; */
  754. box-shadow: 5rpx 5rpx 5rpx #09afff;
  755. }
  756. .fixed_letter {
  757. position: absolute;
  758. z-index: 20;
  759. width: 160rpx;
  760. height: 160rpx;
  761. left: 50%;
  762. top: 50%;
  763. margin-left: -80rpx;
  764. margin-top: -80rpx;
  765. border-radius: 80rpx;
  766. text-align: center;
  767. line-height: 160rpx;
  768. font-size: 70rpx;
  769. color: #fff;
  770. background-color: rgba(0, 0, 0, 0.5);
  771. /* box-shadow : 5rpx 5rpx 5rpx #f7c3ee; */
  772. box-shadow: 5rpx 5rpx 5rpx #09afff;
  773. }
  774. /* 搜索结果 */
  775. .result_list {
  776. padding-top: 90rpx;
  777. background: #fff;
  778. width: 100%;
  779. }
  780. .r_item {
  781. width: 100%;
  782. position: relative;
  783. padding: 20rpx 20rpx 20rpx 30rpx;
  784. font-size: 28rpx;
  785. color: #333;
  786. box-sizing: border-box;
  787. border-bottom: 1rpx solid #eaeef1;
  788. }
  789. .r_item::after {
  790. /* content : '';
  791. position : absolute;
  792. border-bottom : 1rpx solid #eaeef1;
  793. -webkit-transform: scaleY(0.5);
  794. transform : scaleY(0.5);
  795. bottom : 0;
  796. right : 0;
  797. left : 30rpx; */
  798. }
  799. .r_item_hover {
  800. background-color: #eee !important;
  801. }
  802. .no_data {
  803. margin-top: 80px;
  804. height: 500rpx;
  805. align-items: center;
  806. font-size: 26rpx;
  807. color: #999;
  808. display: flex;
  809. flex-direction: column;
  810. }
  811. .no_data image {
  812. width: 250rpx;
  813. height: 162rpx;
  814. margin-bottom: 30rpx;
  815. }
  816. #myMap {
  817. position: fixed;
  818. top: 80rpx;
  819. left: 0;
  820. z-index: 9;
  821. width: 100%;
  822. height: 580rpx;
  823. background-color: #f6f6f6;
  824. }
  825. .input-view {
  826. flex: 1;
  827. }
  828. .city-block {
  829. display: flex;
  830. align-items: center;
  831. }
  832. .arrow-img {
  833. width: 20rpx;
  834. height: 20rpx;
  835. margin: 0 8rpx;
  836. transform: rotate(0deg);
  837. transition: all 0.3s;
  838. }
  839. .arrow-up {
  840. transform: rotate(180deg);
  841. transition: all 0.3s;
  842. }
  843. .marker-name {
  844. z-index: 99;
  845. top: 282rpx;
  846. position: fixed;
  847. height: 68rpx;
  848. line-height: 68rpx;
  849. border-radius: 68rpx;
  850. background: #fff;
  851. padding: 0 20rpx;
  852. left: 50%;
  853. -webkit-transform: translate(-50%, 0);
  854. transform: translate(-50%, 0);
  855. display: inline-block;
  856. }
  857. .map-icon {
  858. position: fixed;
  859. z-index: 99;
  860. top: 350rpx;
  861. width: 70rpx;
  862. height: 70rpx;
  863. left: 340rpx;
  864. }
  865. .poi-list {
  866. position: fixed;
  867. background: #ffffff;
  868. z-index: 9999;
  869. top: 600rpx;
  870. width: 100%;
  871. left: 0;
  872. height: 1000rpx;
  873. }
  874. .poi-item {
  875. display: flex;
  876. padding: 20rpx;
  877. border-bottom: 1rpx solid #eee;
  878. align-items: center;
  879. }
  880. .poi-left {
  881. flex: 1;
  882. display: flex;
  883. flex-direction: column;
  884. }
  885. .poi-name {
  886. font-size: 28rpx;
  887. color: #333;
  888. margin-bottom: 12rpx;
  889. }
  890. .poi-address {
  891. font-size: 24rpx;
  892. color: #777;
  893. }
  894. .poi-right {
  895. margin-left: 40rpx;
  896. }
  897. .hot_city {
  898. position: relative;
  899. z-index: 9999;
  900. background: #f2f5f7;
  901. }
  902. .all_city {}
  903. .result_list {
  904. position: relative;
  905. z-index: 8888;
  906. min-height: 700rpx;
  907. }
  908. </style>