feat:抽奖判断是否签署合同

This commit is contained in:
2025-09-13 15:20:17 +08:00
parent 415862ef42
commit cdddc39cbf
3 changed files with 25 additions and 5 deletions
@@ -30,6 +30,7 @@
<script>
import { raffleExecute } from '@/api/raffle.js';
import { getUserInfo } from '@/api/auth.js';
export default {
props: {
// 奖品数据数组
@@ -66,10 +67,22 @@ export default {
STOP_SPEED: 250, // 停止时的速度阈值
animationTimer: null, // 动画计时器
targetIndex: 0,
currentPrize: []
currentPrize: [],
currentUserData:{}
}
},
mounted() {
this.getUserInfo();
},
methods: {
// 查询用户等级
async getUserInfo() {
const result = await getUserInfo();
if (result && result.bizcode === 100) {
const data = result.data;
this.currentUserData = result.data || {};
}
},
/**
* 移动高亮框到指定索引位置
* @param {number} index - 格子索引
@@ -146,6 +159,13 @@ export default {
* 处理开始抽奖事件
*/
async handleStartLottery(num) {
if(this.currentUserData.contractStatus != 5){
uni.showToast({
title: `您当前尚未签署合同,请先签署合同再参与抽奖~`,
icon: 'none'
});
return;
}
if (this.prizesObj.times <= 0) {
uni.showToast({