Roebin 3 vuotta sitten
vanhempi
commit
6a645db1fa

+ 1 - 1
pages/travel.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="travelPage">
 	<view class="travelPage">
-		<u-swiper height=500 :list="swiper"  circular :autoplay="false" show-center-play-btn :poster="imgUrl">
+		<u-swiper height=500 :list="swiper"  circular :autoplay="true" show-center-play-btn :poster="imgUrl" :duration="1000" :interval="5000">
 		</u-swiper>
 		</u-swiper>
 		<u-sticky bgColor="#fff">
 		<u-sticky bgColor="#fff">
 			<view class="tags">
 			<view class="tags">

+ 1 - 1
pages/travel/contract.vue

@@ -33,7 +33,7 @@
 					}
 					}
 				}).then((res) => {
 				}).then((res) => {
 					
 					
-					this.content=res[7].value
+					this.content=res[6].value
 					uni.hideLoading()
 					uni.hideLoading()
 				}).catch((err) => {
 				}).catch((err) => {
 					uni.hideLoading()
 					uni.hideLoading()

+ 9 - 3
pages/travel/poster.vue

@@ -121,6 +121,7 @@
 					uni.getSetting({
 					uni.getSetting({
 						success: (res) => {
 						success: (res) => {
 							//如果没有相册权限
 							//如果没有相册权限
+							console.log(22222)
 							if (!res.authSetting["scope.writePhotosAlbum"]) {
 							if (!res.authSetting["scope.writePhotosAlbum"]) {
 								//向用户发起授权请求
 								//向用户发起授权请求
 								uni.authorize({
 								uni.authorize({
@@ -128,8 +129,10 @@
 									success: () => {
 									success: () => {
 										//授权成功保存图片到系统相册
 										//授权成功保存图片到系统相册
 										uni.downloadFile({
 										uni.downloadFile({
-											url: this.imgurl,
+											url: that.imgurl,
 											success: (res) => {
 											success: (res) => {
+												
+												uni.hideLoading();
 												console.log(res)
 												console.log(res)
 												if (res.statusCode === 200) {
 												if (res.statusCode === 200) {
 													uni.saveImageToPhotosAlbum({
 													uni.saveImageToPhotosAlbum({
@@ -175,21 +178,24 @@
 									},
 									},
 								});
 								});
 							} else {
 							} else {
+								console.log(22222)
 								//如果已有相册权限,直接保存图片到系统相册
 								//如果已有相册权限,直接保存图片到系统相册
 								uni.downloadFile({
 								uni.downloadFile({
-									url:this.imgurl,
+									url:that.imgurl,
 									success: (res) => {
 									success: (res) => {
-										console.log(res)
+										console.log(res,996)
 										if (res.statusCode === 200) {
 										if (res.statusCode === 200) {
 											uni.saveImageToPhotosAlbum({
 											uni.saveImageToPhotosAlbum({
 												filePath: res.tempFilePath,
 												filePath: res.tempFilePath,
 												success: function() {
 												success: function() {
+													uni.hideLoading()
 													uni.showToast({
 													uni.showToast({
 														title: "保存成功",
 														title: "保存成功",
 														icon: "none"
 														icon: "none"
 													});
 													});
 												},
 												},
 												fail: function() {
 												fail: function() {
+													uni.hideLoading()
 													uni.showToast({
 													uni.showToast({
 														title: "保存失败",
 														title: "保存失败",
 														icon: "none"
 														icon: "none"

+ 2 - 1
pages/travel/submitOrder.vue

@@ -2,7 +2,8 @@
 	<view class="">
 	<view class="">
 		<view class="top">
 		<view class="top">
 			<view class="image">
 			<view class="image">
-				<image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png"></image>
+				<image :src="suborder.cover_picture" mode="aspectFill"></image>
+				<!-- <image :src="suborder.cover_picture" ></image> -->
 			</view>
 			</view>
 			<view class="">
 			<view class="">
 				<view class="" style="font-size: 32rpx;font-weight: 600;">
 				<view class="" style="font-size: 32rpx;font-weight: 600;">

+ 94 - 32
pages/travel/travelDetails.vue

@@ -33,7 +33,7 @@
 
 
 					<u-tabs :list="list1" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"
 					<u-tabs :list="list1" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"
 						:inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=50
 						:inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=50
-						:scrollable="false" @click="check"></u-tabs>
+						:scrollable="false" @click="check" :current="active"></u-tabs>
 
 
 				</view>
 				</view>
 			</u-sticky>
 			</u-sticky>
@@ -68,7 +68,7 @@
 				<u-parse :content="goodsInfo.instruction"></u-parse>
 				<u-parse :content="goodsInfo.instruction"></u-parse>
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="" style="padding-top: 100rpx;width: 100%;"></view>
+		<!-- <view class="" style="padding-top: 100rpx;width: 100%;"></view> -->
 
 
 		<view class="navbar footer">
 		<view class="navbar footer">
 			<view class="kefu flex">
 			<view class="kefu flex">
@@ -138,7 +138,7 @@
 						:key="index" lineWidth="48" lineHeight="4">
 						:key="index" lineWidth="48" lineHeight="4">
 					</u-tabs>
 					</u-tabs>
 				</view>
 				</view>
-				
+
 				<view class="item">
 				<view class="item">
 					<view class="more" v-if="days.length==0">暂无房型</view>
 					<view class="more" v-if="days.length==0">暂无房型</view>
 					<view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days"
 					<view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days"
@@ -178,12 +178,12 @@
 
 
 		<!-- <scroll-view  scroll-y="true"  style="height: 90vh;"   scroll-with-animation="true"> -->
 		<!-- <scroll-view  scroll-y="true"  style="height: 90vh;"   scroll-with-animation="true"> -->
 		<view class="model">
 		<view class="model">
-			<u-modal :show="isshow" title="报名前必看"  showCancelButton @confirm="goadd" @cancel="cancel"
+			<u-modal :show="isshow" title="报名前必看" showCancelButton @confirm="goadd" @cancel="cancel"
 				confirmColor="#ffffff" style="margin-left: 0;padding-left: 22rpx;">
 				confirmColor="#ffffff" style="margin-left: 0;padding-left: 22rpx;">
 				<view style="height: 560rpx;overflow: auto;">
 				<view style="height: 560rpx;overflow: auto;">
 					<u-parse :content="content"></u-parse>
 					<u-parse :content="content"></u-parse>
 				</view>
 				</view>
-				
+
 			</u-modal>
 			</u-modal>
 		</view>
 		</view>
 		<!-- </scroll-view> -->
 		<!-- </scroll-view> -->
@@ -244,7 +244,14 @@
 				// 
 				// 
 				scrollTop: 0,
 				scrollTop: 0,
 				price: 0,
 				price: 0,
-				picture:[]
+				picture: [],
+				active: 0,
+				tab1top:'',
+				 tab2top:'',
+				 tab3top:'',
+				tab4top:'',
+				tab4bottom:'',
+				cancelScroll:false,
 			}
 			}
 
 
 		},
 		},
@@ -254,10 +261,12 @@
 				this.init(options.id)
 				this.init(options.id)
 			}
 			}
 			let data = uni.getStorageSync("data")
 			let data = uni.getStorageSync("data")
-			this.content=data[3].value
+			this.content = data[3].value
 		},
 		},
 		onShow() {
 		onShow() {
 			this.initvist()
 			this.initvist()
+
+
 		},
 		},
 		computed: {
 		computed: {
 			minprice() {
 			minprice() {
@@ -271,6 +280,7 @@
 		onPageScroll(e) {
 		onPageScroll(e) {
 			// console.log(e,"<==============距离顶部的距离")
 			// console.log(e,"<==============距离顶部的距离")
 			this.scrollTop = e.scrollTop
 			this.scrollTop = e.scrollTop
+			this.handleScroll()
 		},
 		},
 		// #ifdef MP
 		// #ifdef MP
 		onShareAppMessage(s = false) {
 		onShareAppMessage(s = false) {
@@ -283,24 +293,22 @@
 		},
 		},
 		// #endif
 		// #endif
 		methods: {
 		methods: {
-		initvist(){
-			let curPage = getCurrentPages();
-			let route = curPage[curPage.length - 1].route; //获取当前页面的路由
-			let code=uni.getStorageSync("code")
-			let obj={
-				page:route,
-				code:code
-			}
-			if(code){
-				uni.$u.http.post('/api/visit/add',obj,{
-					custom: {
-						auth: true
-					}
-				}).then((res) => {
-				}).catch((err) => {
-				})
-			}
-		},
+			initvist() {
+				let curPage = getCurrentPages();
+				let route = curPage[curPage.length - 1].route; //获取当前页面的路由
+				let code = uni.getStorageSync("code")
+				let obj = {
+					page: route,
+					code: code
+				}
+				if (code) {
+					uni.$u.http.post('/api/visit/add', obj, {
+						custom: {
+							auth: true
+						}
+					}).then((res) => {}).catch((err) => {})
+				}
+			},
 			init(id) {
 			init(id) {
 				this.$showLoadding("加载中")
 				this.$showLoadding("加载中")
 				uni.$u.http.post('/api/good/show', {
 				uni.$u.http.post('/api/good/show', {
@@ -313,7 +321,7 @@
 					uni.hideLoading();
 					uni.hideLoading();
 					this.goodsInfo = res
 					this.goodsInfo = res
 					this.tags = res.tags
 					this.tags = res.tags
-					this.picture=JSON.parse(res.picture)
+					this.picture = JSON.parse(res.picture)
 					let newmonth = []
 					let newmonth = []
 					for (let key in res.plans) {
 					for (let key in res.plans) {
 						newmonth.push({
 						newmonth.push({
@@ -331,18 +339,18 @@
 				if (this.dayindex >= 0) {
 				if (this.dayindex >= 0) {
 					this.isshow = true
 					this.isshow = true
 				} else {
 				} else {
-					if(this.days.length>0){
+					if (this.days.length > 0) {
 						uni.showModal({
 						uni.showModal({
 							title: "提示",
 							title: "提示",
 							content: "请选择出发日期"
 							content: "请选择出发日期"
 						})
 						})
-					}else{
+					} else {
 						uni.showModal({
 						uni.showModal({
 							title: "提示",
 							title: "提示",
 							content: "暂无房型"
 							content: "暂无房型"
 						})
 						})
 					}
 					}
-					
+
 					return
 					return
 				}
 				}
 			},
 			},
@@ -367,7 +375,7 @@
 				goodsInfo.name = this.goodsInfo.name
 				goodsInfo.name = this.goodsInfo.name
 				goodsInfo.id = this.goodsInfo.id
 				goodsInfo.id = this.goodsInfo.id
 				goodsInfo.subtitle = this.goodsInfo.subtitle
 				goodsInfo.subtitle = this.goodsInfo.subtitle
-				goodsInfo.cohabit=this.goodsInfo.cohabit
+				goodsInfo.cohabit = this.goodsInfo.cohabit
 				// uni.navigateTo({
 				// uni.navigateTo({
 				// 	url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
 				// 	url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
 				// })
 				// })
@@ -415,6 +423,7 @@
 							duration: 200, //过渡时间
 							duration: 200, //过渡时间
 							scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
 							scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
 						})
 						})
+						console.log( res.top + this.scrollTop - 50,996555)
 					}).exec()
 					}).exec()
 				} else if (item.name == "费用") {
 				} else if (item.name == "费用") {
 					uni.createSelectorQuery().select(".charge").boundingClientRect(res => { //目标位置的节点:类或者id
 					uni.createSelectorQuery().select(".charge").boundingClientRect(res => { //目标位置的节点:类或者id
@@ -437,8 +446,59 @@
 					})
 					})
 
 
 				}
 				}
+				 this.cancelScroll = true;
+				            setTimeout(() =>{
+				                this.cancelScroll = null;
+				            },500);
 
 
 			},
 			},
+			handleScroll() {
+
+				if (this.cancelScroll) {
+					return;
+				}
+				
+				// this.$refs 获取的是节点 不是数组
+				uni.createSelectorQuery().select('.trips').boundingClientRect(data => { //目标位置的节点:类或者id
+					that.tab1top = data.top-50 //到达距离顶部的top值
+				}).exec();
+				uni.createSelectorQuery().select('.duction').boundingClientRect(data => { //目标位置的节点:类或者id
+				 that.tab2top = data.top-50 //到达距离顶部的top值
+				}).exec();
+				uni.createSelectorQuery().select('.charge').boundingClientRect(data => { //目标位置的节点:类或者id
+					that.tab3top = data.top-50//到达距离顶部的top值
+					console.log(that.tab3top)
+				}).exec();
+				uni.createSelectorQuery().select('.notice').boundingClientRect(data => { //目标位置的节点:类或者id
+					 that.tab4top = data.top-50 //到达距离顶部的top值
+					  that.tab4bottom= data.bottom-50 //到达距离顶部的top值
+				}).exec();
+				// let tab2top = this.$refs['duction'][0].getBoundingClientRect().top;
+				// let tab3top = this.$refs['charge'][0].getBoundingClientRect().top;
+				// let tab4top = this.$refs['notice'][0].getBoundingClientRect().top;
+				// console.log(document.documentElement.scrollTop, '页面滚出');
+
+				// 86是怎么算的?也可以是0,小于0就是滚出去;(内容超出自己的高度,才会有滚动)
+				// 第一个tab的滚动的距离
+				if ( this.tab1top>0) {
+					this.active = 0;
+				}
+
+				// 第二个tab的滚动的距离
+				else if ( this.tab3top>0&&this.tab2top<0) {
+					this.active = 1;
+				}
+				// 第三个tab的滚动的距离
+				else if (this.tab3top<0&&this.tab2top<0&&this.tab4top>0) {
+					this.active = 2;
+				}
+
+				else if ( this.tab4top<0&&this.tab4bottom<0) {
+					this.active = 3;
+				}
+			},
+
+
 			// 生成海报
 			// 生成海报
 			goposter() {
 			goposter() {
 				uni.navigateTo({
 				uni.navigateTo({
@@ -459,16 +519,18 @@
 	page {
 	page {
 		background-color: #f4f4f4;
 		background-color: #f4f4f4;
 	}
 	}
-	._div{
+
+	._div {
 		margin-left: 0 !important;
 		margin-left: 0 !important;
 		padding-left: 22rpx !important;
 		padding-left: 22rpx !important;
 	}
 	}
+
 	.txtgray {
 	.txtgray {
 		color: #666666;
 		color: #666666;
 	}
 	}
 
 
 	.model {
 	.model {
-		height: 500rpx !important;
+		height: 50rpx !important;
 	}
 	}
 
 
 	.detailsPage {
 	.detailsPage {

+ 7 - 0
pages/travel/travelPeople.vue

@@ -377,6 +377,13 @@
 				suborder.good_id = this.goodsInfo.id
 				suborder.good_id = this.goodsInfo.id
 				suborder.start_at = this.day.slice(0, 10)
 				suborder.start_at = this.day.slice(0, 10)
 				suborder.room_id = this.room_id
 				suborder.room_id = this.room_id
+				this.houselist.forEach(item=>{
+					if(item.room_id==this.room_id){
+						console.log(111)
+						suborder.cover_picture =item.room_picture
+					}
+				})
+				console.log(suborder,9965)
 				suborder.number = this.value
 				suborder.number = this.value
 				suborder.travelers = []
 				suborder.travelers = []
 				suborder.cohabits = this.cohabits
 				suborder.cohabits = this.cohabits