package com.ccwangluo.accelerator.ui.dialog

import android.content.Context
import android.os.Bundle
import android.widget.ImageView
import com.ccwangluo.accelerator.R
import com.ccwangluo.accelerator.ui.web.CommonWebViewFragment
import com.github.shadowsocks.http.HttpConfig
import com.xuexiang.xpage.base.XPageFragment
import com.xuexiang.xui.widget.dialog.materialdialog.CustomMaterialDialog
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog

/**
 * 会员购买框
 */
class MemberDialog(
    var fragment: XPageFragment,

    ) : CustomMaterialDialog(fragment.context) {

    override fun getDialogBuilder(context: Context?): MaterialDialog.Builder {
        return MaterialDialog.Builder(context!!)
            .customView(R.layout.dialog_member, false);
    }

    override fun initViews(context: Context?) {
        val btn = findViewById<ImageView>(R.id.dialog_memeber_btn)
        btn.setOnClickListener {
            dismiss<MemberDialog>()
            val params = Bundle()
            params.putString(CommonWebViewFragment.WEBVIEW_URL_KEY,HttpConfig.UI_MAIN_URL +  HttpConfig.MEMBER_CENTER)
            fragment.openPage(CommonWebViewFragment::class.java, params)
        }
    }
    init {
    }


}