|
|
@@ -1,6 +1,10 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <image class="bg" src="/pages-charge/static/charge-ordering-bg.png" mode="widthFix" />
|
|
|
+ <image
|
|
|
+ class="bg"
|
|
|
+ src="/pages-charge/static/charge-ordering-bg.png"
|
|
|
+ mode="widthFix"
|
|
|
+ />
|
|
|
<view class="body">
|
|
|
<view class="iphonex-placeholder"></view>
|
|
|
<view
|
|
|
@@ -25,11 +29,17 @@
|
|
|
<view class="fs-26">充电启动中</view>
|
|
|
</block>
|
|
|
<block v-if="step === 2">
|
|
|
- <image class="icon" src="/pages-charge/static/charge-ordering-icon.png" />
|
|
|
+ <image
|
|
|
+ class="icon"
|
|
|
+ src="/pages-charge/static/charge-ordering-icon.png"
|
|
|
+ />
|
|
|
<view class="fs-26 mt-10">充电中...</view>
|
|
|
</block>
|
|
|
<block v-if="step === 3">
|
|
|
- <image class="icon" src="/pages-charge/static/charge-ordering-finish.png" />
|
|
|
+ <image
|
|
|
+ class="icon"
|
|
|
+ src="/pages-charge/static/charge-ordering-finish.png"
|
|
|
+ />
|
|
|
<view class="fs-26 mt-10">充电结束</view>
|
|
|
</block>
|
|
|
</view>
|
|
|
@@ -342,33 +352,32 @@ const fetchStatus = (data?: any) => {
|
|
|
});
|
|
|
};
|
|
|
const onImgLoad = () => {
|
|
|
- start();
|
|
|
- // fetchChargeStatus()
|
|
|
- // .then((res) => {
|
|
|
- // if ([1, 2].includes(res.chargeStatus)) {
|
|
|
- // if (options.value && options.value.sn === res.connectorId) {
|
|
|
- // fetchStatus(res);
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // 当前充电中
|
|
|
- // uni.showModal({
|
|
|
- // title: "温馨提示",
|
|
|
- // content: "当前有正在充电中的订单",
|
|
|
- // showCancel: false,
|
|
|
- // confirmText: "查看订单",
|
|
|
- // confirmColor: "#347DFF",
|
|
|
- // success: () => {
|
|
|
- // fetchStatus(res);
|
|
|
- // },
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // start();
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch((err) => {
|
|
|
- // console.log(err);
|
|
|
- // start();
|
|
|
- // });
|
|
|
+ fetchChargeStatus()
|
|
|
+ .then((res) => {
|
|
|
+ if ([1, 2].includes(res.chargeStatus)) {
|
|
|
+ if (options.value && options.value.sn === res.connectorId) {
|
|
|
+ fetchStatus(res);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 当前充电中
|
|
|
+ uni.showModal({
|
|
|
+ title: "温馨提示",
|
|
|
+ content: "当前有正在充电中的订单",
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: "查看订单",
|
|
|
+ confirmColor: "#347DFF",
|
|
|
+ success: () => {
|
|
|
+ fetchStatus(res);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ start();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ start();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
onLoad((_options: any) => {
|