Style fix
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
text-align: center;
|
||||
line-height: @header-height;
|
||||
font-size: 1.5rem;
|
||||
transition: background-color .15s;
|
||||
|
||||
&:active {
|
||||
background-color: @bg-color;
|
||||
background-color: rgba(255, 255, 255, .2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Model } from 'dva';
|
||||
import _ from 'lodash';
|
||||
import { getLocale, setLocale } from 'umi-plugin-locale'
|
||||
import { loadUser, storeUser, clearUser } from '@/utils/storage';
|
||||
import { loadUser, storeUser, clearUser, clearMineList } from '@/utils/storage';
|
||||
import { User } from '@/types/common';
|
||||
|
||||
const initState = () => {
|
||||
@@ -45,6 +45,7 @@ const model: Model = {
|
||||
},
|
||||
|
||||
*logout(_, { put, all }) {
|
||||
clearMineList();
|
||||
yield all([
|
||||
put({ type: 'clearUser' }),
|
||||
put({ type: 'home/clear' }),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { connect, DispatchProp } from 'dva';
|
||||
import { connect, DispatchProp, routerRedux } from 'dva';
|
||||
import { Spin, Icon } from 'antd';
|
||||
import { formatMessage } from 'umi-plugin-locale';
|
||||
import { HomeMineModelState } from './model';
|
||||
@@ -53,7 +53,10 @@ const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="right app-btn">
|
||||
<div
|
||||
onClick={() => dispatch(routerRedux.push('/mine'))}
|
||||
className="right app-btn"
|
||||
>
|
||||
{formatMessage({ id: 'home.mine.retrieve' })}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
35
src/pages/mine/index.tsx
Normal file
35
src/pages/mine/index.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Title: 获取矿晶
|
||||
* Routes:
|
||||
* - ./src/pages/routes
|
||||
*/
|
||||
import React, { useEffect } from 'react';
|
||||
import { connect, DispatchProp } from 'dva';
|
||||
import { Spin, Tabs } from 'antd';
|
||||
import { formatMessage } from 'umi-plugin-locale';
|
||||
import FittedImage from 'react-fitted-image';
|
||||
import { MineModelState } from './model';
|
||||
import { PageState, EstateType } from '@/types/common';
|
||||
import Header from '@/components/Header';
|
||||
import Info, { InfoItem } from '@/components/Info';
|
||||
import Failure from '@/components/Failure';
|
||||
|
||||
import styles from './style.less';
|
||||
|
||||
const MinePage: React.FC<DispatchProp & MineModelState> = ({
|
||||
dispatch,
|
||||
}) => {
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Header
|
||||
className="header"
|
||||
title={formatMessage({ id: 'home.mine.retrieve' })}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect(
|
||||
({ mine }: any) => ({ ...mine }),
|
||||
)(MinePage);
|
||||
31
src/pages/mine/model.ts
Normal file
31
src/pages/mine/model.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Model, routerRedux } from "dva";
|
||||
import { message } from 'antd';
|
||||
import { Estate, PageState } from '@/types/common';
|
||||
import { getEstateDetail } from './service';
|
||||
import { isDev } from '@/utils/utils';
|
||||
|
||||
export interface MineModelState {
|
||||
}
|
||||
|
||||
const initState: MineModelState = {
|
||||
};
|
||||
|
||||
const model: Model = {
|
||||
namespace: 'mine',
|
||||
|
||||
state: initState,
|
||||
|
||||
effects: {
|
||||
},
|
||||
|
||||
reducers: {
|
||||
onUpdateState(state, payload) {
|
||||
return {
|
||||
...state,
|
||||
...payload,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default model;
|
||||
18
src/pages/mine/service.ts
Normal file
18
src/pages/mine/service.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import http from '@/utils/http';
|
||||
import { Estate, EstateType } from '@/types/common';
|
||||
import { calcEstate } from '@/utils/transform';
|
||||
|
||||
export async function getEstateDetail(id: string) {
|
||||
const {
|
||||
ok,
|
||||
data,
|
||||
msg,
|
||||
} = await http.get<Estate>('/estateorder/detail', { id });
|
||||
if (ok && data) {
|
||||
data.type = data.outTime ? EstateType.Sold : EstateType.Hold;
|
||||
calcEstate(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
throw Error(msg);
|
||||
}
|
||||
15
src/pages/mine/style.less
Normal file
15
src/pages/mine/style.less
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
@import '../../global.less';
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
background: linear-gradient(to bottom, @purple-one, @purple-two);
|
||||
position: relative;
|
||||
|
||||
:global {
|
||||
.header {
|
||||
background-color: rgba(255,255,255,0);
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,10 @@ function loadMineList() {
|
||||
}
|
||||
}
|
||||
|
||||
function clearMineList() {
|
||||
localStorage.removeItem(mineListKey);
|
||||
}
|
||||
|
||||
export {
|
||||
storeUser,
|
||||
loadUser,
|
||||
@@ -60,4 +64,5 @@ export {
|
||||
|
||||
storeMineList,
|
||||
loadMineList,
|
||||
clearMineList,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user