添加 h5

This commit is contained in:
saplf
2019-09-07 14:39:03 +08:00
parent 71a3719bcf
commit 49fe983181
9 changed files with 507 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ import { PageState } from '@/types/common';
import Header from '@/components/Header';
import styles from './style.less';
import h5plus from '@/utils/h5plus';
const Option = Select.Option;
@@ -44,8 +45,17 @@ const DrawPage: React.FC<DispatchProp & DrawModelState> = ({
);
} else if (pageState === PageState.Success) {
const coinLabel = coin && coin.label.toUpperCase();
const onScan = () => {
message.warn(formatMessage({ id: 'draw.qrPrompt' }));
const onScan = async () => {
if (h5plus.isApp()) {
const result = await h5plus.scan();
if (result) {
dispatch({ type: 'draw/onUpdateState', address: result });
} else {
message.warn(formatMessage({ id: 'draw.qrPrompt' }));
}
} else {
message.warn(formatMessage({ id: 'draw.qrPrompt' }));
}
}
const confirmContent = (
<Modal