snackbarOpen

dev_SaaS
hjm 6 years ago
parent 528996f57d
commit 5c2eb8b1d3

@ -2,8 +2,6 @@ import React, { Component } from 'react';
import LeftView from './LeftView'
import Snackbar from 'material-ui/Snackbar';
import axios from 'axios'
import update from 'immutability-helper'
@ -45,7 +43,7 @@ class LeftViewContainer extends Component {
tabIndex: 0,
dialogOpen: false,
gameAnswer: '',
snackbarOpen: false,
is_teacher: false,
// 评论
@ -253,11 +251,6 @@ class LeftViewContainer extends Component {
dialogOpen: false
})
}
handleRequestClose = () => {
this.setState({
snackbarOpen: false,
});
};
fetchIfCouldGetAnswerWithoutGold() {
// 查看是否有权限直接查看true可以直接查看false需要扣金币查看
var getAnswerUrl = `/api/v1/games/${this.props.game.identifier}/answer`;
@ -268,10 +261,7 @@ class LeftViewContainer extends Component {
.then((response) => {
if (response.data.status == 0) {
this.setState({
snackbarOpen: true,
snackbarText: response.data.message
})
this.props.showSnackbar(response.data.message)
return;
}
/*
@ -372,10 +362,7 @@ class LeftViewContainer extends Component {
// {message: "您没有足够的金币", status: -1}
if (response.data.status == 0) {
this.setState({
snackbarOpen: true,
snackbarText: response.data.message
})
this.props.showSnackbar(response.data.message)
return;
}
if (response.data.status == -1) {
@ -411,12 +398,6 @@ class LeftViewContainer extends Component {
<React.Fragment>
<ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer>
<Snackbar
open={this.state.snackbarOpen}
message={this.state.snackbarText || ""}
autoHideDuration={4000}
onClose={this.handleRequestClose}
/>
<LeftView {...this.props} tabIndexChange={this.tabIndexChange} {...this.state} tabIndex={tabIndex}
handleDialogReadAnswer={this.handleDialogReadAnswer} handleDialogClose={this.handleDialogClose}

Loading…
Cancel
Save