123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- <template>
- <view class="map">
- <!-- 查询 -->
- <view class="address">
- <view style="width: 750rpx; height:1200rpx;">
- <map subkey='CQIBZ-P2MR5-PM3IB-QRKTX-SEVJE-GYF34' id="map" class="maps"
- @regionchange="onMapRegionChange" @tap="onMapTap" @markertap="onmarkertap" enable3D="true"
- enableBuilding="true" enableScroll="true" enableZoom="true" :latitude="latitude"
- :layerStyle="mapStyle" :longitude="longitude" :showCompass="false" :showLocation="true"
- :showScale="false" :scale="scale" :markers="markers"></map>
- </view>
- </view>
- <tab-bar></tab-bar>
- </view>
- </template>
- <script>
- import TabBar from '../../components/TabBar/tabbar.vue'
- import HchPosition from '../../components/hch-position/hch-position.vue'
- export default {
- components: {
- TabBar,
- HchPosition
- },
- data() {
- return {
- latitude: 39.924361, //中心纬度
- longitude: 116.518557, //中心经度
- mapStyle: 1, //个性化地图
- scale: 16,//缩放级别
- markers:[],//标记点
- }
- },
- onLoad() {
- //获取酒店列表
- this.getList()
- this.updated()
- },
- methods: {
- //获取用户定位
- updated() {
- let _this = this
- wx.getLocation({
- type: "gcj02", //返回可以用于wx.openLocation的经纬度
- success: function(res) {
- _this.latitude = res.latitude
- _this.longitude = res.longitude
- },
- fail: function(res) {
- console.log(res);
- }
- })
- },
- //视野发生变化时触发
- onMapRegionChange: function(e) {
- // var t = e.causedBy, r = e.type, i = e.detail.region;
- // if (("drag" == t || "scale" == t) && "end" == r) {
- // for (var n = i.northeast, o = i.southwest, l = this.data.markersSource, s = [], c = 0, u = l.length; c < u; c++) {
- // var d = l[c], g = d.latitude, p = d.longitude;
- // !d.load && g > o.latitude && g < n.latitude & p > o.longitude && p < n.longitude && (d.load = !0,
- // s.push(d));
- // }
- // a.addMarkers({
- // markers: s,
- // clear: !1
- // });
- // }
- },
- //点击地图时触发
- onMapTap: function(e) {},
- //点击标记点时触发
- onmarkertap: function(e) {
- var t = e.detail.markerId;
- wx.vibrateShort({
- type: "light"
- });
- var a = this.data,
- r = a.swiperCurrent;
- a.markersSource;
- this.updateActiveMarker(r, t), this.setData({
- swiperCurrent: t
- });
- },
- getList() {
- this.$api.hotel.getHotelList({
- page: 1
- }).then(res => {
- this.hotelList = res.data.data
- console.log(this.hotelList);
- this.markers = this.hotelList.map(item => {
- return {
- id: item.id,
- latitude: item.latitude,
- longitude: item.longitude,
- width: '34rpx',
- height: '40rpx',
- iconPath: '/../../static/navigation.png',
- callout: {
- content: item.name,
- borderRadius: 10,
- padding: 10,
- display: "ALWAYS",
- }
- }
- })
- console.log(this.markers);
- })
- },
- //去预定页面
- goBook() {
- uni.navigateTo({
- url: '/pages/map/hotel-book/index'
- })
- },
- //返回上一级
- returnBtn() {
- this.isShow = !this.isShow
- },
- //打开酒店列表
- goHotelList() {
- console.log(111);
- this.isShow = !this.isShow
- },
- //是否展示加盟品牌
- selectJoin() {
- this.isJoin = !this.isJoin
- },
- //是否展示合作伙伴
- selectPartner() {
- this.isPartner = !this.isPartner
- },
- //合作伙伴刷选
- change(e) {
- console.log('e:', e);
- },
- //菜单index切换
- checked(index) {
- this.isActive = index
- },
- //展开地区选择
- openArea() {
- console.log(111);
- this.isSelectArea = !this.isSelectArea
- },
- //展开品牌选择
- openBrand() {
- this.isSelectBrand = !this.isSelectBrand
- },
- //展开筛选选择
- openSift() {
- this.isSelectSift = !this.isSelectSift
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- height: 100%;
- }
- .map {
- height: 100%;
- background-color: #f9f9f9;
- display: flex;
- flex-direction: column;
- }
- .maps {
- width: 100%;
- height: 1200rpx;
- }
- .return-btn {
- position: fixed;
- right: 0;
- top: 927rpx;
- z-index: 99;
- }
- .home-bottom {
- height: 60rpx;
- background-color: #f9f9f9;
- }
- .hotel-list {
- width: 100%;
- background-color: #f9f9f9;
- padding: 32rpx 30rpx;
- padding-bottom: 200rpx;
- .hotel-list-item {
- width: 100%;
- margin-bottom: 20rpx;
- .wrap {
- width: 100%;
- height: 318rpx;
- position: relative;
- box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.08);
- border-radius: 10rpx;
- .inner {
- width: 100%;
- height: 318rpx;
- border-radius: 10rpx;
- background: rgba(0, 0, 0, 0.4);
- position: absolute;
- z-index: 2;
- top: 0;
- left: 0;
- .address-detail-main {
- position: absolute;
- left: 0;
- bottom: 30rpx;
- width: 100%;
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- .address-detail-main-left {
- position: absolute;
- left: 20rpx;
- .title {
- font-size: 32rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .content {
- margin: 12rpx 0 20rpx;
- width: 92rpx;
- height: 34rpx;
- background: rgba(142, 160, 166, .6);
- border-radius: 17rpx;
- color: #ffffff;
- font-size: 22rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .bottom {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .bottom-left {
- font-size: 24rpx;
- font-weight: bold;
- color: #ffffff;
- margin-right: 6rpx;
- }
- .bottom-right {
- font-size: 32rpx;
- font-weight: bold;
- color: #ffffff;
- }
- }
- }
- .address-detail-main-right {
- position: absolute;
- right: 24rpx;
- width: 120rpx;
- height: 44rpx;
- background: #FF6300;
- box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.08);
- border-radius: 22rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #ffffff;
- font-size: 28rpx;
- }
- }
- .address-detail-position {
- position: absolute;
- top: 22rpx;
- right: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 500;
- color: #FFFFFF;
- font-size: 20rpx;
- }
- }
- }
- }
- }
- .search-detail {
- width: 100%;
- position: absolute;
- top: 88rpx;
- z-index: 999 !important;
- background-color: #ffffff;
- box-shadow: 0px 12rpx 16rpx 0px rgba(220, 222, 229, 0.4);
- padding: 20rpx 30rpx 20rpx;
- .partner {
- .partner-top {
- height: 88rpx;
- border-top: 2rpx solid #F0F0F0;
- border-bottom: 2rpx solid #F0F0F0;
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #333;
- font-size: 28rpx;
- }
- .partner-main {
- margin-top: 32rpx;
- ::v-deep .uni-data-checklist .checklist-group .checklist-box {
- width: 26%;
- }
- ::v-deep .uni-data-checklist .checklist-group .checklist-box .checkbox__inner {
- width: 48rpx;
- height: 48rpx;
- }
- ::v-deep .uni-data-checklist .checklist-group .checklist-box .checkbox__inner .checkbox__inner-icon {
- top: 6rpx !important;
- left: 17rpx !important;
- height: 24rpx !important;
- width: 15rpx !important;
- border-right-color: #ff6200;
- border-bottom-color: #ff6200;
- }
- ::v-deep .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .checklist-text {
- color: #666 !important;
- font-size: 24rpx !important;
- }
- ::v-deep .checklist-text {
- font-size: 24rpx !important;
- }
- ::v-deep .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .checkbox__inner {
- border-color: #EDEDED !important;
- background-color: #ffffff;
- }
- }
- }
- .search-detail-area {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- align-items: center;
- .areaTitle {
- width: 156rpx;
- height: 56rpx;
- background: #FFFFFF;
- border: 2rpx solid #EDEDED;
- border-radius: 28rpx;
- font-size: 28rpx;
- color: #666;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 20rpx;
- margin-bottom: 18rpx;
- &:nth-child(4n) {
- margin-right: 0;
- }
- }
- // .areaTitle-item {
- // width: 156rpx;
- // height: 56rpx;
- // background-color: #F1F1F1;
- // border-radius: 26rpx;
- // font-size: 24rpx;
- // color: #999;
- // display: flex;
- // justify-content: center;
- // align-items: center;
- // }
- .active-area {
- width: 156rpx;
- height: 56rpx;
- border-radius: 28rpx;
- background-color: #FF6200;
- color: #fff;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- .search-detail-btn {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin: 38rpx 0 20rpx;
- .search-detail-btn-left {
- flex: 1;
- height: 76rpx;
- background: rgba(237, 237, 237, .55);
- border-radius: 8rpx;
- color: #999999;
- font-size: 30rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: bold;
- }
- .search-detail-btn-right {
- flex: 1;
- height: 76rpx;
- background: linear-gradient(270deg, #FF6200 0%, #FF9342 100%);
- border-radius: 8rpx;
- color: #FFFFFF;
- font-size: 30rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-left: 22rpx;
- font-weight: bold;
- }
- }
- ::v-deep .u-input {
- width: 690rpx !important;
- height: 68rpx !important;
- background: #F1F1F1;
- border-radius: 74rpx;
- }
- ::v-deep .u-input__content__field-wrapper {
- padding-left: 36rpx;
- }
- }
- .search-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .search {
- position: relative;
- flex: none;
- width: 100%;
- background: #FFFFFF;
- box-shadow: 0px 12rpx 16rpx 0px rgba(220, 222, 229, 0.4);
- display: flex;
- flex-direction: column;
- align-items: inherit;
- justify-content: space-between;
- .search-loupe {
- flex: none;
- width: 60rpx;
- height: 60rpx;
- background: #FFFFFF;
- border-radius: 50%;
- border: 2rpx solid #EDEDED;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- }
- .search-area-all {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .search-areaClick {
- padding: 12rpx 22rpx;
- height: 52rpx;
- background: #FFFFFF;
- border-radius: 26rpx;
- border: 2rpx solid #FF6200;
- font-weight: 500;
- color: #FF6200;
- font-size: 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- text {
- margin-right: 8rpx;
- }
- }
- .search-area {
- padding: 12rpx 22rpx;
- height: 52rpx;
- background: #FFFFFF;
- border-radius: 26rpx;
- border: 2rpx solid #EDEDED;
- font-weight: 500;
- color: #666666;
- font-size: 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 16rpx;
- text {
- margin-right: 8rpx;
- }
- }
- }
- }
- .address-nav {
- position: absolute;
- width: 100%;
- bottom: 34rpx;
- padding: 0 16rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- overflow-x: scroll;
- .address-nav-btn {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- }
- .address {
- flex: 1;
- position: relative;
- .address-detail {
- position: relative;
- flex: none;
- width: 496rpx;
- border-radius: 10rpx;
- margin-right: 16rpx;
- &:last-child {
- margin-right: 0rpx;
- }
- .inner {
- width: 100%;
- height: 318rpx;
- border-radius: 10rpx;
- background: rgba(0, 0, 0, 0.4);
- position: absolute;
- z-index: 2;
- top: 0;
- left: 0;
- .address-detail-main {
- position: absolute;
- left: 0;
- bottom: 30rpx;
- width: 100%;
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- .address-detail-main-left {
- position: absolute;
- left: 20rpx;
- .title {
- font-size: 32rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .content {
- margin: 12rpx 0 20rpx;
- width: 92rpx;
- height: 34rpx;
- background: rgba(142, 160, 166, .6);
- border-radius: 17rpx;
- color: #ffffff;
- font-size: 22rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .bottom {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .bottom-left {
- font-size: 24rpx;
- font-weight: bold;
- color: #ffffff;
- margin-right: 6rpx;
- }
- .bottom-right {
- font-size: 32rpx;
- font-weight: bold;
- color: #ffffff;
- }
- }
- }
- .address-detail-main-right {
- position: absolute;
- right: 24rpx;
- width: 120rpx;
- height: 44rpx;
- background: #FF6300;
- box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.08);
- border-radius: 22rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #ffffff;
- font-size: 28rpx;
- }
- }
- .address-detail-position {
- position: absolute;
- top: 22rpx;
- right: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 500;
- color: #FFFFFF;
- font-size: 20rpx;
- }
- }
- }
- }
- </style>
|