中建365-家人

develop
wlh 2 years ago
parent dbd6eccb2e
commit 916d6ad193

@ -383,6 +383,22 @@
android:taskAffinity="com.xty.healthuser" android:taskAffinity="com.xty.healthuser"
android:theme="@style/Theme.AppCompat.NoActionBar.Transparent" /> android:theme="@style/Theme.AppCompat.NoActionBar.Transparent" />
<!--适配华为huawei刘海屏-->
<meta-data
android:name="android.notch_support"
android:value="true" />
<!--适配小米xiaomi刘海屏-->
<meta-data
android:name="notch.config"
android:value="portrait|landscape" />
<meta-data
android:name="com.hihonor.push.app_id"
android:value="${HONOR_APPID}" />
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="5a316db0d8149008c774308b33d47174"/>
</application> </application>
</manifest> </manifest>

@ -1,15 +1,20 @@
package com.zj365.dc.activity package com.zj365.dc.activity
import android.content.Intent
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.TextView import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.luck.picture.lib.PictureSelector
import com.luck.picture.lib.config.PictureConfig
import com.luck.picture.lib.config.PictureMimeType import com.luck.picture.lib.config.PictureMimeType
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.picture.PictureUtils import com.xty.common.picture.PictureUtils
import com.zj365.dc.databinding.ActCalorieAnalyzeBinding import com.zj365.dc.databinding.ActCalorieAnalyzeBinding
import com.zj365.dc.vm.DietManagementVm
import com.zj365.health.R import com.zj365.health.R
@Route(path = ARouterUrl.CALORIE_ANALYZE) @Route(path = ARouterUrl.CALORIE_ANALYZE)
@ -17,6 +22,11 @@ class CalorieAnalyzeAct : BaseVmAct<BaseVm>() {
val binding by lazy { ActCalorieAnalyzeBinding.inflate(layoutInflater) } val binding by lazy { ActCalorieAnalyzeBinding.inflate(layoutInflater) }
var type:String = "1"//类型 1-菜品 2-果蔬 3-零食
var fileUrl:String? = null //当前选择的文件的路径
var bottomSheetDialog: BottomSheetDialog? = null var bottomSheetDialog: BottomSheetDialog? = null
override fun liveObserver() { override fun liveObserver() {
@ -38,14 +48,17 @@ class CalorieAnalyzeAct : BaseVmAct<BaseVm>() {
binding.tvDishes.setOnClickListener { binding.tvDishes.setOnClickListener {
bottomSheetDialog?.show() bottomSheetDialog?.show()
type = "1"
} }
binding.tvFruitVegetable.setOnClickListener { binding.tvFruitVegetable.setOnClickListener {
bottomSheetDialog?.show() bottomSheetDialog?.show()
type = "2"
} }
binding.tvSnack.setOnClickListener { binding.tvSnack.setOnClickListener {
bottomSheetDialog?.show() bottomSheetDialog?.show()
type = "3"
} }
@ -83,4 +96,30 @@ class CalorieAnalyzeAct : BaseVmAct<BaseVm>() {
} }
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode === RESULT_OK) {
when (requestCode) {
PictureConfig.CHOOSE_REQUEST -> {
var result = PictureSelector.obtainMultipleResult(data)
if (result.size > 0) {
if (result.isNotEmpty()) {
fileUrl = result[0].compressPath
fileUrl?.let {
bundle.clear()
bundle.putString("type",type)
bundle.putString("fileUrl",fileUrl)
RouteManager.goAct(ARouterUrl.RECOGNIZE_RESULT,bundle)
}
}
}
}
}
}
}
} }

