18034727885
2026-08-11 74a412c8160dfeb8a3e9f6383d45b0495a928818
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
49
50
51
52
53
54
55
56
57
58
59
package com.fangxinxing.xxfxx.ui.mine
 
import com.fangxinxing.xxfxx.R
import com.fangxinxing.xxfxx.base.MyApplication
import com.fangxinxing.xxfxx.base.MyBaseActivity
import com.fangxinxing.xxfxx.bean.AllPhoneBean
import com.fangxinxing.xxfxx.netUtls.Api
import com.fangxinxing.xxfxx.netUtls.callNet
import com.fangxinxing.xxfxx.netUtls.getMapByAny
import com.fangxinxing.xxfxx.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() {
        val map = getMapByAny()
        map["code"] = MyApplication.aMapLocation?.adCode
        callNet(Api.queryPhoneAll, map){
            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())
        }
    }
}