Commit d8911132 authored by wangzhujun's avatar wangzhujun

bar

parent 28070c04
......@@ -46,9 +46,9 @@ class BarItem extends React.Component {
}
render() {
const { barInfo } = this.props;
const { barInfo, left, top, scaleNum } = this.props;
return (
<div className="gamebar">
<div className="gamebar" style={{ left: left / 100 + "rem", top: top / 100 + "rem", transform: `scale(${scaleNum})` }}>
<span className="bardown"></span>
<div className='barbox'>
<span className="baron" style={{
......
......@@ -2,8 +2,8 @@
.gamebar {
width: 571px;
height: 140px;
left: 88px;
top: 361px;
left: 0px;
top: 0px;
position: absolute;
.bardown {
width: 522px;
......@@ -19,6 +19,7 @@
left: 36px;
top: 69px;
position: absolute;
overflow: hidden;
}
.baron {
width: 486px;
......
......@@ -5,13 +5,15 @@ import { observer } from 'mobx-react';
import './successpop.less';
import modalStore from '@src/store/modal';
import { Button } from '../Button';
import BarItem from '../barItem/barItem';
import store from '@src/store';
@observer
class Successpop extends React.Component {
constructor(props) {
super(props);
}
closePop(){
closePop() {
modalStore.closePop("Successpop")
}
render() {
......@@ -21,7 +23,8 @@ class Successpop extends React.Component {
<span className="bg"></span>
<div className="barbox">
<span className="barbg"></span>
<span className="bar"></span>
{/* <span className="bar"></span> */}
<BarItem left={-10} top={20} scaleNum={0.95} barInfo={store.homeInfo?.boxInfo} nowScore={this.props.popData.score}></BarItem>
</div>
<Button className="btn" onClick={this.closePop}></Button>
<span className="score"><p>本次我赚了{this.props.popData.score}</p><p>获得{this.props.popData.sendCount}青果</p></span>
......
......@@ -17,6 +17,13 @@ class Homepahe extends React.Component {
}
componentDidMount() {
store.getIndexInfo()
let data = {
boxId: 2,
score: 600,
sendCount: 500
}
// modalStore.pushPop("Failpop",data)
modalStore.pushPop("Successpop", data)
}
click_Rule() {
if (!store.checkTime(false)) {
......@@ -59,7 +66,7 @@ class Homepahe extends React.Component {
</div>
}
<span className="gamebarbg"></span>
<BarItem barInfo={store.homeInfo?.boxInfo} nowScore={store.homeInfo.historyMaxScore}></BarItem>
<BarItem left={88} top={361} scaleNum={1} barInfo={store.homeInfo?.boxInfo} nowScore={store.homeInfo.historyMaxScore}></BarItem>
<Button className="startbtn" onClick={this.click_StartBtn}></Button>
<span className="title"></span>
<Button className="rule" onClick={this.click_Rule}></Button>
......
......@@ -3,6 +3,7 @@ import { makeAutoObservable } from 'mobx';
import API from '../api/index';
import { GetCurrSkinId, getCustomShareId } from "@src/utils/utils";
import { Toast } from '@spark/ui';
import modalStore from './modal';
const skinId = GetCurrSkinId() || getCustomShareId();
......@@ -45,8 +46,8 @@ const store = makeAutoObservable({
this.frontVariable = data || {};
console.log('前端开发配置', data)
},
timeStamp:'',
homeInfo:{},
timeStamp: '',
homeInfo: {},
async getIndexInfo() {
const { success, data } = await API.indexInfo()
if (success && data) {
......@@ -65,13 +66,17 @@ const store = makeAutoObservable({
}
return true
},
startInfo:{},
async startGame(){
startInfo: {},
async startGame() {
const { success, data } = await API.startGame()
if(success){
if (success) {
this.startInfo = data
// TODO 游戏页面
}
},
updateScore() {
// modalStore.pushPop("Successpop", data)
// modalStore.pushPop("Failpop", data)
}
})
......
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