中建365

develop
wlh 2 years ago
parent 6ec8f7aa22
commit 67660c8782

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
<bytecodeTargetLevel target="11" />
</component>
</project>

@ -7,15 +7,26 @@
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/../TUIKit/TIMCommon/timcommon" />
<option value="$PROJECT_DIR$/../TUIKit/TUIChat/tuichat" />
<option value="$PROJECT_DIR$/../TUIKit/TUIContact/tuicontact" />
<option value="$PROJECT_DIR$/../TUIKit/TUIConversation/tuiconversation" />
<option value="$PROJECT_DIR$/../TUIKit/TUICore/tuicore" />
<option value="$PROJECT_DIR$/../TUIKit/TUIGroup/tuigroup" />
<option value="$PROJECT_DIR$/../TUIKit/TUIOfflinePush/tuiofflinepush" />
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/AYCrashGuard" />
<option value="$PROJECT_DIR$/Health" />
<option value="$PROJECT_DIR$/MPChartLib" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/base" />
<option value="$PROJECT_DIR$/common" />
<option value="$PROJECT_DIR$/mine" />
<option value="$PROJECT_DIR$/network" />
<option value="$PROJECT_DIR$/server" />
<option value="$PROJECT_DIR$/videocompressor" />
</set>
</option>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.6.21" />
<option name="version" value="1.7.10" />
</component>
</project>

@ -1,5 +1,5 @@
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

