Browse Source

update style

dev
xmcp 6 years ago
parent
commit
abf78da5af
  1. 2
      src/BalanceShower.js
  2. 6
      src/Flows.css
  3. 2
      src/Sidebar.css
  4. 9
      src/UserAction.js
  5. 4
      src/index.js

2
src/BalanceShower.js

@ -63,7 +63,7 @@ export class BalanceShower extends PureComponent {
else if(this.state.loading_status==='error')
return (<div className="box box-tip balance-value"><a onClick={()=>{alert(this.state.error)}}>无法查询余额</a></div>);
else if(this.state.loading_status==='done')
return (<div className="box box-tip balance-value">校园卡 {this.state.balance}</div>);
return (<div className="box box-tip balance-value">校园卡 {this.state.balance.toFixed(2)}</div>);
else
return null;
}

6
src/Flows.css

@ -15,7 +15,7 @@
.root-dark-mode .box {
background-color: var(--box-bgcolor-dark);
color: var(--foreground-dark);
box-shadow: 0 0 5px rgba(255,255,255,.15);
box-shadow: 0 0 3px rgba(255,255,255,.2);
}
.root-dark-mode .sidebar .box {
@ -145,7 +145,7 @@
}
.box-header, .box-footer {
font-size: small;
font-size: .8em;
}
.flow-item-row p.img {
@ -161,7 +161,7 @@
}
.root-dark-mode .flow-item-row p.img img {
filter: brightness(.8);
filter: brightness(.85);
}
.box-header-badge {

2
src/Sidebar.css

@ -24,7 +24,7 @@
opacity: .5;
}
.root-dark-mode .sidebar-on .sidebar-shadow:active {
opacity: .3;
opacity: .65;
}
.sidebar {

9
src/UserAction.js

@ -109,7 +109,7 @@ export class LoginForm extends Component {
})
.catch((e)=>{
console.error(e);
alert('发送失败'+e);
alert('发送失败\n'+e);
this.setState({
loading_status: 'done',
});
@ -139,20 +139,19 @@ export class LoginForm extends Component {
.then(get_json)
.then((json)=>{
if(json.code!==0) {
if(json.msg) alert(json.msg);
if(json.msg) throw new Error(json.msg);
throw new Error(JSON.stringify(json));
}
let freshman_welcome=json.uid.indexOf('19')===0 && (+new Date())<1567958400000; // 2019-09-09 0:00 GMT+8
set_token(json.user_token);
alert(`成功以 ${json.name} 的身份登录`+(freshman_welcome ? '\n欢迎来到北京大学!' : ''));
alert(`成功以 ${json.name} 的身份登录`);
this.setState({
loading_status: 'done',
});
})
.catch((e)=>{
console.error(e);
alert('登录失败');
alert('登录失败\n'+e);
this.setState({
loading_status: 'done',
});

4
src/index.js

@ -2,10 +2,10 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {elevate} from './infrastructure/elevator';
//import {elevate} from './infrastructure/elevator';
import registerServiceWorker from './registerServiceWorker';
elevate();
//elevate();
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

Loading…
Cancel
Save