中建365-绑定设备

develop
wlh 1 year ago
parent 916d6ad193
commit 485b67d188

@ -1,7 +1,6 @@
package com.zj365.dc.activity package com.zj365.dc.activity
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
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.tamsiree.rxkit.RxActivityTool import com.tamsiree.rxkit.RxActivityTool
@ -29,20 +28,18 @@ class DeviceChoiceAct : BaseVmAct<DeviceChoiceVm>() {
private val deviceAdapter by lazy { DeviceChoiceAdapter() } private val deviceAdapter by lazy { DeviceChoiceAdapter() }
private var isLogin = false private var isLogin = false
private val data = mutableListOf(
DeviceBean(R.mipmap.ic_watch_gs29u, "4GGS29U", 1),
DeviceBean(R.mipmap.ic_watch_ps360, "4GPS360", 1)
/* DeviceBean(R.mipmap.ic_watch_x1, "4G手表(X1)", 1),
DeviceBean(R.mipmap.ic_blutooth_watch, "蓝牙手表(U32)", 0)*/
)
override fun liveObserver() { override fun liveObserver() {
mViewModel.deviceTypeListLiveData.observe(this){
deviceAdapter.setNewInstance(it.data)
}
} }
override fun initData() { override fun initData() {
super.initData() super.initData()
isLogin = intent.getBooleanExtra("isLogin", false) isLogin = intent.getBooleanExtra("isLogin", false)
} }
override fun initView() { override fun initView() {
@ -62,11 +59,11 @@ class DeviceChoiceAct : BaseVmAct<DeviceChoiceVm>() {
layoutManager = LinearLayoutManager(this@DeviceChoiceAct) layoutManager = LinearLayoutManager(this@DeviceChoiceAct)
adapter = deviceAdapter adapter = deviceAdapter
} }
deviceAdapter.setNewInstance(data)
deviceAdapter.setOnItemClickListener { adapter, _, position -> deviceAdapter.setOnItemClickListener { adapter, _, position ->
val device = adapter.data[position] as DeviceBean val device = adapter.data[position] as DeviceBean
val type = device.type val type = device.watchType
if (type != 0) { if (type != 0) {
bundle.clear() bundle.clear()
bundle.putInt("type", type) bundle.putInt("type", type)
@ -92,6 +89,7 @@ class DeviceChoiceAct : BaseVmAct<DeviceChoiceVm>() {
} }
} }
} }
mViewModel.getDeviceType()
} }
override fun onBackPressed() { override fun onBackPressed() {

@ -47,7 +47,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
val dialogBind by lazy { val dialogBind by lazy {
DialogTipNew(this, "恭喜您成为中健三六五大家庭的医院,为了提供更好的信息服务,请完善您的基本信息。", "前往","取消",false,{ DialogTipNew(this,"温馨提示", "恭喜您成为中健三六五大家庭的医院,为了提供更好的信息服务,请完善您的基本信息。", "前往","取消",false,{
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE) RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE)
}){ }){
EventBus.getDefault().post(LoginOrRegisterEvent()) EventBus.getDefault().post(LoginOrRegisterEvent())

@ -21,6 +21,7 @@ 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.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption import com.amap.api.location.AMapLocationClientOption
import com.blankj.utilcode.util.ArrayUtils
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
@ -31,6 +32,7 @@ import com.tencent.qcloud.tuicore.TUIConstants
import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper 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.dialog.DialogActivities
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
@ -38,10 +40,13 @@ 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.LoginOrRegisterEvent
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.CommonUtils
import com.xty.common.util.ViewScreenshotUtils import com.xty.common.util.ViewScreenshotUtils
import com.xty.network.model.InviteCustodyBean
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
@ -52,6 +57,7 @@ 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.health.weight.DialogTipNew
import com.zj365.mime.act.DevInfoAct import com.zj365.mime.act.DevInfoAct
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@ -79,6 +85,8 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
private var mLocationClient: AMapLocationClient? = null private var mLocationClient: AMapLocationClient? = null
private var mLocationOption: AMapLocationClientOption? = null private var mLocationOption: AMapLocationClientOption? = null
var inviteCustodyBean:InviteCustodyBean? = null
private val dialog by lazy { private val dialog by lazy {
AppUpdateDialog(this) { AppUpdateDialog(this) {
if (it) { if (it) {
@ -87,6 +95,19 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
} }
} }
val dialogInvite by lazy {
DialogTipNew(this, "监护邀请","138****3415用户邀请您成为 监护人", "确认","取消",false,{
inviteCustodyBean?.let {
mViewModel.confirmInvite(it.id,"1")
}
}){
inviteCustodyBean?.let {
mViewModel.confirmInvite(it.id,"0")
}
}
}
private fun initUnreadCountReceiver() { private fun initUnreadCountReceiver() {
unreadCountReceiver = object : BroadcastReceiver() { unreadCountReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
@ -124,7 +145,7 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
initVp2() initVp2()
initBottomNav() initBottomNav()
addNv() addNv()
// mViewModel.getVersionNew() mViewModel.getVersionNew()
initUnreadCountReceiver() initUnreadCountReceiver()
JPushInterface.setBadgeNumber(this, 0) JPushInterface.setBadgeNumber(this, 0)
@ -135,6 +156,9 @@ 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.getBanners(userId,3)
mViewModel.getIsDemonstate()
mViewModel.searchInviteInfo()
// mViewModel.getBindList(BaseDeviceBindListAct.DeviceType.BODYFAT.type) // mViewModel.getBindList(BaseDeviceBindListAct.DeviceType.BODYFAT.type)
} }
@ -261,6 +285,29 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
} }
} }
mViewModel.isDemonstrateData.observe(this){
isDemonstrate = it.data == "1"
}
mViewModel.findInfoLiveData.observe(this){
if (it.data != null){
inviteCustodyBean = it.data
dialogInvite.setContentNew("${CommonUtils.replaceMiddleNumber(it.data.phone)}用户邀请您成为 监护人")
dialogInvite.show()
}
}
mViewModel.bannerLive.observe(this){
it[3]?.let {
if(it != null && it.size > 0){
// DialogActivities(this,it[0].imgUrl).show()
}
}
}
//未读消息操作 //未读消息操作
/* mViewModel.countLive.observe(this) { /* mViewModel.countLive.observe(this) {
setUnreadcount(it.data.count) setUnreadcount(it.data.count)

@ -1,5 +1,6 @@
package com.zj365.dc.activity package com.zj365.dc.activity
import android.text.Html
import android.view.View import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
@ -39,7 +40,7 @@ class MessageDetailNewAct: BaseVmAct<BaseVm>() {
msgBean?.let { msgBean?.let {
binding.tvMsgTitle.text = it.notifyTitle binding.tvMsgTitle.text = it.notifyTitle
binding.tvMsgTime.text = Dateutils.formatTime(it.notifyCreateTime,Dateutils.YYYY_MM_DD_HH_MM) binding.tvMsgTime.text = Dateutils.formatTime(it.notifyCreateTime,Dateutils.YYYY_MM_DD_HH_MM)
binding.tvMsgContent.text = it.notifyContent binding.tvMsgContent.text = Html.fromHtml(it.notifyContent)
} }

@ -4,10 +4,12 @@ import android.content.Intent
import android.view.View import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.tamsiree.rxkit.RxActivityTool
import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.common.LogUtils import com.xty.common.LogUtils
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.util.CommonToastUtils
import com.xty.common.xqr_code.XQRCodeAct import com.xty.common.xqr_code.XQRCodeAct
import com.xuexiang.xqrcode.XQRCode import com.xuexiang.xqrcode.XQRCode
import com.zj365.dc.databinding.ActBinderDeviceOneKeyBinding import com.zj365.dc.databinding.ActBinderDeviceOneKeyBinding
@ -19,6 +21,10 @@ class OneKeyBinderDeviceAct : BaseVmAct<OneKeyBinderDeviceVm>() {
val binding by lazy { ActBinderDeviceOneKeyBinding.inflate(layoutInflater) } val binding by lazy { ActBinderDeviceOneKeyBinding.inflate(layoutInflater) }
override fun liveObserver() { override fun liveObserver() {
mViewModel.bindResult.observe(this){
CommonToastUtils.showToast("绑定成功")
finish()
}
} }
@ -33,7 +39,8 @@ class OneKeyBinderDeviceAct : BaseVmAct<OneKeyBinderDeviceVm>() {
startScan() startScan()
} }
binding.tvBackHome.setOnClickListener { binding.tvBackHome.setOnClickListener {
RxActivityTool.finishActivity(DeviceChoiceAct::class.java)
finish()
} }
} }
@ -74,8 +81,7 @@ class OneKeyBinderDeviceAct : BaseVmAct<OneKeyBinderDeviceVm>() {
LogUtils.d("扫描结果:$result") LogUtils.d("扫描结果:$result")
binding.tvErrorMsg.visibility = View.GONE binding.tvErrorMsg.visibility = View.GONE
if (!result.isNullOrEmpty()) { if (!result.isNullOrEmpty()) {
val gson = Gson() mViewModel.binderDevice(result)
var scanInfoBean = gson.fromJson(result, ScanInfoBean::class.java)
} else { } else {
binding.tvErrorMsg.visibility = View.VISIBLE binding.tvErrorMsg.visibility = View.VISIBLE
binding.tvScan.text = "继续绑定" binding.tvScan.text = "继续绑定"

@ -137,8 +137,8 @@ class WelcomeAct : BaseVmAct<WelcomeVm>() {
mainScope.launch(Dispatchers.IO) { mainScope.launch(Dispatchers.IO) {
LogUtils.d("BlueTooth Connect!!!") LogUtils.d("BlueTooth Connect!!!")
YCBBlueConnectHelper.connectionBlueTooth(mac, true) { /* YCBBlueConnectHelper.connectionBlueTooth(mac, true) {
} }*/
} }
} }

