|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
- <page-meta page-style="overflow: {{O || U ? 'hidden' : 'visible'}}" />
|
|
|
|
|
|
|
+ <page-meta page-style="overflow: {{X || R ? 'hidden' : 'visible'}}" />
|
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
|
<view :class="['page']">
|
|
<view :class="['page']">
|
|
|
<view v-if="data && priceInfo">
|
|
<view v-if="data && priceInfo">
|
|
@@ -102,28 +102,40 @@
|
|
|
>
|
|
>
|
|
|
<view class="fs-28 color-000 fw-500">充电时间</view>
|
|
<view class="fs-28 color-000 fw-500">充电时间</view>
|
|
|
<view class="flex-align-center lh-28">
|
|
<view class="flex-align-center lh-28">
|
|
|
- <view
|
|
|
|
|
- v-if="chargeTime.format"
|
|
|
|
|
- class="fs-28 color-333 fw-500 mr-16"
|
|
|
|
|
- >{{ chargeTime.format }}</view
|
|
|
|
|
- >
|
|
|
|
|
- <view v-else class="fs-26 mr-16" style="color: #cacaca"
|
|
|
|
|
- >请选择</view
|
|
|
|
|
- >
|
|
|
|
|
- <uni-icons type="right" size="16" color="#CACACA"></uni-icons>
|
|
|
|
|
|
|
+ <block v-if="chargeTime.isPowerSaving">
|
|
|
|
|
+ <view class="fs-28 color-333 fw-500 mr-16">00:00 - 08:00</view>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="chargeTime.format"
|
|
|
|
|
+ class="fs-28 color-333 fw-500 mr-16"
|
|
|
|
|
+ >{{ chargeTime.format }}</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <view v-else class="fs-26 mr-16" style="color: #cacaca"
|
|
|
|
|
+ >请选择</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <uni-icons type="right" size="16" color="#CACACA"></uni-icons>
|
|
|
|
|
+ </block>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="pt-40 pb-40 flex-between">
|
|
<view class="pt-40 pb-40 flex-between">
|
|
|
<view class="fs-28 color-000 fw-500">预计费用</view>
|
|
<view class="fs-28 color-000 fw-500">预计费用</view>
|
|
|
<view class="flex-align-center lh-28">
|
|
<view class="flex-align-center lh-28">
|
|
|
- <view
|
|
|
|
|
- v-if="chargeTime.formatPrice"
|
|
|
|
|
- class="fs-28 color-333 fw-500"
|
|
|
|
|
- >{{ chargeTime.formatPrice }}</view
|
|
|
|
|
- >
|
|
|
|
|
- <view v-else class="fs-26 mr-16" style="color: #cacaca"
|
|
|
|
|
- >选择时间后显示</view
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <block v-if="chargeTime.isPowerSaving">
|
|
|
|
|
+ <view class="fs-28 color-333 fw-500"
|
|
|
|
|
+ >低至{{ priceInfo.minPrice }}元/kwh</view
|
|
|
|
|
+ >
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-if="chargeTime.formatPrice"
|
|
|
|
|
+ class="fs-28 color-333 fw-500"
|
|
|
|
|
+ >{{ chargeTime.formatPrice }}</view
|
|
|
|
|
+ >
|
|
|
|
|
+ <view v-else class="fs-26 mr-16" style="color: #cacaca"
|
|
|
|
|
+ >选择时间后显示</view
|
|
|
|
|
+ >
|
|
|
|
|
+ </block>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -375,6 +387,13 @@ const buildHours = (hour: number, day: Date) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const selectTime = () => {
|
|
const selectTime = () => {
|
|
|
|
|
+ if (chargeTime.value.isPowerSaving) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "省电模式将在00:00-08:00进行充电",
|
|
|
|
|
+ icon: "none",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (!appointmentData.value && chargeType.value === 1) {
|
|
if (!appointmentData.value && chargeType.value === 1) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: "请选择预约模式",
|
|
title: "请选择预约模式",
|
|
@@ -615,7 +634,11 @@ const formatAppointmentCountDown = (time: string) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const submit = () => {
|
|
const submit = () => {
|
|
|
- if (chargeType.value === 0 && !chargeTime.value.hour) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ chargeType.value === 0 &&
|
|
|
|
|
+ !chargeTime.value.isPowerSaving &&
|
|
|
|
|
+ !chargeTime.value.hour
|
|
|
|
|
+ ) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: "请选择充电时间",
|
|
title: "请选择充电时间",
|
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -625,6 +648,7 @@ const submit = () => {
|
|
|
const now = new Date();
|
|
const now = new Date();
|
|
|
let startTime = chargeTime.value.time;
|
|
let startTime = chargeTime.value.time;
|
|
|
if (chargeTime.value.isPowerSaving) {
|
|
if (chargeTime.value.isPowerSaving) {
|
|
|
|
|
+ startTime = now.getTime();
|
|
|
// 省电模式
|
|
// 省电模式
|
|
|
if (
|
|
if (
|
|
|
now.getHours() >= 8 &&
|
|
now.getHours() >= 8 &&
|
|
@@ -637,7 +661,9 @@ const submit = () => {
|
|
|
if (chargeType.value === 0) {
|
|
if (chargeType.value === 0) {
|
|
|
query += "isBooking=true";
|
|
query += "isBooking=true";
|
|
|
query += `&startTime=${format("y-M-d", startTime)} ${
|
|
query += `&startTime=${format("y-M-d", startTime)} ${
|
|
|
- chargeTime.value.isPowerSaving ? "00:00:00" : `${chargeTime.value.hour}:00`
|
|
|
|
|
|
|
+ chargeTime.value.isPowerSaving
|
|
|
|
|
+ ? "00:00:00"
|
|
|
|
|
+ : `${chargeTime.value.hour}:00`
|
|
|
}`;
|
|
}`;
|
|
|
if (chargeTime.value.isPowerSaving) {
|
|
if (chargeTime.value.isPowerSaving) {
|
|
|
query += `&endTime=${format("y-M-d", startTime)} 08:00:00`;
|
|
query += `&endTime=${format("y-M-d", startTime)} 08:00:00`;
|
|
@@ -649,6 +675,7 @@ const submit = () => {
|
|
|
if (discountIndex.value >= 0) {
|
|
if (discountIndex.value >= 0) {
|
|
|
query += `&rechargeRightsId=${discountList.value[discountIndex.value].id}`;
|
|
query += `&rechargeRightsId=${discountList.value[discountIndex.value].id}`;
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(query)
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: "提交中",
|
|
title: "提交中",
|
|
|
mask: true,
|
|
mask: true,
|