@ -13,6 +13,8 @@ import com.zj365.dc.databinding.ActDietManagementBinding
class DietManagementAct : BaseVmAct<BaseVm>(){ class DietManagementAct : BaseVmAct<BaseVm>(){
val binding by lazy{ ActDietManagementBinding.inflate(layoutInflater)} val binding by lazy{ ActDietManagementBinding.inflate(layoutInflater)}
override fun liveObserver() { override fun liveObserver() {
} }

@ -5,7 +5,6 @@ import android.text.*
import android.text.method.HideReturnsTransformationMethod import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod import android.text.method.PasswordTransformationMethod
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.util.Log
import android.view.View import android.view.View
import android.widget.EditText import android.widget.EditText
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
@ -14,8 +13,6 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.androidkun.xtablayout.XTabLayout import com.androidkun.xtablayout.XTabLayout
import com.tamsiree.rxkit.RxKeyboardTool import com.tamsiree.rxkit.RxKeyboardTool
import com.tamsiree.rxkit.RxRegTool import com.tamsiree.rxkit.RxRegTool
import com.tencent.qcloud.tuicore.TUILogin
import com.tencent.qcloud.tuicore.interfaces.TUICallback
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog import com.xty.base.dialog.AppUpdateDialog
import com.xty.common.* import com.xty.common.*
@ -27,6 +24,8 @@ import com.xty.common.util.CommonToastUtils
import com.xty.network.model.WxInfoBean import com.xty.network.model.WxInfoBean
import com.zj365.dc.databinding.ActLoginBinding import com.zj365.dc.databinding.ActLoginBinding
import com.zj365.dc.vm.LoginVm import com.zj365.dc.vm.LoginVm
import com.zj365.health.weight.DialogTip
import com.zj365.health.weight.DialogTipNew
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
@ -44,6 +43,17 @@ class LoginAct : BaseVmAct<LoginVm>() {
var wxBean: WxInfoBean? = null var wxBean: WxInfoBean? = null
var tabName = arrayOf("账号密码","验证码") var tabName = arrayOf("账号密码","验证码")
val dialogBind by lazy {
DialogTipNew(this, "恭喜您成为中健三六五大家庭的医院,为了提供更好的信息服务,请完善您的基本信息。", "前往","取消",false,{
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE)
}){
EventBus.getDefault().post(LoginOrRegisterEvent())
finish()
}
}
val dialog by lazy { val dialog by lazy {
AppUpdateDialog(this){ AppUpdateDialog(this){
if (it){ if (it){
@ -143,7 +153,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
var span = SpannableString(getString(R.string.private_info)) var span = SpannableString(getString(R.string.private_info))
span.setSpan(object : ClickableSpan() { span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
bundle.clear() /* bundle.clear()
bundle.putString("title", "用户协议") bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1) bundle.putInt("type", Const.AGREEMENT_1)
RouteManager.goActRequest( RouteManager.goActRequest(
@ -151,7 +161,12 @@ class LoginAct : BaseVmAct<LoginVm>() {
this@LoginAct, this@LoginAct,
USER_AGREEMENT, USER_AGREEMENT,
bundle bundle
) )*/
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putString("url", "https://dc.zhongjian365.com/agreement.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
} }
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
@ -164,7 +179,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
bundle.clear() bundle.clear()
bundle.putString("title", "隐私政策") bundle.putString("title", "隐私政策")
bundle.putString("url", "https://auprty.com/app/static/app/privacy.html") bundle.putString("url", "https://dc.zhongjian365.com/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle) RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
} }
@ -265,11 +280,16 @@ class LoginAct : BaseVmAct<LoginVm>() {
override fun liveObserver() { override fun liveObserver() {
mViewModel.mLogin.observe(this) { mViewModel.mLogin.observe(this) {
loadingView.dismiss() loadingView.dismiss()
if (it.data.isPerfect == 0){
dialogBind.show()
}else{
EventBus.getDefault().post(LoginOrRegisterEvent())
finish()
}
// initTab() // initTab()
// mViewModel.getImUserSig("user_${it.data.id}") // mViewModel.getImUserSig("user_${it.data.id}")
// RouteManager.goAct(ARouterUrl.MAIN_ACT) // RouteManager.goAct(ARouterUrl.MAIN_ACT)
EventBus.getDefault().post(LoginOrRegisterEvent())
finish()
} }
// mViewModel.loginWx.observe(this) { // mViewModel.loginWx.observe(this) {
// loadingView.dismiss() // loadingView.dismiss()
@ -281,7 +301,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
initTab() initTab()
mViewModel.getImUserSig("user_${it}") mViewModel.getImUserSig("user_${it}")
}*/ }*/
mViewModel.getImUserSig.observe(this) { /* mViewModel.getImUserSig.observe(this) {
Log.e("simon", "login"+it.data) Log.e("simon", "login"+it.data)
TUILogin.login( TUILogin.login(
applicationContext, applicationContext,
@ -300,7 +320,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
} }
}) })
} }*/
mViewModel.codeLive.observe(this) { mViewModel.codeLive.observe(this) {
timeStart() timeStart()

@ -1,9 +1,11 @@
package com.zj365.dc.activity package com.zj365.dc.activity
import android.Manifest
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.net.Uri
import android.os.Build import android.os.Build
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
@ -17,6 +19,8 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager
import cn.jpush.android.api.JPushInterface import cn.jpush.android.api.JPushInterface
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSON import com.alibaba.fastjson.JSON
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.google.android.material.bottomnavigation.BottomNavigationItemView import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationMenuView import com.google.android.material.bottomnavigation.BottomNavigationMenuView
import com.lifesense.android.ble.core.serializer.AbstractMeasureData import com.lifesense.android.ble.core.serializer.AbstractMeasureData
@ -24,17 +28,20 @@ import com.lifesense.android.ble.device.fatscale.model.WeightMeasureData
import com.tamsiree.rxkit.RxActivityTool import com.tamsiree.rxkit.RxActivityTool
import com.tamsiree.rxkit.RxSPTool import com.tamsiree.rxkit.RxSPTool
import com.tencent.qcloud.tuicore.TUIConstants import com.tencent.qcloud.tuicore.TUIConstants
import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog import com.xty.base.dialog.AppUpdateDialog
import com.xty.base.vp2.VpAdapter import com.xty.base.vp2.VpAdapter
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.aMapUtils.AmapInit
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.checkBlueConnectPermission import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.event.MeasureWeightEvent import com.xty.common.event.MeasureWeightEvent
import com.xty.common.event.MqttReceive import com.xty.common.event.MqttReceive
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.common.util.ViewScreenshotUtils
import com.zj365.dc.BuildConfig import com.zj365.dc.BuildConfig
import com.zj365.dc.R import com.zj365.dc.R
import com.zj365.dc.databinding.ActivityMainBinding import com.zj365.dc.databinding.ActivityMainBinding
@ -45,12 +52,14 @@ import com.zj365.dc.fragment.MineFrag
import com.zj365.dc.vm.MainVm import com.zj365.dc.vm.MainVm
import com.zj365.health.act.binddevice.BaseDeviceBindListAct import com.zj365.health.act.binddevice.BaseDeviceBindListAct
import com.zj365.health.act.binddevice.BlueUtil import com.zj365.health.act.binddevice.BlueUtil
import com.zj365.mime.act.DevInfoAct
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
import pub.devrel.easypermissions.EasyPermissions
import java.util.Date import java.util.Date
@Route(path = ARouterUrl.MAIN_ACT) @Route(path = ARouterUrl.MAIN_ACT)
@ -67,6 +76,9 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
private var unreadCountReceiver: BroadcastReceiver? = null private var unreadCountReceiver: BroadcastReceiver? = null
private var badegView: View? = null private var badegView: View? = null
private var mLocationClient: AMapLocationClient? = null
private var mLocationOption: AMapLocationClientOption? = null
private val dialog by lazy { private val dialog by lazy {
AppUpdateDialog(this) { AppUpdateDialog(this) {
if (it) { if (it) {
@ -100,17 +112,7 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
HealthHomeFrag(), HealthHomeFrag(),
// Fragment(), // Fragment(),
DynamicManagementFrag(), DynamicManagementFrag(),
MessageFragment() MessageFragment(),
/*TUIConversationFragment(
if (RxSPTool.getString(this, Const.UnReadSysMessageContentKey)
.isNullOrEmpty()
) "用户预约提醒,新增用户提醒"
else RxSPTool.getString(this, Const.UnReadSysMessageContentKey),
if (RxSPTool.getString(this, Const.UnReadSysMessageTimeKey)
.isNullOrEmpty()
) Date().time.toString()
else RxSPTool.getString(this, Const.UnReadSysMessageTimeKey)
)*/,
MineFrag() MineFrag()
) )
} }
@ -123,23 +125,8 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
initBottomNav() initBottomNav()
addNv() addNv()
// mViewModel.getVersionNew() // mViewModel.getVersionNew()
/* val loginStatus = V2TIMManager.getInstance().loginStatus
Log.e("yansu", "loginStatus ${loginStatus}")
if (loginStatus != V2TIMManager.V2TIM_STATUS_LOGINED) {
Log.e("yansu", "请求 ${MMkvHelper.getString(Const.USER_ID)}")
mViewModel.getImUserSig("user_" + MMkvHelper.getLong(Const.USER_ID))
}*/
initUnreadCountReceiver() initUnreadCountReceiver()
JPushInterface.setBadgeNumber(this, 0) JPushInterface.setBadgeNumber(this, 0)
// //前台空服务
// val service = RouteManager.getAny(ARouterUrl.NONE_SERVICE) as Service
// intent.setClass(this,service::class.java)
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
// startForegroundService(intent)
// } else{
// startService(intent)
// }
//请求用户设备信息 //请求用户设备信息
val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") { val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {
@ -148,25 +135,20 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
MMkvHelper.getLong(Const.USER_ID).toString() MMkvHelper.getLong(Const.USER_ID).toString()
} }
mViewModel.getUserEquipmentInformationizationRequest(userId) mViewModel.getUserEquipmentInformationizationRequest(userId)
mViewModel.getBindList(BaseDeviceBindListAct.DeviceType.BODYFAT.type) // mViewModel.getBindList(BaseDeviceBindListAct.DeviceType.BODYFAT.type)
} }
/* private fun initBleSDK() {
fun getUnReadMessage() {
mViewModel.getNotReadCount()
}
private fun initBleSDK() {
BlueUtil.getBlueManage().setDebug(BuildConfig.isRelease) BlueUtil.getBlueManage().setDebug(BuildConfig.isRelease)
BlueUtil.getBlueManage() BlueUtil.getBlueManage()
.init( .init(
this, this,
"lx1f367d71ff67ca73", "",
"a713f5e2fa03ec19476a3ac96287c4645986c4c6", "",
null, null,
this this
) )
} }*/
fun initVp2() { fun initVp2() {
binding.mVp2.adapter = VpAdapter(listFragment, this) binding.mVp2.adapter = VpAdapter(listFragment, this)
@ -221,48 +203,10 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
// getUnReadMessage()
} }
override fun onNewIntent(intent: Intent?) { override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent) super.onNewIntent(intent)
// isonNewIntent = true;
handleOfflinePush(intent)
}
private fun handleOfflinePush(intent: Intent?) {
if (intent == null) {
Log.d("MainActivity", "handleOfflinePush intent is null")
return
}
// if (OfflinePushConfigs.getOfflinePushConfigs().clickNotificationCallbackMode === OfflinePushConfigs.CLICK_NOTIFICATION_CALLBACK_INTENT
// ) {
Log.d(
"MainActivity",
"OfflinePushConfigs.getOfflinePushConfigs().clickNotificationCallbackMode"
)
/* TUIUtils.handleOfflinePush(
intent
) { hasLogged ->
if (hasLogged) {
setIntent(null)
} else {
// finish()
}
}*/
// } else {
// val ext = intent.getStringExtra(TUIConstants.TUIOfflinePush.NOTIFICATION_EXT_KEY)
// TUIUtils.handleOfflinePush(ext
// ) { hasLogged ->
// if (hasLogged) {
// setIntent(null)
// } else {
// Log.d("MainActivity", "finish")
// finish()
//
// }
// }
// }
} }
public fun setCurrentTab(position: Int) { public fun setCurrentTab(position: Int) {
@ -292,13 +236,13 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
override fun liveObserver() { override fun liveObserver() {
mViewModel.saveSuccess.observe(this) { mViewModel.saveSuccess.observe(this) {
} }
mViewModel.boundDevices.observe(this) { /* mViewModel.boundDevices.observe(this) {
if (it.code != 0) return@observe if (it.code != 0) return@observe
val data = it.data val data = it.data
if (data.isNotEmpty()) { if (data.isNotEmpty()) {
if (checkBlueConnectPermission(this)) { if (checkBlueConnectPermission(this)) {
//体脂秤sdk初始化 //体脂秤sdk初始化
initBleSDK() // initBleSDK()
if (BlueUtil.getBlueManage().isInitialized) { if (BlueUtil.getBlueManage().isInitialized) {
it.data.forEach { bleData -> it.data.forEach { bleData ->
BlueUtil.getBlueManage().addBondedMac(bleData.mac) BlueUtil.getBlueManage().addBondedMac(bleData.mac)
@ -307,7 +251,7 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
} }
} }
} }
} }*/
mViewModel.updateLive.observe(this) { mViewModel.updateLive.observe(this) {
if (!it.data.url.isNullOrEmpty()) { if (!it.data.url.isNullOrEmpty()) {
@ -332,7 +276,7 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
Log.e("simon", it.data) Log.e("simon", it.data)
TUILogin.login( TUILogin.login(
applicationContext, applicationContext,
1400807230, ,
it.paramsData, it.paramsData,
it.data, it.data,
object : TUICallback() { object : TUICallback() {
@ -433,8 +377,12 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
} }
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
BlueUtil.getBlueManage().releaseResource() AmapInit.stopLocation()
// BlueUtil.getBlueManage().releaseResource()
} }
} }

@ -1,5 +1,6 @@
package com.zj365.dc.activity package com.zj365.dc.activity
import android.content.Intent
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
@ -8,32 +9,50 @@ import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.luck.picture.lib.PictureSelector
import com.luck.picture.lib.config.PictureConfig
import com.luck.picture.lib.config.PictureMimeType import com.luck.picture.lib.config.PictureMimeType
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.picture.PictureUtils import com.xty.common.picture.PictureUtils
import com.xty.common.util.SpannableUtils import com.xty.common.util.SpannableUtils
import com.xty.network.model.FoodRecoginzeInfo
import com.zj365.dc.adapter.RecognizeResultAdapter import com.zj365.dc.adapter.RecognizeResultAdapter
import com.zj365.dc.databinding.ActRecognizeResultBinding import com.zj365.dc.databinding.ActRecognizeResultBinding
import com.zj365.dc.vm.DietManagementVm
import com.zj365.health.R import com.zj365.health.R
@Route(path = ARouterUrl.RECOGNIZE_RESULT) @Route(path = ARouterUrl.RECOGNIZE_RESULT)
class RecognizeResultAct : BaseVmAct<BaseVm>() { class RecognizeResultAct : BaseVmAct<DietManagementVm>() {
val binding by lazy{ ActRecognizeResultBinding.inflate(layoutInflater)} val binding by lazy{ ActRecognizeResultBinding.inflate(layoutInflater)}
val adapter by lazy { RecognizeResultAdapter() } val adapter by lazy { RecognizeResultAdapter() }
var bottomSheetDialog: BottomSheetDialog? = null var bottomSheetDialog: BottomSheetDialog? = null
override fun liveObserver() {
var type:String? = null
var fileUrl :String? = null
override fun liveObserver() {
mViewModel.foodRecoginzeInfoLiveData.observe(this){
adapter.setNewInstance(it.data)
}
} }
override fun initView() { override fun initView() {
super.initView() super.initView()
statusBar(binding.title.mView) statusBar(binding.title.mView)
binding.title.mTvTitle.text = "识别结果" binding.title.mTvTitle.text = "识别结果"
type = intent.getStringExtra("type")
fileUrl = intent.getStringExtra("fileUrl")
fileUrl?.let {
mViewModel.submit(type!!,it)
}
binding.title.mIvBack.setOnClickListener { binding.title.mIvBack.setOnClickListener {
finish() finish()
} }
@ -53,7 +72,7 @@ class RecognizeResultAct : BaseVmAct<BaseVm>() {
binding.recycler.layoutManager = LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) binding.recycler.layoutManager = LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false)
binding.recycler.adapter = adapter binding.recycler.adapter = adapter
adapter.setOnItemChildClickListener { adapter, view, position -> adapter.setOnItemChildClickListener { adapter, view, position ->
val foodBean = adapter.getItem(position) as FoodRecoginzeInfo
} }
} }
@ -92,4 +111,27 @@ class RecognizeResultAct : BaseVmAct<BaseVm>() {
} }
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode === RESULT_OK) {
when (requestCode) {
PictureConfig.CHOOSE_REQUEST -> {
var result = PictureSelector.obtainMultipleResult(data)
if (result.size > 0) {
if (result.isNotEmpty()) {
fileUrl = result[0].compressPath
fileUrl?.let {
mViewModel.submit(type!!,it)
}
}
}
}
}
}
}
} }

@ -2,6 +2,7 @@ package com.zj365.dc.activity
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.graphics.Bitmap import android.graphics.Bitmap
import android.util.Log
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
@ -206,12 +207,27 @@ class WelcomeAct : BaseVmAct<WelcomeVm>() {
private fun initUMeng() { private fun initUMeng() {
UMConfigure.submitPolicyGrantResult(MyApp.instance, true) UMConfigure.submitPolicyGrantResult(MyApp.instance, true)
UMConfigure.init(
MyApp.instance,
com.xty.common.BuildConfig.umengKey,
com.xty.common.BuildConfig.umengChannelName,
UMConfigure.DEVICE_TYPE_PHONE,
""
)
} }
private fun initPush() { private fun initPush() {
JPushInterface.setDebugMode(!BuildConfig.isRelease) JPushInterface.setDebugMode(!BuildConfig.isRelease)
JPushInterface.init(MyApp.instance) JPushInterface.init(MyApp.instance)
//根据用户的设置开启或关闭消息通知 //根据用户的设置开启或关闭消息通知
val registrationID = JPushInterface.getRegistrationID(this)
LogUtils.d("terry", "registrationID:$registrationID")
val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") ""
else MMkvHelper.getLong(Const.USER_ID).toString()
if (!userId.isNullOrEmpty()){
Log.i("terry", "useId:$userId")
JPushInterface.setAlias(this,userId.toInt(),"user_release_${userId}")
}
JPushHelper(this).stopOrResumeJPush(MMkvHelper.getBoolean(Const.NOTICE_FLAG)) JPushHelper(this).stopOrResumeJPush(MMkvHelper.getBoolean(Const.NOTICE_FLAG))
} }

@ -144,6 +144,15 @@ class HealthMonitoringAdapter(
calorieStr.length - 3 calorieStr.length - 3
)*/ )*/
} else { } else {
if (
healthMonitoringListBean.buttonContent == "建模中" ||
healthMonitoringListBean.buttonContent == "未开通" ||
healthMonitoringListBean.buttonContent == "续费" ||
healthMonitoringListBean.buttonContent == "敬请期待"
){
mTvCalorie.visibility = View.GONE
}else{
mTvCalorie.visibility = View.VISIBLE
if (TextUtils.isEmpty(calorie)){ if (TextUtils.isEmpty(calorie)){
val calorieStr = "监测:--次" val calorieStr = "监测:--次"
mTvCalorie.text = calorieStr mTvCalorie.text = calorieStr
@ -151,6 +160,8 @@ class HealthMonitoringAdapter(
val calorieStr = "监测:${calorie}" val calorieStr = "监测:${calorie}"
mTvCalorie.text = calorieStr mTvCalorie.text = calorieStr
} }
}
} }

@ -2,11 +2,14 @@ package com.zj365.dc.adapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter import com.xty.base.adapter.BaseAdapter
import com.xty.network.model.FoodRecoginzeInfo
import com.xty.network.model.HomeLayoutBean import com.xty.network.model.HomeLayoutBean
import com.zj365.dc.R import com.zj365.dc.R
class RecognizeResultAdapter : BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_recognize_result){ class RecognizeResultAdapter : BaseAdapter<FoodRecoginzeInfo>(R.layout.item_recognize_result){
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) { override fun convert(holder: BaseViewHolder, item: FoodRecoginzeInfo) {
} }

@ -1,5 +1,6 @@
package com.zj365.dc.fragment package com.zj365.dc.fragment
import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
@ -25,6 +26,7 @@ import com.xty.common.Const
import com.xty.common.LogUtils import com.xty.common.LogUtils
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.UmengEventId import com.xty.common.UmengEventId
import com.xty.common.aMapUtils.AmapInit
import com.xty.common.app.MyApp import com.xty.common.app.MyApp
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
@ -53,6 +55,7 @@ import com.zj365.mime.weight.NoticeSettingDialog
import com.xty.network.MyRetrofit import com.xty.network.MyRetrofit
import com.xty.network.model.FamilyBean import com.xty.network.model.FamilyBean
import com.xty.network.model.HealthMonitoringListBean import com.xty.network.model.HealthMonitoringListBean
import com.xty.network.model.MainBean
import com.xty.network.model.MessageBean import com.xty.network.model.MessageBean
import com.xty.network.model.ReportBean import com.xty.network.model.ReportBean
import com.zj365.dc.BuildConfig import com.zj365.dc.BuildConfig
@ -74,6 +77,7 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import pub.devrel.easypermissions.EasyPermissions
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.regex.Matcher import java.util.regex.Matcher
import java.util.regex.Pattern import java.util.regex.Pattern
@ -83,7 +87,7 @@ import kotlin.math.min
/** /**
* 动态管理页面 * 动态管理页面
*/ */
class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() { class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermissions.PermissionCallbacks{
val binding by lazy { FragDynamicManagementBinding.inflate(layoutInflater) } val binding by lazy { FragDynamicManagementBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root override fun setLayout(): View = binding.root
@ -148,10 +152,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
* 0.心率1.血氧2.呼吸率3.体温4.步数5.睡眠6.血压7.血糖8.心电9.尿酸10.血脂 * 0.心率1.血氧2.呼吸率3.体温4.步数5.睡眠6.血压7.血糖8.心电9.尿酸10.血脂
*/ */
private val pageIndexs = arrayOf( private val pageIndexs = arrayOf(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9/*, 10*/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
) )
private val pageNames = arrayOf( private val pageNames = arrayOf(
"心率", "血氧", "呼吸率", "体温", "步数", "睡眠", "血压", "血糖", "心电", "尿酸"/*, "血脂"*/ "心率", "血氧", "呼吸率", "体温", "步数", "睡眠", "血压", "血糖", "心电", "尿酸", "血脂"
) )
@SuppressLint("ResourceType") @SuppressLint("ResourceType")
@ -172,8 +176,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
//刷新注册 //刷新注册
refresh() refresh()
updateWarningStatus()
binding.mGriddingList.mGridView.adapter = mHealthAdapter binding.mGriddingList.mGridView.adapter = mHealthAdapter
binding.mGriddingList.mGridView.setOnItemClickListener { _, _, position, _ -> binding.mGriddingList.mGridView.setOnItemClickListener { _, _, position, _ ->
val index = mHealthAdapter.getItem(position).type val index = mHealthAdapter.getItem(position).type
@ -206,10 +208,16 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
5 -> { 5 -> {
val deviceType = MMkvHelper.getString(Const.DEVICE_TYPE) val deviceType = MMkvHelper.getString(Const.DEVICE_TYPE)
if (deviceType == "U32" || deviceType == "A3") { /*if (deviceType == "U32" || deviceType == "A3") {
goPage(index - 1) goPage(index - 1)
} else { } else {
}*/
if (deviceType == "X1" || deviceType == "X2") {
goPage(index - 2) goPage(index - 2)
} else {
goPage(index - 1)
} }
} }
@ -222,7 +230,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} }
9 -> { 9 -> { //心电隐藏的前提下尿酸为8 否则为9
val deviceType = MMkvHelper.getString(Const.DEVICE_TYPE) val deviceType = MMkvHelper.getString(Const.DEVICE_TYPE)
if (deviceType == "X1" || deviceType == "X2") { if (deviceType == "X1" || deviceType == "X2") {
goPage(6) goPage(6)
@ -255,8 +263,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} }
10 -> { //血脂 10 -> { // //心电隐藏的前提下血脂为9 否则为10
when (MMkvHelper.getString(Const.DEVICE_TYPE)) {
CommonToastUtils.showToast("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
/*when (MMkvHelper.getString(Const.DEVICE_TYPE)) {
"X1", "X2" -> { "X1", "X2" -> {
goPage(7) goPage(7)
} }
@ -269,11 +279,11 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
else -> { else -> {
goPage(7) goPage(7)
} }
} }*/
} }
8 -> {//心电 /*8 -> {//心电 暂时隐藏 尿酸就改成8
// if (MMkvHelper.getInt(Const.Watch_Device_Type) == -1) { //演示模式 // if (MMkvHelper.getInt(Const.Watch_Device_Type) == -1) { //演示模式
// showToast("尊敬的用户您好,心电功能暂未开放,敬请期待哦~") // showToast("尊敬的用户您好,心电功能暂未开放,敬请期待哦~")
// } else // } else
@ -289,7 +299,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
// RouteManager.goAct(ARouterUrl.XD_HISTORY, bundle) // RouteManager.goAct(ARouterUrl.XD_HISTORY, bundle)
// } // }
} }
} }*/
} }
} }
} }
@ -338,7 +348,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
private fun setOnClickListener() { private fun setOnClickListener() {
binding.mMsgLayout.setOnClickListener(onClickListener) binding.mMsgLayout.setOnClickListener(onClickListener)
binding.mMsg.setOnClickListener(onClickListener) binding.mMsg.setOnClickListener(onClickListener)
binding.mHeader.mWearManager.setOnClickListener(onClickListener)
binding.mHeader.mCard.setOnClickListener(onClickListener) binding.mHeader.mCard.setOnClickListener(onClickListener)
binding.mHeader.mBtnBind.setOnClickListener(onClickListener) binding.mHeader.mBtnBind.setOnClickListener(onClickListener)
binding.mGriddingList.mSub.setOnClickListener(onClickListener) binding.mGriddingList.mSub.setOnClickListener(onClickListener)
@ -361,8 +370,8 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
RouteManager.goAct(ARouterUrl.WARNING_MSG) RouteManager.goAct(ARouterUrl.WARNING_MSG)
} }
//设备连接 //设备连接
R.id.mWearManager -> { R.id.mHealthRecords -> {
val btnStr = binding.mHeader.mWearManager.text /*val btnStr = binding.mHeader.mWearManager.text
if (btnStr == "佩戴管理") { if (btnStr == "佩戴管理") {
if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表 if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表
RouteManager.goAct(ARouterUrl.WEAR_MANAGER) RouteManager.goAct(ARouterUrl.WEAR_MANAGER)
@ -380,7 +389,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} else { } else {
RouteManager.goAct(ARouterUrl.DEVICE_CHOICE) RouteManager.goAct(ARouterUrl.DEVICE_CHOICE)
} }*/
} }
//评估 //评估
R.id.mCard -> { R.id.mCard -> {
@ -606,6 +615,20 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mViewModel.getMySetting() mViewModel.getMySetting()
mViewModel.getTips() mViewModel.getTips()
mViewModel.getRank(2) mViewModel.getRank(2)
if(EasyPermissions.hasPermissions(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION)) {
AmapInit.startLocation(requireContext()) {
MMkvHelper.put(Const.LONGITUDE,it.longitude)
MMkvHelper.put(Const.LATITUDE,it.latitude)
mViewModel.getWeather()
}
}else{
EasyPermissions.requestPermissions(this,"申请定位权限",
0x00022,
Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
}
} }
/** /**
@ -750,6 +773,47 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} }
/**
* 设置天气信息
*/
private fun setWeatherInfo(weather: MainBean.Weather?) {
if (null == weather) {
binding.mHeader.tvWeather.visibility = View.GONE
} else {
weather.apply {
if (weatherNo.isNullOrEmpty()) {
binding.mHeader.tvWeather.visibility = View.GONE
return
}
var icon = when (weatherNo) {
"32" -> {//晴天
"晴天"
}
"44" -> {//多云
"多云"
}
"20" -> {//阴天
"阴天"
}
"12" -> {//雨天
"雨天"
}
"45" -> {//雷阵雨
"雷阵雨"
}
"16" -> {//雪
""
}
else -> {
"晴天"
}
}
binding.mHeader.tvWeather.text = "${icon} ${weatherInfo}"
}
}
}
/** /**
* 获取所有信息 * 获取所有信息
*/ */
@ -814,6 +878,15 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} }
mViewModel.weatherLiveDate.observe(this){
if(it.data == null){
binding.mHeader.tvWeather.visibility = View.GONE
}else{
binding.mHeader.tvWeather.text = "${it.data.text} ${it.data.temp}"
}
}
//获取首页所有信息返回 //获取首页所有信息返回
mViewModel.allData.observe(this) { mViewModel.allData.observe(this) {
it.data.let { bean -> it.data.let { bean ->
@ -824,60 +897,36 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
(requireActivity() as MainActivity).isDemonstrate = isDemonstrate (requireActivity() as MainActivity).isDemonstrate = isDemonstrate
if (isDemonstrate) { if (isDemonstrate) {
binding.mHeader.mWearInfo.visibility = View.INVISIBLE binding.mHeader.mWearInfo.visibility = View.INVISIBLE
binding.mHeader.mWatchType.visibility = View.INVISIBLE
} else { } else {
binding.mHeader.mWatchType.visibility = View.GONE
binding.mHeader.mWearInfo.visibility = View.VISIBLE binding.mHeader.mWearInfo.visibility = View.VISIBLE
} }
/*if (mFamilyAdapter.position != -1) {
if (mFamilyAdapter.getItem(mFamilyAdapter.position).userJointId != bean.user.id.toInt()) {
if (mFamilyAdapter.position == 0 && bean.user.id.toString() == CommonUtils.getMyUserId()) {//如果是自己加载用户头像并保存用户信息
} else {
LogUtils.e("当前用户与请求用户信息不一致,不作处理!")
return@observe
}
}
}*/
if (showIdInfo.isNotEmpty()) { //自己 if (showIdInfo.isNotEmpty()) { //自己
//// binding.mChildView.mGuide2.visibility = View.VISIBLE
// binding.mChildView.mInter.visibility = View.VISIBLE
// binding.mChildView.lleach.visibility = View.VISIBLE
// } else {
//// binding.mChildView.mGuide2.visibility = View.GONE//隐藏健康管家
// binding.mChildView.mInter.visibility = View.GONE//隐藏健康互动标题
// binding.mChildView.lleach.visibility = View.GONE//隐藏健康打卡,榜单,我的家人功能
Const.otherLiveData.value = bean Const.otherLiveData.value = bean
} }
// setWeatherInfo(bean.weather)
Const.battery = bean.power Const.battery = bean.power
Const.watchType = bean.watchType Const.watchType = bean.watchType
MMkvHelper.put(Const.Watch_Device_Type, bean.watchType) MMkvHelper.put(Const.Watch_Device_Type, bean.watchType)
binding.mHeader.tvNowTime.text = bean.nowDay
binding.mHeader.tvLanuDate.text = bean.chinaDay
// setWeatherInfo(bean.weather)
binding.mHeader.mBMI.text = "BMI ${bean.bmiInfo.bmi}"
binding.mHeader.mBMIStatus.text = "${bean.bmiInfo.levelName}"
binding.mHeader.tvWarningNum.text ="预警次数:${if (bean.warningCount == 0) "--" else bean.warningCount}"
binding.mHeader.tvMonitorNum.text ="监测次数:${if (bean.healthCount == 0) "--" else bean.healthCount}"
/*if (bean.watchType == -1) { //没有绑定设备
if (bean.watchType == -1) { //没有绑定设备
binding.mHeader.mBindState.apply {
text = "未绑定"
val drawable = getDrawable(R.mipmap.ic_unbind)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
setCompoundDrawables(drawable, null, null, null)
visibility = View.VISIBLE
}
binding.mHeader.mWearManager.text = "绑定手表"
binding.mHeader.mBindState.visibility = View.GONE
binding.mHeader.mConnectStatu.visibility = View.GONE
binding.mHeader.mWatchType.visibility = View.GONE
} else if (Const.Companion.WatchDevice.LightA3.ordinal == bean.watchType) {//如果是4G设备设置连接状态与电量信息 } else if (Const.Companion.WatchDevice.LightA3.ordinal == bean.watchType) {//如果是4G设备设置连接状态与电量信息
setDeviceInfo(
DeviceInfoBean( } else {*/
true,
YCBBlueConnectHelper.BLEConnectState.Connected,
if (Const.battery.isEmpty()) "" else "电量${Const.battery}%"
)
)
} else {
if (showIdInfo.isEmpty()) { //自己 if (showIdInfo.isEmpty()) { //自己
val localBlueMac = MMkvHelper.getString(Const.Blue_Tooth) val localBlueMac = MMkvHelper.getString(Const.Blue_Tooth)
if (YCBBlueConnectHelper.getBleNowStatus() == YCBBlueConnectHelper.BLEConnectState.DisConnect) {//如果本地有蓝牙信息且属于未连接状态,则直接连接 if (YCBBlueConnectHelper.getBleNowStatus() == YCBBlueConnectHelper.BLEConnectState.DisConnect) {//如果本地有蓝牙信息且属于未连接状态,则直接连接
@ -892,9 +941,9 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
getConnectStatus() getConnectStatus()
} }
} else { } else {
setDeviceInfo(null)
}
} }
// }
get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态 get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态
@ -948,6 +997,8 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
} }
//24小时健康报告返回信息 //24小时健康报告返回信息
mViewModel.infoLive.observe(this) { mViewModel.infoLive.observe(this) {
if (null == it.data) { if (null == it.data) {
@ -1037,7 +1088,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
// binding.mContent.visibility = View.VISIBLE // binding.mContent.visibility = View.VISIBLE
binding.mHeader.mLayoutResult.visibility = View.GONE binding.mHeader.mLayoutResult.visibility = View.GONE
binding.mHeader.mBtnBind.visibility = View.VISIBLE binding.mHeader.mBtnBind.visibility = View.VISIBLE
setDeviceInfo(DeviceInfoBean(false))
// if (!(activity as MainActivity).isDialogShow) { // if (!(activity as MainActivity).isDialogShow) {
// dialogBind.show() // dialogBind.show()
// } // }
@ -1068,13 +1118,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
} }
if (Const.Companion.WatchDevice.LightA3.ordinal == Const.watchType) {//如果是4G设备设置连接状态与电量信息 if (Const.Companion.WatchDevice.LightA3.ordinal == Const.watchType) {//如果是4G设备设置连接状态与电量信息
setDeviceInfo(
DeviceInfoBean(
true,
YCBBlueConnectHelper.BLEConnectState.Connected,
if (Const.battery.isEmpty()) "" else "电量${Const.battery}%"
)
)
get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态 get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态
} }
@ -1130,13 +1174,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mainScope.launch { mainScope.launch {
LogUtils.d("getDeviceInfo isOk:$isok;;; value=$value") LogUtils.d("getDeviceInfo isOk:$isok;;; value=$value")
if (isok) {//获取到设备信息,设备准备就绪上传手表数据 if (isok) {//获取到设备信息,设备准备就绪上传手表数据
setDeviceInfo(
DeviceInfoBean(
true,
YCBBlueConnectHelper.BLEConnectState.Connected,
value
)
)
} }
} }
} }
@ -1374,15 +1411,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mainScope.launch(Dispatchers.Main) { mainScope.launch(Dispatchers.Main) {
when (connectState) { when (connectState) {
YCBBlueConnectHelper.BLEConnectState.Connecting -> { YCBBlueConnectHelper.BLEConnectState.Connecting -> {
setDeviceInfo(
DeviceInfoBean(
true,
YCBBlueConnectHelper.BLEConnectState.Connecting
)
)
// binding.mContent.visibility = View.GONE
// binding.mEle.visibility = View.VISIBLE
// binding.mEle.text = getString(R.string.blue_tooth_connecting)
} }
YCBBlueConnectHelper.BLEConnectState.Connected -> { YCBBlueConnectHelper.BLEConnectState.Connected -> {
@ -1491,16 +1520,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mainScope.launch { mainScope.launch {
LogUtils.d("getDeviceInfo isOk:$isok;;; value=$value") LogUtils.d("getDeviceInfo isOk:$isok;;; value=$value")
if (isok) {//获取到设备信息,设备准备就绪上传手表数据 if (isok) {//获取到设备信息,设备准备就绪上传手表数据
// binding.mCom.visibility = View.GONE
// binding.mEle.visibility = View.VISIBLE
// binding.mEle.text = value
setDeviceInfo(
DeviceInfoBean(
true,
YCBBlueConnectHelper.BLEConnectState.Connected,
value
)
)
uploadWhatchData() uploadWhatchData()
@ -1562,9 +1581,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
// } // }
private fun initBlueToothStatu() { private fun initBlueToothStatu() {
setDeviceInfo(DeviceInfoBean(blueTooth(), YCBBlueConnectHelper.BLEConnectState.DisConnect))
// binding.mContent.visibility = View.VISIBLE
// binding.mEle.visibility = View.GONE
} }
private fun requestGPSPermission() { private fun requestGPSPermission() {
@ -1644,134 +1661,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mViewModel.get24HourReportInfo(userId, isShowLoading) mViewModel.get24HourReportInfo(userId, isShowLoading)
} }
private fun updateWarningStatus() {
/*val position = mFamilyAdapter.position
if (position == 0 || position == -1) {
if (notifyStatus == 0) {
//未读
binding.mHeader.llWarning.visibility = View.VISIBLE
} else {
//已读
binding.mHeader.llWarning.visibility = View.GONE
}
} else {
binding.mHeader.llWarning.visibility = View.GONE
}*/
}
/**
* 设置设备信息
*/
private fun setDeviceInfo(deviceInfo: DeviceInfoBean?) {
if (null != deviceInfo) {
if (blueTooth()) {
binding.mHeader.mWatchType.text = getString(R.string.blue_tooth)
val drawable = getDrawable(R.mipmap.ic_watch_bluetooth)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
binding.mHeader.mWatchType.setCompoundDrawables(drawable, null, null, null)
} else {
binding.mHeader.mWatchType.text = getString(R.string.lite_4g)
val drawable = getDrawable(R.mipmap.ic_watch_4g)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
binding.mHeader.mWatchType.setCompoundDrawables(drawable, null, null, null)
}
binding.mHeader.mBindState.visibility = View.VISIBLE
if (deviceInfo.bindState) {//已绑定
binding.mHeader.mBindState.apply {
text = "已绑定"
background = null
val drawable = getDrawable(R.mipmap.ic_bangding)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
setCompoundDrawables(drawable, null, null, null)
}
binding.mHeader.mWearManager.text = "佩戴管理"
when (deviceInfo.connectState) {
YCBBlueConnectHelper.BLEConnectState.Connected -> {//已连接
binding.mHeader.mConnectStatu.apply {
setBackgroundResource(R.drawable.shape_bind_bg_new_2)
text = deviceInfo.battery
setTextColor(resources.getColor(R.color.col_27B8, null))
var drawable: Drawable = getDrawable(R.mipmap.ic_battery)
if (!deviceInfo.battery.isNullOrEmpty()) {
val str =
deviceInfo.battery.substring(2, deviceInfo.battery.length - 1)
val pattern: Pattern = Pattern.compile("[0-9]*")
val isNum: Matcher = pattern.matcher(str)
if (isNum.matches()) {
val battery = str.toInt()
drawable = if (battery > 20) {
getDrawable(R.mipmap.ic_battery)
// } else if (battery > 70) {
// getDrawable(R.mipmap.ic_battery_90)
// } else if (battery > 50) {
// getDrawable(R.mipmap.ic_battery_70)
// } else if (battery > 30) {
// getDrawable(R.mipmap.ic_battery_50)
// } else if (battery > 10) {
// getDrawable(R.mipmap.ic_battery_30)
} else {
setTextColor(resources.getColor(R.color.col_2628, null))
text =
context.resources.getString(R.string.health_low_battery)
setBackgroundResource(R.drawable.shape_bind_bg_new_1)
getDrawable(R.mipmap.ic_diancbuz)
}
}
}
drawable.setBounds(
0,
0,
drawable.minimumWidth,
drawable.minimumHeight
)
setCompoundDrawables(drawable, null, null, null)
}
}
YCBBlueConnectHelper.BLEConnectState.Connecting -> {//连接中
binding.mHeader.mConnectStatu.apply {
text = "连接中..."
setCompoundDrawables(null, null, null, null)
}
}
YCBBlueConnectHelper.BLEConnectState.DisConnect -> {//未连接
binding.mHeader.mConnectStatu.apply {
text = "未连接"
val drawable = getDrawable(R.mipmap.ic_not_connect)
drawable.setBounds(
0,
0,
drawable.minimumWidth,
drawable.minimumHeight
)
setCompoundDrawables(drawable, null, null, null)
}
}
}
binding.mHeader.mConnectStatu.visibility = View.GONE
} else {
binding.mHeader.mBindState.apply {
text = "未绑定"
val drawable = getDrawable(R.mipmap.ic_unbind)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
setCompoundDrawables(drawable, null, null, null)
}
binding.mHeader.mWearManager.text = "绑定手表"
binding.mHeader.mConnectStatu.visibility = View.GONE
}
} else {
binding.mHeader.mWatchType.text = getString(R.string.blue_tooth)
val drawable = getDrawable(R.mipmap.ic_watch_bluetooth)
drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
binding.mHeader.mWatchType.setCompoundDrawables(drawable, null, null, null)
binding.mHeader.mBindState.visibility = View.GONE
binding.mHeader.mConnectStatu.visibility = View.GONE
}
}
private fun blueTooth(): Boolean { private fun blueTooth(): Boolean {
return CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type)) return CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))
@ -1824,7 +1713,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mViewModel.getAllInfo(event.showUserId, false) mViewModel.getAllInfo(event.showUserId, false)
getXtInfo(event.showUserId) getXtInfo(event.showUserId)
get24HourReportInfo(event.showUserId) get24HourReportInfo(event.showUserId)
updateWarningStatus()
} }
override fun onDestroy() { override fun onDestroy() {
@ -1841,4 +1729,16 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
fun loginOutChange(event: LoginOutEvent){ fun loginOutChange(event: LoginOutEvent){
} }
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>) {
AmapInit.startLocation(requireContext()) {
MMkvHelper.put(Const.LONGITUDE,it.longitude)
MMkvHelper.put(Const.LATITUDE,it.latitude)
mViewModel.getWeather()
}
}
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
}
} }

@ -22,6 +22,7 @@ import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.LoginOutEvent import com.xty.common.event.LoginOutEvent
import com.xty.common.event.MyInfoEvent import com.xty.common.event.MyInfoEvent
import com.xty.common.onEventObject import com.xty.common.onEventObject
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils import com.xty.common.util.CommonUtils
import com.xty.network.model.BannerBean import com.xty.network.model.BannerBean
import com.xty.network.model.FamilyBean import com.xty.network.model.FamilyBean
@ -196,7 +197,9 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
binding.mCom.rvLayout.layoutManager= LinearLayoutManager(requireContext(),LinearLayoutManager.HORIZONTAL,false) binding.mCom.rvLayout.layoutManager= LinearLayoutManager(requireContext(),LinearLayoutManager.HORIZONTAL,false)
binding.mCom.rvLayout.adapter = layoutTopAdapter binding.mCom.rvLayout.adapter = layoutTopAdapter
layoutTopAdapter.setOnItemClickListener { adapter, view, position -> layoutTopAdapter.setOnItemClickListener { adapter, view, position ->
var contentData = adapter.getItem(position) as HomeLayoutBean.HomeChildBean
CommonToastUtils.showToast("敬请期待")
/*var contentData = adapter.getItem(position) as HomeLayoutBean.HomeChildBean
when(contentData.jumpType){ when(contentData.jumpType){
1 ->{ 1 ->{
contentData.jumpUrl?.let { contentData.jumpUrl?.let {
@ -254,7 +257,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
} }
} }
} }*/
} }
binding.mChildView.homeContentRv.layoutManager = GridLayoutManager(requireContext(),3) binding.mChildView.homeContentRv.layoutManager = GridLayoutManager(requireContext(),3)
@ -490,50 +493,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
} }
} }
} }
/**
* 设置天气信息*/
private fun setWeatherInfo(weather: MainBean.Weather?) {
// if (null == weather) {
// binding.mCom.tvLocationWeather.visibility = View.GONE
// } else {
// weather.apply {
// if (city.isNullOrEmpty() || weatherNo.isNullOrEmpty()) {
// binding.mCom.tvLocationWeather.visibility = View.GONE
// return
// }
// binding.mCom.tvLocationWeather.text = "${city} ${weatherInfo}"
// var icon = when (weatherNo) {
// "32" -> {//晴天
// R.mipmap.weather_sunny
// }
// "44" -> {//多云
// R.mipmap.weather_cloudy
// }
// "20" -> {//阴天
// R.mipmap.weather_yin
// }
// "12" -> {//雨天
// R.mipmap.weather_rain
// }
// "45" -> {//雷阵雨
// R.mipmap.weather_thunder_shower
// }
// "16" -> {//雪
// R.mipmap.weather_snow
// }
// else -> {
// R.mipmap.weather_sunny
// }
// }
// val drawable = getDrawable(icon)
// drawable!!.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
// binding.mCom.tvLocationWeather.setCompoundDrawables(null, null, drawable, null)
// binding.mCom.tvLocationWeather.visibility = View.VISIBLE
// }
// }
}

