package com.zj365.health.fragment

import com.xty.base.fragment.BaseVmFrag
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonUtils
import com.zj365.health.databinding.FragProgrammeBinding
import com.zj365.health.vm.MyProgVm

/**
 * 我的方案  弃用
 */
class MyProgFrag: BaseVmFrag<MyProgVm>() {
    val binding by lazy { FragProgrammeBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root

    override fun initView() {
        super.initView()

        binding.mTvHistory.setOnClickListener {

            RouteManager.goAct(ARouterUrl.PROGRAMME_HISTORY)
        }

        CommonUtils.getMyUserInfo()?.let {
            mViewModel.getNesProg(it.id.toString())
        }
    }

    override fun setViewModel()= MyProgVm()

    override fun observer() {
        mViewModel.progLive.observe(this){
            if(it.data.isNotEmpty()){
                binding.mContent.text=it.data[0].prName
            }

        }
    }

}