@ -1,15 +1,17 @@
package com.zj365.dc.adapter package com.zj365.dc.adapter
import android.widget.ImageView
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.common.setImage
import com.xty.network.model.DeviceBean import com.xty.network.model.DeviceBean
import com.zj365.dc.R import com.zj365.dc.R
class DeviceChoiceAdapter:BaseAdapter<DeviceBean>(R.layout.item_device_choice) { class DeviceChoiceAdapter:BaseAdapter<DeviceBean>(R.layout.item_device_choice) {
override fun convert(holder: BaseViewHolder, item: DeviceBean) { override fun convert(holder: BaseViewHolder, item: DeviceBean) {
holder.setImageResource(R.id.iv_device_icon,item.resId) holder.getView<ImageView>(R.id.iv_device_icon).setImage(context,item.imageUrl)
holder.setText(R.id.tv_device_name,item.name) holder.setText(R.id.tv_device_name,"${item.watchTypeName}(${item.deviceType})")
} }
} }

@ -1,5 +1,6 @@
package com.zj365.dc.adapter package com.zj365.dc.adapter
import android.text.Html
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -23,7 +24,7 @@ class HomeMessageAdapter : BaseAdapter<SystemMsgBean>(R.layout.item_home_message
holder.getView<ImageView>(R.id.img_msg).setImageDrawable(context.resources.getDrawable(R.mipmap.icon_msg_welfare)) holder.getView<ImageView>(R.id.img_msg).setImageDrawable(context.resources.getDrawable(R.mipmap.icon_msg_welfare))
} }
holder.setText(R.id.tv_msg_title,item.name) holder.setText(R.id.tv_msg_title,item.name)
holder.setText(R.id.tv_msg_content,item.msg) holder.setText(R.id.tv_msg_content, Html.fromHtml(item.msg))
if(!TextUtils.isEmpty(item.time)){ if(!TextUtils.isEmpty(item.time)){
holder.setText(R.id.tv_msg_time,Dateutils.formatTime(item.time.toLong(),Dateutils.YYYY_MM_DD_HH_MM)) holder.setText(R.id.tv_msg_time,Dateutils.formatTime(item.time.toLong(),Dateutils.YYYY_MM_DD_HH_MM))
} }

