فهرست منبع

修改预约日期样式

暖心小太阳 1 ماه پیش
والد
کامیت
6f86a8a61e
2فایلهای تغییر یافته به همراه113 افزوده شده و 168 حذف شده
  1. 94 15
      pages/checkout/checkout.vue
  2. 19 153
      pages/ucenter/appointOrder/appointOrder.vue

+ 94 - 15
pages/checkout/checkout.vue

@@ -58,7 +58,18 @@
 			<view class="plus-amount">{{ increaseSumPrice }}</view>
 		</view>
 
-
+	<view class="appoint-server" 
+			 v-if="showLastServiceBtn" @tap="chooseLastOrder">
+			<view class="server-tip" >优先匹配上一单的服务者</view>
+			
+			<image mode="aspectFit"
+				src="https://mall.zhaijieshi.cc/file/wx-huawang/dian2.png" class="radio-img" v-if="isPreOrder" 
+				></image>
+			
+			<image mode="aspectFit"
+				src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-unselect-popup.png" v-else
+				class="radio-img" ></image>
+		</view>
 		<!-- 预约时间 -->
 		<view class="appoint-time-block" v-if="goodsType != 6 && goodsType != 4 && (isNeedAppoint || couponId == 24)">
 			<view class="appoint-time-operate" @tap="showAppoint">
@@ -310,7 +321,13 @@
 							<view class="time-select-bottom" v-if="selectweek!==''&weekday!==''&selecttime!==''">
 								<span>当前选择:</span>
 								{{selectweek}}
-								<span style="display: inline-block;width: 4rpx;height:20rpx;background-color: #D77958;"></span>
+								<span style="    display: inline-block;
+    width: 2px;
+    height: 10px;
+    background-color: #d77958;
+    position: relative;
+    top: 1px;
+    margin: 0 5px;"></span>
 								{{weekday}}({{selecttime}})
 							</view>
 						</view>
@@ -321,13 +338,15 @@
 				<block v-if="popupType == 3">
 					<view class="popup-content">
 						<view class="first-appoint-date-list">
-							<view class="first-appoint-date-item" @tap="firstDateCheck" :data-index="index"
+							<view class="first-appoint-date-item" @tap="firstDateCheck" :data-index="index" :data-firstdate="item.date" :data-firstweek="item.week" 
 								v-for="(item, index) in firstAppointList" :key="index">
 								<view :class="firstDateIndex == index ? 'current-date' : ''">
 									{{ item.date + ' ' + item.week }}
 								</view>
-
-								<!-- 			<view v-if="firstDateIndex == index" class="first-time-selected date-tag">已选</view> -->
+							</view>
+							<view class="time-select-bottom2" v-if="firstdate!==''&firstweek!==''&selecttime!==''">
+								<span>当前选择:</span>
+								{{firstdate}}({{firstweek}}){{selecttime}}
 							</view>
 						</view>
 					</view>
@@ -578,8 +597,12 @@
 				appType: 0,
 				couponName: '',
 				selectweek: '两周1次',
-				weekday: '',
-				selecttime: ''
+				weekday: '周一',
+				selecttime: '',
+				showLastServiceBtn:false,
+				isPreOrder:false,
+				firstweek:'',
+				firstdate:''
 			};
 		},
 		onReady: function() {
@@ -781,7 +804,8 @@
 							goodsType: res.data.goodsType,
 							increaseSumPrice: res.data.increaseSumPrice,
 							serviceDuration: res.data.serviceDuration,
-							couponName: res.data.couponName
+							couponName: res.data.couponName,
+							showLastServiceBtn:res.data.showLastServiceBtn
 						});
 						let serviceDuration = res.data.checkedGoodsList[0].product.serviceDuration;
 						if (that.popupType == 2) {
@@ -1046,7 +1070,8 @@
 						lng: this.checkedAddress.lng,
 						lat: this.checkedAddress.lat,
 						shopId: this.checkedAddress.shopId,
-						goodId: this.checkedGoodsList[0].goodsId
+						goodId: this.checkedGoodsList[0].goodsId,
+						isPreOrder:this.isPreOrder
 					};
 					console.log(params);
 					this.orderPay(params);
@@ -1070,7 +1095,8 @@
 						lng: this.checkedAddress.lng,
 						lat: this.checkedAddress.lat,
 						shopId: this.checkedAddress.shopId,
-						goodId: this.checkedGoodsList[0].goodsId
+						goodId: this.checkedGoodsList[0].goodsId,
+						isPreOrder:this.isPreOrder
 					};
 					console.log(params);
 					this.orderPay(params);
@@ -1102,7 +1128,8 @@
 					orderDate: orderData,
 					requireOrder: this.requireOrder,
 					traceId: this.traceId, //视频号
-					createOrderType: this.appType
+					createOrderType: this.appType,
+					
 				};
 
 				if (this.codeShow && !this.isNoMatch) {
@@ -1621,8 +1648,13 @@
 
 			firstDateCheck(e) {
 				let index = e.currentTarget.dataset.index;
+				let firstdate = e.currentTarget.dataset.firstdate;
+				let firstweek = e.currentTarget.dataset.firstweek;
+				console.log("firstweek",firstweek+firstdate);
 				this.setData({
-					firstDateIndex: index
+					firstDateIndex: index,
+					firstdate:firstdate,
+					firstweek:firstweek
 				});
 			},
 
@@ -1951,7 +1983,9 @@
 				let params = {
 					days: 30,
 					productId: this.checkedGoodsList[0].productId,
-					serviceDuration: this.serviceDuration
+					serviceDuration: this.serviceDuration,
+					isPreOrder:this.isPreOrder,
+					addressId:this.checkedAddress.id
 				};
 				uni.showLoading({
 					title: '加载中'
@@ -1998,6 +2032,13 @@
 							timeIndex: ''
 						});
 					});
+			},
+			//优先选择上一单服务者
+			chooseLastOrder(){
+				this.setData({
+					isPreOrder:!this.isPreOrder
+				})
+				console.log("isProOrder",this.isPreOrder);
 			}
 		}
 	};
@@ -2949,6 +2990,29 @@
 		color: #ABABAB;
 		font-family: AlibabaPuHuiTi_2_85_Bold;
 	}
+	
+	.appoint-server{
+			border-radius: 18rpx;
+			    background-color: #fff;
+			    height: 80rpx;
+			    line-height: 80rpx;
+			    padding: 0 24rpx;
+			    color: #999;
+			    display: flex;
+			    margin-top: 28rpx;
+			    justify-content: space-between;
+				align-items: center;
+		}
+	.appoint-server .server-tip{
+		color: #999;
+			font-size: 26rpx;
+			flex: 1;
+			text-align: left;
+	}
+	.appoint-server .radio-img{
+		width: 26rpx;
+		height: 26rpx;
+	}
 
 	/* 时间弹窗相关 */
 	.week-select-left {
@@ -3009,11 +3073,12 @@
 		background-color: #feebd7;
 		height: 54rpx;
 		font-size: 22rpx !important;
-		/* color: #00b4fe !important; */
+		color: #d77958 !important;
 		line-height: 54rpx;
 		padding-left: 30rpx;
 		position: absolute;
 		bottom: 0;
+		letter-spacing: 2rpx;
 	}
 
 	.time-select-bottom1 {
@@ -3021,12 +3086,23 @@
 		background-color: #feebd7;
 		height: 54rpx;
 		font-size: 22rpx !important;
-		/* color: #00b4fe !important; */
+		color: #d77958 !important;
 		line-height: 54rpx;
 		padding-left: 30rpx;
 		position: absolute;
 		bottom: 55rpx;
 	}
+	.time-select-bottom2 {
+		width: 100vw;
+		background-color: #feebd7;
+		height: 54rpx;
+		font-size: 22rpx !important;
+		color: #d77958 !important;
+		line-height: 54rpx;
+		padding-left: 30rpx;
+		
+		letter-spacing: 2rpx;
+	}
 
 	.time-select-left {
 		/* flex: 2; */
@@ -3259,4 +3335,7 @@
 		justify-content: space-between;
 		align-content: flex-start;
 	}
+	.first-appoint-date-list{
+		background-color: #fafafa;
+	}
 </style>

+ 19 - 153
pages/ucenter/appointOrder/appointOrder.vue

@@ -117,16 +117,16 @@
 		
 		
 		
-		<view class="appoint-server" 
+		<view class="appoint-server"   v-if="showLastServiceBtn" @tap="chooseLastOrder"
 			>
 			<view class="server-tip" >优先匹配上一单的服务者</view>
 			
-			<!-- <image mode="aspectFit"
-				src="https://mall.zhaijieshi.cc/file/wx-huawang/dian2.png" class="radio-img"  
-				></image> -->
+			<image mode="aspectFit"
+				src="https://mall.zhaijieshi.cc/file/wx-huawang/dian2.png" class="radio-img" v-if="isPreOrder" 
+				></image>
 			
 			<image mode="aspectFit"
-				src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-unselect-popup.png"
+				src="https://jzmall.lifejingzhi.com/file/jzmall-dy/icon-unselect-popup.png" v-else
 				class="radio-img" ></image>
 		</view>
 		<!-- 预约服务时间 -->
@@ -181,65 +181,6 @@
 
 		<view class="appoint-overlay-wrapper" v-if="choosePopup" @tap="onClose"></view>
 			<timeSelect v-if="choosePopup" :timeParams='timeParams' @timeShow='setTimeshow'/>
-	<!-- 	<view class="popup-wrapper popup-wrapper-special" v-if="choosePopup">
-			<view class="popup-title popup-title-special popup-title-new">
-				<view>选择服务开始时间</view>
-				<view v-if="selectTimeValue >= 17" class="fee-tips">您选的时间段可能会加收夜间服务费,具体以与商家的沟通为准</view>
-			</view>
-
-			<block>
-				<view class="popup-content popup-content-special">
-					<view class="time-select-left">
-						<view class="time-select-left-item" @tap="dateCheck" :data-index="index" :data-week="item.week"
-							:data-date="item.date" :data-isbook="item.isBook" v-for="(item, index) in dateList"
-							:key="index">
-							<view class="date-line-wrapper">
-								<view :class="dateIndex == index ? 'current-date' : ''">
-									{{ item.bookdate + ' ' + item.weekOfDay }}
-								</view>
-								<view>
-									<text v-if="index <= 1" class="date-tag">{{ index == 0 ? '今天' : '明天' }}</text>
-								</view>
-							</view>
-
-							<view :class="'date-msg ' + (item.dateMsg == '可约' ? 'avail-date' : '')">{{ item.dateMsg }}
-							</view>
-						</view>
-					</view>
-					<view class="time-select-right">
-						<view class="noon-select">
-							<view :class="'noon-item ' + (noonType == '1' ? 'active-noon' : '')" data-noon="1"
-								@tap="noonTab">上午</view>
-							<view :class="'noon-item ' + (noonType == '2' ? 'active-noon' : '')" data-noon="2"
-								@tap="noonTab">下午</view>
-						</view>
-						<view class="time-item-wrapper">
-							<view :class="'time-select-right-item ' + (item.timeMsg ? 'invalid-time' : '')"
-								@tap="timeCheck" :data-stock="item.stock" :data-index="index" :data-msg="item.timeMsg"
-								v-for="(item, index) in timeList" :key="index">
-								
-
-								<view class="time-line">
-									<text :class="timeIndex === index ? 'current-date' : ''">{{ item.begin }}</text>
-								
-									<text v-if="selectTimeValue >= 17 && timeIndex == index && !item.timeMsg"
-										class="extra-tips">收夜间服务费</text>
-									<text v-if="timeIndex === index" class="date-tag">已选</text>
-									<view v-if="item.timeMsg && item.timeMsg != null" class="time-msg">
-										{{ item.timeMsg }}
-									</view>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-			</block>
-
-		
-			<view class="popup-btn-wrapper">
-				<view @tap="confirmTime" class="confirm-btn">确定</view>
-			</view>
-		</view> -->
 
 		<!-- 地址弹框 -->
 		<view class="appoint-overlay-wrapper address-overlay" v-if="addressShow" @tap="onAddressClose">
