From 447e19fa298ae11a1c3a3fa2d2ff3a1a8dba0501 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期四, 29 八月 2024 17:15:29 +0800
Subject: [PATCH] -

---
 src/pages/checkin/workdetail.vue |  246 +++++++++++++++++++++++++++----------------------
 1 files changed, 135 insertions(+), 111 deletions(-)

diff --git a/src/pages/checkin/workdetail.vue b/src/pages/checkin/workdetail.vue
index 0c6a054..61a51c5 100644
--- a/src/pages/checkin/workdetail.vue
+++ b/src/pages/checkin/workdetail.vue
@@ -1,125 +1,139 @@
 <template>
-	<view class="">
+	<view class="c-p-b-150">
 		<view class="coreshop-ff">
-			<up-list>
-				<up-list-item>
-					<up-cell title="鍛ㄥ厛鐢�">
-						<template #icon>
-							<up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg"
-								customStyle="margin: -3px 5px -3px 0"></up-avatar>
-						</template>
-					</up-cell>
-				</up-list-item>
-				<view class="c-p-20">
-					<view class="chuany-flex chuany-justify-between chuany-flex-wrap">
-						<text class="chuany-font34 chuany-text-bold">
-							涓存椂宸�
-						</text>
-						<text class="">
-							鏃ユ湡锛�2024-08-12
-						</text>
-					</view>
+			<view class="c-p-20">
+				<view class="chuany-flex chuany-justify-between chuany-flex-wrap">
+					<text class="chuany-font34 chuany-text-bold">
+						{{dakaList.orderName}}
+					</text>
+					<text class="">
+						鏃ユ湡锛歿{$util.formatDate(dakaList.workDate)}}
+					</text>
 				</view>
-				<view class="c-p-20">
-					<view class="">
-						<text class="">
-							鎵撳崱璁板綍锛�
-						</text>
-						<view class="chuany-flex chuany-justify-between c-p-t-20">
-							<view
-								class="chuany-flex chuany-flex-direction chuany-align-center textclo chuany-font24 step_item"
-								v-for="(item,index) in 4">
-								<up-avatar shape="square" size="38" src="https://uview-plus.jiangruyi.com/album/1.jpg"
-									@click="previewImage"></up-avatar>
-								<view class="line line-active" v-if="index!==3">
-
+			</view>
+			<view class="c-p-20">
+				<view class="">
+					<text class="">
+						鎵撳崱璁板綍锛�
+					</text>
+					<view class="chuany-flex chuany-justify-evenly chuany-flex-wrap c-p-t-20">
+						<view
+							class="chuany-flex chuany-flex-direction chuany-align-center chuany-justify-around textclo chuany-font24 c-p-b-10 daka"
+							:key="index" v-for="(item,index) in dakaList.orderBiddingDetailCheck">
+							<up-avatar shape="square" size="56" :src="item.checkPhoto"
+								@click="previewImage(item.checkPhoto)"></up-avatar>
+							<view class="step_item">
+								<up-icon name="checkmark-circle-fill" :color="item.checktime?'#2979ff':'#e9e8e8'"
+									size="22"></up-icon>
+								<view class="line" :class="item.checkPhoto?'line-active':''"
+									v-if="index!==dakaList.length-1&&index%2==0">
 								</view>
-								<up-icon name="checkmark-circle-fill" color="#2979ff" size="22"></up-icon>
-								<text>宸叉墦鍗�</text>
-								<text>10:00</text>
 							</view>
-
+							<text>{{item.checktime?'宸叉墦鍗�':'鏈墦鍗�'}}</text>
+							<text
+								:class="$util.formatDate(item.checktime,true)=='-'?'core-opa':''">{{$util.formatDate(item.checktime,true)}}</text>
 						</view>
-
 					</view>
 				</view>
