Ver Fonte

Merge remote-tracking branch 'origin/origin/main' into origin/main

# Conflicts:
#	src/pages/map/map.vue
zuypeng há 4 meses atrás
pai
commit
551f58ea94

+ 2 - 1
src/pages-charge/appointment/appointment.vue

@@ -5,7 +5,7 @@
         <view class="station">
           <ChargeMachine
               :title="'NO.' + equipment.shortId"
-              :list="station.connectInfoList"
+              :list="[equipment]"
               :time="priceInfo.useTime"
               :parkingNo="equipment.parkingNo"
           ></ChargeMachine>
@@ -859,6 +859,7 @@ onLoad((_options: any) => {
   fetchStationDetailByShortIdOrConnectorIdOrEquipmentId(sn, connectorId, equipmentId)
       .then((res) => {
         console.log("1111111111", res);
+        //充电桩需要再次过滤
         stationId.value = res.stationId;
         fetchUserStationDefaultRightsAndCoupon();
         if (sn) {

+ 24 - 4
src/pages-charge/camera/camera.vue

@@ -125,10 +125,10 @@ const handleReady = () => {
 };
 
 const handleScancode = (e: any) => {
-  uni.vibrateShort({});
-  if (e.detail && e.detail.result) {
-    deCode(e.detail.result);
-  }
+    uni.vibrateShort({});
+    if (e.detail && e.detail.result) {
+      deCode(e.detail.result);
+    }
 };
 
 const handleError = (e: any) => {
@@ -156,6 +156,26 @@ const toggleFlash = () => {
 };
 
 const chooseImage = () => {
+  // #ifdef MP-WEIXIN
+  wx.scanCode({
+    onlyFromCamera:false,
+    scanType:['qrcode','barcode'],
+    success: (res1) => {
+      console.log("scanCode",res1);
+      deCode(res1.result);
+    },
+    fail: (err) => {
+      console.error("scanCode",err);
+      uni.hideLoading();
+      uni.showModal({
+        content: err.errMsg || "出现错误,请重试",
+      });
+    }
+  })
+  // #endif
+}
+
+const chooseImage1 = () => {
   uni.chooseImage({
     count: 1,
     sizeType: ["compressed"],

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

@@ -29,7 +29,11 @@
 </template>
 
 <script setup lang="ts">
-import {fetchStationByConnectorIdOrShortId, fetchStationDetailByConnectorId} from "@/api/charge";
+import {
+  fetchStationByConnectorIdOrShortId,
+  fetchStationDetailByConnectorId,
+  fetchStationDetailByShortId
+} from "@/api/charge";
 import { ref } from "vue";
 import { scanCode } from "../../utils/code";
 import { to } from "../../utils/navigate";
@@ -48,10 +52,10 @@ const submit = () => {
   uni.showLoading({
     title: "加载中",
   });
-  fetchStationDetailByConnectorId(value.value)
+  fetchStationDetailByShortId(value.value)
     .then(() => {
       uni.hideLoading();
-      to(`/pages-charge/appointment/appointment?connectorId=${value.value}`);
+      to(`/pages-charge/appointment/appointment?sn=${value.value}`);
     })
     .catch((err) => {
       value.value = ''

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

@@ -43,7 +43,7 @@
     </view>
     <view class="ml-auto" v-if="price">
       <view
-        class="lh-32 color-warning"
+        class="lh-32 color-warning  flex-end "
         style="text-align: right; margin-top: -8rpx"
       >
         <text class="fs-22 mr-4">¥</text>

+ 4 - 4
src/pages/map/map.vue

@@ -277,15 +277,15 @@ const defaulDistance = 3;
 const defaultScale = 12;
 const pointSize = {
   width: 30,
-  height: 52,
+  height: 55,
   fontSize: 7,
   iconPath: "/static/images/map-point.png",
   currentWidth: 42,
   currentHeight: 72,
   currentFontSize: 10,
   currentIconPath: "/static/images/map-point-current.png",
-  androidX: -14,
-  androidCurrentX: -50,
+  androidX:-4,
+  androidCurrentX: -7,
 };
 import { fetchHomeBanner } from "@/api";
 import { deCode } from "../../utils/code";
@@ -463,7 +463,7 @@ const refreshStation = (location: any) => {
           anchorY: -(
             (index === _markersIndex
               ? pointSize.currentHeight
-              : pointSize.height) - 3
+              : pointSize.height- 3)
           ),
         },
       };

+ 4 - 2
src/utils/code.ts

@@ -25,9 +25,11 @@ export function deCode(url: string) {
       url: `/pages-charge/appointment/appointment?sn=${sn}`,
     });
   } else {
-    uni.showModal({
-      content: "输扫描正确的二维码",
+    uni.showToast({
+        icon: "none",
+      title: "请扫描正确的二维码",
       showCancel: false,
+        duration:1000
     });
   }
 }