package com.swago.user

import androidx.activity.viewModels
import com.alibaba.android.arouter.facade.annotation.Route
import com.swago.baseswago.activity.BaseXActivity
import com.swago.baseswago.constant.ARouteConstant
import com.swago.baseswago.util.AppContext
import com.swago.user.databinding.ActivityCustomServiceBinding
import com.swago.user.vm.TaskVm

/**
 *@date 2022/2/26 13:37
 *description:
 */
@Route(path = ARouteConstant.User.customService)
class CustomServiceActivity : BaseXActivity<ActivityCustomServiceBinding>() {

    private val taskVm by viewModels<TaskVm>()

    override fun loadData() {
        taskVm.getAppConfig()
    }

    override fun initOther() {
        setBackView(binding.toolbar.ivBack)
        binding.toolbar.tvTitle.text = AppContext.getContext().resources.getString(R.string.contact_service)
    }

    override fun initLiveData() {
        taskVm.appConfigLiveData.observe(this){
            binding.tvGmail.text = "gmail:${it.app_gmail}"
            binding.tvWhatsApp.text = it.app_phone
        }
    }
}