|
@@ -5,6 +5,7 @@ import com.yingyang.workbenches.adapter.TrainReportAdapter
|
|
|
import com.yingyang.workbenches.databinding.FragmentTrainReportBinding
|
|
|
import com.yingyang.workbenches.entity.GetTrainReportEvent
|
|
|
import com.yingyang.workbenches.entity.RecordBeans
|
|
|
+import com.yingyangfly.baselib.config.AccountConfig
|
|
|
import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMFragment
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
@@ -19,7 +20,6 @@ import gorden.rxbus2.ThreadMode
|
|
|
*/
|
|
|
class TrainReportFragment : BaseMVVMFragment<FragmentTrainReportBinding, TrainReportViewModel>() {
|
|
|
|
|
|
- private var url = ""
|
|
|
private var page = 1
|
|
|
private var reportList = mutableListOf<RecordBeans>()
|
|
|
|
|
@@ -36,13 +36,11 @@ class TrainReportFragment : BaseMVVMFragment<FragmentTrainReportBinding, TrainRe
|
|
|
adapter.setData(reportList)
|
|
|
}
|
|
|
adapter.onReportImageClickListener = {
|
|
|
- if (TextUtils.isEmpty(url).not()) {
|
|
|
- val trainingDailyUrl = url +
|
|
|
- "?userId=" + User.getUserId() + "&time=" + it + "&userToken=" + User.getToken()
|
|
|
+ if (TextUtils.isEmpty(AccountConfig.TRAINREPORT_URL).not()) {
|
|
|
+ val trainingDailyUrl =
|
|
|
+ AccountConfig.TRAINREPORT_URL + "?userId=" + User.getUserId() + "&time=" + it + "&userToken=" + User.getToken()
|
|
|
JumpUtil.jumpActivityWithUrl(
|
|
|
- RouterUrlCommon.WEB_VIEW_INTERACTION_JS,
|
|
|
- trainingDailyUrl,
|
|
|
- mContext
|
|
|
+ RouterUrlCommon.WEB_VIEW_INTERACTION_JS, trainingDailyUrl, mContext
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -79,11 +77,10 @@ class TrainReportFragment : BaseMVVMFragment<FragmentTrainReportBinding, TrainRe
|
|
|
it.toast()
|
|
|
}, success = {
|
|
|
endRefresh()
|
|
|
- if(event.isRefresh) {
|
|
|
+ if (event.isRefresh) {
|
|
|
reportList.clear()
|
|
|
}
|
|
|
if (it != null && it.list != null && it.list.records.isNullOrEmpty().not()) {
|
|
|
- url = it.url
|
|
|
reportList.addAll(it.list.records)
|
|
|
}
|
|
|
adapter.showEmptyView = reportList.isEmpty()
|