package com.quansu.heifengwuliu.vmodel

import android.os.Bundle
import androidx.lifecycle.MutableLiveData
import com.quansu.heifengwuliu.activity.PasswordActivity
import com.quansu.heifengwuliu.model.User
import com.quansu.heifengwuliu.repository.UserInfoRepository
import com.ysnows.base.base.BViewModel
import com.ysnows.base.utils.UiSwitch

class SettingsVModel : BViewModel<UserInfoRepository>() {
    val user: MutableLiveData<User?> = MutableLiveData(User.get())


    override fun firstReq() {
        super.firstReq()
        repository().getUserInfo()
                .doOnNext() {
                    user.value = it
                }
                .subscribe()

    }

    fun buyVip() {
    }


    //设置登录密码和支付密码 1：登录密码 2支付密码
    fun goPassword(type:Int){
        UiSwitch.bundle(repository().context, PasswordActivity::class.java, Bundle().apply {
            putInt("type",type)
        })
    }

}
