From d52e728dc411aa8e43d37bda9f85bfc09871c1a0 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期六, 19 七月 2025 16:14:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/demand-hall/demand-hall.vue |  170 ++++++++++++++++++++++----------------------------------
 1 files changed, 67 insertions(+), 103 deletions(-)

diff --git a/small-program/pages/demand-hall/demand-hall.vue b/small-program/pages/demand-hall/demand-hall.vue
index 7503f8a..793717b 100644
--- a/small-program/pages/demand-hall/demand-hall.vue
+++ b/small-program/pages/demand-hall/demand-hall.vue
@@ -11,7 +11,7 @@
 		<view class="index-wu" v-if="!isLogin">
 			<image src="/static/icon/default_login@2x.png" mode="widthFix"></image>
 			<text>鎮ㄨ繕娌℃湁鐧诲綍锛岃鐧诲綍鍚庢煡鐪嬭鍗�</text>
-			<button>鐧诲綍</button>
+			<button @click="toLogin">鐧诲綍</button>
 		</view>
 		
 		<!-- 宸茬櫥闄� -->
@@ -36,7 +36,7 @@
 			</view>
 			<!-- 鍙戝崟鏂� -->
 			<view class="index-list" v-if="typeViewId === 0">
-				<view class="index-list-item" v-for="(item, index) in orderList" :key="index">
+				<view class="index-list-item" v-for="(item, index) in orderList" :key="index" @click="jumpDesc(item)">
 					<view class="index-list-item-head">
 						<view class="index-list-item-head-l">
 							<view class="xoam"></view>
@@ -50,7 +50,7 @@
 						<view class="index-list-item-head-r" v-if="item.status === 2">宸叉帴鍗�</view>
 						<view class="index-list-item-head-r" v-if="item.status === 3">杩涜涓�</view>
 						<view class="index-list-item-head-r" v-if="item.status === 2 && item.isUpdate === 1">宸蹭慨鏀癸紝寰呮帴鍗曟柟纭</view>
-						<view class="index-list-item-head-r hui" v-if="item.status === 4">宸插畬鎴�</view>
+						<view class="index-list-item-head-r hui" v-if="item.status === 4 && item.commentStatus !== 0">宸插畬鎴�</view>
 						<view class="index-list-item-head-r hui" v-if="item.status === 99">宸插彇娑�</view>
 						<view class="index-list-item-head-r" v-if="item.status === 4 && item.commentStatus === 0">寰呰瘎浠�</view>
 					</view>
@@ -85,7 +85,7 @@
 						</view>
 						<view class="index-list-item-dz">
 							<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
-							<text>{{item.startDate}} 鑷� {{item.endDate}}锛坽{item.priceNum1}}澶╋級</text>
+							<text>{{item.startDate}} 鑷� {{item.endDate}}锛坽{item.totalDays}}澶╋級</text>
 						</view>
 					</template>
 					<view class="index-list-item-price">
@@ -95,23 +95,20 @@
 					<view class="eidt">
 						<view></view>
 						<view class="eidt-right">
-							<view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click="orderId = item.id, show = true">鍙栨秷璁㈠崟</view>
+							<view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click.stop="orderId = item.id, show = true">鍙栨秷璁㈠崟</view>
 							<view class="eidt-phone" v-if="[2].includes(item.status)">鑱旂郴甯堝倕</view>
 							<view class="eidt-phone" v-if="item.status === 4 && item.commentStatus === 0">璇勪环璁㈠崟</view>
