From 79745a1b12fa6d69edd3a353cb11b8ae02b8d4aa Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期一, 26 八月 2024 17:16:53 +0800
Subject: [PATCH] 投递与确认

---
 src/pages/order/detail.vue |  127 +++++++++++++++++++++++++++++++-----------
 1 files changed, 94 insertions(+), 33 deletions(-)

diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue
index 2b30a1a..2056ec2 100644
--- a/src/pages/order/detail.vue
+++ b/src/pages/order/detail.vue
@@ -2,37 +2,40 @@
 	<view class="">
 		<scroll-view enable-flex="true">
 			<view class="list chuany-flex chuany-flex-direction chuany-align-center c-p-b-30">
-				<view class="content " v-for="(item,index) in list2" @click='toDetail' :key='item.id'>
+				<view class="content ">
 					<view class="bgblue c-p-18 chuany-flex chuany-justify-between chuany-font34 chuany-text-bold">
-						<text class=''>
-							{{item.time}}
-						</text>
+						<view class="chuany-flex chuany-flex-direction">
+							<text class=''>
+								{{$util.formatDate(detailItem.wordStartTime,true)}}
+							</text>
+							<text>{{$util.formatDate(detailItem.wordEndTime,true)}}</text>
+						</view>
 						<text>
-							鎷泏{item.zhaodao}}/{{item.peoplenum}}浜�
+							鎷泏{detailItem.worderCounted}}/{{detailItem.worderCount}}浜�
 						</text>
 					</view>
 					<view class="c-p-18 chuany-font44 chuany-text-bold">
-						{{item.name}}
+						{{detailItem.orderName}}
 					</view>
-					<view class="chuany-flex c-p-l-18">
+					<!-- <view class="chuany-flex c-p-l-18">
 						<up-tag class='c-p-r-14' :text="item" plain v-for="(item,index) in item.tags" :key="index">
 						</up-tag>
-					</view>
+					</view> -->
 					<view class="chuany-flex chuany-flex-direction">
 						<text class='c-p-18'>
-							瑕佹眰锛歿{item.yaoqiu}}
+							瑕佹眰锛歿{detailItem.demand}}
 						</text>
 						<text class='c-p-l-18 c-p-b-16'>
-							鍦板潃锛歿{item.adress}}
+							鍦板潃锛歿{detailItem.worderAddress}}
 						</text>
 					</view>
 					<view class='chuany-flex chuany-justify-between c-p-l-18 c-p-r-18'>
 						<view class="redcla">
 							<text class="chuany-font40 chuany-text-bold">
-								{{item.price}}
+								{{detailItem.workPrice}}
 							</text>
 							<text class='chuany-font20'>
-								鍏�/灏忔椂
+								{{detailItem.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
 							</text>
 						</view>
 						<!-- <up-tag text="鍘绘姠娲�" type="warning" shape="circle"></up-tag> -->
@@ -40,20 +43,24 @@
 					</view>
 				</view>
 			</view>
-			<view class="coreshop-ff">
+			<view class="coreshop-ff" v-if="detailItem.orderBidding&&detailItem.orderBidding.length>0">
 				<up-list>
-					<up-list-item>
-						<up-cell title="鍛ㄥ厛鐢�">
+					<up-list-item v-for="(item,index) in detailItem.orderBidding" :key="item.id" @click.stop="toWorkDetail">
+						<up-cell :title="item.workerName">
 							<template #icon>
-								<up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/1.jpg"
+								<up-avatar shape="square" size="35" :src="item.workerAvatar"
 									customStyle="margin: -3px 5px -3px 0"></up-avatar>
 							</template>
-							<template #right-icon>
-								<up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary"></up-button>
+							<template #right-icon v-if="item.isSelected">
+								<up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary" @click="toView"></up-button>
+							</template>
+							<template #right-icon v-else>
+								<up-button class="button-layout__item" text="纭" size="mini" type="success"
+									@click="selectBtn(item)"></up-button>
 							</template>
 						</up-cell>
 					</up-list-item>
-					<up-list-item>
+					<!-- <up-list-item>
 						<up-cell title="鏉庡厛鐢�">
 							<template #icon>
 								<up-avatar shape="square" size="35" src="https://uview-plus.jiangruyi.com/album/2.jpg"
@@ -74,6 +81,21 @@
 								<up-button class="button-layout__item" text="纭" size="mini" type="success"></up-button>
 							</template>
 						</up-cell>
+					</up-list-item> -->
+				</up-list>
+			</view>
+			<view class="coreshop-ff" v-else>
+				<up-list>
+					<up-list-item>
+						<up-cell title="鏆傛棤鎶曢��" class="u-cell__title-text_wu">
+							<!-- <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>
+							<template #right-icon>
+								<up-button class="button-layout__item" text="鏌ョ湅" size="mini" type="primary"></up-button>
+							</template> -->
+						</up-cell>
 					</up-list-item>
 				</up-list>
 			</view>
@@ -84,33 +106,68 @@
 
 <script setup>
 	import {
+		onLoad,
+		onShow,
+		onReachBottom
+	} from "@dcloudio/uni-app";
+	import {
 		reactive,
-		ref
+		ref,
+		getCurrentInstance
 	} from 'vue';
+	const {
+		$upload,
+		$api,
+		$util,
+		$db
+	} = getCurrentInstance().appContext.config.globalProperties
+	const detailItem = ref({})
+	let orderid = ref('')
+	onLoad((option) => {
+		console.log(option,'========');
+		let {
+			orderid
+		} = option
+		getOrder(orderid)
+		orderid.value = orderid
+		// detailItem.value = JSON.parse($db.get('detailItem'))
+	})
 	let state = reactive({
 		currentIdex: 0
 	})
 
-	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) => {
+	const toView = (e) => {
 		uni.navigateTo({
-			url: '/pages/detail/detail'
+			url: 'pages/checkin/index'
+		})
+	}
+	const toWorkDetail = (e) => {
+		uni.navigateTo({
+			url: '/pages/order/worker'
+		})
+	}
+	const selectBtn = (item) => {
+		$api.saveQueRen({orderBiddingId:item.id}).then(res => {
+			if(res.code==1){
+				$util.showToast({
+					title: "纭鎴愬姛锛�",
+					icon: "success"
+				})
+				getOrder(orderid.value)
+			}
+		})
+	}
+	const getOrder=(orderid) =>{
+		$api.getOrder(orderid).then(res => {
+			if (res.code == 1) {
+				detailItem.value = res.data
+			}
 		})
 	}
 </script>
@@ -139,4 +196,8 @@
 	.redcla {
 		color: #f05348;
 	}
+
+	.u-cell__title-text_wu {
+		text-align: center;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1