diff --git a/.env.development b/.env.development
index 2ba80cb..408d2d3 100644
--- a/.env.development
+++ b/.env.development
@@ -1,7 +1,7 @@
VITE_APP_NAME=后台管理系统
#VITE_API_URL=http://localhost:9090/api
-#VITE_API_URL=http://yxw.wsdns.cn/api
+VITE_API_URL=http://yxw.wsdns.cn/api
#VITE_SOCKET_URL=ws://localhost:9190
-VITE_API_URL=http://127.0.0.1:9090/api
+#VITE_API_URL=http://127.0.0.1:9090/api
#VITE_API_URL=https://server.gxwebsoft.com/api
VITE_SOCKET_URL=wss://server.gxwebsoft.com
diff --git a/src/api/order/model/index.ts b/src/api/order/model/index.ts
index 3abf5f9..5980c39 100644
--- a/src/api/order/model/index.ts
+++ b/src/api/order/model/index.ts
@@ -35,6 +35,7 @@ export interface Order {
sortNumber?: number;
// 配送方式
deliveryType?: string;
+ payTime?: string;
// 付款状态
payStatus?: number;
expressPrice?: string;
diff --git a/src/views/yunxinwei/order/components/order-info.vue b/src/views/yunxinwei/order/components/order-info.vue
index 05b6181..c0f0dcc 100644
--- a/src/views/yunxinwei/order/components/order-info.vue
+++ b/src/views/yunxinwei/order/components/order-info.vue
@@ -267,9 +267,6 @@
电池押金:¥{{ record.batteryDeposit }}
电池保险:¥{{ record.batteryInsurance }}
-
- {{ expirationDay(record) }}
-
{{ countDuration(record) }}
@@ -278,7 +275,7 @@
-
+
- {{ record.orderNo }}
+ {{ record.orderNo }}
-
+
电池租金:¥{{ record.batteryRent }}
电池押金:¥{{ record.batteryDeposit }}
电池保险:¥{{ record.batteryInsurance }}
@@ -302,7 +304,14 @@
{{ record.expirationTime }}
- {{ expirationDay(record) }}
+ {{ expirationDay(record) }}
+ {{
+ expirationDay(record)
+ }}
@@ -454,6 +463,7 @@
import { listOrder, listOrderPay } from '@/api/order';
import { CopyOutlined } from '@ant-design/icons-vue';
import { EquipmentRecord } from '@/api/apps/equipment/record/model';
+ import dayjs from 'dayjs';
const useForm = Form.useForm;
// 是否开启响应式布局
@@ -809,15 +819,20 @@
// };
const expirationDay = (order) => {
- const setTime = new Date(order.expirationTime);
- const nowTime = new Date();
- const restSec = setTime.getTime() - nowTime.getTime();
- console.log('计算剩余天数');
- console.log(restSec);
- // 剩余天数
- const day = parseInt(String(restSec / (60 * 60 * 24 * 1000)));
- if (day < 0) {
- return '逾期' + Math.abs(day) + '天';
+ if (dayjs(order.expirationTime).isBefore(dayjs())) {
+ const useDay = dayjs(order.expirationTime).diff(
+ dayjs(props?.data?.payTime),
+ 'd'
+ );
+ return `使用${useDay}天`;
+ } else {
+ const day = dayjs(order.expirationTime).diff(dayjs(order.payTime), 'd');
+ if (day < 0) {
+ return '逾期' + Math.abs(day) + '天';
+ } else {
+ const useDay = dayjs().diff(dayjs(props?.data?.payTime), 'd');
+ return `使用${useDay}天`;
+ }
}
};