package com.quansu.heifengwuliu.vmodel

import android.app.Activity
import android.content.Intent
import com.quansu.heifengwuliu.utils.net.NetEngine
import com.ysnows.base.base.BRRepository
import com.ysnows.base.base.BRViewModel

class InvoiceVModel : BRViewModel<BRRepository>() {


    fun setSaveDriver(arr:String){
        //添加司机

        repository()
                .lreq(NetEngine.service.setDriver(arr))
                .doOnNext {
                    if (it.ok(true)) {
                        val intent = Intent()
                        var con = repository().context as Activity
                        con.setResult(Activity.RESULT_OK, intent)
                        con.finish()
                    }
                }
                .subscribe()
    }






}
