|
|
@ -1,6 +1,6 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { CloseOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons-vue' |
|
|
|
import { CloseOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons-vue' |
|
|
|
import { Button, Carousel, Modal, QRCode, message } from 'ant-design-vue' |
|
|
|
import { Button, Carousel, Modal, QRCode, Spin, message } from 'ant-design-vue' |
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
import type { GoodsData, Racharge } from './index.d' |
|
|
|
import type { GoodsData, Racharge } from './index.d' |
|
|
|
import { getIsPay, goodsList, goodsType, payment } from '@/api/recharge/index' |
|
|
|
import { getIsPay, goodsList, goodsType, payment } from '@/api/recharge/index' |
|
|
@ -13,6 +13,7 @@ import { RechargeEnum } from '@/enums/recharge' |
|
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
const userStore = useUserStore() |
|
|
|
const rechargeStore = useRechargeStore() |
|
|
|
const rechargeStore = useRechargeStore() |
|
|
|
|
|
|
|
const currentIndex = ref(3) |
|
|
|
// 轮播的ref |
|
|
|
// 轮播的ref |
|
|
|
const carouselRef = ref() |
|
|
|
const carouselRef = ref() |
|
|
|
// 选项卡索引 |
|
|
|
// 选项卡索引 |
|
|
@ -23,6 +24,8 @@ const qrshow = ref<boolean>(false) |
|
|
|
const tabs = ref<Racharge[]>([]) |
|
|
|
const tabs = ref<Racharge[]>([]) |
|
|
|
// 套餐列表 |
|
|
|
// 套餐列表 |
|
|
|
const goodslists = ref<GoodsData[]>([]) |
|
|
|
const goodslists = ref<GoodsData[]>([]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isDataLoaded = ref(false) |
|
|
|
// 支付路径 |
|
|
|
// 支付路径 |
|
|
|
const payData = ref<any>({ |
|
|
|
const payData = ref<any>({ |
|
|
|
orderCode: '', |
|
|
|
orderCode: '', |
|
|
@ -40,14 +43,19 @@ function getType() { |
|
|
|
|
|
|
|
|
|
|
|
// 套餐列表 |
|
|
|
// 套餐列表 |
|
|
|
function getgoodsList(type: string) { |
|
|
|
function getgoodsList(type: string) { |
|
|
|
|
|
|
|
isDataLoaded.value = true |
|
|
|
goodsList({ type }).then((res) => { |
|
|
|
goodsList({ type }).then((res) => { |
|
|
|
goodslists.value = res |
|
|
|
goodslists.value = res |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
isDataLoaded.value = false |
|
|
|
|
|
|
|
}, 300) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选择选项卡 |
|
|
|
// 选择选项卡 |
|
|
|
function selectTab(index: number, key: string) { |
|
|
|
function selectTab(index: number, key: string) { |
|
|
|
activeTab.value = index |
|
|
|
activeTab.value = index |
|
|
|
|
|
|
|
currentIndex.value = 3 |
|
|
|
getgoodsList(key) |
|
|
|
getgoodsList(key) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -78,7 +86,6 @@ function stopPolling() { |
|
|
|
clearInterval(intervalId.value) |
|
|
|
clearInterval(intervalId.value) |
|
|
|
intervalId.value = null |
|
|
|
intervalId.value = null |
|
|
|
qrshow.value = false |
|
|
|
qrshow.value = false |
|
|
|
|
|
|
|
|
|
|
|
userStore.getChatInfoFun() |
|
|
|
userStore.getChatInfoFun() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -111,11 +118,17 @@ function tabClass(index: number) { |
|
|
|
|
|
|
|
|
|
|
|
// 走马灯向上 |
|
|
|
// 走马灯向上 |
|
|
|
function onPrevClick() { |
|
|
|
function onPrevClick() { |
|
|
|
carouselRef.value.prev() |
|
|
|
if (currentIndex.value > 3) { |
|
|
|
|
|
|
|
currentIndex.value-- |
|
|
|
|
|
|
|
carouselRef.value.prev() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 走马灯向下 |
|
|
|
// 走马灯向下 |
|
|
|
function onNextClick() { |
|
|
|
function onNextClick() { |
|
|
|
carouselRef.value.next() |
|
|
|
if (currentIndex.value < goodslists.value.length) { |
|
|
|
|
|
|
|
currentIndex.value++ |
|
|
|
|
|
|
|
carouselRef.value.next() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 数字分隔符 |
|
|
|
// 数字分隔符 |
|
|
@ -150,89 +163,92 @@ function separator(num: number | string) { |
|
|
|
<div v-show="goodslists.length > 3" class="prev-button prev" @click="onPrevClick"> |
|
|
|
<div v-show="goodslists.length > 3" class="prev-button prev" @click="onPrevClick"> |
|
|
|
<LeftOutlined /> |
|
|
|
<LeftOutlined /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Carousel ref="carouselRef" arrows :dots="false" :autoplay="false" :slides-to-show="goodslists.length > 3 ? 3 : goodslists.length" :slides-to-scroll="1"> |
|
|
|
<Spin :spinning="isDataLoaded"> |
|
|
|
<div v-for="(item, index) in goodslists" :key="index" class="carouse-box"> |
|
|
|
<Carousel :key="activeTab" ref="carouselRef" arrows :dots="false" :infinite="false" :autoplay="false" :slides-to-show="goodslists.length > 3 ? 3 : goodslists.length" :slides-to-scroll="1"> |
|
|
|
<div class="carouse-item"> |
|
|
|
<div v-for="(item, index) in goodslists" :key="index" class="carouse-box"> |
|
|
|
<div class="dotnumbox"> |
|
|
|
<div class="carouse-item"> |
|
|
|
<div class="dotnum"> |
|
|
|
<div class="dotnumbox"> |
|
|
|
{{ item.giveNum }}点数 |
|
|
|
<div class="dotnum"> |
|
|
|
</div> |
|
|
|
{{ item.giveNum }}点数 |
|
|
|
<div class="discount"> |
|
|
|
|
|
|
|
限时折扣 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="deadline"> |
|
|
|
|
|
|
|
{{ item.title }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="equitiesbox"> |
|
|
|
|
|
|
|
<div class="equities"> |
|
|
|
|
|
|
|
<div class="left"> |
|
|
|
|
|
|
|
GPT3.5版本 |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<div class="discount"> |
|
|
|
{{ item.gpt35Num }}条 |
|
|
|
限时折扣 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="deadline"> |
|
|
|
|
|
|
|
{{ item.title }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="equitiesbox"> |
|
|
|
|
|
|
|
<div class="equities"> |
|
|
|
|
|
|
|
<div class="left"> |
|
|
|
|
|
|
|
GPT3.5版本 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
|
|
|
|
{{ item.gpt35Num }}条 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="equities"> |
|
|
|
<div class="equities"> |
|
|
|
<div class="left"> |
|
|
|
<div class="left"> |
|
|
|
GPT4.0版本 |
|
|
|
GPT4.0版本 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
|
|
|
|
{{ item.gpt40Num }}条 |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<div class="equities"> |
|
|
|
{{ item.gpt40Num }}条 |
|
|
|
<div class="left"> |
|
|
|
|
|
|
|
AI绘图 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
|
|
|
|
{{ item.pictureNum }}幅 |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="equities"> |
|
|
|
<div class="price"> |
|
|
|
<div class="left"> |
|
|
|
<div class="nowprice"> |
|
|
|
AI绘图 |
|
|
|
¥{{ item.price }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<div class="oldprice"> |
|
|
|
{{ item.pictureNum }}幅 |
|
|
|
¥{{ item.costPrice }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="payBtn"> |
|
|
|
<div class="price"> |
|
|
|
<Button class="customBtn" @click="handlePay(item.id)"> |
|
|
|
<div class="nowprice"> |
|
|
|
立即充值 |
|
|
|
¥{{ item.price }} |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="oldprice"> |
|
|
|
|
|
|
|
¥{{ item.costPrice }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="payBtn"> |
|
|
|
|
|
|
|
<Button class="customBtn" @click="handlePay(item.id)"> |
|
|
|
|
|
|
|
立即充值 |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</Carousel> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-show="goodslists.length > 3" class="next-button next" @click="onNextClick"> |
|
|
|
|
|
|
|
<RightOutlined /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Carousel> |
|
|
|
<div class="line"> |
|
|
|
<div v-show="goodslists.length > 3" class="next-button next" @click="onNextClick"> |
|
|
|
<div class="colorLine"></div> |
|
|
|
<RightOutlined /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="broadcastBox"> |
|
|
|
<div class="line"> |
|
|
|
<div class="broadcast"> |
|
|
|
<div class="colorLine"></div> |
|
|
|
<div class="trumpet"> |
|
|
|
</div> |
|
|
|
<img :src="trumpet" alt=""> |
|
|
|
<div class="broadcastBox"> |
|
|
|
</div> |
|
|
|
<div class="broadcast"> |
|
|
|
<div class="marquee"> |
|
|
|
<div class="trumpet"> |
|
|
|
<div class="content"> |
|
|
|
<img :src="trumpet" alt=""> |
|
|
|
<span>152****0062 在 2024/1/25开通了至尊礼遇卡!</span> |
|
|
|
</div> |
|
|
|
<span>178****6455 在 2024/1/24开通了年套餐!</span> |
|
|
|
<div class="marquee"> |
|
|
|
<span>151****2519 在 2024/1/23开通了日套餐!</span> |
|
|
|
<div class="content"> |
|
|
|
<span>178****0062 在 2024/1/22开通了至尊礼遇卡!</span> |
|
|
|
<span>152****0062 在 2024/1/25开通了至尊礼遇卡!</span> |
|
|
|
<span>178****6556 在 2024/1/21开通了年套餐!</span> |
|
|
|
<span>178****6455 在 2024/1/24开通了年套餐!</span> |
|
|
|
<span>131****9871 在 2024/1/20开通了日套餐!</span> |
|
|
|
<span>151****2519 在 2024/1/23开通了日套餐!</span> |
|
|
|
<span>198****2091 在 2024/1/19开通了至尊礼遇卡!</span> |
|
|
|
<span>178****0062 在 2024/1/22开通了至尊礼遇卡!</span> |
|
|
|
<span>138****4848 在 2024/1/18开通了年套餐!</span> |
|
|
|
<span>178****6556 在 2024/1/21开通了年套餐!</span> |
|
|
|
<span>195****2519 在 2024/1/17开通了日套餐!</span> |
|
|
|
<span>131****9871 在 2024/1/20开通了日套餐!</span> |
|
|
|
</div> |
|
|
|
<span>198****2091 在 2024/1/19开通了至尊礼遇卡!</span> |
|
|
|
|
|
|
|
<span>138****4848 在 2024/1/18开通了年套餐!</span> |
|
|
|
|
|
|
|
<span>195****2519 在 2024/1/17开通了日套餐!</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Spin> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="extreme-box"> |
|
|
|
<div v-else class="extreme-box"> |
|
|
|
<div class="extreme"> |
|
|
|
<div class="extreme"> |
|
|
|