1094 lines
29 KiB
Vue
1094 lines
29 KiB
Vue
<template>
|
||
<view class="winners-page">
|
||
<!-- <view class="custom-header" :style="{ paddingTop: `${statusBarHeight}px` }">
|
||
<view class="header-inner">
|
||
<view class="header-back" @click="goBack">
|
||
<u-icon name="arrow-left" size="24" color="#333" class="header-back-icon"></u-icon>
|
||
</view>
|
||
<view class="header-title">中奖名单</view>
|
||
</view>
|
||
</view> -->
|
||
|
||
<view class="content-wrap" v-if="loaded">
|
||
<view v-if="useHistoryHeader" class="badge-side-wrap">
|
||
<view class="badge-side left-side" style="top: 0rpx"></view>
|
||
<view class="badge-side right-side" style="top: 0rpx"></view>
|
||
</view>
|
||
<view v-if="!useHistoryHeader" class="draw-info-wrap" :style="{ backgroundImage: `url(${webUrl}/zhongjiang5.png)` }">
|
||
<view class="period-side left">
|
||
<text class="side-text v12-font-36">第</text>
|
||
<text class="side-text v12-font-36">{{ periodLabel }}</text>
|
||
<text class="side-text v12-font-36">期</text>
|
||
</view>
|
||
<view class="period-side right">
|
||
<view class="side-text side-text-count v12-font-26" @click="handleShowHistory">
|
||
<text>往</text>
|
||
<text>期</text>
|
||
<text>中</text>
|
||
<text>奖</text>
|
||
<text>名</text>
|
||
<text>单</text>
|
||
</view>
|
||
</view>
|
||
<view class="draw-main">
|
||
<view class="draw-title">本期已开奖</view>
|
||
<view class="draw-time">开奖时间:{{ drawTime }}</view>
|
||
</view>
|
||
</view>
|
||
<view v-else class="draw-info-wrap history-header" style="padding: 0">
|
||
|
||
<view class="history-btn-wrap">
|
||
<view class="history-btn-wrap__inner">
|
||
|
||
<view
|
||
class="history-nav-btn left"
|
||
:class="{ disabled: !canSwitchPrev }"
|
||
@click="handleSwitchHistory('prev')"
|
||
>
|
||
{{ '<' }}
|
||
</view>
|
||
|
||
<view style="margin: 0 10px;">
|
||
<view class="v12-font-bold v12-font-40">
|
||
第{{ periodLabel }}期
|
||
</view>
|
||
</view>
|
||
<view
|
||
class="history-nav-btn right"
|
||
:class="{ disabled: !canSwitchNext }"
|
||
@click="handleSwitchHistory('next')"
|
||
>
|
||
{{ '>' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="draw-main" style="padding: 0" >
|
||
<view class="draw-time" style="margin-top: 40rpx">开奖时间:{{ drawTime }}</view>
|
||
</view>
|
||
</view>
|
||
<view class="win-banner" v-if="hasWon === 1 && userWinList.length > 0">
|
||
<view class="win-banner-bg-top" :style="{ backgroundImage: `url(${webUrl}/zhongjiangtop.png)` }"></view>
|
||
<view class="win-banner-bg-bottom" :style="{ backgroundImage: `url(${webUrl}/zhongjiangbottom.png)` }"></view>
|
||
<view class="win-banner-content">
|
||
<view class="win-banner-subtitle">
|
||
您的抽奖码
|
||
<text class="code" v-for="(code, index) in winTicketCodeList" :key="`${code}_${index}`">
|
||
{{ code }}<text v-if="index < winTicketCodeList.length - 1">、</text>
|
||
</text>
|
||
获得了
|
||
</view>
|
||
|
||
<view class="prize-card" v-for="(prize, index) in userWinList" :key="index">
|
||
<view class="prize-img-wrap">
|
||
<image class="prize-img" :src="prize.prizeImage" mode="aspectFill"></image>
|
||
</view>
|
||
<view class="prize-info">
|
||
<view class="prize-name-wrap">
|
||
<text class="prize-level">{{ prize.levelName }}:</text>
|
||
<text class="prize-name one-t">{{ prize.prizeName }}</text>
|
||
</view>
|
||
<view class="prize-desc one-t">{{ prize.prizeAttrName || "默认" }}</view>
|
||
</view>
|
||
</view>
|
||
|
||
<button v-if="showClaimNowBtn" class="my-tickets-btn" @click="handleClaimNow">
|
||
<text class="btn-text">立即领取</text>
|
||
</button>
|
||
<button v-else class="my-tickets-btn" @click="navToMyTickets">
|
||
<text class="btn-text">我的抽奖码</text>
|
||
</button>
|
||
<view class="claim-tip">*请在{{ remainingClaimDays }}天内领取,过期失效</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 把半圆提出来,跟大卡片平级,并且放在大卡片前面,让大卡片的背景可以遮住它们的下半截 -->
|
||
<view class="badge-side-wrap">
|
||
<view class="badge-side left-side"></view>
|
||
<view class="badge-side right-side"></view>
|
||
</view>
|
||
|
||
<view class="winners-list-wrap">
|
||
<view class="list-title-badge">
|
||
<!-- 主图背景 -->
|
||
<view class="badge-bg" :style="{ backgroundImage: `url(${webUrl}/zhongjiang6.png)` }"></view>
|
||
|
||
<!-- 内容区 -->
|
||
<view class="badge-content">
|
||
<text class="gift-icon" style="opacity: 0;">🎁</text>
|
||
<text class="title-text" style="opacity: 0;">中奖名单</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="list-content">
|
||
<view class="list-item" v-for="(item, index) in activityWinnerList" :key="index">
|
||
<view class="item-left">
|
||
<view class="item-prize">
|
||
<text class="level">{{ item.levelName }}:</text>
|
||
<text class="name">{{ item.prizeName }}</text>
|
||
</view>
|
||
<view class="item-code">
|
||
中奖码:<text class="code-text">{{ item.ticketCode }}</text>
|
||
</view>
|
||
</view>
|
||
<view class="item-right">
|
||
<view class="user-name">{{ item.realName }}</view>
|
||
<view class="user-phone">{{ item.phone }}</view>
|
||
</view>
|
||
</view>
|
||
<view class="empty-text" v-if="activityWinnerList.length === 0">暂无中奖名单</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="coupon-popup-mask" v-if="showCouponSuccessPopup" @click="closeCouponSuccessPopup">
|
||
<view class="coupon-popup" @click.stop>
|
||
<view class="popup-close" @click="closeCouponSuccessPopup">×</view>
|
||
<view class="popup-icon-wrap">
|
||
<image class="popup-success-icon" :src="webUrl + '/home/qingzhu.png'" mode="aspectFit" />
|
||
</view>
|
||
<view class="popup-title">领取成功</view>
|
||
<view class="popup-desc">您的奖品已经领取成功,请前往“我的优惠券”查看详情</view>
|
||
<view class="popup-btn" @click="goMyCoupons">去查看我的优惠券</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import { getDrawActivityInfo, getActivityWinRecord, getDrawMyTickets, getDrawHistoryActivities } from '@/api/lottery'
|
||
|
||
export default {
|
||
computed: {
|
||
currentHistoryIndex() {
|
||
if (!this.historyList.length) return -1
|
||
return this.historyList.findIndex(item => Number(item.id) === Number(this.activityId))
|
||
},
|
||
canSwitchPrev() {
|
||
if (!this.historyList.length) return false
|
||
if (this.currentHistoryIndex < 0) return true
|
||
return this.currentHistoryIndex < this.historyList.length - 1
|
||
},
|
||
canSwitchNext() {
|
||
if (!this.historyList.length) return false
|
||
if (this.currentHistoryIndex < 0) return true
|
||
return this.currentHistoryIndex > 0
|
||
},
|
||
useHistoryHeader() {
|
||
return this.showHistory || this.entryWithoutActivityId
|
||
},
|
||
showClaimNowBtn() {
|
||
if (this.userWinList.length !== 1) return false
|
||
const prize = this.userWinList[0] || {}
|
||
return Number(prize.claimStatus) === 0
|
||
},
|
||
winTicketCodeList() {
|
||
const list = (this.userWinList || [])
|
||
.map(item => String(item.ticketCode || '').trim())
|
||
.filter(code => !!code)
|
||
const uniqList = [...new Set(list)]
|
||
return uniqList.length ? uniqList : ['--']
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||
statusBarHeight: 20,
|
||
activityId: 0,
|
||
periodLabel: "01",
|
||
drawTime: "--",
|
||
hasWon: 0,
|
||
userWinList: [],
|
||
activityWinnerList: [],
|
||
historyActivities: [],
|
||
loaded: false,
|
||
showCouponSuccessPopup: false,
|
||
showHistory: false,
|
||
entryWithoutActivityId: false,
|
||
historyList: [],
|
||
remainingClaimDays: 7
|
||
}
|
||
},
|
||
onLoad(options) {
|
||
const incomingActivityId = Number(options && options.activityId) || 0
|
||
this.entryWithoutActivityId = !incomingActivityId
|
||
this.activityId = incomingActivityId
|
||
const systemInfo = uni.getSystemInfoSync()
|
||
this.statusBarHeight = systemInfo.statusBarHeight || 20
|
||
this.fetchData()
|
||
},
|
||
methods: {
|
||
async loadHistoryList() {
|
||
const historyRes = await getDrawHistoryActivities()
|
||
const { data, success } = historyRes || {}
|
||
if (!success) return []
|
||
const list = (data || [])
|
||
.map(item => ({
|
||
id: Number(item.id || item.activityId || item.drawActivityId || 0),
|
||
periodNo: item.periodNo || '',
|
||
drawTime: item.drawTime || ''
|
||
}))
|
||
.filter(item => item.id > 0)
|
||
.sort((a, b) => this.getPeriodNoValue(b.periodNo) - this.getPeriodNoValue(a.periodNo))
|
||
this.historyList = list
|
||
return list
|
||
},
|
||
async handleShowHistory() {
|
||
uni.showLoading({
|
||
mask: true
|
||
})
|
||
const list = await this.loadHistoryList()
|
||
uni.hideLoading()
|
||
if (!list.length) return
|
||
this.showHistory = true
|
||
},
|
||
async handleSwitchHistory(direction) {
|
||
if (!this.historyList.length) {
|
||
uni.showToast({
|
||
title: "暂无可切换历史期",
|
||
icon: "none"
|
||
})
|
||
return
|
||
}
|
||
const currentIndex = this.currentHistoryIndex
|
||
const targetIndex = currentIndex < 0
|
||
? (direction === 'prev' ? 0 : this.historyList.length - 1)
|
||
: (direction === 'prev' ? currentIndex + 1 : currentIndex - 1)
|
||
if (targetIndex < 0 || targetIndex >= this.historyList.length) return
|
||
const target = this.historyList[targetIndex]
|
||
if (!target || Number(target.id) === Number(this.activityId)) return
|
||
this.activityId = Number(target.id)
|
||
this.loaded = false
|
||
await this.fetchData()
|
||
},
|
||
goBack() {
|
||
uni.navigateBack()
|
||
},
|
||
navToMyTickets() {
|
||
uni.navigateTo({
|
||
url: '/pkg-video/views/county-my-tickets'
|
||
})
|
||
},
|
||
handleClaimNow() {
|
||
if (!this.userWinList.length) return
|
||
if (!this.showClaimNowBtn) {
|
||
this.navToMyTickets()
|
||
return
|
||
}
|
||
|
||
if (this.userWinList.length > 1) {
|
||
this.navToMyTickets()
|
||
return
|
||
}
|
||
|
||
const allCouponPrize = this.userWinList.every((item) => this.isCouponPrize(item))
|
||
if (allCouponPrize) {
|
||
this.showCouponSuccessPopup = true
|
||
return
|
||
}
|
||
this.navToReceiveInfo(this.userWinList[0])
|
||
},
|
||
isCouponPrize(prize = {}) {
|
||
const prizeType = Number(prize.prizeType)
|
||
const prizeName = String(prize.prizeName || "")
|
||
return prizeType === 3 || prize.prizeType === "coupon" || /券/.test(prizeName)
|
||
},
|
||
navToReceiveInfo(prize = {}) {
|
||
const queryParams = { source: "lottery", ...prize }
|
||
const query = Object.keys(queryParams)
|
||
.filter((key) => {
|
||
const value = queryParams[key]
|
||
return value !== undefined && value !== null && typeof value !== "object"
|
||
})
|
||
.map((key) => `${key}=${encodeURIComponent(queryParams[key])}`)
|
||
.join("&")
|
||
uni.navigateTo({
|
||
url: `/pkg-video/views/county-claim-address?${query}`
|
||
})
|
||
},
|
||
closeCouponSuccessPopup() {
|
||
this.showCouponSuccessPopup = false
|
||
},
|
||
goMyCoupons() {
|
||
this.showCouponSuccessPopup = false
|
||
uni.navigateTo({
|
||
url: "/pkg_user/views/myCoupons"
|
||
})
|
||
},
|
||
normalizeListData(res) {
|
||
if (!res) return []
|
||
if (Array.isArray(res)) return res
|
||
if (Array.isArray(res.data)) return res.data
|
||
if (Array.isArray(res.data && res.data.list)) return res.data.list
|
||
if (Array.isArray(res.list)) return res.list
|
||
return []
|
||
},
|
||
normalizeHistoryListData(res) {
|
||
if (!res) return []
|
||
if (Array.isArray(res)) return res
|
||
if (Array.isArray(res.data)) return res.data
|
||
if (Array.isArray(res.data && res.data.list)) return res.data.list
|
||
if (Array.isArray(res.list)) return res.list
|
||
return []
|
||
},
|
||
getPeriodNoValue(periodNo) {
|
||
const text = String(periodNo || '')
|
||
const match = text.match(/\d+/g)
|
||
if (!match || !match.length) return 0
|
||
return Number(match.join('')) || 0
|
||
},
|
||
formatDrawTime(time) {
|
||
if (!time) return "--"
|
||
const date = new Date(String(time).replace(/-/g, "/"))
|
||
if (Number.isNaN(date.getTime())) return String(time)
|
||
const y = date.getFullYear()
|
||
const m = String(date.getMonth() + 1).padStart(2, "0")
|
||
const d = String(date.getDate()).padStart(2, "0")
|
||
return `${y}年${m}月${d}日`
|
||
},
|
||
mapUserWinList(ticketList = []) {
|
||
return ticketList.map(item => ({
|
||
id: item.id || item.lotteryRecordId || item.ticketId || item.recordId || "",
|
||
lotteryRecordId: item.id || item.lotteryRecordId || item.ticketId || item.recordId || "",
|
||
levelName: item.levelName || item.prizeLevelName || "中奖奖品",
|
||
prizeName: item.prizeName || item.awardName || "神秘奖品",
|
||
prizeAttrName: item.prizeAttrName || "默认",
|
||
ticketCode: item.ticketCode || item.code || "--",
|
||
claimStatus: Number(item.claimStatus),
|
||
prizeType: item.prizeType,
|
||
prizeTypeName: item.prizeTypeName || item.prizeCategoryName || "",
|
||
prizeImage: item.prizeImage || item.image || ""
|
||
}))
|
||
},
|
||
async fetchData() {
|
||
try {
|
||
let targetActivityId = Number(this.activityId) || 0
|
||
if (!targetActivityId) {
|
||
const historyList = await this.loadHistoryList()
|
||
this.showHistory = true
|
||
targetActivityId = (historyList[0] && Number(historyList[0].id)) || 0
|
||
if (targetActivityId) {
|
||
this.activityId = targetActivityId
|
||
}
|
||
}
|
||
const [activityRes, winnerRes, myTicketsRes] = await Promise.all([
|
||
targetActivityId ? getDrawActivityInfo(targetActivityId) : Promise.resolve(null),
|
||
targetActivityId ? getActivityWinRecord(targetActivityId) : Promise.resolve(null),
|
||
getDrawMyTickets(1)
|
||
])
|
||
const activityData = (activityRes && activityRes.data) || {}
|
||
const winnerData = (winnerRes && winnerRes.data) || {}
|
||
const winnerList = winnerData.activityWinnerList || []
|
||
const userWinList = this.mapUserWinList(winnerData.userWinList || [])
|
||
const myTicketList = this.normalizeListData(myTicketsRes)
|
||
|
||
const filteredMyTicketList = targetActivityId
|
||
? myTicketList.filter(item => Number(item.activityId || item.drawActivityId || 0) === targetActivityId)
|
||
: myTicketList
|
||
|
||
this.drawTime = this.formatDrawTime(activityData.drawTime || activityData.openTime || "")
|
||
this.activityWinnerList = winnerList
|
||
this.userWinList = userWinList
|
||
this.hasWon = this.userWinList.length > 0 ? 1 : 0
|
||
this.periodLabel = winnerData.periodNo || "01"
|
||
this.remainingClaimDays = winnerData.remainingClaimDays || 7
|
||
} catch (e) {
|
||
uni.showToast({
|
||
title: "中奖数据加载失败",
|
||
icon: "none"
|
||
})
|
||
} finally {
|
||
this.loaded = true
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.popup-success-icon {
|
||
width: 92rpx;
|
||
height: 92rpx;
|
||
}
|
||
.winners-page {
|
||
min-height: 100vh;
|
||
background: #f4f6f8;
|
||
padding-bottom: 48rpx;
|
||
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
|
||
}
|
||
|
||
.custom-header {
|
||
position: sticky;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
z-index: 99;
|
||
background-color: #fff;
|
||
|
||
.header-inner {
|
||
height: 44px;
|
||
display: flex;
|
||
align-items: center;
|
||
position: relative;
|
||
padding: 0 24rpx;
|
||
|
||
.header-back {
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 8rpx;
|
||
|
||
.header-back-icon {
|
||
font-size: 60rpx;
|
||
color: #333;
|
||
margin-top: -4rpx;
|
||
}
|
||
}
|
||
|
||
.header-title {
|
||
flex: 1;
|
||
text-align: center;
|
||
font-size: 34rpx;
|
||
font-weight: 700;
|
||
color: #333;
|
||
}
|
||
|
||
.header-actions {
|
||
width: 120rpx;
|
||
height: 56rpx;
|
||
border-radius: 28rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
padding: 0 16rpx;
|
||
|
||
.dot {
|
||
font-size: 22rpx;
|
||
color: #333;
|
||
font-weight: bold;
|
||
letter-spacing: 2rpx;
|
||
}
|
||
|
||
.circle-dot {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
border: 3rpx solid #333;
|
||
border-radius: 50%;
|
||
position: relative;
|
||
&::after {
|
||
content: '';
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 6rpx;
|
||
height: 6rpx;
|
||
background: #333;
|
||
border-radius: 50%;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.content-wrap {
|
||
padding: 28rpx 24rpx 0;
|
||
}
|
||
|
||
.draw-info-wrap {
|
||
position: relative;
|
||
margin: 18rpx 0 38rpx;
|
||
padding: 24rpx 70rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
min-height: 168rpx;
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
background-color: transparent;
|
||
|
||
.period-side {
|
||
position: absolute;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
width: 54rpx;
|
||
height: 152rpx;
|
||
border-radius: 16rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: #fff4d1;
|
||
padding-bottom: 15rpx;
|
||
.side-text {
|
||
font-size: 24rpx;
|
||
line-height: 1.1;
|
||
font-weight: 900;
|
||
letter-spacing: 2rpx;
|
||
color: #1f1f1f;
|
||
}
|
||
|
||
.side-text-count {
|
||
writing-mode: horizontal-tb;
|
||
height: 132rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
letter-spacing: 0;
|
||
line-height: 1;
|
||
}
|
||
|
||
&.left {
|
||
left: 8rpx;
|
||
background: transparent;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
}
|
||
|
||
&.right {
|
||
right: 8rpx;
|
||
background: transparent;
|
||
}
|
||
}
|
||
|
||
.draw-main {
|
||
flex: 1;
|
||
border-radius: 16rpx;
|
||
text-align: center;
|
||
padding: 18rpx 12rpx;
|
||
}
|
||
|
||
.draw-title {
|
||
font-size: 58rpx;
|
||
line-height: 1.05;
|
||
color: #d73222;
|
||
font-weight: 900;
|
||
letter-spacing: 1rpx;
|
||
margin-bottom: 8rpx;
|
||
}
|
||
|
||
.draw-time {
|
||
font-size: 30rpx;
|
||
color: #222;
|
||
font-weight: 800;
|
||
}
|
||
}
|
||
|
||
.win-banner {
|
||
padding: 54rpx 20rpx 26rpx;
|
||
text-align: center;
|
||
margin-bottom: 62rpx;
|
||
position: relative;
|
||
background-color: transparent;
|
||
|
||
.win-banner-bg-top {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 120rpx; /* 根据顶部图实际比例微调 */
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
z-index: 1;
|
||
}
|
||
|
||
.win-banner-bg-bottom {
|
||
position: absolute;
|
||
top: 118rpx; /* 让上下拼接处没有缝隙,可以覆盖 2rpx */
|
||
bottom: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
z-index: 1;
|
||
}
|
||
|
||
.win-banner-content {
|
||
position: relative;
|
||
z-index: 2;
|
||
}
|
||
|
||
.win-badge {
|
||
position: absolute;
|
||
top: -34rpx;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
width: 390rpx;
|
||
height: 72rpx;
|
||
background: #ffca1c;
|
||
border: 4rpx solid #1f1f1f;
|
||
border-radius: 18rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-shadow: 0 5rpx 0 #d49400;
|
||
|
||
.win-badge-text {
|
||
font-size: 52rpx;
|
||
font-weight: 900;
|
||
color: #fff;
|
||
text-shadow: -2rpx -2rpx 0 #1f1f1f, 2rpx -2rpx 0 #1f1f1f, -2rpx 2rpx 0 #1f1f1f, 2rpx 2rpx 0 #1f1f1f, 0 4rpx 0 #1f1f1f;
|
||
letter-spacing: 1rpx;
|
||
}
|
||
}
|
||
|
||
.win-banner-subtitle {
|
||
font-size: 28rpx;
|
||
color: #fff;
|
||
margin-bottom: 20rpx;
|
||
margin-top: 50rpx;
|
||
font-weight: 700;
|
||
|
||
.code {
|
||
font-weight: 900;
|
||
font-size: 40rpx;
|
||
margin: 0 8rpx;
|
||
color: #ffe8db;
|
||
}
|
||
}
|
||
|
||
.prize-card {
|
||
background: #fffdf5;
|
||
height: 134rpx;
|
||
border: 4rpx solid #1f1f1f;
|
||
border-radius: 20rpx;
|
||
display: flex;
|
||
align-items: flex-start;
|
||
margin-bottom: 18rpx;
|
||
text-align: left;
|
||
box-shadow: inset 0 0 0 2rpx #fff;
|
||
|
||
.prize-img-wrap {
|
||
flex-shrink: 0;
|
||
width: 132rpx;
|
||
height: 132rpx;
|
||
border-radius: 20rpx;
|
||
border: 4rpx solid #1f1f1f;
|
||
margin-right: 18rpx;
|
||
background: #fff;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-left: -4rpx;
|
||
margin-top: -4rpx;
|
||
.prize-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
border-radius: 20rpx;
|
||
}
|
||
}
|
||
|
||
.prize-info {
|
||
flex: 1;
|
||
padding-top: 8rpx;
|
||
min-width: 0;
|
||
|
||
.prize-name-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
font-size: 32rpx;
|
||
color: #222;
|
||
margin-bottom: 10rpx;
|
||
line-height: 1.2;
|
||
|
||
.prize-level {
|
||
font-weight: 900;
|
||
flex-shrink: 0;
|
||
}
|
||
.prize-name {
|
||
font-weight: 700;
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: block;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
}
|
||
|
||
.prize-desc {
|
||
font-size: 26rpx;
|
||
color: #8c8c8c;
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
}
|
||
|
||
.my-tickets-btn {
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
background-color: transparent;
|
||
border: none;
|
||
border-radius: 48rpx;
|
||
padding: 0;
|
||
height: 90rpx;
|
||
width: 92%;
|
||
margin: 0 auto;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border: 4rpx solid #333;
|
||
box-shadow: inset 0 -12rpx 0 #FAA100, inset 0 12rpx 0 #FAA100, inset -12rpx 0rpx 0rpx #FAA100, inset 12rpx 0rpx 0 #FAA100;
|
||
transition: all 0.1s;
|
||
background: #FDB400;
|
||
color: #333;
|
||
&:active {
|
||
transform: translateY(4rpx);
|
||
box-shadow: inset 0 -4rpx 0 #FAA100;
|
||
}
|
||
|
||
.btn-text {
|
||
font-size: 44rpx;
|
||
font-weight: 900;
|
||
color: #111;
|
||
text-shadow: -2rpx -2rpx 0 #fff, 2rpx -2rpx 0 #fff, -2rpx 2rpx 0 #fff, 2rpx 2rpx 0 #fff, 0 2rpx 0 #fff;
|
||
letter-spacing: 2rpx;
|
||
}
|
||
}
|
||
|
||
.claim-tip {
|
||
margin-top: 16rpx;
|
||
color: #fff0de;
|
||
font-size: 30rpx;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
|
||
/* 新增:半圆挂在列表大卡片外部的相对容器上 */
|
||
.badge-side-wrap {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 0; /* 占位 0,不影响后续流 */
|
||
z-index: 1; /* 在 winners-list-wrap 之前,所以会被它的 z-index 盖住,或自然被后面元素盖住 */
|
||
|
||
.badge-side {
|
||
position: absolute;
|
||
top: -18rpx; /* 调整此值以对齐中奖名单背景的垂直中线 */
|
||
width: 40rpx;
|
||
height: 38rpx;
|
||
background-color: #fdb400;
|
||
border: 4rpx solid #111;
|
||
}
|
||
|
||
.left-side {
|
||
left: calc(50% - 160rpx); /* 根据主图 280rpx 宽算,一半140rpx,加上突出的 20rpx */
|
||
border-radius: 40rpx 0 0 40rpx;
|
||
border-right: none;
|
||
}
|
||
|
||
.right-side {
|
||
right: calc(50% - 160rpx);
|
||
border-radius: 0 40rpx 40rpx 0;
|
||
border-left: none;
|
||
}
|
||
}
|
||
|
||
.winners-list-wrap {
|
||
background: #fff;
|
||
border-radius: 28rpx;
|
||
padding: 46rpx 24rpx 10rpx;
|
||
position: relative;
|
||
z-index: 2; /* 确保盖住上面的 badge-side-wrap */
|
||
box-shadow: 0 5rpx 0 #e6e8ec;
|
||
|
||
.list-title-badge {
|
||
position: absolute;
|
||
left: 50%;
|
||
top: -30rpx;
|
||
transform: translateX(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 280rpx; /* 根据实际标题框宽度设定,让它包裹住背景图 */
|
||
height: 85rpx;
|
||
z-index: 3;
|
||
|
||
/* 主背景图,层级2,盖住半圆的一部分 */
|
||
.badge-bg {
|
||
position: absolute;
|
||
top: -5rpx;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-size: 100% 100%;
|
||
background-repeat: no-repeat;
|
||
z-index: 2;
|
||
}
|
||
|
||
/* 文字内容,层级3,位于最上层 */
|
||
.badge-content {
|
||
position: relative;
|
||
z-index: 3;
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 0 34rpx;
|
||
height: 100%;
|
||
|
||
.gift-icon {
|
||
font-size: 28rpx;
|
||
margin-right: 8rpx;
|
||
}
|
||
|
||
.title-text {
|
||
font-size: 34rpx;
|
||
font-weight: 900;
|
||
color: #222;
|
||
}
|
||
}
|
||
}
|
||
|
||
.list-content {
|
||
.list-item {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: flex-start;
|
||
padding: 24rpx 0;
|
||
border-bottom: 2rpx solid #f1f1f1;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.item-left {
|
||
flex: 1;
|
||
|
||
.item-prize {
|
||
font-size: 28rpx;
|
||
color: #333;
|
||
margin-bottom: 8rpx;
|
||
line-height: 1.25;
|
||
|
||
.level {
|
||
font-weight: 900;
|
||
}
|
||
|
||
.name {
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
|
||
.item-code {
|
||
font-size: 28rpx;
|
||
color: #666;
|
||
font-weight: 700;
|
||
|
||
.code-text {
|
||
color: #d8392b;
|
||
font-weight: 900;
|
||
}
|
||
}
|
||
}
|
||
|
||
.item-right {
|
||
margin-left: 16rpx;
|
||
text-align: right;
|
||
|
||
.user-name {
|
||
font-size: 28rpx;
|
||
color: #666;
|
||
font-weight: 700;
|
||
margin-bottom: 8rpx;
|
||
}
|
||
|
||
.user-phone {
|
||
font-size: 28rpx;
|
||
color: #999;
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
}
|
||
|
||
.empty-text {
|
||
text-align: center;
|
||
padding: 60rpx 0;
|
||
color: #999;
|
||
font-size: 28rpx;
|
||
}
|
||
}
|
||
}
|
||
|
||
.coupon-popup-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 1000;
|
||
background: rgba(0, 0, 0, 0.55);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 24rpx;
|
||
}
|
||
|
||
.coupon-popup {
|
||
width: 550rpx;
|
||
height: 560rpx;
|
||
background: #fff;
|
||
border-radius: 32rpx;
|
||
padding: 26rpx 34rpx 42rpx;
|
||
position: relative;
|
||
}
|
||
|
||
.popup-close {
|
||
position: absolute;
|
||
right: 18rpx;
|
||
top: 18rpx;
|
||
width: 40rpx;
|
||
height: 40rpx;
|
||
border-radius: 50%;
|
||
border: 4rpx solid #333;
|
||
font-size: 40rpx;
|
||
font-weight: 700;
|
||
color: #333;
|
||
line-height: 40rpx;
|
||
text-align: center;
|
||
}
|
||
|
||
.popup-icon-wrap {
|
||
width: 112rpx;
|
||
height: 112rpx;
|
||
margin: 20rpx auto 8rpx;
|
||
border-radius: 8rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.popup-icon {
|
||
font-size: 70rpx;
|
||
}
|
||
|
||
.popup-title {
|
||
text-align: center;
|
||
font-size: 50rpx;
|
||
font-weight: 900;
|
||
color: #222;
|
||
margin-top: 12rpx;
|
||
}
|
||
|
||
.popup-desc {
|
||
margin: 38rpx auto 42rpx;
|
||
text-align: center;
|
||
font-size: 28rpx;
|
||
line-height: 1.6;
|
||
color: #9a9a9a;
|
||
width: 92%;
|
||
}
|
||
|
||
.popup-btn {
|
||
width: 86%;
|
||
height: 96rpx;
|
||
margin: 0 auto;
|
||
border-radius: 48rpx;
|
||
background: #c43124;
|
||
color: #fff;
|
||
font-size: 40rpx;
|
||
font-weight: 900;
|
||
text-align: center;
|
||
line-height: 96rpx;
|
||
letter-spacing: 2rpx;
|
||
}
|
||
.top-wrap{
|
||
position: absolute;
|
||
top: 6px;
|
||
left: 0;
|
||
right: 0;
|
||
margin: auto;
|
||
width: fit-content;
|
||
color: #333;
|
||
}
|
||
|
||
.history-nav-btn {
|
||
width: 52rpx;
|
||
height: 52rpx;
|
||
top: 16rpx;
|
||
border-radius: 50%;
|
||
color: #333;
|
||
font-size: 44rpx;
|
||
line-height: 48rpx;
|
||
text-align: center;
|
||
font-weight: 700;
|
||
|
||
&.left {
|
||
left: 240rpx;
|
||
}
|
||
|
||
&.right {
|
||
right: 240rpx;
|
||
}
|
||
|
||
&.disabled {
|
||
opacity: 0.4;
|
||
}
|
||
}
|
||
.history-header{
|
||
position: relative;
|
||
z-index: 5;
|
||
min-height: 120rpx !important;
|
||
border: 6rpx solid #333;
|
||
border-radius: 30rpx;
|
||
background: #fff;
|
||
box-shadow: inset 0 -12rpx 0 #FAF8E9, inset 0 12rpx 0 #FAF8E9, inset -12rpx 0rpx 0rpx #FAF8E9, inset 12rpx 0rpx 0 #FAF8E9;
|
||
}
|
||
.history-btn-wrap{
|
||
position: absolute;
|
||
width: fit-content;
|
||
height: 60rpx;
|
||
border-radius: 1000rpx;
|
||
border: 6rpx solid #333;
|
||
line-height: 60rpx;
|
||
text-align: center;
|
||
display: flex;
|
||
align-items: center;
|
||
background: #FCF9E8;
|
||
left: 0;
|
||
right: 0;
|
||
margin: auto;
|
||
top: -34rpx;
|
||
z-index: 10;
|
||
|
||
&::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: -16rpx;
|
||
left: 50%;
|
||
transform: translateX(-50%) rotate(-45deg);
|
||
width: 30rpx;
|
||
height: 30rpx;
|
||
border: 6rpx solid #333;
|
||
background: #FCF9E8;
|
||
/* 为了不让这个三角形的边框跑到上方的背景前,可以设置层级或者利用边框隐藏等,目前看原来的效果是直接叠加在底下的。
|
||
由于要模拟原本的 .triangle 元素层级,我们用 z-index: -1 把它垫在 pill 下面即可 */
|
||
}
|
||
}
|
||
.history-btn-wrap__inner {
|
||
display: flex;
|
||
z-index: 1;
|
||
background: #FAF8E9;
|
||
border-radius: 1000rpx;
|
||
align-items: center;
|
||
position: relative;
|
||
|
||
.badge-side {
|
||
position: absolute;
|
||
top: 8rpx; /* 调整此值以对齐中奖名单背景的垂直中线 */
|
||
width: 40rpx;
|
||
height: 38rpx;
|
||
background-color: #fdb400;
|
||
border: 4rpx solid #111;
|
||
z-index: -1;
|
||
}
|
||
|
||
.left-side {
|
||
left: calc(50% - 160rpx); /* 根据主图 280rpx 宽算,一半140rpx,加上突出的 20rpx */
|
||
border-radius: 40rpx 0 0 40rpx;
|
||
border-right: none;
|
||
}
|
||
|
||
.right-side {
|
||
right: calc(50% - 160rpx);
|
||
border-radius: 0 40rpx 40rpx 0;
|
||
border-left: none;
|
||
}
|
||
}
|
||
</style>
|