From edb50cb0dc65061d5ce9f8d4ff26fcee12b09eee Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 19 七月 2025 15:07:01 +0800
Subject: [PATCH] 调接口

---
 small-program/pages/packaging-worker/packaging-worker.vue |   30 ++++--
 small-program/pages/demand-hall/demand-hall.vue           |   28 ++++--
 small-program/pages/sorting/sorting.vue                   |   29 ++++--
 small-program/pages/using-workers/using-workers.vue       |   29 ++++--
 small-program/pages/index/index.vue                       |   52 +++++++-----
 small-program/pages/freight/freight.vue                   |   46 +++++++----
 6 files changed, 131 insertions(+), 83 deletions(-)

diff --git a/small-program/pages/demand-hall/demand-hall.vue b/small-program/pages/demand-hall/demand-hall.vue
index b953303..52e4b0d 100644
--- a/small-program/pages/demand-hall/demand-hall.vue
+++ b/small-program/pages/demand-hall/demand-hall.vue
@@ -273,12 +273,15 @@
 			startJobs(orderId) {
 				this.$u.api.begin({ orderId })
 					.then(res => {
-						this.status = ''
-						this.commentStatus = ''
-						this.orderList = []
-						this.next = true
-						this.page = 1
-						this.getOrderList()
+						if (res.code === 200) {
+							this.status = ''
+							this.commentStatus = ''
+							this.orderList = []
+							this.next = true
+							this.page = 1
+							this.getOrderList()
+						}
+						
 					})
 			},
 			jumpDesc(item) {
@@ -310,11 +313,14 @@
 				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) {
diff --git a/small-program/pages/freight/freight.vue b/small-program/pages/freight/freight.vue
index 7fc5791..b6c615e 100644
--- a/small-program/pages/freight/freight.vue
+++ b/small-program/pages/freight/freight.vue
@@ -302,16 +302,18 @@
 				this.$u.api.getDetail({
 					orderId: option.id
 				}).then(res => {
-					this.info = res.data
-					for (const key in this.form) {
-						this.form[key] = res.data[key]
-					}
-					this.form.price = Number(this.form.price) / 100
-					if (!this.form.multifileList) {
-						this.form.multifileList = []
-					}
-					if (!this.form.wayInfoDTOList) {
-						this.form.wayInfoDTOList = []
+					if (res.code === 200) {
+						this.info = res.data
+						for (const key in this.form) {
+							this.form[key] = res.data[key]
+						}
+						this.form.price = Number(this.form.price) / 100
+						if (!this.form.multifileList) {
+							this.form.multifileList = []
+						}
+						if (!this.form.wayInfoDTOList) {
+							this.form.wayInfoDTOList = []
+						}
 					}
 				})
 			} else {
@@ -414,23 +416,31 @@
 						priceNum2: this.form.priceNum2,
 						type: 1
 					}).then(res => {
-						this.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							this.form.estimatedAccount = res.data
+						}
+						
 					})
 				}
 			},
 			getCategoryLists() {
 				this.$u.api.getCategoryList({ type: 1 })
 					.then(res => {
-						this.car = [res.data]
-						res.data.forEach(item => {
-							if (item.id === this.form.categoryId) {
-								this.carArr = [item.detailList]
-							}
-						})
+						if (res.code === 200) {
+							this.car = [res.data]
+							res.data.forEach(item => {
+								if (item.id === this.form.categoryId) {
+									this.carArr = [item.detailList]
+								}
+							})
+						}
+						
 					})
 				this.$u.api.getCategoryList({ type: 0 })
 					.then(res => {
-						this.variety = [res.data]
+						if (res.code === 200) {
+							this.variety = [res.data]
+						}
 					})
 			},
 			confirmCategary(e) {
diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 9a93d5f..1c2ed91 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -467,13 +467,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) {
@@ -620,7 +622,9 @@
 						priceNum1: that.form.days,
 						type: 2
 					}).then(res => {
-						that.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							that.form.estimatedAccount = res.data
+						}
 					})
 				}
 			},
@@ -758,24 +762,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
+						}
 					})
 			}
 		}