@ -85,24 +85,94 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else{ }else{
bundle.clear() CommonToastUtils.showToast("敬请期待")
bundle.putSerializable("user", user)
RouteManager.goAct(ARouterUrl.MY_INTEGRAL, bundle)
} }
} }
binding.llAboutUs.setOnClickListener {
RouteManager.goAct(ARouterUrl.ABOUT) binding.mllCoupon.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.mllWallet.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
/*binding.llOrder.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}*/
binding.mllMember.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.mAppreciation.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
} }
binding.llHealthRecord.setOnClickListener { binding.llHealthRecord.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else { }else {
bundle.putString("id", user?.id) CommonToastUtils.showToast("敬请期待")
RouteManager.goAct(ARouterUrl.HEALTH_RECORD, bundle) }
}
binding.llHealthMonitor.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
} }
binding.llHealthDaily.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llStartBs.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llDailyPoster.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llAboutUs.setOnClickListener {
RouteManager.goAct(ARouterUrl.ABOUT)
} }
binding.llDataComparsion.setOnClickListener { binding.llDataComparsion.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
@ -127,6 +197,30 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
} }
} }
binding.llEnterpriseData.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llShippingAddress.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llOperationGuide.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
CommonToastUtils.showToast("敬请期待")
}
}
binding.llOrder.setOnClickListener { binding.llOrder.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
@ -141,7 +235,7 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else { }else {
RouteManager.goAct(ARouterUrl.FAMILY) RouteManager.goAct(ARouterUrl.FAMILY_HEALTH_ACT)
} }
} }
binding.llWearableDevice.setOnClickListener { binding.llWearableDevice.setOnClickListener {

@ -0,0 +1,33 @@
package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.FoodRecoginzeInfo
import com.xty.network.model.ImageUploadBean
import com.xty.network.model.RespBody
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
import okhttp3.MultipartBody
import org.json.JSONObject
import java.io.File
class DietManagementVm : BaseVm() {
val foodRecoginzeInfoLiveData by lazy { MutableLiveData<RespBody<MutableList<FoodRecoginzeInfo>>>() }
fun submit(type:String,path: String){
startHttp {
withContext(Dispatchers.IO) {
var f = File(path)
var fileRb =
MultipartBody.Part.createFormData("file", f.name, retrofits.getMultiPartFileRb(f))
var body = apiInterface().foodRecognize(fileRb,retrofits.getRequestBody(type))
body.getCodeStatus(foodRecoginzeInfoLiveData,nowData)
}
}
}
}

@ -25,6 +25,7 @@ import com.xty.network.model.ReportBean
import com.xty.network.model.RespBody import com.xty.network.model.RespBody
import com.xty.network.model.SettingBean import com.xty.network.model.SettingBean
import com.xty.network.model.TipsBean import com.xty.network.model.TipsBean
import com.xty.network.model.WeatherBean
import com.xty.network.model.XTangInfoBean import com.xty.network.model.XTangInfoBean
import com.zj365.dc.R import com.zj365.dc.R
import org.json.JSONArray import org.json.JSONArray
@ -50,6 +51,8 @@ class DynamicManagementVm : BaseVm() {
val mqtt by lazy { MutableLiveData<RespBody<MqTTBean>>() } val mqtt by lazy { MutableLiveData<RespBody<MqTTBean>>() }
val uploadMultiple by lazy { MutableLiveData<RespBody<NotAccepted>>() } val uploadMultiple by lazy { MutableLiveData<RespBody<NotAccepted>>() }
val weatherLiveDate by lazy { MutableLiveData<RespBody<WeatherBean>>() }
/** /**
* 获取所有信息 * 获取所有信息
*/ */
@ -523,7 +526,7 @@ class DynamicManagementVm : BaseVm() {
) )
) )
//心电 /*//心电
val statusXD = 0 val statusXD = 0
val contentXD = val contentXD =
if (TextUtils.isEmpty(heartData.hrData) || heartData.hrData == "0") { if (TextUtils.isEmpty(heartData.hrData) || heartData.hrData == "0") {
@ -542,7 +545,7 @@ class DynamicManagementVm : BaseVm() {
R.mipmap.ic_ecg, R.mipmap.ic_ecg,
8 8
) )
) )*/
//尿酸 //尿酸
// val statusNS = if (uricAcidData.value == "0") { // val statusNS = if (uricAcidData.value == "0") {
@ -625,7 +628,18 @@ class DynamicManagementVm : BaseVm() {
) )
//血脂 //血脂
var statusXZ = 0 healthMonitoringList.add(
HealthMonitoringListBean(
"血脂",
0,
"",
"敬请期待",
R.mipmap.bg_fat,
R.mipmap.ic_fat,
10
)
)
/*var statusXZ = 0
var contentXZ = "" var contentXZ = ""
var mTimeXZ = "" var mTimeXZ = ""
when (bloodFatData.status) { when (bloodFatData.status) {
@ -687,7 +701,7 @@ class DynamicManagementVm : BaseVm() {
R.mipmap.ic_fat, R.mipmap.ic_fat,
10 10
) )
) )*/
} }
"A3" -> { "A3" -> {
@ -1473,4 +1487,14 @@ class DynamicManagementVm : BaseVm() {
SimpleDateFormat("yyyy-MM-dd HH:mm") SimpleDateFormat("yyyy-MM-dd HH:mm")
) )
} }
fun getWeather(){
startHttp {
val json = JSONObject()
json.put("longitude", MMkvHelper.getDouble(Const.LONGITUDE))
json.put("latitude", MMkvHelper.getDouble(Const.LATITUDE))
val body = apiInterface().getWeather(retrofits.getRequestBody(json.toString()))
body.getCodeStatus(weatherLiveDate, nowData)
}
}
} }

