package com.zswc.creativity.vmodel

import android.app.Application
import com.tencent.mmkv.MMKV
import com.ysnows.base.base.BRepository
import com.ysnows.base.base.BViewModel
import com.ysnows.base.utils.B
import com.ysnows.base.utils.UiSwitch
import com.zswc.creativity.activity.*

class SettingVModel(application: Application) : BViewModel<BRepository>(application)  {

    //退出登录
    fun  toExitLogin(){
        //只清空token
        MMKV.defaultMMKV().putString("token", "")
        UiSwitch.single_new_task_with_clear_task(repository().context, LoginActivity::class.java)
    }


    fun toAgree(a:Int){

        UiSwitch.bundle(repository().context, ArticleDetailActivity::class.java,
                B().putString("type","2")
                        .putString("chose",a.toString())
                        .ok())
    }
    fun  toMyInfo(){
        UiSwitch.single(repository().context, MyInfoActivity::class.java)
    }

    fun toAccountSafe(){
        UiSwitch.single(repository().context, AccountSafeActivity::class.java)

    }

    fun toChangePassword(){
        UiSwitch.single(repository().context, ChangePasswordActivity::class.java)

    }
    fun toBindBank(){
        UiSwitch.single(repository().context, BindBankActivity::class.java)
    }







}
