package com.example.myapplication.ui.recharge

import android.graphics.Paint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import android.widget.ImageView
import androidx.fragment.app.Fragment
import com.example.myapplication.R

class RechargeFragment : Fragment() {
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.activity_recharge, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        // 找到旧价格 TextView
        val tvOldPrice = view.findViewById<TextView>(R.id.tvOldPrice)
        // 旧价格加删除线
        tvOldPrice.paintFlags = tvOldPrice.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
        
        // 设置关闭按钮点击事件
        view.findViewById<ImageView>(R.id.iv_close).setOnClickListener {
            parentFragmentManager.popBackStack()
        }
    }
}
