Jelajahi Sumber

feat: 优化

shuisheng 3 tahun lalu
induk
melakukan
f04d31500f
2 mengubah file dengan 13 tambahan dan 3 penghapusan
  1. 8 3
      src/layout/head/index.vue
  2. 5 0
      src/views/sponsors/index.vue

+ 8 - 3
src/layout/head/index.vue

@@ -49,7 +49,7 @@
         href="https://github.com/galaxy-s10/billd-live"
       >
         <img
-          src="https://img.shields.io/github/stars/galaxy-s10/billd-live?label=Star&logo=GitHub&labelColor=white&logoColor=black&style=social&cacheSeconds=3600"
+          :src="githubStar"
           alt=""
         />
       </a>
@@ -89,13 +89,13 @@
 
 <script lang="ts" setup>
 import { openToTarget } from 'billd-utils';
-import { ref } from 'vue';
+import { onMounted, ref } from 'vue';
 import { useRouter } from 'vue-router';
 
 import { routerName } from '@/router';
 
 const router = useRouter();
-
+const githubStar = ref('');
 const pushList = ref([
   { title: 'Webrtc Push', routerName: routerName.webrtcPush },
   { title: 'SRS WebRTC Push', routerName: routerName.srsWebRtcPush },
@@ -106,6 +106,11 @@ const pullList = ref([
   { title: 'SRS WebRTC Pull', routerName: routerName.srsWebRtcPull },
 ]);
 
+onMounted(() => {
+  githubStar.value =
+    'https://img.shields.io/github/stars/galaxy-s10/billd-live?label=Star&logo=GitHub&labelColor=white&logoColor=black&style=social&cacheSeconds=3600';
+});
+
 function goPushPage(routerName: string) {
   const url = router.resolve({ name: routerName });
   openToTarget(url.href);

+ 5 - 0
src/views/sponsors/index.vue

@@ -75,6 +75,7 @@
 </template>
 
 <script lang="ts" setup>
+import { hrefToTarget, isMobile } from 'billd-utils';
 import QRCode from 'qrcode';
 import { onMounted, onUnmounted, ref } from 'vue';
 
@@ -231,6 +232,10 @@ async function startPay(item) {
       body: item.body,
     });
     if (res.code === 200) {
+      if (isMobile()) {
+        hrefToTarget(res.data.qr_code);
+        return;
+      }
       const base64 = await generateQR(res.data.qr_code);
       aliPayBase64.value = base64;
       getPayStatus(res.data.out_trade_no);