@ -9,6 +9,7 @@ import android.text.TextPaint
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.view.View import android.view.View
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.amap.api.location.AMapLocationClient
import com.hjq.toast.ToastUtils import com.hjq.toast.ToastUtils
import com.xty.base.dialog.BaseDialog import com.xty.base.dialog.BaseDialog
import com.xty.common.Const import com.xty.common.Const
@ -50,7 +51,7 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
ds.isUnderlineText = false ds.isUnderlineText = false
} }
}, 46, 52, Spanned.SPAN_INCLUSIVE_INCLUSIVE) }, 49, 55, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
span.setSpan(object : ClickableSpan() { span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
val bundle = Bundle() val bundle = Bundle()
@ -66,7 +67,7 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
ds.clearShadowLayer() ds.clearShadowLayer()
} }
}, 53, 59, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) }, 56, 62, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(object : ClickableSpan() { span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
val bundle = Bundle() val bundle = Bundle()
@ -82,7 +83,7 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
ds.clearShadowLayer() ds.clearShadowLayer()
} }
}, 60, 75, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) }, 72, 78, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(object : ClickableSpan() { span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
val bundle = Bundle() val bundle = Bundle()
@ -98,8 +99,8 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
ds.isUnderlineText = false ds.isUnderlineText = false
} }
}, 85, 91, Spanned.SPAN_INCLUSIVE_INCLUSIVE) }, 79, 85, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
span.setSpan(object : ClickableSpan() { /*span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
val bundle = Bundle() val bundle = Bundle()
bundle.putString("title", "隐私政策") bundle.putString("title", "隐私政策")
@ -130,7 +131,7 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
ds.clearShadowLayer() ds.clearShadowLayer()
} }
}, 99, 114, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) }, 99, 114, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)*/
binding.mContent.text = span binding.mContent.text = span
binding.mContent.highlightColor = Color.TRANSPARENT binding.mContent.highlightColor = Color.TRANSPARENT
@ -141,6 +142,8 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
binding.mAgree.setOnClickListener { binding.mAgree.setOnClickListener {
dismiss() dismiss()
agree.invoke() agree.invoke()
AMapLocationClient.updatePrivacyShow(context,true,true);
AMapLocationClient.updatePrivacyAgree(context,true);
} }
} }
} }