@ -59,13 +59,13 @@ android {
}
signingConfigs{
release {
/* release {
keyAlias 'healthUser'
keyPassword '123456'
storeFile file('./HealthUser.keyStore')
storeFile file('C:/Users/anyu-android/Desktop/user_keystore/HealthUser.keyStore')
storePassword '123456'
}
}*/
}
buildTypes {
@ -88,18 +88,40 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
/* kotlinOptions {
jvmTarget = '1.8'
}*/
viewBinding {
enabled = true
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation (name: 'ycbtsdk-release', ext: 'aar')
implementation (name: 'push-3.0.0', ext: 'aar')
implementation files('libs/bluetooth-mini-fatscale-2.9.5.jar')
implementation files('libs/bluetooth-mini-core-2.9.5.jar')
implementation project(':Health')
implementation project(':server')
implementation project(':mine')
// implementation project(':AYCrashGuard')
kapt rely.arouter_compiler
kapt rely.GifDrawable
kapt rely.xutil
implementation rely.arouter_compiler
}

@ -1,22 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.zj365.dc">
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Required 一些系统要求的权限,如访问网络等-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<!-- SDK2.1新增获取用户位置信息 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--蓝牙基本的权限-->
<!-- Request legacy Bluetooth permissions on older devices. -->
<!--<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />-->
<!-- true 表示手机必须支持BLE否则无法安装这里设置为false运行后在activity中检查 -->
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="false" />
<!--蓝牙搜索要用到权限-->
<!-- Needed only if your app looks for Bluetooth devices.
You must add an attribute to this permission, or declare the
ACCESS_FINE_LOCATION permission, depending on the results when you
check location usage in your app. -->
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
tools:ignore="SystemPermissionTypo" />
<!-- 只有当您的应用程序使用蓝牙扫描结果来获取物理位置时才需要 -->
<!-- Needed only if your app makes the device discoverable to Bluetooth
devices. -->
<!-- 允许当前蓝牙设备可以被其他蓝牙设备发现 -->
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTHCONNECT" />
<!--蓝牙连接要用到权限-->
<!-- Needed only if your app communicates with already-paired Bluetooth
devices. -->
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Optional for location -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- 用于开启 debug 版本的应用在6.0 系统上 层叠窗口权限 -->
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<!--用于访问wifi网络信息wifi信息会用于进行网络定位-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!--用于获取wifi的获取权限wifi信息会用来进行网络定位-->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!--用于读取手机当前的状态-->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!--用于写入缓存数据到扩展存储卡-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--用于申请调用A-GPS模块-->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<!--如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--如果您的应用需要后台定位权限且有可能运行在Android Q设备上,并且设置了target>28必须增加这个权限声明-->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!--极光推送角标权限-->
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE " />
<uses-sdk tools:overrideLibrary="com.yucheng.ycbtsdk" />
<application
android:name="com.xty.common.app.MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:largeHeap="true"
android:maxAspectRatio="2.4"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"
android:roundIcon="@mipmap/ic_logo"
android:supportsRtl="true"
android:theme="@style/Theme.Zhongjian">
<activity android:name=".MainActivity"
android:exported="true">
android:theme="@style/Theme.zhongjian"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup">
<activity
android:name=".activity.WelcomeAct"
android:exported="true"
android:theme="@style/app_start"
android:windowSoftInputMode="adjustNothing">
<intent-filter>
<action android:name="com.xty.splash" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.RegisterAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name=".activity.LoginAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.MainActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.xty.server.act.ScienceDetailAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.health.act.BindFamilyAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name=".activity.DeviceChoiceAct"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.SettingAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MyInfoAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.DevInfoAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name="com.zj365.mime.act.MyIntegralAct"
android:launchMode="singleTop"
android:screenOrientation="portrait"/>
<activity
android:name="com.zj365.mime.act.NickNameAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.ChangePwdAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.AboutAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.DeviceSettingAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.WearManagerAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.WaterRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.DonotRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.SitRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.SportRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.HeartRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MedicationRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.HeartSpeedRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.HeartLowRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.HeartSportRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.OoRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.PersonInfoAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.TempRemindAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.NoticeSettingAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MyProgAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MyOrganAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.DontDisturbAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.FeedBackAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.BaseInfoChangeAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.ProgeammeDetailOldAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MsgReceiveAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MyKeeperAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.AgreementAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.ChangePhoneAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.FeedBackListAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity
android:name="com.zj365.mime.act.MessageDetailAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application>
</manifest>

@ -1,13 +0,0 @@
package com.zj365.dc
import android.app.Activity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
d:
c
class MainActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}

@ -0,0 +1,106 @@
package com.zj365.dc.activity
import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.tamsiree.rxkit.RxActivityTool
import com.xty.base.act.BaseVmAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission
import com.xty.network.model.DeviceBean
import com.zj365.dc.R
import com.zj365.dc.adapter.DeviceChoiceAdapter
import com.zj365.dc.databinding.ActDeviceChoiceBinding
import com.zj365.dc.vm.DeviceChoiceVm
import com.zj365.mime.weight.FactorySettingDialog
/**
* 选择手表型号
*/
@Route(path = ARouterUrl.DEVICE_CHOICE)
class DeviceChoiceAct : BaseVmAct<DeviceChoiceVm>() {
val binding by lazy { ActDeviceChoiceBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private val deviceAdapter by lazy { DeviceChoiceAdapter() }
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 initData() {
super.initData()
isLogin = intent.getBooleanExtra("isLogin", false)
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
// binding.title.titleBg.setBackgroundColor(ContextCompat.getColor(this, R.color.white))
binding.title.mTvTitle.text = getString(R.string.activity_chocie_device)
binding.title.mIvBack.setOnClickListener {
if (isLogin) { //如果是走注册流程过来的,退出该界面,则进入主界面
RouteManager.goAct(ARouterUrl.MAIN_ACT)
RxActivityTool.finishAllActivity()
} else {
finish()
}
}
binding.rlvData.apply {
layoutManager = LinearLayoutManager(this@DeviceChoiceAct)
adapter = deviceAdapter
}
deviceAdapter.setNewInstance(data)
deviceAdapter.setOnItemClickListener { adapter, _, position ->
val device = adapter.data[position] as DeviceBean
val type = device.type
if (type != 0) {
bundle.clear()
bundle.putInt("type", type)
bundle.putBoolean("isLogin", isLogin)
RouteManager.goAct(ARouterUrl.DEVICE_ACTIVE, bundle)
} else {
if (!checkBlueConnectPermission(this)) {
FactorySettingDialog(this, "蓝牙手表需要访问位置、蓝牙权限。") {
getBluePermission(baseContext) {
if (it) {
bundle.clear()
bundle.putInt("type", type)
bundle.putBoolean("isLogin", isLogin)
RouteManager.goAct(ARouterUrl.DEVICE_ACTIVE, bundle)
}
}
}.show()
} else {
bundle.clear()
bundle.putInt("type", type)
bundle.putBoolean("isLogin", isLogin)
RouteManager.goAct(ARouterUrl.DEVICE_ACTIVE, bundle)
}
}
}
}
override fun onBackPressed() {
super.onBackPressed()
if (isLogin) { //如果是走注册流程过来的,退出该界面,则进入主界面
RouteManager.goAct(ARouterUrl.MAIN_ACT)
RxActivityTool.finishAllActivity()
} else {
super.onBackPressed()
}
}
}

@ -1,4 +1,4 @@
package com.xty.healthuser.act
package com.zj365.dc.activity
import android.graphics.Color
import android.text.*
@ -11,7 +11,7 @@ import android.widget.EditText
import androidx.core.content.ContextCompat
import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.hjq.toast.ToastUtils
import com.androidkun.xtablayout.XTabLayout
import com.tamsiree.rxkit.RxKeyboardTool
import com.tamsiree.rxkit.RxRegTool
import com.tencent.qcloud.tuicore.TUILogin
@ -19,15 +19,13 @@ import com.tencent.qcloud.tuicore.interfaces.TUICallback
import com.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog
import com.xty.common.*
import com.xty.common.MMkvHelper.mmkv
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.event.MyInfoEvent
import com.xty.common.event.WxLoginEvent
import com.xty.healthuser.R
import com.xty.healthuser.databinding.ActLoginBinding
import com.xty.healthuser.vm.LoginVm
import com.xty.common.util.CommonToastUtils
import com.xty.network.model.WxInfoBean
import com.zj365.dc.databinding.ActLoginBinding
import com.zj365.dc.vm.LoginVm
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.*
@ -42,6 +40,8 @@ class LoginAct : BaseVmAct<LoginVm>() {
val binding by lazy { ActLoginBinding.inflate(layoutInflater) }
val timeLive by lazy { MutableLiveData<String>() }
var wxBean: WxInfoBean? = null
var tabName = arrayOf("账号密码","验证码")
val dialog by lazy {
AppUpdateDialog(this){
if (it){
@ -49,6 +49,8 @@ class LoginAct : BaseVmAct<LoginVm>() {
}
}
}
var isSelectTab = 0 //0 账号密码 1 验证码
private val USER_AGREEMENT = 10000
override fun setLayout(): View = binding.root
@ -61,18 +63,21 @@ class LoginAct : BaseVmAct<LoginVm>() {
override fun initView() {
super.initView()
binding.mRegister.setOnClickListener {
// RouteManager.goAct(ARouterUrl.INFO_SIMPLE)
RouteManager.goAct(ARouterUrl.REGIST_ACT)
}
binding.tvReturn.setOnClickListener {
finish()
}
binding.mLogin.isSelected = true
binding.mLogin.setOnClickListener {
RxKeyboardTool.hideSoftInput(this)
if (!binding.seleck.isSelected) {
ToastUtils.show(R.string.please_agree_all)
CommonToastUtils.showToast(getString(R.string.please_agree_all))
return@setOnClickListener
}
var phone = binding.mAccount.text.toString()
if (binding.mTvPswLogin.isSelected) { //密码登陆
if (isSelectTab == 0) { //密码登陆
var pwd = binding.mPsw.text.toString()
mViewModel.login(phone, pwd)
@ -113,14 +118,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
bundle.putString("title", "忘记密码")
RouteManager.goAct(ARouterUrl.CHANGE_PWD)
}
binding.mLoginWx.setOnClickListener {
if (!binding.seleck.isSelected) {
ToastUtils.show(R.string.please_agree_all)
return@setOnClickListener
}
WxUtils.signInWx()
}
initTab()
setPrv()
@ -129,14 +127,13 @@ class LoginAct : BaseVmAct<LoginVm>() {
setTextWatcher(binding.mCode)
mViewModel.getVersionNew()
}
/**
* 隐私条款
*/
fun setPrv() {
var txtCol = ContextCompat.getColor(this, R.color.col_009)
var txtCol = ContextCompat.getColor(this, R.color.col_313)
binding.seleck.setOnClickListener {
it.isSelected = !it.isSelected
}
@ -195,18 +192,49 @@ class LoginAct : BaseVmAct<LoginVm>() {
timer!!.schedule(task, 0, 1000)
}
/**
* 初始化tab
*/
fun initTab() {
binding.mTvPswLogin.isSelected = true
tabName.forEach {
var tab = binding.tabTitle.newTab()
tab.text = it
binding.tabTitle.addTab(tab)
}
binding.tabTitle.setOnTabSelectedListener(object : XTabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: XTabLayout.Tab?) {
var filed = tab!!.javaClass.getDeclaredField("mView")
filed.isAccessible = true
var tabView = filed.get(tab) as View
if (tabView.isPressed) {
isSelectTab = tab.position
if(tab.position == 1){
binding.mRelPwd.visibility = View.GONE
binding.mRelCode.visibility = View.VISIBLE
getNowLoginStatus()
}else{
binding.mRelPwd.visibility = View.VISIBLE
binding.mRelCode.visibility = View.GONE
getNowLoginStatus()
}
}
}
override fun onTabUnselected(tab: XTabLayout.Tab?) {
}
override fun onTabReselected(tab: XTabLayout.Tab?) {
}
})
/*binding.mTvPswLogin.isSelected = true
binding.mTvPswLogin.setOnClickListener {
binding.mTvCodeLogin.isSelected = false
it.isSelected = true
binding.mRelPwd.visibility = View.VISIBLE
binding.mRelCode.visibility = View.GONE
getNowLoginStatus()
}
binding.mTvCodeLogin.setOnClickListener {
binding.mTvPswLogin.isSelected = false
@ -214,7 +242,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
binding.mRelPwd.visibility = View.GONE
binding.mRelCode.visibility = View.VISIBLE
getNowLoginStatus()
}
}*/
}
//添加监听
@ -235,7 +263,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
//判断登陆按钮状态
fun getNowLoginStatus() {
var ac = binding.mAccount.text.toString()
if (binding.mTvPswLogin.isSelected) { //密码登陆
if (isSelectTab == 0) { //密码登陆
var pwd = binding.mPsw.text.toString()
binding.mLogin.isSelected = ac.isNotEmpty() && pwd.isNotEmpty()
} else { //验证码登陆
@ -303,7 +331,6 @@ class LoginAct : BaseVmAct<LoginVm>() {
}
mViewModel.wxLoginInfo.observe(this) {
wxBean = it
// ToastUtils.show("${it.sex}")
mViewModel.loginWx(it)
}
@ -315,7 +342,7 @@ class LoginAct : BaseVmAct<LoginVm>() {
mViewModel.updateLive.observe(this) {
if (!it.data.url.isNullOrEmpty()) {
dialog.showUploadDialog(it.data.url!!, it.data.log, it.data.isupdate){}
dialog.showUploadDialog(it.data.url!!, it.data.log, it.data.versionName,it.data.isupdate){}
}
}
}
@ -325,7 +352,6 @@ class LoginAct : BaseVmAct<LoginVm>() {
timer?.cancel()
}
fun setErrorMsg(error: String) {
if (error.isEmpty()) {
binding.mError.visibility = View.GONE

@ -0,0 +1,439 @@
package com.zj365.dc.activity
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.cardview.widget.CardView
import androidx.fragment.app.Fragment
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import cn.jpush.android.api.JPushInterface
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSON
import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationMenuView
import com.lifesense.android.ble.core.serializer.AbstractMeasureData
import com.lifesense.android.ble.device.fatscale.model.WeightMeasureData
import com.tamsiree.rxkit.RxActivityTool
import com.tamsiree.rxkit.RxSPTool
import com.tencent.imsdk.v2.V2TIMManager
import com.tencent.qcloud.tim.tuiofflinepush.notification.TUIUtils
import com.tencent.qcloud.tuicore.TUIConstants
import com.tencent.qcloud.tuicore.TUILogin
import com.tencent.qcloud.tuicore.event.ShowSystemMessageEvent
import com.tencent.qcloud.tuicore.interfaces.TUICallback
import com.tencent.qcloud.tuikit.tuichat.config.TUIChatConfigs
import com.tencent.qcloud.tuikit.tuiconversation.classicui.page.TUIConversationFragment
import com.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog
import com.xty.base.vp2.VpAdapter
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.common.arouter.ARouterUrl
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.event.MeasureWeightEvent
import com.xty.common.event.MqttReceive
import com.xty.common.util.CommonToastUtils
import com.zj365.dc.BuildConfig
import com.zj365.dc.R
import com.zj365.dc.databinding.ActivityMainBinding
import com.zj365.dc.fragment.DynamicManagementFrag
import com.zj365.dc.fragment.HealthHomeFrag
import com.zj365.dc.fragment.MineFrag
import com.zj365.dc.vm.MainVm
import com.zj365.health.act.binddevice.BaseDeviceBindListAct
import com.zj365.health.act.binddevice.BlueUtil
import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.Date
@Route(path = ARouterUrl.MAIN_ACT)
class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
private val binding by lazy { ActivityMainBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private var isonNewIntent: Boolean = false
var isDemonstrate: Boolean = false
var imunreadCount = 0
var sysunreadCount = 0
var isDialogShow = false //是否已经弹出Dialog
private var unreadCountReceiver: BroadcastReceiver? = null
private var badegView: View? = null
private val dialog by lazy {
AppUpdateDialog(this) {
if (it) {
//finish()
}
}
}
private fun initUnreadCountReceiver() {
unreadCountReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val unreadCount = intent.getLongExtra(TUIConstants.UNREAD_COUNT_EXTRA, 0)
// if (unreadCount > 0) {
// isShowReadAllButton = true
imunreadCount = unreadCount.toInt()
setBadge(sysunreadCount + unreadCount.toInt())
// } else {
// isShowReadAllButton = false
// setBadge(unreadCount)
// }
}
}
val unreadCountFilter = IntentFilter()
unreadCountFilter.addAction(TUIConstants.CONVERSATION_UNREAD_COUNT_ACTION)
LocalBroadcastManager.getInstance(this)
.registerReceiver(unreadCountReceiver as BroadcastReceiver, unreadCountFilter)
}
private val listFragment by lazy {
listOf(
HealthHomeFrag(),
Fragment(),
DynamicManagementFrag(),
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()
)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun initView() {
super.initView()
//在离线登录的情况下查询
initVp2()
initBottomNav()
addNv()
// 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()
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") {
""
} else {
MMkvHelper.getLong(Const.USER_ID).toString()
}
mViewModel.getUserEquipmentInformationizationRequest(userId)
mViewModel.getBindList(BaseDeviceBindListAct.DeviceType.BODYFAT.type)
}
fun getUnReadMessage() {
mViewModel.getNotReadCount()
}
private fun initBleSDK() {
BlueUtil.getBlueManage().setDebug(BuildConfig.isRelease)
BlueUtil.getBlueManage()
.init(
this,
"lx1f367d71ff67ca73",
"a713f5e2fa03ec19476a3ac96287c4645986c4c6",
null,
this
)
}
fun initVp2() {
binding.mVp2.adapter = VpAdapter(listFragment, this)
binding.mVp2.isUserInputEnabled = false
binding.mVp2.offscreenPageLimit = 2
// binding.mVp2.currentItem = 0
}
fun initBottomNav() {
binding.mBottom.itemIconTintList = null //使用自己的图片切换
binding.mBottom.setOnNavigationItemSelectedListener {
when (it.itemId) {
R.id.nav_health -> {
binding.mVp2.setCurrentItem(0, false)
return@setOnNavigationItemSelectedListener true
}
R.id.nav_server -> {
binding.mVp2.setCurrentItem(1, false)
return@setOnNavigationItemSelectedListener true
}
R.id.nav_dynamic_management -> {
binding.mVp2.setCurrentItem(2, false)
return@setOnNavigationItemSelectedListener true
}
R.id.nav_message -> {
binding.mVp2.setCurrentItem(3, false)
return@setOnNavigationItemSelectedListener true
}
R.id.nav_mine -> {
binding.mVp2.setCurrentItem(4, false)
return@setOnNavigationItemSelectedListener true
}
}
false
}
binding.gifImageVIew.setOnClickListener {
if (binding.mBottom.selectedItemId == R.id.nav_dynamic_management) return@setOnClickListener
binding.mBottom.selectedItemId = R.id.nav_dynamic_management
}
}
override fun onResume() {
super.onResume()
getUnReadMessage()
}
override fun onNewIntent(intent: 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) {
binding.mVp2.setCurrentItem(position, false)
binding.mBottom.selectedItemId = R.id.nav_message
}
var nowTime = 0L
var oldTime = 0L
override fun onBackPressed() {
nowTime = System.currentTimeMillis()
if (oldTime == 0L) {
oldTime = nowTime
CommonToastUtils.showToast("再按一次退出程序")
} else if (nowTime - oldTime > 2000) {
oldTime = nowTime
CommonToastUtils.showToast("再按一次退出程序")
} else {
mainScope.launch {
delay(100)
RxActivityTool.AppExit(applicationContext)
}
super.onBackPressed()
}
}
override fun liveObserver() {
mViewModel.saveSuccess.observe(this) {
}
mViewModel.boundDevices.observe(this) {
if (it.code != 0) return@observe
val data = it.data
if (data.isNotEmpty()) {
if (checkBlueConnectPermission(this)) {
//体脂秤sdk初始化
initBleSDK()
if (BlueUtil.getBlueManage().isInitialized) {
it.data.forEach { bleData ->
BlueUtil.getBlueManage().addBondedMac(bleData.mac)
}
BlueUtil.getBlueManage().connectBondedDevices()
}
}
}
}
mViewModel.updateLive.observe(this) {
if (!it.data.url.isNullOrEmpty()) {
dialog.showUploadDialog(it.data.url!!, it.data.log,it.data.versionName ,it.data.isupdate) { show ->
isDialogShow = show
}
}
}
//未读消息操作
mViewModel.countLive.observe(this) {
setUnreadcount(it.data.count)
EventBus.getDefault()
.post(ShowSystemMessageEvent(it.data.msg, it.data.time, it.data.count))
if (it.data.count > 0) {
RxSPTool.putString(this, Const.UnReadSysMessageContentKey, it.data.msg)
RxSPTool.putString(this, Const.UnReadSysMessageTimeKey, it.data.time)
}
}
mViewModel.getImUserSig.observe(this) {
Log.e("simon", it.data)
TUILogin.login(
applicationContext,
1400807230,
it.paramsData,
it.data,
object : TUICallback() {
override fun onSuccess() {
Log.e("simon", "登陆成功")
TUIChatConfigs.getConfigs().generalConfig.isEnableWelcomeCustomMessage =
false
handleOfflinePush(intent)
}
override fun onError(errorCode: Int, errorMessage: String?) {
}
})
}
//获取用户设备信息网络请求返回
mViewModel.getUserEquipmentInformationization.observe(this) {
if (it.code != 0) {
CommonToastUtils.showLoserToast("获取设备信息失败")
}
when (it.data.bindStatus) {
0 -> {
binding.mVp2.currentItem = 0
binding.mBottom.selectedItemId = R.id.nav_health
}
1 -> {
binding.mVp2.currentItem = 2
binding.mBottom.selectedItemId = R.id.nav_dynamic_management
}
else -> {
binding.mVp2.currentItem = 0
binding.mBottom.selectedItemId = R.id.nav_health
}
}
}
}
private fun addNv() {
val menuView = binding.mBottom.getChildAt(0) as BottomNavigationMenuView
//这里就是获取所添加的每一个Tab(或者叫menu)
val tab = menuView.getChildAt(3) as BottomNavigationItemView
//加载我们的角标View新创建的一个布局
badegView = LayoutInflater.from(this).inflate(R.layout.item_msg_count, tab, true)
}
fun setUnreadcount(data: Int) {
sysunreadCount = data
setBadge(imunreadCount + data)
}
private fun setBadge(num: Int) {
badegView?.let {
var tv = it.findViewById<TextView>(R.id.mBadge)
var carrdView = it.findViewById<CardView>(R.id.mCard)
if (num > 0) {
tv.visibility = View.VISIBLE
tv.text = if (num > 99) "99+" else "$num"
tv.post {
val layoutParams = tv.layoutParams as ViewGroup.LayoutParams
val text = tv.text.toString()
carrdView.radius = tv.height / 2f
var textWidth = tv.paint.measureText(text)
if (tv.height >= textWidth) { //等宽高的圆形
layoutParams.width = tv.height
} else { //宽高不等 将宽度两边加10
layoutParams.width = textWidth.toInt() + 20
}
tv.layoutParams = layoutParams
}
} else {
tv.visibility = View.GONE
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun reveiveMsg(event: MqttReceive) {
}
override fun accept(abstractMeasureData: AbstractMeasureData) {
if (abstractMeasureData is WeightMeasureData) {
if (!abstractMeasureData.isProcessingData) {
Log.i("LS-Bluetooth", "收到测量过程数据:${JSON.toJSONString(abstractMeasureData)}")
val deviceInfo = abstractMeasureData.deviceInfo
mViewModel.saveWeight(
abstractMeasureData.weight,
abstractMeasureData.resistance50K,
deviceInfo.sn
)
EventBus.getDefault()
.post(MeasureWeightEvent(JSON.toJSONString(abstractMeasureData)))
return
}
}
}
override fun onDestroy() {
super.onDestroy()
BlueUtil.getBlueManage().releaseResource()
}
}

@ -0,0 +1,330 @@
package com.zj365.dc.activity
import android.content.Intent
import android.graphics.Color
import android.text.*
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import android.text.style.ClickableSpan
import android.view.View
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.tamsiree.rxkit.RxKeyboardTool
import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper
import com.xty.base.act.BaseVmAct
import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.common.MyLinkedMovementMethod
import com.xty.common.TimeSelect
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonToastUtils
import com.xty.common.xqr_code.XQRCodeAct
import com.xuexiang.xqrcode.XQRCode
import com.zj365.dc.R
import com.zj365.dc.databinding.ActRegisterBinding
import com.zj365.dc.model.SimpleInfoBean
import com.zj365.dc.vm.RegisterVm
import java.util.*
/**
* 注册
*/
@Route(path = ARouterUrl.REGIST_ACT)
class RegisterAct : BaseVmAct<RegisterVm>() {
val binding by lazy { ActRegisterBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
val timeLive by lazy { MutableLiveData<String>() }
private var timeNow = Const.timeBack
private var timer: Timer? = null
private val USER_AGREEMENT = 10000
private val PRIVACY = 10001
private var isAgreement = false
private var isPrivacy = false
private var birthdayType = 1
private val timeSelect by lazy { TimeSelect(this) {} }
var bean: SimpleInfoBean? = null
override fun initData() {
super.initData()
isDarkBar = true
// bean=intent.extras!!.getSerializable("bean") as SimpleInfoBean
}
override fun initView() {
super.initView()
timeSelect.startDate.set(1922, 0, 1)
getTextWatch(binding.mAccount)
getTextWatch(binding.mCode)
getTextWatch(binding.mPsw)
binding.mRegister.isSelected = false
binding.mRegister.isEnabled = false
binding.mTvCode.apply {
isSelected = true
setOnClickListener {
val trim = binding.mAccount.text.toString().trim()
if (trim.length == 11) {
mViewModel.sendCode(trim)
} else {
CommonToastUtils.showToast(R.string.please_input_ok_phone)
}
}
}
binding.tvReturn.setOnClickListener {
finish()
}
binding.mShow.setOnClickListener {
if (it.isSelected) {
binding.mPsw.transformationMethod = PasswordTransformationMethod.getInstance()
} else {
binding.mPsw.transformationMethod = HideReturnsTransformationMethod.getInstance();
}
it.isSelected = !it.isSelected
var txtLength = binding.mPsw.text.toString().trim().length
binding.mPsw.setSelection(txtLength)
}
binding.mRegister.setOnClickListener {
RxKeyboardTool.hideSoftInput(this)
if (!binding.mPrivate.isSelected) {
CommonToastUtils.showToast(R.string.please_agree_all)
return@setOnClickListener
}
var organCode = ""
var invitePhone = ""
val phone = binding.mAccount.text.toString().trim()
val code = binding.mCode.text.toString().trim()
val pwd = binding.mPsw.text.toString().trim()
mViewModel.register(
phone,
code,
pwd,
null,
null,
bean,
invitePhone
)
}
binding.mPrivate.setOnClickListener {
if (!isAgreement) {
CommonToastUtils.showToast(R.string.please_agree_user)
return@setOnClickListener
}
if (!isPrivacy) {
CommonToastUtils.showToast(R.string.please_agree_prv)
return@setOnClickListener
}
it.isSelected = !it.isSelected
}
setPrv()
}
/**
* 隐私条款
*/
private fun setPrv() {
var txtCol = ContextCompat.getColor(this, R.color.col_313)
binding.mPrivate.movementMethod = MyLinkedMovementMethod().getInstance()
var span = SpannableString(getString(R.string.private_info))
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1)
RouteManager.goActRequest(
ARouterUrl.RICH_TEXT,
this@RegisterAct,
USER_AGREEMENT,
bundle
)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
}
}, 2, 8, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
bundle.clear()
bundle.putString("title", "隐私政策")
bundle.putString("url", "https://auprty.com/app/static/app/privacy.html")
RouteManager.goActRequest(
ARouterUrl.AGREEMNT_READ_WEB_ACT,
this@RegisterAct,
PRIVACY,
bundle
)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
ds.clearShadowLayer()
}
}, 9, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
binding.mPrivate.text = span
binding.mPrivate.highlightColor = Color.TRANSPARENT
}
private fun timeStart() {
timer = Timer()
var task = object : TimerTask() {
override fun run() {
timeLive.postValue("")
}
}
timer!!.schedule(task, 0, 1000)
}
override fun liveObserver() {
mViewModel.registerVm.observe(this) {
CommonToastUtils.showSucceedToast("注册成功")
setResult(RESULT_OK)
finish()
val phone = binding.mAccount.text.toString().trim()
val password = binding.mPsw.text.toString().trim()
bundle.clear()
bundle.putString("phone", phone)
bundle.putString("password", password)
RouteManager.goAct(ARouterUrl.INFO_SIMPLE, bundle)
}
mViewModel.codeLive.observe(this) {
timeStart()
binding.mTvCode.apply {
isEnabled = false
isSelected = false
}
}
timeLive.observe(this) {
--timeNow
if (timeNow > 0) {
binding.mTvCode.text = "${timeNow}"
} else {
timer!!.cancel()
binding.mTvCode.isSelected = true
binding.mTvCode.isEnabled = true
timeNow = Const.timeBack
binding.mTvCode.text = getString(R.string.get_code)
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == RESULT_OK) {
when (requestCode) {
USER_AGREEMENT -> {
isAgreement = true
if (!isPrivacy) {
bundle.clear()
bundle.putString("title", "隐私政策")
bundle.putInt("type", Const.AGREEMENT_3)
RouteManager.goActRequest(
ARouterUrl.RICH_TEXT,
this@RegisterAct,
PRIVACY,
bundle
)
}
}
PRIVACY -> {
isPrivacy = true
if (!isAgreement) {
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1)
RouteManager.goActRequest(
ARouterUrl.RICH_TEXT,
this@RegisterAct,
USER_AGREEMENT,
bundle
)
}
}
XQRCodeAct.QRCODE_AGREEMENT -> {/*
when (data!!.getIntExtra(XQRCode.RESULT_TYPE, 0)) {
XQRCode.RESULT_SUCCESS -> {
try {
val result = data.extras!!.getString(XQRCode.RESULT_DATA)
LogUtils.d("扫描结果:$result")
if (!result.isNullOrEmpty()) {
val gson = Gson()
//设置扫描结果
binding.jigouId.setText(result)
} else {
CommonToastUtils.showToast("扫码失败,请重试...")
}
} catch (e: Exception) {
LogUtils.e("二维码扫描:$e")
CommonToastUtils.showToast("请确认二维码是否正确!")
}
}
XQRCode.RESULT_FAILED -> {
LogUtils.d("扫描失败")
}
}*/
}
}
}
}
private fun getTextWatch(view: TextView) {
var watcher = object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
changeStatus()
}
}
view.setTag(watcher)
view.addTextChangedListener(watcher)
}
fun changeStatus() {
var phone = binding.mAccount.text.toString().trim()
var code = binding.mCode.text.toString().trim()
var pwd = binding.mPsw.text.toString().trim()
if (phone.isNotEmpty() && code.isNotEmpty() && pwd.isNotEmpty()) {
binding.mRegister.isSelected = true
binding.mRegister.isEnabled = true
} else {
binding.mRegister.isSelected = false
binding.mRegister.isEnabled = false
}
}
override fun onDestroy() {
super.onDestroy()
if (timer != null) {
timer!!.cancel()
}
}
}

@ -1,4 +1,4 @@
package com.xty.healthuser.act
package com.zj365.dc.activity
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
@ -8,11 +8,11 @@ import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.onEventObject
import com.xty.common.recycleUtils.RecycleItem
import com.xty.healthuser.adapter.WarningMessageAdapter
import com.xty.healthuser.vm.HealthVm
import com.xty.mime.R
import com.xty.mime.databinding.ActWarningMessageBinding
import com.xty.network.model.MessageBean
import com.zj365.dc.R
import com.zj365.dc.adapter.WarningMessageAdapter
import com.zj365.dc.vm.HealthVm
import com.zj365.mime.databinding.ActWarningMessageBinding
/**
* 我的预警消息

@ -1,4 +1,4 @@
package com.xty.healthuser.act
package com.zj365.dc.activity
import android.annotation.SuppressLint
import android.graphics.Bitmap
@ -13,7 +13,6 @@ import com.gyf.immersionbar.ImmersionBar
import com.tamsiree.rxkit.RxDeviceTool
import com.umeng.commonsdk.UMConfigure
import com.xty.base.act.BaseVmAct
import com.xty.common.BuildConfig
import com.xty.common.Const
import com.xty.common.JPushHelper
import com.xty.common.LogUtils
@ -26,9 +25,11 @@ import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.getImageUrl
import com.xty.common.util.CommonUtils
import com.xty.healthuser.databinding.ActWelcomeBinding
import com.xty.healthuser.vm.WelcomeVm
import com.xty.healthuser.weight.PrevDialog
import com.zj365.dc.BuildConfig
import com.zj365.dc.databinding.ActWelcomeBinding
import com.zj365.dc.vm.WelcomeVm
import com.zj365.dc.weight.PrevDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@ -115,32 +116,6 @@ class WelcomeAct : BaseVmAct<WelcomeVm>() {
} else {//上述都无信息,则展示默认欢迎界面
binding.mLinInfo.visibility = View.GONE
}
// if (MMkvHelper.contains(Const.ORGAN_ID)) {
// if ("5" == MMkvHelper.getString(Const.ORGAN_ID)) {//安瑜总部
// binding.mLinInfo.visibility = View.GONE
// getBgImage(getImageUrl(MMkvHelper.getString(Const.WELCOME_BG)))
// } else {
// if (MMkvHelper.contains(Const.WELCOME_IMG) && MMkvHelper.contains(Const.WELCOME_DESC)) {//欢迎语和logo都存在
// binding.mBg.setImageResource(R.mipmap.ic_welcome_bg)
// binding.mTxt.text = MMkvHelper.getString(Const.WELCOME_DESC)
// getLogoImage(getImageUrl(MMkvHelper.getString(Const.WELCOME_IMG)))
// binding.mLinInfo.visibility = View.VISIBLE
// } else if (MMkvHelper.contains(Const.WELCOME_DESC)) {//只有欢迎语
// binding.mBg.setImageResource(R.mipmap.ic_welcome_bg)
// binding.mTxt.text = MMkvHelper.getString(Const.WELCOME_DESC)
// binding.mLinInfo.visibility = View.VISIBLE
// } else if (MMkvHelper.contains(Const.WELCOME_IMG)) {//只有logo存在
// binding.mBg.setImageResource(R.mipmap.ic_welcome_bg)
// getLogoImage(getImageUrl(MMkvHelper.getString(Const.WELCOME_IMG)))
// binding.mLinInfo.visibility = View.VISIBLE
// } else {//上述都无信息,则展示默认欢迎界面
// binding.mLinInfo.visibility = View.GONE
// }
// }
// } else {
// binding.mLinInfo.visibility = View.GONE
// getBgImage(getImageUrl(MMkvHelper.getString(Const.WELCOME_BG)))
// }
if (MMkvHelper.contains(Const.Watch_Device_Type)) {
if (CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))) {
@ -167,11 +142,11 @@ class WelcomeAct : BaseVmAct<WelcomeVm>() {
}
private fun forwardNextPage() {
if (MMkvHelper.contains(Const.Auth_Token)) {
// if (MMkvHelper.contains(Const.Auth_Token)) {
RouteManager.goAct(ARouterUrl.MAIN_ACT)
} else {
/*} else {
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}
}*/
finish()
}
@ -231,16 +206,6 @@ class WelcomeAct : BaseVmAct<WelcomeVm>() {
private fun initUMeng() {
UMConfigure.submitPolicyGrantResult(MyApp.instance, true)
/*** 友盟sdk正式初始化*/
//友盟正式初始化
//初始化组件化基础库, 所有友盟业务SDK都必须调用此初始化接口。
UMConfigure.init(
MyApp.instance,
BuildConfig.umengKey,
BuildConfig.umengChannelName,
UMConfigure.DEVICE_TYPE_PHONE,
""
)
}
private fun initPush() {

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter
package com.zj365.dc.adapter
import android.content.Context
import android.util.SparseArray
@ -7,14 +7,14 @@ import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.xty.common.setBigImage
import com.xty.common.setImage
import com.xty.healthuser.R
import com.xty.healthuser.adapter.holder.ImageHolder
import com.xty.healthuser.adapter.holder.TitleHolder
import com.xty.healthuser.adapter.holder.VideoHolder
import com.xty.network.model.BannerBean
import com.youth.banner.adapter.BannerAdapter
import com.youth.banner.util.BannerUtils
import com.zj365.dc.R
import com.zj365.dc.adapter.holder.ImageHolder
import com.zj365.dc.adapter.holder.TitleHolder
import com.zj365.dc.adapter.holder.VideoHolder
/**

@ -1,10 +1,10 @@
package com.xty.healthuser.adapter
package com.zj365.dc.adapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.healthuser.R
import com.xty.network.model.DeviceBean
import com.zj365.dc.R
class DeviceChoiceAdapter:BaseAdapter<DeviceBean>(R.layout.item_device_choice) {

@ -0,0 +1,15 @@
package com.zj365.dc.adapter
import android.widget.TextView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.network.model.FamilyBean
import com.zj365.dc.R
class FamilyAdapter(var position:Int=-1):BaseAdapter<FamilyBean>(R.layout.item_family_name) {
override fun convert(holder: BaseViewHolder, item: FamilyBean) {
holder.getView<TextView>(R.id.mName).isSelected = position==holder.layoutPosition
holder.getView<TextView>(R.id.mIndiacator).isSelected = position==holder.layoutPosition
holder.setText(R.id.mName,item.fCall).setTextColorRes(R.id.mName,if(position==holder.layoutPosition) R.color.col_02c else R.color.col_C7C)
}
}

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter
package com.zj365.dc.adapter
import android.annotation.SuppressLint
import android.content.Context
@ -15,8 +15,8 @@ import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import com.tamsiree.rxkit.RxTimeTool
import com.xty.common.util.SpannableUtils
import com.xty.healthuser.R
import com.xty.network.model.HealthMonitoringListBean
import com.zj365.dc.R
import java.text.SimpleDateFormat
/**
@ -157,7 +157,7 @@ class HealthMonitoringAdapter(
buttonTime,
12,
ContextCompat.getColor(
context, R.color.col_25C
context, R.color.col_02c
),
Typeface.BOLD,
0,
@ -168,7 +168,7 @@ class HealthMonitoringAdapter(
}
}
// mView.setBackgroundResource(healthMonitoringListBean.buttonBg)
mBackground.setImageResource(healthMonitoringListBean.buttonBg)
// mBackground.setImageResource(healthMonitoringListBean.buttonBg) //颜色都是白色
mHealthIcon.setImageResource(healthMonitoringListBean.buttonIcon)
}
return convertView

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter
package com.zj365.dc.adapter
import android.graphics.Canvas
import android.graphics.Paint
@ -16,8 +16,8 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.getImageUrl
import com.xty.common.setImage
import com.xty.healthuser.R
import com.xty.network.model.ScienceBean
import com.zj365.dc.R
class ScienceAdapter:BaseAdapter<ScienceBean>(R.layout.item_scence) {

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter
package com.zj365.dc.adapter
import android.graphics.drawable.GradientDrawable
import android.view.View
@ -9,8 +9,8 @@ import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.tamsiree.rxkit.RxTimeTool
import com.xty.base.adapter.BaseAdapter
import com.xty.mime.R
import com.xty.network.model.MessageBean
import com.zj365.dc.R
import java.text.SimpleDateFormat

@ -0,0 +1,3 @@
package com.zj365.dc.adapter.holder;
data class HealthManageHolder(val type:Int,val desc:String)

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter.holder;
package com.zj365.dc.adapter.holder;
import android.view.View;
import android.widget.ImageView;

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter.holder;
package com.zj365.dc.adapter.holder;
import android.view.View;
import android.widget.ImageView;
@ -7,7 +7,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.xty.healthuser.R;
import com.zj365.dc.R;
public class ImageTitleHolder extends RecyclerView.ViewHolder {

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter.holder;
package com.zj365.dc.adapter.holder;
import android.view.View;
import android.widget.TextView;
@ -6,7 +6,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.xty.healthuser.R;
import com.zj365.dc.R;
public class TitleHolder extends RecyclerView.ViewHolder {

@ -1,4 +1,4 @@
package com.xty.healthuser.adapter.holder;
package com.zj365.dc.adapter.holder;
import android.view.View;
@ -6,7 +6,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
import com.xty.healthuser.R;
import com.zj365.dc.R;
public class VideoHolder extends RecyclerView.ViewHolder {
public StandardGSYVideoPlayer player;

@ -1,4 +1,4 @@
package com.xty.healthuser.fragment
package com.zj365.dc.fragment
import android.annotation.SuppressLint
import android.content.Intent
@ -16,7 +16,6 @@ import androidx.lifecycle.MutableLiveData
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.jpush.android.api.JPushInterface
import com.hjq.toast.ToastUtils
import com.tamsiree.rxkit.RxTimeTool
import com.xty.base.fragment.BaseVmFrag
import com.xty.base.utils.UserInfoDefin
@ -37,29 +36,31 @@ import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.FamilyEvent
import com.xty.common.event.Health24HourStatusEvent
import com.xty.common.event.MyInfoEvent
import com.xty.common.event.WorkManagerEvent
import com.xty.common.marqueen.SimpleMF
import com.xty.common.onEventObject
import com.xty.common.setImageUser
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.common.weight.CenterImageSpan
import com.xty.common.work.MyWorkManger
import com.xty.health.vm.ReportVm
import com.xty.health.weight.DialogTip
import com.xty.healthuser.BuildConfig
import com.xty.healthuser.R
import com.xty.healthuser.act.MainActivity
import com.xty.healthuser.adapter.FamilyAdapter
import com.xty.healthuser.adapter.HealthMonitoringAdapter
import com.xty.healthuser.databinding.FragDynamicManagementBinding
import com.xty.healthuser.model.DeviceInfoBean
import com.xty.healthuser.vm.DynamicManagementVm
import com.xty.healthuser.weight.AgainSignDialog
import com.xty.mime.weight.NoticeSettingDialog
import com.zj365.mime.weight.NoticeSettingDialog
import com.xty.network.MyRetrofit
import com.xty.network.model.FamilyBean
import com.xty.network.model.HealthMonitoringListBean
import com.xty.network.model.MessageBean
import com.xty.network.model.ReportBean
import com.zj365.dc.BuildConfig
import com.zj365.dc.R
import com.zj365.dc.activity.MainActivity
import com.zj365.dc.adapter.FamilyAdapter
import com.zj365.dc.adapter.HealthMonitoringAdapter
import com.zj365.dc.databinding.FragDynamicManagementBinding
import com.zj365.dc.model.DeviceInfoBean
import com.zj365.dc.vm.DynamicManagementVm
import com.zj365.dc.weight.AgainSignDialog
import com.zj365.health.vm.ReportVm
import com.zj365.health.weight.DialogTip
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@ -249,29 +250,29 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
10 -> { //血脂
// when (MMkvHelper.getString(Const.DEVICE_TYPE)) {
// "X1", "X2" -> {
// goPage(7)
// }
// "U32" -> {
// goPage(9)
// }
// "A3" -> {
// goPage(8)
// }
// else -> {
// goPage(10)
// }
// }
when (MMkvHelper.getString(Const.DEVICE_TYPE)) {
"X1", "X2" -> {
goPage(7)
}
"U32","" -> {
goPage(9)
}
"A3" -> {
goPage(8)
}
else -> {
goPage(7)
}
}
}
8 -> {//心电
// if (MMkvHelper.getInt(Const.Watch_Device_Type) == -1) { //演示模式
// ToastUtils.show("尊敬的用户您好,心电功能暂未开放,敬请期待哦~")
// showToast("尊敬的用户您好,心电功能暂未开放,敬请期待哦~")
// } else
if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表
ToastUtils.show("尊敬的用户您好,心电功能暂未开放,敬请期待哦~")
CommonToastUtils.showToast("尊敬的用户您好,心电功能暂未开放,敬请期待哦~")
} else {
goPage(8)
// if (showIdInfo.isEmpty()) {
@ -385,7 +386,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
// return@OnClickListener
// }
//// if (!canGoto24Healthresult) {
//// ToastUtils.show("数据不足或数据建模中,无法查看健康评估")
//// showToast("数据不足或数据建模中,无法查看健康评估")
//// return@OnClickListener
//// }
// CommonUtils.getMyUserInfo()?.apply {
@ -447,7 +448,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
mHealthAdapter.notifyDataSetChanged()
} else {
// ToastUtils.show("数据为空")
// showToast("数据为空")
}
}
//日报
@ -553,7 +554,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
RouteManager.goAct(ARouterUrl.HEALTHMAIN, bundle)
} else {
ToastUtils.show(R.string.please_bind_device)
CommonToastUtils.showToast(R.string.please_bind_device)
}
}
@ -1194,6 +1195,87 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
mFamilyAdapter.position = selectPosition
mFamilyAdapter.setNewInstance(it.data)
}
//手表信息组装上传
mViewModel.allDataInfo.observe(this) {
if (null == it || it["data"] == null || it["data"] !is ArrayList<*>) {
LogUtils.d("手表数据:暂时无数据...")
getXtInfo(showIdInfo)//如果手表没数据也需要获取获取血糖信息
get24HourReportInfo(showIdInfo)//如果手表没数据也需要获取24小时日报
return@observe
}
LogUtils.d("手表数据:全部信息开始上传...")
//是否为错误数据
var existError = false
val lists = it["data"] as ArrayList<Any>
val array = JSONArray()
lists.forEach { bean ->
val json = JSONObject()
val nowData = bean as java.util.HashMap<String, *>
val iterator = nowData.iterator()
while (iterator.hasNext()) {
val next = iterator.next()
val values = if (next.value is Long) (next.value as Long) / 1000 else next.value
when (next.key) {
"OOValue" -> json.put("ooValue", values)
"DBPValue" -> {
val sbp = nowData["SBPValue"] as Int
val dbp = nowData["DBPValue"] as Int
//医学上是大值 收缩压
//小值
json.put("sbpValue", min(sbp, dbp))
}
"SBPValue" -> {
//医学上是小值 舒张压
//大值
val sbp = nowData["SBPValue"] as Int
val dbp = nowData["DBPValue"] as Int
json.put("dbpValue", max(sbp, dbp))
}
else -> json.put(next.key, values)
}
}
if (json.has("startTime")) {
val times = json.get("startTime").toString().toLong()
if (times < 0 || times > System.currentTimeMillis() / 1000) { //错误数据 不使用
existError = true
} else {
array.put(json)
}
}
}
// //错误数据保存到本地日志
// if (existError) {
// saveFile(it.toString()) //存到本地日志
// }
LogUtils.d("手表数据array Length:${array.length()}")
if (array.length() > 0) {
// var lastJson = array[array.length() - 1] as JSONObject
// lastJson.put("original", it.toString())
mViewModel.uploadAllInfo(array)
}
}
//手表数据上传
mViewModel.uploadMultiple.observe(this) {
CommonToastUtils.showSucceedToast(R.string.upload_data_success)
// showSucceedToast(requireContext().getString(R.string.upload_data_success))
LogUtils.d("all data upload success ")
get24HourReportInfo(showIdInfo)//数据上传成功后获取24小时日报
getXtInfo(showIdInfo)//数据上传成功后获取血糖信息
YCBManager.deleteHistory(YCBOrder.DELETE_ALL) //删除 数据
mainScope.launch {
delay(500)
mViewModel.getAllInfo(showIdInfo, false)
}
}
}
private fun setTips(datas: List<String>) {
@ -1330,7 +1412,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
(selectStarImage.minimumHeight / 1.4).toInt()
)
var unSelectStarImage = context.getDrawable(com.xty.health.R.mipmap.icon_insufficient)
var unSelectStarImage = context.getDrawable(com.zj365.health.R.mipmap.icon_insufficient)
unSelectStarImage?.setBounds(
0,
0,
@ -1366,7 +1448,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
if (!checkBlueConnectPermission(requireContext())) {
ToastUtils.show("请开启App蓝牙搜索权限")
CommonToastUtils.showToast("请开启App蓝牙搜索权限")
getBluePermission(requireContext()) {
if (it) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
@ -1378,7 +1460,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
ToastUtils.show("请打开GPS权限")
CommonToastUtils.showToast("请打开GPS权限")
requestGPSPermission()
return
}
@ -1721,6 +1803,14 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
}
//workmanager 后台上传任务
@Subscribe(threadMode = ThreadMode.MAIN)
fun workManagerSuccess(event: WorkManagerEvent) {
//上传成功回传刷新
LogUtils.d("work is ok")
mViewModel.getAllInfo(showIdInfo, false)
}
override fun onDestroy() {
super.onDestroy()
tenJob?.cancel()

@ -1,4 +1,5 @@
package com.xty.healthuser.fragment
/*
package com.zj365.dc.fragment
import android.app.Activity.RESULT_OK
import android.content.Intent
@ -13,12 +14,10 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.lifecycle.MutableLiveData
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.jpush.android.api.JPushInterface
import com.hjq.toast.ToastUtils
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
import com.tamsiree.rxkit.RxTimeTool
import com.xty.base.fragment.BaseVmFrag
@ -31,26 +30,20 @@ import com.xty.common.bracelet.*
import com.xty.common.event.*
import com.xty.common.marqueen.SimpleMF
import com.xty.common.services.MqTTService
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.common.weight.CenterImageSpan
import com.xty.common.work.MyWorkManger
import com.xty.health.weight.DialogTip
import com.xty.healthuser.BuildConfig
import com.xty.healthuser.R
import com.xty.healthuser.act.MainActivity
import com.xty.healthuser.adapter.BannerCustomAdapter
import com.xty.healthuser.adapter.FamilyAdapter
import com.xty.healthuser.adapter.HealthAdapter
import com.xty.healthuser.adapter.holder.VideoHolder
import com.xty.healthuser.databinding.FragHealthBinding
import com.xty.healthuser.model.DeviceInfoBean
import com.xty.healthuser.vm.HealthVm
import com.xty.healthuser.weight.AgainSignDialog
import com.xty.mime.weight.NoticeSettingDialog
import com.zj365.mime.weight.NoticeSettingDialog
import com.xty.network.MyRetrofit
import com.xty.network.model.*
import com.youth.banner.indicator.RoundLinesIndicator
import com.youth.banner.listener.OnPageChangeListener
import com.zj365.dc.databinding.FragHealthBinding
import com.zj365.dc.vm.HealthVm
import com.zj365.dc.weight.AgainSignDialog
import com.zj365.health.adapter.FamilyAdapter
import com.zj365.health.weight.DialogTip
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@ -63,10 +56,13 @@ import java.text.SimpleDateFormat
import kotlin.math.max
import kotlin.math.min
*/
/**
* 健康
*/
*//*
class HealthCustomFrag : BaseVmFrag<HealthVm>() {
val binding by lazy { FragHealthBinding.inflate(layoutInflater) }
@ -92,7 +88,10 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
private var showIdInfo = "" //需要显示的信息的id
override fun setViewModel() = HealthVm()
/**----------------*/
*/
/**----------------*//*
val tenLive by lazy { MutableLiveData<String>() }
var tenJob: Job? = null
@ -189,7 +188,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
7 -> {//心电
if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表
ToastUtils.show("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
CommonToastUtils.showToast("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
} else {
if (showIdInfo.isEmpty()) {
goPage(index)
@ -244,10 +243,13 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
*
* -1步数 0:心率 1血氧 2呼吸率 3体温 4睡眠 5血压 6血糖 7:心电|血脂
*/
* -1步数 0:心率 1血氧 2呼吸率 3体温 4睡眠 5血压 6血糖 7:心电|血脂*//*
private val pageIndexs = arrayOf(
0, 1, 2, 3, -1, 4, 5, 6, 7
)
@ -416,7 +418,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
if (isBind()) {
RouteManager.goAct(ARouterUrl.FAMILY)
} else {
ToastUtils.show(com.xty.common.R.string.please_bind_device)
CommonToastUtils.showToast(com.xty.common.R.string.please_bind_device)
}
}
//榜单
@ -424,7 +426,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
mViewModel.allData.value?.apply {
if (data.adorn.activeWear <= 3) {
ToastUtils.show("尊敬的用户您好您正处于3天建模期请坚持佩戴")
CommonToastUtils.showToast("尊敬的用户您好您正处于3天建模期请坚持佩戴")
return@OnClickListener
}
onEventObject(requireContext(), UmengEventId.HealthRank)
@ -447,7 +449,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
//评估
R.id.mCard -> {
if (!canGoto24Healthresult) {
ToastUtils.show("数据不足或数据建模中,无法查看健康评估")
CommonToastUtils.showToast("数据不足或数据建模中,无法查看健康评估")
return@OnClickListener
}
CommonUtils.getMyUserInfo()?.apply {
@ -520,11 +522,11 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
} else {
onEventObject(requireContext(), UmengEventId.HealthAdmin, "未绑定点击")
ToastUtils.show(com.xty.common.R.string.please_bind_device)
CommonToastUtils.showToast(com.xty.common.R.string.please_bind_device)
}
} else {
onEventObject(requireContext(), UmengEventId.HealthAdmin, "关注家人点击")
ToastUtils.show("不支持上传家人健康信息")
CommonToastUtils.showToast("不支持上传家人健康信息")
}
}
//健康方案
@ -545,9 +547,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
/**
* 设置设备信息
*/
*/
/**
* 设置设备信息*//*
private fun setDeviceInfo(deviceInfo: DeviceInfoBean?) {
if (null != deviceInfo) {
if (blueTooth()) {
@ -648,9 +653,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
/**
* 设置天气信息
*/
*/
/**
* 设置天气信息*//*
private fun setWeatherInfo(weather: MainBean.Weather?) {
// if (null == weather) {
// binding.mCom.tvLocationWeather.visibility = View.GONE
@ -692,9 +700,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
// }
}
/**
* 设置设备信息
*/
*/
/**
* 设置设备信息*//*
private fun setBindDeviceInfo(deviceInfo: MainBean.DeviceTotal?) {
deviceInfo?.let {
binding.mChildView.tvXueyaNum.text = "已绑定" + it.sphygmomanometer + ""
@ -788,17 +799,21 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
/**
* 是否绑定了设备
*/
*/
/**
* 是否绑定了设备*//*
private fun isBind(): Boolean {
return true
/* Const.mainLiveData?.value?.let {
Const.mainLiveData?.value?.let {
if(!it.user.bluetooth.isNullOrEmpty()){
return true
}
}
return false*/
return false
}
@ -810,7 +825,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.HEALTHMAIN, bundle)
} else {
ToastUtils.show(R.string.please_bind_device)
CommonToastUtils.showToast(R.string.please_bind_device)
}
}
@ -962,7 +977,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
//手表数据上传
mViewModel.uploadMultiple.observe(this) {
ToastUtils.show(R.string.upload_data_success)
CommonToastUtils.showSucceedToast(R.string.upload_data_success)
LogUtils.d("all data upload success ")
get24HourReportInfo(showIdInfo)//数据上传成功后获取24小时日报
getXtInfo(showIdInfo)//数据上传成功后获取血糖信息
@ -1034,7 +1049,6 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
)
}
Const.mainLiveData.value = settingBean
mViewModel.getWelcomeInfo(settingBean.user.id)
mViewModel.getWarningMsg()//获取预警消息
@ -1099,7 +1113,6 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
//个人信息拿到之后再去获取mqtt信息
mViewModel.getMqttInfo()
}
//血糖信息获取
@ -1341,9 +1354,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
binding.mCom.tvWarning.text = sysMsg.notifyContent
}
/**
* 通过设备型号来处理不同业务逻辑
*/
*/
/**
* 通过设备型号来处理不同业务逻辑*//*
private fun requestByDeviceModel() {
when (MMkvHelper.getInt(Const.Watch_Device_Type)) {//如果是4GA3设备则隐藏心电板块
Const.Companion.WatchDevice.LightA3.ordinal -> {
@ -1407,12 +1423,14 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
append(" ")
}
}
}
/**
* 更新血糖模块信息
*/
*/
/**
* 更新血糖模块信息*//*
private fun updateBloodSugarInfo(info: XTangInfoBean) {
if (null == info) {
@ -1421,7 +1439,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
if (!info.errorMsg.isNullOrEmpty()) {
ToastUtils.show(info.errorMsg)
CommonToastUtils.showToast(info.errorMsg)
}
mHealthAdapter.xtangInfo = info
@ -1456,10 +1474,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
// }
}
*/
/**
* 更新健康状态*//*
/**
* 更新健康状态
*/
private fun updateHealthDesc(healthStatus: Int) {
canGoto24Healthresult = healthStatus != 0 && healthStatus != -1
binding.mCom.mDesc.apply {
@ -1472,14 +1492,16 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
)
)
}
// text =
// setStrSpan(content, 13, getColor(com.xty.health.R.color.col_ff7), Typeface.BOLD, content.length - 3 - percent.length, content.length - 3)
}
/**
* 家人信息绑定
*/
*/
/**
* 家人信息绑定*//*
private fun initFamilyAdapter() {
binding.mCom.mRecycle.layoutManager =
LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
@ -1513,9 +1535,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
* 设置用户头像
*/
*/
/**
* 设置用户头像*//*
private fun setUserImage(userId: String, headerImage: String?) {
binding.mCom.mHeaderImage.apply {
tag = userId
@ -1530,9 +1555,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
* 获取所有信息
*/
*/
/**
* 获取所有信息*//*
private fun getAllData() {
YCBManager.getAllData {
LogUtils.d("getAll Info!")
@ -1542,23 +1570,28 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*15秒钟之内只能上传一次睡眠数据 避免重复上传
*/
*/
/**
*15秒钟之内只能上传一次睡眠数据 避免重复上传*//*
private fun refreshTime() {
if (isRefresh) {
isRefresh = false
mainScope.launch {
delay(15 * 1000)
isRefresh = true
}
}
}
/**
* 获取历史步数
*/
*/
/**
* 获取历史步数*//*
private fun getStep() {
YCBManager.getHistoryInfo(YCBOrder.STEP_DATA) {
mainScope.launch {
@ -1584,7 +1617,6 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
continue
}
var json = JSONObject()
json.put("startTime", (info["sportStartTime"] as Long) / 1000)
json.put("endTime", (info["sportEndTime"] as Long) / 1000)
@ -1594,14 +1626,16 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
jsonArray.put(json)
}
mViewModel.uploadStep(jsonArray)
}
}
}
/**
* 手表信息上传
*/
*/
/**
* 手表信息上传*//*
private fun uploadWhatchData() {
LogUtils.d("手表数据是否上传:$isRefresh")
if (isRefresh) {//避免重复多次上传导致服务器负载过高,五秒钟之内不允许重复上传。蓝牙断开重连也可以上传
@ -1613,24 +1647,33 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
* 获取血糖信息
*/
*/
/**
* 获取血糖信息*//*
private fun getXtInfo(userId: String, isShowLoading: Boolean = false) {
mViewModel.getXtInfo(userId, isShowLoading)
}
/**
* 获取24小时健康报告
*/
*/
/**
* 获取24小时健康报告*//*
private fun get24HourReportInfo(userId: String, isShowLoading: Boolean = false) {
mViewModel.get24HourReportInfo(userId, isShowLoading)
}
/**
*/
/**
* 睡眠时间上传
* 限制睡眠在一定时间内请求的次数
*/
* 限制睡眠在一定时间内请求的次数*//*
private fun getSleepNew() {
YCBManager.getHistoryInfo(YCBOrder.SLEEP_DATA) {
LogUtils.d("getSleep Info!")
@ -1700,9 +1743,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
* 修改背景色
*/
*/
/**
* 修改背景色*//*
private fun changeBg(view: View, colId: Int) {
var bg = view.background as GradientDrawable
bg.setColor(ContextCompat.getColor(requireContext(), colId))
@ -1719,14 +1765,16 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
private fun requestGPSPermission() {
reqGpsPermissionDialog.show()
}
/**
* 蓝牙链接
*/
*/
/**
* 蓝牙链接*//*
private fun connect(mac: String) {
if (!CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))) {//如果不是蓝牙设备,不进行连接
@ -1739,7 +1787,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
if (!checkBlueConnectPermission(requireContext())) {
ToastUtils.show("请开启App蓝牙搜索权限")
CommonToastUtils.showToast("请开启App蓝牙搜索权限")
getBluePermission(requireContext()) {
if (it) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
@ -1751,7 +1799,7 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
ToastUtils.show("请打开GPS权限")
CommonToastUtils.showToast("请打开GPS权限")
requestGPSPermission()
return
}
@ -1765,7 +1813,6 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
private fun mainUIUpdate(connectState: YCBBlueConnectHelper.BLEConnectState) {
mainScope.launch(Dispatchers.Main) {
when (connectState) {
YCBBlueConnectHelper.BLEConnectState.Connecting -> {
@ -1829,17 +1876,23 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
mViewModel.getMyFamilyList()
}
/**
* 重新签名之后隐藏提示框
*/
*/
/**
* 重新签名之后隐藏提示框*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun againSignEvent(event: AgainSignEvent) {
signDialog.dismiss()
}
/**
* 24小时健康状态更新事件
*/
*/
/**
* 24小时健康状态更新事件*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun health24HourStatusUpdate(event: Health24HourStatusEvent) {
if (-2 != event.healthStatus) {
@ -1847,9 +1900,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
* 血糖开通/续费成功
*/
*/
/**
* 血糖开通/续费成功*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun xtOpenSuccess(event: XTangOpenEvent) {
var time = RxTimeTool.getCurrentDateTime("mm").toInt()
@ -1858,18 +1914,24 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
updateBloodsugarStatus(event.model, nowTimeStr)
}
/**
* 血糖信息更新
*/
*/
/**
* 血糖信息更新*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun xtDataUpdate(event: XTangUpdateEvent) {
LogUtils.d("xtDataUpdate!!!")
updateBloodSugarInfo(event.info)
}
/**
* 睡眠的原始数据
*/
*/
/**
* 睡眠的原始数据*//*
private fun sleepOriganData(list: ArrayList<Any>): JSONArray {
var array = JSONArray()
list.forEach {
@ -1904,15 +1966,15 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
e.printStackTrace()
}
}
return array
}
*/
/**
* 计算要休眠的时间*//*
/**
* 计算要休眠的时间
*/
private fun getNowTime() {
var tenTimes = 11 * 60 * 1000 //整十分钟对应的毫秒数
var time = RxTimeTool.getCurTimeString(SimpleDateFormat("mm")).toInt()
@ -1928,9 +1990,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
/**
* 15秒钟一次更新
*/
*/
/**
* 15秒钟一次更新*//*
private fun startGetDeviceInfoLive() {
getDeviceInfoJob = mainScope.launch(Dispatchers.IO) {
delay(1000 * 15)
@ -1939,10 +2004,13 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 十分钟休眠开始
* times 需要休眠的毫秒数
*/
* times 需要休眠的毫秒数*//*
private fun startTenLive(times: Long) {
LogUtils.d("休眠开始时间:${RxTimeTool.curTimeString}")
LogUtils.d("休眠时长:${times}")
@ -1953,14 +2021,16 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 由于SDK问题返回的时间存在秒和毫秒 两种值
* 这里 返回的类型为毫秒数
*/
* 这里 返回的类型为毫秒数*//*
private fun formatTime(time: Long): Long {
if (time > 9999999999) {
return time
}
return time * 1000
}
@ -1972,10 +2042,12 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
*/
/**
* 更新血糖状态*//*
/**
* 更新血糖状态
*/
private fun updateBloodsugarStatus(model: Int, updateTime: String) {
mHealthAdapter.xtangInfo?.let {
it.model = model
@ -2001,4 +2073,5 @@ class HealthCustomFrag : BaseVmFrag<HealthVm>() {
}
}
}
}
}
*/

@ -1,4 +1,5 @@
package com.xty.healthuser.fragment
/*
package com.zj365.dc.fragment
import android.app.Activity.RESULT_OK
import android.content.Intent
@ -9,7 +10,6 @@ import android.os.Build
import android.provider.Settings
import android.text.Spannable
import android.text.SpannableString
import android.util.Log
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
@ -17,9 +17,7 @@ import androidx.lifecycle.MutableLiveData
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.jpush.android.api.JPushInterface
import com.hjq.toast.ToastUtils
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
import com.tamsiree.rxkit.RxDataTool
import com.tamsiree.rxkit.RxTimeTool
import com.xty.base.fragment.BaseVmFrag
import com.xty.base.utils.UserInfoDefin
@ -48,6 +46,7 @@ import com.xty.common.marqueen.SimpleMF
import com.xty.common.onEventObject
import com.xty.common.services.MqTTService
import com.xty.common.setImageUser
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.common.weight.CenterImageSpan
import com.xty.common.work.MyWorkManger
@ -64,7 +63,7 @@ import com.xty.healthuser.databinding.FragHealthBinding
import com.xty.healthuser.model.DeviceInfoBean
import com.xty.healthuser.vm.HealthVm
import com.xty.healthuser.weight.AgainSignDialog
import com.xty.mime.weight.NoticeSettingDialog
import com.zj365.mime.weight.NoticeSettingDialog
import com.xty.network.MyRetrofit
import com.xty.network.model.BannerBean
import com.xty.network.model.FamilyBean
@ -88,10 +87,11 @@ import java.util.regex.Pattern
import kotlin.math.max
import kotlin.math.min
*/
/**
* 健康
*/
*//*
class HealthFrag : BaseVmFrag<HealthVm>() {
private var isDemonstrate: Boolean = false
val binding by lazy { FragHealthBinding.inflate(layoutInflater) }
@ -117,7 +117,9 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
private var showIdInfo = "" //需要显示的信息的id
override fun setViewModel() = HealthVm()
/**----------------*/
*/
/**----------------*//*
val tenLive by lazy { MutableLiveData<String>() }
var tenJob: Job? = null
@ -128,7 +130,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
var reportBean: ReportBean? = null//24小时日报数据
private val dialogBind by lazy {
DialogTip(requireContext(), "需绑定安瑜健康手表,才能查看","去绑定") {
DialogTip(requireContext(), "需绑定安瑜健康手表,才能查看", "去绑定") {
dialogChooseDevice.show()
}
}
@ -139,9 +141,9 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
private val dialogChooseDevice by lazy {
DeviceChooseDialog(requireContext()) {
bundle.clear()
bundle.putInt("type", it)
RouteManager.goAct(ARouterUrl.DEVICE_ACTIVE, bundle)
bundle.clear()
bundle.putInt("type", it)
RouteManager.goAct(ARouterUrl.DEVICE_ACTIVE, bundle)
}
}
@ -217,11 +219,12 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
goPage(index)
}
}
7 -> {//心电
if (MMkvHelper.getInt(Const.Watch_Device_Type) == -1) { //演示模式
ToastUtils.show("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
}else if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表
ToastUtils.show("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
CommonToastUtils.showToast("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
} else if (MMkvHelper.getInt(Const.Watch_Device_Type) == Const.Companion.WatchDevice.LightA3.ordinal) {//4G手表
CommonToastUtils.showToast("尊敬的用户您好,血脂功能暂未开放,敬请期待哦~")
} else {
if (showIdInfo.isEmpty()) {
goPage(index)
@ -232,14 +235,15 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
}
-1 -> {//步数
if (isDemonstrate){
if (isDemonstrate) {
return@setOnItemClickListener
}
mViewModel.allData.value?.apply {
// if (data.adorn.wearCount <= 3) {
// ToastUtils.show("尊敬的用户您好您正处于3天建模期请坚持佩戴")
// CommonToastUtils.showToast("尊敬的用户您好您正处于3天建模期请坚持佩戴")
// return@setOnItemClickListener
// }
bundle.clear()
@ -253,6 +257,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
RouteManager.goAct(ARouterUrl.RANK_LIST, bundle)
}
}
else -> {
goPage(index)
}
@ -279,10 +284,12 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
*
* -1步数 0:心率 1血氧 2呼吸率 3体温 4睡眠 5血压 6血糖 7:心电|血脂
*/
*//*
private val pageIndexs = arrayOf(
0, 1, 2, 3, -1, 4, 5, 6, 7
)
@ -422,16 +429,16 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
binding.mOrganView.llCompare.setOnClickListener(onClickListener)
}
private var onClickListener = View.OnClickListener {
when (it.id) {
R.id.ll_compare -> {//健康对比
if (isDemonstrate){
if (isDemonstrate) {
dialogBind.show()
return@OnClickListener
}
goComparePage( )
goComparePage()
}
R.id.mSub -> {//健康监测
goPage(0)
}
@ -462,19 +469,18 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
if (isBind()) {
RouteManager.goAct(ARouterUrl.FAMILY)
} else {
ToastUtils.show(com.xty.common.R.string.please_bind_device)
CommonToastUtils.showToast(com.xty.common.R.string.please_bind_device)
}
}
//榜单
R.id.mRelInterBD -> {
if (isDemonstrate){
if (isDemonstrate) {
dialogBind.show()
return@OnClickListener
}
mViewModel.allData.value?.apply {
if (data.adorn.activeWear <= 3) {
ToastUtils.show("尊敬的用户您好您正处于3天建模期请坚持佩戴")
CommonToastUtils.showToast("尊敬的用户您好您正处于3天建模期请坚持佩戴")
return@OnClickListener
}
onEventObject(requireContext(), UmengEventId.HealthRank)
@ -487,7 +493,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
//打卡
R.id.mRelInterDk -> {
if (isDemonstrate){
if (isDemonstrate) {
dialogBind.show()
return@OnClickListener
}
@ -500,7 +506,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
//评估
R.id.mCard -> {
if (isDemonstrate){
if (isDemonstrate) {
bundle.clear()
bundle.putBoolean("isDemonstrate", isDemonstrate)
// RouteManager.goAct(ARouterUrl.HEALTH_24HOUR_REPORT, bundle)//新24小时
@ -508,7 +514,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
return@OnClickListener
}
// if (!canGoto24Healthresult) {
// ToastUtils.show("数据不足或数据建模中,无法查看健康评估")
// showToast("数据不足或数据建模中,无法查看健康评估")
// return@OnClickListener
// }
CommonUtils.getMyUserInfo()?.apply {
@ -531,7 +537,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
bundle.clear()
bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.PRVENT_CANCER, bundle)
// ToastUtils.show("功能暂未开通,敬请期待")
// showToast("功能暂未开通,敬请期待")
}
//舌诊
R.id.ivTongueDiagnosis -> {
@ -539,7 +545,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
bundle.clear()
bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.TONGUE_MAIN_ACTIVITY, bundle)
// ToastUtils.show("功能暂未开通,敬请期待")
// showToast("功能暂未开通,敬请期待")
}
//问卷
R.id.ivWarn2 -> {
@ -551,7 +557,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
//预警
R.id.ivWarn1 -> {
if (isDemonstrate){
if (isDemonstrate) {
bundle.clear()
bundle.putString("id", showIdInfo)
bundle.putInt("page", 1)
@ -573,14 +579,14 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
UmengEventId.Health30Day,
"佩戴未满30天或活跃天数未满15天。"
)
ToastUtils.show("尊敬的用户您好该功能需要佩戴30天且活跃佩戴15天查看请坚持佩戴且每日同步数据")
CommonToastUtils.showToast("尊敬的用户您好该功能需要佩戴30天且活跃佩戴15天查看请坚持佩戴且每日同步数据")
} else {
onEventObject(
requireContext(),
UmengEventId.Health30Day,
"关联用户处于7天建模中"
)
ToastUtils.show("您关联的用户正处于7天建模中……")
CommonToastUtils.showToast("您关联的用户正处于7天建模中……")
}
}
}
@ -596,7 +602,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
//健康管家
R.id.mGuide2 -> {
if (isDemonstrate){
if (isDemonstrate) {
dialogBind.show()
return@OnClickListener
}
@ -611,11 +617,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
} else {
onEventObject(requireContext(), UmengEventId.HealthAdmin, "未绑定点击")
ToastUtils.show(com.xty.common.R.string.please_bind_device)
CommonToastUtils.showToast(com.xty.common.R.string.please_bind_device)
}
} else {
onEventObject(requireContext(), UmengEventId.HealthAdmin, "关注家人点击")
ToastUtils.show("不支持上传家人健康信息")
CommonToastUtils.showToast("不支持上传家人健康信息")
}
}
//健康方案
@ -625,14 +631,15 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// bundle.putString("id", showIdInfo)
// RouteManager.goAct(ARouterUrl.HEALTH_PROP, bundle)
// }
if (isDemonstrate){
if (isDemonstrate) {
dialogBind.show()
return@OnClickListener
}
onEventObject(requireContext(), UmengEventId.HealthProgrammes, "首页")
RouteManager.goAct(ARouterUrl.MY_PROG)
}
R.id.mGuide_4-> {
R.id.mGuide_4 -> {
RouteManager.goAct(ARouterUrl.DATA_MANAGE)
// RouteManager.goAct(ARouterUrl.MY_UPLOAD)
}
@ -647,13 +654,13 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
bundle.clear()
bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.COMPARE_PAGE_DATA_ACT, bundle)
}
/**
*/
/**
* 设置设备信息
*/
*//*
private fun setDeviceInfo(deviceInfo: DeviceInfoBean?) {
if (null != deviceInfo) {
if (blueTooth()) {
@ -685,7 +692,8 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
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 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()) {
@ -718,12 +726,14 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
setCompoundDrawables(drawable, null, null, null)
}
}
YCBBlueConnectHelper.BLEConnectState.Connecting -> {//连接中
binding.mCom.mConnectStatu.apply {
text = "连接中..."
setCompoundDrawables(null, null, null, null)
}
}
YCBBlueConnectHelper.BLEConnectState.DisConnect -> {//未连接
binding.mCom.mConnectStatu.apply {
text = "未连接"
@ -759,10 +769,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 设置天气信息
*/
*//*
private fun setWeatherInfo(weather: MainBean.Weather?) {
// if (null == weather) {
// binding.mCom.tvLocationWeather.visibility = View.GONE
@ -804,9 +815,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// }
}
/**
*/
/**
* 设置设备信息
*/
*//*
private fun setBindDeviceInfo(deviceInfo: MainBean.DeviceTotal?) {
deviceInfo?.let {
binding.mChildView.tvXueyaNum.text = "已绑定" + it.sphygmomanometer + ""
@ -835,7 +848,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
private fun request() {
mViewModel.getBanners(CommonUtils.getMyUserId())//当期登录用户id
mViewModel.getAllInfo(showIdInfo,false)
mViewModel.getAllInfo(showIdInfo, false)
mViewModel.getDkInfo(false, showIdInfo)
// 如果显示的是家人Tab则不刷新用户信息防止头像错乱
if (mFamilyAdapter.position < 1) {
@ -846,7 +859,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
mViewModel.getRank(2)
}
//蓝牙连接状态之后 数据上传
private fun getConnectStatus() {
LogUtils.d("getConnectStatus!")
@ -902,19 +914,22 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
/**
*/
/**
* 是否绑定了设备
*/
*//*
private fun isBind(): Boolean {
return true
/* Const.mainLiveData?.value?.let {
*/
/* Const.mainLiveData?.value?.let {
if(!it.user.bluetooth.isNullOrEmpty()){
return true
}
}
return false*/
}
return false*//*
}
//界面跳转
fun goPage(page: Int) {
@ -925,7 +940,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.HEALTHMAIN, bundle)
} else {
ToastUtils.show(R.string.please_bind_device)
CommonToastUtils.showToast(R.string.please_bind_device)
}
}
@ -982,7 +997,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
override fun observer() {
//预警消息
mViewModel.warningMsgLive.observe(this) {
updateBadgeNum(it.data.noReadNum)
@ -1000,14 +1014,12 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
if (null == it) {
return@observe
}
mBannerAdapter.setDatas(it.data)
mBannerAdapter.notifyDataSetChanged()
}
//手表信息组装上传
mViewModel.allDataInfo.observe(this) {
if (null == it || it["data"] == null || it["data"] !is ArrayList<*>) {
LogUtils.d("手表数据:暂时无数据...")
getXtInfo(showIdInfo)//如果手表没数据也需要获取获取血糖信息
@ -1039,6 +1051,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
//小值
json.put("sbpValue", min(sbp, dbp))
}
"SBPValue" -> {
//医学上是小值 舒张压
//大值
@ -1070,21 +1083,19 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// var lastJson = array[array.length() - 1] as JSONObject
// lastJson.put("original", it.toString())
mViewModel.uploadAllInfo(array)
}
}
//手表数据上传
mViewModel.uploadMultiple.observe(this) {
ToastUtils.show(R.string.upload_data_success)
CommonToastUtils.showSucceedToast(R.string.upload_data_success)
LogUtils.d("all data upload success ")
get24HourReportInfo(showIdInfo)//数据上传成功后获取24小时日报
getXtInfo(showIdInfo)//数据上传成功后获取血糖信息
YCBManager.deleteHistory(YCBOrder.DELETE_ALL) //删除 数据
mainScope.launch {
delay(500)
mViewModel.getAllInfo(showIdInfo,false)
mViewModel.getAllInfo(showIdInfo, false)
}
}
//睡眠上传
@ -1133,7 +1144,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
content.length - 1 - (it.data.userRank).toString().length,
content.length - 1
)
}
//个人设置信息获取
@ -1149,7 +1159,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
)
}
Const.mainLiveData.value = settingBean
mViewModel.getWelcomeInfo(settingBean.user.id)
mViewModel.getWarningMsg()//获取预警消息
@ -1221,7 +1230,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
//个人信息拿到之后再去获取mqtt信息
mViewModel.getMqttInfo()
}
//血糖信息获取
@ -1238,15 +1246,15 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
return@observe
}
if (bean.user.name.isNullOrEmpty()){
if (bean.user.name.isNullOrEmpty()) {
dialogInfoUn.show()
}
isDemonstrate = bean.demonstrate == 1 //1 演示模式0 普通模式
(requireActivity() as MainActivity).isDemonstrate = isDemonstrate
if (isDemonstrate){
(requireActivity() as MainActivity).isDemonstrate = isDemonstrate
if (isDemonstrate) {
binding.mCom.mWearInfo.visibility = View.INVISIBLE
binding.mCom.mWatchType.visibility = View.INVISIBLE
}else{
} else {
binding.mCom.mWatchType.visibility = View.VISIBLE
binding.mCom.mWearInfo.visibility = View.VISIBLE
}
@ -1410,7 +1418,6 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
//24小时健康报告返回信息
mViewModel.infoLive.observe(this) {
if (null == it.data) {
LogUtils.e("返回数据为空!")
return@observe
@ -1457,7 +1464,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
var notifyStatus: Int? = -1
private fun updateWarningInfo(sysMsg: MessageBean.SysMsg?) {
if (sysMsg == null || mFamilyAdapter.position>0) { //如果不是自己,不显示预警消息
if (sysMsg == null || mFamilyAdapter.position > 0) { //如果不是自己,不显示预警消息
binding.mCom.llWarning.visibility = View.GONE
return
} else if (mFamilyAdapter.position == 0 || mFamilyAdapter.position == -1) {
@ -1475,15 +1482,18 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
binding.mCom.tvWarning.text = sysMsg.notifyContent
}
/**
*/
/**
* 通过设备型号来处理不同业务逻辑
*/
*//*
private fun requestByDeviceModel() {
when (MMkvHelper.getInt(Const.Watch_Device_Type)) {//如果是4GA3设备则隐藏心电板块
Const.Companion.WatchDevice.LightA3.ordinal -> {
getXtInfo(showIdInfo, false)//获取血糖信息
// get24HourReportInfo(showIdInfo)//获取24小时日报
}
else -> {
if (!YCBBlueConnectHelper.isBlueExits()) {//检查蓝牙设备如未发现蓝牙设备则获取用户上次的血糖信息和24小时信息
LogUtils.d("未发现蓝牙设备...")
@ -1541,21 +1551,21 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
append(" ")
}
}
}
/**
*/
/**
* 更新血糖模块信息
*/
private fun updateBloodSugarInfo(info: XTangInfoBean) {
*//*
private fun updateBloodSugarInfo(info: XTangInfoBean) {
if (null == info) {
LogUtils.e("血糖模块信息没有,出错了~")
return
}
if (!info.errorMsg.isNullOrEmpty()) {
ToastUtils.show(info.errorMsg)
CommonToastUtils.showToast(info.errorMsg)
}
mHealthAdapter.xtangInfo = info
@ -1591,9 +1601,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
/**
*/
/**
* 更新健康状态
*/
*//*
private fun updateHealthDesc(healthStatus: Int) {
canGoto24Healthresult = healthStatus != 0 && healthStatus != -1
binding.mCom.mDesc.apply {
@ -1611,9 +1623,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// setStrSpan(content, 13, getColor(com.xty.health.R.color.col_ff7), Typeface.BOLD, content.length - 3 - percent.length, content.length - 3)
}
/**
*/
/**
* 家人信息绑定
*/
*//*
private fun initFamilyAdapter() {
binding.mCom.mRecycle.layoutManager =
LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
@ -1638,7 +1652,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
binding.mCom.mUserName.text = bean.fCall
mFamilyAdapter.position = position
mFamilyAdapter.notifyDataSetChanged()
mViewModel.getAllInfo(showIdInfo,true)
mViewModel.getAllInfo(showIdInfo, true)
getXtInfo(showIdInfo)
get24HourReportInfo(showIdInfo)
mViewModel.getDkInfo(false, showIdInfo)
@ -1647,9 +1661,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 设置用户头像
*/
*//*
private fun setUserImage(userId: String, headerImage: String?) {
binding.mCom.mHeaderImage.apply {
tag = userId
@ -1664,9 +1680,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 获取所有信息
*/
*//*
private fun getAllData() {
YCBManager.getAllData {
mainScope.launch {
@ -1675,9 +1693,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
*15秒钟之内只能上传一次睡眠数据 避免重复上传
*/
*//*
private fun refreshTime() {
if (isRefresh) {
isRefresh = false
@ -1689,9 +1709,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 获取历史步数
*/
*//*
private fun getStep() {
YCBManager.getHistoryInfo(YCBOrder.STEP_DATA) {
mainScope.launch {
@ -1732,9 +1754,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 手表信息上传
*/
*//*
private fun uploadWhatchData() {
LogUtils.d("手表数据是否上传:$isRefresh")
if (isRefresh) {//避免重复多次上传导致服务器负载过高,五秒钟之内不允许重复上传。蓝牙断开重连也可以上传
@ -1746,24 +1770,30 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 获取血糖信息
*/
*//*
private fun getXtInfo(userId: String, isShowLoading: Boolean = false) {
mViewModel.getXtInfo(userId, isShowLoading)
}
/**
*/
/**
* 获取24小时健康报告
*/
*//*
private fun get24HourReportInfo(userId: String, isShowLoading: Boolean = false) {
mViewModel.get24HourReportInfo(userId, isShowLoading)
}
/**
*/
/**
* 睡眠时间上传
* 限制睡眠在一定时间内请求的次数
*/
*//*
private fun getSleepNew() {
YCBManager.getHistoryInfo(YCBOrder.SLEEP_DATA) {
LogUtils.d("getSleep Info!")
@ -1833,9 +1863,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 修改背景色
*/
*//*
private fun changeBg(view: View, colId: Int) {
var bg = view.background as GradientDrawable
bg.setColor(ContextCompat.getColor(requireContext(), colId))
@ -1857,9 +1889,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
reqGpsPermissionDialog.show()
}
/**
*/
/**
* 蓝牙链接
*/
*//*
private fun connect(mac: String) {
if (!CommonUtils.isBlueTooth(MMkvHelper.getInt(Const.Watch_Device_Type))) {//如果不是蓝牙设备,不进行连接
@ -1872,7 +1906,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
if (!checkBlueConnectPermission(requireContext())) {
ToastUtils.show("请开启App蓝牙搜索权限")
CommonToastUtils.showToast("请开启App蓝牙搜索权限")
getBluePermission(requireContext()) {
if (it) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
@ -1884,7 +1918,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isGpsOpen(requireContext())) {
ToastUtils.show("请打开GPS权限")
CommonToastUtils.showToast("请打开GPS权限")
requestGPSPermission()
return
}
@ -1912,9 +1946,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// binding.mEle.visibility = View.VISIBLE
// binding.mEle.text = getString(R.string.blue_tooth_connecting)
}
YCBBlueConnectHelper.BLEConnectState.Connected -> {
getConnectStatus()
}
YCBBlueConnectHelper.BLEConnectState.DisConnect -> {
//断开连接重置状态 为了重新连接自后可以进行睡眠上传
initBlueToothStatu()
@ -1935,7 +1971,7 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
fun workManagerSuccess(event: WorkManagerEvent) {
//上传成功回传刷新
LogUtils.d("work is ok")
mViewModel.getAllInfo(showIdInfo,false)
mViewModel.getAllInfo(showIdInfo, false)
}
//个人信息修改 主界面刷新
@ -1962,17 +1998,21 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
mViewModel.getMyFamilyList()
}
/**
*/
/**
* 重新签名之后隐藏提示框
*/
*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun againSignEvent(event: AgainSignEvent) {
signDialog.dismiss()
}
/**
*/
/**
* 24小时健康状态更新事件
*/
*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun health24HourStatusUpdate(event: Health24HourStatusEvent) {
if (-2 != event.healthStatus) {
@ -1980,9 +2020,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 血糖开通/续费成功
*/
*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun xtOpenSuccess(event: XTangOpenEvent) {
var time = RxTimeTool.getCurrentDateTime("mm").toInt()
@ -1991,18 +2033,22 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
updateBloodsugarStatus(event.model, nowTimeStr)
}
/**
*/
/**
* 血糖信息更新
*/
*//*
@Subscribe(threadMode = ThreadMode.MAIN)
fun xtDataUpdate(event: XTangUpdateEvent) {
LogUtils.d("xtDataUpdate!!!")
updateBloodSugarInfo(event.info)
}
/**
*/
/**
* 睡眠的原始数据
*/
*//*
private fun sleepOriganData(list: ArrayList<Any>): JSONArray {
var array = JSONArray()
list.forEach {
@ -2037,15 +2083,14 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
e.printStackTrace()
}
}
return array
}
/**
*/
/**
* 计算要休眠的时间
*/
*//*
private fun getNowTime() {
var tenTimes = 11 * 60 * 1000 //整十分钟对应的毫秒数
var time = RxTimeTool.getCurTimeString(SimpleDateFormat("mm")).toInt()
@ -2058,12 +2103,13 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
var sleepSec = nextTimeMill - System.currentTimeMillis() //距离下个时间要休眠的毫秒数
startTenLive(sleepSec)
}
/**
*/
/**
* 15秒钟一次更新
*/
*//*
private fun startGetDeviceInfoLive() {
getDeviceInfoJob = mainScope.launch(Dispatchers.IO) {
delay(1000 * 15)
@ -2072,10 +2118,12 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 十分钟休眠开始
* times 需要休眠的毫秒数
*/
*//*
private fun startTenLive(times: Long) {
LogUtils.d("休眠开始时间:${RxTimeTool.curTimeString}")
LogUtils.d("休眠时长:${times}")
@ -2086,14 +2134,15 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 由于SDK问题返回的时间存在秒和毫秒 两种值
* 这里 返回的类型为毫秒数
*/
*//*
private fun formatTime(time: Long): Long {
if (time > 9999999999) {
return time
}
return time * 1000
}
@ -2105,10 +2154,11 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
}
}
/**
*/
/**
* 更新血糖状态
*/
*//*
private fun updateBloodsugarStatus(model: Int, updateTime: String) {
mHealthAdapter.xtangInfo?.let {
it.model = model
@ -2152,4 +2202,4 @@ class HealthFrag : BaseVmFrag<HealthVm>() {
// interface DataCallback {
// fun onDataReceived(data: String)
// }
}
}*/

@ -1,10 +1,9 @@
package com.xty.healthuser.fragment
package com.zj365.dc.fragment
import android.os.Build
import android.text.TextUtils
import android.view.View
import androidx.annotation.RequiresApi
import com.hjq.toast.ToastUtils
import com.tencent.qcloud.tuicore.event.ShowSystemMessageEvent
import com.xty.base.fragment.BaseVmFrag
import com.xty.common.*
@ -12,18 +11,21 @@ import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.event.MyInfoEvent
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.health.R
import com.xty.health.weight.DialogTip
import com.xty.healthuser.act.MainActivity
import com.xty.healthuser.databinding.FragMineBinding
import com.xty.mime.vm.SettingVm
import com.xty.network.model.SettingBean
import com.zj365.dc.activity.MainActivity
import com.zj365.dc.databinding.FragMineBinding
import com.zj365.health.weight.DialogTip
import com.zj365.mime.vm.SettingVm
import org.greenrobot.eventbus.EventBus
/**
* 我的
*/
** 我的
*/
class MineFrag : BaseVmFrag<SettingVm>() {
private val binding by lazy { FragMineBinding.inflate(layoutInflater) }
@ -54,56 +56,65 @@ class MineFrag : BaseVmFrag<SettingVm>() {
mViewModel.getMySetting()
}
binding.mllSource.setOnClickListener { //积分
binding.mImage.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else{
RouteManager.goAct(ARouterUrl.MY_INFO)
}
}
binding.mllIntegral.setOnClickListener { //积分
bundle.clear()
bundle.putSerializable("user", user)
RouteManager.goAct(ARouterUrl.MY_INTEGRAL, bundle)
/* bundle.clear()
/* bundle.clear()
bundle.putString("url","https://blog.csdn.net/wenmang_star/article/details/72911605")
RouteManager.goAct( ARouterUrl.WEB_ACT)*/
RouteManager.goAct( ARouterUrl.WEB_ACT)
*/
}
binding.mTvAbout.setOnClickListener {
binding.llAboutUs.setOnClickListener {
RouteManager.goAct(ARouterUrl.ABOUT)
}
binding.mTvMsg.setOnClickListener {
/* binding.mTvMsg.setOnClickListener {
// RouteManager.goAct(ARouterUrl.MESSAGE)
(requireActivity() as MainActivity).setCurrentTab(2)
}
binding.mTvSetting.setOnClickListener {
}*/
binding.llSetting.setOnClickListener {
bundle.clear()
bundle.putSerializable("user", user)
bundle.putBoolean("isDemonstrate", (requireActivity() as MainActivity).isDemonstrate)
RouteManager.goAct(ARouterUrl.SETTING, bundle)
}
binding.mTvOrgan.setOnClickListener {//我的机构
/* binding.mTvOrgan.setOnClickListener {//我的机构
bundle.clear()
// bundle.putSerializable("user", user)
RouteManager.goAct(ARouterUrl.MY_ORGAN, bundle)
}
binding.mTvOrder.setOnClickListener {
}*/
binding.llOrder.setOnClickListener {
bundle.clear()
bundle.putString("id", user?.id)
RouteManager.goAct(ARouterUrl.ORDER_LIST, bundle)
}
binding.mllmProg.setOnClickListener {
/*binding.mllmProg.setOnClickListener {
onEventObject(requireContext(), UmengEventId.HealthProgrammes, "我的页面")
RouteManager.goAct(ARouterUrl.MY_PROG)
}
binding.mllFamily.setOnClickListener {
}*/
binding.llFamilyHealth.setOnClickListener {
RouteManager.goAct(ARouterUrl.FAMILY)
}
binding.mFamily.setOnClickListener {
/*binding.mFamily.setOnClickListener {
RouteManager.goAct(ARouterUrl.FAMILY)
}
binding.mTvAppoint.setOnClickListener {
}*/
/* binding.mTvAppoint.setOnClickListener {
if ((requireActivity() as MainActivity).isDemonstrate) {
dialogBind.show()
return@setOnClickListener
}
RouteManager.goAct(ARouterUrl.MY_APPOINT)
}
binding.mKeeper.setOnClickListener {
}*/
/* binding.mKeeper.setOnClickListener {
// if ((requireActivity() as MainActivity).isDemonstrate ){
// return@setOnClickListener
// }
@ -112,8 +123,8 @@ class MineFrag : BaseVmFrag<SettingVm>() {
bundle.putString("fromUserId", it)
RouteManager.goAct(ARouterUrl.MY_KEEPER, bundle)
}
}
binding.mTvBind.setOnClickListener {
}*/
binding.llWearableDevice.setOnClickListener {
CommonUtils.getMyUserInfo()?.let {
if (it.watchName == null) {
RouteManager.goAct(ARouterUrl.DEVICE_CHOICE)
@ -126,7 +137,7 @@ class MineFrag : BaseVmFrag<SettingVm>() {
}
}
}
binding.mSign.setOnClickListener {
/*binding.mSign.setOnClickListener {
if ((requireActivity() as MainActivity).isDemonstrate) {
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE, bundle)
return@setOnClickListener
@ -136,11 +147,11 @@ class MineFrag : BaseVmFrag<SettingVm>() {
mViewModel.sign()
}
}
}
}*/
binding.mInfo.setOnClickListener {
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE, bundle)
}
//邀请记录
/* //邀请记录
binding.tvLnvitationMessage.setOnClickListener {
bundle.clear()
bundle.putSerializable("user", user)
@ -151,7 +162,7 @@ class MineFrag : BaseVmFrag<SettingVm>() {
bundle.clear()
bundle.putSerializable("user", user)
RouteManager.goAct(ARouterUrl.INVITE_FRIENDS, bundle)
}
}*/
mViewModel.getNesProg("")
}
@ -172,9 +183,9 @@ class MineFrag : BaseVmFrag<SettingVm>() {
}
override fun observer() {
mViewModel.familyLive.observe(this) {
/* mViewModel.familyLive.observe(this) {
binding.mFamily.text = it.data.size.toString()
}
}*/
mViewModel.progLive.observe(this) {
binding.mProg.text = it.data.size.toString()
}
@ -210,11 +221,11 @@ class MineFrag : BaseVmFrag<SettingVm>() {
Const.CHAT_IMAGE = it.user.avatarUrl
}
if (it.user.sign == 0) {
/* if (it.user.sign == 0) {
binding.mSign.text = "签到"
} else {
binding.mSign.text = "已签到"
}
}*/
}
mViewModel.unbindLive.observe(this) {
@ -223,11 +234,11 @@ class MineFrag : BaseVmFrag<SettingVm>() {
YCBBlueConnectHelper.cancelTimer()
EventBus.getDefault().post(MyInfoEvent()) //刷新个人信息
}
mViewModel.signLive.observe(this) {
ToastUtils.show("签到成功")
/* mViewModel.signLive.observe(this) {
CommonToastUtils.showSucceedToast("签到成功")
binding.mSign.text = "已签到"
user!!.sign = 1
}
}*/
mViewModel.countLive.observe(this) {
// setBadge(it.data.count)
(requireActivity() as MainActivity).setUnreadcount(it.data.count)
@ -242,12 +253,14 @@ class MineFrag : BaseVmFrag<SettingVm>() {
binding.mNoNetwork.root.visibility = View.GONE
}
}
}
/**
* 设置消息数量
*/
/*** 设置消息数量*/
private fun setBadge(num: Int) {
// if (num > 0) {
// binding.mCard.visibility = View.VISIBLE
@ -270,4 +283,4 @@ class MineFrag : BaseVmFrag<SettingVm>() {
// }
}
}
}

@ -1,4 +1,5 @@
package com.xty.healthuser.fragment
/*
package com.zj365.dc.fragment
import android.view.View
import androidx.recyclerview.widget.*
@ -8,12 +9,6 @@ import com.xty.common.*
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonUtils
import com.xty.healthuser.R
import com.xty.healthuser.adapter.GjAdapter
import com.xty.healthuser.adapter.ProAdapter
import com.xty.healthuser.adapter.ScienceAdapter
import com.xty.healthuser.databinding.FragServerBinding
import com.xty.healthuser.vm.ServerVm
import com.xty.network.model.ExpertBean
import com.xty.network.model.KeeperBean
import com.xty.network.model.ScienceBean
@ -228,4 +223,4 @@ class ServerFrag : BaseVmFrag<ServerVm>() {
}
}
}*/

@ -1,4 +1,4 @@
package com.xty.healthuser.model
package com.zj365.dc.model
import com.xty.common.bracelet.YCBBlueConnectHelper

@ -1,9 +1,9 @@
package com.xty.healthuser.model
package com.zj365.dc.model
import com.lifesense.android.ble.core.application.BleDeviceManager
import com.lifesense.android.ble.core.application.model.enums.ConnectionState
import com.lifesense.android.ble.core.valueobject.DeviceInfo
import com.xty.health.act.binddevice.BlueUtil
import com.zj365.health.act.binddevice.BlueUtil
class DeviceStateWrapper {

@ -1,4 +1,4 @@
package com.xty.healthuser.model
package com.zj365.dc.model
import java.io.Serializable

@ -0,0 +1,7 @@
package com.zj365.dc.vm
import com.xty.base.vm.BaseVm
class DeviceChoiceVm:BaseVm() {
}

@ -1,4 +1,4 @@
package com.xty.healthuser.vm
package com.zj365.dc.vm
import android.annotation.SuppressLint
import android.content.Context
@ -6,28 +6,27 @@ import android.graphics.Typeface
import android.text.TextUtils
import androidx.core.content.ContextCompat
import androidx.lifecycle.MutableLiveData
import com.tamsiree.rxkit.RxConstTool
import com.tamsiree.rxkit.RxTimeTool
import com.xty.base.utils.OrganStatusCalcUtil
import com.xty.base.vm.BaseVm
import com.xty.common.Const
import com.xty.common.Dateutils
import com.xty.common.MMkvHelper
import com.xty.common.TimeUtils
import com.xty.common.util.CommonUtils
import com.xty.healthuser.R
import com.xty.network.model.BannerBean
import com.xty.network.model.DkBean
import com.xty.network.model.FamilyBean
import com.xty.network.model.HealthMonitoringListBean
import com.xty.network.model.MainBean
import com.xty.network.model.MessageBean
import com.xty.network.model.MqTTBean
import com.xty.network.model.NotAccepted
import com.xty.network.model.RankBean
import com.xty.network.model.ReportBean
import com.xty.network.model.RespBody
import com.xty.network.model.SettingBean
import com.xty.network.model.TipsBean
import com.xty.network.model.XTangInfoBean
import com.zj365.dc.R
import org.json.JSONArray
import org.json.JSONObject
import java.text.SimpleDateFormat
@ -49,37 +48,45 @@ class DynamicManagementVm : BaseVm() {
val allDataInfo by lazy { MutableLiveData<MutableMap<String, Any>>() }
val uploadSleep by lazy { MutableLiveData<RespBody<String>>() }
val mqtt by lazy { MutableLiveData<RespBody<MqTTBean>>() }
val uploadMultiple by lazy { MutableLiveData<RespBody<NotAccepted>>() }
/**
* 获取所有信息
*/
fun getAllInfo(id: String, isShowDialog: Boolean) {
startHttp(isShowDialog) {
var json = JSONObject()
val json = JSONObject()
json.put("id", id)
var body = apiInterface().getMainInfo(retrofits.getRequestBody(json.toString()))
val body = apiInterface().getMainInfo(retrofits.getRequestBody(json.toString()))
body.getCodeStatus(allData, nowData)
}
}
fun uploadAllInfo(array: JSONArray) {
startHttp(false) {
val body = apiInterface().uploadAllInfo(retrofits.getRequestBody(array.toString()))
body.getCodeStatus(uploadMultiple, nowData)
}
}
/**
* 获取血糖信息
*
*/
fun getXtInfo(userId: String, isShowLoading: Boolean = true) {
startHttp(isShowLoading) {
var json = JSONObject()
val json = JSONObject()
json.put("userId", userId)
var value = apiInterface().getXtInfo(retrofits.getRequestBody(json.toString()))
val value = apiInterface().getXtInfo(retrofits.getRequestBody(json.toString()))
value.getCodeStatus(xtInfo, nowData)
}
}
fun get24HourReportInfo(id: String = "", isShowLoading: Boolean = true) {
startHttp(isShowLoading) {
var json = JSONObject()
val json = JSONObject()
json.put("id", id)
var response =
val response =
apiInterface().get24HourReportInfo(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(infoLive, nowData)
}
@ -112,7 +119,7 @@ class DynamicManagementVm : BaseVm() {
*/
fun getMySetting() {
startHttp(false) {
var body = apiInterface().getMySetting()
val body = apiInterface().getMySetting()
body.getCodeStatus(settingLive, nowData)
}
@ -123,10 +130,10 @@ class DynamicManagementVm : BaseVm() {
*/
fun getMyFamilyList() {
startHttp(false) {
var json = JSONObject()
val json = JSONObject()
/* json.put("pageNum","1")
json.put("pageSize",Const.PAGE_SIZE)*/
var request = apiInterface().getMyFamily(retrofits.getRequestBody(json.toString()))
val request = apiInterface().getMyFamily(retrofits.getRequestBody(json.toString()))
request.getCodeStatus(familyLive, nowData)
}
}
@ -136,7 +143,7 @@ class DynamicManagementVm : BaseVm() {
*/
fun getTips() {
startHttp(false) {
var body = apiInterface().getTips()
val body = apiInterface().getTips()
body.getCodeStatus(tipsLive, nowData)
}
}
@ -146,7 +153,7 @@ class DynamicManagementVm : BaseVm() {
*/
fun getRank(type: Int, isShowLoading: Boolean = false) {
startHttp(isShowLoading) {
var respnse = apiInterface().getRankList("$type")
val respnse = apiInterface().getRankList("$type")
respnse.getCodeStatus(rankLive, nowData)
}
}
@ -156,8 +163,8 @@ class DynamicManagementVm : BaseVm() {
*/
fun uploadStep(array: JSONArray) {
startHttp(false) {
var rb = retrofits.getRequestBody(array.toString())
var body = apiInterface().uploadStep(rb)
val rb = retrofits.getRequestBody(array.toString())
val body = apiInterface().uploadStep(rb)
body.getCodeStatus(uploadStep, nowData)
}
}
@ -167,8 +174,8 @@ class DynamicManagementVm : BaseVm() {
*/
fun uploadSleep(array: JSONArray) {
startHttp(false) {
var rb = retrofits.getRequestBody(array.toString())
var body = apiInterface().uploadSleep(rb)
val rb = retrofits.getRequestBody(array.toString())
val body = apiInterface().uploadSleep(rb)
body.getCodeStatus(uploadSleep, nowData)
}
}
@ -227,10 +234,10 @@ class DynamicManagementVm : BaseVm() {
*/
fun getWarningMsg() {
startHttp(false) {
var json = JSONObject()
val json = JSONObject()
json.put("userId", CommonUtils.getMyUserId())
var respnse =
val respnse =
apiInterface().getWarningMsgList(retrofits.getRequestBody(json.toString()))
respnse.getCodeStatus(warningMsgLive, nowData)
}
@ -238,7 +245,7 @@ class DynamicManagementVm : BaseVm() {
fun getMqttInfo() {
startHttp(false) {
var response = apiInterface().getMqttInfo()
val response = apiInterface().getMqttInfo()
response.getCodeStatus(mqtt, nowData)
}
}
@ -573,17 +580,17 @@ class DynamicManagementVm : BaseVm() {
1 -> {
statusNS = 1
contentNS = "建模中"
mTimeNS = if (bloodSugarData.time.isNullOrEmpty()) {
mTimeNS = if (uricAcidData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodSugarData.time.contains("-")) {
bloodSugarData.time
} else if (uricAcidData.time.contains("-")) {
uricAcidData.time
} else {
"${
RxTimeTool.simpleDateFormat(
"yyyy-MM-dd HH",
RxTimeTool.string2Date(
"yyyy-MM-dd HH:mm:ss",
bloodSugarData.time
uricAcidData.time
)
)
}:00"
@ -618,12 +625,64 @@ class DynamicManagementVm : BaseVm() {
)
//血脂
var statusXZ = 0
var contentXZ = ""
var mTimeXZ = ""
when (bloodFatData.status) {
//0 未开通 1建模中 2建模完成
0 -> {
if (TextUtils.isEmpty(bloodFatData.expireTime)) {
contentXZ = "未开通"
mTimeXZ = "免费体验100天"
statusXZ = 3
} else {
contentXZ = "续费"
mTimeXZ = RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH:mm")
statusXZ = 0
}
}
1 -> {
statusXZ = 1
contentXZ = "建模中"
mTimeXZ = if (bloodFatData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodFatData.time.contains("-")) {
bloodFatData.time
} else {
// "${
// RxTimeTool.simpleDateFormat(
// "yyyy-MM-dd HH",
// RxTimeTool.string2Date(
// "yyyy-MM-dd HH:mm:ss",
// bloodFatData.time
// )
// )
// }:00"
milliseconds2String(bloodFatData.time)
}
}
2 -> {
statusXZ =
if (bloodFatData.value == "0" || TextUtils.isEmpty(bloodFatData.value)) {
0
} else if (bloodFatData.message.contains("正常")) {
1
} else {
2
}
contentXZ =
if (!TextUtils.isEmpty(bloodFatData.value)) bloodFatData.value else "--"
mTimeXZ = milliseconds2String(bloodFatData.time)
}
}
healthMonitoringList.add(
HealthMonitoringListBean(
"血脂",
0,
"",
"敬请期待",
statusXZ,
mTimeXZ,
contentXZ,
R.mipmap.bg_fat,
R.mipmap.ic_fat,
10
@ -925,17 +984,17 @@ class DynamicManagementVm : BaseVm() {
1 -> {
statusNS = 1
contentNS = "建模中"
mTimeNS = if (bloodSugarData.time.isNullOrEmpty()) {
mTimeNS = if (uricAcidData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodSugarData.time.contains("-")) {
bloodSugarData.time
} else if (uricAcidData.time.contains("-")) {
uricAcidData.time
} else {
"${
RxTimeTool.simpleDateFormat(
"yyyy-MM-dd HH",
RxTimeTool.string2Date(
"yyyy-MM-dd HH:mm:ss",
bloodSugarData.time
uricAcidData.time
)
)
}:00"
@ -970,12 +1029,64 @@ class DynamicManagementVm : BaseVm() {
)
//血脂
var statusXZ = 0
var contentXZ = ""
var mTimeXZ = ""
when (bloodFatData.status) {
//0 未开通 1建模中 2建模完成
0 -> {
if (TextUtils.isEmpty(bloodFatData.expireTime)) {
contentXZ = "未开通"
mTimeXZ = "免费体验100天"
statusXZ = 3
} else {
contentXZ = "续费"
mTimeXZ = RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH:mm")
statusXZ = 0
}
}
1 -> {
statusXZ = 1
contentXZ = "建模中"
mTimeXZ = if (bloodFatData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodFatData.time.contains("-")) {
bloodFatData.time
} else {
// "${
// RxTimeTool.simpleDateFormat(
// "yyyy-MM-dd HH",
// RxTimeTool.string2Date(
// "yyyy-MM-dd HH:mm:ss",
// bloodFatData.time
// )
// )
// }:00"
milliseconds2String(bloodFatData.time)
}
}
2 -> {
statusXZ =
if (bloodFatData.value == "0" || TextUtils.isEmpty(bloodFatData.value)) {
0
} else if (bloodFatData.message.contains("正常")) {
1
} else {
2
}
contentXZ =
if (!TextUtils.isEmpty(bloodFatData.value)) bloodFatData.value else "--"
mTimeXZ = milliseconds2String(bloodFatData.time)
}
}
healthMonitoringList.add(
HealthMonitoringListBean(
"血脂",
0,
"",
"敬请期待",
statusXZ,
mTimeXZ,
contentXZ,
R.mipmap.bg_fat,
R.mipmap.ic_fat,
10
@ -984,7 +1095,6 @@ class DynamicManagementVm : BaseVm() {
}
"X2", "X1" -> {
//其他界面要用到是否为x1,x2的设备判断这里坐下缓存
MMkvHelper.put(Const.X1_X2_Device, true)
//心率
@ -1174,7 +1284,7 @@ class DynamicManagementVm : BaseVm() {
bloodSugarData.time
)
)
}:00"
}"
}
}
@ -1196,6 +1306,7 @@ class DynamicManagementVm : BaseVm() {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else {
"${
// milliseconds2String(bloodFatData.time)
RxTimeTool.simpleDateFormat(
"yyyy-MM-dd HH",
RxTimeTool.string2Date(
@ -1255,20 +1366,14 @@ class DynamicManagementVm : BaseVm() {
1 -> {
statusNS = 1
contentNS = "建模中"
mTimeNS = if (bloodSugarData.time.isNullOrEmpty()) {
mTimeNS = if (uricAcidData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodSugarData.time.contains("-")) {
bloodSugarData.time
} else if (uricAcidData.time.contains("-")) {
uricAcidData.time
} else {
"${
RxTimeTool.simpleDateFormat(
"yyyy-MM-dd HH",
RxTimeTool.string2Date(
"yyyy-MM-dd HH:mm:ss",
bloodSugarData.time
)
)
}:00"
milliseconds2String(uricAcidData.time)
}"
}
}
@ -1301,12 +1406,55 @@ class DynamicManagementVm : BaseVm() {
)
//血脂
var statusXZ = 0
var contentXZ = ""
var mTimeXZ = ""
when (bloodFatData.status) {
//0 未开通 1建模中 2建模完成
0 -> {
if (TextUtils.isEmpty(bloodFatData.expireTime)) {
contentXZ = "未开通"
mTimeXZ = "免费体验100天"
statusXZ = 3
} else {
contentXZ = "续费"
mTimeXZ = RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH:mm")
statusXZ = 0
}
}
1 -> {
statusXZ = 1
contentXZ = "建模中"
mTimeXZ = if (bloodFatData.time.isNullOrEmpty()) {
"${RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH")}:00"
} else if (bloodFatData.time.contains("-")) {
bloodFatData.time
} else {
milliseconds2String(bloodFatData.time)
}
}
2 -> {
statusXZ =
if (bloodFatData.value == "0" || TextUtils.isEmpty(bloodFatData.value)) {
0
} else if (bloodFatData.message.contains("正常")) {
1
} else {
2
}
contentXZ =
if (!TextUtils.isEmpty(bloodFatData.value)) bloodFatData.value else "--"
mTimeXZ = milliseconds2String(bloodFatData.time)
}
}
healthMonitoringList.add(
HealthMonitoringListBean(
"血脂",
0,
"",
"敬请期待",
statusXZ,
mTimeXZ,
contentXZ,
R.mipmap.bg_fat,
R.mipmap.ic_fat,
10
@ -1318,6 +1466,7 @@ class DynamicManagementVm : BaseVm() {
return healthMonitoringList
}
@SuppressLint("SimpleDateFormat")
private fun milliseconds2String(strTime: String): String {
return RxTimeTool.milliseconds2String(
strTime.toLong() * 1000,

@ -1,4 +1,4 @@
package com.xty.healthuser.vm
package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
@ -49,6 +49,8 @@ class HealthVm : BaseVm() {
val saveSuccess by lazy { MutableLiveData<RespBody<Any>>() }
val boundDevices by lazy{MutableLiveData<RespBody<MutableList<BindDeviceListBean>>>()}
val scinceLive by lazy{MutableLiveData<RespBody<MutableList<ScienceBean>>>()}
/**
* 设备类型1血压计2血糖仪.3体脂秤
@ -381,4 +383,11 @@ class HealthVm : BaseVm() {
respnse.getCodeStatus(readLive,nowData)
}
}
fun getScinceList(){
startHttp {
var body= apiInterface().getScinceList()
body.getCodeStatus(scinceLive,nowData)
}
}
}

@ -1,23 +1,21 @@
package com.xty.healthuser.vm
package com.zj365.dc.vm
import android.text.TextUtils
import android.util.Log
import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson
import com.google.gson.internal.LinkedTreeMap
import com.google.gson.reflect.TypeToken
import com.hjq.toast.ToastUtils
import com.tamsiree.rxkit.RxTool
import com.xty.base.vm.BaseVm
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.healthuser.BuildConfig
import com.xty.healthuser.R
import com.xty.common.util.CommonToastUtils
import com.xty.network.model.MainBean
import com.xty.network.model.RespBody
import com.xty.network.model.Update
import com.xty.network.model.WxInfoBean
import com.xty.network.model.WxTokenBean
import com.zj365.dc.BuildConfig
import com.zj365.dc.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
@ -34,23 +32,21 @@ class LoginVm() : BaseVm() {
val setLoginWxId by lazy { MutableLiveData<Long>() }
fun login(account: String, pwd: String) {
if (account.isEmpty()) {
ToastUtils.show(R.string.please_input_phone)
CommonToastUtils.showToast(R.string.please_input_phone)
return
}
if (pwd.isEmpty()) {
ToastUtils.show(R.string.please_input_password)
CommonToastUtils.showToast(R.string.please_input_password)
return
}
startHttp {
var json = JSONObject()
val json = JSONObject()
json.put("phone", account)
json.put("userPwd", RxTool.Md5(pwd))
//json.put("userPwd", pwd)
var login = apiInterface().login(retrofits.getRequestBody(json.toString()))
val login = apiInterface().login(retrofits.getRequestBody(json.toString()))
if (login.body()?.code == 500) {
ToastUtils.show(login.body()?.msg)
login.body()?.msg?.let { CommonToastUtils.showToast(it) }
return@startHttp
}
saveToken(login.raw().headers)
@ -72,11 +68,11 @@ class LoginVm() : BaseVm() {
*/
fun loginCode(account: String, code: String) {
if (account.isEmpty()) {
ToastUtils.show(R.string.please_input_phone)
CommonToastUtils.showToast(R.string.please_input_phone)
return
}
if (code.isEmpty()) {
ToastUtils.show(R.string.please_input_code)
CommonToastUtils.showToast(R.string.please_input_code)
return
}
startHttp {
@ -202,8 +198,8 @@ class LoginVm() : BaseVm() {
fun getVersionNew() {
startHttp {
var response = apiInterface().getVersionNew(BuildConfig.VERSION_CODE)
response.getCodeStatus(updateLive, nowData)
/* var response = apiInterface().getVersionNew(BuildConfig.VERSION_CODE)
response.getCodeStatus(updateLive, nowData)*/
}
}
}

@ -1,4 +1,4 @@
package com.xty.healthuser.vm
package com.zj365.dc.vm
import android.app.Activity
import android.content.Context
@ -6,7 +6,6 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.xty.base.vm.BaseVm
import com.xty.common.util.CommonUtils
import com.xty.healthuser.BuildConfig
import com.xty.network.model.BindDeviceListBean
import com.xty.network.model.RespBody
import com.xty.network.model.UnReadMessageBean
@ -49,7 +48,7 @@ class MainVm : BaseVm() {
}
fun getVersionNew() {
startHttp {
var response = apiInterface().getVersionNew(BuildConfig.VERSION_CODE)
var response = apiInterface().getVersionNew(1/*BuildConfig.VERSION_CODE*/)
response.getCodeStatus(updateLive, nowData)
}
}

@ -0,0 +1,118 @@
package com.zj365.dc.vm
import android.text.TextUtils
import androidx.lifecycle.MutableLiveData
import com.tamsiree.rxkit.RxTool
import com.xty.base.vm.BaseVm
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.common.util.CommonToastUtils
import com.xty.network.model.*
import com.zj365.dc.R
import com.zj365.dc.model.SimpleInfoBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
import okhttp3.Headers
import okhttp3.MultipartBody
import org.json.JSONObject
import java.io.File
class RegisterVm : BaseVm() {
val codeLive by lazy { MutableLiveData<RespBody<String>>() }
val registerVm by lazy { MutableLiveData<RespBody<String>>() }
val mLogin by lazy { MutableLiveData<RespBody<MainBean.User>>() }
fun sendCode(phone: String) {
startHttp {
var code = apiInterface().sendCode(phone)
code.getCodeStatus(codeLive, nowData)
}
}
/**
* 密码校验数字与密码
*/
// private fun isPasswordValid(password: String): Boolean {
// val pattern = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,12}$".toRegex()
// return pattern.matches(password)
// }
fun register(
phone: String,
code: String,
password: String,
birthday: String? = null,
bean: WxInfoBean? = null,
simple: SimpleInfoBean? = null,
invitePhone: String? = ""
) {
if (phone.isEmpty()) {
CommonToastUtils.showToast(R.string.please_input_phone)
return
}
if (code.isEmpty()) {
CommonToastUtils.showToast(R.string.please_input_code)
return
}
if (password.isEmpty()) {
CommonToastUtils.showToast(R.string.please_input_new_pwd)
return
} else {
if (password.length < 6) {
CommonToastUtils.showToast(R.string.please_input_new_pwd)
return
}
}
startHttp {
withContext(Dispatchers.IO) {
val json = JSONObject()
json.put("phone", phone)
// json.put("sex",1) //性别默认传1
json.put("birthday", birthday)
// json.put("birthdayType",birthdayType)
json.put("code", code)
json.put("password", RxTool.Md5(password))
if (!TextUtils.isEmpty(invitePhone)) {
json.put("invitePhone", invitePhone)
}
if (bean != null) {
json.put("openId", bean.openid)
json.put("name", bean.nickname)
json.put("avatarUrl", bean.headimgurl)
json.put("sex", if (bean.sex == 0) 1 else bean.sex)
}
if (simple != null) {
json.put("name", simple.name)
if (simple.avatar.isNotEmpty()) {
val image = async { upLoadImage(simple.avatar) }
val await = image.await()
json.put("avatarUrl", await.fileId)
}
json.put("sex", simple.sex)
}
val register = apiInterface().register(retrofits.getRequestBody(json.toString()))
saveToken(register.raw().headers)
register.body()?.getCodeStatus(registerVm, nowData)
}
}
}
private fun saveToken(headers: Headers) {
var headerIterator = headers.iterator()
while (headerIterator.hasNext()) {
var next = headerIterator.next()
if (Const.Auth_Token == next.first) MMkvHelper.put(Const.Auth_Token, next.second)
if (Const.Auth_Id == next.first) MMkvHelper.put(Const.Auth_Id, next.second)
}
}
suspend fun upLoadImage(image: String): ImageUploadBean {
var file = File(image)
var filbody = retrofits.getMultiPartFileRb(file)
var fileRb = MultipartBody.Part.createFormData("file", file.name, filbody)
var body = apiInterface().uploadImage(fileRb)
return body.data
}
}

@ -1,4 +1,4 @@
package com.xty.healthuser.vm
package com.zj365.dc.vm
import com.xty.base.vm.BaseVm

@ -1,8 +1,8 @@
package com.xty.healthuser.weight
package com.zj365.dc.weight
import android.content.Context
import com.xty.base.dialog.BaseDialog
import com.xty.healthuser.databinding.DialogSignAgainBinding
import com.zj365.dc.databinding.DialogSignAgainBinding
class AgainSignDialog (context: Context, var cancel:()->Unit, var confirm:()->Unit,): BaseDialog(context) {
val binding by lazy{ DialogSignAgainBinding.inflate(layoutInflater)}

@ -1,4 +1,4 @@
package com.xty.healthuser.weight
package com.zj365.dc.weight
import android.content.Context
import android.content.res.TypedArray
@ -10,7 +10,7 @@ import android.util.AttributeSet
import android.view.View
import androidx.annotation.ColorInt
import androidx.recyclerview.widget.RecyclerView
import com.xty.healthuser.R
import com.zj365.dc.R
/**

@ -1,4 +1,4 @@
package com.xty.healthuser.weight
package com.zj365.dc.weight
import android.content.Context
import android.graphics.Canvas

@ -0,0 +1,146 @@
package com.zj365.dc.weight
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.text.SpannableString
import android.text.Spanned
import android.text.TextPaint
import android.text.style.ClickableSpan
import android.view.View
import androidx.core.content.ContextCompat
import com.hjq.toast.ToastUtils
import com.xty.base.dialog.BaseDialog
import com.xty.common.Const
import com.xty.common.MyLinkedMovementMethod
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.zj365.dc.R
import com.zj365.dc.databinding.DialogPrevBinding
class PrevDialog(context: Context, private var agree: () -> Unit, private var giveUp: () -> Unit) :
BaseDialog(context) {
val binding by lazy { DialogPrevBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
override fun initView() {
super.initView()
setCanceledOnTouchOutside(false)
setCancelable(false)
percentHeight = 3 / 5f
setDialogPadding(80, 0, 80, 80)
val txtCol = ContextCompat.getColor(context, R.color.col_009)
binding.mContent.movementMethod = MyLinkedMovementMethod().getInstance()
val string = context.getString(R.string.prev_content)
val span = SpannableString(string)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1)
RouteManager.goAct(ARouterUrl.RICH_TEXT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
}
}, 46, 52, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.putString("title", "隐私政策")
bundle.putString("url", "https://auprty.com/app/static/app/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
ds.clearShadowLayer()
}
}, 53, 59, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.putString("title", "安瑜健康 APP 权限列表")
bundle.putString("url", "https://auprty.com/app/static/app/permission.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
ds.clearShadowLayer()
}
}, 60, 75, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putInt("type", Const.AGREEMENT_1)
RouteManager.goAct(ARouterUrl.RICH_TEXT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
}
}, 85, 91, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.putString("title", "隐私政策")
bundle.putString("url", "https://auprty.com/app/static/app/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
ds.clearShadowLayer()
}
}, 92, 98, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.putString("title", "安瑜健康 APP 权限列表")
bundle.putString("url", "https://auprty.com/app/static/app/permission.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
ds.clearShadowLayer()
}
}, 99, 114, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
binding.mContent.text = span
binding.mContent.highlightColor = Color.TRANSPARENT
binding.mClose.setOnClickListener {
dismiss()
giveUp.invoke()
}
binding.mAgree.setOnClickListener {
dismiss()
agree.invoke()
}
}
}

@ -1,9 +1,9 @@
package com.xty.healthuser.weight
package com.zj365.dc.weight
import android.content.Context
import android.text.Html
import com.xty.base.dialog.BaseDialog
import com.xty.healthuser.databinding.DialogWearBinding
import com.zj365.dc.databinding.DialogWearBinding
class WearDialog(context: Context,var confirm:()->Unit) : BaseDialog(context) {
val binding by lazy { DialogWearBinding.inflate(layoutInflater) }

@ -1,8 +1,7 @@
package com.xty.healthuser.wxapi
package com.zj365.dc.wxapi
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.hjq.toast.ToastUtils
import com.tencent.mm.opensdk.modelbase.BaseReq
import com.tencent.mm.opensdk.modelbase.BaseResp
import com.tencent.mm.opensdk.modelmsg.SendAuth
@ -10,6 +9,7 @@ import com.tencent.mm.opensdk.modelmsg.SendMessageToWX
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler
import com.xty.common.event.WxLoginEvent
import com.xty.common.app.MyApp
import com.xty.common.util.CommonToastUtils
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@ -34,7 +34,7 @@ class WXEntryActivity : AppCompatActivity(), IWXAPIEventHandler {
if(resp is SendAuth.Resp){
EventBus.getDefault().post(WxLoginEvent(resp.code))
}else if(resp is SendMessageToWX){
ToastUtils.show("分享完成")
CommonToastUtils.showSucceedToast("分享完成")
}
}
BaseResp.ErrCode.ERR_USER_CANCEL -> {

@ -1,4 +1,4 @@
package com.xty.healthuser.wxapi
package com.zj365.dc.wxapi
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/col_02c" android:state_selected="true"/>
<item android:color="@color/col_c7c" android:state_selected="false"/>
</selector>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/col_02c" android:state_selected="true"/>
<item android:color="@color/col_c7c" android:state_selected="false"/>
</selector>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_health_selected" android:state_selected="true"/>
<item android:drawable="@mipmap/icon_health_unselected" android:state_selected="false"/>
</selector>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_home_selected" android:state_selected="true"/>
<item android:drawable="@mipmap/icon_home_unselected" android:state_selected="false"/>
</selector>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_message_selected" android:state_selected="true"/>
<item android:drawable="@mipmap/icon_message_unselected" android:state_selected="false"/>
</selector>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_shopping_selected" android:state_selected="true"/>
<item android:drawable="@mipmap/icon_shopping_unselected" android:state_selected="false"/>
</selector>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_message_selected" android:state_selected="true"/>
<item android:drawable="@mipmap/icon_message_unselected" android:state_selected="false"/>
</selector>

@ -4,7 +4,7 @@
<solid android:color="@color/white" />
<stroke
android:color="@color/col_8D0"
android:color="@color/col_02c"
android:width="@dimen/dp_1"/>
<corners
android:radius="@dimen/dp_15" />

@ -5,7 +5,7 @@
<!--虚线边框 android:dashWidth表示'-'这样一个横线的宽度android:dashGap表示之间隔开的距离-->
<stroke
android:width="1dp"
android:color="@color/col_2bb"
android:color="@color/col_02c"
android:dashWidth="@dimen/dp_3"
android:dashGap="@dimen/dp_0_5" />
<!--内部填充色-->

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MissingDefaultResource">
<item android:drawable="@mipmap/ic_start_bg" />
<!-- <item android:drawable="@mipmap/ic_welcome_txt"-->
<!-- android:gravity="center"/>-->
</layer-list>

@ -9,12 +9,12 @@
<include
android:id="@+id/title"
layout="@layout/title_dark_bar" />
layout="@layout/title_white_bar" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rlv_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_17"/>
android:layout_marginTop="@dimen/dp_14"/>
</LinearLayout>

@ -0,0 +1,246 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_54"
android:drawableLeft="@mipmap/icon_black_return"
android:drawablePadding="@dimen/dp_6"
android:gravity="center"
android:text="返回"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_19"
android:layout_marginTop="@dimen/dp_40"
android:text="@string/login_log"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/tab_title"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/dp_19"
android:layout_marginTop="@dimen/dp_67"
android:background="@color/white"
app:xTabMode="scrollable"
app:xTabDisplayNum="5"
app:xTabIndicatorColor="@color/col_02c"
app:xTabIndicatorHeight="@dimen/dp_3"
app:xTabIndicatorRoundY="@dimen/dp_3"
app:xTabIndicatorWidth="@dimen/dp_21"
app:xTabSelectedTextColor="@color/col_02c"
app:xTabSelectedTextSize="@dimen/sp_15"
app:xTabTextColor="@color/col_c7c"
app:xTabTextSize="@dimen/sp_15" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/mAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/shape_r25_eeeeee"
android:hint="@string/please_input_phone"
android:inputType="phone"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:singleLine="true"
android:text=""
android:textColor="@color/col_313"
android:textColorHint="@color/col_c7c"
android:textSize="@dimen/sp_15" />
<RelativeLayout
android:id="@+id/mRelCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:visibility="gone"
>
<EditText
android:id="@+id/mCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/mTvCode"
android:background="@drawable/shape_r25_eeeeee"
android:hint="@string/please_input_code"
android:inputType="number"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:singleLine="true"
android:textColor="@color/col_313"
android:textColorHint="@color/col_c7c"
android:textSize="@dimen/sp_16" />
<TextView
android:id="@+id/mTvCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/selector_login_btn"
android:layout_marginLeft="@dimen/dp_13"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:paddingRight="@dimen/dp_20"
android:text="@string/get_code"
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mRelPwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:background="@drawable/shape_r25_eeeeee">
<EditText
android:id="@+id/mPsw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/mShow"
android:background="@null"
android:hint="@string/please_input_password"
android:inputType="textPassword"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:singleLine="true"
android:text=""
android:textColor="@color/col_313"
android:textColorHint="@color/col_c7c"
android:textSize="@dimen/dp_16" />
<ImageView
android:id="@+id/mShow"
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="center"
android:src="@drawable/selector_pwd" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/mError"
android:layout_width="wrap_content"
android:layout_height="29dp"
android:textColor="@color/col_e03"
android:visibility="gone"
android:textSize="@dimen/sp_14" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/seleck"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_15"
android:background="@drawable/selctor_check_sel"
android:padding="@dimen/dp_10" />
<TextView
android:id="@+id/mPrivate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_8"
android:gravity="center"
android:textSize="@dimen/sp_13"
android:text="隐私条款"
android:textColor="@color/col_c7c" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_72"
android:layout_marginRight="@dimen/dp_10">
<TextView
android:id="@+id/mLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/selector_login_btn"
android:gravity="center"
android:padding="@dimen/dp_16"
android:text="@string/sign_in"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
<TextView
android:id="@+id/mRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/mLogin"
android:layout_marginTop="@dimen/sp_20"
android:text="新用户注册"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/mForget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/mLogin"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/sp_20"
android:text="@string/forget"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

@ -0,0 +1,186 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_20"
android:paddingRight="@dimen/dp_20">
<TextView
android:id="@+id/tv_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="返回"
android:gravity="center"
android:drawablePadding="@dimen/dp_6"
android:drawableLeft="@mipmap/icon_black_return"
android:textColor="@color/col_313"
android:layout_marginTop="@dimen/dp_54"
android:textSize="@dimen/sp_15"/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/mTvPswLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_45"
android:text="@string/register"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
<EditText
android:id="@+id/mAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_r25_eeeeee"
android:hint="@string/please_input_phone"
android:inputType="phone"
android:layout_marginTop="@dimen/dp_62"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:textColorHint="@color/col_c7c"
android:paddingLeft="@dimen/dp_20"
android:textColor="@color/col_313"
android:singleLine="true"
android:textSize="@dimen/sp_13" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26">
<EditText
android:id="@+id/mCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/mTvCode"
android:background="@drawable/shape_r25_eeeeee"
android:hint="@string/please_input_code"
android:inputType="number"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:textColorHint="@color/col_c7c"
android:paddingLeft="@dimen/dp_20"
android:textColor="@color/col_313"
android:singleLine="true"
android:textSize="@dimen/sp_13" />
<TextView
android:id="@+id/mTvCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_13"
android:background="@drawable/selector_login_btn"
android:paddingLeft="@dimen/dp_18"
android:paddingTop="@dimen/dp_18"
android:paddingRight="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:textStyle="bold"
android:text="@string/get_code"
android:textColor="@color/white"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mRelPwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_r25_eeeeee"
android:layout_marginTop="@dimen/dp_30">
<EditText
android:id="@+id/mPsw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_r25_eeeeee"
android:hint="请输入6位密码"
android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18"
android:textColorHint="@color/col_c7c"
android:paddingLeft="@dimen/dp_20"
android:textColor="@color/col_313"
android:singleLine="true"
android:textSize="@dimen/sp_13" />
<ImageView
android:id="@+id/mShow"
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="center"
android:src="@drawable/selector_pwd" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/mRegister"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selector_login_btn"
android:gravity="center"
android:padding="@dimen/dp_16"
android:text="立即注册"
android:textColor="@color/white"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_57"
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/mPrivate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginTop="@dimen/dp_17"
android:drawableLeft="@drawable/selctor_check_sel"
android:drawablePadding="@dimen/dp_6"
android:gravity="center"
android:text="隐私条款"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_12"
tools:ignore="UseCompatTextViewDrawableXml" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提示:"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_14"
android:layout_marginTop="@dimen/dp_102"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请绑定自己的手机号,平台将对您的手机号做保密隐私管理,仅用于必要服务沟通和用户绑定。"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_14"
android:layout_marginBottom="@dimen/dp_93"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_f1f"
android:orientation="vertical">
<include
android:id="@+id/title"
layout="@layout/title_white_bar" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecycle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="vertical"
android:overScrollMode="never" />
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

@ -1,18 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/home_coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:background="#F2F6F7">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
tools:context=".act.MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/mVp2"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="@+id/mBottom"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/mBottom"
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_gravity="bottom"
android:background="@color/white"
android:theme="@style/myNavigationDrawerStyle"
app:elevation="0dp"
app:itemBackground="@null"
app:itemTextColor="@color/bottom_nav_col"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_bar" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/gifImageVIew"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_18"
app:layout_constraintBottom_toBottomOf="@+id/mBottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_14"
android:paddingRight="@dimen/dp_14">
<LinearLayout
android:id="@+id/llguide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_ai_tongue_diagnosis"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon_ai_tongue_diagnosis"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AI舌诊"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_ai_skin_measurement"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon__ai_skin_measurement"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AI测肤"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_ai_confectioner"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon_ai_confectioner"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AI糖医"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_mental_test"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon_mental_test"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="心理测试"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_cancer_screening"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon_cancer_screening"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="防癌筛查"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_diet_management"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
android:background="@mipmap/icon_diet_management"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="膳食管理"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -49,7 +49,7 @@
android:layout_marginStart="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"/>
<com.xty.healthuser.weight.HIndicator
<com.zj365.dc.weight.HIndicator
android:id="@+id/hi_indicator"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_4"
@ -724,7 +724,7 @@
android:paddingBottom="@dimen/dp_5"
android:text="查看"
android:textColor="@color/col_8D0"
android:textSize="@dimen/dp_12" />
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<RelativeLayout

@ -5,7 +5,6 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -25,12 +24,16 @@
android:padding="@dimen/dp_10"
android:text="@string/prev_title"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_20"
android:textSize="@dimen/sp_20"
android:textStyle="bold" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:layout_above="@+id/mAgree"
android:layout_below="@+id/mTitle">
@ -40,10 +43,11 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:lineSpacingExtra="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:text="@string/prev_content"
android:textColor="@color/col_455"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
</androidx.core.widget.NestedScrollView>
<TextView
@ -58,10 +62,9 @@
android:background="@drawable/shape_btn_select_bg"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="@string/agree_prev"
android:textColor="@color/white"
android:textSize="@dimen/dp_18" />
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/mClose"
@ -74,7 +77,7 @@
android:padding="@dimen/dp_10"
android:text="@string/give_up"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_18" />
android:textSize="@dimen/sp_18" />
</RelativeLayout>

@ -28,7 +28,7 @@
android:layout_weight="1"
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="健康监测"
android:text="今日数据"
android:textColor="#313131"
android:textSize="@dimen/sp_17"
android:textStyle="bold"
@ -39,11 +39,11 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@mipmap/arrow_right"
android:drawableRight="@mipmap/icon_arrow_left"
android:drawablePadding="@dimen/dp_5"
android:text="@string/detail"
android:textColor="@color/col_97a"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"
tools:ignore="UseCompatTextViewDrawableXml" />
</LinearLayout>
@ -123,6 +123,7 @@
android:layout_height="@dimen/dp_1"
android:layout_marginEnd="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_15"
android:visibility="gone"
android:background="#EBF0F2"/>
<LinearLayout
@ -134,6 +135,7 @@
android:paddingBottom="@dimen/dp_22"
android:paddingTop="@dimen/dp_17"
android:layout_marginTop="@dimen/dp_3"
android:visibility="gone"
android:orientation="horizontal">
<TextView

@ -174,7 +174,7 @@
android:layout_marginTop="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_6"
android:background="@drawable/shape_white_8radius"
android:background="@drawable/shape_8round_white"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_16">
@ -185,7 +185,7 @@
android:layout_marginTop="@dimen/dp_22"
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_11"
android:text="24小时健康评估"
android:text="24小时监测"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
android:textStyle="bold"
@ -198,10 +198,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_14"
android:drawableRight="@mipmap/arrow_right"
android:drawableRight="@mipmap/icon_arrow_left"
android:drawablePadding="@dimen/dp_5"
android:text="查看详情"
android:textColor="@color/col_C7C"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"
app:layout_constraintBottom_toBottomOf="@+id/tvProfession"
app:layout_constraintEnd_toEndOf="parent"
@ -215,6 +215,7 @@
android:layout_marginEnd="@dimen/dp_1"
android:layout_marginBottom="@dimen/dp_3"
android:src="@mipmap/ic_mascot"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
@ -253,7 +254,7 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="评估结果:"
android:textColor="@color/col_6b3"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_13"
android:textStyle="bold" />
@ -277,7 +278,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center_vertical"
android:textColor="@color/col_a8a"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_13"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/mWearInfo"
@ -301,7 +302,7 @@
android:paddingRight="@dimen/dp_35"
android:paddingBottom="@dimen/dp_8"
android:text="请绑定手表"
android:textColor="@color/col_2bb"
android:textColor="@color/col_02c"
android:textSize="@dimen/dp_14"
android:textStyle="bold"
android:visibility="gone"
@ -314,11 +315,12 @@
android:id="@+id/mWearInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_17"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginLeft="@dimen/dp_15"
android:text=""
android:textColor="@color/col_444"
android:textSize="@dimen/sp_10"
tools:text="总佩戴天数: 0天 | 活跃天数: 0天 | 休眠天数: 0天 "
android:textColor="@color/col_313"
android:textSize="@dimen/sp_12"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mHealthStatus" />
@ -335,7 +337,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mWearInfo"
app:marqueeAnimDuration="2000"
app:smvTextColor="@color/col_0098"
app:smvTextColor="@color/col_02c"
app:smvTextEllipsize="end"
app:smvTextGravity="center_vertical"
app:smvTextSingleLine="true"

@ -14,7 +14,7 @@
android:layout_marginTop="@dimen/dp_22"
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="健康报告"
android:text="监测报告"
android:textColor="#313131"
android:textSize="@dimen/sp_17"
android:textStyle="bold"

@ -0,0 +1,171 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/statusBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent" />
<!-- 下拉刷新控件 -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:srlAccentColor="@color/white">
<!-- 经典下拉头部 -->
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foregroundTint="@color/white"
app:srlAccentColor="@color/white"
app:srlPrimaryColor="@color/white" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 头部信息 -->
<include
android:id="@+id/mCom"
layout="@layout/frag_health_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
android:id="@+id/mBannerCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
app:cardCornerRadius="@dimen/dp_5"
app:cardElevation="@dimen/dp_0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mCom">
<com.youth.banner.Banner
android:id="@+id/mBanner"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:background="@drawable/shape_banner_bg"
app:banner_indicator_normal_color="@color/col_298D0"
app:banner_indicator_selected_color="@color/col_8D0"
app:banner_infinite_loop="true"
app:banner_loop_time="4000" />
</androidx.cardview.widget.CardView>
<include
android:id="@+id/mChild_view"
layout="@layout/child_healt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
app:layout_constraintTop_toBottomOf="@+id/mBannerCard" />
<androidx.cardview.widget.CardView
android:id="@+id/mBannerCardTwo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
app:cardCornerRadius="@dimen/dp_5"
app:cardElevation="@dimen/dp_0"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mChild_view">
<com.youth.banner.Banner
android:id="@+id/mBannerTwo"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:background="@drawable/shape_banner_bg"
app:banner_indicator_normal_color="@color/col_298D0"
app:banner_indicator_selected_color="@color/col_8D0"
app:banner_infinite_loop="true"
app:banner_loop_time="4000" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_12"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_16"
android:paddingRight="@dimen/dp_16"
android:paddingBottom="@dimen/dp_21"
android:paddingTop="@dimen/dp_23"
app:layout_constraintTop_toBottomOf="@+id/mBannerCardTwo"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_12"
android:text="@string/server_4"
android:textColor="@color/col_515"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_12"
android:text="查看更多"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"
android:drawableRight="@mipmap/icon_arrow_left"
android:layout_alignParentEnd="true"
android:drawablePadding="@dimen/dp_2"
/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecycleNews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:paddingBottom="@dimen/dp_10" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/viewgroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:paddingBottom="@dimen/dp_15"
android:paddingTop="@dimen/dp_40">
<LinearLayout
android:id="@+id/mHeaderLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/dp_15"
app:layout_constraintBottom_toTopOf="@+id/ll_home_about"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="horizontal">
<!-- 我的家人列表 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecycle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_5" />
</LinearLayout>
<RelativeLayout
android:id="@+id/mMsgLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_25">
<ImageView
android:id="@+id/mMsg"
android:layout_width="@dimen/dp_20"
android:layout_height="wrap_content"
android:src="@mipmap/ic_health_msg" />
<androidx.cardview.widget.CardView
android:id="@+id/mBadgeCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:visibility="gone"
app:cardBackgroundColor="@color/col_f23"
app:cardCornerRadius="@dimen/dp_10"
app:cardElevation="0dp">
<TextView
android:id="@+id/mBadge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/dp_12" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_home_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_14"
app:layout_constraintTop_toBottomOf="@+id/mHeaderLayout"
app:layout_constraintLeft_toLeftOf="parent">
<LinearLayout
android:id="@+id/ll_daily_benefit"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon_daily_benefit"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="每日福利"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="11dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_video_interview"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon__video_interview"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="视频问诊"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="11dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_health_records"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon__health_records"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康档案"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="11dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_health_code"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon__health_code"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康医典"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="11dp"/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 健康评估cardview -->
</androidx.constraintlayout.widget.ConstraintLayout>

@ -317,25 +317,6 @@
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/mChild_home_view" />
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/bg_slogan"-->
<!-- android:gravity="center_horizontal"-->
<!-- android:layout_marginTop="@dimen/dp_5"-->
<!-- android:padding="@dimen/dp_15"-->
<!-- android:text="- 安瑜健康 • 因爱而生 -"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/dp_15"-->
<!-- android:textStyle="bold"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/mChild_view" />-->
<!-- &lt;!&ndash; 敬请期待 &ndash;&gt;-->
<!-- <include-->
<!-- android:id="@+id/mDynamic_view"-->
<!-- layout="@layout/child_dynamic_view"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/mChild_view" />-->
</LinearLayout>

@ -0,0 +1,839 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/mNoNetwork"
layout="@layout/view_no_network"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_f2f">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_f2f"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mInfo"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_310"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_header"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_260"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/white"
app:layout_constraintLeft_toLeftOf="parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/mImage"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_54"
app:civ_border_width="@dimen/dp_1"
android:src="@mipmap/icon_default_avator"
app:civ_border_color="@color/white"
app:civ_border_overlay="true"
app:civ_circle_background_color="#66B0B4B4"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/mName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_5"
android:ellipsize="end"
android:gravity="start"
android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/view"
app:layout_constraintEnd_toStartOf="@+id/img_arrow"
app:layout_constraintStart_toStartOf="@+id/mPhone"
tools:text="张灵甫" />
<ImageView
android:id="@+id/img_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_arrow_left"
android:layout_marginRight="@dimen/dp_34"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/mImage"
app:layout_constraintBottom_toBottomOf="@+id/mImage"/>
<TextView
android:id="@+id/mPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_16"
app:layout_constraintLeft_toRightOf="@+id/mImage"
app:layout_constraintTop_toBottomOf="@+id/view"
tools:text="12312414234" />
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/mImage"
app:layout_constraintTop_toTopOf="@+id/mImage" />
<LinearLayout
android:id="@+id/ll_mine"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_25"
android:orientation="horizontal"
android:weightSum="4"
android:background="@color/white"
app:layout_constraintTop_toBottomOf="@+id/mImage">
<LinearLayout
android:id="@+id/mllIntegral"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/mIntegral"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
tools:text="6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="我的积分"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<LinearLayout
android:id="@+id/mllCoupon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/mProg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
tools:text="123" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="优惠卡券"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<LinearLayout
android:id="@+id/mllWallet"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/mTvSource"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
tools:text="1233" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="我的钱包"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<LinearLayout
android:id="@+id/llOrder"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvInviteCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
tools:ignore="HardcodedText"
tools:text="123" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="我的订单"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_12"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/h1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.65"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/h1"
>
<LinearLayout
android:id="@+id/mllMember"
android:layout_width="0dp"
android:layout_height="@dimen/dp_70"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_weight="0.7"
android:background="@mipmap/bg_mine_member"
android:paddingLeft="@dimen/dp_19"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:src="@mipmap/icon_memeber" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="会员权益"
android:textColor="@color/col_fac"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginLeft="@dimen/dp_6"
/>
</LinearLayout>
<TextView
android:id="@+id/tv_member_validity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="有效期至2033-12-12 15:24:36"
android:textColor="@color/col_fac"
android:textSize="@dimen/sp_12"
tools:ignore="UseCompatTextViewDrawableXml" />
</LinearLayout>
<LinearLayout
android:id="@+id/mAppreciation"
android:layout_width="0dp"
android:layout_height="@dimen/dp_70"
android:layout_marginEnd="@dimen/dp_14"
android:layout_weight="0.3"
android:layout_marginLeft="@dimen/dp_18"
android:background="@mipmap/bg_mine_appreciation"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:src="@mipmap/icon_apprecoation_mine" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="增值服务"
android:textColor="@color/col_fac"
android:layout_marginTop="@dimen/dp_8"
android:textSize="@dimen/dp_14"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_156"
android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:background="@drawable/shape_8round_white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="@dimen/dp_16"
android:orientation="horizontal">
<View
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_19"
android:background="@color/col_02c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康管理"
android:layout_marginLeft="@dimen/dp_10"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_health_record"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:src="@mipmap/icon_health_record"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康档案"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_health_monitor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon_health_monitor"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康监测"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_health_daily"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon_health_daily"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康日报"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_data_comparsion"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon_data_comparison"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="数据对比"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_135"
android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_12"
android:background="@drawable/shape_8round_white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="@dimen/dp_16"
android:orientation="horizontal">
<View
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_19"
android:background="@color/col_02c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="权益工具"
android:layout_marginLeft="@dimen/dp_10"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_start_bs"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_mine_start_bs"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2999创业"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_daily_poster"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_daily_poster"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今日海报"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_wearable_device"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_wearable_device"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="穿戴设备"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_family_health"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_family_health"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="家人健康"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_12"
android:background="@drawable/shape_8round_white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
android:layout_marginLeft="@dimen/dp_16"
android:orientation="horizontal">
<View
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_19"
android:background="@color/col_02c"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="关于平台"
android:layout_marginLeft="@dimen/dp_10"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_customer_service"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_customer_service"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="客服服务"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_enterprise_data"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_enterprise_data"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="企业资料"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_about_us"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_about_us"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="关于我们"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_up_graded"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_up_graded"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="版本升级"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_22"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_shipping_address"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_shipping_address"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收货地址"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_operation_guide"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon__operation_guide"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="操作指南"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_setting"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_setting"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:visibility="invisible"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_up_graded"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="版本升级"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_12"
android:textColor="@color/col_7c7"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_19"
android:text="以上服务由中健三六五提供"
android:textSize="@dimen/sp_12"
android:textColor="@color/col_6B6"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

@ -0,0 +1,40 @@
<?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:background="@drawable/shape_8round_white"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_device_icon"
android:layout_width="@dimen/dp_63"
android:layout_height="@dimen/dp_63"
tools:src="@mipmap/ic_blutooth_watch" />
<TextView
android:id="@+id/tv_device_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_7"
android:textSize="@dimen/sp_20"
android:textColor="@color/col_313"
android:textStyle="bold"
tools:text="4G手表(A3)" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_144"
android:layout_gravity="center_horizontal"
android:background="@mipmap/bg_xl"
tools:ignore="MissingDefaultResource">
<ImageView
android:id="@+id/ivBg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:visibility="gone"
android:src="@mipmap/bg_xl"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<LinearLayout
android:id="@+id/ll_health_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_16"
app:layout_constraintTop_toTopOf="parent"
>
<ImageView
android:id="@+id/mHealthIcon"
android:layout_width="@dimen/dp_19"
android:layout_height="@dimen/dp_19"
tools:src="@mipmap/ic_xl" />
<TextView
android:id="@+id/mHealthName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="即可"
/>
</LinearLayout>
<ImageView
android:id="@+id/mHealthStatus"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_health_title"
tools:src="@mipmap/ic_health_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_17"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mHealthStatus">
<TextView
android:id="@+id/mHealthInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_3"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="sdfsdg" />
<TextView
android:id="@+id/tvCalorie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_9"
tools:text="sdfsdg" />
<TextView
android:id="@+id/mHealthTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_7c7"
android:textSize="@dimen/sp_9"
tools:text="sdgasdg" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -9,8 +9,8 @@
<androidx.cardview.widget.CardView
android:id="@+id/mCard"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_80"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_83"
app:cardCornerRadius="@dimen/dp_5"
app:cardElevation="@dimen/dp_0"
app:layout_constraintLeft_toLeftOf="parent"
@ -30,9 +30,9 @@
android:layout_height="match_parent"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/col_455"
android:textColor="@color/col_333"
android:textSize="@dimen/sp_14"
android:paddingLeft="@dimen/dp_10"
android:paddingLeft="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintLeft_toRightOf="@+id/mCard"
app:layout_constraintRight_toRightOf="parent"
@ -45,9 +45,9 @@
android:layout_height="match_parent"
android:ellipsize="end"
android:lines="1"
android:paddingLeft="@dimen/dp_12"
android:textColor="@color/col_455"
android:textSize="@dimen/sp_14"
android:paddingLeft="@dimen/dp_16"
android:textColor="@color/col_888"
android:textSize="@dimen/sp_12"
app:layout_constraintTop_toBottomOf="@+id/mTitle"
app:layout_constraintLeft_toRightOf="@+id/mCard"
app:layout_constraintRight_toRightOf="parent" />
@ -57,9 +57,11 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:ellipsize="end"
android:paddingLeft="@dimen/dp_12"
android:textColor="@color/col_97a"
android:textSize="@dimen/sp_14"
android:paddingLeft="@dimen/dp_16"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_11"
android:drawablePadding="@dimen/dp_2"
android:drawableLeft="@mipmap/icon_news_times"
app:layout_constraintTop_toBottomOf="@+id/mOrgName"
app:layout_constraintLeft_toRightOf="@+id/mCard"
app:layout_constraintRight_toRightOf="parent" />

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mContentView"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_10"
app:cardElevation="@dimen/dp_0"
tools:ignore="MissingDefaultResource">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/mTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="@dimen/dp_10"
android:textColor="@color/col_455"
android:textSize="@dimen/dp_16" />
<TextView
android:id="@+id/mTvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="@dimen/dp_10"
android:textColor="@color/col_919"
android:textSize="@dimen/dp_14" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentTop="true"
android:background="@color/col_f1f" />
<TextView
android:id="@+id/mContent"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:gravity="center_vertical"
android:ellipsize="end"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:maxLines="2"
android:textColor="@color/col_B8B"
android:textSize="@dimen/dp_14" />
</LinearLayout>
</androidx.cardview.widget.CardView>

@ -4,19 +4,19 @@
<item
android:id="@+id/nav_health"
android:icon="@drawable/sel_health"
android:title="@string/health"
android:icon="@drawable/sel_home"
android:title="@string/home"
app:showAsAction="ifRoom" />
<item
android:id="@+id/nav_server"
android:icon="@drawable/sel_server"
android:title="@string/server"
android:title="@string/shopping"
app:showAsAction="ifRoom" />
<item
android:id="@+id/nav_dynamic_management"
android:icon="@drawable/sel_health"
android:title="@string/dynamic_management"
android:title="健康管理"
app:showAsAction="ifRoom" />
<item
android:id="@+id/nav_message"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save