-							<view class="eidt-btn" v-if="[0,1,2].includes(item.status)" @click="jumpEdit(item)">淇敼璁㈠崟</view>
-							<view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) ||  (item.type === 2 && item.status === 3)" @click="jumpEdit(item)">缁х画鏀粯</view>
-							<!-- <view class="eidt-close">鍒犻櫎璁㈠崟</view>
-							<view class="eidt-phone">鑱旂郴甯堝倕</view>
-							<view class="eidt-phone">璇勪环璁㈠崟</view>
-							<view class="eidt-btn">淇敼璁㈠崟</view>
-							<view class="eidt-btn">瀹屾垚骞舵敮浠�</view> -->
+							<view class="eidt-btn" v-if="[0,1,2].includes(item.status) && item.type !== 2" @click.stop="jumpEdit(item)">淇敼璁㈠崟</view>
+							<view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) ||  (item.type === 2 && item.status === 3)" @click.stop="jumpEdit(item)">缁х画鏀粯</view>
+							<view class="eidt-btn" v-if="item.status === 2" @click.stop="startJobs(item.id)">寮�濮嬩綔涓�</view>
+							<view class="eidt-btn" v-if="item.status === 3" @click.stop="jumpDesc(item)">瀹屾垚骞舵敮浠�</view>
 						</view>
 					</view>
 				</view>
 			</view>
 			<!-- 鎺ュ崟鏂� -->
 			<view class="index-list" v-if="typeViewId === 1">
-				<view class="index-list-item" v-for="(item, index) in orderList" :key="index">
+				<view class="index-list-item" v-for="(item, index) in orderList" :key="index" @click="jumpDesc(item)">
 					<view class="index-list-item-head">
 						<view class="index-list-item-head-l">
 							<view class="xoam"></view>
@@ -174,90 +171,11 @@
 						<view class="eidt-tips" v-else></view>
 						
 						<view class="eidt-right">
-							<view class="eidt-close" v-if="item.status === 2" @click="orderId = item.id, show = true">鍙栨秷璁㈠崟</view>
-							<view class="eidt-phone" v-if="[2,3].includes(item.status)" @click="phoneCall(item.linkPhone)">鑱旂郴涓氫富</view>
-							
-							<!-- <view class="eidt-close">鍒犻櫎璁㈠崟</view>
-							<view class="eidt-phone">鑱旂郴甯堝倕</view>
-							<view class="eidt-phone">璇勪环璁㈠崟</view>
-							<view class="eidt-btn">淇敼璁㈠崟</view>
-							<view class="eidt-btn">瀹屾垚骞舵敮浠�</view> -->
+							<view class="eidt-close" v-if="item.status === 2" @click.stop="orderId = item.id, show = true">鍙栨秷璁㈠崟</view>
+							<view class="eidt-phone" v-if="[2,3].includes(item.status)" @click.stop="phoneCall(item.linkPhone)">鑱旂郴涓氫富</view>
 						</view>
 					</view>
 				</view>
-				<!-- <view class="index-list-item">
-					<view class="index-list-item-head">
-						<view class="index-list-item-head-l">
-							<view class="xoam"></view>
-							<text>杩愯揣鍗�-灏忚揣杞�-鍘㈠紡</text>
-							<view class="tips1">鑷富鎶㈠崟</view>
-						</view>
-						<view class="index-list-item-head-r">宸叉帴鍗�</view>
-					</view>
-					<view class="index-list-item-info">
-						钁¤悇锝�20000鏂わ綔闇�2杈�
-					</view>
-					<view class="index-list-item-date">
-						<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
-						<text>07-26 鑷� 07-27锛�2澶╋級</text>
-					</view>
-					<view class="address">
-						<view class="address-xian"></view>
-						<view class="address-row">
-							<image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image>
-							<text>闀挎睙瑗胯矾澶ц渶灞辨.鏋楀叕鍥タ闂ㄤ繚瀹夊</text>
-						</view>
-						<view class="address-row">
-							<image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image>
-							<text>闀挎睙瑗胯矾澶ц渶灞辨.鏋楀叕鍥笢闂ㄤ繚瀹夊</text>
-						</view>
-						<view class="address-row">
-							<image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image>
-							<text>瀹夊窘鑾茶姳绉戞妧浜т笟鍥眴绫崇鎶�鏈夐檺鍏徃</text>
-						</view>
-					</view>
-					<view class="index-list-item-price">
-						<text>棰勪及锛�</text>
-						<text>楼1000.00</text>
-					</view>
-					<view class="eidt">
-						<view></view>
-						<view class="eidt-right">
-							<view class="eidt-close">鍙栨秷璁㈠崟</view>
-						</view>
-					</view>
-				</view> -->
-				<!-- <view class="index-list-item">
-					<view class="index-list-item-head">
-						<view class="index-list-item-head-l">
-							<view class="xoam"></view>
-							<text>鐢ㄥ伐鍗�-閲囨憳宸�</text>
-							<view class="tips1">鑷富鎶㈠崟</view>
-						</view>
-						<view class="index-list-item-head-r">寰呮帴鍗�</view>
-					</view>
-					<view class="index-list-item-info">
-						钁¤悇锝�2000鏂�
-					</view>
-					<view class="index-list-item-dz">
-						<image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image>
-						<text>闀挎睙瑗胯矾澶ц渶灞辨.鏋楀叕鍥タ闂ㄤ繚瀹夊</text>
-					</view>
-					<view class="index-list-item-dz">
-						<image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image>
-						<text>07-26 鑷� 07-27锛�2澶╋級</text>
-					</view>
-					<view class="index-list-item-price">
-						<text>棰勪及锛�</text>
-						<text>楼1000.00</text>
-					</view>
-					<view class="eidt">
-						<view></view>
-						<view class="eidt-right">
-							<view class="eidt-close">鍙栨秷璁㈠崟</view>
-						</view>
-					</view>
-				</view> -->
 			</view>
 		</template>
 		