@ -36,6 +36,7 @@ import com.xty.common.bracelet.YCBOrder
import com.xty.common.bracelet.checkBlueConnectPermission import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission import com.xty.common.bracelet.getBluePermission
import com.xty.common.bracelet.isGpsOpen import com.xty.common.bracelet.isGpsOpen
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.BlueToothConnectEvent import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.ChangeFamilyEvent import com.xty.common.event.ChangeFamilyEvent
import com.xty.common.event.FamilyEvent import com.xty.common.event.FamilyEvent
@ -1104,7 +1105,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
signDialog.show() signDialog.show()
} }
} }
if (CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))) {//如果是蓝牙设备 /* if (CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))) {//如果是蓝牙设备
startGetDeviceInfoLive() startGetDeviceInfoLive()
if (settingBean.user.bluetooth != MMkvHelper.getString(Const.Blue_Tooth)) {//如果不是同一设备 if (settingBean.user.bluetooth != MMkvHelper.getString(Const.Blue_Tooth)) {//如果不是同一设备
YCBBlueConnectHelper.disconnect()//断开蓝牙断开后收到BlueToothConnectEvent会自动连接 YCBBlueConnectHelper.disconnect()//断开蓝牙断开后收到BlueToothConnectEvent会自动连接
@ -1114,7 +1115,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
mainUIUpdate(YCBBlueConnectHelper.BLEConnectState.Connecting)//刷新蓝牙连接状态 mainUIUpdate(YCBBlueConnectHelper.BLEConnectState.Connecting)//刷新蓝牙连接状态
connect(settingBean.user.bluetooth) connect(settingBean.user.bluetooth)
} }
} }*/
} }
if (Const.Companion.WatchDevice.LightA3.ordinal == Const.watchType) {//如果是4G设备设置连接状态与电量信息 if (Const.Companion.WatchDevice.LightA3.ordinal == Const.watchType) {//如果是4G设备设置连接状态与电量信息
@ -1669,7 +1670,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
//家人信息改变 刷新 //家人信息改变 刷新
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun familyChange(event: FamilyEvent) { fun familyChange(event: FamilyEvent) {
mViewModel.getMyFamilyList() // mViewModel.getMyFamilyList()
} }
/** /**
@ -1741,4 +1742,9 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) { override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
} }
@Subscribe(threadMode = ThreadMode.MAIN)
fun addSuccess(event: AddSuccessEvent){
request()
}
} }

@ -290,7 +290,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
} }
else ->{ else ->{
CommonToastUtils.showToast("敬请期待")
} }
} }
} }
@ -507,7 +507,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
private fun request() { private fun request() {
mViewModel.getBanners(CommonUtils.getMyUserId(),1)//当期登录用户id mViewModel.getBanners(CommonUtils.getMyUserId(),1)//当期登录用户id
mViewModel.getMyFamilyList() // mViewModel.getMyFamilyList()
mViewModel.getScinceList() mViewModel.getScinceList()
@ -596,6 +596,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
if (position == mFamilyAdapter.data.size - 1) { //第一期暂不做 if (position == mFamilyAdapter.data.size - 1) { //第一期暂不做
/* onEventObject(requireContext(), UmengEventId.Family) /* onEventObject(requireContext(), UmengEventId.Family)
RouteManager.goAct(ARouterUrl.BIND_FAMILY)*/ RouteManager.goAct(ARouterUrl.BIND_FAMILY)*/
RouteManager.goAct(ARouterUrl.FAMILY_HEALTH_ACT)
} else { } else {
var bean = adapter.getItem(position) as FamilyBean var bean = adapter.getItem(position) as FamilyBean
showIdInfo = if (bean.id == 0) { showIdInfo = if (bean.id == 0) {
@ -643,7 +644,7 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
//家人信息改变 刷新 //家人信息改变 刷新
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun familyChange(event: FamilyEvent) { fun familyChange(event: FamilyEvent) {
mViewModel.getMyFamilyList() // mViewModel.getMyFamilyList()
} }

@ -12,6 +12,7 @@ import com.xty.common.*
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.YCBBlueConnectHelper import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.LoginOrRegisterEvent 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
@ -339,8 +340,8 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
mViewModel.unbindLive.observe(this) { mViewModel.unbindLive.observe(this) {
user!!.bluetooth = "" user!!.bluetooth = ""
YCBBlueConnectHelper.disconnect() /* YCBBlueConnectHelper.disconnect()
YCBBlueConnectHelper.cancelTimer() YCBBlueConnectHelper.cancelTimer()*/
EventBus.getDefault().post(MyInfoEvent()) //刷新个人信息 EventBus.getDefault().post(MyInfoEvent()) //刷新个人信息
} }
/* mViewModel.signLive.observe(this) { /* mViewModel.signLive.observe(this) {
@ -382,6 +383,11 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
refreshLogoutUI() refreshLogoutUI()
} }
@Subscribe(threadMode = ThreadMode.MAIN)
fun addSuccess(event: AddSuccessEvent){
mViewModel.getMySetting()
mViewModel.getScore(1)
}

@ -1,7 +1,21 @@
package com.zj365.dc.vm package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.network.model.DeviceBean
import com.xty.network.model.RespBody
import org.json.JSONObject
class DeviceChoiceVm:BaseVm() { class DeviceChoiceVm:BaseVm() {
val deviceTypeListLiveData by lazy { MutableLiveData<RespBody<MutableList<DeviceBean>>> ()}
fun getDeviceType(){
startHttp {
var json = JSONObject()
val response = apiInterface().getDeviceTypeList(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(deviceTypeListLiveData, nowData)
}
}
} }

@ -261,8 +261,8 @@ class DynamicManagementVm : BaseVm() {
): MutableList<HealthMonitoringListBean> { ): MutableList<HealthMonitoringListBean> {
val healthMonitoringList: MutableList<HealthMonitoringListBean> = mutableListOf() val healthMonitoringList: MutableList<HealthMonitoringListBean> = mutableListOf()
bean.apply { bean.apply {
when (deviceType) { /*when (deviceType) {
"U32", "" -> { //其他界面要用到是否为x1,x2的设备判断这里坐下缓存 "U32", "" -> { //其他界面要用到是否为x1,x2的设备判断这里坐下缓存*/
MMkvHelper.put(Const.X1_X2_Device, false) MMkvHelper.put(Const.X1_X2_Device, false)
//心率 //心率
val statusXL = if (hrData.hr == 0) { val statusXL = if (hrData.hr == 0) {
@ -702,9 +702,9 @@ class DynamicManagementVm : BaseVm() {
10 10
) )
)*/ )*/
} // }
"A3" -> { /*"A3" -> {
//其他界面要用到是否为x1,x2的设备判断这里坐下缓存 //其他界面要用到是否为x1,x2的设备判断这里坐下缓存
MMkvHelper.put(Const.X1_X2_Device, false) MMkvHelper.put(Const.X1_X2_Device, false)
//心率 //心率
@ -1106,8 +1106,8 @@ class DynamicManagementVm : BaseVm() {
10 10
) )
) )
} }*/
/*
"X2", "X1" -> { "X2", "X1" -> {
//其他界面要用到是否为x1,x2的设备判断这里坐下缓存 //其他界面要用到是否为x1,x2的设备判断这里坐下缓存
MMkvHelper.put(Const.X1_X2_Device, true) MMkvHelper.put(Const.X1_X2_Device, true)
@ -1474,8 +1474,8 @@ class DynamicManagementVm : BaseVm() {
10 10
) )
) )
} }*/
} // }
} }
return healthMonitoringList return healthMonitoringList
} }

