Fix bug
This commit is contained in:
@@ -7,6 +7,7 @@ import { MineStatus, Mine } from '@/types/common';
|
|||||||
import { dispatch } from '@/utils/utils';
|
import { dispatch } from '@/utils/utils';
|
||||||
|
|
||||||
import styles from './style.less';
|
import styles from './style.less';
|
||||||
|
import { displayTime } from '@/utils/transform';
|
||||||
|
|
||||||
const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
|
const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
|
||||||
dispatch,
|
dispatch,
|
||||||
@@ -62,7 +63,7 @@ const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
|
|||||||
const renderItem = (it: Mine) => (
|
const renderItem = (it: Mine) => (
|
||||||
<div className={styles.item} key={it.id}>
|
<div className={styles.item} key={it.id}>
|
||||||
<div className="line">
|
<div className="line">
|
||||||
<div>{formatMessage({ id: 'home.mine.validTime' })}{it.createdAt}</div>
|
<div>{formatMessage({ id: 'home.mine.validTime' })}{displayTime(it.createdAt)}</div>
|
||||||
<div className="amount">+{it.amount} KG</div>
|
<div className="amount">+{it.amount} KG</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="line">
|
<div className="line">
|
||||||
@@ -70,7 +71,7 @@ const MinePage: React.FC<HomeMineModelState & DispatchProp> = ({
|
|||||||
{formatMessage({ id: 'home.mine.status' })}
|
{formatMessage({ id: 'home.mine.status' })}
|
||||||
{formatMessage({ id: `home.mine.status${it.status}` })}
|
{formatMessage({ id: `home.mine.status${it.status}` })}
|
||||||
</div>
|
</div>
|
||||||
<div className="small">{formatMessage({ id: 'home.mine.invalidTime' })}{it.expiresAt}</div>
|
<div className="small">{formatMessage({ id: 'home.mine.invalidTime' })}{displayTime(it.expiresAt)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import List from '@/components/List';
|
|||||||
|
|
||||||
import styles from './style.less';
|
import styles from './style.less';
|
||||||
import { isApp } from '@/utils/h5plus';
|
import { isApp } from '@/utils/h5plus';
|
||||||
|
import { displayTime } from '@/utils/transform';
|
||||||
|
|
||||||
const FundPage: React.FC<HomeFundModelState & DispatchProp> = ({
|
const FundPage: React.FC<HomeFundModelState & DispatchProp> = ({
|
||||||
dispatch,
|
dispatch,
|
||||||
@@ -67,14 +68,14 @@ const FundPage: React.FC<HomeFundModelState & DispatchProp> = ({
|
|||||||
<div>{formatMessage({ id: `home.fund.type${it.type}` })}</div>
|
<div>{formatMessage({ id: `home.fund.type${it.type}` })}</div>
|
||||||
<div className={`amount ${it.op === JournalOp.Income ? 'active' : ''}`}>
|
<div className={`amount ${it.op === JournalOp.Income ? 'active' : ''}`}>
|
||||||
{it.op === JournalOp.Income ? '+' : '-'}{it.amount}
|
{it.op === JournalOp.Income ? '+' : '-'}{it.amount}
|
||||||
{it.coinType.toUpperCase()}
|
{(it.tokenType || '').toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="line">
|
<div className="line">
|
||||||
<div className="detail">
|
<div className="detail">
|
||||||
{it.detail}
|
{it.detail}
|
||||||
</div>
|
</div>
|
||||||
<div className="small">{it.createdAt}</div>
|
<div className="small">{displayTime(it.createdAt)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import List from '@/components/List';
|
|||||||
import { dispatch } from '@/utils/utils';
|
import { dispatch } from '@/utils/utils';
|
||||||
|
|
||||||
import styles from './style.less';
|
import styles from './style.less';
|
||||||
import { displayPhone } from '@/utils/transform';
|
import { displayPhone, displayTime } from '@/utils/transform';
|
||||||
import { isApp } from '@/utils/h5plus';
|
import { isApp } from '@/utils/h5plus';
|
||||||
|
|
||||||
const CommunityPage: React.FC<HomeCommunityModelState & DispatchProp> = ({
|
const CommunityPage: React.FC<HomeCommunityModelState & DispatchProp> = ({
|
||||||
@@ -85,7 +85,7 @@ const CommunityPage: React.FC<HomeCommunityModelState & DispatchProp> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="line">
|
<div className="line">
|
||||||
<span>{it.nickname || displayPhone(it.phone)}</span>
|
<span>{it.nickname || displayPhone(it.phone)}</span>
|
||||||
<span className="time">{formatMessage({ id: 'home.community.time' })}{it.createdAt}</span>
|
<span className="time">{formatMessage({ id: 'home.community.time' })}{displayTime(it.createdAt)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ export interface Journal {
|
|||||||
|
|
||||||
amount: string;
|
amount: string;
|
||||||
|
|
||||||
coinType: string;
|
tokenType: string;
|
||||||
|
|
||||||
op: JournalOp;
|
op: JournalOp;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import md5 from 'md5';
|
import md5 from 'md5';
|
||||||
import { AreaCode, Estate } from '@/types/common';
|
import { AreaCode, Estate } from '@/types/common';
|
||||||
|
import moment, { Moment } from 'moment';
|
||||||
|
|
||||||
export function encodePhone(code: AreaCode, phone: string): string {
|
export function encodePhone(code: AreaCode, phone: string): string {
|
||||||
if (code && code.areacode) return `+${code.areacode}-${phone || ''}`;
|
if (code && code.areacode) return `+${code.areacode}-${phone || ''}`;
|
||||||
@@ -50,3 +51,7 @@ export function encryptPwd(pwd: string): string {
|
|||||||
export function displayPhone(phone: string): string {
|
export function displayPhone(phone: string): string {
|
||||||
return `1******${_.takeRight(phone, 4).join('')}`;
|
return `1******${_.takeRight(phone, 4).join('')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function displayTime(time: string | Moment): string {
|
||||||
|
return moment(time).format('YYYY-MM-DD HH:mm');
|
||||||
|
}
|
||||||
|
|||||||
@@ -9818,11 +9818,16 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@
|
|||||||
dependencies:
|
dependencies:
|
||||||
minimist "0.0.8"
|
minimist "0.0.8"
|
||||||
|
|
||||||
moment@2.x, moment@^2.22.1, moment@^2.24.0:
|
moment@2.x, moment@^2.22.1:
|
||||||
version "2.24.0"
|
version "2.24.0"
|
||||||
resolved "https://registry.npm.taobao.org/moment/download/moment-2.24.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
resolved "https://registry.npm.taobao.org/moment/download/moment-2.24.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
||||||
integrity sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s=
|
integrity sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s=
|
||||||
|
|
||||||
|
moment@^2.24.0:
|
||||||
|
version "2.24.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
||||||
|
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
|
||||||
|
|
||||||
moo@^0.4.3:
|
moo@^0.4.3:
|
||||||
version "0.4.3"
|
version "0.4.3"
|
||||||
resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
|
resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
|
||||||
|
|||||||
Reference in New Issue
Block a user