songzhen 1 bulan lalu
induk
melakukan
2fba1da394

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
     "nuxt-swiper": "^2.0.0",
     "pinia": "^2.2.2",
     "vue": "latest",
+    "vue-clipboard3": "^2.0.0",
     "vue-cropper": "^1.1.4",
     "vue-draggable-plus": "^0.6.0",
     "vue-router": "latest",

+ 41 - 0
pnpm-lock.yaml

@@ -41,6 +41,9 @@ importers:
       vue:
         specifier: latest
         version: 3.5.10
+      vue-clipboard3:
+        specifier: ^2.0.0
+        version: 2.0.0
       vue-cropper:
         specifier: ^1.1.4
         version: 1.1.4
@@ -1530,6 +1533,9 @@ packages:
   clear@0.1.0:
     resolution: {integrity: sha512-qMjRnoL+JDPJHeLePZJuao6+8orzHMGP04A8CdwCNsKhRbOnKRjefxONR7bwILT3MHecxKBjHkKL/tkZ8r4Uzw==}
 
+  clipboard@2.0.11:
+    resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==}
+
   clipboardy@4.0.0:
     resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==}
     engines: {node: '>=18'}
@@ -1768,6 +1774,9 @@ packages:
   defu@6.1.4:
     resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
 
+  delegate@3.2.0:
+    resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==}
+
   delegates@1.0.0:
     resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
 
@@ -2060,6 +2069,9 @@ packages:
     resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==}
     engines: {node: '>=18'}
 
+  good-listener@1.2.2:
+    resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==}
+
   graceful-fs@4.2.11:
     resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
 
@@ -3106,6 +3118,9 @@ packages:
   scule@1.3.0:
     resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==}
 
+  select@1.1.2:
+    resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==}
+
   semver@6.3.1:
     resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
     hasBin: true
@@ -3319,6 +3334,9 @@ packages:
     resolution: {integrity: sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==}
     engines: {node: '>=12.22'}
 
+  tiny-emitter@2.1.0:
+    resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
+
   tiny-invariant@1.3.3:
     resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
 
@@ -3618,6 +3636,9 @@ packages:
   vue-bundle-renderer@2.1.1:
     resolution: {integrity: sha512-+qALLI5cQncuetYOXp4yScwYvqh8c6SMXee3B+M7oTZxOgtESP0l4j/fXdEJoZ+EdMxkGWIj+aSEyjXkOdmd7g==}
 
+  vue-clipboard3@2.0.0:
+    resolution: {integrity: sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==}
+
   vue-cropper@1.1.4:
     resolution: {integrity: sha512-5m98vBsCEI9rbS4JxELxXidtAui3qNyTHLHg67Qbn7g8cg+E6LcnC+hh3SM/p94x6mFh6KRxT1ttnta+wCYqWA==}
 
@@ -5389,6 +5410,12 @@ snapshots:
 
   clear@0.1.0: {}
 
+  clipboard@2.0.11:
+    dependencies:
+      good-listener: 1.2.2
+      select: 1.1.2
+      tiny-emitter: 2.1.0
+
   clipboardy@4.0.0:
     dependencies:
       execa: 8.0.1
@@ -5601,6 +5628,8 @@ snapshots:
 
   defu@6.1.4: {}
 
+  delegate@3.2.0: {}
+
   delegates@1.0.0: {}
 
   denque@2.1.0: {}
@@ -5951,6 +5980,10 @@ snapshots:
       slash: 5.1.0
       unicorn-magic: 0.1.0
 
+  good-listener@1.2.2:
+    dependencies:
+      delegate: 3.2.0
+
   graceful-fs@4.2.11: {}
 
   gzip-size@7.0.0:
@@ -7066,6 +7099,8 @@ snapshots:
 
   scule@1.3.0: {}
 
+  select@1.1.2: {}
+
   semver@6.3.1: {}
 
   semver@7.6.3: {}
@@ -7321,6 +7356,8 @@ snapshots:
 
   throttle-debounce@5.0.0: {}
 
+  tiny-emitter@2.1.0: {}
+
   tiny-invariant@1.3.3: {}
 
   tinyglobby@0.2.6:
@@ -7655,6 +7692,10 @@ snapshots:
     dependencies:
       ufo: 1.5.4
 
+  vue-clipboard3@2.0.0:
+    dependencies:
+      clipboard: 2.0.11
+
   vue-cropper@1.1.4: {}
 
   vue-demi@0.14.10(vue@3.5.10):

+ 9 - 16
src/components/Profile/TravelOrders/ShareModal/index.vue

@@ -51,8 +51,7 @@
 </template>
 
 <script setup>
-import { useClipboard } from "@vueuse/core";
-import { usePermission } from "@vueuse/core";
+import useClipboard from "vue-clipboard3";
 
 const show = defineModel("show", false);
 
@@ -103,21 +102,15 @@ const userId = computed(() => userInfo.value?.userId ?? "");
 const shareUrl = computed(() => {
   return `${import.meta.env.VITE_APP_WEBSITE_BASE_URL}/t/${props.projectId}?pinTuanId=${props.pinTuanId}&fromUserId=${userId.value}`;
 });
-const { copy } = useClipboard({ shareUrl });
 
-function handleCopy() {
-  // const clipboardRead = usePermission("clipboard-read");
-  // console.log(clipboardRead);
-  // copy(shareUrl.value);
-  // showToast("复制成功");
-  navigator.clipboard.writeText(shareUrl.value).then(
-    () => {
-      showToast("复制成功");
-    },
-    (err) => {
-      showToast("复制失败");
-    }
-  );
+const { toClipboard } = useClipboard();
+async function handleCopy() {
+  try {
+    await toClipboard(shareUrl.value);
+    showToast("复制成功");
+  } catch (e) {
+    showToast("复制失败");
+  }
 }
 </script>
 

+ 9 - 6
src/components/TravelProjectDetail/PinTuan/ResultModal.vue

@@ -60,7 +60,7 @@
 </template>
 
 <script setup>
-import { useClipboard } from "@vueuse/core";
+import useClipboard from "vue-clipboard3";
 
 const show = defineModel("show", false);
 
@@ -78,11 +78,14 @@ const userId = computed(() => userInfo.value?.userId ?? "");
 const shareUrl = computed(() => {
   return `${import.meta.env.VITE_APP_WEBSITE_BASE_URL}/t/${props.pinTuanInfo.projectId}?pinTuanId=${props.pinTuanInfo.id}&fromUserId=${userId.value}`;
 });
-const { copy } = useClipboard({ shareUrl });
-
-function handleCopy() {
-  copy(shareUrl.value);
-  showToast("复制成功");
+const { toClipboard } = useClipboard();
+async function handleCopy() {
+  try {
+    await toClipboard(shareUrl.value);
+    showToast("复制成功");
+  } catch (e) {
+    showToast("复制失败");
+  }
 }
 </script>
 

+ 1 - 1
src/pages/car/submit-order.client.vue

@@ -97,7 +97,7 @@
       class="fixed bottom-0 left-0 right-0 shadow-[0px_3px_12px_1px_rgba(0,0,0,0.11);] bg-white h-60 text-base font-semibold flex items-center px-30"
     >
       <span class="">订单金额:</span>
-      <span class="text-[#FF1D1D]">{{ orderPrice }}</span>
+      <span class="text-[#FF1D1D]">{{ carInfo.unit }}{{ orderPrice }}</span>
       <van-button
         class="flex-1"
         style="font-size: 16px; margin-left: 50px"