MrShi
2025-07-19 9b1a32a3df7d54d19373551a3df34970d1a6a34f
调接口
已修改2个文件
85 ■■■■ 文件已修改
small-program/pages/demand-hall/demand-hall.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
small-program/pages/using-workers/using-workers.vue 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
                    }
                })
            },
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
                    })
                }