package com.zxbw.modulemain.activity

import android.graphics.Paint
import android.view.View
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.model.qy.SkillGoodsEntity
import com.zxhl.cms.utils.JumpUtils
import kotlinx.android.synthetic.main.activity_layout_skill_pay.*

//秒杀商品去支付
class XymhSkillPayActivity : BaseActivity() {
    override fun onClick(v: View?) {

    }

    override fun before() {
        super.before()
        setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
    }

    override fun layoutID(): Int {
        return R.layout.activity_layout_skill_pay
    }

    override fun init() {
        id_img_back?.setOnClickListener {
            finish()
        }
        val skillGoodsEntity: SkillGoodsEntity =
            intent.getSerializableExtra("skillgoods") as SkillGoodsEntity
        setDataView(skillGoodsEntity)
        id_ll_no_vip?.setOnClickListener {
            JumpUtils.BuyMemberJump()
        }
    }

    fun setDataView(entity: SkillGoodsEntity) {
        id_title_name?.text =
            "${entity?.card?.brand}${entity?.card?.category}${entity?.card?.goodsName}"
        id_tv_goods_name?.text =
            "${entity?.card?.brand}${entity?.card?.category}${entity?.card?.goodsName}"
        id_tv_member_discount?.text = "会员专享${entity?.card?.costDiscount}折"
        id_tv_sale_price?.text = "${entity?.skillPrice}"
        id_tv_orgin_price?.text = " ¥ ${entity?.card?.originPrice}"
        id_tv_orgin_price?.getPaint()?.setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中划线
    }
}