package com.yidianling.user.mine.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by jiucheng on 2018/7/13.
 * 功能：
 */
class AccountBean() :Parcelable{
    var id: String? = null//id
    var uid: String? = null//id
    var type: Int? = -1//1,//账号类型：1、支付宝；2、微信；3、银行卡
    var cashName: String? = null//提现姓名
    var bankRealName: String? = null//提现姓名
    var bankName: String? = null//1、中国建设银行；2、中国工商银行；3、中国农业银行；4、中国银
    var bankAddress: String? = null//"建设银行滨江支行",//支行
    var account: String? = null//sdfas***@163.com
    var bankIcon: String? = null//http://www.yidainling.com/asdfadsf.jpg
    var remark: String? = null//工作日9-18点，到账时间：2小时内；休息日顺延至下一个工作日
    var isDefault: Int = -1//默认账户 1默认2非默认
    var status: Int = -1//1' => "未审核", '2' => "审核中",'3' => "审核成功",'4' => "审核失败"5、

    constructor(parcel: Parcel) : this() {
        id = parcel.readString()
        uid = parcel.readString()
        type = parcel.readValue(Int::class.java.classLoader) as? Int
        cashName = parcel.readString()
        bankRealName = parcel.readString()
        bankName = parcel.readString()
        bankAddress = parcel.readString()
        account = parcel.readString()
        bankIcon = parcel.readString()
        remark = parcel.readString()
        isDefault = parcel.readInt()
        status = parcel.readInt()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(uid)
        parcel.writeValue(type)
        parcel.writeString(cashName)
        parcel.writeString(bankRealName)
        parcel.writeString(bankName)
        parcel.writeString(bankAddress)
        parcel.writeString(account)
        parcel.writeString(bankIcon)
        parcel.writeString(remark)
        parcel.writeInt(isDefault)
        parcel.writeInt(status)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AccountBean> {
        override fun createFromParcel(parcel: Parcel): AccountBean {
            return AccountBean(parcel)
        }

        override fun newArray(size: Int): Array<AccountBean?> {
            return arrayOfNulls(size)
        }
    }
}