正在显示
20 个修改的文件
包含
86 行增加
和
161 行删除
@@ -70,7 +70,18 @@ interface LessonApi : ApiService { | @@ -70,7 +70,18 @@ interface LessonApi : ApiService { | ||
70 | @POST("/api/lesson/lesson_detail") | 70 | @POST("/api/lesson/lesson_detail") |
71 | fun lessonVideoDetail( | 71 | fun lessonVideoDetail( |
72 | @Field("id") id: Int | 72 | @Field("id") id: Int |
73 | -// , @Field("train_class_id") train_class_id: Int | 73 | + , @Field("train_class_id") train_class_id: Int |
74 | + ): Observable<BaseResponse<LessonTrainVideoDetail>> | ||
75 | + | ||
76 | + | ||
77 | + /** | ||
78 | + * 视频课程详情 | ||
79 | + * @param id 课程id | ||
80 | + */ | ||
81 | + @FormUrlEncoded | ||
82 | + @POST("/api/lesson/lesson_detail") | ||
83 | + fun lessonVideoDetail( | ||
84 | + @Field("id") id: Int | ||
74 | ): Observable<BaseResponse<LessonTrainVideoDetail>> | 85 | ): Observable<BaseResponse<LessonTrainVideoDetail>> |
75 | 86 | ||
76 | /** | 87 | /** |
@@ -230,8 +241,7 @@ interface LessonApi : ApiService { | @@ -230,8 +241,7 @@ interface LessonApi : ApiService { | ||
230 | @Field("type") type: Int, | 241 | @Field("type") type: Int, |
231 | @Field("lesson_id") lesson_id: String, | 242 | @Field("lesson_id") lesson_id: String, |
232 | @Field("train_class_id") train_class_id: String, | 243 | @Field("train_class_id") train_class_id: String, |
233 | - @Field("view_len") view_len: String?, | ||
234 | - @FieldMap fieldMap: HashMap<String, String> | 244 | + @Field("view_len") view_len: String? |
235 | ): Observable<BaseResponse<Void>> | 245 | ): Observable<BaseResponse<Void>> |
236 | 246 | ||
237 | @FormUrlEncoded | 247 | @FormUrlEncoded |
@@ -68,6 +68,14 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | @@ -68,6 +68,14 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | ||
68 | 68 | ||
69 | fun lessonVideoDetail( | 69 | fun lessonVideoDetail( |
70 | id: Int, | 70 | id: Int, |
71 | + trainClassId: Int, | ||
72 | + liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>> | ||
73 | + ) { | ||
74 | + addRequest(lessonService.lessonVideoDetail(id,trainClassId), liveData) | ||
75 | + } | ||
76 | + | ||
77 | + fun lessonVideoDetail( | ||
78 | + id: Int, | ||
71 | liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>> | 79 | liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>> |
72 | ) { | 80 | ) { |
73 | addRequest(lessonService.lessonVideoDetail(id), liveData) | 81 | addRequest(lessonService.lessonVideoDetail(id), liveData) |
@@ -163,11 +171,10 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | @@ -163,11 +171,10 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | ||
163 | lesson_id: String, | 171 | lesson_id: String, |
164 | train_class_id: String, | 172 | train_class_id: String, |
165 | view_len: String?, | 173 | view_len: String?, |
166 | - map: HashMap<String, String>, | ||
167 | liveData: MutableLiveData<BaseResponse<Void>> | 174 | liveData: MutableLiveData<BaseResponse<Void>> |
168 | ) { | 175 | ) { |
169 | addRequest( | 176 | addRequest( |
170 | - lessonService.recordTrainLesson(type, lesson_id, train_class_id, view_len, map), | 177 | + lessonService.recordTrainLesson(type, lesson_id, train_class_id, view_len), |
171 | liveData | 178 | liveData |
172 | ) | 179 | ) |
173 | } | 180 | } |
@@ -177,11 +184,11 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | @@ -177,11 +184,11 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo | ||
177 | lesson_id: String, | 184 | lesson_id: String, |
178 | train_class_id: String, | 185 | train_class_id: String, |
179 | view_len: String?, | 186 | view_len: String?, |
180 | - class_id: String?, | 187 | + mClassId: String?, |
181 | liveData: MutableLiveData<BaseResponse<Void>> | 188 | liveData: MutableLiveData<BaseResponse<Void>> |
182 | ) { | 189 | ) { |
183 | addRequest( | 190 | addRequest( |
184 | - lessonService.recordTrainLesson(type, lesson_id, train_class_id, view_len, class_id), | 191 | + lessonService.recordTrainLesson(type, lesson_id, train_class_id, view_len, mClassId), |
185 | liveData | 192 | liveData |
186 | ) | 193 | ) |
187 | } | 194 | } |
@@ -37,7 +37,7 @@ open class LessonVideo( | @@ -37,7 +37,7 @@ open class LessonVideo( | ||
37 | var des: String, // 描述 | 37 | var des: String, // 描述 |
38 | var image: String, // 图片 | 38 | var image: String, // 图片 |
39 | var class_hours: Int, // 总课时 | 39 | var class_hours: Int, // 总课时 |
40 | - var pos_name: Int, // 工种 | 40 | + var pos_name: Int, // 岗位 |
41 | var teacher: Teacher | 41 | var teacher: Teacher |
42 | ) | 42 | ) |
43 | 43 |
@@ -75,7 +75,7 @@ open class ExamBean( | @@ -75,7 +75,7 @@ open class ExamBean( | ||
75 | var score: Int, | 75 | var score: Int, |
76 | var pass: Int, | 76 | var pass: Int, |
77 | var name: String, // 考试名称 | 77 | var name: String, // 考试名称 |
78 | - var pos_name: String, // 工种 | 78 | + var pos_name: String, // 岗位 |
79 | var answer_count: Int, // 做过的人数 | 79 | var answer_count: Int, // 做过的人数 |
80 | var is_complete: Int, // 答题状态0=未完成1=已完成 | 80 | var is_complete: Int, // 答题状态0=未完成1=已完成 |
81 | var count: Int, // 题目数量 | 81 | var count: Int, // 题目数量 |
@@ -40,8 +40,11 @@ open class CourseParam() : Parcelable { | @@ -40,8 +40,11 @@ open class CourseParam() : Parcelable { | ||
40 | // 观看进度 | 40 | // 观看进度 |
41 | var mViewLen: Int = 0 | 41 | var mViewLen: Int = 0 |
42 | 42 | ||
43 | + var isFinished: Boolean = false | ||
44 | + | ||
43 | constructor(parcel: Parcel) : this() { | 45 | constructor(parcel: Parcel) : this() { |
44 | isTrainClass = parcel.readByte() != 0.toByte() | 46 | isTrainClass = parcel.readByte() != 0.toByte() |
47 | + title = parcel.readString().toString() | ||
45 | type = parcel.readInt() | 48 | type = parcel.readInt() |
46 | mLessonId = parcel.readString().toString() | 49 | mLessonId = parcel.readString().toString() |
47 | mClassId = parcel.readString().toString() | 50 | mClassId = parcel.readString().toString() |
@@ -49,11 +52,12 @@ open class CourseParam() : Parcelable { | @@ -49,11 +52,12 @@ open class CourseParam() : Parcelable { | ||
49 | lat = parcel.readString().toString() | 52 | lat = parcel.readString().toString() |
50 | lng = parcel.readString().toString() | 53 | lng = parcel.readString().toString() |
51 | mViewLen = parcel.readInt() | 54 | mViewLen = parcel.readInt() |
52 | - title = parcel.readString().toString() | 55 | + isFinished = parcel.readByte() != 0.toByte() |
53 | } | 56 | } |
54 | 57 | ||
55 | override fun writeToParcel(parcel: Parcel, flags: Int) { | 58 | override fun writeToParcel(parcel: Parcel, flags: Int) { |
56 | parcel.writeByte(if (isTrainClass) 1 else 0) | 59 | parcel.writeByte(if (isTrainClass) 1 else 0) |
60 | + parcel.writeString(title) | ||
57 | parcel.writeInt(type) | 61 | parcel.writeInt(type) |
58 | parcel.writeString(mLessonId) | 62 | parcel.writeString(mLessonId) |
59 | parcel.writeString(mClassId) | 63 | parcel.writeString(mClassId) |
@@ -61,7 +65,7 @@ open class CourseParam() : Parcelable { | @@ -61,7 +65,7 @@ open class CourseParam() : Parcelable { | ||
61 | parcel.writeString(lat) | 65 | parcel.writeString(lat) |
62 | parcel.writeString(lng) | 66 | parcel.writeString(lng) |
63 | parcel.writeInt(mViewLen) | 67 | parcel.writeInt(mViewLen) |
64 | - parcel.writeString(title) | 68 | + parcel.writeByte(if (isFinished) 1 else 0) |
65 | } | 69 | } |
66 | 70 | ||
67 | override fun describeContents(): Int { | 71 | override fun describeContents(): Int { |
@@ -77,6 +81,7 @@ open class CourseParam() : Parcelable { | @@ -77,6 +81,7 @@ open class CourseParam() : Parcelable { | ||
77 | return arrayOfNulls(size) | 81 | return arrayOfNulls(size) |
78 | } | 82 | } |
79 | } | 83 | } |
84 | + | ||
80 | } | 85 | } |
81 | 86 | ||
82 | // 课程详情描述 | 87 | // 课程详情描述 |
@@ -23,7 +23,7 @@ class MockExamActivity : | @@ -23,7 +23,7 @@ class MockExamActivity : | ||
23 | override fun initData() { | 23 | override fun initData() { |
24 | super.initData() | 24 | super.initData() |
25 | binding.apply { | 25 | binding.apply { |
26 | - // 工种 | 26 | + // 岗位 |
27 | toolBar.setRightText("$sp_job_name") | 27 | toolBar.setRightText("$sp_job_name") |
28 | binding.apply { | 28 | binding.apply { |
29 | // 自动刷新 | 29 | // 自动刷新 |
@@ -22,7 +22,7 @@ class PracticeListActivity : BaseLifeCycleActivity<PracticeViewModel, ActivityPr | @@ -22,7 +22,7 @@ class PracticeListActivity : BaseLifeCycleActivity<PracticeViewModel, ActivityPr | ||
22 | override fun initData() { | 22 | override fun initData() { |
23 | super.initData() | 23 | super.initData() |
24 | binding.apply { | 24 | binding.apply { |
25 | - // 工种 | 25 | + // 岗位 |
26 | // toolBar.setRightText(sp_job_name) | 26 | // toolBar.setRightText(sp_job_name) |
27 | binding.apply { | 27 | binding.apply { |
28 | // 自动刷新 | 28 | // 自动刷新 |
@@ -140,7 +140,7 @@ class BankFragment : | @@ -140,7 +140,7 @@ class BankFragment : | ||
140 | } | 140 | } |
141 | 141 | ||
142 | override fun initDataObserver() { | 142 | override fun initDataObserver() { |
143 | - //工种 | 143 | + //岗位 |
144 | mViewModel.mWorkTypeBean.observe(this, { | 144 | mViewModel.mWorkTypeBean.observe(this, { |
145 | classifyPop.setList(it.data.list) | 145 | classifyPop.setList(it.data.list) |
146 | if (!classifyPop.isShowing) { | 146 | if (!classifyPop.isShowing) { |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/home/activity/LiveCourseActivity.kt
@@ -50,7 +50,7 @@ class LiveCourseActivity | @@ -50,7 +50,7 @@ class LiveCourseActivity | ||
50 | } | 50 | } |
51 | 51 | ||
52 | override fun initDataObserver() { | 52 | override fun initDataObserver() { |
53 | - //工种 | 53 | + //岗位 |
54 | mViewModel.mWorkTypeBean.observe(this, { | 54 | mViewModel.mWorkTypeBean.observe(this, { |
55 | classifyPop.setList(it.data.list) | 55 | classifyPop.setList(it.data.list) |
56 | if (!classifyPop.isShowing) { | 56 | if (!classifyPop.isShowing) { |
@@ -94,7 +94,7 @@ class WebViewActivity : | @@ -94,7 +94,7 @@ class WebViewActivity : | ||
94 | ws.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW | 94 | ws.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW |
95 | } | 95 | } |
96 | } | 96 | } |
97 | -// WebView.setWebContentsDebuggingEnabled(true) | 97 | + WebView.setWebContentsDebuggingEnabled(true) |
98 | webView?.webViewClient = | 98 | webView?.webViewClient = |
99 | object : WebViewClient() { | 99 | object : WebViewClient() { |
100 | override fun onReceivedSslError( | 100 | override fun onReceivedSslError( |
1 | package com.br_technology.securitytrain_master.ui.view.home.activity.course | 1 | package com.br_technology.securitytrain_master.ui.view.home.activity.course |
2 | 2 | ||
3 | import android.Manifest | 3 | import android.Manifest |
4 | +import android.app.Activity | ||
4 | import android.content.Intent | 5 | import android.content.Intent |
5 | import android.text.TextUtils | 6 | import android.text.TextUtils |
6 | import androidx.fragment.app.FragmentPagerAdapter | 7 | import androidx.fragment.app.FragmentPagerAdapter |
@@ -85,17 +86,27 @@ class CourseDetailActivity | @@ -85,17 +86,27 @@ class CourseDetailActivity | ||
85 | dialogLoading!!.show() | 86 | dialogLoading!!.show() |
86 | } | 87 | } |
87 | 88 | ||
89 | + private fun dismissLoading() { | ||
90 | + if (dialogLoading != null && dialogLoading!!.isShowing) { | ||
91 | + dialogLoading!!.dismiss() | ||
92 | + } | ||
93 | + } | ||
94 | + | ||
88 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | 95 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
89 | super.onActivityResult(requestCode, resultCode, data) | 96 | super.onActivityResult(requestCode, resultCode, data) |
90 | if (requestCode == FaceUtil.FRONT_CAPTURE_CODE) { | 97 | if (requestCode == FaceUtil.FRONT_CAPTURE_CODE) { |
91 | - permissionCount = 0 | ||
92 | - fileUploadTemp?.let { | ||
93 | - faceUtil.compressFile(this, fileUploadTemp!!, object : FaceUtil.ICompress { | ||
94 | - override fun compress(file: File) { | ||
95 | - dialogLoading() | ||
96 | - mViewModel.uploadFace(file.path) | ||
97 | - } | ||
98 | - }) | 98 | + if (resultCode == Activity.RESULT_OK) { |
99 | + permissionCount = 0 | ||
100 | + fileUploadTemp?.let { | ||
101 | + faceUtil.compressFile(this, fileUploadTemp!!, object : FaceUtil.ICompress { | ||
102 | + override fun compress(file: File) { | ||
103 | + dialogLoading() | ||
104 | + mViewModel.uploadFace(file.path) | ||
105 | + } | ||
106 | + }) | ||
107 | + } | ||
108 | + } else { | ||
109 | + dismissLoading() | ||
99 | } | 110 | } |
100 | } | 111 | } |
101 | } | 112 | } |
@@ -262,7 +273,7 @@ class CourseDetailActivity | @@ -262,7 +273,7 @@ class CourseDetailActivity | ||
262 | Glide.with(this@CourseDetailActivity).load(it.image).into(binding.ivTop) | 273 | Glide.with(this@CourseDetailActivity).load(it.image).into(binding.ivTop) |
263 | } | 274 | } |
264 | mViewModel.workType() | 275 | mViewModel.workType() |
265 | - mViewModel.mWorkBean.observe(this, { | 276 | + mViewModel.mWorkBean.observe(this, { it -> |
266 | mWorkBean = it.data | 277 | mWorkBean = it.data |
267 | for (data in it.data.list) { | 278 | for (data in it.data.list) { |
268 | mapWork.put(data.id, data) | 279 | mapWork.put(data.id, data) |
@@ -271,11 +282,17 @@ class CourseDetailActivity | @@ -271,11 +282,17 @@ class CourseDetailActivity | ||
271 | courseBean?.let { | 282 | courseBean?.let { |
272 | when (it.type) { | 283 | when (it.type) { |
273 | TYPE_COURSE_DETAIL_ITEM_VIDEO -> { | 284 | TYPE_COURSE_DETAIL_ITEM_VIDEO -> { |
274 | - mViewModel.videoLessonsDetail(it.mLessonId.toInt()) | 285 | + mViewModel.videoLessonsDetail( |
286 | + it.mLessonId.toInt(), | ||
287 | + it.mTrainClassId.toInt() | ||
288 | + ) | ||
275 | } | 289 | } |
276 | TYPE_COURSE_DETAIL_ITEM_NORMAL -> { | 290 | TYPE_COURSE_DETAIL_ITEM_NORMAL -> { |
277 | if (courseBean?.isTrainClass == true) { | 291 | if (courseBean?.isTrainClass == true) { |
278 | - mViewModel.videoLessonsDetail(it.mLessonId.toInt()) | 292 | + mViewModel.videoLessonsDetail( |
293 | + it.mLessonId.toInt(), | ||
294 | + it.mTrainClassId.toInt() | ||
295 | + ) | ||
279 | } else { | 296 | } else { |
280 | mViewModel.videoLessonNormal(it.mLessonId.toInt()) | 297 | mViewModel.videoLessonNormal(it.mLessonId.toInt()) |
281 | } | 298 | } |
@@ -287,7 +304,7 @@ class CourseDetailActivity | @@ -287,7 +304,7 @@ class CourseDetailActivity | ||
287 | mViewModel.offLessonDetail(it.mLessonId.toInt()) | 304 | mViewModel.offLessonDetail(it.mLessonId.toInt()) |
288 | } | 305 | } |
289 | } | 306 | } |
290 | - if (it.type != TYPE_COURSE_DETAIL_ITEM_OFF) { | 307 | + if (it.type != TYPE_COURSE_DETAIL_ITEM_OFF && !it.isFinished) { |
291 | showDialogId() | 308 | showDialogId() |
292 | } | 309 | } |
293 | } | 310 | } |
@@ -54,7 +54,7 @@ class LocationSignActivity : | @@ -54,7 +54,7 @@ class LocationSignActivity : | ||
54 | map.put("lat", "${mLocation?.latitude}") | 54 | map.put("lat", "${mLocation?.latitude}") |
55 | map.put("lng", "${mLocation?.longitude}") | 55 | map.put("lng", "${mLocation?.longitude}") |
56 | 56 | ||
57 | - mViewModel.recordTrainLesson("$mLessonId", "$mTrainClassId", null, map) | 57 | + mViewModel.recordTrainLesson("$mLessonId", "$mTrainClassId", null) |
58 | } | 58 | } |
59 | } | 59 | } |
60 | } | 60 | } |
app/src/main/java/com/br_technology/securitytrain_master/ui/view/home/fragment/CourseListFragment.kt
@@ -77,7 +77,7 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin | @@ -77,7 +77,7 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin | ||
77 | val param = (activity as CourseDetailActivity).getCourseBean() | 77 | val param = (activity as CourseDetailActivity).getCourseBean() |
78 | when (item.type) { | 78 | when (item.type) { |
79 | TYPE_COURSE_DETAIL_ITEM_VIDEO -> { | 79 | TYPE_COURSE_DETAIL_ITEM_VIDEO -> { |
80 | -// param?.mClassId = item.lessonVideoChild?.id.toString() | 80 | + param?.mClassId = item.lessonVideoChild?.id.toString() |
81 | startActivity( | 81 | startActivity( |
82 | Intent(activity, VideoDetailActivity::class.java) | 82 | Intent(activity, VideoDetailActivity::class.java) |
83 | .putExtra(COMMON_URL, item.lessonVideoChild?.video_url) | 83 | .putExtra(COMMON_URL, item.lessonVideoChild?.video_url) |
@@ -164,7 +164,6 @@ class HomeFragment : | @@ -164,7 +164,6 @@ class HomeFragment : | ||
164 | startActivity( | 164 | startActivity( |
165 | Intent(requireContext(), WebViewActivity::class.java) | 165 | Intent(requireContext(), WebViewActivity::class.java) |
166 | .putExtra(COMMON_URL, res.href) | 166 | .putExtra(COMMON_URL, res.href) |
167 | -// .putExtra(COMMON_URL, url) | ||
168 | ) | 167 | ) |
169 | } | 168 | } |
170 | } | 169 | } |
@@ -240,122 +239,4 @@ class HomeFragment : | @@ -240,122 +239,4 @@ class HomeFragment : | ||
240 | override fun immersionBarEnabled(): Boolean { | 239 | override fun immersionBarEnabled(): Boolean { |
241 | return true | 240 | return true |
242 | } | 241 | } |
243 | - | ||
244 | -} | ||
245 | -//class HomeFragment : Fragment() { | ||
246 | -// override fun onCreateView( | ||
247 | -// inflater: LayoutInflater, | ||
248 | -// container: ViewGroup?, | ||
249 | -// savedInstanceState: Bundle? | ||
250 | -// ): View? { | ||
251 | -// return inflater.inflate(R.layout.fragment_home, container, false) | ||
252 | -// } | ||
253 | -// | ||
254 | -// override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
255 | -// super.onViewCreated(view, savedInstanceState) | ||
256 | -// | ||
257 | -// | ||
258 | -// val banner: Banner<Int, BannerImageAdapter<Int>> = view.findViewById(R.id.banner) | ||
259 | -// banner.setAdapter(object : BannerImageAdapter<Int>( | ||
260 | -// mutableListOf( | ||
261 | -// R.mipmap.banner, | ||
262 | -// R.mipmap.banner, | ||
263 | -// R.mipmap.banner | ||
264 | -// ) | ||
265 | -// ) { | ||
266 | -// override fun onBindView( | ||
267 | -// holder: BannerImageHolder, | ||
268 | -// data: Int, | ||
269 | -// position: Int, | ||
270 | -// size: Int | ||
271 | -// ) { | ||
272 | -// Glide.with(requireActivity()) | ||
273 | -// .load(data) | ||
274 | -// .apply(RequestOptions.bitmapTransform(RoundedCorners(8))) | ||
275 | -// .into(holder.imageView) | ||
276 | -// | ||
277 | -// } | ||
278 | -// }).addBannerLifecycleObserver(this) | ||
279 | -// .indicator = CircleIndicator(requireContext()) | ||
280 | -// | ||
281 | -// // 共享资料库 | ||
282 | -// view.findViewById<TextView>(R.id.database).setOnClickListener { | ||
283 | -// startActivity(DatabaseActivity::class.java) | ||
284 | -// } | ||
285 | -// | ||
286 | -// // 共享资料库 | ||
287 | -// view.findViewById<TextView>(R.id.txt_course).setOnClickListener { | ||
288 | -// startActivity(TextCourseActivity::class.java) | ||
289 | -// } | ||
290 | -// // 在线课程 | ||
291 | -// view.findViewById<TextView>(R.id.online_course).setOnClickListener { | ||
292 | -//// startActivity() | ||
293 | -// } | ||
294 | -// | ||
295 | -// // 视频课程 | ||
296 | -// val videoCourse: RecyclerView = view.findViewById(R.id.video_course) | ||
297 | -// videoCourse.addItemDecoration(object : RecyclerView.ItemDecoration() { | ||
298 | -// override fun getItemOffsets( | ||
299 | -// outRect: Rect, | ||
300 | -// view: View, | ||
301 | -// parent: RecyclerView, | ||
302 | -// state: RecyclerView.State | ||
303 | -// ) { | ||
304 | -// super.getItemOffsets(outRect, view, parent, state) | ||
305 | -// if (parent.getChildAdapterPosition(view) % 2 == 0) { | ||
306 | -// outRect.top = 24 | ||
307 | -// outRect.right = 15 | ||
308 | -// } else { | ||
309 | -// outRect.top = 24 | ||
310 | -// outRect.left = 15 | ||
311 | -// } | ||
312 | -// } | ||
313 | -// }) | ||
314 | -// val videoCourseAdapter = VideoCourseAdapter() | ||
315 | -// val list = mutableListOf( | ||
316 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
317 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
318 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
319 | -// VideoCourse(R.mipmap.banner, "10课时", "自动化制作课程", "", "张钧-三岗职位培训班"), | ||
320 | -// ) | ||
321 | -// videoCourse.adapter = videoCourseAdapter | ||
322 | -// videoCourseAdapter.addList(list) | ||
323 | -// | ||
324 | -// val recommendData: RecyclerView = view.findViewById(R.id.recommended_data) | ||
325 | -// val recommendDataAdapter = RecommendDataAdapter() | ||
326 | -// val recommendList = mutableListOf( | ||
327 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
328 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
329 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
330 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
331 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
332 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
333 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
334 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
335 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
336 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
337 | -// RecommendData(R.mipmap.banner, "思维导图高分作文法(高中)议论", "从这个角度看,康得在不经意间这样说过,既然我已踏上了这条道路,那么"), | ||
338 | -// ) | ||
339 | -// recommendData.adapter = recommendDataAdapter | ||
340 | -// recommendDataAdapter.addList(recommendList) | ||
341 | -// | ||
342 | -// | ||
343 | -// view.findViewById<View>(R.id.search).setOnClickListener { | ||
344 | -// val intent = Intent(requireActivity(), SearchActivity::class.java) | ||
345 | -// startActivity(intent) | ||
346 | -// } | ||
347 | -// } | ||
348 | -// | ||
349 | -// | ||
350 | -// private fun startActivity(cls: Class<out Activity>) { | ||
351 | -// startActivity(cls, null) | ||
352 | -// } | ||
353 | -// | ||
354 | -// private fun startActivity(cls: Class<out Activity>, bundle: Bundle?) { | ||
355 | -// val intent = Intent(requireActivity(), cls) | ||
356 | -// if (bundle != null) { | ||
357 | -// intent.putExtras(bundle) | ||
358 | -// } | ||
359 | -// startActivity(intent) | ||
360 | -// } | ||
361 | -//} | ||
242 | +} |
@@ -24,9 +24,10 @@ class CourseDetailViewModel : BaseViewModel<LessonRepository>() { | @@ -24,9 +24,10 @@ class CourseDetailViewModel : BaseViewModel<LessonRepository>() { | ||
24 | var mFaceCheck = MutableLiveData<BaseResponse<Void>>() | 24 | var mFaceCheck = MutableLiveData<BaseResponse<Void>>() |
25 | 25 | ||
26 | fun videoLessonsDetail( | 26 | fun videoLessonsDetail( |
27 | - id: Int | 27 | + id: Int, |
28 | + trainClassId: Int | ||
28 | ) { | 29 | ) { |
29 | - mRepository.lessonVideoDetail(id, mVideoLesson) | 30 | + mRepository.lessonVideoDetail(id,trainClassId, mVideoLesson) |
30 | } | 31 | } |
31 | 32 | ||
32 | fun videoLessonNormal(id: Int) { | 33 | fun videoLessonNormal(id: Int) { |
@@ -19,10 +19,11 @@ class LocationSignViewModel : BaseViewModel<LessonRepository>() { | @@ -19,10 +19,11 @@ class LocationSignViewModel : BaseViewModel<LessonRepository>() { | ||
19 | mRepository.lessonOffSignup(lessonId, lat, lng, signData) | 19 | mRepository.lessonOffSignup(lessonId, lat, lng, signData) |
20 | } | 20 | } |
21 | 21 | ||
22 | - fun recordTrainLesson(lesson_id: String, | ||
23 | - train_class_id: String, | ||
24 | - view_len: String?, | ||
25 | - map: HashMap<String, String>,) { | ||
26 | - mRepository.recordTrainLesson(3, lesson_id, train_class_id, view_len,map,liveData) | 22 | + fun recordTrainLesson( |
23 | + lesson_id: String, | ||
24 | + train_class_id: String, | ||
25 | + view_len: String? | ||
26 | + ) { | ||
27 | + mRepository.recordTrainLesson(3, lesson_id, train_class_id, view_len, liveData) | ||
27 | } | 28 | } |
28 | } | 29 | } |
@@ -55,7 +55,6 @@ class TextDetailViewModel : BaseViewModel<LessonRepository>() { | @@ -55,7 +55,6 @@ class TextDetailViewModel : BaseViewModel<LessonRepository>() { | ||
55 | lesson_id, | 55 | lesson_id, |
56 | train_class_id, | 56 | train_class_id, |
57 | view_len, | 57 | view_len, |
58 | - HashMap(), | ||
59 | recordCalss | 58 | recordCalss |
60 | ) | 59 | ) |
61 | } | 60 | } |
@@ -145,7 +145,9 @@ class ClassDutyCourseFragment(val type: Int) : | @@ -145,7 +145,9 @@ class ClassDutyCourseFragment(val type: Int) : | ||
145 | val course = CourseParam() | 145 | val course = CourseParam() |
146 | course.mLessonId = "${data.id}" | 146 | course.mLessonId = "${data.id}" |
147 | course.isTrainClass = true | 147 | course.isTrainClass = true |
148 | - course.mClassId = "${data.class_id}" | 148 | + course.isFinished = data.status == "1" |
149 | +// course.mClassId = "${data.class_id}" | ||
150 | + course.mClassId = "${data.train_id}" | ||
149 | course.mTrainClassId = "${data.train_class_id}" | 151 | course.mTrainClassId = "${data.train_class_id}" |
150 | course.type = data.itemType | 152 | course.type = data.itemType |
151 | return course | 153 | return course |
@@ -157,8 +159,10 @@ class ClassDutyCourseFragment(val type: Int) : | @@ -157,8 +159,10 @@ class ClassDutyCourseFragment(val type: Int) : | ||
157 | course.mTrainClassId = "${ | 159 | course.mTrainClassId = "${ |
158 | if (data.isTest) { | 160 | if (data.isTest) { |
159 | data.practice?.id | 161 | data.practice?.id |
162 | + course.isFinished = data.practice?.is_complete == 1 | ||
160 | } else { | 163 | } else { |
161 | data.exam?.id | 164 | data.exam?.id |
165 | + course.isFinished = data.exam?.is_complete == 1 | ||
162 | } | 166 | } |
163 | }" | 167 | }" |
164 | course.type = data.itemType | 168 | course.type = data.itemType |
@@ -27,7 +27,7 @@ var is_login by SpUtil(IS_LOGIN, false) | @@ -27,7 +27,7 @@ var is_login by SpUtil(IS_LOGIN, false) | ||
27 | var sp_job_id by SpUtil(POI_ID, 0) | 27 | var sp_job_id by SpUtil(POI_ID, 0) |
28 | var sp_job_id_select by SpUtil(POI_ID_, 0) | 28 | var sp_job_id_select by SpUtil(POI_ID_, 0) |
29 | var sp_job_name by SpUtil(POI_NAME_, "") | 29 | var sp_job_name by SpUtil(POI_NAME_, "") |
30 | -var sp_job_name_select by SpUtil(POI_NAME_, "工种") | 30 | +var sp_job_name_select by SpUtil(POI_NAME_, "岗位") |
31 | 31 | ||
32 | const val TYPE_LIVE = 0 | 32 | const val TYPE_LIVE = 0 |
33 | const val TYPE_HOME = 1 | 33 | const val TYPE_HOME = 1 |
@@ -261,7 +261,7 @@ | @@ -261,7 +261,7 @@ | ||
261 | android:layout_height="wrap_content" | 261 | android:layout_height="wrap_content" |
262 | android:layout_gravity="center_vertical" | 262 | android:layout_gravity="center_vertical" |
263 | android:layout_marginStart="16dp" | 263 | android:layout_marginStart="16dp" |
264 | - android:text="部门:" | 264 | + android:text="车间:" |
265 | android:textColor="@color/color_32" | 265 | android:textColor="@color/color_32" |
266 | android:textSize="14sp" /> | 266 | android:textSize="14sp" /> |
267 | 267 |
-
请 注册 或 登录 后发表评论