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/index/index.vue |  111 +++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 70 insertions(+), 41 deletions(-)

diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 880b9c9..7d73195 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -66,7 +66,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">
@@ -223,10 +223,10 @@
 							</view>
 							<view class="box-hz-list-item" @click="selectAddress(1)">
 								<view class="box-hz-list-item-label"><text>鐢ㄥ伐鍦扮偣锛�</text></view>
-								<view :class="form.location ? 'box-hz-list-item-val active' :'box-hz-list-item-val'">
+								<view :class="form.address ? 'box-hz-list-item-val active' :'box-hz-list-item-val'">
 									<view class="box-hz-list-item-val-left">
 										<image class="icon" src="/static/icon/ic_location@2x.png" mode="widthFix"></image>
-										<text>{{form.location ? form.location : '璇烽�夋嫨鐢ㄥ伐鍦扮偣'}}</text>
+										<text>{{form.address ? form.address : '璇烽�夋嫨鐢ㄥ伐鍦扮偣'}}</text>
 									</view>
 									<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
 								</view>
@@ -326,15 +326,6 @@
 				return this.form.estimatedAccount / 100
 			}
 		},
-		onShow(options) {
-			this.typeViewId = 0
-			if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
-				this.isLogin = true
-			}
-			if (this.userInfo && this.userInfo.useIdentity == 1) {
-				this.typeViewId = 1
-			}
-		},
 		data() {
 			return {
 				show: false,
@@ -394,14 +385,40 @@
 				orderList: [],
 				typeVal: '',
 				page: 1,
-				next: true
+				next: true,
+				
+				isOnce: true
 			}
 		},
 		async onLoad() {
 			await this.$onLaunched;
-			this.getCategoryLists()
-			this.getOrderList()
+			if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
+				this.getOrderList()
+				this.getCategoryLists()
+			}
 			this.form.linkPhone = this.userInfo.telephone
+		},
+		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.userInfo.useIdentity == 1) {
+					this.page = 1
+					this.next = true
+					this.orderList = []
+					this.getOrderList()
+				}
+				
+			} else {
+				this.isLogin = false
+				console.log('鏈櫥闄�')
+			}
+			
+			if (this.userInfo && this.userInfo.useIdentity == 1) {
+				this.typeViewId = 1
+			}
 		},
 		watch: {
 			typeId: {
@@ -413,7 +430,7 @@
 					this.form.longitude = ''
 					this.form.location = ''
 					this.form.locationEnd = ''
-					this.form.wayInfoDTOList = ''
+					this.form.wayInfoDTOList = []
 					this.form.workType = ''
 					this.form.days = ''
 					this.form.locationRemark = ''
@@ -459,13 +476,15 @@
 			getaccept(e, orderId, index) {
 				this.$u.api.accept({ orderId })
 					.then(res => {
-						uni.showToast({ title: '鎶㈠崟鎴愬姛锛�', icon: 'success', duration: 2000 })
-						setTimeout(() => {
-							this.page = 1
-							this.next = true
-							this.orderList = []
-							this.getOrderList()
-						}, 2000)
+						if (res.code === 200) {
+							uni.showToast({ title: '鎶㈠崟鎴愬姛锛�', icon: 'success', duration: 2000 })
+							setTimeout(() => {
+								this.page = 1
+								this.next = true
+								this.orderList = []
+								this.getOrderList()
+							}, 2000)
+						}
 					})
 			},
 			clickSort(id) {
@@ -496,6 +515,8 @@
 						queryLgt: this.longitude
 					}
 				}).then(res => {
+					if (res.code !== 200) return;
+					this.isOnce = false
 					res.data.records.forEach(item => {
 						// 璁㈤鍗�
 						if (item.type === 2) {
@@ -511,6 +532,8 @@
 					
 					if (this.orderList.length === res.data.total) {
 						this.next = false
+					} else {
+						this.page += 1
 					}
 				})
 			},
@@ -608,7 +631,9 @@
 						priceNum1: that.form.days,
 						type: 2
 					}).then(res => {
-						that.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							that.form.estimatedAccount = res.data
+						}
 					})
 				}
 			},
@@ -687,17 +712,17 @@
 					// 閲囨憳宸�
 					if (this.form.workType === 0) {
 						uni.navigateTo({
-							url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+							url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
 						})
 					// 鍒嗘嫞宸�
 					} else if (this.form.workType === 1) {
 						uni.navigateTo({
-							url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+							url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
 						})
 					// 鍖呰宸�
 					} else if (this.form.workType === 2) {
 						uni.navigateTo({
-							url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}`
+							url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}`
 						})
 					}
 				// 杩愯揣
@@ -746,24 +771,28 @@
 			getCategoryLists() {
 				this.$u.api.getCategoryList({ type: 1 })
 					.then(res => {
-						this.car = res.data
-						this.form.categoryId = res.data[0].id
-						this.form.categoryName = res.data[0].name
-						this.carRemark = res.data[0].remark
-						this.carImage = res.data[0].iconFull
+						if (res.code === 200) {
+							this.car = res.data
+							this.form.categoryId = res.data[0].id
+							this.form.categoryName = res.data[0].name
+							this.carRemark = res.data[0].remark
+							this.carImage = res.data[0].iconFull
+						}
 					})
 				this.$u.api.getCategoryList({ type: 2 })
 					.then(res => {
-						res.data.forEach(item => {
-							item.num = ''
-							item.list = item.detailList.map(child => {
-								return {
-									active: false,
-									price: child
-								}
+						if (res.code === 200) {
+							res.data.forEach(item => {
+								item.num = ''
+								item.list = item.detailList.map(child => {
+									return {
+										active: false,
+										price: child
+									}
+								})
 							})
-						})
-						this.orderFood = res.data
+							this.orderFood = res.data
+						}
 					})
 			}
 		}

--
Gitblit v1.9.3