feat: 订单详情

This commit is contained in:
苟川东 2025-04-14 10:06:47 +08:00
parent 99bcb178a6
commit 10b0bf4515
4 changed files with 69 additions and 22 deletions

View File

@ -55,6 +55,12 @@ class Api {
let url = `${config.host}/worker/order_dispatch/countWorkbenchOrder`;
return fetch.request('GET', url, {}, true)
}
// 订单详情
static orderInfo(data) {
let url = `${config.host}/worker/order_dispatch/info`;
return fetch.request('GET', url, data, true)
}
}
export default Api

View File

@ -1,13 +1,5 @@
{
"pages": [
{
"path" : "pages/workbench/workbench",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/index/index",
"style" :
@ -16,6 +8,14 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/workbench/workbench",
"style" :
{
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
},
{
"path" : "pages/user/login",
"style" :

View File

@ -2,14 +2,14 @@
<IndexSkeleton v-if="data.is_show_skeleton"></IndexSkeleton>
<view v-else class="ctr">
<view class="fixed-top">
<me-top :title="data.isPullDownRefresh ? '刷新中…' : '接单大厅'"></me-top>
<me-top title="接单大厅"></me-top>
</view>
<me-empty-space :height="listMarginTop"></me-empty-space>
<view class="list">
<view class="order-item" v-for="(item, index) in data.list" :key="index">
<view class="top flex-sb">
<view class="type flex-l">{{item.order_info.item_title}}</view>
<view class="type flex-l" @click="toDetail(item.id)">{{item.order_info.item_title}}</view>
<view class="price flex-r important-color" v-if="item.order_info.receive_type === 1">上门报价</view>
<view class="price flex-r" v-else>平台已收款</view>
</view>

View File

@ -1,48 +1,49 @@
<template>
<view class="ctr">
<view class="ctr" v-if="data !== null">
<view class="price-ctr">
<view class="price flex-c">平台已收款</view>
<view class="desc flex-c">服务价格</view>
<view class="price flex-c" v-if="data.order_info.receive_type === 1">上门报价</view>
<view class="price flex-c" v-else>平台已收款</view>
<view class="desc flex-c">{{ getPriceDescText() }}</view>
</view>
<view class="info">
<view class="item-row flex-sb line-after">
<view class="title flex-l">当前状态</view>
<view class="value flex-r order-status">
<text>待接单</text>
<text>{{getOrderStatusText(data.status)}}</text>
</view>
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">服务类型</view>
<view class="value flex-r">
<text>日常保洁</text>
<text>{{data.order_info.item_title}}</text>
</view>
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">客户姓名</view>
<view class="value flex-r">
<text>倪运昊</text>
<text>{{ data.order_info.customer }}</text>
</view>
</view>
<view class="item-row flex-sb">
<view class="title flex-l">客户电话</view>
<view class="value flex-r value-theme">
<me-icon class="icon" type="icon-call" color="var(--themeColor)" size="40rpx"></me-icon>
<text>18628195903</text>
<text>{{ data.order_info.tel }}</text>
</view>
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">预约上门时间</view>
<view class="value flex-r">
<text>2025年03月22日21:01</text>
<text>{{data.order_info.plan_time}}</text>
</view>
</view>
<view class="item-multi-line line-after">
<view class="title flex-l">客户地址</view>
<view class="value flex-l">浙江省瑞安市迎宾路58号海洋家属楼506号517房</view>
<view class="value flex-l">{{helpers.removeCommas(data.order_info.area.merge_name) + data.order_info.address}}</view>
</view>
<view class="item-multi-line">
<view class="title flex-l">客户备注</view>
<view class="value flex-l">千古江山英雄无觅孙仲谋处舞榭歌台风流总被雨打风吹去斜阳草树寻常巷陌人道寄奴曾住想当年金戈铁马气吞万里如虎</view>
<view class="value flex-l">{{data.remark ? data.remark : '无备注信息'}}</view>
</view>
</view>
<me-empty-space height="376"></me-empty-space>
@ -60,10 +61,50 @@ import MeIcon from "../../components/me-icon/me-icon.vue";
import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue";
import MeButton from "../../components/me-button/me-button.vue";
import helpers from "../../utils/helpers";
import {onLoad, onShow} from '@dcloudio/uni-app'
import {ref, reactive, computed, watch, inject} from 'vue'
import api from "../../api/api";
import enums from "../../utils/enums";
const submit = () => {
helpers.jumpToPage('order-submit')
}
const id = ref(null)
onLoad((params) => {
id.value = params.id
})
onShow(() => {
init()
})
const data = ref(null)
const init = () => {
api.orderInfo({order_dispatch_id: id.value}).then(res => {
data.value = res
}).catch(() => {})
}
//
const getPriceDescText = () => {
let orderInfo = data.value
if (orderInfo.order_info.receive_type === 2) {
return '服务价格'
}
if (orderInfo.status === 60) {
let tailText = orderInfo.total > 0 ? '线下收款¥' + orderInfo.total : '线上收款¥' + orderInfo.online_total
return `服务价格(订金¥${orderInfo.order_info.online_amount}+${tailText})`
}
return `服务价格(已收订金¥${orderInfo.order_info.online_amount})`
}
//
const getOrderStatusText = (status) => {
return enums.WORKBENCH_STATUS_TEXT[status]
}
</script>
<style lang="scss" scoped>
@ -72,7 +113,7 @@ const submit = () => {
box-sizing: border-box;
height: 100vh;
.price-ctr {
height: 200rpx;
min-height: 200rpx;
width: 100%;
padding: 32rpx 20rpx;
box-sizing: border-box;
@ -85,7 +126,7 @@ const submit = () => {
}
.desc {
width: 100%;
height: 56rpx;
min-height: 56rpx;
font-size: 28rpx;
color: var(--summaryColor);
}