package com.zj365.health.act

import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.zj365.health.adapter.AnswerAdapter
import com.zj365.health.databinding.ActPaySuccessBinding
import com.zj365.health.vm.PayCancerVm

/**
 * 已填问卷列表
 */
@Route(path = ARouterUrl.PAY_SUCCESS)
class PaySuccessAct : BaseVmAct<PayCancerVm>() {

    val mAdapter by lazy { AnswerAdapter() }
    val binding by lazy { ActPaySuccessBinding.inflate(layoutInflater) }
    override fun setLayout() = binding.root
    override fun initData() {
        super.initData()
        orderNo = intent.getStringExtra("orderNo")
        orderType = intent.getStringExtra("orderType")
    }

    var orderNo:String? = ""
    //1为AI防癌 2为AI舌诊
    var orderType:String? = ""
    override fun initView() {
        super.initView()
        statusBar(binding.title.mView)
        binding.title.mTvTitle.text = "支付成功"
        binding.title.mIvBack.setOnClickListener { finish() }

        binding.mNext.setOnClickListener {
            when (orderType) {
                "1" -> {
                    //下一步知情同意书
                    bundle.clear()
                    bundle.putString("orderNo",orderNo)
                    RouteManager.goAct(ARouterUrl.AGREE,bundle)
                    finish()
                }
                "2" -> {
                    //下一步填写问诊信息
                    bundle.clear()
                    bundle.putString("orderNo",orderNo)
                    RouteManager.goAct(ARouterUrl.TONGUE_EDIT_INFO_ACTIVITY,bundle)
                    finish()
                }
                else -> {}
            }

        }
        binding.mNext.isSelected = true

    }

    override fun liveObserver() {

    }

}