ElectronicCardLookInfoActivity.java 3.76 KB
package com.hjx.personalcenter.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hjx.personalcenter.R;
import com.hjx.personalcenter.db.Content;
import com.hjx.personalcenter.db.SaveParam;
import com.hjx.personalcenter.util.GetDevicesUtil;

/**
 * Created by h on 2017/8/11.
 */

public class ElectronicCardLookInfoActivity extends AppCompatActivity implements View.OnClickListener{
    private ImageView iv_last_step;
    private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,
            shopadress,phone,tlePhone,tv_card_adress_change,tv_card_phone_change;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_electronic_look_cardinfo);
        initView();
        initData();
        initLister();
    }
    private void initView() {
        usename = (TextView) findViewById(R.id.iv_card_username);
        iv_last_step  = (ImageView) findViewById(R.id.cancel);
        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);
        tv_card_adress_change = (TextView) findViewById(R.id.tv_card_adress_change);
        tv_card_phone_change = (TextView) findViewById(R.id.tv_card_phone_change);
    }
    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() {
        tv_card_adress_change.setOnClickListener(this);
        tv_card_phone_change.setOnClickListener(this);
        iv_last_step.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_card_adress_change:
                Intent intent = new Intent();
                intent.setClass(this,ChangeElectronicCardAdressInfoActivity.class);
                startActivity(intent);
                overridePendingTransition(R.anim.rightin, R.anim.rightout);

                break;
            case R.id.tv_card_phone_change:
                Content.authcodeflag =2;
                Intent intent1 = new Intent();
                intent1.setClass(this,ElectronicCardValidationActivity.class);
                startActivity(intent1);
                overridePendingTransition(R.anim.rightin, R.anim.rightout);


                break;
            case R.id.cancel:
                finish();
                break;
        }
    }

}