Browse Source

更改周边民宿逻辑

xiaoxin 2 years ago
parent
commit
6445e11eae

+ 1 - 1
pages/binding/binding.vue

@@ -68,7 +68,7 @@ export default {
 				return
 			}
 			uni.navigateTo({
-				url: `/pages/web/web?url=https://chtech.ncjti.edu.cn/hotelReservation/getLoginCode/&formName=${this.formName}&formPassword=${this.formPassword}&type=${this.type}&status=${this.status}`
+				url: `/pages/web/web?url=https://www.jinganrenjiams.com/hotelReservation/getLoginCode/&formName=${this.formName}&formPassword=${this.formPassword}&type=${this.type}&status=${this.status}`
 			})
 		}
 	}

+ 1 - 1
pages/complaint/complaint.vue

@@ -199,7 +199,7 @@ export default {
 				title: '上传中'
 			})
 			uni.uploadFile({
-				url: `https://chtech.ncjti.edu.cn/homestay/file/cos/upload`,
+				url: `https://www.jinganrenjiams.com/hotelReservation/file/cos/upload`,
 				filePath: ele.tempFilePath,
 				name: 'files',
 				success: (uploadFileRes) => {

+ 74 - 17
pages/detail/detail.vue

@@ -304,9 +304,9 @@
 			<view class="rim_body" v-if="rimList.length">
 				<!-- 每一个盒子区域 -->
 				<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="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_bottom">
 							<view class="bottom_rate">4.8分</view>
@@ -402,7 +402,9 @@ export default {
 			// 用户定位经度
 			myLng: 0,
 			// 用户定位纬度
-			myLat: 0
+			myLat: 0,
+			// 所属乡镇
+			town: ''
 		}
 	},
 	mounted() {
@@ -416,6 +418,7 @@ export default {
 		this.getTimes()
 		this.hotelId = options.id
 		this.distance = options.distance === 'undefined' ? false : options.distance
+		this.town = options.town
 		uni.getSetting({
 			success: (res) => {
 				this.showLocation = res.authSetting['scope.userLocation']
@@ -431,7 +434,7 @@ export default {
 				this.myLng = res.longitude
 			},
 			complete: () => {
-				this.getRimList()
+				this.getRimList_hotel()
 			}
 		})
 	},
@@ -460,14 +463,16 @@ export default {
 		}
 	},
 	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: {
@@ -484,6 +489,28 @@ export default {
 				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() {
 			const res = await this.$myRequest({
 				url: '/mhotel/applistAround.action',
@@ -507,10 +534,36 @@ export default {
 			}
 		},
 		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) {
@@ -624,7 +677,11 @@ export default {
 			this.rimActiveIndex = index
 			this.pgae = 1
 			this.rimList = []
-			this.getRimList()
+			if (this.rimActiveIndex == 0) {
+				this.getRimList_hotel()
+			} else {
+				this.getRimList()
+			}
 		},
 		monthSwitch(e) {
 			let time = e.year + '-' + e.month.toString().padStart(2, 0) + '-01'

+ 1 - 1
pages/evaluate/evaluate.vue

@@ -335,7 +335,7 @@ export default {
 				title: '上传中'
 			})
 			uni.uploadFile({
-				url: `https://chtech.ncjti.edu.cn/homestay/file/cos/upload`,
+				url: `https://www.jinganrenjiams.com/hotelReservation/file/cos/upload`,
 				filePath: ele.tempFilePath,
 				// name: 'myFile',
 				name: 'files',

+ 1 - 1
pages/home3/home3.vue

@@ -668,7 +668,7 @@ export default {
 
 		goPageDetail(item) {
 			uni.navigateTo({
-				url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}`
+				url: `/pages/detail/detail?id=${item.id}&distance=${item.distance}&town=${item.hotelTownshipName}`
 			})
 		},
 		// 弹窗关闭按钮回调

+ 1 - 1
pages/identity/identity.vue

@@ -17,7 +17,7 @@ export default {
 	methods: {
 		handleCheck(type) {
 			uni.navigateTo({
-				url: `/pages/web/web?url=https://chtech.ncjti.edu.cn/hotelReservation/getLoginCode/&type=${type}&check=1`
+				url: `/pages/web/web?url=https://www.jinganrenjiams.com/hotelReservation/getLoginCode/&type=${type}&check=1`
 			})
 		}
 	}

+ 1 - 1
pages/send/send.vue

@@ -228,7 +228,7 @@ export default {
 				title: '上传中'
 			})
 			uni.uploadFile({
-				url: `https://chtech.ncjti.edu.cn/homestay/file/cos/upload`,
+				url: `https://www.jinganrenjiams.com/hotelReservation/file/cos/upload`,
 				filePath: ele,
 				name: 'files',
 				success: (uploadFileRes) => {

+ 1 - 1
pages/set/set.vue

@@ -75,7 +75,7 @@ export default {
 						title: '上传中'
 					})
 					uni.uploadFile({
-						url: `https://chtech.ncjti.edu.cn/homestay/file/cos/upload`,
+						url: `https://www.jinganrenjiams.com/hotelReservation/file/cos/upload`,
 						filePath: res.tempFilePaths[0],
 						name: 'files',
 						success: async (uploadFileRes) => {

+ 1 - 1
pages/shopInfo/shopInfo.vue

@@ -59,7 +59,7 @@ export default {
 			})
 		},
 		handleGoMsg() {
-			let url = 'https://chtech.ncjti.edu.cn/hotelReservation/pc4/'
+			let url = 'https://www.jinganrenjiams.com/hotelReservation/pc4/'
 			uni.navigateTo({
 				url: `/pages/web/web?url=${url}`
 			})