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/order/order.vue |  152 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 101 insertions(+), 51 deletions(-)

diff --git a/src/pages/order/order.vue b/src/pages/order/order.vue
index 00ed0b9..a2e418b 100644
--- a/src/pages/order/order.vue
+++ b/src/pages/order/order.vue
@@ -1,44 +1,61 @@
 <template>
 	<view>
 		<up-sticky bgColor="#fff">
-			<up-subsection :list="list" :current="current4" activeColor="#f9ae3d"
-				@change="sectionChange"></up-subsection>
+			<view class="coreshop-ff content c-p-10">
+				<up-search placeholder="璇风偣鍑婚�夋嫨鏃ユ湡" @clear='clear' @clickIcon='clickTime' @custom='search'
+					v-model="workTime" search-icon="calendar" @search='search'></up-search>
+			</view>
+			<!-- <up-subsection :list="list" :current="current4" activeColor="#f9ae3d"
+				@change="sectionChange"></up-subsection> -->
 		</up-sticky>
 		<view class="full-page">
-			<view class="listrecord c-p-20" v-for="(item,index) in listO.orderList">
-				<view class="coreshop-ff chuany-bradius20">
-					<view class="c-p-26">
-						<view class="chuany-flex chuany-justify-between">
-							<text class="chuany-font34 chuany-text-bold">
-								{{item.orderName}}
-							</text>
+			<view class="c-p-l-20 c-p-r-20" v-if="listO.orderList&&listO.orderList.length>0">
+				<view class="listrecord c-p-t-20" v-for="(item,index) in listO.orderList" :key="item.id"
+					@click="pageToDetail(item)">
+					<view class="coreshop-ff chuany-bradius20">
+						<view class="c-p-26">
 							<view class="chuany-flex chuany-justify-between">
-								<!-- <text class="c-p-r-20">
-								
-							</text> -->
-								<up-tag class='c-m-r-10' text="宸茬粨绠�" shape="circle" type="success" plain plainFill
-									size='mini'></up-tag>
-								<up-tag text="宸茬‘璁�" shape="circle" type="success" plain plainFill size='mini'></up-tag>
-							</view>
-						</view>
-						<view class="chuany-flex chuany-justify-between c-p-t-20">
-							<view class="chuany-width50">
-								<text>
-									鏂瑰紡锛氳鏃�
+								<text class="chuany-font34 chuany-text-bold">
+									{{item.orderName}}
 								</text>
+								<view class="chuany-flex chuany-justify-between">
+									<!-- 鎷涘伐浜烘暟锛歿{item.worderCount}}浜� -->
+									<!-- <text class="c-p-r-20">
+									
+								</text> -->
+									<up-tag class='c-m-r-10' :text="item.orderStatusName" shape="circle" type="success"
+										plain plainFill size='mini'></up-tag>
+								</view>
 							</view>
-							<text class="chuany-width50">
-								宸ヤ环锛�17鍏�/灏忔椂
-							</text>
+							<view class="c-p-t-14">
+								鏃ユ湡锛歿{$util.formatDate(item.wordStartTime)}} 鑷� {{$util.formatDate(item.wordEndTime)}}
+							</view>
+							<view class="c-p-t-14">
+								鏃堕棿锛歿{item.startTimeName}} 鑷� {{item.endTimeName}}
+							</view>
+							<view class="chuany-flex chuany-justify-between c-p-t-14">
+								<view class="chuany-width50">
+									<text>
+										鏂瑰紡锛歿{item.workerType==0?'璁℃椂':'璁′欢'}}
+									</text>
+								</view>
+								<view class="chuany-width50">
+									宸ヤ环锛歿{item.workPrice}}{{item.workerType==0?'鍏�/灏忔椂':'鍏�/浠�'}}
+									<text></text>
+								</view>
+							</view>
 						</view>
 					</view>
 				</view>
+				<up-loadmore :status="loadStatus" />
 			</view>
-			<up-loadmore :status="status" />
+			<view v-else>
+				<up-empty text='鏆傛棤' icon="/static/order.png">
+				</up-empty>
+			</view>
 		</view>
