lmw
2023-03-11 4df5bb59e5fe9f9d140e5610f7772dd8a05a28d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.fuban.driver.ui.adapter
 
import android.view.View
import cn.sinata.xldutils.utils.clickDelay
import com.fuban.driver.R
import com.fuban.driver.base.BaseRvAdapter
import com.fuban.driver.base.BaseViewHolder
import com.fuban.driver.bean.CardListBean
import com.fuban.driver.netUtls.Api
import com.fuban.driver.netUtls.callNet
import com.fuban.driver.netUtls.getMapByAny
import kotlinx.android.synthetic.main.item_card_list.view.*
 
class CardListAdapter:BaseRvAdapter<CardListBean.DataBean>() {
    override fun getLayoutResId(viewType: Int): Int {
        return R.layout.item_card_list
    }
 
    override fun onBindItem(holder: BaseViewHolder?, view: View?, item: CardListBean.DataBean?) {
        holder?.let {
            it.itemView.tv_card_name.text = item!!.bank
            it.itemView.tv_card_num.text = item.code
            it.itemView.btn_delete.clickDelay {
                var map = getMapByAny()
                map["id"] = item.id
                callNet(context, Api.delBankCard,map){
                    data.remove(item)
                    notifyDataSetChanged()
                    toast("删除成功")
                }
            }
        }
    }
}