Просмотр исходного кода

Merge branch 'dev5.8.1' of Software/android-cloud-H5 into master

guocanfeng 1 год назад
Родитель
Сommit
055cc16a3b

+ 2 - 0
.env.production

@@ -27,3 +27,5 @@ QIYUKF_TEMPLATE_ID = "6635862"
 
 IMG_URL = "https://www.androidscloud.com:9001/cloud/picture/assist"
 
+H5_URL = "https://client.phone.androidscloud.com"
+

+ 2 - 0
.env.test

@@ -26,3 +26,5 @@ SZX_APP_ANDROID_SCHEME = "opengeminiapp"
 QIYUKF_TEMPLATE_ID = "6635862"
 
 IMG_URL = "http://gntest.phone.androidscloud.com:9002/cloud/picture/assist"
+
+H5_URL = "http://gntest.phone.androidscloud.com:1280"

+ 3 - 0
.env.uat

@@ -27,3 +27,6 @@ SZX_APP_ANDROID_SCHEME = "opengeminiapp"
 QIYUKF_TEMPLATE_ID = "6635862"
 
 IMG_URL = "https://gntest.phone.androidscloud.com:9001/clouduat/picture/assist"
+
+H5_URL = "https://prese.phone.androidscloud.com"
+

BIN
assets/image/claimCloudPhone/Invitee-to-claim.png


BIN
assets/image/claimCloudPhone/first-reward-2.png


BIN
assets/image/claimCloudPhone/first-reward-3.png


BIN
assets/image/claimCloudPhone/first-reward-container-privilege.png


BIN
assets/image/claimCloudPhone/first-reward-img.png


BIN
assets/image/claimCloudPhone/purchase-img.png


BIN
assets/image/claimCloudPhone/second-reward-img.png


+ 8 - 0
nuxt.config.js

@@ -17,6 +17,7 @@ dotenv.config({
 });
 
 export default {
+  target: 'static',
   // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
   ssr: false,
   // Global page headers: https://go.nuxtjs.dev/config-head
@@ -273,6 +274,13 @@ export default {
   router: {
     base: '/h5/',
     middleware: ['auth'],
+    extendRoutes(routes, resolve) {
+      routes.push({
+        name: 'claim-cloud-phone',
+        path: '/claimCloudPhone/:id',
+        component: resolve(__dirname, 'pages/claimCloudPhone/_type.vue')
+      });
+    }
   },
   styleResources: {
     scss: ['~/assets/style/variables.scss'],

+ 13 - 8
pages/claimCloudPhone/components/bargainingAssistance.vue

@@ -746,17 +746,19 @@ export default {
                   if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
                     this.$native.share(shareInfo);
                   } else {
-                    writeToClipboard(res.data.link)
-                      .then(() => {
+                    writeToClipboard(
+                      res.data.link,
+                      () => {
                         setTimeout(() => {
                           this.$toast('链接复制成功');
                         });
-                      })
-                      .catch((err) => {
+                      },
+                      () => {
                         setTimeout(() => {
                           this.$toast('链接复制失败');
                         });
-                      });
+                      },
+                    );
                   }
                 }
               })
@@ -1253,6 +1255,9 @@ export default {
             font-size: 14px;
             color: #6d2b12;
             text-align: center;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
             font-style: normal;
           }
         }
@@ -1437,12 +1442,12 @@ export default {
       width: 284px;
       z-index: -1;
     }
-    .exit-glory{
+    .exit-glory {
       position: absolute;
       top: 50%;
       left: 50%;
       transform: translate(-50%, -50%) scale(1.5);
-      z-index: -2
+      z-index: -2;
     }
     .exit-content {
       position: absolute;
@@ -1681,7 +1686,7 @@ export default {
   margin-bottom: 24px !important;
 }
 
-.mask{
+.mask {
   z-index: 4000;
 }
 </style>

+ 2 - 2
pages/claimCloudPhone/confirmation.vue

@@ -64,6 +64,7 @@ export default {
       },
       currentStatus: '',
       index: 1,
+      H5_URL: process.env.H5_URL,
     };
   },
   mounted() {
@@ -118,8 +119,7 @@ export default {
         : 'https://www.androidscloud.com';
     },
     toH5() {
-      location.href =
-        'http://gntest.phone.androidscloud.com:1280/cloud/phone/web/#/';
+      location.href = this.H5_URL + '/cloud/phone/web/#/';
     },
   },
 };

+ 3 - 3
pages/claimCloudPhone/purchase.vue

@@ -11,11 +11,11 @@
           <img src="@/assets/image/claimCloudPhone/privilege-1.png" alt="" />
           应用预装已完成
         </div>
-        <div style="animation-delay: 1s">
+        <div style="animation-delay: 0.3s">
           <img src="@/assets/image/claimCloudPhone/privilege-2.png" alt="" />
           任意下单
         </div>
-        <div style="animation-delay: 1.5s">
+        <div style="animation-delay: 0.6s">
           <img src="@/assets/image/claimCloudPhone/privilege-3.png" alt="" />
           立即使用云机
         </div>
@@ -315,7 +315,7 @@ export default {
     justify-content: space-between;
     & > div {
       opacity: 0;
-      animation: purchase 0.5s forwards linear;
+      animation: purchase 0.3s forwards linear;
       text-align: center;
       font-family: PingFangSC, PingFang SC;
       font-weight: 400;

+ 11 - 5
plugins/plugins.js

@@ -17,16 +17,21 @@ export function timeStamp(StatusMinute, userCardType, nextSendTime) {
 
 
 // 封装对剪贴板的访问为异步函数
-export async function writeToClipboard(text) {
+export function writeToClipboard(text, success = () => { }, error = () => { }) {
     // 如果navigator.clipboard存在,直接使用复制功能
     if (navigator.clipboard) {
         try {
-            await navigator.clipboard.writeText(text);
+            setTimeout(() => {
+                navigator.clipboard.writeText(text).then(() => {
+                    success()
+                }).catch(() => {
+                    error()
+                })
+            }, 0);
         } catch (err) {
-            throw err
+            error()
         }
     } else {
-        // 否则使用传统的document.execCommand('copy')方法
         const textArea = document.createElement('textarea');
         textArea.value = text;
         document.body.appendChild(textArea);
@@ -34,11 +39,12 @@ export async function writeToClipboard(text) {
         try {
             const successful = document.execCommand('copy');
             if (successful) {
+                success()
             } else {
                 throw '复制失败'
             }
         } catch (err) {
-            throw err
+            error()
         }
         document.body.removeChild(textArea);
     }