|
|
@@ -40,6 +40,7 @@ export const usePriceStore = defineStore("price", () => {
|
|
|
yearly: "0",
|
|
|
lifetime: "0",
|
|
|
single: "0",
|
|
|
+ preview_duration: "30",
|
|
|
};
|
|
|
|
|
|
response.forEach((item) => {
|
|
|
@@ -67,6 +68,12 @@ export const usePriceStore = defineStore("price", () => {
|
|
|
return getPrice("single");
|
|
|
};
|
|
|
|
|
|
+ // 获取试看时长(秒)
|
|
|
+ const getPreviewDuration = (): number => {
|
|
|
+ const duration = getPrice("preview_duration");
|
|
|
+ return parseInt(duration) || 30; // 默认30秒
|
|
|
+ };
|
|
|
+
|
|
|
// 获取会员套餐列表
|
|
|
const getMembershipPlans = computed((): MembershipPlan[] => {
|
|
|
if (!priceConfig.value) return [];
|
|
|
@@ -99,6 +106,7 @@ export const usePriceStore = defineStore("price", () => {
|
|
|
fetchPriceConfig,
|
|
|
getPrice,
|
|
|
getSinglePrice,
|
|
|
+ getPreviewDuration,
|
|
|
getMembershipPlans,
|
|
|
isPriceConfigLoaded,
|
|
|
};
|