@ -5,13 +5,20 @@ import android.content.Context
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.common.util.CommonUtils import com.xty.common.util.CommonUtils
import com.xty.network.model.BannerBean
import com.xty.network.model.BindDeviceListBean import com.xty.network.model.BindDeviceListBean
import com.xty.network.model.InviteCustodyBean
import com.xty.network.model.RespBody import com.xty.network.model.RespBody
import com.xty.network.model.UnReadMessageBean import com.xty.network.model.UnReadMessageBean
import com.xty.network.model.Update import com.xty.network.model.Update
import com.xty.network.model.UserEquipmentInformationizationBean import com.xty.network.model.UserEquipmentInformationizationBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.json.JSONObject import org.json.JSONObject
class MainVm : BaseVm() { class MainVm : BaseVm() {
@ -24,6 +31,15 @@ class MainVm : BaseVm() {
val saveSuccess by lazy { MutableLiveData<RespBody<Any>>() } val saveSuccess by lazy { MutableLiveData<RespBody<Any>>() }
val boundDevices by lazy{MutableLiveData<RespBody<MutableList<BindDeviceListBean>>>()} val boundDevices by lazy{MutableLiveData<RespBody<MutableList<BindDeviceListBean>>>()}
val bannerLive by lazy { MutableLiveData<MutableMap<Int,MutableList<BannerBean>>>() }
val isDemonstrateData by lazy { MutableLiveData<RespBody<String>>() }
val findInfoLiveData by lazy { MutableLiveData<RespBody<InviteCustodyBean>>() }
val confirmInviteLiveData by lazy { MutableLiveData<RespBody<Any>>() }
/** /**
* 设备类型1血压计2血糖仪.3体脂秤 * 设备类型1血压计2血糖仪.3体脂秤
*/ */
@ -91,4 +107,79 @@ class MainVm : BaseVm() {
response.getCodeStatus(getUserEquipmentInformationization, nowData) response.getCodeStatus(getUserEquipmentInformationization, nowData)
} }
} }
fun getBanners(id: String?,location:Int){
startHttp(false) {
withContext(Dispatchers.IO){
val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {
""
} else {
MMkvHelper.getLong(Const.USER_ID).toString()
}
var nowLine = async{apiInterface().getBanners(userId,location)}
var showInfo = nowLine.await()
// var value=apiInterface().getBanners(retrofits.getRequestBody(json.toString()))
var dataMap = setMapValue(bannerLive.value,showInfo.data,location)
if (dataMap != null){
bannerLive.postValue(dataMap)
}
// value.getCodeStatus(bannerLive,nowData)
}
}
}
fun getIsDemonstate(){
startHttp(false) {
withContext(Dispatchers.IO){
val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {
""
} else {
MMkvHelper.getLong(Const.USER_ID).toString()
}
var json = JSONObject()
json.put("id", userId)
val response = apiInterface().getIsDemonstrate(retrofits.getRequestBody(json.toString()))
// value.getCodeStatus(bannerLive,nowData)
response.getCodeStatus(isDemonstrateData,nowData)
}
}
}
fun searchInviteInfo(){
startHttp(false) {
var json = JSONObject()
val response = apiInterface().findConfirmInfo(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(findInfoLiveData, nowData)
}
}
fun confirmInvite(id:String, status:String){
startHttp(false) {
var json = JSONObject()
json.put("id",id)
json.put("status",status)
val response = apiInterface().confirmInvited(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(confirmInviteLiveData,nowData)
}
}
fun <T> setMapValue(map: MutableMap<Int, MutableList<T>>?, list: MutableList<T>?, type: Int): MutableMap<Int, MutableList<T>>? {
if (list == null) {
return null
} else { //当得到的值不是空的时候
var mapNew = mutableMapOf<Int, MutableList<T>>()
if (map == null) {
mapNew[type] = list
return mapNew
} else {
map[type] = list
return map
}
}
}
} }

@ -16,7 +16,7 @@
<item <item
android:id="@+id/nav_dynamic_management" android:id="@+id/nav_dynamic_management"
android:icon="@drawable/sel_health" android:icon="@drawable/sel_health"
android:title="健康管理" android:title="健康监测"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
<item <item
android:id="@+id/nav_message" android:id="@+id/nav_message"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 886 B

