lmw
2023-05-12 f67802a41f9e01444d1115f34ecc6e1beb05fc3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.fuban.user.ui.mine
 
import android.app.Activity
import androidx.core.os.bundleOf
import com.fuban.user.R
import com.fuban.user.network.HttpManager
import com.fuban.user.network.request
import com.fuban.user.ui.TransparentStatusBarActivity
import com.fuban.user.dialog.TipDialog
import kotlinx.android.synthetic.main.activity_unregister.*
import org.jetbrains.anko.sdk27.coroutines.onClick
 
class UnregisterActivity : TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_unregister
 
    override fun initClick() {
        tv_action.onClick {
            val tipDialog = TipDialog()
            tipDialog.arguments = bundleOf("msg" to "您确定要注销吗?","ok" to "注销","cancel" to "再想想")
            tipDialog.setCallback(object :TipDialog.OnClickCallback{
                override fun onOk() {
                    unregister()
                }
 
                override fun onCancel() {}
            })
            tipDialog.show(supportFragmentManager,"unregister")
        }
    }
 
    override fun initView() {
    }
 
    private fun unregister() {
        showDialog()
        HttpManager.unregister().request(this){_,_->
            val tipDialog = TipDialog()
            tipDialog.arguments = bundleOf("msg" to "注销成功!","isAlert" to true)
            tipDialog.setDismissCallback(object :TipDialog.OnDismiss{
                override fun onDismiss() {
                    setResult(Activity.RESULT_OK)
                    finish()
                }
            })
            tipDialog.show(supportFragmentManager,"suc")
        }
    }
}