@@ -444,7 +385,9 @@
 				goods: '',
 				mobile: '',
 				showOverLay: false,
-				showErrorMsg: ''
+				showErrorMsg: '',
+				isPreOrder:false,
+				showLastServiceBtn:false,
 			};
 		}
 		/**
@@ -484,6 +427,13 @@
 			}
 		},
 		methods: {
+			//优先选择上一单服务者
+			chooseLastOrder(){
+				this.setData({
+					isPreOrder:!this.isPreOrder
+				})
+				console.log("isProOrder",this.isPreOrder);
+			},
 			setTimeshow(params){
 				this.setData({
 					choosePopup:false,
@@ -513,7 +463,8 @@
 							dyDetails: res.data.dyDetails,
 							afterSale: res.data.afterSale,
 							payOverTime: res.data.payOverTime,
-							remainTimes: res.data.serviceTimes - res.data.servedTimes
+							remainTimes: res.data.serviceTimes - res.data.servedTimes,
+							showLastServiceBtn:res.data.showLastServiceBtn
 						});
 
 						if (res.data.addressId) {
@@ -619,7 +570,8 @@
 						// orderBookId:this.data.bookId,
 						bookId: this.serviceId,
 						productId: this.orderInfo.productId,
-						serviceDuration: this.orderInfo.serviceDuration
+						serviceDuration: this.orderInfo.serviceDuration,
+						isPreOrder:this.isPreOrder
 					};
 					this.setData({
 						timeParams:params
@@ -2160,92 +2112,6 @@
 		font-size: 24rpx;
 	}
 
-	/* .noon-select {
-		height: 64rpx;
-		display: flex;
-		border-bottom: 1rpx solid #ddd;
-	}
-
-	.time-select-right .noon-item {
-		flex: 1;
-		text-align: center;
-		line-height: 64rpx;
-		color: #979797;
-		font-size: 26rpx;
-	}
-
-	.time-select-right view.noon-item.active-noon {
-		color: #fff;
-		background: #d77958;
-	} */
-
-	/* view.popup-wrapper .time-select-right-item .date-tag {
-		width: 80rpx;
-		height: 40rpx;
-		line-height: 38rpx;
-		margin-left: 0;
-	}
-
-	.popup-title-new.popup-title {
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		height: 116rpx;
-		line-height: normal;
-	}
-
-	.popup-title-new view {
-		color: #333;
-		font-size: 32rpx;
-	}
-
-	.popup-title-new view.fee-tips {
-		color: #ff5735;
-		font-size: 22rpx;
-	}
-
-	.time-select-right-item text {
-		color: #888;
-	} */
-
-	/* .time-select-right .time-item-wrapper {
-		height: 836rpx;
-		overflow-y: scroll;
-	} */
-
-	/* .time-line {
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		width: 100%;
-	} */
-
-/* 	view.popup-wrapper .time-select-right-item.invalid-time text {
-		color: #999;
-	}
-
-	view.popup-wrapper .time-select-right-item.invalid-time {
-		background: #eee;
-	} */
-
-/* 	.time-select-right-item view.time-msg {
-		height: 40rpx;
-		line-height: 38rpx;
-		border-radius: 40rpx;
-		padding: 0 8rpx;
-		font-size: 22rpx;
-		border: 2rpx solid #999;
-		color: #999;
-		font-weight: normal;
-		white-space: nowrap;
-	}
-
-	.time-select-right-item text.extra-tips {
-		color: #ff5735;
-		font-size: 22rpx;
-	} */
-
 	.notice-block {
 		background: #fff;
 		border-radius: 24rpx;