|
|
|
@ -18,6 +18,7 @@ import com.zj365.health.R
|
|
|
|
|
import com.zj365.health.databinding.ActNsuanOpenBinding
|
|
|
|
|
import com.zj365.health.vm.NSuanVm
|
|
|
|
|
import com.xuexiang.xqrcode.XQRCode
|
|
|
|
|
import com.zj365.health.weight.DialogTip
|
|
|
|
|
import org.greenrobot.eventbus.EventBus
|
|
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
|
|
import org.greenrobot.eventbus.ThreadMode
|
|
|
|
@ -27,7 +28,7 @@ import pub.devrel.easypermissions.EasyPermissions
|
|
|
|
|
* 尿酸开通
|
|
|
|
|
*/
|
|
|
|
|
@Route(path = ARouterUrl.NS_OPEN)
|
|
|
|
|
class NSuanOpenAct : BaseVmAct<NSuanVm>() {
|
|
|
|
|
class NSuanOpenAct : BaseVmAct<NSuanVm>() , EasyPermissions.PermissionCallbacks ,EasyPermissions.RationaleCallbacks {
|
|
|
|
|
|
|
|
|
|
val binding by lazy { ActNsuanOpenBinding.inflate(layoutInflater) }
|
|
|
|
|
override fun setLayout(): View = binding.root
|
|
|
|
@ -98,20 +99,19 @@ class NSuanOpenAct : BaseVmAct<NSuanVm>() {
|
|
|
|
|
R.style.XQRCodeTheme_Custom
|
|
|
|
|
)
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
DialogTip(
|
|
|
|
|
this,
|
|
|
|
|
"中健365需要相机权限,以便您使用扫一扫功能"
|
|
|
|
|
) {
|
|
|
|
|
EasyPermissions.requestPermissions(this,"",
|
|
|
|
|
0x00011,
|
|
|
|
|
Manifest.permission.CAMERA)
|
|
|
|
|
}.show()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onSuccess(requestCode: Int) {
|
|
|
|
|
super.onSuccess(requestCode)
|
|
|
|
|
XQRCodeAct.start(
|
|
|
|
|
this@NSuanOpenAct,
|
|
|
|
|
QRCODE_AGREEMENT,
|
|
|
|
|
R.style.XQRCodeTheme_Custom
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun confirm() {
|
|
|
|
|
if (binding.mTvActCode.text.isNullOrEmpty()) {
|
|
|
|
@ -195,4 +195,26 @@ class NSuanOpenAct : BaseVmAct<NSuanVm>() {
|
|
|
|
|
fun onRefresh(event: NSuanOpenEvent) {
|
|
|
|
|
finish()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>) {
|
|
|
|
|
XQRCodeAct.start(
|
|
|
|
|
this@NSuanOpenAct,
|
|
|
|
|
QRCODE_AGREEMENT,
|
|
|
|
|
R.style.XQRCodeTheme_Custom
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onRationaleAccepted(requestCode: Int) {
|
|
|
|
|
XQRCodeAct.start(
|
|
|
|
|
this@NSuanOpenAct,
|
|
|
|
|
QRCODE_AGREEMENT,
|
|
|
|
|
R.style.XQRCodeTheme_Custom
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onRationaleDenied(requestCode: Int) {
|
|
|
|
|
}
|
|
|
|
|
}
|