From cdd2f1211f746ad59ba691667e9f6ab0e30caeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=9F=E5=B7=9D=E4=B8=9C?= Date: Mon, 14 Apr 2025 14:24:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E6=8E=A5=E5=8D=95=E3=80=81=E6=8B=92=E5=8D=95=EF=BC=9B?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B8=8A=E9=97=A8=E6=97=B6=E9=97=B4=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E8=AF=95=EF=BC=9Bicon=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=A7=BB=E5=87=BA=E9=BB=98=E8=AE=A4=E9=A2=9C=E8=89=B2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/me-icon/me-icon.css | 9 --- pages.json | 7 ++ pages/order/order-info.vue | 70 +++++++++++++---- pages/order/select-time.vue | 134 +++++++++++++++++++++++++++++++++ pages/workbench/workbench.vue | 12 ++- utils/enums.js | 1 + utils/helpers.js | 6 ++ 7 files changed, 212 insertions(+), 27 deletions(-) create mode 100644 pages/order/select-time.vue diff --git a/components/me-icon/me-icon.css b/components/me-icon/me-icon.css index d642144..56fed6a 100644 --- a/components/me-icon/me-icon.css +++ b/components/me-icon/me-icon.css @@ -1,14 +1,11 @@ .icon-arrow-up-line:before { content: "\e90d"; - color: #fff; } .icon-progress-2-line:before { content: "\e90e"; - color: #e18f00; } .icon-reset-left-line:before { content: "\e90c"; - color: #fff; } .icon-upload-cloud-fill:before { content: "\e90b"; @@ -18,11 +15,9 @@ } .icon-info:before { content: "\e900"; - color: #e18f00; } .icon-call:before { content: "\e901"; - color: #2772f0; } .icon-user:before { content: "\e902"; @@ -35,19 +30,15 @@ } .icon-flashlight:before { content: "\e905"; - color: #fff; } .icon-time:before { content: "\e906"; - color: #2772f0; } .icon-arrow-right-circle:before { content: "\e907"; - color: #fff; } .icon-checkbox-circle:before { content: "\e908"; - color: #2772f0; } .icon-checkbox-blank-circle:before { content: "\e909"; diff --git a/pages.json b/pages.json index 618a8bf..117dbe0 100644 --- a/pages.json +++ b/pages.json @@ -45,6 +45,13 @@ { "navigationBarTitleText" : "提交" } + }, + { + "path" : "pages/order/select-time", + "style" : + { + "navigationBarTitleText" : "已和客户沟通" + } } ], "globalStyle": { diff --git a/pages/order/order-info.vue b/pages/order/order-info.vue index e8f66b4..d4f6a34 100644 --- a/pages/order/order-info.vue +++ b/pages/order/order-info.vue @@ -18,19 +18,21 @@ {{data.order_info.item_title}} - - 客户姓名 - - {{ data.order_info.customer }} + 预约上门时间 @@ -47,10 +49,14 @@ - - - + + + + + + + @@ -66,6 +72,42 @@ import {ref, reactive, computed, watch, inject} from 'vue' import api from "../../api/api"; import enums from "../../utils/enums"; +const selectTime = () => { + helpers.jumpToPage('select-time', 'id=' + id.value) +} + +const acceptOrder = () => { + uni.showModal({ + title: '接单提示', + confirmText: '确认', + content: '接单后请及时和客户联系,确认接单?', + success: function (res) { + if (res.confirm) { + api.orderConfirm({type: 'accept', order_dispatch_id: id.value}).then(() => { + helpers.showToast('已接单') + init() + }).catch(() => {}) + } + } + }); +} + +const rejectOrder = () => { + uni.showModal({ + title: '拒接提示', + confirmText: '确认', + content: '确认拒接该单?', + success: function (res) { + if (res.confirm) { + api.orderConfirm({type: 'reject', order_dispatch_id: id.value}).then(() => { + helpers.showToast('已拒接') + init() + }).catch(() => {}) + } + } + }); +} + const submit = () => { helpers.jumpToPage('order-submit') } diff --git a/pages/order/select-time.vue b/pages/order/select-time.vue new file mode 100644 index 0000000..63e8c58 --- /dev/null +++ b/pages/order/select-time.vue @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + diff --git a/pages/workbench/workbench.vue b/pages/workbench/workbench.vue index 7674927..2ae5a10 100644 --- a/pages/workbench/workbench.vue +++ b/pages/workbench/workbench.vue @@ -15,12 +15,12 @@ - {{item.order_info.item_title}} + {{item.order_info.item_title}} 上门报价 平台已收款 - + {{item.order_info.address}} @@ -76,12 +76,16 @@ import {onLoad, onShow} from '@dcloudio/uni-app' import {ref, reactive, computed, watch, inject} from 'vue' import MeIcon from "../../components/me-icon/me-icon"; -import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue"; +import MeEmptySpace from "../../components/me-empty-space/me-empty-space"; import MeTop from "../../components/me-top/me-top.vue"; import api from "../../api/api"; import helpers from "../../utils/helpers"; import enums from "../../utils/enums"; -import WorkbenchSkeleton from "./workbench-skeleton.vue"; +import WorkbenchSkeleton from "./workbench-skeleton"; + +const toDetail = (id) => { + helpers.jumpToPage('order-info', `id=${id}`) +} //是否显示骨架屏 const isShowSkeleton = computed(() => { diff --git a/utils/enums.js b/utils/enums.js index 30c0fb3..0d0ee57 100644 --- a/utils/enums.js +++ b/utils/enums.js @@ -18,6 +18,7 @@ const enums = { 20: '待上门', 30: '服务中', 60: '已完成', + '-10': '已拒接' }, }; diff --git a/utils/helpers.js b/utils/helpers.js index 4930c40..9ef70e0 100644 --- a/utils/helpers.js +++ b/utils/helpers.js @@ -21,6 +21,8 @@ class helpers { 'order-submit': '/pages/order/order-submit', //首页 'index': '/pages/index/index', + //选择上门时间 + 'select-time': '/pages/order/select-time', } url = paths[pathName] @@ -126,5 +128,9 @@ class helpers { static removeCommas(str) { return str.replace(/,/g, ''); } + + static removeSeconds(datetimeStr) { + return datetimeStr.slice(0, 16); + } } export default helpers