ElectronicCardInfoOKActivity.java 3.46 KB
package com.hjx.personalcenter.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.hjx.personalcenter.R;
import com.hjx.personalcenter.db.SaveParam;
import com.hjx.personalcenter.http.HttpManager;
import com.hjx.personalcenter.util.GetDevicesUtil;

/**确认保卡信息
 * Created by h on 2017/8/11.
 */

public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener {
    private Button btn_finish;
    private ImageView iv_last_step;
    private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ok_cardinfo);
        initView();
        initData();
        initLister();
    }
    private void initView() {
        btn_finish = (Button) findViewById(R.id.btn_finish);
        iv_last_step  = (ImageView) findViewById(R.id.cancel);
        usename = (TextView) findViewById(R.id.iv_card_username);
        deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel);
        customer_address = (TextView) findViewById(R.id.tv_card_adress);
        mac_adress = (TextView) findViewById(R.id.tv_card_mac);
        shoptime = (TextView) findViewById(R.id.tv_card_time);
        deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber);
        shopadress = (TextView) findViewById(R.id.tv_card_shopAdress);
        phone = (TextView) findViewById(R.id.tv_card_phone);
        tlePhone = (TextView) findViewById(R.id.tv_card_tleNember);
    }

    private void initData() {
        //获取设备信息
        deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel());
        deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber());
        mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac());
        //获取保卡信息
        usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME));
        customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM));
        shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME));
        shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS));
        tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE));
        phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE));


    }

    private void initLister() {
        iv_last_step.setOnClickListener(this);
        btn_finish.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_finish:
                HttpManager.getInstance().subcardinfo(this,636,usename.getText().toString().trim(),
                        customer_address.getText().toString().trim(),shopadress.getText().toString().trim(),
                        shoptime.getText().toString().trim(),tlePhone.getText().toString().trim(),
                        deviceModel.getText().toString().trim(),deviceNumber.getText().toString().trim(),
                        mac_adress.getText().toString().trim(),phone.getText().toString().trim());
                break;
            case R.id.cancel:
                finish();
                break;
        }
    }

    
}