diff --git a/small-program/pages/packaging-worker/packaging-worker.vue b/small-program/pages/packaging-worker/packaging-worker.vue
index 3e044c9..deb0d78 100644
--- a/small-program/pages/packaging-worker/packaging-worker.vue
+++ b/small-program/pages/packaging-worker/packaging-worker.vue
@@ -211,16 +211,19 @@
 				this.$u.api.getDetail({
 					orderId: option.id
 				}).then(res => {
-					this.info = res.data
-					for (const key in this.form) {
-						this.form[key] = res.data[key]
+					if (res.code === 200) {
+						this.info = res.data
+						for (const key in this.form) {
+							this.form[key] = res.data[key]
+						}
+						this.form.days = res.data.totalDays
+						this.form.price = Number(this.form.price) / 100
+						if (!this.form.multifileList) {
+							this.form.multifileList = []
+						}
+						// this.clickType()
 					}
-					this.form.days = res.data.totalDays
-					this.form.price = Number(this.form.price) / 100
-					if (!this.form.multifileList) {
-						this.form.multifileList = []
-					}
-					// this.clickType()
+					
 				})
 			} else {
 				this.form.linkPhone = this.userInfo.telephone
@@ -283,7 +286,10 @@
 						type: this.form.type,
 						workType: this.form.workType
 					}).then(res => {
-						this.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							this.form.estimatedAccount = res.data
+						}
+						
 					})
 				}
 			},
@@ -320,7 +326,9 @@
 				this.$u.api.getCategoryList({
 					type: 0
 				}).then(res => {
-					this.cateList = [res.data]
+					if (res.code === 200) {
+						this.cateList = [res.data]
+					}
 				})
 			},
 			uploadImg() {
diff --git a/small-program/pages/sorting/sorting.vue b/small-program/pages/sorting/sorting.vue
index d01a6ba..99002d5 100644
--- a/small-program/pages/sorting/sorting.vue
+++ b/small-program/pages/sorting/sorting.vue
@@ -201,15 +201,18 @@
 				this.$u.api.getDetail({
 					orderId: option.id
 				}).then(res => {
-					this.info = res.data
-					for (const key in this.form) {
-						this.form[key] = res.data[key]
+					if (res.code === 200) {
+						this.info = res.data
+						for (const key in this.form) {
+							this.form[key] = res.data[key]
+						}
+						this.form.days = res.data.totalDays
+						this.form.price = Number(this.form.price) / 100
+						if (!this.form.multifileList) {
+							this.form.multifileList = []
+						}
 					}
-					this.form.days = res.data.totalDays
-					this.form.price = Number(this.form.price) / 100
-					if (!this.form.multifileList) {
-						this.form.multifileList = []
-					}
+					
 				})
 			} else {
 				this.form.linkPhone = this.userInfo.telephone
@@ -271,7 +274,10 @@
 						type: this.form.type,
 						workType: this.form.workType
 					}).then(res => {
-						this.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							this.form.estimatedAccount = res.data
+						}
+						
 					})
 				}
 			},
@@ -300,7 +306,10 @@
 				this.$u.api.getCategoryList({
 					type: 0
 				}).then(res => {
-					this.cateList = [res.data]
+					if (res.code === 200) {
+						this.cateList = [res.data]
+					}
+					
 				})
 			},
 			uploadImg() {
diff --git a/small-program/pages/using-workers/using-workers.vue b/small-program/pages/using-workers/using-workers.vue
index a7bddd6..4b4b942 100644
--- a/small-program/pages/using-workers/using-workers.vue
+++ b/small-program/pages/using-workers/using-workers.vue
@@ -195,15 +195,18 @@
 				this.$u.api.getDetail({
 					orderId: option.id
 				}).then(res => {
-					this.info = res.data
-					for (const key in this.form) {
-						this.form[key] = res.data[key]
+					if (res.code === 200) {
+						this.info = res.data
+						for (const key in this.form) {
+							this.form[key] = res.data[key]
+						}
+						this.form.days = res.data.totalDays
+						this.form.price = Number(this.form.price) / 100
+						if (!this.form.multifileList) {
+							this.form.multifileList = []
+						}
 					}
-					this.form.days = res.data.totalDays
-					this.form.price = Number(this.form.price) / 100
-					if (!this.form.multifileList) {
-						this.form.multifileList = []
-					}
+					
 				})
 			} else {
 				this.form.linkPhone = this.userInfo.telephone
@@ -271,8 +274,10 @@
 						type: this.form.type,
 						workType: this.form.workType
 					}).then(res => {
-						this.modify = true
-						this.form.estimatedAccount = res.data
+						if (res.code === 200) {
+							this.modify = true
+							this.form.estimatedAccount = res.data
+						}
 					})
 				}
 			},
@@ -300,7 +305,9 @@
 				this.$u.api.getCategoryList({
 					type: 0
 				}).then(res => {
-					this.cateList = [res.data]
+					if (res.code === 200) {
+						this.cateList = [res.data]
+					}
 				})
 			},
 			uploadImg() {

--
Gitblit v1.9.3