罗明文
18 小时以前 442124baa483f8d1c4aaca7ff81e15dd3f122363
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
package com.dollearn.student.ui.home
 
import cn.sinata.xldutils.fragment.BaseFragment
import com.dollearn.student.R
import com.dollearn.student.dialog.RecommendGoodsDialog
import com.dollearn.student.network.HttpManager
import com.dollearn.student.network.requestByF
import com.dollearn.student.utils.extention.clickDelay
import kotlinx.android.synthetic.main.fragment_home.*
import org.jetbrains.anko.support.v4.startActivity
 
class HomeFragment : BaseFragment() {
    override fun contentViewId() = R.layout.fragment_home
 
 
    override fun onFirstVisibleToUser() {
        initClick()
    }
 
    private fun initClick() {
        cl_listen.clickDelay {
            HttpManager.goodRecommend().requestByF(this,false,{_,data->
                if (data.isNullOrEmpty())
                    startActivity<WeekSelectActivity>()
                else{
                    RecommendGoodsDialog.show(childFragmentManager,data)
                }
            }){_,_->
                startActivity<WeekSelectActivity>()
            }
        }
    }
 
}