Commit e9d6bd92 authored by haiyoucuv's avatar haiyoucuv

init

parent 10a5a589
...@@ -38,6 +38,7 @@ export default [ ...@@ -38,6 +38,7 @@ export default [
optionId: `prizeId${i}`, optionId: `prizeId${i}`,
optionImg: "optionImg", optionImg: "optionImg",
prizeId: `prizeId${i}`, prizeId: `prizeId${i}`,
optionName: `optionName${i}`,
prizeType: Math.random() * 5 >> 0, prizeType: Math.random() * 5 >> 0,
position: Math.random() * 6 >> 0, position: Math.random() * 6 >> 0,
userRecordId: "userRecordId", userRecordId: "userRecordId",
......
...@@ -10,13 +10,14 @@ import resStore from "@/store/ResStore.ts"; ...@@ -10,13 +10,14 @@ import resStore from "@/store/ResStore.ts";
import classNames from "classnames"; import classNames from "classnames";
import { NoPrizePanel } from "@/panels/NoPrizePanel/NoPrizePanel.tsx"; import { NoPrizePanel } from "@/panels/NoPrizePanel/NoPrizePanel.tsx";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx"; import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
import { PrizePanel } from "@/panels/PrizePanel/PrizePanel.tsx";
@observer @observer
class TurnTable extends React.Component { class TurnTable extends React.Component {
turntableRef = null; // 大转盘 turntableRef = null; // 大转盘
btnStarting = false; // 转盘是否启动 btnStarting = false; // 转盘是否启动
drawResultInfo = {}; drawResultInfo: any = {};
async componentDidMount() { async componentDidMount() {
} }
...@@ -24,7 +25,14 @@ class TurnTable extends React.Component { ...@@ -24,7 +25,14 @@ class TurnTable extends React.Component {
onStop = () => { onStop = () => {
this.btnStarting = false; this.btnStarting = false;
resStore.updateInfo(); resStore.updateInfo();
// ModalCtrl.showModal(NoPrizePanel, this.drawResultInfo);
console.log(this.drawResultInfo)
if (this.drawResultInfo.prizeId == "thanks") {
ModalCtrl.showModal(NoPrizePanel, this.drawResultInfo);
} else {
ModalCtrl.showModal(PrizePanel, this.drawResultInfo);
}
} }
// 开始抽奖 // 开始抽奖
...@@ -42,9 +50,9 @@ class TurnTable extends React.Component { ...@@ -42,9 +50,9 @@ class TurnTable extends React.Component {
this.btnStarting = false; this.btnStarting = false;
return; return;
} }
this.drawResultInfo = data;
this.turntableRef.launch(); this.turntableRef.launch();
this.drawResultInfo = data;
const index = resStore.info.prizeInfo?.findIndex((item) => item.prizeId === this.drawResultInfo.prizeId); const index = resStore.info.prizeInfo?.findIndex((item) => item.prizeId === this.drawResultInfo.prizeId);
this.turntableRef.braking(index); this.turntableRef.braking(index);
}); });
......
...@@ -15,7 +15,7 @@ export class NoPrizePanel extends Component<any, any> { ...@@ -15,7 +15,7 @@ export class NoPrizePanel extends Component<any, any> {
render() { render() {
return <div className="NoPrizePanel"> return <div className="NoPrizePanel modal_center">
<div className="bg"/> <div className="bg"/>
<Button className="btn" onClick={this.clickClose}/> <Button className="btn" onClick={this.clickClose}/>
<Button className="close" onClick={this.clickClose}/> <Button className="close" onClick={this.clickClose}/>
......
@import "../../res.less";
.PrizePanel {
width: 750px;
height: 100%;
left: 0;
top: 0;
position: absolute;
.bg {
position: absolute;
left: 82px;
top: 348px;
width: 585px;
height: 671px;
.webpBg("PrizePanel/bg.png");
}
.btn {
position: absolute;
left: 120px;
top: 811px;
width: 510px;
height: 138px;
.webpBg("PrizePanel/btn.png");
}
.img {
border-radius: 22px;
background-color: white;
position: absolute;
left: 265px;
top: 494px;
width: 220px;
height: 220px;
}
.prizeName {
font-size: 28px;
color: rgb(1, 1, 1);
text-align: center;
position: absolute;
left: 100px;
width: 550px;
top: 740px;
.lineClamp1();
}
.close {
position: absolute;
left: 346px;
top: 1161px;
width: 58px;
height: 58px;
.webpBg("common/close.png");
}
}
import { Component } from "react";
import "./PrizePanel.less";
import { Button } from "@grace/ui";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
export class PrizePanel extends Component<any, any> {
componentDidMount() {
}
clickClose = () => {
ModalCtrl.closeModal();
}
render() {
const {optionImg, optionName} = this.props;
return <div className="PrizePanel modal_center">
<div className="bg"/>
<img className="img" src={optionImg}/>
<div className="prizeName">{optionName}</div>
<Button className="btn" onClick={this.clickClose}/>
<Button className="close" onClick={this.clickClose}/>
</div>
}
}
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