@ -31,7 +31,7 @@
<!-- 用户名 --> <!-- 用户名 -->
<TextView <TextView
android:id="@+id/mUserName" android:id="@+id/mBMI"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -44,72 +44,9 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<!-- 绑定状态 -->
<TextView
android:id="@+id/mBindState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_15"
android:drawableLeft="@mipmap/ic_bangding"
android:drawablePadding="@dimen/dp_3_5"
android:gravity="center_vertical"
android:paddingTop="@dimen/dp_5"
android:text="未绑定"
android:textColor="@color/col_8D0"
android:textSize="@dimen/dp_10"
app:layout_constraintLeft_toRightOf="@+id/mUserName"
app:layout_constraintTop_toTopOf="parent" />
<!-- 手表型号 -->
<TextView
android:id="@+id/mWatchType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|left"
android:visibility="gone"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_5"
android:layout_weight="1"
android:background="@drawable/shape_bind_bg_new_2"
android:drawableLeft="@mipmap/ic_watch_bluetooth"
android:drawablePadding="@dimen/dp_2"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="蓝牙"
android:textColor="@color/col_27B8"
android:textSize="@dimen/sp_9"
app:layout_constraintLeft_toRightOf="@+id/mHeaderImage"
app:layout_constraintTop_toBottomOf="@+id/mUserName" />
<!-- 连接状态 -->
<TextView
android:id="@+id/mConnectStatu"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|left"
android:visibility="gone"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:layout_weight="1"
android:background="@drawable/shape_bind_bg_new_2"
android:drawableLeft="@mipmap/ic_not_connect"
android:drawablePadding="@dimen/dp_2"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="未连接"
android:textColor="@color/col_27B8"
android:textSize="@dimen/sp_9"
app:layout_constraintLeft_toRightOf="@+id/mWatchType"
app:layout_constraintTop_toBottomOf="@+id/mUserName"
tools:ignore="UseCompatTextViewDrawableXml" />
<TextView <TextView
android:id="@+id/mConnectStatus" android:id="@+id/mBMIStatus"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical|left" android:layout_gravity="center_vertical|left"
@ -126,13 +63,13 @@
android:textColor="@color/col_D9BD" android:textColor="@color/col_D9BD"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/mWatchType" app:layout_constraintLeft_toRightOf="@+id/mHeaderImage"
app:layout_constraintTop_toBottomOf="@+id/mUserName" app:layout_constraintTop_toBottomOf="@+id/mBMI"
tools:ignore="UseCompatTextViewDrawableXml" /> tools:ignore="UseCompatTextViewDrawableXml" />
<!-- 佩戴管理 --> <!-- 佩戴管理 -->
<TextView <TextView
android:id="@+id/mWearManager" android:id="@+id/mHealthRecords"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
@ -163,14 +100,35 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@mipmap/icon_health_time"/> android:src="@mipmap/icon_health_time"/>
<TextView
android:id="@+id/tv_nowTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:layout_marginLeft="@dimen/dp_5"
tools:text="2023-12-01"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_lanuDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:layout_marginLeft="@dimen/dp_5"
android:textStyle="bold"
android:text="农历 十月十九"/>
<TextView <TextView
android:id="@+id/tv_weather"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
android:textStyle="bold" android:textStyle="bold"
android:text="2023-12-01 农历 十月十九 晴 13℃"/> android:text="晴 13℃"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -181,6 +139,7 @@
app:layout_constraintTop_toBottomOf="@+id/ll_time" app:layout_constraintTop_toBottomOf="@+id/ll_time"
app:layout_constraintLeft_toLeftOf="parent"> app:layout_constraintLeft_toLeftOf="parent">
<TextView <TextView
android:id="@+id/tv_monitor_num"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -190,6 +149,7 @@
android:text="监测次数107次"/> android:text="监测次数107次"/>
<TextView <TextView
android:id="@+id/tv_warning_num"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"

@ -38,4 +38,5 @@
<color name="col_6F7">#F2F6F7</color> <color name="col_6F7">#F2F6F7</color>
<color name="transparent">#00000000</color> <color name="transparent">#00000000</color>
<color name="read_dot_bg">#f74c31</color> <color name="read_dot_bg">#f74c31</color>
<color name="col_6ea">#6EA8F6</color>
</resources> </resources>

