From f7aa204aa8d20b090d7943969ddeb9871a1fad76 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期四, 12 九月 2024 17:28:06 +0800
Subject: [PATCH] -

---
 src/pages/detail/detail.vue |   66 +++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/src/pages/detail/detail.vue b/src/pages/detail/detail.vue
index 2f36422..280e25b 100644
--- a/src/pages/detail/detail.vue
+++ b/src/pages/detail/detail.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="list full-page">
 		<view class="content c-p-b-18">
-			<view class="bgcolor c-p-24 chuany-flex chuany-justify-between chuany-font28 chuany-text-bold">
+			<!-- <view class="bgcolor c-p-24 chuany-flex chuany-justify-between chuany-font28 chuany-text-bold">
 				鎶ュ悕
 				<up-icon name="arrow-right-double" color='#faa93f'></up-icon>
 				纭鎺ュ崟
@@ -9,14 +9,15 @@
 				涓婁笅鐝墦鍗�
 				<up-icon name="arrow-right-double" color='#faa93f'></up-icon>
 				缁撶畻鎻愮幇
-			</view>
+			</view> -->
 			<view class="chuany-flex chuany-justify-between">
-				<view class="">
-					<view class="chuany-flex chuany-justify-between chuany-align-center">
-						<view class="c-p-18 chuany-font34">
+				<view class="chuany-width100">
+					<view
+						class="chuany-flex chuany-justify-between chuany-align-center chuany-width100 chuany-box c-p-18">
+						<view class=" chuany-font34">
 							{{orderObj.orderName}}
 						</view>
-						<view class="c-p-l-108">
+						<view>
 							{{orderObj.workerType==0?'璁℃椂':'璁′欢'}}
 						</view>
 					</view>
@@ -24,7 +25,7 @@
 						<up-tag class='c-p-l-14 c-p-b-14' :text="item" plain v-for="(item,index) in tags"> </up-tag>
 					</view> -->
 					<view class="redcla c-p-l-18 c-p-r-18">
-						<text class="chuany-font40 chuany-text-bold">
+						<text class="chuany-font40">
 							{{orderObj.workPrice}}
 						</text>
 						<text class='chuany-font20'>
@@ -42,13 +43,19 @@
 		<view class="coreshop-bg-white c-m-t-18 c-p-18">
 			<view class="chuany-flex c-p-20">
 				<view class="chuany-width26">
+					<text class="colorgray ">浠诲姟鏃ユ湡</text>
+				</view>
+				<view class="chuany-flex chuany-flex-direction">
+					<text>{{$util.formatDate(orderObj.wordStartTime)}} 鑷�
+						{{$util.formatDate(orderObj.wordEndTime)}}</text>
+				</view>
+			</view>
+			<view class="chuany-flex c-p-l-20 c-p-r-20 c-p-b-20">
+				<view class="chuany-width26">
 					<text class="colorgray ">浠诲姟鏃堕棿</text>
 				</view>
 				<view class="chuany-flex chuany-flex-direction">
-					<text class=''>
-						{{$util.formatDate(orderObj.wordEndTime,true)}}
-					</text>
-					<text>{{$util.formatDate(orderObj.wordStartTime,true)}}</text>
+					<text>{{orderObj.startTimeName}} 鑷� {{orderObj.endTimeName}}</text>
 				</view>
 			</view>
 			<view class="chuany-flex  c-p-l-18">
@@ -92,12 +99,18 @@
 			</view>
 		</view>
 		<view class="tabbtns">
-			<up-button color='#fece01' class="text-69" text="鎶ュ悕" @click="enroll"></up-button>
+			<up-button color='#fece01' :loading='isLoading' loadingText="鎶ュ悕涓�" class="text-69" text="鎶ュ悕"
+				@click="enroll"></up-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		mapActions,
+		mapGetters,
+		mapMutations
+	} from 'vuex'
 	export default {
 		onLoad(option) {
 			let {
@@ -105,11 +118,16 @@
 			} = option
 			this.getOrder(orderid)
 		},
+
 		data() {
 			return {
-				orderObj: null,
-				tags: ['4灏忔椂', '鍙棤缁忛獙', '鎵嬭剼楹诲埄', '璁℃椂']
+				orderObj: {},
+				tags: ['4灏忔椂', '鍙棤缁忛獙', '鎵嬭剼楹诲埄', '璁℃椂'],
+				isLoading: false
 			}
+		},
+		computed: {
+			...mapGetters(['userInfo'])
 		},
 		methods: {
 			getOrder(orderid) {
@@ -120,19 +138,31 @@
 				})
 			},
 			enroll() {
+				if (!this.userInfo.userWorker) {
+					uni.navigateTo({
+						url: '/pages/mine/apply'
+					});
+					this.$util.showToast({
+						title: '璇峰厛瀹屽杽璧勬枡锛�'
+					})
+					return
+				}
+				this.isLoading = true
 				this.$api.saveBaoMing({
 					orderId: this.orderObj.id
 				}).then(res => {
-					if(res.code==1){
+					if (res.code == 1) {
+						uni.navigateBack()
 						this.$util.showToast({
 							title: "鎶ュ悕鎴愬姛锛�",
 							icon: "success"
 						})
-					}else{
+					} else {
 						this.$util.showToast({
 							title: res.error
 						})
 					}
+					this.isLoading = false
 				})
 			}
 		}
@@ -182,9 +212,5 @@
 	.dingwei {
 		width: 50rpx;
 		height: 50rpx;
-	}
-
-	.borderbox {
-		border-top: 1px solid #f2f2f4;
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1