@@ -288,12 +206,21 @@
 		onShow(options) {
 			this.typeViewId = 0
 			if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
+				console.log('宸茬櫥闄�')
 				this.isLogin = true
+				if (!this.isOnce) {
+					this.commentStatus = ''
+					this.orderList = []
+					this.next = true
+					this.page = 1
+					this.getOrderList()
+				}
+			} else {
+				this.isLogin = false
+				console.log('鏈櫥闄�')
 			}
 			if (this.userInfo && this.userInfo.useIdentity == 1) {
 				this.typeViewId = 1
-			} else {
-				this.typeViewId = 0
 			}
 		},
 		data() {
@@ -324,7 +251,8 @@
 				
 				next: true,
 				page: 1,
-				orderList: []
+				orderList: [],
+				isOnce: true
 			};
 		},
 		async onLoad() {
@@ -344,6 +272,30 @@
 			this.getOrderList()
 		},
 		methods: {
+			toLogin() {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				})
+			},
+			startJobs(orderId) {
+				this.$u.api.begin({ orderId })
+					.then(res => {
+						if (res.code === 200) {
+							this.status = ''
+							this.commentStatus = ''
+							this.orderList = []
+							this.next = true
+							this.page = 1
+							this.getOrderList()
+						}
+						
+					})
+			},
+			jumpDesc(item) {
+				uni.navigateTo({
+					url: `/pages/order-details/order-details?id=${item.id}`
+				})
+			},
 			// 淇敼
 			jumpEdit(item) {
 				if (item.type === 0 && item.workType === 0) {
@@ -358,17 +310,24 @@
 					uni.navigateTo({
 						url: `/pages/packaging-worker/packaging-worker?id=${item.id}`
 					})
+				} else if (item.type === 1) {
+					uni.navigateTo({
+						url: `/pages/freight/freight?id=${item.id}`
+					})
 				}
 			},
 			cancelOrder() {
-				this.$u.api.receiveCancelOrder({
+				this.$u.api.cancelOrder({
 					orderId: this.orderId
 				}).then(res => {
-					this.show = false
-					this.orderList = []
-					this.next = true
-					this.page = 1
-					this.getOrderList()
+					if (res.code === 200) {
+						this.show = false
+						this.orderList = []
+						this.next = true
+						this.page = 1
+						this.getOrderList()
+					}
+					
 				})
 			},
 			phoneCall(phoneNumber) {
@@ -389,6 +348,8 @@
 						queryLgt: this.longitude
 					}
 				}).then(res => {
+					if (res.code !== 200) return;
+					this.isOnce = false
 					res.data.records.forEach(item => {
 						// 璁㈤鍗�
 						if (item.type === 2) {
@@ -404,6 +365,8 @@
 					
 					if (this.orderList.length === res.data.total) {
 						this.next = false
+					} else {
+						this.page += 1
 					}
 				})
 			},
@@ -522,6 +485,7 @@
 						display: flex;
 						align-items: center;
 						justify-content: flex-end;
+						flex-wrap: wrap;
 						.eidt-close {
 							width: 160rpx;
 							height: 64rpx;

--
Gitblit v1.9.3