@ -127,6 +127,9 @@ class Const {
const val X1_X2_Device = "x1_x2_device" const val X1_X2_Device = "x1_x2_device"
const val DEVICE_TYPE = "device_Type" const val DEVICE_TYPE = "device_Type"
const val LONGITUDE = "longitude" //经度
const val LATITUDE = "latitude" //纬度
var DeviceIdNum : String = "" var DeviceIdNum : String = ""
// const val userName = "User_Name" // const val userName = "User_Name"
// const val userBean = "UserUser" // const val userBean = "UserUser"

@ -1,6 +1,7 @@
package com.xty.common.aMapUtils package com.xty.common.aMapUtils
import android.app.Application import android.app.Application
import android.content.Context
import com.amap.api.location.AMapLocation import com.amap.api.location.AMapLocation
import com.amap.api.location.AMapLocationClient import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption import com.amap.api.location.AMapLocationClientOption
@ -48,7 +49,7 @@ object AmapInit{
} }
} }
private fun init(context: Application) { private fun init(context: Context) {
//隐私政策合规 //隐私政策合规
AMapLocationClient.updatePrivacyShow(context,true,true) AMapLocationClient.updatePrivacyShow(context,true,true)
AMapLocationClient.updatePrivacyAgree(context,true) AMapLocationClient.updatePrivacyAgree(context,true)
@ -67,7 +68,8 @@ object AmapInit{
} }
//开启监听 //开启监听
fun startLocation(context: Application, back:(listener:AMapLocation)->Unit) { fun startLocation(context: Context, back:(listener:AMapLocation)->Unit) {
funs=back funs=back
if (mLocationClient == null) { if (mLocationClient == null) {
init(context) init(context)
@ -81,10 +83,11 @@ object AmapInit{
* 停止 * 停止
*/ */
fun stopLocation(){ fun stopLocation(){
// mainScope.cancel() mainScope.cancel()
// mLocationClient?.let { mLocationClient?.let {
// it.stopLocation() it.stopLocation()
// } it.onDestroy()
}
} }

@ -55,14 +55,14 @@ class MyApp : Application() {
super.onCreate() super.onCreate()
LogUtils.d("MyApp onCreate!!!!") LogUtils.d("MyApp onCreate!!!!")
initCrash() // initCrash()
// 初始化 Toast 框架 // 初始化 Toast 框架
getInstance(this) getInstance(this)
MMkvHelper.initMmkv(this) MMkvHelper.initMmkv(this)
ToastUtils.init(this) ToastUtils.init(this)
ARouter.openDebug() ARouter.openDebug()
ARouter.init(this) ARouter.init(this)
initTouch() // initTouch()
initTimeUtils() initTimeUtils()
initWxApi() initWxApi()
initUMengSdk() initUMengSdk()
@ -70,7 +70,7 @@ class MyApp : Application() {
registerBlueToothBoardCastReceiver() registerBlueToothBoardCastReceiver()
//bugly 上报 在release版本才会上报 //bugly 上报 在release版本才会上报
// if(BuildConfig.isRelease){ // if(BuildConfig.isRelease){
CrashReport.initCrashReport(this, "bdcd791680", true) // CrashReport.initCrashReport(this, "", true)
// } // }
//删除角标 //删除角标
ShortcutBadger.applyCount(applicationContext, 0) ShortcutBadger.applyCount(applicationContext, 0)
@ -146,10 +146,10 @@ class MyApp : Application() {
fun initUMengSdk(){ fun initUMengSdk(){
//设置LOG开关默认为false //设置LOG开关默认为false
UMConfigure.setLogEnabled(!BuildConfig.isRelease) UMConfigure.setLogEnabled(!BuildConfig.isRelease)
/* //友盟预初始化 //友盟预初始化
UMConfigure.preInit(applicationContext, BuildConfig.umengKey, BuildConfig.umengChannelName) UMConfigure.preInit(applicationContext, BuildConfig.umengKey, BuildConfig.umengChannelName)
// 支持在子进程中统计自定义事件 // 支持在子进程中统计自定义事件
UMConfigure.setProcessEvent(true)*/ UMConfigure.setProcessEvent(true)
} }
/** /**
@ -246,7 +246,7 @@ class MyApp : Application() {
/** /**
* 崩溃拦截框架 * 崩溃拦截框架
*/ */
@SuppressLint("RestrictedApi") /* @SuppressLint("RestrictedApi")
private fun initCrash() { private fun initCrash() {
CrashGuard.install(this, object : ExceptionHandler() { CrashGuard.install(this, object : ExceptionHandler() {
override fun onUncaughtException(thread: Thread, throwable: Throwable) { override fun onUncaughtException(thread: Thread, throwable: Throwable) {
@ -258,7 +258,7 @@ class MyApp : Application() {
LogUtils.e("simon", "生命周期异常 thread:${thread.name} throwable:${e.message}") LogUtils.e("simon", "生命周期异常 thread:${thread.name} throwable:${e.message}")
} }
}) })
} }*/
// CaocConfig.Builder.create() // CaocConfig.Builder.create()
// .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) // .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT)

@ -122,6 +122,10 @@ class ARouterUrl {
//AI 测肤 //AI 测肤
const val AI_SKIN_MEASUREMENT_ACTIVITY = "/health/com/zj365/health/act/skin/SkinMeasurementMainAct" const val AI_SKIN_MEASUREMENT_ACTIVITY = "/health/com/zj365/health/act/skin/SkinMeasurementMainAct"
const val ADD_FAMILY_GUARDIAN_ACT = "/health/com/zj365/health/act/familyhealth/AddFamilyGuardianAct"
const val FAMILY_HEALTH_ACT = "/health/com/zj365/health/act/familyhealth/FamilyHealthAct"
//设备绑定相关 //设备绑定相关
const val XUEYAJI_BIND_LIST = "/health/com/zj365/health/act/XueyaDeviceBindListAct" const val XUEYAJI_BIND_LIST = "/health/com/zj365/health/act/XueyaDeviceBindListAct"
const val XUEYAJI_BIND = "/health/com/zj365/health/act/XueyaDeviceBindAct" const val XUEYAJI_BIND = "/health/com/zj365/health/act/XueyaDeviceBindAct"

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_7"/>
<stroke android:width="@dimen/dp_0_5"
android:color="#6EA8F6"/>
<solid android:color="#EBF3FE"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

@ -17,7 +17,7 @@ ext {
] ]
umeng = [ umeng = [
umengKey : "", umengKey : "657bf673a7208a5af1881764",
umengChannelName: "android友盟统计" umengChannelName: "android友盟统计"
] ]
@ -35,8 +35,8 @@ ext {
image_preifx = [ image_preifx = [
debug_url : "https://auprty.com/app", debug_url : "http://java01.zhongjian365.com/app/",
release_url: "https://auprty.com/app" release_url: "http://java01.zhongjian365.com/app/"
//debug_url : "http://175.6.39.20:8181/app/", //debug_url : "http://175.6.39.20:8181/app/",
//release_url: "http://175.6.39.20:8181/app/" //release_url: "http://175.6.39.20:8181/app/"

@ -116,6 +116,11 @@
android:name="com.zj365.health.act.PreventCancertAct" android:name="com.zj365.health.act.PreventCancertAct"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name="com.zj365.health.act.RankListAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity <activity
android:name="com.zj365.health.act.DuihuanmaAct" android:name="com.zj365.health.act.DuihuanmaAct"
android:launchMode="singleTop" android:launchMode="singleTop"
@ -238,6 +243,14 @@
<activity android:name=".act.skin.SkinMeasurementMainAct" <activity android:name=".act.skin.SkinMeasurementMainAct"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".act.familyhealth.FamilyHealthAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.familyhealth.AddFamilyGuardianAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>

@ -74,12 +74,6 @@ class AgreeAct : BaseVmAct<PayCancerVm>() {
bundle.clear() bundle.clear()
bundle.putString("title", "用户协议") bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1) bundle.putInt("type", Const.AGREEMENT_1)
/* RouteManager.goActRequest(
ARouterUrl.RICH_TEXT,
this@AgreeAct,
USER_AGREEMENT,
bundle
)*/
} }
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
@ -90,6 +84,8 @@ class AgreeAct : BaseVmAct<PayCancerVm>() {
}, 2, span.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE) }, 2, span.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
binding.mPrivate.text = span
binding.mSubmit.setOnClickListener { binding.mSubmit.setOnClickListener {
if (!binding.mPrivate.isSelected) { if (!binding.mPrivate.isSelected) {
CommonToastUtils.showToast(R.string.please_agree_server) CommonToastUtils.showToast(R.string.please_agree_server)
@ -97,6 +93,9 @@ class AgreeAct : BaseVmAct<PayCancerVm>() {
} }
mViewModel.uploadImagesFile(signPath) mViewModel.uploadImagesFile(signPath)
} }
binding.tvSignAgain.setOnClickListener {
dialog.show()
}
binding.mSign.setOnClickListener { binding.mSign.setOnClickListener {
dialog.show() dialog.show()
} }

@ -0,0 +1,19 @@
package com.zj365.health.act
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter
import com.zj365.health.databinding.ActHealthFamilyBinding
class HealthFamilyAct : BaseVmAct<BaseVm>() {
val binding by lazy{ ActHealthFamilyBinding.inflate(layoutInflater)}
val adapter by lazy { HealthFamilyAdapter() }
override fun liveObserver() {
}
override fun setLayout() = binding.root
}

@ -70,8 +70,8 @@ class HealthMainAct : IBaseAct() {
arrayOf( arrayOf(
R.string.info_1, R.string.info_3, R.string.info_7, R.string.info_1, R.string.info_3, R.string.info_7,
R.string.info_4, R.string.info_6, R.string.info_2, R.string.info_4, R.string.info_6, R.string.info_2,
R.string.info_8, R.string.info_11, R.string.info_5, R.string.info_8, R.string.info_11/*, R.string.info_5,
R.string.info_10 R.string.info_10*/
) )
} }
@ -79,7 +79,7 @@ class HealthMainAct : IBaseAct() {
arrayOf( arrayOf(
R.string.info_1, R.string.info_3, R.string.info_7, R.string.info_1, R.string.info_3, R.string.info_7,
R.string.info_4, R.string.info_6, R.string.info_2, R.string.info_4, R.string.info_6, R.string.info_2,
R.string.info_8, R.string.info_11, R.string.info_10 R.string.info_8, R.string.info_11/*, R.string.info_10*/
) )
} }
@ -87,7 +87,7 @@ class HealthMainAct : IBaseAct() {
arrayOf( arrayOf(
R.string.info_1, R.string.info_3, R.string.info_7, R.string.info_1, R.string.info_3, R.string.info_7,
R.string.info_6, R.string.info_2, R.string.info_8, R.string.info_6, R.string.info_2, R.string.info_8,
R.string.info_11, R.string.info_10 R.string.info_11/*, R.string.info_10*/
) )
} }
} }
@ -171,8 +171,8 @@ class HealthMainAct : IBaseAct() {
listFragment.add(setArgumentFrag(XueyaFrag(), id)) listFragment.add(setArgumentFrag(XueyaFrag(), id))
listFragment.add(setArgumentFrag(XueTangFrag(), id)) listFragment.add(setArgumentFrag(XueTangFrag(), id))
listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex)) listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex))
listFragment.add(setArgumentFrag(XdFrag(), id)) // listFragment.add(setArgumentFrag(XdFrag(), id))
listFragment.add(setArgumentFrag(BloodFatFrag(), id)) // listFragment.add(setArgumentFrag(BloodFatFrag(), id))
} }
"A3" -> { "A3" -> {
@ -184,7 +184,7 @@ class HealthMainAct : IBaseAct() {
listFragment.add(setArgumentFrag(XueyaFrag(), id)) listFragment.add(setArgumentFrag(XueyaFrag(), id))
listFragment.add(setArgumentFrag(XueTangFrag(), id)) listFragment.add(setArgumentFrag(XueTangFrag(), id))
listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex)) listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex))
listFragment.add(setArgumentFrag(BloodFatFrag(), id)) // listFragment.add(setArgumentFrag(BloodFatFrag(), id))
} }
else -> { else -> {
@ -195,7 +195,7 @@ class HealthMainAct : IBaseAct() {
listFragment.add(setArgumentFrag(XueyaFrag(), id)) listFragment.add(setArgumentFrag(XueyaFrag(), id))
listFragment.add(setArgumentFrag(XueTangFrag(), id)) listFragment.add(setArgumentFrag(XueTangFrag(), id))
listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex)) listFragment.add(setArgumentFrag(UricAcidFrag(), id, sex))
listFragment.add(setArgumentFrag(BloodFatFrag(), id)) // listFragment.add(setArgumentFrag(BloodFatFrag(), id))
} }
} }

