Kaynağa Gözat

fix:修复字段

needcode 2 yıl önce
ebeveyn
işleme
9ccba07f85

+ 3 - 5
src/api/charge.ts

@@ -30,7 +30,7 @@ export function fetchStationPriceDesc(ConnectorID: string, StationID?: string) {
             item.startTimeFormat = `${hour}:${min}~24:00`;
             if (Number(hour) <= nowHour) {
               currentPrice = Number(
-                Number(item.elecPrice + item.sevicePrice).toFixed(2)
+                Number(item.elecPrice + item.servicePrice).toFixed(2)
               );
               currentTime = `${hour}:${min}~24:00`;
             }
@@ -40,7 +40,7 @@ export function fetchStationPriceDesc(ConnectorID: string, StationID?: string) {
             item.startTimeFormat = `${hour}:${min}~${nhour}:${nmin}`;
             if (nowHour >= Number(hour) && nowHour < Number(nhour)) {
               currentPrice = Number(
-                Number(item.elecPrice + item.sevicePrice).toFixed(2)
+                Number(item.elecPrice + item.servicePrice).toFixed(2)
               );
               currentTime = `${hour}:${min}~${nhour}:${nmin}`;
             }
@@ -301,11 +301,9 @@ function _fetchStationStatus(list: any[]) {
             if (StationStatusInfo) {
               const connectorStatusInfo =
                 StationStatusInfo.connectorStatusInfos.find(
-                  (costatus: any) => costatus.connectorId === coInfo.connectorID
+                  (costatus: any) => costatus.connectorId === coInfo.connectorId
                 );
               if (connectorStatusInfo) {
-                console.log(connectorStatusInfo);
-                
                 coInfo.connectorStatusInfo = connectorStatusInfo;
               }
             }

+ 3 - 1
src/pages-charge/codeing/codeing.vue

@@ -1,8 +1,10 @@
 <template>
   <view class="pt-10 pr-60 pl-60">
     <view class="lh-0">
+      <!-- #ifdef MP-WEIXIN -->
+		  <!-- #endif -->
       <image
-        src="../static/charge-input-head.png"
+        src="/pages-charge/static/charge-input-head.png"
         mode="widthFix"
         style="width: 100%"
       ></image>

+ 1 - 1
src/pages-charge/machines/charge-machine/charge-machine.vue

@@ -84,7 +84,7 @@ export default {
           success: (res) => {
             if (res.tapIndex === 0) {
               uni.navigateTo({
-                url: `/pages-charge/ordering/ordering?sn=${list[index].ConnectorID}`,
+                url: `/pages-charge/ordering/ordering?sn=${list[index].connectorId}`,
               });
             }
           },

+ 4 - 4
src/pages-charge/machines/machines.vue

@@ -16,7 +16,7 @@
       </view>
       <view class="flex mt-20">
         <image
-          src="../static/machines-banner-address.png"
+          src="/pages-charge/static/machines-banner-address.png"
           mode="widthFix"
           style="width: 16px; display: block"
         />
@@ -35,7 +35,7 @@
         </view>
       </view>
       <image
-        src="../static/machines-banner-nav.png"
+        src="/pages-charge/static/machines-banner-nav.png"
         mode="widthFix"
         class="nav"
         @click="openAddress"
@@ -48,7 +48,7 @@
       :key="index"
     >
       <ChargeMachine
-        :title="item.equipmentId"
+        :title="'NO.' + item.shortId"
         :price="station.totalFee"
         :time="currentTime"
         :list="item.connectorInfos"
@@ -146,7 +146,7 @@ onLoad((options: any) => {
           if (item.connectorInfos && item.connectorInfos.length) {
             item.connectorInfos.forEach((con: any) => {
               if (!ConnectorID) {
-                ConnectorID = con.connectorID;
+                ConnectorID = con.connectorId;
               }
               if (
                 con.connectorStatusInfo &&

+ 31 - 30
src/pages-charge/ordering/ordering.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="container">
-    <image class="bg" src="../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
@@ -11,7 +11,7 @@
       >
         <image
           :class="['border', `${step <= 2 ? 'border-animation' : ''}`]"
-          src="../static/charge-ordering-border.png"
+          src="/pages-charge/static/charge-ordering-border.png"
           @load="onImgLoad"
         />
         <view class="timer flex-column flex-center">
@@ -25,11 +25,11 @@
             <view class="fs-26">充电启动中</view>
           </block>
           <block v-if="step === 2">
-            <image class="icon" src="../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="../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,32 +342,33 @@ const fetchStatus = (data?: any) => {
     });
 };
 const onImgLoad = () => {
-  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();
-    });
+  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) => {

+ 1 - 0
src/utils/code.ts

@@ -16,6 +16,7 @@ export function deCode(url: string) {
     /h5\.en-plus\.com/.test(url) ||
     /www.en-plus.cn/.test(url) ||
     /dev\.en-plus\.com\.cn/.test(url) ||
+    /dev\.kuaiyuman\.cn/.test(url) || 
     /www\.kuaiyuman\.cn/.test(url)
   ) {
     const split = url.split("/");

+ 16 - 1
src/utils/constant.ts

@@ -1 +1,16 @@
-export const host = 'https://dev.kuaiyuman.cn/api' // 'https://www.kuaiyuman.cn/api'
+declare const process: any;
+declare const __wxConfig: any;
+
+let isDevelopment = process.env.NODE_ENV === "development";
+
+// #ifdef MP-WEIXIN
+const env =
+  typeof __wxConfig !== "undefined"
+    ? __wxConfig.envVersion || "release"
+    : "release";
+console.log("env", env);
+isDevelopment = env === "develop" || env === "trial";
+// #endif
+
+export const domain = isDevelopment ? "dev.kuaiyuman.cn" : "www.kuaiyuman.cn";
+export const host = `https://${domain}/api`;

+ 1 - 1
src/utils/http.ts

@@ -79,7 +79,7 @@ class Http {
               uni.reLaunch({
                 url: "/pages/map/map",
               });
-            }, 1000);
+            }, 1500);
             throw {
               errMsg: "请重新登录",
             };