|
|
@@ -1,9 +1,11 @@
|
|
|
import React, { Component } from "react";
|
|
|
import Taro from "@tarojs/taro";
|
|
|
import { View, Button } from "@tarojs/components";
|
|
|
-import { AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
|
|
|
+import { AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction, } from "taro-ui";
|
|
|
import { addAccount, editAccount } from '../../../utils/servers/servers';
|
|
|
+import BankModal from '../../common/bankModal'
|
|
|
|
|
|
+import './index.less';
|
|
|
import "taro-ui/dist/style/components/modal.scss";
|
|
|
|
|
|
class AccountModal extends Component {
|
|
|
@@ -11,6 +13,7 @@ class AccountModal extends Component {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
data: {},
|
|
|
+ isshowDrawer: false,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -98,69 +101,99 @@ class AccountModal extends Component {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ openshowDrawer() {
|
|
|
+ this.setState({
|
|
|
+ isshowDrawer: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ closeshowDrawer() {
|
|
|
+ this.setState({
|
|
|
+ isshowDrawer: false,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ getHot(i) {
|
|
|
+ const { data = {}, } = this.state
|
|
|
+ data.bank = i.name
|
|
|
+ this.setState({
|
|
|
+ isshowDrawer: false,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
- const { data = {} } = this.state
|
|
|
+ const { data = {}, } = this.state
|
|
|
const { visible = "", onClose } = this.props;
|
|
|
return (
|
|
|
- <AtModal
|
|
|
- isOpened={visible != ""}
|
|
|
- closeOnClickOverlay={false}
|
|
|
- >
|
|
|
- <AtModalHeader>{visible == "add" ? "新增收款账户" : visible == "edit" && "编辑收款账户"}</AtModalHeader>
|
|
|
- <AtModalContent>
|
|
|
- <View className="modal">
|
|
|
- <View>
|
|
|
- <AtInput
|
|
|
- required
|
|
|
- name='name'
|
|
|
- title='账户姓名:'
|
|
|
- type='text'
|
|
|
- placeholder='请输入账户姓名'
|
|
|
- value={data.name}
|
|
|
- onChange={e => { data.name = e }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View>
|
|
|
- <AtInput
|
|
|
- required
|
|
|
- name='address'
|
|
|
- title='银行名称:'
|
|
|
- type='text'
|
|
|
- placeholder='请输入银行名称'
|
|
|
- value={data.bank}
|
|
|
- onChange={e => { data.bank = e }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View>
|
|
|
- <AtInput
|
|
|
- required
|
|
|
- name='bank'
|
|
|
- title='开户银行:'
|
|
|
- type='text'
|
|
|
- placeholder='请输入开户银行'
|
|
|
- value={data.openBank}
|
|
|
- onChange={e => { data.openBank = e }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View>
|
|
|
- <AtInput
|
|
|
- required
|
|
|
- name='code'
|
|
|
- title='银行账户:'
|
|
|
- type='number'
|
|
|
- placeholder='请输入银行账户'
|
|
|
- value={data.accounts}
|
|
|
- onChange={e => { data.accounts = e }}
|
|
|
- />
|
|
|
+ <View>
|
|
|
+ <AtModal
|
|
|
+ isOpened={visible != ""}
|
|
|
+ closeOnClickOverlay={false}
|
|
|
+ >
|
|
|
+ <AtModalHeader>{visible == "add" ? "新增收款账户" : visible == "edit" && "编辑收款账户"}</AtModalHeader>
|
|
|
+ <AtModalContent>
|
|
|
+ <View className="modal">
|
|
|
+ <View>
|
|
|
+ <AtInput
|
|
|
+ required
|
|
|
+ name='name'
|
|
|
+ title='账户姓名:'
|
|
|
+ type='text'
|
|
|
+ placeholder='请输入账户姓名'
|
|
|
+ value={data.name}
|
|
|
+ onChange={e => { data.name = e }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View onClick={() => {
|
|
|
+ this.openshowDrawer()
|
|
|
+ }}>
|
|
|
+ <AtInput
|
|
|
+ required
|
|
|
+ editable={false}
|
|
|
+ name='address'
|
|
|
+ title='银行名称:'
|
|
|
+ type='text'
|
|
|
+ placeholder='请选择银行名称'
|
|
|
+ value={data.bank}
|
|
|
+ onChange={e => { data.bank = e }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View>
|
|
|
+ <AtInput
|
|
|
+ required
|
|
|
+ name='bank'
|
|
|
+ title='开户银行:'
|
|
|
+ type='text'
|
|
|
+ placeholder='请输入开户银行'
|
|
|
+ value={data.openBank}
|
|
|
+ onChange={e => { data.openBank = e }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View>
|
|
|
+ <AtInput
|
|
|
+ required
|
|
|
+ name='code'
|
|
|
+ title='银行账户:'
|
|
|
+ type='number'
|
|
|
+ placeholder='请输入银行账户'
|
|
|
+ value={data.accounts}
|
|
|
+ onChange={e => { data.accounts = e }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
</View>
|
|
|
- </View>
|
|
|
- </AtModalContent>
|
|
|
- <AtModalAction>
|
|
|
- <Button onClick={onClose}>取消</Button>
|
|
|
- <Button onClick={this.onSubmit.bind(this, visible, 1)}>保存并设置为默认账户</Button>
|
|
|
- <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>
|
|
|
- </AtModalAction>
|
|
|
- </AtModal>
|
|
|
+ </AtModalContent>
|
|
|
+ <AtModalAction>
|
|
|
+ <Button onClick={onClose}>取消</Button>
|
|
|
+ <Button onClick={this.onSubmit.bind(this, visible, 1)}>保存并设置为默认账户</Button>
|
|
|
+ <Button onClick={this.onSubmit.bind(this, visible, 0)}>保存账户</Button>
|
|
|
+ </AtModalAction>
|
|
|
+ </AtModal>
|
|
|
+ <BankModal
|
|
|
+ closeshowDrawer={this.closeshowDrawer.bind(this)}
|
|
|
+ isshowDrawer={this.state.isshowDrawer}
|
|
|
+ getHot={this.getHot.bind(this)}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
);
|
|
|
}
|
|
|
}
|