package com.zxhl.main.page.activity

import android.util.Log
import android.view.View
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.NoDoubleClickListener
import com.zxhl.cms.widget.CenterDialog
import com.zxhl.main.R
import com.zxhl.main.page.contract.WinterBoxContract
import com.zxhl.main.page.presenter.VoiceRoomPrsenter
import com.zxhl.main.page.presenter.WinterBoxPresenter
import kotlinx.android.synthetic.main.activity_layout_winter_box.*

class WinterBoxActivity : BaseActivity(), WinterBoxContract.View {
    private var mPresenter: WinterBoxPresenter? = null
    override fun layoutID(): Int {
        return R.layout.activity_layout_winter_box
    }

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

    override fun init() {
        mPresenter = WinterBoxPresenter(this)
        mPresenter?.getWinterBox()
        id_img_back?.setOnClickListener {
            finish()
        }
        id_tv_rule?.setOnClickListener {
            JumpUtils.webJump("活动规则", NetConfig.H5.WEB_URL_WINTER_RULE)
        }
        id_tv_get_box?.setOnClickListener(object : NoDoubleClickListener() {
            override fun onNoDoubleClick(v: View?) {
                openBox()
            }

        })
    }

    fun openBox() {
        mPresenter?.openWinterBox()
    }

    override fun onClick(v: View?) {

    }

    override fun getReward(reward: String?) {
        Log.e("MXL", "reward" + reward)
        CenterDialog.showWinterReward(this,reward)
    }


}