From 9b1a32a3df7d54d19373551a3df34970d1a6a34f Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 19 七月 2025 10:29:47 +0800
Subject: [PATCH] 调接口
---
small-program/pages/demand-hall/demand-hall.vue | 15 ++++++-
small-program/pages/using-workers/using-workers.vue | 70 ++++++++++++++++++++++++++--------
2 files changed, 66 insertions(+), 19 deletions(-)
diff --git a/small-program/pages/demand-hall/demand-hall.vue b/small-program/pages/demand-hall/demand-hall.vue
index 7503f8a..cb5b86a 100644
--- a/small-program/pages/demand-hall/demand-hall.vue
+++ b/small-program/pages/demand-hall/demand-hall.vue
@@ -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>
@@ -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">
@@ -344,6 +344,11 @@
this.getOrderList()
},
methods: {
+ jumpDesc(item) {
+ uni.navigateTo({
+ url: `/pages/order-details/order-details?id=${item.id}`
+ })
+ },
// 淇敼
jumpEdit(item) {
if (item.type === 0 && item.workType === 0) {
@@ -357,6 +362,10 @@
} else if (item.type === 0 && item.workType === 2) {
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}`
})
}
},
@@ -404,6 +413,8 @@
if (this.orderList.length === res.data.total) {
this.next = false
+ } else {
+ this.page += 1
}
})
},
diff --git a/small-program/pages/using-workers/using-workers.vue b/small-program/pages/using-workers/using-workers.vue
index 712b0e2..4be22fe 100644
--- a/small-program/pages/using-workers/using-workers.vue
+++ b/small-program/pages/using-workers/using-workers.vue
@@ -56,7 +56,7 @@
<view class="list-item-row-label">鍥剧墖</view>
<view class="list-item-row-upload">
<view class="upload-item" v-for="(item, index) in form.multifileList" :key="index">
- <image :src="item.url" mode="widthFix"></image>
+ <image :src="item.url || item.fileurlFull" mode="widthFix"></image>
<image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image>
</view>
<view class="upload-item" @click="uploadImg">
@@ -155,6 +155,7 @@
show: false,
show1: false,
form: {
+ id: null,
days: '',
startDate: '',
endDate: '',
@@ -175,19 +176,34 @@
estimatedAccount: '',
type: 0
},
+ modify: false,
cateList: [],
viewStatus: false
};
},
onLoad(option) {
- this.form.linkPhone = this.userInfo.telephone
- this.form.days = option.days
- this.form.startDate = option.startDate
- this.form.endDate = option.endDate
- this.form.lat = option.latitude
- this.form.lgt = option.longitude
- this.form.location = option.address
- this.form.workType = option.workType
+ // 缂栬緫
+ if (option.id) {
+ this.form.id = option.id
+ this.$u.api.getDetail({
+ orderId: option.id
+ }).then(res => {
+ 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
+ })
+ } else {
+ this.form.linkPhone = this.userInfo.telephone
+ this.form.days = option.days
+ this.form.startDate = option.startDate
+ this.form.endDate = option.endDate
+ this.form.lat = option.latitude
+ this.form.lgt = option.longitude
+ this.form.location = option.address
+ this.form.workType = option.workType
+ }
this.getCateList()
},
methods: {
@@ -205,14 +221,33 @@
if (!this.form.linkPhone) {
return uni.showToast({ title: '璇疯緭鍏ヨ仈绯荤數璇�', icon: 'none' })
}
- this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 })
- .then(res => {
- if (res.code == 200) {
- uni.navigateTo({
- url: `/pages/success/success?orderId=${res.data.id}`
- })
- }
- })
+ if (!this.form.id) {
+ this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 })
+ .then(res => {
+ if (res.code == 200) {
+ uni.navigateTo({
+ url: `/pages/success/success?orderId=${res.data.id}`
+ })
+ }
+ })
+ } else {
+ this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100 })
+ .then(res => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '缂栬緫鎴愬姛',
+ icon: 'success',
+ mask: true,
+ duration: 2000
+ })
+ setTimeout(() => {
+ uni.navigateBack({ delta: 1 });
+ uni.$emit('refresh')
+ }, 1500)
+
+ }
+ })
+ }
},
// 璁$畻閲戦
getPrice() {
@@ -225,6 +260,7 @@
type: this.form.type,
workType: this.form.workType
}).then(res => {
+ this.modify = true
this.form.estimatedAccount = res.data
})
}
--
Gitblit v1.9.3