feat: 优化

This commit is contained in:
苟川东 2025-04-20 08:46:26 +08:00
parent 2b69628ce7
commit 68b426bc65
7 changed files with 71 additions and 13 deletions

View File

@ -142,8 +142,6 @@ const submit = () => {
font-size: 30rpx; font-size: 30rpx;
line-height: 112rpx; line-height: 112rpx;
text-align: center; text-align: center;
color: transparent;
transition: background .2s ease;
.text { .text {
height: 96rpx; height: 96rpx;
line-height: 96rpx; line-height: 96rpx;
@ -160,7 +158,6 @@ const submit = () => {
.btn { .btn {
border: 1px solid var(--contentBgColor); border: 1px solid var(--contentBgColor);
box-sizing: border-box; box-sizing: border-box;
background-color: transparent;
} }
} }
} }

View File

@ -68,7 +68,12 @@ const acceptOrder = (index, id) => {
content: '接单后请及时和客户联系,确认接单?', content: '接单后请及时和客户联系,确认接单?',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
uni.showLoading({
title: '接单中'
});
api.orderConfirm({type: 'accept', order_dispatch_id: id}).then(res => { api.orderConfirm({type: 'accept', order_dispatch_id: id}).then(res => {
uni.hideLoading();
helpers.showToast('已接单') helpers.showToast('已接单')
data.list.splice(index, 1) data.list.splice(index, 1)
}).catch(() => {}) }).catch(() => {})
@ -81,10 +86,19 @@ const rejectOrder = (index, id) => {
uni.showModal({ uni.showModal({
title: '拒接提示', title: '拒接提示',
confirmText: '确认', confirmText: '确认',
content: '确认拒接该单?', editable: true,
placeholderText: '请输入拒接原因',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
api.orderConfirm({type: 'reject', order_dispatch_id: id}).then(res => { if (!res.content) {
return helpers.showToast('请输入拒接原因')
}
uni.showLoading({
title: '拒接中'
});
api.orderConfirm({type: 'reject', order_dispatch_id: id, reject_reason: res.content}).then(() => {
uni.hideLoading();
helpers.showToast('已拒接') helpers.showToast('已拒接')
data.list.splice(index, 1) data.list.splice(index, 1)
}).catch(() => {}) }).catch(() => {})

View File

@ -126,7 +126,7 @@ const submit = throttle(() => {
icon: "success" icon: "success"
}) })
setTimeout(() => { setTimeout(() => {
helpers.jumpToPage('order-info', `id=${id.value}`, 'redirectTo') uni.navigateBack();
}, 1000) }, 1000)
}).catch(() => {}) }).catch(() => {})
} }

View File

@ -39,7 +39,7 @@
<!-- 线下收款需选择尾款收款方--> <!-- 线下收款需选择尾款收款方-->
<view v-if="submitData.final_payment_method === 1" class="item input flex-sb line-after" @click="selectOfflineTotalType()"> <view v-if="submitData.final_payment_method === 1" class="item input flex-sb line-after" @click="selectOfflineTotalType()">
<view class="title flex-l">尾款收款方</view> <view class="title flex-l">尾款收款方</view>
<view v-if="submitData.offline_total_type === null" class="select-ctr flex-r">请选择尾款收款方</view> <view v-if="submitData.offline_total_type === 0" class="select-ctr flex-r">请选择尾款收款方</view>
<view v-else class="select-ctr flex-r select">{{submitData.offline_total_type === 1 ? '师傅收' : '公司收'}}</view> <view v-else class="select-ctr flex-r select">{{submitData.offline_total_type === 1 ? '师傅收' : '公司收'}}</view>
</view> </view>
<view class="item input flex-sb line-after"> <view class="item input flex-sb line-after">
@ -185,7 +185,7 @@ const submit = throttle(() => {
icon: "success" icon: "success"
}) })
setTimeout(() => { setTimeout(() => {
helpers.jumpToPage('order-info', `id=${id.value}`, 'redirectTo') uni.navigateBack();
}, 1000) }, 1000)
}).catch(() => {}) }).catch(() => {})
} }
@ -214,7 +214,7 @@ const init = () => {
const submitData = reactive({ const submitData = reactive({
complete_images: [],// complete_images: [],//
final_payment_method: null,//1=线,2=线 final_payment_method: null,//1=线,2=线
offline_total_type: null,//1=,2= offline_total_type: 0,//1=,2=
amount: '',// amount: '',//
payment_image: '',// payment_image: '',//
}) })
@ -255,7 +255,7 @@ const validate = () => {
return false return false
} }
if (submitData.final_payment_method === 1 && submitData.offline_total_type === null) { if (submitData.final_payment_method === 1 && submitData.offline_total_type === 0) {
helpers.showToast('请选择尾款收款方') helpers.showToast('请选择尾款收款方')
return false return false
} }

