Selaa lähdekoodia

修复ios夸克支付弹窗的问题。

wilhelm wong 2 kuukautta sitten
vanhempi
commit
7cfdb09b58
2 muutettua tiedostoa jossa 79 lisäystä ja 3 poistoa
  1. 1 1
      dev-dist/sw.js
  2. 78 2
      src/views/VideoPlayer.vue

+ 1 - 1
dev-dist/sw.js

@@ -79,7 +79,7 @@ define(['./workbox-f2cb1a81'], (function (workbox) { 'use strict';
    */
   workbox.precacheAndRoute([{
     "url": "index.html",
-    "revision": "0.qsae4lcskhg"
+    "revision": "0.ur6unbqg22"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 78 - 2
src/views/VideoPlayer.vue

@@ -73,13 +73,13 @@
         <!-- 只有非游客用户才显示购买会员按钮 -->
         <button
           v-if="!isGuest"
-          @click="showMembershipPurchaseModal = true"
+          @click="handleMembershipClick"
           class="px-2 py-1 rounded-md bg-brand text-slate-900 text-xs font-medium hover:bg-brand/90 transition whitespace-nowrap min-w-fit"
         >
           开通会员
         </button>
         <button
-          @click="showSinglePurchaseModal = true"
+          @click="handleSinglePurchaseClick"
           class="px-3 py-2 rounded-lg bg-blue-500 text-white text-sm font-semibold hover:bg-blue-600 transition shadow-lg hover:shadow-xl flash-animation glow-animation hover:animate-none whitespace-nowrap min-w-fit"
         >
           单片购买
@@ -684,15 +684,41 @@ const errorMessage = ref("");
 const showSinglePaymentWaitingDialog = ref(false);
 const singleCurrentOrderNo = ref("");
 
+// 检测是否为夸克浏览器
+const isQuarkBrowser = () => {
+  const ua = navigator.userAgent.toLowerCase();
+  return ua.includes('quark');
+};
+
 // 显示成功/错误提示的函数
 const showSuccess = (message: string) => {
   successMessage.value = message;
   showSuccessDialog.value = true;
+  
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
 };
 
 const showError = (message: string) => {
   errorMessage.value = message;
   showErrorDialog.value = true;
+  
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
 };
 
 // 生成设备标识
@@ -867,12 +893,52 @@ const startTrial = () => {
   isTrialMode.value = true;
 };
 
+// 处理顶部会员购买按钮点击
+const handleMembershipClick = () => {
+  showMembershipPurchaseModal.value = true;
+  
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
+};
+
+// 处理顶部单片购买按钮点击
+const handleSinglePurchaseClick = () => {
+  showSinglePurchaseModal.value = true;
+  
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
+};
+
 // 购买会员
 const purchaseMembership = () => {
   // 关闭试看结束弹窗
   showTrialEndModal.value = false;
   // 打开会员购买弹窗
   showMembershipPurchaseModal.value = true;
+  
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
 };
 
 // 处理会员购买
@@ -974,6 +1040,16 @@ const handleSingleQueryOrder = async () => {
 
 // 单独购买本片
 const purchaseVideo = async () => {
+  // 夸克浏览器自动滚动到底部
+  if (isQuarkBrowser()) {
+    setTimeout(() => {
+      window.scrollTo({
+        top: document.documentElement.scrollHeight,
+        behavior: 'smooth'
+      });
+    }, 100);
+  }
+  
   try {
     // 使用视频信息的真实ID
     if (!videoInfo.value.id || videoInfo.value.id === "unknown") {