package com.zswc.creativity.vmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.zswc.creativity.model.CollectionList
import com.zswc.creativity.utils.net.NetEngine
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel
import kotlinx.coroutines.launch

/**
 *Created by shihuiyun
 *on 2020/9/23
 */
open class BlindBoxVModel(application: Application) : BViewModel<BRepository>(application) {

    var list = MutableLiveData<List<CollectionList>>()//钓位配置


    fun toGetCollectionList() {

        viewModelScope.launch {
            var it = repository().lreq { NetEngine.service.getCollectionList() }
            if(it.ok()){
               list.value=it.data
            }
        }
    }





    fun getSeatInfo() {//获取数据
//        viewModelScope.launch {
//            var it = repository().lreq { NetEngine.service.activityseat(k_id) }
//            if (it.ok()) {
//                if (null != it.datas) {
//                    list.value = (it.datas as java.util.ArrayList<FishpondSeat>?)!!
//                }
//
//            }
//        }
    }


}