@ -0,0 +1,44 @@
package com.xty.base.dialog
import android.content.Context
import android.graphics.Bitmap
import android.view.View
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition
import com.xty.base.databinding.DialogActivitiesBinding
import com.xty.common.R
import com.xty.common.SizeUtil
import com.xty.common.setBigImage
import com.xty.common.setImage
import com.xty.common.setImageUser
class DialogActivities (context:Context,var imgUrl:String?): BaseDialog(context) {
val binding by lazy { DialogActivitiesBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
override fun initView() {
super.initView()
setDialogPadding(SizeUtil.dp2px(context, 30f), 0, SizeUtil.dp2px(context, 30f), 0)
imgUrl?.let {
binding.imgActivies.setImage(context,it)
/* Glide.with(context).asBitmap().load(it).error(R.mipmap.ic_welcome_main_bg)
.into(object : SimpleTarget<Bitmap?>() {
override fun onResourceReady(
resource: Bitmap,
transition: Transition<in Bitmap?>?
) {
if (resource != null) {
binding.imgActivies.setImageBitmap(resource)
}
}
})*/
}
binding.imgClose.setOnClickListener { dismiss() }
binding.imgActivies.setOnClickListener {
}
}
}

@ -0,0 +1,26 @@
<?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:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_9"
android:layout_gravity="end"
android:layout_marginRight="32dp"
android:background="@mipmap/icon_close"/>
<ImageView
android:id="@+id/img_activies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxHeight="@dimen/dp_306"
android:scaleType="centerCrop"
/>
</LinearLayout>

@ -39,4 +39,6 @@
<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> <color name="col_6ea">#6EA8F6</color>
<color name="col_481">#FDA481</color>
<color name="col_91d">#F7891D</color>
</resources> </resources>

@ -0,0 +1,4 @@
package com.xty.common.event
class AddSuccessEvent {
}

@ -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="#FDA481"/>
<solid android:color="#FDF5F2"/>
</shape>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

@ -5,9 +5,11 @@ import com.alibaba.android.arouter.facade.annotation.Route
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.event.AddSuccessEvent
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.zj365.health.databinding.ActAddFamilyGuardianBinding import com.zj365.health.databinding.ActAddFamilyGuardianBinding
import com.zj365.health.vm.AddFamilyGuardianVm import com.zj365.health.vm.AddFamilyGuardianVm
import org.greenrobot.eventbus.EventBus
@Route(path = ARouterUrl.ADD_FAMILY_GUARDIAN_ACT) @Route(path = ARouterUrl.ADD_FAMILY_GUARDIAN_ACT)
class AddFamilyGuardianAct : BaseVmAct<AddFamilyGuardianVm>() { class AddFamilyGuardianAct : BaseVmAct<AddFamilyGuardianVm>() {
@ -21,7 +23,8 @@ class AddFamilyGuardianAct : BaseVmAct<AddFamilyGuardianVm>() {
override fun liveObserver() { override fun liveObserver() {
mViewModel.submitLiveData.observe(this){ mViewModel.submitLiveData.observe(this){
EventBus.getDefault().post(AddSuccessEvent())
finish()
} }
} }

@ -1,17 +1,34 @@
package com.zj365.health.act.familyhealth package com.zj365.health.act.familyhealth
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct import com.blankj.utilcode.util.GsonUtils
import com.xty.base.vm.BaseVm import com.xty.base.act.BaseListAct
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.event.AddSuccessEvent
import com.xty.network.model.CancerGoodsBean
import com.xty.network.model.FamilyHealthBean
import com.zj365.health.R
import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter
import com.zj365.health.databinding.ActHealthFamilyBinding import com.zj365.health.databinding.ActHealthFamilyBinding
import com.zj365.health.vm.FamilyHealthVm
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@Route(path = ARouterUrl.FAMILY_HEALTH_ACT) @Route(path = ARouterUrl.FAMILY_HEALTH_ACT)
class FamilyHealthAct : BaseVmAct<BaseVm>() { class FamilyHealthAct : BaseListAct<FamilyHealthVm>() {
val binding by lazy { ActHealthFamilyBinding.inflate(layoutInflater) } val binding by lazy { ActHealthFamilyBinding.inflate(layoutInflater) }
val adapter by lazy { HealthFamilyAdapter() } val mAdapter by lazy { HealthFamilyAdapter() }
override fun liveObserver() { override fun liveObserver() {
mViewModel.familyHealthListData.observe(this){
mAdapter.setNewInstance(it.data)
}
mViewModel.exitCustody.observe(this){
page =1
loadData()
}
} }
override fun setLayout() = binding.root override fun setLayout() = binding.root
@ -25,7 +42,37 @@ class FamilyHealthAct : BaseVmAct<BaseVm>() {
} }
} }
override fun initAdapter() {
setRecycleRefresh(binding.recyclerView, binding.mRefresh, true)
binding.recyclerView.layoutManager = LinearLayoutManager(this)
binding.recyclerView.adapter = mAdapter
mAdapter.addChildClickViewIds(R.id.tv_add_cancel, R.id.tv_watch,R.id.tv_current_time)
mAdapter.setOnItemChildClickListener { adapter, view, position ->
val familyHealthBean = adapter.data[position] as FamilyHealthBean
when (view.id) {
R.id.tv_add_cancel -> {
if(familyHealthBean.isMy == 1){
RouteManager.goAct(ARouterUrl.ADD_FAMILY_GUARDIAN_ACT)
}else{
mViewModel.exitCustody(familyHealthBean.id.toString())
}
}
}
}
}
override fun loadData() {
mViewModel.getFamilyHealthList()
}
override fun initData() { override fun initData() {
super.initData() super.initData()
} }
@Subscribe(threadMode = ThreadMode.MAIN)
fun addSuccess(event: AddSuccessEvent){
page = 1
loadData()
}
} }

@ -1,12 +1,88 @@
package com.zj365.health.adapter.familyhealth package com.zj365.health.adapter.familyhealth
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.tencent.qcloud.tuikit.timcommon.component.impl.GlideEngine
import com.xty.base.adapter.BaseAdapter import com.xty.base.adapter.BaseAdapter
import com.xty.common.setImageUser
import com.xty.network.model.FamilyHealthBean
import com.zj365.health.R import com.zj365.health.R
import de.hdodenhof.circleimageview.CircleImageView
class HealthFamilyAdapter: BaseAdapter<Any>(R.layout.item_health_family) { class HealthFamilyAdapter: BaseAdapter<FamilyHealthBean>(R.layout.item_health_family) {
override fun convert(holder: BaseViewHolder, item: Any) { val mAdapterTaget by lazy { HealthFamilyTargetAdapter() }
val mAvatarAdapter by lazy { HealthFamilyUserAvatorAdapter() }
override fun convert(holder: BaseViewHolder, item: FamilyHealthBean) {
var tvRelation = holder.getView<TextView>(R.id.tv_relation)
var tvPower = holder.getView<TextView>(R.id.tv_power)
var recycler = holder.getView<RecyclerView>(R.id.recycler)
var tvAddOrCancel = holder.getView<TextView>(R.id.tv_add_cancel)
var avatarRecycler = holder.getView<RecyclerView>(R.id.user_avatar_recycler)
avatarRecycler.layoutManager = LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
avatarRecycler.adapter = mAvatarAdapter
holder.setText(R.id.tv_family_name,item.name)
holder.getView<CircleImageView>(R.id.img_avator).setImageUser(context,item.avatarUrl)
tvRelation.text = item.relation
if(item.isMy == 1){ ////是否本人01
tvRelation.background = context.resources.getDrawable(R.drawable.shape_r7_3fe_8f6)
tvRelation.setTextColor(context.resources.getColor(R.color.col_6ea))
tvAddOrCancel.text ="添加监护人"
tvAddOrCancel.background = context.resources.getDrawable(R.drawable.shape_r25_02c)
tvAddOrCancel.setTextColor(context.resources.getColor(R.color.white))
holder.setGone(R.id.user_avatar_recycler,false)
holder.setGone(R.id.tv_num,false)
holder.setGone(R.id.tv_watch_him,true)
item.avatarList?.let {
mAvatarAdapter.setNewInstance(it)
holder.setText(R.id.tv_num,"${it.size}/10")
}
}else {
tvRelation.background = context.resources.getDrawable(R.drawable.shape_r7_5f2_481)
tvRelation.setTextColor(context.resources.getColor(R.color.col_481))
tvAddOrCancel.text ="退出监护"
tvAddOrCancel.background = context.resources.getDrawable(R.drawable.shape_r25_stroke_02c)
tvAddOrCancel.setTextColor(context.resources.getColor(R.color.col_02c))
holder.setGone(R.id.user_avatar_recycler,true)
holder.setGone(R.id.tv_num,true)
holder.setGone(R.id.tv_watch_him,false)
}
if(item.power != null){
item.power?.let {
tvPower.text = "${it}%"
}
}else{
tvPower.text = "--%"
}
val drawableLeft = context.resources.getDrawable(R.mipmap.icon_power_green)
drawableLeft.setBounds(0,0,drawableLeft.minimumWidth,drawableLeft.minimumHeight)
tvPower.setCompoundDrawables(drawableLeft,null,null,null)
tvPower.compoundDrawablePadding = 5
recycler.layoutManager = LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
recycler.adapter = mAdapterTaget
mAdapterTaget.setNewInstance(item.dataList)
} }
} }

@ -1,11 +1,113 @@
package com.zj365.health.adapter.familyhealth package com.zj365.health.adapter.familyhealth
import android.graphics.Color
import android.graphics.Typeface
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.tencent.qcloud.tuikit.timcommon.component.impl.GlideEngine
import com.xty.base.adapter.BaseAdapter import com.xty.base.adapter.BaseAdapter
import com.xty.common.util.SpannableUtils
import com.xty.network.model.FamilyHealthBean
import com.zj365.health.R import com.zj365.health.R
class HealthFamilyTargetAdapter : BaseAdapter<String>(R.layout.item_health_family_target) { class HealthFamilyTargetAdapter : BaseAdapter<FamilyHealthBean.FamilyTargetBean>(R.layout.item_health_family_target) {
override fun convert(holder: BaseViewHolder, item: String) {
TODO("Not yet implemented") //器官名
private val units = arrayOf(
R.string.info_1_unit, R.string.info_3_unit, R.string.info_7_unit,
R.string.info_4_unit, R.string.info_2_unit, R.string.info_9_unit,
R.string.info_8_unit,
R.string.info_10_unit, R.string.info_6_unit
)
override fun convert(holder: BaseViewHolder, item: FamilyHealthBean.FamilyTargetBean) {
var imgTarget = holder.getView<ImageView>(R.id.img_target)
var tvValue = holder.getView<TextView>(R.id.tv_value)
holder.setText(R.id.tv_name,item.name)
var contentValue =""
if(item.type == 5){
if(item.value == "0/0"){
contentValue = "--"
}else{
contentValue = item.value
}
}else{
contentValue = if (item.value == "0") "--" else item.value
}
if(item.status == 1){
tvValue.setTextColor(Color.parseColor("#7C7C7C"))
tvValue.text = SpannableUtils.setStrSpan(
"${contentValue}${context.getString(units[item.type-1])}",
14,
ContextCompat.getColor(
context, R.color.col_c7c
),
Typeface.BOLD,
0,
"${contentValue}${context.getString(units[item.type-1])}".length -
context.getString(units[item.type-1]).length)
}else{
tvValue.setTextColor(Color.parseColor("#F7891D"))
tvValue.text = SpannableUtils.setStrSpan(
"${contentValue}${context.getString(units[item.type-1])}",
14,
ContextCompat.getColor(
context, R.color.col_91d
),
Typeface.BOLD,
0,
"${contentValue}${context.getString(units[item.type-1])}".length -
context.getString(units[item.type-1]).length)
}
when(item.type){
1 ->{
imgTarget.setImageResource(R.mipmap.ic_xl)
}
2 ->{
imgTarget.setImageResource(R.mipmap.ic_oo)
}
3 ->{
imgTarget.setImageResource(R.mipmap.ic_h_breath)
}
4 ->{
imgTarget.setImageResource(R.mipmap.ic_temp)
}
5 ->{
imgTarget.setImageResource(R.mipmap.ic_xya)
}
6 ->{
imgTarget.setImageResource(R.mipmap.ic_steps)
}
7 ->{
imgTarget.setImageResource(R.mipmap.ic_bloodsugar)
}
8 ->{
imgTarget.setImageResource(R.mipmap.ic_niaosuan)
}
}
} }
} }

@ -15,7 +15,13 @@ class HealthFamilyUserAvatorAdapter : BaseAdapter<String>(R.layout.item_health_f
if (position == 0){ if (position == 0){
setMargins(holder.itemView,0,0,0,0) setMargins(holder.itemView,0,0,0,0)
} }
holder.getView<CircleImageView>(R.id.img_user_avator).setImageUser(context,item) if (item != null){
holder.getView<CircleImageView>(R.id.img_user_avator).setImageUser(context,item)
}else{
holder.getView<CircleImageView>(R.id.img_user_avator).setImageResource(R.mipmap.icon_default_avator)
}
} }

