Selaa lähdekoodia

bugfix:修复已知bug

leo 1 vuosi sitten
vanhempi
commit
2b142f4376

+ 0 - 7
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -750,13 +750,6 @@ export default {
                   if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
                     this.$native.share(shareInfo);
                   } else {
-                    if (this.$userAgent.isIos && !this.$userAgent.isWx) {
-                      await this.$native.clipboard.writeText(res.data.link);
-                      setTimeout(() => {
-                        this.$toast.success('链接复制成功');
-                      });
-                      return;
-                    }
                     writeToClipboard(res.data.link)
                       .then(() => {
                         setTimeout(() => {

+ 1 - 0
pages/claimCloudPhone/secondReward.vue

@@ -85,6 +85,7 @@ export default {
       this.imgName = name;
     },
     toPurchase() {
+      if(!this.imgName) return 
       // 埋点
       this.$axios
         .$post('public/v5/User/selects/addApplication', {

+ 3 - 5
plugins/plugins.js

@@ -22,9 +22,8 @@ export async function writeToClipboard(text) {
     if (navigator.clipboard) {
         try {
             await navigator.clipboard.writeText(text);
-            console.log('复制成功');
         } catch (err) {
-            console.error('复制失败', err);
+            throw err
         }
     } else {
         // 否则使用传统的document.execCommand('copy')方法
@@ -35,12 +34,11 @@ export async function writeToClipboard(text) {
         try {
             const successful = document.execCommand('copy');
             if (successful) {
-                console.log('复制成功');
             } else {
-                console.log('复制失败');
+                throw '复制失败'
             }
         } catch (err) {
-            console.error('复制失败', err);
+            throw err
         }
         document.body.removeChild(textArea);
     }