Commit 09c41c2a by lijiabin

【需求 20331】 feat: 完成每日抽奖内容

parent d45e0829
...@@ -273,41 +273,60 @@ ...@@ -273,41 +273,60 @@
<h1 class="text-sm sm:text-base font-bold">每日抽奖</h1> <h1 class="text-sm sm:text-base font-bold">每日抽奖</h1>
</div> </div>
<div class="flex items-center gap-3 min-w-0"> <div
class="flex items-center gap-3 min-w-0 p-3 rounded-lg bg-white/60 border border-amber-100"
>
<el-image <el-image
class="h-20 rounded-lg" class="w-18 h-18 rounded-lg flex-shrink-0 shadow-sm"
:src="lotteryPrizesDetail.prizesImg" :src="lotteryPrizesDetail.prizesImg"
fit="cover" fit="cover"
:preview-src-list="[lotteryPrizesDetail.prizesImg]" :preview-src-list="[lotteryPrizesDetail.prizesImg]"
/> />
<div class="flex flex-col min-w-0 gap-1">
<div class="flex flex-col min-w-0"> <div class="font-semibold text-sm truncate">
<div class="font-semibold truncate mb-1"> {{ lotteryPrizesDetail.prizesName }}
奖品名称:{{ lotteryPrizesDetail.prizesName }}
</div> </div>
<div class="text-13px text-gray-500 truncate tracking-wider"> <div class="text-12px text-gray-500 flex items-center gap-1">
参与费用:{{ lotteryPrizesDetail.registrationFee }}YA币 <svg-icon name="small_coin" size="14" />
</div> <span>{{ lotteryPrizesDetail.registrationFee }} YA币</span>
<div class="text-13px text-gray-500 truncate tracking-wider">
今日参与:{{ lotteryPrizesDetail.number }}
</div> </div>
<div class="text-12px text-gray-400">今日{{ lotteryPrizesDetail.number }}人参与</div>
</div> </div>
</div> </div>
<div class="text-sm text-gray-500 my-2" v-if="lotteryPrizesDetail.winner">
恭喜昨日中奖者{{ lotteryPrizesDetail.winner }} <div v-if="lotteryPrizesDetail.winner" class="text-xs text-amber-600 mt-2 px-1 truncate">
昨日中奖:{{ lotteryPrizesDetail.winner }}
</div> </div>
<div class="flex justify-center items-center mt-3"> <div class="flex justify-center items-center mt-3">
<el-button <el-button
class="w-80%! bg-[linear-gradient(to_right,#FFD06A_0%,#FFB143_100%)] shadow-[0px_1px_8px_0_rgba(255,173,91,0.25)] border-none hover:-translate-y-1 hover:shadow-[0px_4px_10px_0_rgba(255,173,91,0.4)] hover:scale-105 active:scale-95 active:translate-y-0 transition-all duration-200 flex-1 text-xs sm:text-sm text-#333!" v-if="!lotteryPrizesDetail.isJoin"
class="w-full! border-none! transition-all duration-200 text-xs sm:text-sm bg-[linear-gradient(to_right,#FFD06A_0%,#FFB143_100%)]! text-#333! shadow-[0px_1px_8px_0_rgba(255,173,91,0.25)] hover:-translate-y-0.5 hover:shadow-[0px_4px_10px_0_rgba(255,173,91,0.4)] active:translate-y-0"
type="primary" type="primary"
@click="handleLottery" @click="handleLottery"
> >
<svg-icon name="daily_lottery" size="18" class="mr-2 mb-1" /> <svg-icon name="daily_lottery" size="18" class="mr-1" />
参与抽奖 参与抽奖
</el-button> </el-button>
<div
v-else
class="w-full text-center py-2 rounded-md bg-amber-50 border border-amber-200 border-dashed text-amber-400 text-xs sm:text-sm"
>
✓ 今日已参与
</div>
</div> </div>
</div> </div>
<!-- 大转盘 -->
<!-- <div class="lottery-container common-box rounded-lg bg-#F5F0FF">
<div class="flex items-center gap-2 mb-4">
<div class="w-1 h-4 bg-gradient-to-b from-violet-500 to-purple-500 rounded-full"></div>
<h1 class="text-sm sm:text-base font-bold">大转盘</h1>
</div>
<div class="flex justify-center">
<LuckyWheel />
</div>
</div> -->
</div> </div>
</div> </div>
...@@ -346,6 +365,7 @@ import { TABS_REF_KEY, levelListOptions } from '@/constants' ...@@ -346,6 +365,7 @@ import { TABS_REF_KEY, levelListOptions } from '@/constants'
import { useScrollTop } from '@/hooks' import { useScrollTop } from '@/hooks'
import { useQuestionStore } from '@/stores/question' import { useQuestionStore } from '@/stores/question'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
// import LuckyWheel from '@/components/common/LuckyWheel/index.vue'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
...@@ -461,6 +481,8 @@ const getLotteryPrizesDetail = async () => { ...@@ -461,6 +481,8 @@ const getLotteryPrizesDetail = async () => {
} }
// 参与抽奖 // 参与抽奖
const handleLottery = async () => { const handleLottery = async () => {
if (!lotteryPrizesDetail.value?.inRegistrationTime)
return ElMessage.error(`抽奖通道将于${lotteryPrizesDetail.value?.registrationTimeDesc}开启`)
await userJoinLottery() await userJoinLottery()
getLotteryPrizesDetail() getLotteryPrizesDetail()
refreshUserAccountData() refreshUserAccountData()
...@@ -508,7 +530,7 @@ const publishTopic = () => { ...@@ -508,7 +530,7 @@ const publishTopic = () => {
const handleClickCarousel = (item: CarouselItemDto) => { const handleClickCarousel = (item: CarouselItemDto) => {
if (item.url) { if (item.url) {
window.open(item.url) router.push(item.url)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment