作者 杨谦

1.测试文档确认修改

正在显示 19 个修改的文件 包含 194 行增加104 行删除
@@ -10,8 +10,9 @@ import java.io.File @@ -10,8 +10,9 @@ import java.io.File
10 */ 10 */
11 object Constant { 11 object Constant {
12 // const val BASE_URL = "https://security.brofirst.cn/" 12 // const val BASE_URL = "https://security.brofirst.cn/"
13 - const val BASE_URL = "http://security.brofirst.cn/"  
14 -// const val BASE_URL = "https://test.mobile.anqixing.com/" 13 +// const val BASE_URL = "http://security.brofirst.cn/"
  14 +// const val BASE_URL = "https://test.admin.anqixing.com"
  15 + const val BASE_URL = "https://test.admin.anqixing.com"
15 // const val BASE_URL = "http://admin.anqixing.com" 16 // const val BASE_URL = "http://admin.anqixing.com"
16 const val USERNAME_KEY = "username" 17 const val USERNAME_KEY = "username"
17 const val USERID_KEY = "userid" 18 const val USERID_KEY = "userid"
@@ -65,7 +65,6 @@ interface LessonApi : ApiService { @@ -65,7 +65,6 @@ interface LessonApi : ApiService {
65 /** 65 /**
66 * 视频课程详情 66 * 视频课程详情
67 * @param id 课程id 67 * @param id 课程id
68 - * @param train_class_id 班级id  
69 */ 68 */
70 @FormUrlEncoded 69 @FormUrlEncoded
71 @POST("/api/lesson/lesson_detail") 70 @POST("/api/lesson/lesson_detail")
@@ -106,7 +106,7 @@ object TrainCourseDetailItemType { @@ -106,7 +106,7 @@ object TrainCourseDetailItemType {
106 106
107 open class TrainCourseData(var type: Int) { 107 open class TrainCourseData(var type: Int) {
108 var lessonBean: LessonTrainVideoDetail? = null 108 var lessonBean: LessonTrainVideoDetail? = null
109 - var lessonBeanNormal: LessonClassDetail? = null 109 + var lessonBeanNormal: LessonTrainVideoDetail? = null
110 var lessonLive: LessonLive? = null 110 var lessonLive: LessonLive? = null
111 var lessonOff: LessonOfflineDetail? = null 111 var lessonOff: LessonOfflineDetail? = null
112 112
@@ -117,7 +117,7 @@ open class TrainCourseData(var type: Int) { @@ -117,7 +117,7 @@ open class TrainCourseData(var type: Int) {
117 117
118 open class TrainCourseDetailItem(var type: Int) : MultiItemEntity { 118 open class TrainCourseDetailItem(var type: Int) : MultiItemEntity {
119 var lessonVideo: LessonClazz? = null 119 var lessonVideo: LessonClazz? = null
120 - var lessonVideoNormal: LessonClassDetail? = null 120 + var lessonVideoNormal: LessonClazz? = null
121 var lessonLive: LessonLive? = null 121 var lessonLive: LessonLive? = null
122 var lessonOff: LessonOfflineDetail? = null 122 var lessonOff: LessonOfflineDetail? = null
123 123
@@ -102,6 +102,7 @@ class DatabaseActivity : @@ -102,6 +102,7 @@ class DatabaseActivity :
102 102
103 override fun initData() { 103 override fun initData() {
104 super.initData() 104 super.initData()
  105 + mViewModel.type.value = 1
105 mViewModel.geClassify() 106 mViewModel.geClassify()
106 } 107 }
107 108
@@ -112,7 +113,7 @@ class DatabaseActivity : @@ -112,7 +113,7 @@ class DatabaseActivity :
112 mViewModel.getDataList(page) 113 mViewModel.getDataList(page)
113 } 114 }
114 115
115 - fun loadMore() { 116 + private fun loadMore() {
116 page++ 117 page++
117 binding.refresh.setEnableRefresh(false) 118 binding.refresh.setEnableRefresh(false)
118 binding.refresh.setEnableLoadMore(false) 119 binding.refresh.setEnableLoadMore(false)
@@ -128,9 +129,20 @@ class DatabaseActivity : @@ -128,9 +129,20 @@ class DatabaseActivity :
128 mClassifyAdapter?.addListener(object : OnItemClickListener<MaterialClassify> { 129 mClassifyAdapter?.addListener(object : OnItemClickListener<MaterialClassify> {
129 override fun onClick(position: Int, data: MaterialClassify) { 130 override fun onClick(position: Int, data: MaterialClassify) {
130 mViewModel.sortId.value = data.id 131 mViewModel.sortId.value = data.id
  132 + mClassifyAdapter?.let { classifyAdapter ->
  133 + val oldIndex = classifyAdapter.index;
  134 + if (oldIndex != position) {
  135 + classifyAdapter.index = position
  136 + if (oldIndex >= 0) {
  137 + classifyAdapter.notifyItemChanged(oldIndex)
  138 + }
  139 + classifyAdapter.notifyItemChanged(position)
  140 + }
  141 + }
131 } 142 }
132 }) 143 })
133 if (data.list.isNotEmpty()) { 144 if (data.list.isNotEmpty()) {
  145 + page = 1
134 mViewModel.sortId.value = data.list[0].id 146 mViewModel.sortId.value = data.list[0].id
135 } 147 }
136 }) 148 })
@@ -143,7 +155,18 @@ class DatabaseActivity : @@ -143,7 +155,18 @@ class DatabaseActivity :
143 binding.refresh.setEnableRefresh(true) 155 binding.refresh.setEnableRefresh(true)
144 binding.refresh.finishRefresh() 156 binding.refresh.finishRefresh()
145 binding.refresh.finishLoadMore() 157 binding.refresh.finishLoadMore()
  158 + val bool = data.list.data.isEmpty();
146 if (page == 1) { 159 if (page == 1) {
  160 + binding.refresh.visibility = if (bool) {
  161 + View.GONE
  162 + } else {
  163 + View.VISIBLE
  164 + }
  165 + binding.none.visibility = if (bool) {
  166 + View.VISIBLE
  167 + } else {
  168 + View.GONE
  169 + }
147 mRecommendAdapter = RecommendDataAdapter() 170 mRecommendAdapter = RecommendDataAdapter()
148 mRecommendAdapter?.addList(data.list.data) 171 mRecommendAdapter?.addList(data.list.data)
149 binding.databaseRecycler.adapter = mRecommendAdapter 172 binding.databaseRecycler.adapter = mRecommendAdapter
@@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity @@ -3,6 +3,7 @@ package com.br_technology.securitytrain_master.ui.view.home.activity
3 import android.content.Intent 3 import android.content.Intent
4 import android.content.res.Configuration 4 import android.content.res.Configuration
5 import android.os.Bundle 5 import android.os.Bundle
  6 +import android.text.TextUtils
6 import android.view.View 7 import android.view.View
7 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL 8 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL
8 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.DOC_ID 9 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.DOC_ID
@@ -51,13 +52,17 @@ class DatabaseDetailActivity : @@ -51,13 +52,17 @@ class DatabaseDetailActivity :
51 } 52 }
52 }) 53 })
53 mViewModel.mDetailMaterialNormal.observe(this, { 54 mViewModel.mDetailMaterialNormal.observe(this, {
54 - binding.videoPlayer.initVideoBuilderMode(  
55 - it.data.detail.image,  
56 - it.data.detail.video,  
57 - this@DatabaseDetailActivity,  
58 - false,  
59 - lifecycle  
60 - ) 55 + if (!TextUtils.isEmpty(it.data.detail.video)) {
  56 + binding.videoPlayer.initVideoBuilderMode(
  57 + it.data.detail.image,
  58 + it.data.detail.video,
  59 + this@DatabaseDetailActivity,
  60 + false,
  61 + lifecycle
  62 + )
  63 + } else {
  64 + binding.videoPlayer.visibility = View.GONE
  65 + }
61 66
62 binding.start.isSelected = it.data.detail.is_favorite == 1 67 binding.start.isSelected = it.data.detail.is_favorite == 1
63 68
@@ -85,7 +90,6 @@ class DatabaseDetailActivity : @@ -85,7 +90,6 @@ class DatabaseDetailActivity :
85 mViewModel.materialDetail(intent.getIntExtra(DOC_ID, 0)) 90 mViewModel.materialDetail(intent.getIntExtra(DOC_ID, 0))
86 } 91 }
87 92
88 -  
89 override fun onBackPressed() { 93 override fun onBackPressed() {
90 binding.videoPlayer.onBackPressed() 94 binding.videoPlayer.onBackPressed()
91 if (GSYVideoManager.backFromWindowFull(this)) { 95 if (GSYVideoManager.backFromWindowFull(this)) {
@@ -99,5 +103,4 @@ class DatabaseDetailActivity : @@ -99,5 +103,4 @@ class DatabaseDetailActivity :
99 //如果旋转了就全屏 103 //如果旋转了就全屏
100 binding.videoPlayer.onConfigurationChanged(newConfig, this) 104 binding.videoPlayer.onConfigurationChanged(newConfig, this)
101 } 105 }
102 -  
103 } 106 }
@@ -7,6 +7,7 @@ import com.br_technology.securitytrain_master.base.common.ConstantParamKey @@ -7,6 +7,7 @@ import com.br_technology.securitytrain_master.base.common.ConstantParamKey
7 import com.br_technology.securitytrain_master.databinding.ActivityOnlineBinding 7 import com.br_technology.securitytrain_master.databinding.ActivityOnlineBinding
8 import com.br_technology.securitytrain_master.expand.addItemDecoration2 8 import com.br_technology.securitytrain_master.expand.addItemDecoration2
9 import com.br_technology.securitytrain_master.ui.bean.CourseParam 9 import com.br_technology.securitytrain_master.ui.bean.CourseParam
  10 +import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType
10 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity 11 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
11 import com.br_technology.securitytrain_master.ui.view.home.adapter.VideoCourseAdapter 12 import com.br_technology.securitytrain_master.ui.view.home.adapter.VideoCourseAdapter
12 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean 13 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean
@@ -40,7 +41,7 @@ class OnlineActivity : @@ -40,7 +41,7 @@ class OnlineActivity :
40 val data = videoLessonList!![position] 41 val data = videoLessonList!![position]
41 course.mLessonId = "${data.id}" 42 course.mLessonId = "${data.id}"
42 course.isTrainClass = false 43 course.isTrainClass = false
43 - course.type = 1 44 + course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO
44 startActivity( 45 startActivity(
45 Intent( 46 Intent(
46 this@OnlineActivity, 47 this@OnlineActivity,
@@ -34,6 +34,7 @@ class CourseDetailActivity @@ -34,6 +34,7 @@ class CourseDetailActivity
34 private var mapWork = mutableMapOf<Int, WorkTypeBean.ListBean>() 34 private var mapWork = mutableMapOf<Int, WorkTypeBean.ListBean>()
35 35
36 override fun initDataObserver() { 36 override fun initDataObserver() {
  37 + // 培训视频课程
37 mViewModel.mVideoLesson.observe(this, { 38 mViewModel.mVideoLesson.observe(this, {
38 binding.apply { 39 binding.apply {
39 val posIds = it.data.detail.pos_ids 40 val posIds = it.data.detail.pos_ids
@@ -43,53 +44,79 @@ class CourseDetailActivity @@ -43,53 +44,79 @@ class CourseDetailActivity
43 supportFragmentManager, 44 supportFragmentManager,
44 FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT 45 FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
45 ) 46 )
46 - val list =  
47 - mutableListOf(  
48 - OnlineDetailFragment(  
49 - TrainClassDes(  
50 - it.data.detail.name,  
51 - setPosName(posIds),  
52 - it.data.detail.content  
53 - ), TYPE_COURSE_DETAIL_ITEM_VIDEO  
54 - ),  
55 - CourseListFragment(TrainCourseData(TYPE_COURSE_DETAIL_ITEM_VIDEO).apply {  
56 - this.lessonBean = it.data  
57 - }, "${courseBean?.mTrainClassId}")  
58 - ) 47 + courseBean?.type?.let { type ->
  48 + when (type) {
  49 + 0 -> {
  50 + val list = mutableListOf(
  51 + OnlineDetailFragment(
  52 + TrainClassDes(
  53 + courseLesson?.name ?: "",
  54 + courseLesson?.pos_ids ?: "",
  55 + courseLesson?.content ?: ""
  56 + ), TYPE_COURSE_DETAIL_ITEM_NORMAL
  57 + ),
  58 + CourseListFragment(
  59 + TrainCourseData(
  60 + TYPE_COURSE_DETAIL_ITEM_NORMAL
  61 + ).apply {
  62 + this.lessonBeanNormal = it.data
  63 + }, "${courseBean?.mTrainClassId}"
  64 + )
  65 + )
  66 + searchResultAdapter?.addData(list.toMutableList())
  67 + }
  68 + 1 -> {
  69 + val list = mutableListOf(
  70 + OnlineDetailFragment(
  71 + TrainClassDes(
  72 + it.data.detail.name,
  73 + setPosName(posIds),
  74 + it.data.detail.content
  75 + ), TYPE_COURSE_DETAIL_ITEM_VIDEO
  76 + ),
  77 + CourseListFragment(TrainCourseData(TYPE_COURSE_DETAIL_ITEM_VIDEO).apply {
  78 + this.lessonBean = it.data
  79 + }, "${courseBean?.mTrainClassId}")
  80 + )
  81 + searchResultAdapter?.addData(list.toMutableList())
  82 + }
  83 + else -> {}
  84 + }
  85 + }
59 val titles = listOf("课程详情", "课程列表") 86 val titles = listOf("课程详情", "课程列表")
60 - searchResultAdapter?.addData(list.toMutableList())  
61 searchResultAdapter?.addTitle(titles) 87 searchResultAdapter?.addTitle(titles)
62 viewPager.adapter = searchResultAdapter 88 viewPager.adapter = searchResultAdapter
63 tabLayout.setupWithViewPager(viewPager) 89 tabLayout.setupWithViewPager(viewPager)
64 } 90 }
65 }) 91 })
66 92
67 - mViewModel.mVideoLessonNormal.observe(this, {  
68 - binding.apply {  
69 - searchResultAdapter = BasePagerAdapter(  
70 - supportFragmentManager,  
71 - FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT  
72 - )  
73 - val list =  
74 - mutableListOf(  
75 - OnlineDetailFragment(  
76 - TrainClassDes(  
77 - courseLesson?.name ?: "",  
78 - courseLesson?.pos_ids ?: "",  
79 - courseLesson?.content ?: ""  
80 - ), TYPE_COURSE_DETAIL_ITEM_NORMAL  
81 - ),  
82 - CourseListFragment(TrainCourseData(TYPE_COURSE_DETAIL_ITEM_NORMAL).apply {  
83 - this.lessonBeanNormal = it.data.detail  
84 - }, "${courseBean?.mTrainClassId}")  
85 - )  
86 - val titles = listOf("课程详情", "课程列表")  
87 - searchResultAdapter?.addData(list.toMutableList())  
88 - searchResultAdapter?.addTitle(titles)  
89 - viewPager.adapter = searchResultAdapter  
90 - tabLayout.setupWithViewPager(viewPager)  
91 - }  
92 - }) 93 +// // 视频数据
  94 +// mViewModel.mVideoLessonNormal.observe(this, {
  95 +// binding.apply {
  96 +// searchResultAdapter = BasePagerAdapter(
  97 +// supportFragmentManager,
  98 +// FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
  99 +// )
  100 +// val list =
  101 +// mutableListOf(
  102 +// OnlineDetailFragment(
  103 +// TrainClassDes(
  104 +// courseLesson?.name ?: "",
  105 +// courseLesson?.pos_ids ?: "",
  106 +// courseLesson?.content ?: ""
  107 +// ), TYPE_COURSE_DETAIL_ITEM_NORMAL
  108 +// ),
  109 +// CourseListFragment(TrainCourseData(TYPE_COURSE_DETAIL_ITEM_NORMAL).apply {
  110 +// this.lessonBeanNormal = it.data.detail
  111 +// }, "${courseBean?.mTrainClassId}")
  112 +// )
  113 +// val titles = listOf("课程详情", "课程列表")
  114 +// searchResultAdapter?.addData(list.toMutableList())
  115 +// searchResultAdapter?.addTitle(titles)
  116 +// viewPager.adapter = searchResultAdapter
  117 +// tabLayout.setupWithViewPager(viewPager)
  118 +// }
  119 +// })
93 120
94 mViewModel.mLiveLesson.observe(this, { 121 mViewModel.mLiveLesson.observe(this, {
95 binding.apply { 122 binding.apply {
@@ -171,20 +198,23 @@ class CourseDetailActivity @@ -171,20 +198,23 @@ class CourseDetailActivity
171 for (data in it.data.list) { 198 for (data in it.data.list) {
172 mapWork.put(data.id, data) 199 mapWork.put(data.id, data)
173 } 200 }
174 - //1=视频课,2=直播课,3=线下培训课,4=文本课 201 + //1=视频课,2=直播课,3=线下培训课,4=文本课 0普通视频
175 courseBean?.let { 202 courseBean?.let {
176 when (it.type) { 203 when (it.type) {
177 - 1 -> { 204 + TYPE_COURSE_DETAIL_ITEM_VIDEO -> {
  205 + mViewModel.videoLessonsDetail(it.mLessonId.toInt())
  206 + }
  207 + TYPE_COURSE_DETAIL_ITEM_NORMAL -> {
178 if (courseBean?.isTrainClass == true) { 208 if (courseBean?.isTrainClass == true) {
179 mViewModel.videoLessonsDetail(it.mLessonId.toInt()) 209 mViewModel.videoLessonsDetail(it.mLessonId.toInt())
180 } else { 210 } else {
181 mViewModel.videoLessonNormal(it.mLessonId.toInt()) 211 mViewModel.videoLessonNormal(it.mLessonId.toInt())
182 } 212 }
183 } 213 }
184 - 2 -> { 214 + TYPE_COURSE_DETAIL_ITEM_LIVE -> {
185 mViewModel.liveLessonDetail(it.mLessonId.toInt()) 215 mViewModel.liveLessonDetail(it.mLessonId.toInt())
186 } 216 }
187 - 3 -> { 217 + TYPE_COURSE_DETAIL_ITEM_OFF -> {
188 mViewModel.offLessonDetail(it.mLessonId.toInt()) 218 mViewModel.offLessonDetail(it.mLessonId.toInt())
189 } 219 }
190 } 220 }
@@ -102,9 +102,11 @@ fun transData(data: TrainCourseDetailItem, pos: Int): List<TrainCourseDetailItem @@ -102,9 +102,11 @@ fun transData(data: TrainCourseDetailItem, pos: Int): List<TrainCourseDetailItem
102 } 102 }
103 TYPE_COURSE_DETAIL_ITEM_NORMAL -> { 103 TYPE_COURSE_DETAIL_ITEM_NORMAL -> {
104 data.lessonVideoNormal?.apply { 104 data.lessonVideoNormal?.apply {
105 - list.add(TrainCourseDetailItemChild(TYPE_COURSE_DETAIL_ITEM_NORMAL, pos).apply {  
106 - lessonVideoNormalChild = data.lessonVideoNormal  
107 - }) 105 + for (p in lessonclassdetail) {
  106 + list.add(TrainCourseDetailItemChild(TYPE_COURSE_DETAIL_ITEM_NORMAL, pos).apply {
  107 + lessonVideoNormalChild = p
  108 + })
  109 + }
108 } 110 }
109 } 111 }
110 TYPE_COURSE_DETAIL_ITEM_LIVE -> { 112 TYPE_COURSE_DETAIL_ITEM_LIVE -> {
@@ -48,9 +48,13 @@ class CourseListFragment(var courseData: TrainCourseData,var tranClassId:String) @@ -48,9 +48,13 @@ class CourseListFragment(var courseData: TrainCourseData,var tranClassId:String)
48 } 48 }
49 } 49 }
50 TYPE_COURSE_DETAIL_ITEM_NORMAL -> { 50 TYPE_COURSE_DETAIL_ITEM_NORMAL -> {
51 - dataList.add(TrainCourseDetailItem(TYPE_COURSE_DETAIL_ITEM_NORMAL).apply {  
52 - lessonVideoNormal = courseData.lessonBeanNormal  
53 - }) 51 + courseData.lessonBeanNormal?.apply {
  52 + for (p in class_list) {
  53 + dataList.add(TrainCourseDetailItem(TYPE_COURSE_DETAIL_ITEM_NORMAL).apply {
  54 + lessonVideoNormal = p
  55 + })
  56 + }
  57 + }
54 } 58 }
55 TYPE_COURSE_DETAIL_ITEM_LIVE -> { 59 TYPE_COURSE_DETAIL_ITEM_LIVE -> {
56 dataList.add(TrainCourseDetailItem(TYPE_COURSE_DETAIL_ITEM_LIVE).apply { 60 dataList.add(TrainCourseDetailItem(TYPE_COURSE_DETAIL_ITEM_LIVE).apply {
@@ -12,6 +12,7 @@ import com.br_technology.securitytrain_master.base.common.ConstantParamKey.DOC_I @@ -12,6 +12,7 @@ import com.br_technology.securitytrain_master.base.common.ConstantParamKey.DOC_I
12 import com.br_technology.securitytrain_master.databinding.FragmentHomeBinding 12 import com.br_technology.securitytrain_master.databinding.FragmentHomeBinding
13 import com.br_technology.securitytrain_master.expand.addItemDecoration2 13 import com.br_technology.securitytrain_master.expand.addItemDecoration2
14 import com.br_technology.securitytrain_master.ui.bean.CourseParam 14 import com.br_technology.securitytrain_master.ui.bean.CourseParam
  15 +import com.br_technology.securitytrain_master.ui.bean.TrainCourseDetailItemType
15 import com.br_technology.securitytrain_master.ui.view.home.activity.* 16 import com.br_technology.securitytrain_master.ui.view.home.activity.*
16 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity 17 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
17 import com.br_technology.securitytrain_master.ui.view.home.adapter.RecommendDataAdapter 18 import com.br_technology.securitytrain_master.ui.view.home.adapter.RecommendDataAdapter
@@ -224,7 +225,7 @@ class HomeFragment : @@ -224,7 +225,7 @@ class HomeFragment :
224 val data = videoLessonList!![position] 225 val data = videoLessonList!![position]
225 course.mLessonId = "${data.id}" 226 course.mLessonId = "${data.id}"
226 course.isTrainClass = false 227 course.isTrainClass = false
227 - course.type = 1 228 + course.type = TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO
228 //视频详情 229 //视频详情
229 startActivity( 230 startActivity(
230 Intent( 231 Intent(
@@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.home.fragment @@ -2,6 +2,7 @@ package com.br_technology.securitytrain_master.ui.view.home.fragment
2 2
3 import android.content.Intent 3 import android.content.Intent
4 import android.os.Bundle 4 import android.os.Bundle
  5 +import android.view.View
5 import com.br_technology.securitytrain_master.R 6 import com.br_technology.securitytrain_master.R
6 import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding 7 import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding
7 import com.br_technology.securitytrain_master.expand.addItemDecoration2 8 import com.br_technology.securitytrain_master.expand.addItemDecoration2
@@ -9,7 +10,6 @@ import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean @@ -9,7 +10,6 @@ import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean
9 import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter 10 import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter
10 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel 11 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel
11 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity 12 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity
12 -import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LiveWebViewModel  
13 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 13 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
14 14
15 /** 15 /**
@@ -35,6 +35,13 @@ class OnLiveCourseFragment @@ -35,6 +35,13 @@ class OnLiveCourseFragment
35 binding.smartRefresh.setNoMoreData(true) 35 binding.smartRefresh.setNoMoreData(true)
36 } 36 }
37 if (page == 1) { 37 if (page == 1) {
  38 + if (it.data.list.data.isEmpty()) {
  39 + binding.smartRefresh.visibility = View.GONE
  40 + binding.none.visibility = View.VISIBLE
  41 + } else {
  42 + binding.smartRefresh.visibility = View.VISIBLE
  43 + binding.none.visibility = View.GONE
  44 + }
38 adapter.setNewInstance(it.data.list.data as MutableList<LessonLiveBean>) 45 adapter.setNewInstance(it.data.list.data as MutableList<LessonLiveBean>)
39 } else { 46 } else {
40 adapter.addData(it.data.list.data) 47 adapter.addData(it.data.list.data)
@@ -94,7 +101,6 @@ class OnLiveCourseFragment @@ -94,7 +101,6 @@ class OnLiveCourseFragment
94 } 101 }
95 } 102 }
96 103
97 -  
98 companion object { 104 companion object {
99 fun newInstance(type: Int): OnLiveCourseFragment { 105 fun newInstance(type: Int): OnLiveCourseFragment {
100 val fragment = OnLiveCourseFragment() 106 val fragment = OnLiveCourseFragment()
@@ -104,6 +110,4 @@ class OnLiveCourseFragment @@ -104,6 +110,4 @@ class OnLiveCourseFragment
104 return fragment 110 return fragment
105 } 111 }
106 } 112 }
107 -  
108 -  
109 } 113 }
@@ -21,7 +21,8 @@ class OnlineDetailFragment(val data: TrainClassDes, var type: Int) : @@ -21,7 +21,8 @@ class OnlineDetailFragment(val data: TrainClassDes, var type: Int) :
21 21
22 override fun initData() { 22 override fun initData() {
23 super.initData() 23 super.initData()
24 - if (TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_NORMAL == type) { 24 + if (TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_NORMAL == type
  25 + || TrainCourseDetailItemType.TYPE_COURSE_DETAIL_ITEM_VIDEO == type) {
25 binding.llContent.visibility = View.GONE 26 binding.llContent.visibility = View.GONE
26 } 27 }
27 binding.tvPos.text = data.pos 28 binding.tvPos.text = data.pos
@@ -24,7 +24,7 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() { @@ -24,7 +24,7 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() {
24 if (it.isTrainClass) { 24 if (it.isTrainClass) {
25 val map = hashMapOf("class_id" to it.mClassId) 25 val map = hashMapOf("class_id" to it.mClassId)
26 mRepository.recordTrainLesson( 26 mRepository.recordTrainLesson(
27 - it.type, 27 + 1,
28 it.mLessonId, 28 it.mLessonId,
29 it.mTrainClassId, 29 it.mTrainClassId,
30 view_len, 30 view_len,
@@ -33,7 +33,7 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() { @@ -33,7 +33,7 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() {
33 ) 33 )
34 } else { 34 } else {
35 val map = hashMapOf("view_len" to view_len, "class_id" to it.mClassId) 35 val map = hashMapOf("view_len" to view_len, "class_id" to it.mClassId)
36 - mRepository.recordNormalLesson(it.type, it.mLessonId, map, record) 36 + mRepository.recordNormalLesson(1, it.mLessonId, map, record)
37 } 37 }
38 } 38 }
39 } 39 }
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 android:layout_marginEnd="32dp" 28 android:layout_marginEnd="32dp"
29 android:background="@null" 29 android:background="@null"
30 android:digits="1234567890Xx" 30 android:digits="1234567890Xx"
31 - android:hint="身份证号码" 31 + android:hint="请输入账号"
32 android:textColor="@color/black" 32 android:textColor="@color/black"
33 android:textColorHint="#CECED6" 33 android:textColorHint="#CECED6"
34 android:textSize="18sp" /> 34 android:textSize="18sp" />
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 android:layout_height="match_parent" 55 android:layout_height="match_parent"
56 android:layout_weight="1" 56 android:layout_weight="1"
57 android:background="@null" 57 android:background="@null"
58 - android:hint="登录密码" 58 + android:hint="请输入6-12位数(英文字母/数字)"
59 android:importantForAutofill="no" 59 android:importantForAutofill="no"
60 android:inputType="textPassword" 60 android:inputType="textPassword"
61 android:lines="1" 61 android:lines="1"
@@ -53,38 +53,53 @@ @@ -53,38 +53,53 @@
53 android:layout_width="wrap_content" 53 android:layout_width="wrap_content"
54 android:layout_height="match_parent" 54 android:layout_height="match_parent"
55 android:layout_marginStart="16dp" 55 android:layout_marginStart="16dp"
56 - android:visibility="gone"  
57 android:drawableEnd="@mipmap/bold_arrow" 56 android:drawableEnd="@mipmap/bold_arrow"
58 android:drawablePadding="8dp" 57 android:drawablePadding="8dp"
59 android:gravity="center_vertical" 58 android:gravity="center_vertical"
60 android:text="通用知识" 59 android:text="通用知识"
61 android:textColor="@color/color_25" 60 android:textColor="@color/color_25"
62 - android:textSize="12sp" /> 61 + android:textSize="12sp"
  62 + android:visibility="gone" />
63 </FrameLayout> 63 </FrameLayout>
64 64
65 - <com.scwang.smart.refresh.layout.SmartRefreshLayout  
66 - android:id="@+id/refresh" 65 + <FrameLayout
67 android:layout_width="match_parent" 66 android:layout_width="match_parent"
68 - android:layout_height="wrap_content"> 67 + android:layout_height="match_parent">
69 68
70 - <com.scwang.smart.refresh.header.ClassicsHeader 69 + <com.scwang.smart.refresh.layout.SmartRefreshLayout
  70 + android:id="@+id/refresh"
71 android:layout_width="match_parent" 71 android:layout_width="match_parent"
72 - android:layout_height="wrap_content" /> 72 + android:layout_height="wrap_content">
  73 +
  74 + <com.scwang.smart.refresh.header.ClassicsHeader
  75 + android:layout_width="match_parent"
  76 + android:layout_height="wrap_content" />
  77 +
  78 + <androidx.recyclerview.widget.RecyclerView
  79 + android:id="@+id/database_recycler"
  80 + android:layout_width="match_parent"
  81 + android:layout_height="wrap_content"
  82 + android:layout_marginStart="16dp"
  83 + android:layout_marginTop="16dp"
  84 + android:layout_marginEnd="16dp"
  85 + android:overScrollMode="never"
  86 + android:scrollbars="none"
  87 + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
73 88
74 - <androidx.recyclerview.widget.RecyclerView  
75 - android:id="@+id/database_recycler" 89 + <com.scwang.smart.refresh.footer.ClassicsFooter
  90 + android:layout_width="match_parent"
  91 + android:layout_height="wrap_content" />
  92 + </com.scwang.smart.refresh.layout.SmartRefreshLayout>
  93 +
  94 + <TextView
  95 + android:id="@+id/none"
76 android:layout_width="match_parent" 96 android:layout_width="match_parent"
77 android:layout_height="wrap_content" 97 android:layout_height="wrap_content"
78 - android:layout_marginStart="16dp"  
79 - android:layout_marginTop="16dp"  
80 - android:layout_marginEnd="16dp"  
81 - android:overScrollMode="never"  
82 - android:scrollbars="none"  
83 - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> 98 + android:gravity="center"
  99 + android:padding="32dp"
  100 + android:text="暂无资料"
  101 + android:visibility="gone" />
  102 + </FrameLayout>
84 103
85 - <com.scwang.smart.refresh.footer.ClassicsFooter  
86 - android:layout_width="match_parent"  
87 - android:layout_height="wrap_content" />  
88 - </com.scwang.smart.refresh.layout.SmartRefreshLayout>  
89 104
90 </LinearLayout> 105 </LinearLayout>
@@ -80,8 +80,6 @@ @@ -80,8 +80,6 @@
80 android:id="@+id/web_view" 80 android:id="@+id/web_view"
81 android:layout_width="match_parent" 81 android:layout_width="match_parent"
82 android:layout_height="wrap_content" 82 android:layout_height="wrap_content"
83 - android:layout_marginTop="24dp"  
84 - android:layout_marginBottom="40dp"  
85 android:scrollbars="none" /> 83 android:scrollbars="none" />
86 84
87 <androidx.recyclerview.widget.RecyclerView 85 <androidx.recyclerview.widget.RecyclerView
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 android:layout_marginTop="32dp" 27 android:layout_marginTop="32dp"
28 android:layout_marginEnd="32dp" 28 android:layout_marginEnd="32dp"
29 android:background="@null" 29 android:background="@null"
30 - android:hint="手机号" 30 + android:hint="手机号"
31 android:inputType="phone" 31 android:inputType="phone"
32 android:textColor="@color/black" 32 android:textColor="@color/black"
33 android:textColorHint="#CECED6" 33 android:textColorHint="#CECED6"
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 android:layout_height="match_parent" 54 android:layout_height="match_parent"
55 android:layout_weight="1" 55 android:layout_weight="1"
56 android:background="@null" 56 android:background="@null"
57 - android:hint="验证码" 57 + android:hint="短信验证码"
58 android:inputType="phone" 58 android:inputType="phone"
59 android:textColor="@color/black" 59 android:textColor="@color/black"
60 android:textColorHint="#CECED6" 60 android:textColorHint="#CECED6"
@@ -16,7 +16,6 @@ @@ -16,7 +16,6 @@
16 android:id="@+id/tv_title" 16 android:id="@+id/tv_title"
17 android:layout_width="match_parent" 17 android:layout_width="match_parent"
18 android:layout_height="wrap_content" 18 android:layout_height="wrap_content"
19 - android:layout_marginTop="30dp"  
20 android:gravity="center" 19 android:gravity="center"
21 android:textStyle="bold" 20 android:textStyle="bold"
22 android:padding="12dp" 21 android:padding="12dp"
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 - android:orientation="vertical"  
5 android:layout_width="match_parent" 4 android:layout_width="match_parent"
6 - android:layout_height="match_parent"> 5 + android:layout_height="match_parent"
  6 + android:orientation="vertical">
7 7
8 <com.scwang.smart.refresh.layout.SmartRefreshLayout 8 <com.scwang.smart.refresh.layout.SmartRefreshLayout
9 android:id="@+id/smart_refresh" 9 android:id="@+id/smart_refresh"
10 android:layout_width="match_parent" 10 android:layout_width="match_parent"
11 android:layout_height="match_parent"> 11 android:layout_height="match_parent">
  12 +
12 <androidx.recyclerview.widget.RecyclerView 13 <androidx.recyclerview.widget.RecyclerView
13 android:id="@+id/online_recycler" 14 android:id="@+id/online_recycler"
14 android:layout_width="match_parent" 15 android:layout_width="match_parent"
@@ -23,4 +24,12 @@ @@ -23,4 +24,12 @@
23 app:spanCount="2" /> 24 app:spanCount="2" />
24 </com.scwang.smart.refresh.layout.SmartRefreshLayout> 25 </com.scwang.smart.refresh.layout.SmartRefreshLayout>
25 26
26 -</LinearLayout>  
  27 + <TextView
  28 + android:id="@+id/none"
  29 + android:layout_width="match_parent"
  30 + android:layout_height="wrap_content"
  31 + android:gravity="center"
  32 + android:padding="32dp"
  33 + android:text="暂无数据"
  34 + android:visibility="gone" />
  35 +</FrameLayout>