|
|
@@ -156,10 +156,13 @@
|
|
|
class="bg-surface border border-white/10 rounded-2xl p-6 w-full max-w-sm mx-4 text-center"
|
|
|
>
|
|
|
<h3 class="text-lg font-semibold text-white/90 mb-2">确认购买</h3>
|
|
|
- <p class="text-sm text-white/70 mb-6">
|
|
|
+ <p class="text-sm text-white/70 mb-4">
|
|
|
确定要购买当前视频吗?<br />
|
|
|
购买后即可观看完整内容
|
|
|
</p>
|
|
|
+ <div class="text-lg font-semibold text-brand mb-6">
|
|
|
+ ¥{{ priceStore.getSinglePrice() }}
|
|
|
+ </div>
|
|
|
|
|
|
<div class="space-y-3">
|
|
|
<button
|
|
|
@@ -607,6 +610,7 @@ import {
|
|
|
} from "@/services/api";
|
|
|
import VideoProcessor from "@/components/VideoProcessor.vue";
|
|
|
import { useUserStore } from "@/store/user";
|
|
|
+import { usePriceStore } from "@/store/price";
|
|
|
import { VipLevel, canWatchFullVideo, getTrialDuration } from "@/types/vip";
|
|
|
|
|
|
// 路由相关
|
|
|
@@ -615,6 +619,7 @@ const router = useRouter();
|
|
|
|
|
|
// 用户状态
|
|
|
const userStore = useUserStore();
|
|
|
+const priceStore = usePriceStore();
|
|
|
|
|
|
// 视频播放器引用(现在由 VideoProcessor 组件管理)
|
|
|
const videoPlayer = ref<HTMLVideoElement>();
|
|
|
@@ -646,16 +651,8 @@ const isTrialMode = ref(false);
|
|
|
// 单片购买状态
|
|
|
const isSinglePurchased = ref(false);
|
|
|
|
|
|
-// 会员购买相关
|
|
|
-const membershipPlans = [
|
|
|
- { key: "hourly", label: "一小时", price: "1", duration: "1小时" },
|
|
|
- { key: "daily", label: "一天", price: "10", duration: "1天" },
|
|
|
- { key: "weekly", label: "一周", price: "60", duration: "7天" },
|
|
|
- { key: "monthly", label: "一个月", price: "200", duration: "30天" },
|
|
|
- { key: "quarterly", label: "三个月", price: "500", duration: "90天" },
|
|
|
- { key: "yearly", label: "一年", price: "1000", duration: "365天" },
|
|
|
- { key: "lifetime", label: "终身", price: "1500", duration: "永久" },
|
|
|
-];
|
|
|
+// 使用动态价格配置
|
|
|
+const membershipPlans = computed(() => priceStore.getMembershipPlans);
|
|
|
|
|
|
const selectedPlan = ref("");
|
|
|
const selectedPayment = ref("alipay");
|
|
|
@@ -1170,6 +1167,10 @@ watch(
|
|
|
|
|
|
onMounted(async () => {
|
|
|
// 路由监听器已经在处理所有情况,这里不需要额外逻辑
|
|
|
+ // 加载价格配置
|
|
|
+ if (!priceStore.isPriceConfigLoaded) {
|
|
|
+ await priceStore.fetchPriceConfig();
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|