-		<up-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png">
-		</up-empty>
-
+		<fui-date-picker range :show="datePickerShow" type="5" @change="changePicker"
+			@cancel="cancel"></fui-date-picker>
 	</view>
 </template>
 
@@ -59,59 +76,92 @@
 		$util,
 		$db
 	} = getCurrentInstance().appContext.config.globalProperties
-	const state = reactive({
+	let state = reactive({
 		pageIndex: 1,
 		pageSize: 20,
 	})
-	let status = ref('loadmore')
+	let workTime = ref('')
+	let datePickerShow = ref(false)
+	let loadStatus = ref('loadmore')
 	let totalPages = ref(0)
 	let listO = reactive({
-		orderList:[]
+		orderList: []
 	})
 	onReachBottom(() => {
-			if (this.loadStatus != 'nomore') {
-				PostMyListPageCompany();
-			}
-		}),
-		onLoad(() => {
-			$api.PostMyListPageCompany(state).then(res => {
-				console.log(res, '---');
-			})
-		})
+		if (loadStatus.value != 'nomore') {
+			PostMyListPageCompany();
+		}
+	})
+	onLoad(() => {
+		PostMyListPageCompany()
+	})
 	const current4 = ref(0);
-	const list = ref(['鍏ㄩ儴', '杩涜涓�', '宸插畬鎴�', '宸插彇娑�']);
-
-
-	const sectionChange = (index) => {
-		current4.value = index;
+	const list = ref(['鍏ㄩ儴', '鍙戝竷', '鎷涘伐瀹屾瘯', '缁撶畻瀹屾瘯']);
+	const changePicker = (val) => {
+		console.log(val);
+		workTime.value = val.startDate.result + '鑷�' + val.endDate.result
+		state.wordStartTime = new Date(val.startDate.result) //宸ヤ綔寮�濮嬫椂闂�
+		state.wordEndTime = new Date(val.endDate.result)
 	}
-	const PostMyListPageCompany = () => {
+
+	const search = (index) => {
+		console.log(index, '------鈥�');
+		if (index == 0) {
+			PostMyListPageCompany()
+		} else {
+			PostMyListPageCompany(index - 1)
+		}
+
+	}
+	const clear = () => {
+		state.wordStartTime = ""
+		state.wordEndTime = ""
+	}
+	const clickTime = () => {
+		datePickerShow.value = !datePickerShow.value
+	}
+	const PostMyListPageCompany = (orderStatus) => {
 		let data = {
 			pageIndex: state.pageIndex,
 			pageSize: state.pageSize,
+			orderStatus
 		}
-		this.loadStatus = 'loading';
+		if (state.wordStartTime) {
+			data.wordStartTime = state.wordStartTime
+		}
+		if (state.wordEndTime) {
+			data.wordEndTime = state.wordEndTime
+		}
+		loadStatus.value = 'loading';
 		$api.PostMyListPageCompany(data).then(res => {
+			console.log(res, res.code, '-----------123鈥�');
 			if (res.code == 1) {
-				if(state.pageIndex==1){
+				if (state.pageIndex == 1) {
 					listO.orderList = res.data.items
-				}else{
+				} else {
 					listO.orderList.concat(...res.data.items)
 				}
+				console.log(listO.orderList, 'listO.orderList鈥�');
 				// totalPages.value = res.data.totalCount
 				// 鏍规嵁count鏁伴噺鍒ゆ柇鏄惁杩樻湁鏁版嵁
 				if (res.data.totalCount > listO.orderList.length) {
-					status.value = 'loadmore';
+					loadStatus.value = 'loadmore'
 					state.pageIndex++
 				} else {
 					// 鏁版嵁宸插姞杞藉畬姣�
-					status.value = 'nomore';
+					loadStatus.value = 'nomore'
 				}
 			} else {
 				// _that.$refs.uToast.show({ message: res.msg, type: 'error' });
 			}
 		})
 	}
+	const pageToDetail = (item) => {
+		uni.navigateTo({
+			url: `/pages/order/detail?orderid=${item.id}`
+		});
+		// $db.set('detailItem',JSON.stringify(item))
+	}
 </script>
 
 <style>

--
Gitblit v1.9.1