@ -96,7 +96,7 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
var listFrag = mutableListOf<Fragment>() var listFrag = mutableListOf<Fragment>()
val tabs = arrayOf("", "", "","") val tabs = arrayOf("", "", "","")
private val activeColor: Int = Color.parseColor("#25C8D0") private val activeColor: Int = Color.parseColor("#02C191")
private val normalColor: Int = Color.parseColor("#7C7C7C") private val normalColor: Int = Color.parseColor("#7C7C7C")
private val activeSize = 15F private val activeSize = 15F
private val normalSize = 15F private val normalSize = 15F
@ -243,10 +243,10 @@ class SleepFrag : BaseVmFrag<SleepVm>() {
}else{ }else{
isAudioPlay = true isAudioPlay = true
musicInfoBinding.mImagePlay.setImageResource(R.mipmap.ic_pause) musicInfoBinding.mImagePlay.setImageResource(R.mipmap.ic_pause)
musicInfoBinding.mName.setTextColor(resources.getColor(R.color.col_25C)) musicInfoBinding.mName.setTextColor(resources.getColor(R.color.col_02c))
musicInfoBinding.mName.setTypeface(null, Typeface.BOLD) musicInfoBinding.mName.setTypeface(null, Typeface.BOLD)
musicInfoBinding.mPosition.setTypeface(null, Typeface.BOLD) musicInfoBinding.mPosition.setTypeface(null, Typeface.BOLD)
musicInfoBinding.mPosition.setTextColor(resources.getColor(R.color.col_25C)) musicInfoBinding.mPosition.setTextColor(resources.getColor(R.color.col_02c))
file.path?.let { it1 -> file.path?.let { it1 ->

@ -0,0 +1,31 @@
package com.zj365.health.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.FamilyHealthBean
import com.xty.network.model.RespBody
import org.json.JSONObject
class FamilyHealthVm :BaseVm() {
val familyHealthListData by lazy { MutableLiveData<RespBody<MutableList<FamilyHealthBean>>>() }
val exitCustody by lazy { MutableLiveData<RespBody<Any>>() }
fun getFamilyHealthList(){
startHttp (true){
val json = JSONObject()
val request = apiInterface().getFamilyList(retrofits.getRequestBody(json.toString()))
request.getCodeStatus(familyHealthListData,nowData)
}
}
fun exitCustody(id:String){
startHttp (true){
val request = apiInterface().exitCustody(id)
request.getCodeStatus(exitCustody,nowData)
}
}
}

@ -10,7 +10,8 @@ import com.zj365.health.databinding.DialogTipToastBinding
class DialogTipNew( class DialogTipNew(
context: Context, context: Context,
var title: String, var title: String? = "温馨提示",
var content:String,
var confirmText: String? = "确定", var confirmText: String? = "确定",
var cancelText:String? = "取消", var cancelText:String? = "取消",
var isSingleBtn:Boolean = false, var isSingleBtn:Boolean = false,
@ -22,7 +23,8 @@ class DialogTipNew(
override fun initView() { override fun initView() {
super.initView() super.initView()
setDialogPadding(SizeUtil.dp2px(context, 40f), 0, SizeUtil.dp2px(context, 40f), 0) setDialogPadding(SizeUtil.dp2px(context, 40f), 0, SizeUtil.dp2px(context, 40f), 0)
binding.mTitle.text = title // binding.mTitle.text = content
binding.tvTitle.text = title
if (isSingleBtn) { if (isSingleBtn) {
binding.clTwoBtnLayout.visibility = View.GONE binding.clTwoBtnLayout.visibility = View.GONE
@ -46,4 +48,8 @@ class DialogTipNew(
} }
} }
fun setContentNew(content:String){
binding.mTitle.text= content
}
} }

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#25C8D0" /> <solid android:color="#02C191" />
<corners <corners
android:bottomLeftRadius="3dp" android:bottomLeftRadius="3dp"
android:bottomRightRadius="3dp" android:bottomRightRadius="3dp"

@ -8,9 +8,27 @@
<include layout="@layout/title_white_bar" <include layout="@layout/title_white_bar"
android:id="@+id/title"/> android:id="@+id/title"/>
<androidx.recyclerview.widget.RecyclerView <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:id="@+id/recycler"/> android:background="@color/col_f4f">
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"/>
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>

@ -11,6 +11,7 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"

@ -3,11 +3,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" 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:orientation="vertical"
android:background="@drawable/shape_8round_white" android:background="@drawable/shape_8round_white"
android:layout_marginTop="@dimen/dp_12"
> >
<RelativeLayout <RelativeLayout
@ -40,10 +38,12 @@
android:layout_marginLeft="@dimen/dp_14"/> android:layout_marginLeft="@dimen/dp_14"/>
<TextView <TextView
android:id="@+id/tv_relation"
android:layout_width="@dimen/dp_27" android:layout_width="@dimen/dp_27"
android:layout_height="@dimen/dp_15" android:layout_height="@dimen/dp_15"
android:textSize="@dimen/sp_9" android:textSize="@dimen/sp_9"
android:textColor="@color/col_6ea" android:textColor="@color/col_6ea"
android:gravity="center"
android:background="@drawable/shape_r7_3fe_8f6" android:background="@drawable/shape_r7_3fe_8f6"
tools:text="本人" tools:text="本人"
android:layout_marginLeft="@dimen/dp_5"/> android:layout_marginLeft="@dimen/dp_5"/>
@ -52,6 +52,7 @@
<TextView <TextView
android:id="@+id/tv_power"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_12"
@ -70,10 +71,11 @@
android:textStyle="bold" android:textStyle="bold"
android:gravity="center" android:gravity="center"
android:id="@+id/tv_current_time" android:id="@+id/tv_current_time"
android:textSize="@dimen/sp_10"
android:layout_toLeftOf="@+id/tv_watch" android:layout_toLeftOf="@+id/tv_watch"
android:layout_marginRight="@dimen/dp_9" android:layout_marginRight="@dimen/dp_9"
android:background="@drawable/shape_r12_stroke_02c" android:background="@drawable/shape_r12_stroke_02c"
android:layout_alignParentEnd="true"/> />
<TextView <TextView
android:id="@+id/tv_watch" android:id="@+id/tv_watch"
@ -82,6 +84,7 @@
android:text="查看" android:text="查看"
android:textColor="@color/col_02c" android:textColor="@color/col_02c"
android:textStyle="bold" android:textStyle="bold"
android:textSize="@dimen/sp_10"
android:gravity="center" android:gravity="center"
android:background="@drawable/shape_r12_stroke_02c" android:background="@drawable/shape_r12_stroke_02c"
android:layout_alignParentEnd="true"/> android:layout_alignParentEnd="true"/>
@ -92,6 +95,9 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4"
android:layout_marginRight="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_8"
android:id="@+id/recycler"/> android:id="@+id/recycler"/>
<TextView <TextView
@ -109,18 +115,37 @@
android:id="@+id/tv_add_cancel"/> android:id="@+id/tv_add_cancel"/>
<LinearLayout <LinearLayout
android:id="@+id/ll_avatar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:visibility="visible"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_13"
android:orientation="horizontal"> android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_avator_recy" android:id="@+id/user_avatar_recycler"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<TextView <TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:layout_marginLeft="@dimen/dp_7"
android:textSize="@dimen/sp_13"/> android:textSize="@dimen/sp_13"/>
<TextView
android:id="@+id/tv_watch_him"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查看当前状况"
android:textSize="@dimen/sp_13"
android:textColor="@color/col_c7c"
android:drawableRight="@mipmap/icon_arrow_right"
android:layout_marginBottom="@dimen/dp_3"
android:drawablePadding="@dimen/dp_5"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

@ -3,27 +3,30 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center" android:gravity="center"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_71"
android:layout_height="wrap_content"> android:layout_height="@dimen/dp_71">
<ImageView <ImageView
android:layout_width="@dimen/dp_17" android:layout_width="@dimen/dp_19"
android:layout_height="@dimen/dp_17" android:layout_height="@dimen/dp_19"
android:id="@+id/img_target"/> android:id="@+id/img_target"/>
<TextView <TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:layout_marginTop="@dimen/dp_8"
tools:text="血氧" tools:text="血氧"
android:textSize="@dimen/sp_13"/> android:textSize="@dimen/sp_13"/>
<TextView <TextView
android:id="@+id/tv_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
tools:text="42345步" tools:text="42345步"
android:textSize="@dimen/sp_14"/> android:textSize="@dimen/sp_10"/>
</LinearLayout> </LinearLayout>

@ -6,6 +6,7 @@ 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
import com.xty.common.arouter.RouteManager
import com.xty.common.getImageUrl import com.xty.common.getImageUrl
import com.xty.common.setImage import com.xty.common.setImage
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
@ -33,7 +34,25 @@ class AboutAct: BaseVmAct<AboutVm>() {
statusBar(binding.title.mView) statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() } binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = getString(R.string.about) binding.title.mTvTitle.text = getString(R.string.about)
mViewModel.getAbout()
binding.mVersion.text="版本号: V${packageManager.getPackageInfo(this.packageName,0).versionName}"
binding.tvUserPrivate.setOnClickListener {
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)
}
binding.tvPrivate.setOnClickListener {
bundle.clear()
bundle.putString("title", "隐私政策")
bundle.putBoolean("isAgree", false)
bundle.putString("url","https://dc.zhongjian365.com/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
// mViewModel.getAbout()
binding.mVersion.setOnClickListener { binding.mVersion.setOnClickListener {
openLogFlag++ openLogFlag++
@ -48,13 +67,7 @@ class AboutAct: BaseVmAct<AboutVm>() {
mViewModel.prevLive.observe(this){ mViewModel.prevLive.observe(this){
if (!ArrayUtils.isEmpty(it.data)){ if (!ArrayUtils.isEmpty(it.data)){
it.data[0].let { it.data[0].let {
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.mPhone.text=Html.fromHtml(String.format(getString(R.string.about_info),"联系电话:",it.phone))
binding.mEmail.text=Html.fromHtml(String.format(getString(R.string.about_info),"邮箱地址:",it.email))
binding.mCode.apply {
setImage(context,getImageUrl(it.qrCode))
}
} }
} }

@ -58,7 +58,7 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
if (userBean != null) { if (userBean != null) {
user = userBean as SettingBean.User user = userBean as SettingBean.User
} }
userId = intent.getStringExtra("userId") // userId = intent.getStringExtra("userId")
} }
override fun initView() { override fun initView() {
@ -79,16 +79,17 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
} }
} }
user?.let { user?.let {
binding.mNickName.text = "设备名称:${it.watchName}" mViewModel.getUserDeviceInfo(it.id)
/* binding.mNickName.text = "设备名称:${it.watchName}"
binding.mNum.text = "设备地址:${it.bluetooth}" binding.mNum.text = "设备地址:${it.bluetooth}"
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 {
mViewModel.getUserDeviceInfo(userId!!)
} }
@ -115,6 +116,8 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
}, 8, span.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE) }, 8, span.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
binding.tvContactKefu.text = span
} }
@ -127,8 +130,8 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
Const.watchType = -1//将手表型号恢复初始值 Const.watchType = -1//将手表型号恢复初始值
Const.battery = ""//电池信息恢复初始值 Const.battery = ""//电池信息恢复初始值
MMkvHelper.remove(Const.Blue_Tooth)//清除蓝牙信息 MMkvHelper.remove(Const.Blue_Tooth)//清除蓝牙信息
YCBBlueConnectHelper.disconnect() /* YCBBlueConnectHelper.disconnect()
YCBBlueConnectHelper.cancelTimer() YCBBlueConnectHelper.cancelTimer()*/
MMkvHelper.clearWhatchInfo()//删除手表信息 MMkvHelper.clearWhatchInfo()//删除手表信息
EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息 EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息
EventBus.getDefault().post(MyInfoEvent()) //刷新个人信息 EventBus.getDefault().post(MyInfoEvent()) //刷新个人信息
@ -140,7 +143,7 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
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.activationTime?:""}"
binding.mActiveCode.visibility = View.VISIBLE binding.mActiveCode.visibility = View.VISIBLE
setDevicePic(it.data.deviceType, binding.ivDevice) setDevicePic(it.data.deviceType, binding.ivDevice)

@ -148,10 +148,10 @@ class SettingNewAct: BaseVmAct<SettingVm>() {
MyRetrofit.get().BLUETOOTH_MAC = ""//清除蓝牙信息 MyRetrofit.get().BLUETOOTH_MAC = ""//清除蓝牙信息
MMkvHelper.remove(Const.Blue_Tooth)//清除蓝牙信息 MMkvHelper.remove(Const.Blue_Tooth)//清除蓝牙信息
MMkvHelper.clearUserInfo()//清除用户登录信息 MMkvHelper.clearUserInfo()//清除用户登录信息
YCBBlueConnectHelper.disconnect()//断开蓝牙连接 /*YCBBlueConnectHelper.disconnect()//断开蓝牙连接
YCBBlueConnectHelper.cancelTimer()//断开重连定时器 YCBBlueConnectHelper.cancelTimer()//断开重连定时器*/
EventBus.getDefault().post(LoginOutEvent()) EventBus.getDefault().post(LoginOutEvent())
EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息 // EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
finish() finish()
} }

@ -2,6 +2,7 @@ package com.zj365.mime.adapter
import android.content.Context import android.content.Context
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.text.Html
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.CheckBox import android.widget.CheckBox
@ -39,7 +40,7 @@ class MessageAdapter():BaseAdapter<Any>(R.layout.item_message) {
// }else // }else
if(item is MessageTypeDataBean.MessageTypeBean){ if(item is MessageTypeDataBean.MessageTypeBean){
holder.setGone(R.id.mRelMsg,false).setGone(R.id.mChat,true) holder.setGone(R.id.mRelMsg,false).setGone(R.id.mChat,true)
holder.setText(R.id.mContent,item.notifyContent) holder.setText(R.id.mContent, Html.fromHtml(item.notifyContent))
.setText(R.id.mTvTime,RxTimeTool.milliseconds2String(item.notifyCreateTime)) .setText(R.id.mTvTime,RxTimeTool.milliseconds2String(item.notifyCreateTime))
.setText(R.id.notifyTitle,item.notifyTitle) .setText(R.id.notifyTitle,item.notifyTitle)
// changeStatus(holder.getView(R.id.mContent),item.notifyStatus) // changeStatus(holder.getView(R.id.mContent),item.notifyStatus)

@ -23,14 +23,14 @@
android:layout_height="@dimen/dp_76" android:layout_height="@dimen/dp_76"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_43" android:layout_marginTop="@dimen/dp_43"
android:src="@mipmap/ic_logo" /> android:src="@mipmap/icon_about_logo" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_18" android:layout_marginTop="@dimen/dp_18"
android:text="@string/app_name" android:text="中建356"
android:textColor="@color/col_455" android:textColor="@color/col_455"
android:textSize="@dimen/sp_17" android:textSize="@dimen/sp_17"
android:textStyle="bold" /> android:textStyle="bold" />
@ -43,8 +43,35 @@
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
android:text="版本号" android:text="版本号"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textStyle="bold"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_15" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_30"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户协议"
android:textColor="@color/col_02c"
android:textStyle="bold"
android:textSize="@dimen/sp_15"
android:id="@+id/tv_user_private"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="隐私协议"
android:textColor="@color/col_02c"
android:textStyle="bold"
android:textSize="@dimen/sp_15"
android:layout_marginLeft="@dimen/dp_23"
android:id="@+id/tv_private"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/tec_support" android:id="@+id/tec_support"
@ -55,7 +82,7 @@
android:layout_marginBottom="@dimen/dp_45" android:layout_marginBottom="@dimen/dp_45"
android:layout_marginStart="@dimen/dp_20" android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_20"
android:text="技术支持:湖南中健三六五健康科技有限公司" android:text="技术支持:湖南安瑜健康科技有限公司"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_15" />
@ -75,106 +102,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
android:text="湖南中健三六五健康科技有限公司 版权所有" android:text="中健三六五健康科技有限公司 版权所有"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_13" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:text="湘ICP备2020020856号" android:text="ICP备案京ICP备2021023958号"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_13" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:text="客服电话400-855-0285" android:text="客服电话4000063365"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_13" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/white"
android:visibility="gone"
android:orientation="vertical">
<TextView
android:id="@+id/mWebSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="公司官网"
android:textColor="@color/col_919"
android:textSize="@dimen/dp_15" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/col_f1f" />
<TextView
android:id="@+id/mPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="联系电话"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_15" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/col_f1f" />
<TextView
android:id="@+id/mEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="邮箱地址"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_15" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/col_f1f" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="公众号:"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_15" />
<ImageView
android:id="@+id/mCode"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_margin="@dimen/dp_10" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

@ -1702,4 +1702,41 @@ interface ApiInterface {
*/ */
@POST("customer/family/addFamily") @POST("customer/family/addFamily")
suspend fun addFamilyGuardian(@Body rb: RequestBody): RespBody<Any> suspend fun addFamilyGuardian(@Body rb: RequestBody): RespBody<Any>
/**
* 家人健康列表
*/
@POST("customer/family/familyList")
suspend fun getFamilyList(@Body rb:RequestBody) : RespBody<MutableList<FamilyHealthBean>>
/**
* 退出监护
*/
@GET("customer/family/remove")
suspend fun exitCustody(@Query("id") id: String): RespBody<Any>
/**
* 获取演示模式
*/
@POST("customer/user/isDemonstrate")
suspend fun getIsDemonstrate(@Body rb:RequestBody):RespBody<String>
/**
* 查询被邀请监护人信息
*/
@POST("customer/family/findConfirmInfo")
suspend fun findConfirmInfo(@Body rb:RequestBody):RespBody<InviteCustodyBean>
/**
* 确认邀请
*/
@POST("customer/family/confirmInfo")
suspend fun confirmInvited(@Body rb:RequestBody):RespBody<Any>
/**
* 获取设备型号
*/
@POST("customer/user/getDeviceTypeList")
suspend fun getDeviceTypeList(@Body rb:RequestBody):RespBody<MutableList<DeviceBean>>
} }

@ -1,3 +1,3 @@
package com.xty.network.model package com.xty.network.model
data class DeviceBean(val resId:Int,val name:String,val type:Int) data class DeviceBean(val imageUrl:String,val watchTypeName:String,val watchType:Int,val deviceType:String)

@ -0,0 +1,24 @@
package com.xty.network.model
data class FamilyHealthBean (
var id:Long,
var userId:Long,
var name:String,
var relation:String, //关系
var avatarUrl:String,
var isMy:Int, //是否本人01
var power:String?, //电量
var dataList: ArrayList<FamilyTargetBean> ,//数据列表
var avatarList:ArrayList<String>?
) {
data class FamilyTargetBean(
var name:String,//名称
var type:Int, //类型1心率2血氧3.呼吸率4.体温5血压6.步数7血糖8尿酸
var status:Int,//状态0异常1正常
var value:String //值
){
}
}

@ -0,0 +1,4 @@
package com.xty.network.model
data class InviteCustodyBean(val phone:String,val id:String) {
}
Loading…
Cancel
Save