mapContent.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978
  1. <template>
  2. <view>
  3. <!-- pages/jsCase/citySel/index.wxml -->
  4. <view :class="'head ' + (search && 'r_head')">
  5. <!-- 搜索框 -->
  6. <view class="flex-row search-box">
  7. <view class="city-block" @tap="switchCity">
  8. <view>{{ current_city }}</view>
  9. <image :class="'arrow-img ' + (cityShow ? 'arrow-up' : '')" mode="aspectFit" src="https://mall.zhaijieshi.cc/file/jzmall-dy/arrow-down.png"></image>
  10. </view>
  11. <view class="head_input">
  12. <image src="https://mall.zhaijieshi.cc/file/wx-huawang/ss.png" class="search_icon"></image>
  13. <input
  14. type="text"
  15. placeholder="搜索"
  16. placeholder-class="place_holder"
  17. @input="getValue"
  18. :value="search"
  19. @focus="mapFocus"
  20. class="input-view"
  21. confirm-type="search"
  22. @confirm="confSearch"
  23. />
  24. </view>
  25. <view class="sha_icon" @tap.stop.prevent="clear_input" v-if="!mapShow">取消</view>
  26. </view>
  27. <view class="flex-row head_curr" v-if="cityShow">
  28. <image src="https://mall.zhaijieshi.cc/file/wx-dy/address-map.png" class="h_c_icon" />
  29. <view>当前定位城市: {{ current_city }}</view>
  30. </view>
  31. </view>
  32. <scroll-view v-if="cityShow" :scroll-y="true" class="sy_container" :scroll-into-view="scrollViewId">
  33. <view class="hot_city">
  34. <view class="title">热门城市</view>
  35. <view class="flex-row flex-wrap box">
  36. <block v-for="(item, index) in hot_city" :key="index">
  37. <view class="name" hover-class="sel_city" hover-stay-time="150" @tap="cityTap" :data-city="item.name">
  38. {{ item.name }}
  39. </view>
  40. </block>
  41. </view>
  42. </view>
  43. <view class="all_city">
  44. <view v-if="item.data.length > 0" v-for="(item, index) in city_list" :key="index">
  45. <view class="letter_name" :id="'id'+item.letter">{{ item.letter }}</view>
  46. <view class="city">
  47. <block v-for="(item0, index0) in item.data" :key="index0">
  48. <view class="name flex-row" hover-class="city_hover" hover-stay-time="150" @tap="cityTap" :data-city="item0.cityName">{{ item0.cityName }}</view>
  49. </block>
  50. </view>
  51. </view>
  52. </view>
  53. </scroll-view>
  54. <!-- 侧边选择索引 -->
  55. <view v-if="cityShow">
  56. <view
  57. class="fixed_bar"
  58. :style="'height: ' + barHeight + 'px;'"
  59. @touchstart.stop.prevent="touchStart"
  60. @touchmove.stop.prevent="touchMove"
  61. @touchend.stop.prevent="touchEnd"
  62. @touchcancel.stop.prevent="touchCancel"
  63. >
  64. <view :style="'height: ' + barHeight / 22 + 'px;'" v-for="(item, index) in city_list" :key="index">
  65. <view
  66. :class="'bar_item flex-column j_c ' + (curr == index && 'bar_item_active')"
  67. :style="'width: ' + (barHeight / 22) * 0.75 + 'px;height: ' + (barHeight / 22) * 0.75 + 'px;'"
  68. >
  69. {{ item.letter }}
  70. </view>
  71. </view>
  72. </view>
  73. <view v-if="showLetter && city_list[curr].letter" class="fixed_letter">{{ city_list[curr].letter }}</view>
  74. </view>
  75. <view v-if="resultShow" class="result_list">
  76. <view v-if="result.length > 0">
  77. <block v-for="(item, index) in result" :key="index">
  78. <view class="r_item" hover-stay-time="150" hover-class="r_item_hover" @tap="resultTap" :data-location="item.location" :data-name="item.name">
  79. <view>{{ item.name }}</view>
  80. <view>{{ item.district + item.address }}</view>
  81. </view>
  82. </block>
  83. </view>
  84. <view v-else class="flex-column no_data">
  85. <image src="https://mall.zhaijieshi.cc/file/jzmall-dy/no-data.png" />
  86. <view>未搜到相关地址</view>
  87. <view>输入地址后请点击搜索</view>
  88. </view>
  89. </view>
  90. <!-- tt-if="{{mapShow}}" -->
  91. <map
  92. :enable-rotate="true"
  93. :min-scale="3"
  94. :max-scale="19"
  95. id="myMap"
  96. :enable-scroll="true"
  97. :enable-overlooking="true"
  98. :longitude="lng"
  99. @tap="mapTap"
  100. :show-location="true"
  101. :latitude="lat"
  102. :scale="15"
  103. @regionchange="regionChange"
  104. :enable-zoom="true"
  105. @updated="mapUpdated"
  106. ></map>
  107. <view class="marker-name" v-if="mapShow && currentName && currentName.length > 0">{{ currentName }}</view>
  108. <image src="https://mall.zhaijieshi.cc/file/jzmall-dy/icon-marker.png" class="map-icon" v-if="mapShow"></image>
  109. <scroll-view class="poi-list" :scroll-y="true" v-if="mapShow">
  110. <view class="poi-item" @tap="poiTap" :data-poi="item" v-for="(item, index) in poiList" :key="index">
  111. <view class="poi-left">
  112. <view class="poi-name">{{ item.name }}</view>
  113. <view class="poi-address">{{ item.address }}</view>
  114. </view>
  115. <view class="poi-right">{{ utils.formatDistance(item.distance) }}米</view>
  116. </view>
  117. </scroll-view>
  118. </view>
  119. </template>
  120. <script module="utils" lang="wxs" src="@/utils/formatFuc.wxs"></script>
  121. <script>
  122. // pages/jsCase/citySel/index.js
  123. const { cityData } = require('./city.js');
  124. var map = require('../../../utils/map.js');
  125. var util = require('../../../utils/util.js');
  126. var api = require('../../../config/api.js');
  127. var app = getApp();
  128. export default {
  129. data() {
  130. return {
  131. index: 0,
  132. current_city: '当前定位',
  133. search: '',
  134. hot_city: [
  135. {
  136. name: '上海'
  137. },
  138. {
  139. name: '北京'
  140. },
  141. {
  142. name: '深圳'
  143. },
  144. {
  145. name: '南京'
  146. },
  147. {
  148. name: '苏州'
  149. },
  150. {
  151. name: '杭州'
  152. },
  153. {
  154. name: '青岛'
  155. },
  156. {
  157. name: '广州'
  158. },
  159. {
  160. name: '成都'
  161. },
  162. {
  163. name: '重庆'
  164. },
  165. {
  166. name: '昆山'
  167. },
  168. {
  169. name: '武汉'
  170. },
  171. {
  172. name: '西安'
  173. },
  174. {
  175. name: '长沙'
  176. }
  177. ],
  178. city_list: [],
  179. barHeight: 0,
  180. curr: -1,
  181. scrollViewId: '',
  182. barTop: 0,
  183. showLetter: true,
  184. result: [],
  185. //搜索结果
  186. mapShow: true,
  187. resultShow: false,
  188. cityShow: false,
  189. currentMarker: [
  190. // {longitude: 116.40159,
  191. // latitude: 39.90511,
  192. // title: '当前位置',}
  193. ],
  194. lng: '',
  195. lat: '',
  196. poiList: [],
  197. timer: '',
  198. loadTime: 0,
  199. isTouchMap: true,
  200. addressName: '',
  201. currentName: '',
  202. letter: ''
  203. };
  204. },
  205. onUnload: function () {
  206. // 页面关闭
  207. clearInterval(this.timer);
  208. },
  209. onLoad: function (options) {
  210. // this.getUserLocation();
  211. let timer = setInterval(() => {
  212. if (this.loadTime < 10) {
  213. this.setData({
  214. loadTime: this.loadTime + 1
  215. });
  216. } else {
  217. clearInterval(that.timer);
  218. }
  219. }, 1000);
  220. this.setData({
  221. timer: timer
  222. });
  223. this.setData({
  224. city_list: cityData
  225. });
  226. uni.getSystemInfo({
  227. success: (res) => {
  228. console.log(res);
  229. let winHeight = res.windowHeight;
  230. let barHeight = winHeight - (res.windowWidth / 750) * 300;
  231. this.setData({
  232. barHeight: barHeight,
  233. barTop: (res.windowWidth / 750) * 180
  234. });
  235. }
  236. });
  237. this.mapCtx = uni.createMapContext('myMap');
  238. let that = this;
  239. console.log(options);
  240. if (options.lng && options.lat) {
  241. that.setData({
  242. addressName: options.addressname,
  243. current_city: options.city,
  244. lng: options.lng,
  245. lat: options.lat
  246. });
  247. console.log("city_list",this.city_list);
  248. that.getPoiList();
  249. } else {
  250. // wx.authorize({
  251. // scope: "scope.userLocation",
  252. // success(res) {
  253. // console.log("已允许授权定位权限: ", res);
  254. uni.getLocation({
  255. type: 'wgs84',
  256. success: function (res) {
  257. let latitude = res.latitude;
  258. let longitude = res.longitude;
  259. app.globalData.lat = latitude; //
  260. app.globalData.lng = longitude; //把onload定位时候的经纬度存到全局
  261. app.globalData.currentLocationName = res.city;
  262. app.globalData.city = res.city;
  263. that.setData({
  264. addressName: app.globalData.currentLocationName,
  265. current_city: app.globalData.city,
  266. lng: app.globalData.lng,
  267. lat: app.globalData.lat
  268. });
  269. console.log('当前经纬度:' + longitude + ',' + latitude);
  270. that.getPoiList();
  271. },
  272. fail: function (res) {
  273. console.log('fail' + JSON.stringify(res));
  274. }
  275. });
  276. // }
  277. // });
  278. }
  279. },
  280. onReady() {},
  281. methods: {
  282. getUserLocation: function () {
  283. map.getUserLocation();
  284. console.log(app.globalData);
  285. let that = this;
  286. setTimeout(() => {
  287. that.setData({
  288. addressName: app.globalData.currentLocationName,
  289. current_city: app.globalData.city,
  290. lng: app.globalData.lng,
  291. lat: app.globalData.lat
  292. });
  293. this.getPoiList();
  294. }, 1000);
  295. },
  296. /**
  297. * 获取value值
  298. * @param {*} e
  299. */
  300. getValue(e) {
  301. this.setData(
  302. {
  303. search: e.detail.value
  304. },
  305. () => {
  306. // this.search(e.detail.value);
  307. }
  308. );
  309. },
  310. confSearch(e) {
  311. this.searchFun(this.search);
  312. },
  313. /**
  314. * 搜索成功
  315. */
  316. searchFun(e) {
  317. // let result = [], { city_list } = this.data;
  318. // city_list.forEach((item1) => {
  319. // item1.data.forEach((item2) => {
  320. // if (item2.keyword.indexOf(e.toLocaleUpperCase()) !== -1) {
  321. // result.push({ name: item2.cityName })
  322. // }
  323. // })
  324. // })
  325. // this.setData({
  326. // result,
  327. // })
  328. util.request(api.gdSearchUrl, {
  329. keywords: e,
  330. output: 'JSON',
  331. city: this.current_city,
  332. key: api.gdKey
  333. }).then((res) => {
  334. console.log(res);
  335. if (res.info == 'OK') {
  336. let list = res.tips;
  337. let result = list;
  338. if (list.length > 1) {
  339. // result=list.splice(1);
  340. this.setData({
  341. result: result
  342. });
  343. } else {
  344. this.setData({
  345. result: []
  346. });
  347. }
  348. }
  349. });
  350. },
  351. /**
  352. * 清空验证码
  353. */
  354. clear_input() {
  355. this.setData({
  356. search: '',
  357. mapShow: true,
  358. cityShow: false,
  359. resultShow: false
  360. });
  361. },
  362. touch(e) {
  363. let pageY = e.touches[0].pageY;
  364. let index = Math.floor((pageY - this.barTop) / (this.barHeight / 22)); //向下取整
  365. let item = this.city_list[index];
  366. console.log("点击字母",item.letter);
  367. if (item) {
  368. this.setData({
  369. scrollViewId: "id"+item.letter,
  370. curr: index
  371. });
  372. }
  373. },
  374. touchStart(e) {
  375. this.setData({
  376. showLetter: true
  377. });
  378. this.touch(e);
  379. },
  380. touchMove(e) {
  381. this.touch(e);
  382. },
  383. touchEnd() {
  384. this.setData({
  385. showLetter: false
  386. });
  387. },
  388. touchCancel() {
  389. this.setData({
  390. showLetter: false
  391. });
  392. },
  393. mapFocus() {
  394. this.setData({
  395. mapShow: false,
  396. resultShow: true,
  397. cityShow: false,
  398. result: []
  399. });
  400. },
  401. switchCity() {
  402. if (this.cityShow) {
  403. this.setData({
  404. mapShow: true,
  405. cityShow: false,
  406. resultShow: false
  407. });
  408. } else {
  409. this.setData({
  410. mapShow: false,
  411. cityShow: true,
  412. resultShow: false,
  413. search: ''
  414. });
  415. }
  416. },
  417. msg(title, duration = 1500) {
  418. uni.showToast({
  419. title,
  420. duration,
  421. icon: 'none'
  422. });
  423. },
  424. regionChange(e) {
  425. console.log('isTouchMap', this.isTouchMap);
  426. if (this.isTouchMap == false) {
  427. return;
  428. }
  429. console.log('region变化' + this.index + ':' + e.detail.type, e);
  430. // this.msg(this.data.index+'');
  431. // this.msg(`region: latitude: ${ latitude }, longitude: ${ longitude }`);
  432. // 经度范围:73°33′E至135°05′E 东经
  433. // 纬度范围:3°51′N至53°33′N 北纬
  434. //type为end才有centerLocation
  435. // && longitude > 72 && longitude < 136 && latitude > 3 && latitude < 54
  436. if (this.loadTime > 3 && e.detail.type == 'end' && e.causedBy == 'drag') {
  437. const { centerLocation } = e.detail;
  438. let latitude = Number(centerLocation.latitude).toFixed(4);
  439. let longitude = Number(centerLocation.longitude).toFixed(4);
  440. console.log('当前中心点经纬度', latitude, longitude);
  441. // if (latitude == this.data.lat) return;
  442. this.setData({
  443. lng: longitude,
  444. lat: latitude,
  445. index: this.index + 1
  446. });
  447. this.getPoiList();
  448. // }
  449. }
  450. // this.setData({
  451. // currentMarker:[
  452. // {longitude:Number(longitude),
  453. // latitude:Number(latitude),
  454. // // title: '',
  455. // }
  456. // ]
  457. // });
  458. },
  459. mapTap(e) {
  460. console.log(e.detail);
  461. },
  462. getPoiList() {
  463. util.request(api.gdUrl, {
  464. // location:'116.40159,39.90511',
  465. location: this.lng + ',' + this.lat,
  466. extensions: 'all',
  467. // poitype:'',
  468. key: api.gdKey,
  469. radius: 3000
  470. }).then((res) => {
  471. console.log('poi', res);
  472. if (res.info == 'OK') {
  473. let list = res.regeocode.pois;
  474. var t = '';
  475. var length = list.length;
  476. for (var i = 0; i < length; i++) {
  477. for (var j = 0; j < length - i - 1; j++) {
  478. if (Number(list[j].distance) > Number(list[j + 1].distance)) {
  479. t = list[j];
  480. list[j] = list[j + 1];
  481. list[j + 1] = t;
  482. }
  483. }
  484. }
  485. this.setData({
  486. currentName: list.length > 0 ? list[0].name : res.regeocode.addressComponent.streetNumber.street,
  487. poiList: list
  488. });
  489. }
  490. });
  491. },
  492. resultTap(e) {
  493. // adcode: "110101"
  494. // address: "1号线/八通线"
  495. // city: []
  496. // district: "北京市东城区"
  497. // id: "BV10006499"
  498. // location: "116.401216,39.907780"
  499. // name: "天安门东(地铁站)"
  500. // typecode: "150500"
  501. let location = e.currentTarget.dataset.location;
  502. let name = e.currentTarget.dataset.name;
  503. this.setData({
  504. currentName: name,
  505. lng: location.split(',')[0],
  506. lat: location.split(',')[1],
  507. resultShow: false,
  508. mapShow: true
  509. });
  510. this.getPoiList();
  511. },
  512. cityTap(e) {
  513. // this.setData({
  514. // isTouchMap: false
  515. // });
  516. console.log('isTouchMap', this.isTouchMap);
  517. let city = e.currentTarget.dataset.city;
  518. console.log(city);
  519. util.request(api.gdCityUrl, {
  520. address: city,
  521. output: 'JSON',
  522. key: api.gdKey
  523. }).then((res) => {
  524. console.log(res);
  525. if (res.info == 'OK') {
  526. let location = res.geocodes[0].location;
  527. this.setData({
  528. current_city: city,
  529. lng: location.split(',')[0],
  530. lat: location.split(',')[1],
  531. cityShow: false,
  532. mapShow: true
  533. });
  534. this.getPoiList();
  535. // setTimeout(() => {
  536. // this.setData({
  537. // isTouchMap: true
  538. // })
  539. // }, 500);
  540. }
  541. });
  542. },
  543. poiTap(e) {
  544. // address: "菖蒲河沿9号(天安门东地铁站B东北口步行200米)"
  545. // businessarea: "东单"
  546. // direction: "东"
  547. // distance: "210.116"
  548. // id: "B0FFFLJW2Q"
  549. // location: "116.403456,39.908566"
  550. // name: "菖蒲河公园"
  551. // poiweight: "0.426156"
  552. // tel: []
  553. // type: "风景名胜;公园广场;公园"
  554. let poi = e.currentTarget.dataset.poi;
  555. console.log(poi);
  556. app.globalData.mapSelectFinish = true;
  557. app.globalData.mapSelectPoi = poi;
  558. uni.navigateBack();
  559. },
  560. mapUpdated(e) {
  561. console.log('mapupdated');
  562. console.log(e);
  563. // this.mapCtx = wx.createMapContext("myMap");
  564. this.mapCtx.getCenterLocation({
  565. success: (res) => {
  566. console.log(res);
  567. },
  568. fail: (res) => {}
  569. });
  570. }
  571. }
  572. };
  573. </script>
  574. <style>
  575. /* pages/jsCase/citySel/index.wxss */
  576. page {
  577. height: 100%;
  578. background: #f2f5f7;
  579. }
  580. .head {
  581. position: fixed;
  582. top: 0;
  583. left: 0;
  584. width: 100%;
  585. /* height : 170rpx; */
  586. box-sizing: border-box;
  587. padding: 20rpx 20rpx 20rpx;
  588. background: #fff;
  589. z-index: 99999;
  590. }
  591. .search-box {
  592. display: flex;
  593. align-items: center;
  594. }
  595. .r_head {
  596. height: 90rpx;
  597. }
  598. .head_input {
  599. /* position: relative; */
  600. flex: 1;
  601. display: flex;
  602. align-items: center;
  603. height: 60rpx;
  604. padding-left: 16rpx;
  605. border-radius: 30rpx;
  606. background: #f2f5f7;
  607. }
  608. .search_icon {
  609. /* position : absolute;
  610. top : 50%;
  611. left : 0;
  612. margin-top : -15rpx; */
  613. width: 30rpx;
  614. height: 30rpx;
  615. margin-right: 12rpx;
  616. }
  617. .head input {
  618. height: 60rpx;
  619. /* padding-left : 75rpx; */
  620. font-size: 28rpx;
  621. }
  622. .place_holder {
  623. font-size: 28rpx;
  624. color: #999999;
  625. }
  626. .sha_icon {
  627. margin-left: 18rpx;
  628. font-size: 28rpx;
  629. color: #333333;
  630. }
  631. .head_curr {
  632. height: 80rpx;
  633. display: flex;
  634. align-items: center;
  635. color: #333;
  636. font-size: 28rpx;
  637. /* padding-top: 20rpx; */
  638. box-sizing: border-box;
  639. }
  640. .h_c_icon {
  641. flex-shrink: 0;
  642. margin-right: 15rpx;
  643. width: 32rpx;
  644. height: 32rpx;
  645. margin-left: 12rpx;
  646. }
  647. .sy_container {
  648. box-sizing: border-box;
  649. width: 100%;
  650. height: 100vh;
  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. }
  904. .result_list {
  905. position: relative;
  906. z-index: 8888;
  907. min-height: 700rpx;
  908. }
  909. </style>