@ -898,7 +898,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
) )
) )
if(bsseInfo.bloodFat == null){ /*if(bsseInfo.bloodFat == null){
listInfo.add( listInfo.add(
ReportBean.HrInfo( ReportBean.HrInfo(
"血脂", "血脂",
@ -923,7 +923,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
R.mipmap.ic_uric_acid_small R.mipmap.ic_uric_acid_small
) )
) )
} }*/
if (bsseInfo.uricAcid == null) { //如果服务端没有返回数据,也就是演示模式,我们自己新增一些假数据用于展示 if (bsseInfo.uricAcid == null) { //如果服务端没有返回数据,也就是演示模式,我们自己新增一些假数据用于展示
listInfo.add( listInfo.add(
@ -1158,7 +1158,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
} }
list.add(uricAcid) list.add(uricAcid)
val bloodFat = if (it.data.bloodFat == null) { //服务端没有返回数据 /* val bloodFat = if (it.data.bloodFat == null) { //服务端没有返回数据
com.xty.common.model.ReportBean().apply { com.xty.common.model.ReportBean().apply {
title = "血脂" title = "血脂"
count = 1 count = 1
@ -1195,7 +1195,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
isShow = true isShow = true
} }
} }
list.add(bloodFat) list.add(bloodFat)*/
val yundong = com.xty.common.model.ReportBean().apply { val yundong = com.xty.common.model.ReportBean().apply {
title = "运动" title = "运动"
@ -1662,13 +1662,13 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
"平均睡眠:${minutesToHours(it.data.signData.sleep.avgTime)}" "平均睡眠:${minutesToHours(it.data.signData.sleep.avgTime)}"
binding.analysisTv7.text = "平均血压:" + it.data.signData.dbp.avg + "mmHg" binding.analysisTv7.text = "平均血压:" + it.data.signData.dbp.avg + "mmHg"
if(!TextUtils.isEmpty(it.data.signData.bloodFat.tgAvg)){ /*if(!TextUtils.isEmpty(it.data.signData.bloodFat.tgAvg)){
binding.analysisTv9.text = "平均血脂:" + it.data.signData.bloodFat.tgAvg + "mmol" binding.analysisTv9.text = "平均血脂:" + it.data.signData.bloodFat.tgAvg + "mmol"
}else{ }else{
binding.analysisTv9.text = "平均血脂0mmol" binding.analysisTv9.text = "平均血脂0mmol"
} }*/
binding.state.apply { binding.state.apply {
val statusInt = it.data.healthy.result val statusInt = it.data.healthy.result
val star = if (it.data.star.isEmpty()) 0 else Integer.valueOf(it.data.star) val star = if (it.data.star.isEmpty()) 0 else Integer.valueOf(it.data.star)

@ -1334,7 +1334,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
) )
} }
if(bsseInfo.bloodFat == null){ /*if(bsseInfo.bloodFat == null){
listInfo.add( listInfo.add(
com.xty.network.model.ReportBean.HrInfo( com.xty.network.model.ReportBean.HrInfo(
"血脂", "血脂",
@ -1359,7 +1359,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
R.mipmap.ic_uric_acid_small R.mipmap.ic_uric_acid_small
) )
) )
} }*/
infoAdapter.setNewInstance(listInfo) infoAdapter.setNewInstance(listInfo)
@ -1566,7 +1566,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
} }
list.add(uricAcid) list.add(uricAcid)
val bloodFat = if (it.data.bloodFat == null) { //服务端没有返回数据 /*val bloodFat = if (it.data.bloodFat == null) { //服务端没有返回数据
ReportBean().apply { ReportBean().apply {
title = "血脂" title = "血脂"
count = 1 count = 1
@ -1603,7 +1603,7 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
isShow = true isShow = true
} }
} }
list.add(bloodFat) list.add(bloodFat)*/
val yundong = ReportBean().apply { val yundong = ReportBean().apply {
title = "运动" title = "运动"
@ -1953,13 +1953,13 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
binding.analysisTv6.text = "平均睡眠: $sleep" binding.analysisTv6.text = "平均睡眠: $sleep"
binding.analysisTv7.text = "平均血压: " + it.data.analyse.dbp binding.analysisTv7.text = "平均血压: " + it.data.analyse.dbp
if(!TextUtils.isEmpty(it.data.signData.bloodFat.tgAvg)){ /* if(!TextUtils.isEmpty(it.data.signData.bloodFat.tgAvg)){
binding.analysisTv9.text = "平均血脂:" + it.data.signData.bloodFat.tgAvg + "mmol" binding.analysisTv9.text = "平均血脂:" + it.data.signData.bloodFat.tgAvg + "mmol"
}else{ }else{
binding.analysisTv9.text = "平均血脂0mmol" binding.analysisTv9.text = "平均血脂0mmol"
} }*/
binding.state.apply { binding.state.apply {
val statusInt = it.data.analyse.status.toInt() val statusInt = it.data.analyse.status.toInt()
val star = if (it.data.star.isEmpty()) 0 else Integer.valueOf(it.data.star) val star = if (it.data.star.isEmpty()) 0 else Integer.valueOf(it.data.star)

@ -0,0 +1,69 @@
package com.zj365.health.act.familyhealth
import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.util.CommonToastUtils
import com.zj365.health.databinding.ActAddFamilyGuardianBinding
import com.zj365.health.vm.AddFamilyGuardianVm
@Route(path = ARouterUrl.ADD_FAMILY_GUARDIAN_ACT)
class AddFamilyGuardianAct : BaseVmAct<AddFamilyGuardianVm>() {
val binding by lazy { ActAddFamilyGuardianBinding.inflate(layoutInflater) }
var isFrist = false
var familyRelation:String? = null
var familyPhone:String? = null
var guardian:String = "0"
override fun liveObserver() {
mViewModel.submitLiveData.observe(this){
}
}
override fun setLayout() = binding.root
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "添加监护人"
binding.title.mIvBack.setOnClickListener {
finish()
}
binding.tvBind.setOnClickListener {
familyRelation = binding.etName.text.toString()
familyPhone = binding.etPhone.text.toString()
if(TextUtils.isEmpty(familyRelation)){
CommonToastUtils.showToast("请填写监护关系")
return@setOnClickListener
}else if (TextUtils.isEmpty(familyPhone)){
CommonToastUtils.showToast("请填写手机号码")
return@setOnClickListener
}
if(isFrist){
guardian = "1"
}else{
guardian = "0"
}
mViewModel.addFamily(familyRelation!!,familyPhone!!,guardian)
}
binding.cbFrist.setOnCheckedChangeListener { compoundButton, b ->
isFrist = b
}
}
override fun initData() {
super.initData()
}
}

@ -0,0 +1,31 @@
package com.zj365.health.act.familyhealth
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter
import com.zj365.health.databinding.ActHealthFamilyBinding
@Route(path = ARouterUrl.FAMILY_HEALTH_ACT)
class FamilyHealthAct : BaseVmAct<BaseVm>() {
val binding by lazy { ActHealthFamilyBinding.inflate(layoutInflater) }
val adapter by lazy { HealthFamilyAdapter() }
override fun liveObserver() {
}
override fun setLayout() = binding.root
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "家人健康"
binding.title.mIvBack.setOnClickListener {
finish()
}
}
override fun initData() {
super.initData()
}
}

@ -0,0 +1,12 @@
package com.zj365.health.adapter.familyhealth
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R
class HealthFamilyAdapter: BaseAdapter<Any>(R.layout.item_health_family) {
override fun convert(holder: BaseViewHolder, item: Any) {
}
}

@ -0,0 +1,11 @@
package com.zj365.health.adapter.familyhealth
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R
class HealthFamilyTargetAdapter : BaseAdapter<String>(R.layout.item_health_family_target) {
override fun convert(holder: BaseViewHolder, item: String) {
TODO("Not yet implemented")
}
}

@ -0,0 +1,29 @@
package com.zj365.health.adapter.familyhealth
import android.view.View
import android.view.ViewGroup
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.setImageUser
import com.zj365.health.R
import de.hdodenhof.circleimageview.CircleImageView
class HealthFamilyUserAvatorAdapter : BaseAdapter<String>(R.layout.item_health_family_user_avator) {
override fun convert(holder: BaseViewHolder, item: String) {
val position = holder.layoutPosition
if (position == 0){
setMargins(holder.itemView,0,0,0,0)
}
holder.getView<CircleImageView>(R.id.img_user_avator).setImageUser(context,item)
}
fun setMargins(v: View, l: Int, t: Int, r: Int, b: Int) {
if (v.layoutParams is ViewGroup.MarginLayoutParams) {
val p = v.layoutParams as ViewGroup.MarginLayoutParams
p.setMargins(l, t, r, b)
v.requestLayout()
}
}
}

@ -0,0 +1,24 @@
package com.zj365.health.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.RespBody
import org.json.JSONObject
class AddFamilyGuardianVm : BaseVm() {
val submitLiveData by lazy { MutableLiveData<RespBody<Any>>() }
fun addFamily(relation:String,phone:String,guardian:String){
startHttp (true){
val json = JSONObject()
json.put("relation",relation)
json.put("phone",phone)
json.put("guardian",guardian)
val body = apiInterface().addFamilyGuardian(retrofits.getRequestBody(json.toString()))
body.getCodeStatus(submitLiveData,nowData)
}
}
}

@ -0,0 +1,19 @@
package com.zj365.health.weight
import android.content.Context
import android.view.View
import com.xty.base.dialog.BaseDialog
import com.zj365.health.databinding.DialogAiIcingBinding
import com.zj365.health.databinding.DialogCancerBinding
class AIIcingPaySuccessDialog(context: Context) : BaseDialog(context) {
val binding by lazy { DialogAiIcingBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
override fun initView() {
super.initView()
binding.tvConfirm.setOnClickListener {
dismiss()
}
}
}

@ -0,0 +1,49 @@
package com.zj365.health.weight
import android.content.Context
import android.view.View
import androidx.core.content.ContextCompat
import com.xty.base.dialog.BaseDialog
import com.xty.common.SizeUtil
import com.zj365.health.R
import com.zj365.health.databinding.DialogTipToastBinding
class DialogTipNew(
context: Context,
var title: String,
var confirmText: String? = "确定",
var cancelText:String? = "取消",
var isSingleBtn:Boolean = false,
var confirm: () -> Unit,
var cancel: () -> Unit
) : BaseDialog(context) {
val binding by lazy { DialogTipToastBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
override fun initView() {
super.initView()
setDialogPadding(SizeUtil.dp2px(context, 40f), 0, SizeUtil.dp2px(context, 40f), 0)
binding.mTitle.text = title
if (isSingleBtn) {
binding.clTwoBtnLayout.visibility = View.GONE
binding.mTitle.setTextColor(ContextCompat.getColor(context, R.color.col_7c7))
binding.tvSingle.visibility = View.VISIBLE
binding.tvSingle.text = confirmText
binding.tvSingle.setOnClickListener {
dismiss()
}
} else {
binding.mTvConfirm.text = confirmText
binding.mTvCancel.text = cancelText
binding.mTvCancel.setOnClickListener {
cancel.invoke()
dismiss()
}
binding.mTvConfirm.setOnClickListener {
confirm.invoke()
dismiss()
}
}
}
}

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@color/col_6f7"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<LinearLayout
android:id="@+id/ll_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/title"
android:paddingLeft="@dimen/dp_21"
android:paddingRight="@dimen/dp_21"
android:background="@color/white">
<RelativeLayout
android:layout_width="match_parent"
android:gravity="center_vertical"
android:layout_height="@dimen/dp_56">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="关系"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<EditText
android:id="@+id/et_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
android:textColorHint="@color/col_6B6"
android:hint="请填写关联对象关系,例:父亲"
android:background="@null"
android:layout_alignParentEnd="true"
android:gravity="right"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:background="@color/col_0f2"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="手机号"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<EditText
android:id="@+id/et_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
android:textColorHint="@color/col_6B6"
android:inputType="phone"
android:maxLength="11"
android:hint="请输入手机号码"
android:background="@null"
android:layout_alignParentEnd="true"
android:gravity="right"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:background="@color/col_0f2"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="监护人"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<CheckBox
android:id="@+id/cb_frist"
android:layout_width="@dimen/dp_13"
android:layout_height="@dimen/dp_13"
android:layout_marginRight="2dp"
android:layout_toLeftOf="@+id/desc"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center_vertical"
android:background="@drawable/selector_check_tongue"
android:button="@null"
/>
<TextView
android:id="@+id/desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="第一监护人(设置该用户接受预警短信)"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_13"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
</LinearLayout>
<TextView
android:layout_below="@+id/ll_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提示:\n1、在添加绑定监护人前请用户先登录小程序或APP;\n2、在登陆后填写用户绑定的手机号码。"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_c7c"
android:layout_marginLeft="@dimen/dp_19"
android:layout_marginRight="@dimen/dp_19"
android:layout_marginTop="@dimen/dp_19"/>
<TextView
android:id="@+id/tv_bind"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginRight="@dimen/dp_25"
android:background="@drawable/shape_r25_02c"
android:text="绑定"
android:textColor="@color/white"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_30"
android:textStyle="bold"/>
</RelativeLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_6f7">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler"/>
</LinearLayout>

@ -745,6 +745,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:visibility="gone"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
tools:text="平均心率: 92次/分" /> tools:text="平均心率: 92次/分" />

@ -767,6 +767,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:visibility="gone"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
tools:text="平均心率: 92次/分" /> tools:text="平均心率: 92次/分" />

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_40"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="@drawable/shape_8round_white">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_pay_success"
android:layout_marginTop="@dimen/dp_36"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="购买成功"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_25">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单编号202307114545412"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_c7c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下单时间2023-07-11 22:02:03"
android:textSize="@dimen/sp_15"
android:layout_marginTop="@dimen/dp_13"
android:textColor="@color/col_c7c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="客服电话400 0063 365"
android:textSize="@dimen/sp_15"
android:layout_marginTop="@dimen/dp_13"
android:textColor="@color/col_c7c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="预留电话18611375035"
android:textSize="@dimen/sp_15"
android:layout_marginTop="@dimen/dp_13"
android:textColor="@color/col_c7c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="备注说明:\n
您已经购买本次服务请耐心等待客服电话客服将在24小时内通过预留电话或订单手机号联系到您请保持电话通畅。
平台将推荐给您最好的服务,祝您愉快"
android:textSize="@dimen/sp_15"
android:layout_marginTop="@dimen/dp_13"
android:textColor="@color/col_313"/>
</LinearLayout>
<TextView
android:id="@+id/tv_confirm"
android:layout_width="@dimen/dp_115"
android:layout_height="@dimen/dp_40"
android:background="@drawable/shape_r25_02c"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginBottom="@dimen/dp_22"
android:text="确认"
android:textColor="@color/white"
android:gravity="center"
android:textSize="@dimen/sp_17"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>

@ -44,7 +44,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical|right" android:gravity="center_vertical|right"
android:textColor="@color/col_8D0" android:textColor="@color/col_02c"
android:layout_marginRight="@dimen/dp_14" android:layout_marginRight="@dimen/dp_14"
android:text="第23名" android:text="第23名"
android:textSize="@dimen/dp_18" /> android:textSize="@dimen/dp_18" />

@ -73,7 +73,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/col_25C" android:textColor="@color/col_02c"
android:textSize="18dp" /> android:textSize="18dp" />
</com.ruffian.library.widget.RLinearLayout> </com.ruffian.library.widget.RLinearLayout>

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:orientation="vertical"
android:background="@drawable/shape_8round_white"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_27"
android:layout_marginLeft="@dimen/dp_23"
android:layout_marginRight="@dimen/dp_16">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/img_avator"
android:layout_width="@dimen/dp_33"
android:layout_height="@dimen/dp_33"
tools:background="@mipmap/icon_default_avator"/>
<LinearLayout
android:id="@+id/ll_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_avator"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_family_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
tools:text="张光汐"
android:layout_marginLeft="@dimen/dp_14"/>
<TextView
android:layout_width="@dimen/dp_27"
android:layout_height="@dimen/dp_15"
android:textSize="@dimen/sp_9"
android:textColor="@color/col_6ea"
android:background="@drawable/shape_r7_3fe_8f6"
tools:text="本人"
android:layout_marginLeft="@dimen/dp_5"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_12"
android:textColor="@color/col_02c"
android:layout_marginLeft="@dimen/dp_14"
tools:text="98%"
android:layout_below="@+id/ll_info"
android:layout_toRightOf="@+id/img_avator"/>
<TextView
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_20"
android:text="实时"
android:textColor="@color/col_02c"
android:textStyle="bold"
android:gravity="center"
android:id="@+id/tv_current_time"
android:layout_toLeftOf="@+id/tv_watch"
android:layout_marginRight="@dimen/dp_9"
android:background="@drawable/shape_r12_stroke_02c"
android:layout_alignParentEnd="true"/>
<TextView
android:id="@+id/tv_watch"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_20"
android:text="查看"
android:textColor="@color/col_02c"
android:textStyle="bold"
android:gravity="center"
android:background="@drawable/shape_r12_stroke_02c"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler"/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_44"
android:layout_marginRight="@dimen/dp_64"
android:layout_marginLeft="@dimen/dp_64"
android:text="添加监护人"
android:textStyle="bold"
android:textSize="@dimen/sp_16"
android:gravity="center"
android:background="@drawable/shape_r25_02c"
android:layout_marginTop="@dimen/dp_21"
android:textColor="@color/white"
android:id="@+id/tv_add_cancel"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_avator_recy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="@dimen/dp_17"
android:layout_height="@dimen/dp_17"
android:id="@+id/img_target"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_313"
tools:text="血氧"
android:textSize="@dimen/sp_13"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_c7c"
tools:text="42345步"
android:textSize="@dimen/sp_14"/>
</LinearLayout>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-6dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/img_user_avator"
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
app:civ_border_width="@dimen/dp_0_5"
app:civ_border_color="@color/white"/>
</LinearLayout>

@ -74,7 +74,7 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="right" android:gravity="right"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:textColor="@color/col_8D0" android:textColor="@color/col_02c"
android:textSize="@dimen/dp_16" /> android:textSize="@dimen/dp_16" />
</LinearLayout> </LinearLayout>

@ -73,7 +73,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="right" android:gravity="right"
android:textColor="@color/col_25C" android:textColor="@color/col_02c"
android:textSize="16dp" /> android:textSize="16dp" />
</LinearLayout> </LinearLayout>

@ -2,6 +2,7 @@ package com.zj365.mime.act
import android.text.Html import android.text.Html
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ArrayUtils
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
@ -45,6 +46,7 @@ class AboutAct: BaseVmAct<AboutVm>() {
override fun liveObserver() { override fun liveObserver() {
mViewModel.prevLive.observe(this){ mViewModel.prevLive.observe(this){
if (!ArrayUtils.isEmpty(it.data)){
it.data[0].let { it.data[0].let {
binding.mVersion.text="版本号: V${packageManager.getPackageInfo(this.packageName,0).versionName}" binding.mVersion.text="版本号: V${packageManager.getPackageInfo(this.packageName,0).versionName}"
binding.mWebSite.text=Html.fromHtml(String.format(getString(R.string.about_info),"公司网址:",it.website)) binding.mWebSite.text=Html.fromHtml(String.format(getString(R.string.about_info),"公司网址:",it.website))
@ -55,5 +57,7 @@ class AboutAct: BaseVmAct<AboutVm>() {
} }
} }
} }
}
} }
} }

@ -245,12 +245,17 @@ class BaseInfoChangeAct : BaseVmAct<BaseInfoVm>() {
binding.mPhone.text = it.phone binding.mPhone.text = it.phone
// binding.mId.setText(it.idCard) // binding.mId.setText(it.idCard)
binding.mBirthday.text = it.birthday binding.mBirthday.text = it.birthday
if (it.birthdayType == 2){
binding.tvCalType.text = "公历"
}else{
binding.tvCalType.text = "农历"
}
if(binding.tvCalType.text.toString().equals("公历")){ if(binding.tvCalType.text.toString().equals("公历")){
it.birthdayType == 2 it.birthdayType == 2
}else{ }else{
it.birthdayType == 1 it.birthdayType == 1
} }
binding.checkBirthday.isChecked = it.birthdayType == 2 // binding.checkBirthday.isChecked = it.birthdayType == 2
// when(it.birthdayType){ // when(it.birthdayType){
// 1-> binding.checkBirthday.isChecked = false // 1-> binding.checkBirthday.isChecked = false
// 2->binding.checkBirthday.isChecked = true // 2->binding.checkBirthday.isChecked = true

@ -84,7 +84,7 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
binding.mCode.text = "设备编号:${it.deviceId}" binding.mCode.text = "设备编号:${it.deviceId}"
binding.mActiveCode.text = "设备激活码:${it.activationCode}" binding.mActiveCode.text = "设备激活码:${it.activationCode}"
binding.mActiveCode.visibility = View.VISIBLE binding.mActiveCode.visibility = View.VISIBLE
setDevicePic(it.deviceType, binding.ivDevice) // setDevicePic(it.deviceType, binding.ivDevice)
} }
userId?.let { userId?.let {
@ -138,9 +138,9 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
mViewModel.deviceInfo.observe(this) { mViewModel.deviceInfo.observe(this) {
binding.mNickName.text = "设备名称:${it.data.watchName?:""}" binding.mNickName.text = "设备名称:${it.data.watchName?:""}"
binding.mNum.text = "设备地址${it.data.bluetooth?:""}" binding.mNum.text = "设备编码${it.data.bluetooth?:""}"
binding.mCode.text = "设备编号${it.data.deviceCode?:""}" binding.mCode.text = "物联网卡${it.data.deviceCode?:""}"
binding.mActiveCode.text = "设备激活码${it.data.activationCode?:""}" binding.mActiveCode.text = "流量到期${it.data.activationCode?:""}"
binding.mActiveCode.visibility = View.VISIBLE binding.mActiveCode.visibility = View.VISIBLE
setDevicePic(it.data.deviceType, binding.ivDevice) setDevicePic(it.data.deviceType, binding.ivDevice)

@ -31,7 +31,7 @@ class MessageDetailAct: IBaseAct() {
} }
binding.mMsg.text=content binding.mMsg.text=content
// onEventObject(baseContext, UmengEventId.WarningMsg, "查看预警消息详情$content") onEventObject(baseContext, UmengEventId.WarningMsg, "查看预警消息详情$content")
} }
override fun initView() { override fun initView() {

@ -77,18 +77,22 @@ class SettingNewAct: BaseVmAct<SettingVm>() {
bundle.clear() bundle.clear()
bundle.putString("title", "隐私政策") bundle.putString("title", "隐私政策")
bundle.putBoolean("isAgree", false) bundle.putBoolean("isAgree", false)
bundle.putString("url","https://auprty.com/app/static/app/privacy.html") bundle.putString("url","https://dc.zhongjian365.com/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle) RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
} }
binding.mTvUserAgree.setOnClickListener { binding.mTvUserAgree.setOnClickListener {
bundle.clear() bundle.clear()
bundle.putString("title", "用户协议")
bundle.putBoolean("isAgree", false)
bundle.putString("url","https://dc.zhongjian365.com/agreement.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
/* bundle.clear()
bundle.putString("title", "用户协议") bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1) bundle.putInt("type", Const.AGREEMENT_1)
bundle.putBoolean("isAgree", false) bundle.putBoolean("isAgree", false)
RouteManager.goAct(ARouterUrl.RICH_TEXT, bundle) RouteManager.goAct(ARouterUrl.RICH_TEXT, bundle)*/
} }

@ -32,7 +32,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@mipmap/ic_device_watch" /> android:src="@mipmap/ic_watch_gs29u" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -112,7 +112,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_27" android:layout_marginBottom="@dimen/dp_27"
android:visibility="gone" android:visibility="visible"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_contact_kefu" android:id="@+id/tv_contact_kefu"

@ -631,6 +631,9 @@ interface ApiInterface {
@POST("customer/family/list") @POST("customer/family/list")
suspend fun getMyFamily(@Body rb: RequestBody): RespBody<MutableList<FamilyBean>> suspend fun getMyFamily(@Body rb: RequestBody): RespBody<MutableList<FamilyBean>>
@POST("customer/index/getWeather")
suspend fun getWeather(@Body rb: RequestBody): RespBody<WeatherBean>
/** /**
* 关联家人 * 关联家人
*/ */
@ -907,6 +910,14 @@ interface ApiInterface {
@POST("customer/layout/list") @POST("customer/layout/list")
suspend fun getHomeLayout():RespBody<HomeLayoutBean> suspend fun getHomeLayout():RespBody<HomeLayoutBean>
/**
* 膳食分析-热卡分析
*/
@POST("customer/meals/foodRecognize")
@Multipart
suspend fun foodRecognize(@Part file: MultipartBody.Part,
@Part("type") type: RequestBody): RespBody<MutableList<FoodRecoginzeInfo>>
/** /**
* 关于 * 关于
*/ */
@ -1685,4 +1696,10 @@ interface ApiInterface {
*/ */
@POST("customer/user/getInviteCount") @POST("customer/user/getInviteCount")
suspend fun getInviteCount(@Body rb: RequestBody): RespBody<String> suspend fun getInviteCount(@Body rb: RequestBody): RespBody<String>
/**
* 添加家人
*/
@POST("customer/family/addFamily")
suspend fun addFamilyGuardian(@Body rb: RequestBody): RespBody<Any>
} }

@ -0,0 +1,12 @@
package com.xty.network.model
import java.nio.DoubleBuffer
data class FoodRecoginzeInfo(
val heat:Double,
val df:Double,
val cho:Double,
val chol:Double,
val na:DoubleBuffer
) {
}

@ -20,13 +20,20 @@ data class MainBean(
val power: String, val power: String,
val watchType: Int,//0:蓝牙U32 1:4G A3 val watchType: Int,//0:蓝牙U32 1:4G A3
val weather: Weather, val weather: Weather,
val bmi:String, //BMI 值
val warningCount :Int, //预警次数
val healthCount :Int, //监测次数
val chinaDay:String, //农历日期
val nowDay:String,//当前日期
val deviceTotal: DeviceTotal,//物联网数据 val deviceTotal: DeviceTotal,//物联网数据
val demonstrate: Int,//0:普通模式 1: 演示模式 val demonstrate: Int,//0:普通模式 1: 演示模式
val stepData: StepData,//步数 val stepData: StepData,//步数
val bloodSugarData: DloodSugarData,//血糖 val bloodSugarData: DloodSugarData,//血糖
val uricAcidData: UricAcidData,//尿酸 val uricAcidData: UricAcidData,//尿酸
val caloriesData: String,//卡路里 val caloriesData: String,//卡路里
val bloodFatData: BloodFatData//血脂 val bloodFatData: BloodFatData,//血脂
val bmiInfo: BMIInfoBean //bmi信息
) { ) {
//血脂 //血脂
data class BloodFatData( data class BloodFatData(
@ -147,6 +154,12 @@ data class MainBean(
val star: String, val star: String,
val deviceType: String, val deviceType: String,
val weight: String? = null, val weight: String? = null,
val bodyFatMac: String val bodyFatMac: String,
val isPerfect:Int = 1 //0未完善1已完善
) : Serializable ) : Serializable
data class BMIInfoBean(
val levelName:String,
val bmi:String
)
} }

@ -0,0 +1,7 @@
package com.xty.network.model
data class WeatherBean(
val temp:String,
val text:String
) {
}
Loading…
Cancel
Save