...
|
...
|
@@ -3,7 +3,10 @@ package com.br_technology.securitytrain_master.ui.view.home.activity.course |
|
|
import android.Manifest
|
|
|
import android.location.LocationManager
|
|
|
import android.util.Log
|
|
|
import com.br_technology.securitytrain_master.base.common.ConstantParamKey
|
|
|
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.CLASS_ID
|
|
|
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_ID
|
|
|
import com.br_technology.securitytrain_master.base.common.ConstantParamKey.TRAIN_CLASS_ID
|
|
|
import com.br_technology.securitytrain_master.base.view.BaseApplication
|
|
|
import com.br_technology.securitytrain_master.databinding.ActivityLocationSignBinding
|
|
|
import com.br_technology.securitytrain_master.ext.initPermissions
|
...
|
...
|
@@ -29,6 +32,8 @@ class LocationSignActivity : |
|
|
), TencentLocationListener {
|
|
|
|
|
|
var mClassId: String? = null
|
|
|
var mLessonId: String? = null
|
|
|
var mTrainClassId: String? = null
|
|
|
private var mLocation: TencentLocation? = null
|
|
|
|
|
|
override fun initView() {
|
...
|
...
|
@@ -39,8 +44,18 @@ class LocationSignActivity : |
|
|
BaseApplication.instance.mLocationManager.coordinateType =
|
|
|
TencentLocationManager.COORDINATE_TYPE_GCJ02;
|
|
|
rvSign.setOnClickListener {
|
|
|
if (mLocation != null && mClassId != null) {
|
|
|
mViewModel.sign(mClassId?:"", "${mLocation?.latitude}", "${mLocation?.longitude}")
|
|
|
if (mLocation != null && mLessonId != null&&mTrainClassId!=null&&mClassId!=null) {
|
|
|
// mViewModel.sign(
|
|
|
// mClassId ?: "",
|
|
|
// "${mLocation?.latitude}",
|
|
|
// "${mLocation?.longitude}"
|
|
|
// )
|
|
|
val map = hashMapOf<String,String>()
|
|
|
map.put("class_id",mClassId?:"")
|
|
|
map.put("lat","${mLocation?.latitude}")
|
|
|
map.put("lng","${mLocation?.longitude}")
|
|
|
|
|
|
mViewModel.recordTrainLesson("$mLessonId","$mTrainClassId",null, map)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -49,6 +64,8 @@ class LocationSignActivity : |
|
|
override fun initData() {
|
|
|
super.initData()
|
|
|
mClassId = intent.getStringExtra(CLASS_ID)
|
|
|
mLessonId = intent.getStringExtra(LESSON_ID)
|
|
|
mTrainClassId = intent.getStringExtra(TRAIN_CLASS_ID)
|
|
|
}
|
|
|
|
|
|
override fun onStart() {
|
...
|
...
|
|