Commit a55a3306 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 8a9b5254
......@@ -129,7 +129,6 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
//获取游客登录数据
homePresenter.userLogin()
} else {
homePresenter.getMyInfo()
homePresenter.topTabs()
homePresenter.orders()
TrackManager.getInstance().getMyInfo()
......
......@@ -11,6 +11,7 @@ import com.xinfu.helivideo.R
import com.xinfu.helivideo.common.AppConfig
import com.xinfu.helivideo.common.Constant
import com.xinfu.helivideo.manager.AppHttpManager
import com.xinfu.helivideo.manager.TrackManager
import com.xinfu.helivideo.manager.UserManager
import com.xinfu.helivideo.mvp.model.BaseResponse
import com.xinfu.helivideo.mvp.model.OrderRecordBean
......@@ -156,28 +157,10 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
initVp2()
}
getData()
TrackManager.getInstance().getMyInfo()
}
}
private fun getData() {
val vo = HashMap<String, Any>()
vo["os"] = "android"
AppHttpManager.getInstance(baseApplication)
.call(baseApplication.loanService.getMyInfo(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onError(e: Throwable) {
}
override fun onNext(t: BaseResponse<UserBean>) {
if (t.status == 200) {
UserManager.getInstance().saveUserInfo(t.data)
}
}
})
}
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
......
......@@ -29,6 +29,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:gravity="center_horizontal"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="包年会员" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment