private void initView() { TextView tv_title = (TextView) findViewById(R.id.tv_title); ibtn_title_back = (ImageButton) findViewById(R.id.ibtn_title_back); ibtn_title_back.setVisibility(View.VISIBLE); TextView tv_right = (TextView) findViewById(R.id.tv_right); tv_right.setVisibility(View.GONE); tv_title.setText("银行卡支付"); cz_money = getIntent().getStringExtra("tip"); et_user_name = (EditText) findViewById(R.id.et_user_name); et_user_card = (EditText) findViewById(R.id.et_user_card); et_user_ban = (EditText) findViewById(R.id.et_user_ban); et_user_phone = (EditText) findViewById(R.id.et_user_phone); ibtn_submit_next = (Button) findViewById(R.id.ibtn_submit_next); rl_bank_name = (RelativeLayout) findViewById(R.id.rl_bank_name); tv_bank_name = (TextView) findViewById(R.id.tv_bank_name_name); btn_vericode = (Button) findViewById(R.id.btn_vericode); bankcardnum = (TextView) findViewById(R.id.bankcardnum); et_vericode = (EditText) findViewById(R.id.et_vericode); ibtn_submit_next.setEnabled(false); }
private void initListener() { ibtn_title_back.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { finish(); TXWLApplication.getInstance().popStack(AddBankCardActivity.this); } }); rl_bank_name.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { // 跳转到银行卡列表 用startActivityForResult取回选择的银行 Intent intent = new Intent(AddBankCardActivity.this, BankSelectionActivity.class); startActivityForResult(intent, Constant.RequestCode); } }); ibtn_submit_next.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { TXWLProgressDialog.createDialog(AddBankCardActivity.this); TXWLProgressDialog.setMessage("支付中..."); try { token = beiFuHttpPost.getToken(); } catch (Exception e) { } // 放在这里做测试 // boundBankCard(); // 完成1元支付,跳转到支付成功界面 String vericode = et_vericode.getText().toString(); if (!"".equals(vericode)) { if (token != null) { new BeiFuPayPhishingKey().execute(); } } else { TXWLProgressDialog.Dismiss(); TXWLApplication.getInstance().showTextToast("验证码还未获取,请稍等"); } } }); btn_vericode.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { if (!verification()) { Log.d("billno -->", billno); // 获取验证码 beiFuHttpPost = new BeiFuHttpPost(); beiFuHttpPost.execute( billno, name, idcard, bankid, phone, cz_money, PreferenceUtils.getUserId() + "", bank_code); MyCountDownTimer mc = new MyCountDownTimer(60000, 1000); mc.start(); btn_vericode.setEnabled(false); // TXWLApplication.getInstance().showTextToast("获取验证码后请不要再修改信息"); } } }); et_user_ban.addTextChangedListener(textwatcher); et_vericode.addTextChangedListener(vericodewatcher); }
@Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { ibtn_submit_next.setEnabled(true); }