View File

@ -57,7 +57,7 @@
</view> </view>
</view> </view>
<!-- 已上门--> <!-- 已上门已完成 显示上门时间-->
<view class="info" v-if="[enums.ORDER_DISPATCH_STATUS.STATUS_CLOCK, enums.ORDER_DISPATCH_STATUS.STATUS_FINISH].includes(data.status)"> <view class="info" v-if="[enums.ORDER_DISPATCH_STATUS.STATUS_CLOCK, enums.ORDER_DISPATCH_STATUS.STATUS_FINISH].includes(data.status)">
<view class="item-row flex-sb line-after"> <view class="item-row flex-sb line-after">
<view class="title flex-l">上门时间</view> <view class="title flex-l">上门时间</view>
@ -75,6 +75,44 @@
</view> </view>
</view> </view>
<!-- 已完成 -->
<view class="info" v-if="data.status === enums.ORDER_DISPATCH_STATUS.STATUS_FINISH">
<view class="images line-after">
<view class="title flex-l">完成图片</view>
<view class="imgs-ctr">
<view @click="previewImage(imgUrl)" v-for="(imgUrl, index) in data.images" :key="index" class="img-ctr" :style="{marginRight: (index+1) % 5 === 0 ? '0' : '36rpx'}">
<image class="img" mode="aspectFill" :src="imgUrl"></image>
</view>
</view>
</view>
<view class="item-row flex-sb line-after" v-if="data.order_info.receive_type === 1">
<view class="title flex-l">优惠信息</view>
<view class="value flex-r">
<text>{{data.order_info.online_amount}}元抵扣{{data.order_info.discount_amount}}</text>
</view>
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">尾款收款方</view>
<view class="value flex-r">
<text>{{ data.offline_total_type === 1 ? '师傅收' : '公司收' }}</text>
</view>
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">收款金额</view>
<view class="value flex-r">
<text>¥{{ data.total > 0 ? data.total : data.online_total }}</text>
</view>
</view>
<view class="images">
<view class="title flex-l">收款凭证</view>
<view class="imgs-ctr">
<view @click="previewImage(data.image)" :key="index" class="img-ctr">
<image class="img" mode="aspectFill" :src="data.image"></image>
</view>
</view>
</view>
</view>
<me-empty-space height="376"></me-empty-space> <me-empty-space height="376"></me-empty-space>
<!-- 待接单--> <!-- 待接单-->
@ -165,6 +203,10 @@ const rejectOrder = () => {
placeholderText: '请输入拒接原因', placeholderText: '请输入拒接原因',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
if (!res.content) {
return helpers.showToast('请输入拒接原因')
}
api.orderConfirm({type: 'reject', order_dispatch_id: id.value, reject_reason: res.content}).then(() => { api.orderConfirm({type: 'reject', order_dispatch_id: id.value, reject_reason: res.content}).then(() => {
helpers.showToast('已拒接') helpers.showToast('已拒接')
init() init()
@ -185,8 +227,12 @@ onShow(() => {
const data = ref(null) const data = ref(null)
const init = () => { const init = () => {
uni.showLoading({
title: '获取中'
});
api.orderInfo({order_dispatch_id: id.value}).then(res => { api.orderInfo({order_dispatch_id: id.value}).then(res => {
data.value = res data.value = res
uni.hideLoading();
}).catch(() => {}) }).catch(() => {})
} }
@ -303,6 +349,7 @@ const previewImage = (url) => {
} }
.images { .images {
width: 100%; width: 100%;
position: relative;
.title { .title {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;

View File

@ -53,7 +53,7 @@ const submit = throttle(() => {
icon: "success" icon: "success"
}) })
setTimeout(() => { setTimeout(() => {
helpers.jumpToPage('order-info', `id=${id.value}`, 'redirectTo') uni.navigateBack();
}, 1000) }, 1000)
}).catch(() => {}) }).catch(() => {})
} }

View File

@ -106,7 +106,7 @@ const call = (tel) => {
}); });
} }
onLoad(() => { onShow(() => {
init() init()
}) })