feat: 九宫格基础结构
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<!-- 中奖结果弹窗 -->
|
||||
<view class="result-modal" v-if="visible">
|
||||
<view class="modal-content">
|
||||
<text class="result-title">恭喜您获得</text>
|
||||
<image :src="prize.img" class="result-img" mode="widthFix" :alt="prize.name || '奖品图片'"></image>
|
||||
<text class="result-desc">{{ prize.name || '未知奖品' }}</text>
|
||||
<button class="confirm-btn" @click="$emit('close')">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// 是否显示弹窗
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 中奖奖品信息
|
||||
prize: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.result-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
width: 500rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* 添加弹窗动画 */
|
||||
animation: popup 0.3s ease-out;
|
||||
}
|
||||
|
||||
@keyframes popup {
|
||||
0% {
|
||||
transform: scale(0.8);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.result-title {
|
||||
font-size: 36rpx;
|
||||
color: #e63946;
|
||||
font-weight: bold;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.result-img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
margin-bottom: 30rpx;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.result-desc {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-bottom: 40rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background-color: #e63946;
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.confirm-btn:active {
|
||||
background-color: #c72c3a;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user