From 94f727774f5301b012924e717a709e4849656693 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期二, 19 十二月 2023 18:04:19 +0800
Subject: [PATCH] 验质页面 不合格品类 页面添加 不合格类判定

---
 pages/driver-page/driver-index/driver-index.vue |  260 ++++++++++++++++++++++++++++++---------------------
 1 files changed, 153 insertions(+), 107 deletions(-)

diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 8d9eed3..4dc7c57 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -6,6 +6,25 @@
 				<view class="wait-collection"
 					:style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/diverbanner.png)`, backgroundSize: 'contain', backgroundRepeat: 'no-repeat' }">
 				</view>
+				<!-- 寮曞椤� -->
+				<view class="noob-tour"
+					v-if="roleType===3&&isFirstLogin">
+					<combined-title title="鎿嶄綔鎸囧紩"></combined-title>
+					<u-cell-group>
+						<u-cell title="鏂版墜鎸囧紩"
+							name='1'
+							:clickable="true"
+							@click="noobTour">
+							<u-badge type="primary"
+								value="01"
+								slot='icon'></u-badge>
+							<u-icon slot="value"
+								name="arrow-right"
+								size="30"
+								color="#b8b8b8"></u-icon>
+						</u-cell>
+					</u-cell-group>
+				</view>
 				<view class="collection-form">
 					<view class="collection-form-item"
 						v-for="(item, index) in driverBillOfLoadingData.list1"
@@ -54,6 +73,15 @@
 								<view class="coal-name">{{ item.coalName }}</view>
 							</view>
 						</view>
+						<!-- 鍒涘缓鏃堕棿 -->
+						<view class="created-box">
+								<view class="clock-create">
+									<view class="time-icon"><u-icon name="clock"
+											color="#515151"
+											size="40"></u-icon></view>
+											<text class="create-date"> {{ item.createTime }}</text>
+								</view>
+							</view>
 						<view class="fourth-line"
 							@click.stop="qiangDanBtn(item)"
 							v-if="item.carNum - item.taskNum !== 0">
@@ -78,13 +106,18 @@
 						icon="http://cdn.uviewui.com/uview/empty/data.png"
 						textSize="30"
 						iconSize="1000"
+						text="鏆傛棤鏁版嵁"
 						v-if="driverBillOfLoadingData.list3 ? (driverBillOfLoadingData.list3.length == 0 ? true : false) : true"></u-empty>
 
 					<view class="appointment-form">
 						<view class="appointment-form-item"
 							v-for="(item, index) in driverBillOfLoadingData.list3"
-							:key="index">
+							:key="index"
+							@click.stop="list3CardIconClick(item)"
+							>
+							
 							<view class="main-divider"></view>
+							<view class="orderCode">璁㈠崟鍙凤細{{ item.orderCode }}</view>	
 							<view class="first-line">
 								<view class="main-information">
 									<view class="sign">瑁�</view>
@@ -141,8 +174,17 @@
 									<!-- <view class="order-type">{{ item.orderType }}</view> -->
 								</view>
 							</view>
+							<!-- 鍒涘缓鏃堕棿 -->
+							<view class="created-box">
+								<view class="clock-create">
+									<view class="time-icon"><u-icon name="clock"
+											color="#515151"
+											size="40"></u-icon></view>
+											<text class="create-date"> {{ item.createTime }}</text>
+								</view>
+							</view>
 							<view class="fourth-line"
-								@click="toAppointmentClick(item)">
+								@click.stop="toAppointmentClick(item)">
 								<view class="button-img">绔嬪嵆棰勭害</view>
 							</view>
 						</view>
@@ -156,6 +198,7 @@
 						icon="http://cdn.uviewui.com/uview/empty/data.png"
 						textSize="30"
 						iconSize="1000"
+						text="鏆傛棤鏁版嵁"
 						v-if="driverBillOfLoadingData.list2 ? (driverBillOfLoadingData.list2.length == 0 ? true : false) : true"></u-empty>
 					<view class="appointment-form">
 						<view class="appointment-form-item"
@@ -163,6 +206,7 @@
 							:key="index"
 							@click="list3CardIconClick(item)">
 							<view class="main-divider"></view>
+							<view class="orderCode">璁㈠崟鍙凤細{{ item.orderCode }}</view>	
 							<view class="first-line">
 								<view class="main-information">
 									<view class="sign">瑁�</view>
@@ -205,6 +249,15 @@
 											size="40"></u-icon></view>
 								</view>
 							</view>
+							<!-- 鍒涘缓鏃堕棿 -->
+							<view class="created-box">
+								<view class="clock-create">
+									<view class="time-icon"><u-icon name="clock"
+											color="#515151"
+											size="40"></u-icon></view>
+											<text class="create-date"> {{ item.createTime }}</text>
+								</view>
+							</view>
 							<view class="status">
 								<u-tag :text="coalStatus[item.statusWeigh] || ''"
 									plain>
@@ -222,56 +275,17 @@
 									<!-- <view class="order-type">{{ item.orderType }}</view> -->
 								</view>
 							</view>
+							<view class="fourth-line" style="opacity: 0;">
+							</view>
 						</view>
 					</view>
 					<view class="white-block"></view>
 				</view>
-
-				<!-- 寮曞椤� -->
-				<view class="noob-tour">
-					<combined-title title="鎿嶄綔鎸囧紩"></combined-title>
-					<u-cell-group>
-						<u-cell v-if="roleType===3"
-							title="鏂版墜鎸囧紩"
-							name='1'
-							:clickable="true"
-							@click="noobTour">
-							<u-badge type="primary"
-								value="01"
-								slot='icon'></u-badge>
-							<u-icon slot="value"
-								name="arrow-right"
-								size="30"
-								color="#b8b8b8"></u-icon>
-						</u-cell>
-					</u-cell-group>
-				</view>
 				<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
 				<view class="previewImage-container">
-					<u-popup :show="previewImageShow"
-						mode="center"
-						@close="previewImageClose"
-						@open="previewImageOpen"
-						:closeable='true'>
-						<view class="image-container"
-							@touchstart="touchStart"
-							@touchmove="touchMove"
-							@touchend="touchEnd">
-							<u--image :src="onlineurl+'/appimg/image/tour/driver/'+TourImgList[imgIndex]"
-								width="400px"
-								height="700px"
-								@click='closeImg'
-								mode='widthFix'
-								:style="imageStyle">
-								<view slot="error"
-									style="font-size: 48rpx;">鍔犺浇澶辫触</view>
-							</u--image>
-							<view class=""
-								style="text-align: center;background-color: rgba(0, 0, 0, 0.5);color: white;">
-								{{imgIndex+1}}/{{TourImgList.length}}寮�
-							</view>
-						</view>
-					</u-popup>
+					<previewImage ref="previewImage"
+						:imgs="driverTourImgList"
+						:saveBtn='false'></previewImage>
 				</view>
 			</view>
 		</view>
@@ -282,9 +296,14 @@
 	import { customerId } from '@/utils/status';
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
 	import { onlineurl } from '@/api/request.js'
+	import { BaseUrl } from '@/api/publicInterface.js'
+	import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
+	import { mapState } from 'vuex';
+	import { Debounce } from '../../../utils/util';
 	export default {
 		components: {
-			combinedTitle
+			combinedTitle,
+			previewImage
 		},
 		props: {
 			indexdriverBillOfLoadingData: {
@@ -299,17 +318,13 @@
 				},
 				deep: true,
 				immediate: true
-			}
+			},
 		},
 		computed: {
+			...mapState(['driverTourImgList']),
 			roleType() {
 				return uni.getStorageSync('roleType');
 			},
-			imageStyle() {
-				return {
-					transition: this.transition ? 'transform 0.3s ease' : 'none'
-				}
-			}
 		},
 		data() {
 			return {
@@ -326,16 +341,16 @@
 				fleetId: '',
 				xsUserId: '',
 				customerId: '',
-				coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚', '楠岃川瀹屾垚'],
+				coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚', '澶勭悊瀹屾垚'],
 				onlineurl,
-				previewImageShow: false,
-				previewImageSrc: '',
-				TourImgList: ['sj1.jpg', 'sj2.jpg', 'sj3.jpg', 'sj4.jpg', 'sj5.jpg', 'sj6.jpg', 'sj7.jpg'],
-				imgIndex: 0,
-				startX: 0, // 瑙︽懜璧峰鐐圭殑X鍧愭爣
-				endX: 0, // 瑙︽懜缁撴潫鐐圭殑X鍧愭爣
-				transition: false
+				phone: "",
+				isFirstLogin: true //鏄惁鏄涓�娆$櫥褰�
 			};
+		},
+		mounted() {
+			// this.TourImgList = TourImgList
+			this.getLogOn()
+			
 		},
 		onShow() {
 			this.init();
@@ -363,7 +378,7 @@
 				});
 			},
 			// 鎶㈠崟鎸夐挳
-			qiangDanBtn(value) {
+			qiangDanBtn:Debounce(function(value){
 				if (value.tmcCount == '0') {
 					this.qiangDan(value.orderPlanId, value.fleetId, value.customerId === null ? '0' : value.customerId,
 						value.xsUserId === null ? '0' : value.xsUserId);
@@ -375,7 +390,9 @@
 					this.qiangDanShow = true;
 					this.qiangDanContent = `宸叉姠${value.tmcCount}鍗曪紝纭畾鎶㈠崟锛焋;
 				}
