|
@@ -304,9 +304,9 @@
|
|
|
<view class="rim_body" v-if="rimList.length">
|
|
<view class="rim_body" v-if="rimList.length">
|
|
|
<!-- 每一个盒子区域 -->
|
|
<!-- 每一个盒子区域 -->
|
|
|
<view class="rim_box" v-for="item in rimList" :key="item.id" @click="GoRimDetail(item)">
|
|
<view class="rim_box" v-for="item in rimList" :key="item.id" @click="GoRimDetail(item)">
|
|
|
- <img mode="aspectFill" :src="item.first_img" />
|
|
|
|
|
|
|
+ <img mode="aspectFill" :src="item.first_img || item.coverImg" />
|
|
|
<view class="box_info">
|
|
<view class="box_info">
|
|
|
- <view class="info_top">{{ item.rname }}</view>
|
|
|
|
|
|
|
+ <view class="info_top">{{ item.rname || item.hname }}</view>
|
|
|
<view class="info_center" v-if="item.distance">距您{{ item.distance }}km</view>
|
|
<view class="info_center" v-if="item.distance">距您{{ item.distance }}km</view>
|
|
|
<!-- <view class="info_bottom">
|
|
<!-- <view class="info_bottom">
|
|
|
<view class="bottom_rate">4.8分</view>
|
|
<view class="bottom_rate">4.8分</view>
|
|
@@ -402,7 +402,9 @@ export default {
|
|
|
// 用户定位经度
|
|
// 用户定位经度
|
|
|
myLng: 0,
|
|
myLng: 0,
|
|
|
// 用户定位纬度
|
|
// 用户定位纬度
|
|
|
- myLat: 0
|
|
|
|
|
|
|
+ myLat: 0,
|
|
|
|
|
+ // 所属乡镇
|
|
|
|
|
+ town: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -416,6 +418,7 @@ export default {
|
|
|
this.getTimes()
|
|
this.getTimes()
|
|
|
this.hotelId = options.id
|
|
this.hotelId = options.id
|
|
|
this.distance = options.distance === 'undefined' ? false : options.distance
|
|
this.distance = options.distance === 'undefined' ? false : options.distance
|
|
|
|
|
+ this.town = options.town
|
|
|
uni.getSetting({
|
|
uni.getSetting({
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
this.showLocation = res.authSetting['scope.userLocation']
|
|
this.showLocation = res.authSetting['scope.userLocation']
|
|
@@ -431,7 +434,7 @@ export default {
|
|
|
this.myLng = res.longitude
|
|
this.myLng = res.longitude
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
- this.getRimList()
|
|
|
|
|
|
|
+ this.getRimList_hotel()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -460,14 +463,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
|
- if (this.rimList < this.rimTotal) {
|
|
|
|
|
- this.page++
|
|
|
|
|
- this.getRimList()
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '没有更多数据了',
|
|
|
|
|
- icon: 'none'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (this.rimActiveIndex != 0) {
|
|
|
|
|
+ if (this.rimList < this.rimTotal) {
|
|
|
|
|
+ this.page++
|
|
|
|
|
+ this.getRimList()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '没有更多数据了',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -484,6 +489,28 @@ export default {
|
|
|
this.lateTime = `${late.getFullYear()}-${(late.getMonth() + 1).toString().padStart(2, 0)}-${late.getDate().toString().padStart(2, 0)}`
|
|
this.lateTime = `${late.getFullYear()}-${(late.getMonth() + 1).toString().padStart(2, 0)}-${late.getDate().toString().padStart(2, 0)}`
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ async getRimList_hotel() {
|
|
|
|
|
+ const res = await this.$myRequest({
|
|
|
|
|
+ url: '/mhotel/appqueryMsByTown.action',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ town: this.town
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.rimList = res.data
|
|
|
|
|
+ const i = this.rimList.findIndex((el) => el.id == this.hotelId)
|
|
|
|
|
+ this.rimList.splice(i, 1)
|
|
|
|
|
+ if (this.distance && this.rimList.length) {
|
|
|
|
|
+ this.rimList.forEach((ele) => {
|
|
|
|
|
+ let lat = ele.hpositionWens.split(',')[0]
|
|
|
|
|
+ let lng = ele.hpositionWens.split(',')[1]
|
|
|
|
|
+ ele.distance = this.calculateDistance(lat, lng)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
async getRimList() {
|
|
async getRimList() {
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/mhotel/applistAround.action',
|
|
url: '/mhotel/applistAround.action',
|
|
@@ -507,10 +534,36 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
GoRimDetail(item) {
|
|
GoRimDetail(item) {
|
|
|
- let info = encodeURIComponent(JSON.stringify(item))
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: `/pages/rimDetail/rimDetail?info=${info}`
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (this.rimActiveIndex == 0) {
|
|
|
|
|
+ this.getTimes()
|
|
|
|
|
+ this.hotelId = item.id
|
|
|
|
|
+ this.info = null
|
|
|
|
|
+ this.list = []
|
|
|
|
|
+ this.getHotelInfo()
|
|
|
|
|
+ this.score = ''
|
|
|
|
|
+ this.commentList = []
|
|
|
|
|
+ this.getEvaData()
|
|
|
|
|
+ this.setTime = ''
|
|
|
|
|
+ this.getLateTime()
|
|
|
|
|
+ uni.getLocation({
|
|
|
|
|
+ type: 'gcj02',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ this.myLat = res.latitude
|
|
|
|
|
+ this.myLng = res.longitude
|
|
|
|
|
+ },
|
|
|
|
|
+ complete: () => {
|
|
|
|
|
+ this.getRimList_hotel()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.pageScrollTo({
|
|
|
|
|
+ scrollTop: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let info = encodeURIComponent(JSON.stringify(item))
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/rimDetail/rimDetail?info=${info}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 进入全屏和退出全屏时触发的回调
|
|
// 进入全屏和退出全屏时触发的回调
|
|
|
fullscreenchange(e) {
|
|
fullscreenchange(e) {
|
|
@@ -624,7 +677,11 @@ export default {
|
|
|
this.rimActiveIndex = index
|
|
this.rimActiveIndex = index
|
|
|
this.pgae = 1
|
|
this.pgae = 1
|
|
|
this.rimList = []
|
|
this.rimList = []
|
|
|
- this.getRimList()
|
|
|
|
|
|
|
+ if (this.rimActiveIndex == 0) {
|
|
|
|
|
+ this.getRimList_hotel()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.getRimList()
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
monthSwitch(e) {
|
|
monthSwitch(e) {
|
|
|
let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'
|
|
let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'
|