guo 2 éve%!(EXTRA string=óta)
szülő
commit
8b27a1adcc
1 módosított fájl, 40 hozzáadás és 233 törlés
  1. 40 233
      pages/user/bespeakDetail.vue

+ 40 - 233
pages/user/bespeakDetail.vue

@@ -85,62 +85,29 @@
 		<view class="bottom" v-if="(orderData.orderSheet.sheetState == 0)||(orderData.orderSheet.sheetState == 1)">
 		
 			<view class="cancel">取消预约</view>
-			<view class="defer" @click="timeShowClick">延期</view>
+			<view class="defer" @click="cktime">延期</view>
 		</view>
 		
 		<!-- 预约时间 -->
-		<view class="timeBox2" v-if="timeShow&&OrderTimes" @click="timeShow=false">
-			<view class="timeMain">
-				<view class="timeTop">
-					<view class="timeTopTitle">选择预约时间</view>
-					<view class="close" @click="timeShow=false">X</view>
-				</view>
-				<view class="timeCont">
-					<view class="timeLeft2">
-						<scroll-view scroll-y="true" class="timeSv">
-							<view class="timeleftLine" v-for="(item,index) in OrderTimes"
-								:class="{timeLeftActive:index==orderTimeIndex1}"
-								@click.stop="orderTimeIndex1=index,orderTimeIndex2=-1">{{item.date.substring(5,10)}}
-							</view>
-						</scroll-view>
-					</view>
-					<view class="timeRight2">
-						<scroll-view scroll-y="true" class="timeSv">
-							<view class="timerightBox">
-								<view class="timesf" v-for="(item,index) in OrderTimes[orderTimeIndex1].timeList"
-									:class="{timesfNo:item.type!=1,timesfActive:index==orderTimeIndex2}"
-									@click.stop="timeSfCk(item,index)">
-									<view class="timeSfNum">{{item.time}}</view>
-									<view class="timeyy" v-if="item.type==1">可预约</view>
-									<view class="timeyy" v-if="item.type==2">已约满</view>
-									<view class="timeyy" v-if="item.type==3">已过期</view>
-								</view>
-							</view>
-						</scroll-view>
-					</view>
-				</view>
-				<view class="timeBottom">
-					<view class="timecomplete" @click="timeCk">完成</view>
-				</view>
-			</view>
-		</view>
-				
+		<timeSelect ref="timeSelect" :timedata="timedata" @changeTime="changeTime"></timeSelect>	
 
 	</view>
 </template>
 
-<script>
-	export default {
+<script>
+	import timeSelect from '@/components/timeSelect/timeSelect.vue'
+	export default {
+		components: {
+			timeSelect
+		},
+	
 		data() {
 			return {
 				location: '',
 				id: '',
 				orderData: '',
-				timeShow: false,
-				orderTime: '',
-				OrderTimes: '',
-				orderTimeIndex1: 0,
-				orderTimeIndex2: -1,
+				timedata:'',
+				billDate:'',
 
 			}
 		},
@@ -155,7 +122,31 @@
 		},
 		
 		methods: {
-			
+			changeTime(data){
+				console.log(data)
+				this.billDate=data
+				this.upTime();
+			},
+			cktime(){
+				 this.$refs.timeSelect.open();
+			},
+			upTime() {
+				uni.showLoading({
+					title: '加载中'
+				})
+				this.$http('openreservation/carOwner/updateTimeOfAppointment', {
+			
+					id: this.id,
+					shopid: this.orderData.shopInfo.id,
+					billDate:this.billDate
+				}, 'POST').then(res => {
+					uni.hideLoading();
+					// var list = res.data.Items
+					var list = res.data
+					console.log("result+=",res.data);
+			
+				})
+			},
 			map() {
 				console.log("打开地图")
 				var that = this;
@@ -170,7 +161,7 @@
 						latitude: Number(that.orderData.shopInfo.lat),
 						longitude: Number(that.orderData.shopInfo.lng),
 						name: that.orderData.shopInfo.shopName,
-						address: that.orderData.shopInfo.province+that.orderData.shopInfo.city+that.orderData.shopInfo.area+that.orderData.shopInfo.address,
+						address: that.orderData.shopInfo.province+that.orderData.shopInfo.city+that.orderData.shopInfo.area+that.orderData.shopInfo.Address,
 						success: function() {
 							console.log('success');
 						},
@@ -202,57 +193,11 @@
 					uni.hideLoading();
 					this.orderData = res.data;
 
-					this.getOrderTimes();
+					
 					
 				})
 			},