-			},
+			} ,500)
+				
+			,
 			// 鎶㈠崟妯℃�佹
 			qiangDanConfirm() {
 				this.qiangDanContent = '';
@@ -423,54 +440,52 @@
 					url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}`
 				});
 			},
-			noobTour(v) {
-				this.$nextTick(() => {
-					this.previewImageShow = true
-					this.imgIndex = 0
+			noobTour() {
+				this.$refs.previewImage.open('https://mx.jzeg.cn:9095/appimg/image/tour/driver/sj1.jpg')
+			},
+			getLogOn() {
+				this.$reqGet('getUserEntity').then(res => {
+					this.phone = res.data.phone
+				}).then(() => {
+					uni.request({
+						url: `${BaseUrl}/admin/log/getLogOnType?phone=${this.phone}`,
+						success: res => {
+							// res.data.data 涓�1 浠h〃绗竴娆$櫥褰�  涓�0鍙栨秷瀛︿範鎸囧紩 涓�2 浠h〃瀛樺湪
+							if (res.data.data === 1) {
+								this.noobTour()
+							} else if (res.data.data === 2) {
+								this.isFirstLogin = true
+							} else {
+								this.isFirstLogin = false
+							}
+						}
+					});
 				})
 			},
-			touchStart(event) {
-				this.startX = event.touches[0].clientX;
-			},
-
-			touchMove(event) {
-				this.endX = event.touches[0].clientX;
-			},
-			touchEnd(event) {
-				const startX = this.startX;
-				const endX = this.endX;
-				if (startX - endX > 50 && this.imgIndex < this.TourImgList.length - 1) {
-					this.transition = true;
-					this.imgIndex++
-					setTimeout(() => {
-						this.transition = false;
-					}, 300);
-				} else if (endX - startX > 50 && this.imgIndex > 0) {
-					this.transition = true;
-					this.imgIndex--
-					setTimeout(() => {
-						this.transition = false;
-					}, 300);
-				} else if (this.imgIndex === this.TourImgList.length - 1) {
-					return this.$u.toast('杩欐槸鏈�鍚庝竴寮犱簡鍝�')
-				}
-			},
-			closeImg() {
-				this.previewImageShow = false;
-			},
-			/**
-			 * @preview 棰勮鍥剧墖
-			 */
-			previewImageClose() {
-				this.previewImageShow = false;
-			},
-			previewImageOpen() {},
 		}
 	};
 </script>
 
 <style lang="scss"
 	scoped>
+	 .created-box{
+		display: flex;
+		position: absolute;
+		bottom: 20rpx;
+   		 left: 35rpx;
+		.clock-create{
+			display: flex;
+		}
+		.create-date{
+			height: 24rpx;
+			line-height: 37rpx;
+			font-size: 28rpx;
+			font-weight: 300;
+			color: #515151;
+			margin-left: 28rpx;
+		}
+
+	}
 	@mixin formItem {
 		width: vww(345);
 		height: vww(150);
@@ -499,6 +514,16 @@
 		display: flex;
 		justify-content: space-between;
 		align-items: center;
+		.clock-create{
+		    width: 100%;
+			height: 42rpx;
+			margin-right: 100rpx;
+			line-height: 42rpx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			justify-content: flex-start;
+		}
 
 		.send-date {
 			width: 148rpx;
@@ -506,6 +531,13 @@
 			line-height: 24rpx;
 			font-size: 28rpx;
 			font-weight: 300;
+			color: #515151;
+		}
+		.create-date {
+			line-height: 24rpx;
+			font-size: 28rpx;
+			font-weight: 300;
+			margin-left: 28rpx;
 			color: #515151;
 		}
 
@@ -546,6 +578,16 @@
 			text-align: center;
 			line-height: vww(40);
 		}
+	}
+
+	.fade-enter-active,
+	.fade-leave-active {
+		transition: opacity 0.5s;
+	}
+
+	.fade-enter,
+	.fade-leave-to {
+		opacity: 0;
 	}
 
 	.exceedHide {
@@ -797,17 +839,19 @@
 
 				.appointment-form-item {
 					@include formItem;
-					height: vww(220);
+					height: vww(240);
 					justify-content: space-between;
 					overflow: hidden;
-
 					.main-divider {
 						width: 560rpx;
 						height: 1rpx;
 						background: #e3e3e3;
 						position: absolute;
-						top: 122rpx;
+						top: 200rpx;
 						left: 128rpx;
+					}
+					.orderCode{
+						padding: 10px;
 					}
 
 					.first-line {
@@ -955,7 +999,9 @@
 			}
 
 			.noob-tour {
-				margin-bottom: vww(50);
+				margin-bottom: vww(10);
+				position: relative;
+				top: -240rpx;
 			}
 
 			.u-popup {

--
Gitblit v1.9.1