package com.fuban.driver.ui.mine
|
|
import com.fuban.driver.R
|
import com.fuban.driver.base.MyBaseActivity
|
import com.fuban.driver.bean.AllPhoneBean
|
import com.fuban.driver.netUtls.Api
|
import com.fuban.driver.netUtls.callNet
|
import com.fuban.driver.netUtls.getMapByAny
|
import com.fuban.driver.utils.MyUtils
|
import kotlinx.android.synthetic.main.activity_server_phone.*
|
import org.jetbrains.anko.toast
|
|
class ServerPhoneActivity: MyBaseActivity() {
|
override fun setContentView() {
|
setContentView(R.layout.activity_server_phone)
|
}
|
|
override fun initView() {
|
setTitleText("客服电话")
|
callPhones()
|
}
|
|
private fun callPhones() {
|
callNet(Api.queryPhoneAll, getMapByAny()){
|
var bean = gson.fromJson<AllPhoneBean>(it,AllPhoneBean::class.java)
|
tv_phone_three.text = bean.data.platform
|
tv_phone_two.text = bean.data.branch
|
tv_phone_one.text = bean.data.franchisee
|
}
|
}
|
|
override fun setOnclick() {
|
tv_phone_three.setOnClickListener {
|
if (tv_phone_three.text.isEmpty()){
|
toast("平台暂无联系方式")
|
return@setOnClickListener
|
}
|
MyUtils.getInstans().CallPhone(this,tv_phone_three.text.toString())
|
}
|
tv_phone_two.setOnClickListener {
|
if (tv_phone_two.text.isEmpty()){
|
toast("分公司暂无联系方式")
|
return@setOnClickListener
|
}
|
MyUtils.getInstans().CallPhone(this,tv_phone_two.text.toString())
|
}
|
tv_phone_one.setOnClickListener {
|
if (tv_phone_one.text.isEmpty()){
|
toast("车队暂无联系方式")
|
return@setOnClickListener
|
}
|
MyUtils.getInstans().CallPhone(this,tv_phone_one.text.toString())
|
}
|
}
|
}
|