-
-				<view class="stepwit">
-					<tem-steps></tem-steps>
-				</view>
-			</up-list>
+			</view>
+			<up-cell title="宸ヤ綔鏃堕暱" :border='false'>
+				<template #right-icon>
+					{{dakaList.workTime}} 灏忔椂
+				</template>
+			</up-cell>
+			<up-cell title="鏂瑰紡" :border='false'>
+				<template #right-icon>
+					{{dakaList.workerTypeName}}
+				</template>
+			</up-cell>
+			<up-cell title="宸ヤ环" :border='false'>
+				<template #right-icon>
+					{{dakaList.workPrice}} {{dakaList.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
+				</template>
+			</up-cell>
+			<up-cell title="鏁伴噺" :border='false'  v-if="dakaList.workerType==1" >
+				<template #right-icon>
+					<up-input v-model="workCount" border="none" placeholder="璇峰~鍐欐暟閲�"></up-input>
+				</template>
+			</up-cell>
+			<up-cell title="宸ヨ祫" :border='false'>
+				<template #right-icon>
+					{{dakaList.todaySalary}} 鍏�
+				</template>
+			</up-cell>
+			<!-- <view class="stepwit">
+				<tem-steps></tem-steps>
+			</view> -->
 			<view class="tabbtns">
-				<up-button color='#fece01' class="text-69" text="宸ヨ祫瀹℃牳"></up-button>
+				<up-button color='#fece01' class="text-69" text="宸ヨ祫鐢虫姤" @click="saveDakaDetail"></up-button>
 			</view>
 		</view>
 	</view>
 </template>
 
-<script setup>
-	import {
-		onLoad,
-		onShow,
-		onReachBottom,
-		onPullDownRefresh
-	} from "@dcloudio/uni-app";
-	import {
-		reactive,
-		ref,
-		getCurrentInstance
-	} from 'vue';
-	const {
-		$upload,
-		$api,
-		$util,
-		$db
-	} = getCurrentInstance().appContext.config.globalProperties
-	onLoad(() => {
-		getDaka()
-	})
-	let state = reactive({
-		currentIdex: 0
-	})
-	let dakaList = reactive([])
-	let show = ref(true)
-	const urls = ['https://uview-plus.jiangruyi.com/album/1.jpg']
-	const list2 = reactive([{
-		id: 1,
-		time: '鏄庡ぉ 19:00-23:00',
-		name: '涓存椂宸�',
-		tags: ['4灏忔椂', '鍙棤缁忛獙', '鎵嬭剼楹诲埄'],
-		adress: '姝︿警鍖烘婧閬�4.0km',
-		yaoqiu: '涓嶉檺',
-		price: 50,
-		peoplenum: 3,
-		zhaodao: 1
-	}]);
-	const click = () => {
-
-	}
-	const change = (e) => {
-		state.currentIdex = e.index
-	}
-	const toDetail = (e) => {
-		uni.navigateTo({
-			url: '/pages/detail/detail'
-		})
-	}
-	const previewImage = () => {
-		uni.previewImage({
-			urls: ['https://uview-plus.jiangruyi.com/album/1.jpg']
-		})
-	}
-	const getDaka = (id) => {
-		$api.getDaka({
-			orderId: id
-		}).then(res => {
-			dakaList = res.data.orderBiddingDetailCheck
-			dakaList.length = 3
-			if (dakaList.length % 2 !== 0) {
-				dakaList.push({})
+<script>
+	export default {
+		data() {
+			return {
+				orderBiddingDetailId: '',
+				dakaList: {},
+				workCount: '',
+				confirmObj: {
+					orderBiddingDetailId: '', //鎷涘伐鎵撳崱Id
+					workTime: '', //宸ヤ綔鏃堕暱
+					workCount: '', //璁′欢鏁伴噺
+					todaySalary: '' //褰撴棩宸ヨ祫
+				}
 			}
-			console.log(res, '鎵撳崱');
-		})
+		},
+		onLoad(options) {
+			this.orderBiddingDetailId = options.id
+			this.getDakaDetail(this.orderBiddingDetailId)
+		},
+		methods: {
+			previewImage(url) {
+				uni.previewImage({
+					urls: [url]
+				})
+			},
+			getDakaDetail(id) {
+				this.$api.getDakaDetail({
+					orderBiddingDetailId: id
+				}).then(res => {
+					this.dakaList = res.data
+					if (this.dakaList.orderBiddingDetailCheck.length == 0) {
+						this.dakaList.orderBiddingDetailCheck.length = 2
+					}
+					if (this.dakaList.orderBiddingDetailCheck.length > 6) {
+						this.dakaList.orderBiddingDetailCheck.length = 6
+					}
+					if (this.dakaList.orderBiddingDetailCheck.length % 2 !== 0) {
+						this.dakaList.orderBiddingDetailCheck.push({})
+					}
+					console.log(res, '鎵撳崱');
+				})
+			},
+			saveDakaDetail() {
+				if (dakaList.workerType == 1 && this.workCount) {
+					this.$util.showToast({
+						title: '璇峰~鍐欐暟閲忥紒',
+						icon: 'error'
+					})
+					return
+				}
+				let obj = {
+					orderBiddingDetailId: dakaList.orderBiddingDetailId, //鎷涘伐鎵撳崱Id
+					workTime: dakaList.workTime, //宸ヤ綔鏃堕暱
+					todaySalary: dakaList.todaySalary //褰撴棩宸ヨ祫
+				}
+				if (this.workCount) {
+					obj.workCount = this.workCount
+				}
+				this.$api.saveDakaDetail(obj).then(res => {
+					console.log(res, '----');
+				})
+			},
+		}
 	}
 </script>
 
@@ -157,6 +171,13 @@
 		margin: 0 auto
 	}
 
+
+
+	.daka {
+		width: 260rpx;
+		height: 230rpx;
+	}
+
 	.step_item {
 		position: relative;
 		/* width: 144rpx; */
@@ -164,16 +185,19 @@
 
 		.line {
 			position: absolute;
-			top: 92rpx;
-			left: 52rpx;
+			top: 17rpx;
+			left: 35rpx;
 			content: "";
 			height: 4rpx;
-			width: 192rpx;
-
+			width: 310rpx;
+			background-color: #e9e8e8;
 		}
 
 		.line-active {
 			background-color: #2979ff;
 		}
 	}
+	.u-cell__body{
+		padding: 6px 15px !important;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1