diff --git a/health/src/main/java/com/zj365/health/act/psychological/PsychologicalResultAct.kt b/health/src/main/java/com/zj365/health/act/psychological/PsychologicalResultAct.kt index cb8c9d8..3e7d13d 100644 --- a/health/src/main/java/com/zj365/health/act/psychological/PsychologicalResultAct.kt +++ b/health/src/main/java/com/zj365/health/act/psychological/PsychologicalResultAct.kt @@ -5,25 +5,36 @@ import com.xty.base.act.BaseVmAct import com.xty.base.vm.BaseVm import com.zj365.health.adapter.psychological.PsychologicalRecommendAdapter import com.zj365.health.databinding.ActPsychologicalResultBinding +import com.zj365.health.vm.PsychologicalResultVm -class PsychologicalResultAct: BaseVmAct() { +class PsychologicalResultAct: BaseVmAct() { val binding by lazy { ActPsychologicalResultBinding.inflate(layoutInflater) } val mAdapter by lazy { PsychologicalRecommendAdapter() } + var answerId:Long = 0 + override fun initView() { super.initView() statusBar(binding.title.mView) - binding.title.mTvTitle.text = "性格测试总结" binding.title.mIvBack.setOnClickListener { finish() } + answerId = intent.extras!!.getLong("answerId",0) + + mViewModel.getPsychologicalResult(answerId) binding.recycler.layoutManager = LinearLayoutManager(this) binding.recycler.adapter = mAdapter } override fun liveObserver() { + + mViewModel.psychologicalResultData.observe(this){ + binding.title.mTvTitle.text = "${it.data.surveyName}" + binding.tvSummaryContent.text = "${it.data.conclusionText}" + + } } override fun setLayout() = binding.root