package com.ytpm.hydtw.activity

import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.FragmentActivity
import com.blankj.utilcode.util.AppUtils
import com.ytpm.hydtw.databinding.ActivityAboutUsBinding

class AboutUsActivity : FragmentActivity() {

    private lateinit var bindding: ActivityAboutUsBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        bindding = ActivityAboutUsBinding.inflate(layoutInflater)
        setContentView(bindding.root)

        initTool()
        initView()
    }

    private fun initTool() {
        bindding.barll.title.text = "关于我们"
        bindding.barll.back.setOnClickListener {
            finish()
        }
    }

    private fun initView() {
        bindding.version.text = "版本号:${AppUtils.getAppVersionName()}"
        bindding.yszc.setOnClickListener {
            val intent = Intent(this@AboutUsActivity, WebActivity::class.java)
            intent.putExtra("title", "隐私政策")
            intent.putExtra("index", 0)
            startActivity(intent)
        }
        bindding.yhxy.setOnClickListener {
            val intent = Intent(this@AboutUsActivity, WebActivity::class.java)
            intent.putExtra("title", "用户协议")
            intent.putExtra("index", 1)
            startActivity(intent)
        }
    }
}