| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | setTitleText("添加银行卡") |
| | | setTitleText("添加支付宝账号") |
| | | if (data != null){ |
| | | setTitleText("修改银行卡") |
| | | setTitleText("修改支付宝账号") |
| | | setInfo(data as CardListBean.DataBean) |
| | | } |
| | | } |
| | | |
| | | private fun setInfo(dataBean: CardListBean.DataBean) { |
| | | tv_card_site.gone() |
| | | et_card_name.setText(dataBean.name) |
| | | et_card_num.setText(dataBean.code) |
| | | et_card_bank_name.setText(dataBean.bankName) |
| | | et_card_name.setText(dataBean.userName) |
| | | et_card_num.setText(dataBean.account) |
| | | tv_add_card.text = "修改" |
| | | id = dataBean.id.toString() |
| | | cardName = dataBean.bank |
| | | } |
| | | |
| | | var cardName = "" |
| | | |
| | | override fun setOnclick() { |
| | | tv_card_site.clickDelay { |
| | | var pop = DialogUtil.getPopupwindow(this,R.layout.pop_card_list) |
| | | pop.contentView.rl_container.clickDelay { |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_car_info.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info.text.toString() |
| | | cardName = pop.contentView.tv_car_info.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | |
| | | pop.contentView.tv_car_info_ny.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info_ny.text.toString() |
| | | cardName = pop.contentView.tv_car_info_ny.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_car_info_zg.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info_zg.text.toString() |
| | | cardName = pop.contentView.tv_car_info_zg.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_car_info_js.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info_js.text.toString() |
| | | cardName = pop.contentView.tv_car_info_js.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_car_info_yz.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info_yz.text.toString() |
| | | cardName = pop.contentView.tv_car_info_yz.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | pop.contentView.tv_car_info_quit.clickDelay { |
| | | tv_card_site.text = pop.contentView.tv_car_info_quit.text.toString() |
| | | cardName = pop.contentView.tv_car_info_quit.text.toString() |
| | | pop.dismiss() |
| | | } |
| | | pop.showDown(window.decorView) |
| | | } |
| | | |
| | | |
| | | tv_add_card.clickDelay { |
| | | if (et_card_name.getContent().isEmpty()){ |
| | | toast("请输入姓名") |
| | | return@clickDelay |
| | | } |
| | | if (et_card_num.getContent().isEmpty()){ |
| | | toast("请输入银行卡号码") |
| | | return@clickDelay |
| | | } |
| | | if (!PhoneCheckUtil.checkBankCard(et_card_num.getContent().trim())){ |
| | | toast("银行卡号码错误") |
| | | return@clickDelay |
| | | } |
| | | if (cardName.isEmpty()){ |
| | | toast("请选择银行卡") |
| | | return@clickDelay |
| | | } |
| | | if (et_card_bank_name.getContent().isEmpty()){ |
| | | toast("请填写开户行名称") |
| | | toast("请输入支付宝账号") |
| | | return@clickDelay |
| | | } |
| | | |
| | | var map = getMapByAny() |
| | | map["bank"] = cardName |
| | | map["code"] = et_card_num.getContent() |
| | | map["name"] = et_card_name.getContent() |
| | | map["bankName"] = et_card_bank_name.getContent() |
| | | map["account"] = et_card_num.getContent() |
| | | map["userName"] = et_card_name.getContent() |
| | | var url = Api.saveBankCard |
| | | if (data != null){ |
| | | map["id"] = id |
| | |
| | | } |
| | | callNet(url,map){ |
| | | onBackPressed() |
| | | toast("成功") |
| | | toast("保存成功") |
| | | } |
| | | } |
| | | } |