1
0
Fork 0
tera-wallet/src/pages/index/index.tsx

60 lines
1.6 KiB
TypeScript

import { connect } from '@tarojs/redux';
import { AtCard, AtNoticebar } from 'taro-ui';
import { View, Image } from '@tarojs/components';
import Taro, { Component, Config } from '@tarojs/taro';
import logoImg from '../../assets/images/logo.png';
import { mapDefaultProps } from '../../models/utils';
import './index.scss';
import { IndexProps, IndexState } from './type';
@connect(mapDefaultProps(Index))
class Index extends Component<IndexProps, IndexState> {
config: Config = {
navigationBarTitleText: '首页',
enablePullDownRefresh: true
}
state = {
notify: '通知: 钱包目前处于测试阶段 如果发现BUG 请及时反馈!'
}
componentDidMount() {
Taro.startPullDownRefresh();
}
async onPullDownRefresh() {
await this.props.dispatch({
type: 'index/getCurrentInfo'
})
}
render() {
const data = this.props
const info = (
<AtCard className='base-info' title='基本信息'>
<View>: {data.version}</View>
<View>: {data.block}</View>
<View>: {data.supply}</View>
<View> : {data.percent}</View>
<View>: {data.lastNumber}</View>
<View> : {data.lastMiner} {data.lastName}</View>
</AtCard>
)
return (
<View className='page page-index'>
<AtNoticebar close marquee icon='volume-plus'>
{this.state.notify}
</AtNoticebar>
<View className='logo'>
<Image src={logoImg} className='img' mode='scaleToFill' />
</View>
<View className='page-title'></View>
{info}
</View>
)
}
}
export default Index