Ver código fonte

修复安卓地图中标点展示异常的问题;修复站点金额样式未对齐的问题;调整手机相册选择二维码逻辑

zuy 5 meses atrás
pai
commit
c251fda5b2

+ 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"],

+ 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>

+ 5 - 5
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:1,
+  androidCurrentX: 1,
 };
 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)
           ),
         },
       };
@@ -723,7 +723,7 @@ const _changeMarker = (current: number) => {
   _markers[markersIndex.value].width = pointSize.width;
   _markers[markersIndex.value].height = pointSize.height;
   _markers[markersIndex.value].label.fontSize = pointSize.fontSize;
-  _markers[markersIndex.value].label.anchorY = -(pointSize.height - 3);
+  _markers[markersIndex.value].label.anchorY = -(pointSize.height-3);
   if (!isIOS) {
     _markers[markersIndex.value].label.anchorX = pointSize.androidX;
   }

+ 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
     });
   }
 }