-			getOrderTimes() {
-				this.$http('worldKeepCar/keepCarMy/getTSheetTimes', {
-					shopId: this.orderData.ShopID,
-					id:this.orderData.ID,
-				}, 'GET').then(res => {
-			
-					this.OrderTimes = res.data;
-				})
-			},
-			timeShowClick() {
-				if (this.OrderTimes) {
-					this.timeShow = true
-				} else {
-					uni.showToast({
-						title: '当前店铺尚未设置可预约时间',
-						icon: 'none',
-						duration: 3000
-					});
-				}
-			
-			},
-			timeSfCk(item, index) {
-				if (item.type == 1) {
-					this.orderTimeIndex2 = index;
-					var orderTime = this.OrderTimes[this.orderTimeIndex1].date + ' ' + item.time
-					this.orderTime = orderTime
-				}
-			
-			},
-			timeCk() {
-				this.timeShow = false;
-				var urlStr = 'worldKeepCar/keepCarMy/saveOrderTime'
-				
-				this.$http(urlStr, {
-					id: this.id,
-					orderTime: this.orderTime
-				}, 'POST').then(res => {
-					if (res.code == 0) {
-						uni.showToast({
-							title: '预约成功',
-							icon: 'none',
-							duration: 2000
-						});
-					}
-					this.getData()
-				})
-			},
+			
 			goback() {
 
 				uni.navigateBack({})
@@ -823,143 +768,5 @@
 		margin-right: 40rpx;
 	}
 	
-	.timeBox2 {
-		width: 100vw;
-		height: 100vh;
-		background: rgba(0, 0, 0, 0.5);
-		position: fixed;
-		top: 0;
-		left: 0;
-	}
-	
-	.timeLeftActive {
-		background: #FFFFFF;
-	}
-	
-	.timeMain {
-		width: 100vw;
-		height: 70vh;
-		margin-top: 30vh;
-		background: #FFFFFF;
-		border-radius: 24rpx 24rpx 0px 0px;
-	}
-	
-	.timesfNo {
-		background: #F5F5F5;
-	}
-	
-	.timesfActive {
-		background: #FF4F00;
-	
-	}
-	
-	.timesfActive .timeSfNum {
-		color: #FFFFFF;
-	}
-	
-	.timesfActive .timeyy {
-		color: #FFFFFF;
-	}
-	
-	
-	
-	.timeTop {
-		display: flex;
-		line-height: 90rpx;
-		padding-left: 24rpx;
-		padding-right: 24rpx;
-		justify-content: space-between;
-	}
-	
-	.timeTopTitle {
-		font-size: 30rpx;
-		font-family: PingFangSC-Medium, PingFang SC;
-		font-weight: 600;
-		color: #3C3C3C;
-	}
-	
-	.close {
-		color: #999999;
-		font-size: 30rpx;
-		padding-left: 30rpx;
-	}
-	
-	.timeCont {
-		height: calc(70vh - 210rpx);
-	}
-	
-	.timeSv {
-		height: calc(70vh - 210rpx);
-	}
-	
-	.timeLeft2 {
-		width: 162rpx;
-		background: #F4F5F7;
-		border-top: 1px soid #F4F5F7;
-		border-right: 1px soid #F4F5F7;
-	}
-	
-	.timeRight2 {
-		width: 588rpx;
-	}
-	
-	.timesf {
-		width: 165rpx;
-		height: 98rpx;
-		border-radius: 7rpx;
-		border: 2rpx solid #EEEEEE;
-		text-align: center;
-		margin-left: 20rpx;
-		margin-bottom: 24rpx;
-	}
-	
-	.timeBottom {
-		width: 750rpx;
-		height: 120rpx;
-		background: #FFFFFF;
-		box-shadow: 0px -2px 20rpx 0px rgba(153, 153, 153, 0.2);
-		display: flex;
-		align-items: center;
-	
-	}
-	
-	.timerightBox {
-		display: flex;
-		flex-wrap: wrap;
-	}
-	
-	.timeCont {
-		display: flex;
-	}
-	
-	.timeSfNum {
-		color: #666666;
-		font-size: 28rpx;
-		padding-top: 15rpx;
-	}
-	
-	.timeyy {
-		font-size: 24rpx;
-		color: #999999;
-	}
-	
-	.timecomplete {
-		width: 690rpx;
-		height: 74rpx;
-		background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
-		border-radius: 37rpx;
-		line-height: 74rpx;
-		text-align: center;
-		font-size: 30rpx;
-		color: #FFFFFF;
-		margin-left: 30rpx;
-	}
-	
-	.timeleftLine {
-		font-size: 30rpx;
-		color: #999999;
-		text-align: center;
-		padding: 28rpx 10rpx;
-		border-bottom: 1px solid #EEEEEE;
-	}
+	
 </style>