Compare commits

..

9 Commits

@ -40,9 +40,9 @@ android {
//.
JPUSH_CHANNEL : "developer-default",
OPPO_APPKEY : "OP-", // OPPOappkey
OPPO_APPID : "OP-", // OPPOappid
OPPO_APPSECRET: "OP-",//OPPOappsecret
OPPO_APPKEY : "OP-5c4377948c564b09ba4894642e0bb6fc", // OPPOappkey
OPPO_APPID : "OP-31015591", // OPPOappid
OPPO_APPSECRET: "OP-7240a5dfcb2b4017bd50193d18c74f79",//OPPOappsecret
XIAOMI_APPKEY : "MI-5992028541716",// appkey
XIAOMI_APPID : "MI-2882303761520285716", // appid
@ -134,7 +134,7 @@ dependencies {
implementation project(':mine')
// implementation project(':AYCrashGuard')
kapt rely.arouter_compiler
kapt rely.GifDrawable
// kapt rely.GifDrawable
kapt rely.xutil
}

@ -84,6 +84,11 @@
<uses-sdk tools:overrideLibrary="com.yucheng.ycbtsdk" />
<!-- ********OPPO 推送 start******** -->
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" />
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" />
<!--********OPPO 推送 end******** -->
<application
android:name="com.xty.common.app.MyApp"
android:allowBackup="true"

@ -1,54 +1,44 @@
package com.zj365.dc.activity
import android.Manifest
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.Uri
import android.os.Build
import android.text.TextUtils
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.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.blankj.utilcode.util.ArrayUtils
import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.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.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog
import com.xty.base.dialog.DialogActivities
import com.xty.base.vp2.VpAdapter
import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.common.MMkvHelper
import com.xty.common.aMapUtils.AmapInit
import com.xty.common.app.MyApp
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BindDevEvent
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.MeasureWeightEvent
import com.xty.common.event.MqttReceive
import com.xty.common.event.MyInfoEvent
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.common.util.ViewScreenshotUtils
import com.xty.network.model.InviteCustodyBean
import com.xty.network.utils.AppUtils
import com.zj365.dc.BuildConfig
@ -60,18 +50,13 @@ import com.zj365.dc.fragment.MessageFragment
import com.zj365.dc.fragment.MineFrag
import com.zj365.dc.fragment.ShopFragment
import com.zj365.dc.vm.MainVm
import com.zj365.health.act.binddevice.BaseDeviceBindListAct
import com.zj365.health.act.binddevice.BlueUtil
import com.zj365.health.weight.DialogTipNew
import com.zj365.mime.act.DevInfoAct
import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import me.leolin.shortcutbadger.ShortcutBadger
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>*/ {
@ -470,7 +455,7 @@ class MainActivity : BaseVmAct<MainVm>()/*, Consumer<AbstractMeasureData>*/ {
fun reveiveMsg(event: MqttReceive) {
}
/* override fun accept(abstractMeasureData: AbstractMeasureData) {
/* override fun accept(abstractMeasureData: AbstractMeasureData) {
if (abstractMeasureData is WeightMeasureData) {
if (!abstractMeasureData.isProcessingData) {
Log.i("LS-Bluetooth", "收到测量过程数据:${JSON.toJSONString(abstractMeasureData)}")
@ -487,8 +472,6 @@ class MainActivity : BaseVmAct<MainVm>()/*, Consumer<AbstractMeasureData>*/ {
}
}*/
override fun onDestroy() {
super.onDestroy()
AmapInit.stopLocation()

@ -28,7 +28,6 @@ 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.network.utils.AppUtils
import com.zj365.dc.BuildConfig
import com.zj365.dc.databinding.ActWelcomeBinding

@ -35,6 +35,7 @@ import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission
import com.xty.common.bracelet.isGpsOpen
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BindDevEvent
import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.ChangeFamilyEvent
@ -1263,7 +1264,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
private var mDisposable: Disposable? = null
fun startUpdateHealthInfoLive(){
LogUtils.e("DynamicManagementFrag","刷新数据 disposable:${mDisposable}")
if(mDisposable == null){
Observable.interval(1000 * 60,60*1000,TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<Long>{
@ -1621,7 +1621,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
@Subscribe(threadMode = ThreadMode.MAIN)
fun loginOutChange(event: LoginOutEvent){
LogUtils.e(TAG,"loginOutChange")
isJob = false
cancelTimer()
@ -1659,6 +1658,20 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun backGroundEvent(event:BackGroundEvent){
if (event.isBackGround){
if(!TextUtils.isEmpty(showIdInfo)){
isJob = false
cancelTimer()
}
}else{
if(!TextUtils.isEmpty(showIdInfo)){
request()
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun bindDevSuccess(event: BindDevEvent){
// getXtInfo(showIdInfo)

@ -124,10 +124,16 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
}
5 -> { //内部跳转
// bundle.clear()
// bundle.putString("title", bannerBean.title)
// bundle.putString("url", bannerBean.linkAddress)
// RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.clear()
bundle.putString("title", bannerBean.title)
bundle.putString("url", bannerBean.linkAddress)
RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.putString(
"web_site_url",
"${bannerBean.linkAddress}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
15 ->{ //视频跳转
@ -135,10 +141,16 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
}
10 -> {//web 跳转
// bundle.clear()
// bundle.putString("title", bannerBean.title)
// bundle.putString("url", bannerBean.linkAddress)
// RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.clear()
bundle.putString("title", bannerBean.title)
bundle.putString("url", bannerBean.linkAddress)
RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.putString(
"web_site_url",
"${bannerBean.linkAddress}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
20 ->{
val appId = "wx032bacb749c0dcb0" // 填移动应用(App)的 AppId非小程序的 AppID
@ -180,17 +192,29 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
}
5 -> { //内部跳转
// bundle.clear()
// bundle.putString("title", bannerBean.title)
// bundle.putString("url", bannerBean.linkAddress)
// RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.clear()
bundle.putString("title", bannerBean.title)
bundle.putString("url", bannerBean.linkAddress)
RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.putString(
"web_site_url",
"${bannerBean.linkAddress}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
10 -> {//web 跳转
// bundle.clear()
// bundle.putString("title", bannerBean.title)
// bundle.putString("url", bannerBean.linkAddress)
// RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.clear()
bundle.putString("title", bannerBean.title)
bundle.putString("url", bannerBean.linkAddress)
RouteManager.goAct(ARouterUrl.WEB_ACT, bundle)
bundle.putString(
"web_site_url",
"${bannerBean.linkAddress}"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
15 ->{ //视频跳转

@ -41,6 +41,7 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
val bundle = Bundle()
bundle.clear()
bundle.putString("title", "用户协议")
bundle.putBoolean("isAgree", false)
bundle.putString("url","https://dc.zhongjian365.com/agreement.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}
@ -56,6 +57,8 @@ class PrevDialog(context: Context, private var agree: () -> Unit, private var gi
override fun onClick(widget: View) {
val bundle = Bundle()
bundle.putString("title", "隐私政策")
bundle.putBoolean("isAgree", false)
bundle.putString("url", "https://dc.zhongjian365.com/privacy.html")
RouteManager.goAct(ARouterUrl.AGREEMNT_READ_WEB_ACT, bundle)
}

@ -3,4 +3,4 @@
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"/>
android:scaleType="centerCrop"/>

@ -56,7 +56,7 @@
<com.youth.banner.Banner
android:id="@+id/mBanner"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:layout_height="@dimen/dp_100"
android:background="@drawable/shape_banner_bg"
app:banner_indicator_normal_color="@color/col_298D0"
app:banner_indicator_selected_color="@color/col_8D0"
@ -89,7 +89,7 @@
<com.youth.banner.Banner
android:id="@+id/mBannerTwo"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:layout_height="@dimen/dp_100"
android:background="@drawable/shape_banner_bg"
app:banner_indicator_normal_color="@color/col_298D0"
app:banner_indicator_selected_color="@color/col_8D0"

@ -176,6 +176,7 @@ open class CloudJSBridge(val context: Context, val listener: IJsBridge) {
@JavascriptInterface
fun jumpWallet(str: String?){
str?.let {
LogUtils.e("eeeee",it)
var wxBean = GsonUtils.fromJson(it, OpenWXBean::class.java)
val appId = "wx032bacb749c0dcb0" // 填移动应用(App)的 AppId非小程序的 AppID

@ -6,6 +6,7 @@ import android.os.Looper
import android.os.Message
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
@ -137,6 +138,7 @@ open class PayUtils(var context: Context) {
tvZhifu.text = "确认支付"
}
val llDuihuan = view.findViewById<LinearLayout>(R.id.llDuihuan)
llDuihuan.visibility = View.GONE
llDuihuan.setOnClickListener {
tvWeixin.isSelected = false
tvZhifubao.isSelected = false

@ -138,7 +138,6 @@
android:layout_marginBottom="@dimen/dp_85"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_10"
android:visibility="gone"
android:paddingBottom="@dimen/dp_10">
<TextView

@ -34,6 +34,7 @@ import com.umeng.commonsdk.UMConfigure
import com.xty.common.*
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.receiver.BluetoothMonitorReceiver
import com.xty.network.utils.AppUtils
@ -120,6 +121,11 @@ class MyApp : Application() {
override fun onActivityStarted(p0: Activity) {
LogUtils.e("APP","前台呀")
if(activityCount == 0){
EventBus.getDefault().post(BackGroundEvent(false))
}
activityCount++
}
@ -133,6 +139,9 @@ class MyApp : Application() {
LogUtils.e("APP","后台")
activityCount--
LogUtils.e("APP","后台${activityCount}")
if(activityCount == 0){
EventBus.getDefault().post(BackGroundEvent(true))
}
}

@ -171,15 +171,17 @@ class ARouterUrl {
const val XT_OPEN = "/health/com/zj365/health/act/XTangOpenAct"
const val XT_HISTORY = "/health/com/zj365/health/act/XTangHistoryAct"
const val XT_UPLOAD = "/health/com/zj365/health/act/XTangUploadAct"
// const val XT_HOW_OPEN = "/health/com/zj365/health/act/XTangHowOpenAct"
const val XT_HOW_OPEN = "/health/com/zj365/health/act/XTangHowOpenAct"
//尿酸
const val NS_OPEN = "/health/com/zj365/health/act/NSuanOpenAct"
// const val NS_HOW_OPEN = "/health/com/zj365/health/act/NSuanHowOpenAct"
const val NS_HOW_OPEN = "/health/com/zj365/health/act/NSuanHowOpenAct"
const val NS_MESSAGE_PERFECT = "/health/com/zj365/health/act/NSuanMessagePerfectAct"
const val URIC_CALIBRATION_SUBMIT = "/health/com/xty/health/act/UricCalibrationSubmitAct"
const val URIC_CALIBRATION_HISTORY = "/health/com/xty/health/act/UricCalibrationHistoryAct"
const val XZ_OPEN = "/health/com/xty/health/act/XZhiOpenAct"
const val XZ_HOW_OPEN = "/health/com/xty/health/act/XZhiHowOpenAct"
const val BL_FAT_EXCEPTION_DATA = "/health/com/zj365/health/fragment/bloodlipid/BloodFatExceptionDataAct"
const val BL_ADJUST_RECORD ="/health/com/zj365/health/act/BloodLipidAdjustRecordsAct" //血脂校准记录
const val BL_ADJUST = "/health/com/zj365/health/act/BloodLipidAdjustAct" //血脂校准

@ -0,0 +1,4 @@
package com.xty.common.event
class BackGroundEvent(var isBackGround:Boolean) {
}

@ -80,6 +80,8 @@
<string name="xt_open">血糖开通</string>
<string name="xt_renew">血糖续费</string>
<string name="ns_renew">尿酸续费</string>
<string name="xz_renew">血脂续费</string>
<string name="xt_history">上传记录</string>
<string name="xt_upload">血糖上传</string>
<string name="xt_calibration">血糖校准</string>
@ -87,6 +89,7 @@
<string name="xd_detail">心电详情</string>·
<string name="blood_align_history">校准记录</string>
<string name="xz_open">血脂开通</string>
<string name="ns_open">尿酸开通</string>
<string name="ns_message_perfect">完善尿酸信息</string>
@ -184,7 +187,7 @@
<string name="sleep_oo_intro">参考值:≥95%</string>
<string name="xtang_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买无创血糖趋势监测服务卡,刮开加密区即可获得血糖兑换码或扫描血糖卡中的二维码获取血糖兑换码。</string>
<string name="nsuan_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买尿酸服务卡,刮开加密区即可获得尿酸兑换码或扫描尿酸服务卡中二维码获取尿酸兑换码</string>
<string name="xzhi_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买血脂服务卡,刮开加密区即可获得血脂兑换码或扫描血脂服务卡中二维码获取血脂兑换码</string>
<string name="login_log">欢迎来到中健365</string>
<string name="private_info">同意《用户协议》和《隐私政策》</string>

@ -6,8 +6,8 @@ ext {
appId : "com.zj365.dc",
minSdk : 23,
targetSdk : 32,
versionCode : 118,
versionName : "1.2.0"
versionCode : 121,
versionName : "1.2.3"
]
@ -28,14 +28,16 @@ ext {
debug_url : "https://app.zhongjian365.com/app/",
release_url: "https://app.zhongjian365.com/app/",
h5_debug_url : "https://built.zhongjian365.com/",
h5_debug_url : "https://built.zhongjian365.com/", //
h5_release_url : "https://built.zhongjian365.com/"
//
/*debug_url : "http://java01.zhongjian365.com/app/",
release_url: "http://java01.zhongjian365.com/app/",
// debug_url : "http://java01.zhongjian365.com/app/",
// release_url: "http://java01.zhongjian365.com/app/",
h5_debug_url : "http://testbuilt.zhongjian365.com/",
h5_release_url : "http://testbuilt.zhongjian365.com/"*/
// h5_debug_url : "http://testbuilt.zhongjian365.com/",
// h5_release_url : "http://testbuilt.zhongjian365.com/"
]
@ -105,9 +107,9 @@ ext {
event_bus : 'org.greenrobot:eventbus:3.3.1',
sign : 'com.github.F1ReKing:SignatureView:1.1.0',
gd_location : 'com.amap.api:location:latest.integration',
gd_map : 'com.amap.api:3dmap:8.0.1',
gd_search : 'com.amap.api:search:latest.integration',
// gd_location : 'com.amap.api:location:latest.integration',
gd_map : 'com.amap.api:3dmap:latest.integration',
gd_search : 'com.amap.api:search:9.7.0',
wixin : 'com.tencent.mm.opensdk:wechat-sdk-android:+',
//
@ -132,18 +134,18 @@ ext {
liBan : 'top.zibin:Luban:1.1.8',
bugly : 'com.tencent.bugly:crashreport:latest.release',
jpush_jcore : 'cn.jiguang.sdk:jcore:3.2.4',
jpush : 'cn.jiguang.sdk:jpush:4.7.0',
// jpush_jcore : 'cn.jiguang.sdk:jcore:3.2.4',
jpush : 'cn.jiguang.sdk:jpush:5.0.0',
hms : 'com.huawei.hms:push:6.3.0.304',
jpush_hms : 'cn.jiguang.sdk.plugin:huawei:4.7.0',
hms : 'com.huawei.hms:push:6.5.0.300',
jpush_hms : 'cn.jiguang.sdk.plugin:huawei:5.0.0',
oppo_gson : 'com.google.code.gson:gson:2.8.6',
oppo_codec : 'commons-codec:commons-codec:1.6',
annoation : 'androidx.annotation:annotation:1.1.0',
jpush_xiaomi : 'cn.jiguang.sdk.plugin:xiaomi:4.7.0',
// jpush_oppo : 'cn.jiguang.sdk.plugin:oppo:4.7.0',
jpush_xiaomi : 'cn.jiguang.sdk.plugin:xiaomi:5.0.0',
jpush_oppo : 'cn.jiguang.sdk.plugin:oppo:5.0.0',
// jpush_vivo : 'cn.jiguang.sdk.plugin:vivo:4.7.0',
// jpush_honor : 'cn.jiguang.sdk.plugin:honor:4.7.0',
//
@ -158,7 +160,7 @@ ext {
RWidgetHelper : 'com.github.RuffianZhong:RWidgetHelper:androidx.v0.0.14',
AndroidGifDrawable : 'pl.droidsonroids.gif:android-gif-drawable:1.2.24',
GifDrawable : 'pl.droidsonroids.gif:android-gif-drawable:1.2.+',
// GifDrawable : 'pl.droidsonroids.gif:android-gif-drawable:1.2.+',
xutil : 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0',

@ -351,7 +351,24 @@
<activity android:name=".act.UricCalibrationHistoryAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XTangOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.NSuanOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XZhiOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XZhiHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XTangHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.NSuanHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application>
</manifest>

@ -96,6 +96,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
private var user: ReportBean.User? = null
private var isfirst: Boolean = true
private var isX1X2 = false
private var startEventTime:Long=0L
private var isSelectTable = false
private var isScrollTable = false
@ -192,6 +193,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
override fun initData() {
super.initData()
startEventTime = System.currentTimeMillis()
isX1X2 = MMkvHelper.getBoolean(Const.X1_X2_Device, false)
isEstimate = intent.getBooleanExtra("isEstimate", false)
@ -764,6 +766,10 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
timeMill - (24 * 60 * 60 * 1000),
SimpleDateFormat("MM-dd")
)
val yestDay1 = RxTimeTool.milliseconds2String(
timeMill - (24 * 60 * 60 * 1000),
SimpleDateFormat("yyyy-MM-dd")
)
if (isDemonstrate) {
if (isfirst) {
binding.mTvTime.text = yestDay
@ -771,6 +777,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
binding.mTvTime.text = timSelect.selectTime
}
isfirst = false
text = "$yestDay1 11:00:00"
} else {
binding.mTvTime.text = "$yestDay 11:00 至 ${
it.data.healthy.createTime.substring(
@ -778,6 +785,7 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
10
)
} 11:00"
text = "$yestDay1 11:00:00"
}
}
}
@ -1993,21 +2001,21 @@ class HealthSkyHourReportAct : BaseVmAct<ReportVm>() {
val time = if (nowTime == showTime) {
RxTimeTool.curTimeString
} else {
"$showTime 12:00:00"
showTime
}
if (isEstimate) {
user?.let {
val aesId = AESCrypt.encrypt("${it.id}")
val subtitle = "${it.name}的24小时健康评估"
val url = "${BuildConfig.image_prefix}/shareApi/reportDaily/$aesId/${time}"
val url = "${BuildConfig.image_prefix}shareApi/reportDaily/$aesId/${time}"
WxUtils.shareWebPage("24小时健康评估", subtitle, this, url)
}
} else {
user?.let {
val aesId = AESCrypt.encrypt("${it.id}")
val subtitle = "${it.name}的日报数据"
val url = "${BuildConfig.image_prefix}/shareApi/reportDaily/$aesId/${time}"
val url = "${BuildConfig.image_prefix}shareApi/reportDaily/$aesId/${time}"
WxUtils.shareWebPage("日报分享", subtitle, this, url)
}
}

@ -2643,13 +2643,13 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
shareTitle = "近30天健康评估分享"
title = "${it.name}近30天健康评估"
url =
"${BuildConfig.image_prefix}/shareApi/reportWeekly/$aesId/$myTime"
"${BuildConfig.image_prefix}shareApi/reportWeekly/$aesId/$myTime"
} else {
//近七天分享
shareTitle = "近7天健康评估分享"
title = "${it.name}近7天健康评估"
url =
"${BuildConfig.image_prefix}/shareApi/reportWeekly/$aesId/$myTime"
"${BuildConfig.image_prefix}shareApi/reportWeekly/$aesId/$myTime"
}
} else {
when (index) {
@ -2662,19 +2662,19 @@ class HealthWeekMonthHourReportAct : BaseVmAct<ReportVm>() {
myTime = "${times[0].trim()}/${times[1]}"
}
url =
"${BuildConfig.image_prefix}/shareApi/reportWeekly/$aesId/$myTime"
"${BuildConfig.image_prefix}shareApi/reportWeekly/$aesId/$myTime"
}
ReportVm.ReportInfoType.Month -> {
shareTitle = "月报分享"
title = "${it.name}月健康状态趋势"
url = "${BuildConfig.image_prefix}/shareApi/reportMonthly/$aesId/$time"
url = "${BuildConfig.image_prefix}shareApi/reportMonthly/$aesId/$time"
}
ReportVm.ReportInfoType.Year -> {
shareTitle = "年报分享"
title = "${it.name}本年健康状态趋势"
url = "${BuildConfig.image_prefix}/shareApi/reportYear/$aesId/$time"
url = "${BuildConfig.image_prefix}shareApi/reportYear/$aesId/$time"
}
else -> {}

@ -0,0 +1,35 @@
package com.zj365.health.act
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActNsuanHowOpenBinding
/**
* 尿酸如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.NS_HOW_OPEN)
class NSuanHowOpenAct : IBaseAct() {
val binding by lazy { ActNsuanHowOpenBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/ns.png")
}
}

@ -75,7 +75,7 @@ class NSuanOpenAct : BaseVmAct<NSuanVm>() , EasyPermissions.PermissionCallbacks
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
// RouteManager.goAct(ARouterUrl.NS_HOW_OPEN)
RouteManager.goAct(ARouterUrl.NS_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {

@ -236,7 +236,7 @@ class OpenOrRenewAct : BaseVmAct<XTangVm>() {
bundle.clear()
bundle.putString("id", userId)
bundle.putBoolean("isOpen", false)
RouteManager.goAct(ARouterUrl.XT_OPEN, bundle)
RouteManager.goAct(ARouterUrl.XZ_OPEN, bundle)
}
else ->{}
}
@ -260,8 +260,8 @@ class OpenOrRenewAct : BaseVmAct<XTangVm>() {
3 -> {
bundle.clear()
bundle.putString("id", userId)
bundle.putBoolean("isOpen", false)
RouteManager.goAct(ARouterUrl.XT_OPEN, bundle)
bundle.putBoolean("isOpen", true)
RouteManager.goAct(ARouterUrl.XZ_OPEN, bundle)
}
else ->{}
}

@ -0,0 +1,40 @@
package com.zj365.health.act
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActXtangHowOpenBinding
/**
* 血糖如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.XT_HOW_OPEN)
class XTangHowOpenAct : IBaseAct() {
val binding by lazy { ActXtangHowOpenBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
// intent.extras?.let {
// url = it.getString("url", "")
// titleName = it.getString("title", "")
// }
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/xt.png")
}
}

@ -107,7 +107,7 @@ class XTangOpenAct : BaseVmAct<XTangVm>(), EasyPermissions.PermissionCallbacks ,
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
// RouteManager.goAct(ARouterUrl.XT_HOW_OPEN)
RouteManager.goAct(ARouterUrl.XT_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {

@ -0,0 +1,36 @@
package com.zj365.health.act
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActXzhiHowOpenBinding
/**
* 尿酸如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.XZ_HOW_OPEN)
class XZhiHowOpenAct : IBaseAct() {
val binding by lazy { ActXzhiHowOpenBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/xz.png")
}
}

@ -0,0 +1,204 @@
package com.zj365.health.act
import android.Manifest
import android.content.Intent
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.xty.base.act.BaseVmAct
import com.xty.common.LogUtils
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonToastUtils
import com.xty.common.event.BloodFilipOpenSuccessEvent
import com.xty.common.event.OpenOrRenewEvent
import com.xty.common.util.JumpPermissionManagement
import com.xty.common.xqr_code.XQRCodeAct
import com.xuexiang.xqrcode.XQRCode
import com.zj365.health.R
import com.zj365.health.databinding.ActXzhiOpenBinding
import com.zj365.health.vm.BloodFatVm
import com.zj365.health.weight.DialogTip
import org.greenrobot.eventbus.EventBus
import pub.devrel.easypermissions.EasyPermissions
/**
* 血脂卡片开通
*/
@Route(path = ARouterUrl.XZ_OPEN)
class XZhiOpenAct : BaseVmAct<BloodFatVm>() {
val binding by lazy { ActXzhiOpenBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
private var isOpen = false
var userId = ""
override fun initData() {
super.initData()
isDarkBar = true//设置状态栏字体为深色
intent.extras?.let {
isOpen = it.getBoolean("isOpen", false)
userId = it.getString("id").toString()
}
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = if (isOpen) {
getString(R.string.xz_renew)
} else {
getString(R.string.xz_open)
}
binding.title.mIvBack.apply {
this.setOnClickListener {
finish()
}
}
binding.mConfirm.isSelected = true
binding.mTvConvert.setOnClickListener(onClickListener)
binding.mPrivate.setOnClickListener(onClickListener)
binding.mConfirm.setOnClickListener(onClickListener)
binding.llScan.setOnClickListener {
startScan()
}
}
/**
* 扫码
*/
private fun startScan() {
if(EasyPermissions.hasPermissions(this,
Manifest.permission.CAMERA)){
XQRCodeAct.start(
this@XZhiOpenAct,
XQRCodeAct.QRCODE_AGREEMENT,
R.style.XQRCodeTheme_Custom
)
}else{
if (EasyPermissions.somePermissionDenied(this,
Manifest.permission.CAMERA)){
DialogTip(
this,
"中健365需要相机权限,需要打开设置页面么?"
) {
JumpPermissionManagement.GoToSetting(this@XZhiOpenAct)
}.show()
}else{
DialogTip(
this,
"中健365需要相机权限以便您使用扫一扫功能"
) {
EasyPermissions.requestPermissions(this,"",
0x00011,
Manifest.permission.CAMERA)
}.show()
}
}
}
private val onClickListener = View.OnClickListener {
when (it.id) {
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
RouteManager.goAct(ARouterUrl.XZ_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {
binding.mPrivate.isSelected = !binding.mPrivate.isSelected
}
//确定兑换
R.id.mConfirm -> {
confirm()
}
}
}
private fun confirm() {
if (binding.mTvActCode.text.isNullOrEmpty()) {
CommonToastUtils.showToast("请输入激活码")
return
}
if (!binding.mPrivate.isSelected) {
CommonToastUtils.showToast("请阅读开通须知")
return
}
mViewModel.renewOpenRequest(
userId,
5,
"EXCHANGE_CODE",
binding.mTvActCode.text.toString()
)
}
override fun liveObserver() {
mViewModel.renewOpenData.observe(this) {
if (null == it.data) {
LogUtils.e("操作异常!")
return@observe
}
val code = it.code
if (code != 0) {
if (isOpen) {
CommonToastUtils.showToast("续费失败:${it.msg}")
} else {
CommonToastUtils.showToast("开通失败:${it.msg}")
}
return@observe
} else {
if (isOpen) {
CommonToastUtils.showSucceedToast("续费成功")
} else {
CommonToastUtils.showSucceedToast("开通成功")
}
EventBus.getDefault().post(BloodFilipOpenSuccessEvent())
EventBus.getDefault().post(OpenOrRenewEvent())
finish()
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode === RESULT_OK) {
when (requestCode) {
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.mTvActCode.setText(result)
} else {
CommonToastUtils.showToast("扫码失败,请重试...")
}
} catch (e: Exception) {
LogUtils.e("二维码扫描:$e")
CommonToastUtils.showToast("请确认二维码是否正确!")
}
}
XQRCode.RESULT_FAILED -> {
LogUtils.d("扫描失败")
}
}
}
}
}
}
}

@ -198,15 +198,10 @@ class BreathFrag : BaseVmFrag<BreathVm>() {
if (isDemonstrate){
binding.tvXinLv.text = "18"
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
}
mViewModel.getRespData(
type,
RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd")),
id,
isDemonstrate
)
mViewModel.getSetting(Const.BREATH_SETTING)
mViewModel.getLastData(id)
binding.mTvTime.text = RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd"))
@ -263,7 +258,21 @@ class BreathFrag : BaseVmFrag<BreathVm>() {
binding.tvXinLv.text = "${it.respiratory.toInt()}"
binding.tvTestTime.text = RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
dayDate= RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
binding.tvShowDate.text = dayDate
mViewModel.getRespData(
type,
RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
),
id,
isDemonstrate
)
}
}

@ -190,17 +190,12 @@ class TemFrag : BaseVmFrag<TempVm>() {
if (isDemonstrate){
binding.tvXinLv.text = "36.4"
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
}else{
mViewModel.getLastData(id)
}
mViewModel.getTempData(
type,
RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd")),
id,
isDemonstrate
)
mViewModel.getSetting(Const.TEMP_SETTING)
binding.mTvTime.text = RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd"))
binding.mTvTime.setOnClickListener {
@ -253,7 +248,23 @@ class TemFrag : BaseVmFrag<TempVm>() {
binding.tvXinLv.text = "${String.format("%.1f", it.tempInt + (it.tempFloat * 0.1))}"
binding.tvTestTime.text = RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
dayDate= RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
binding.tvShowDate.text = dayDate
mViewModel.getTempData(
type,
RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
),
id,
isDemonstrate
)
}
}

@ -83,7 +83,7 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
private var isPermission = false
private var isCompleteInfo = false
private var expireTimeStr: String = ""
var type = 2
var type = 1
val fomartStr by lazy { arrayOf("HH:mm", "HH:mm", "MM-dd", "MM-dd", "yy-MM") }
private val weekStr by lazy { resources.getStringArray(R.array.week_day) }
val dialogBind by lazy {
@ -345,7 +345,7 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
//尿酸头部信息,这里有判断是否绑定了尿酸设备
mViewModel.getUricAcidHead(id)
}
mViewModel.getUricAcidInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
}
private fun moveToErrorShow(bundle: Bundle) {
@ -510,9 +510,14 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
calendar.time = format.parse(data.time!!)!!
val myFormat = SimpleDateFormat("yyyy-MM-dd HH:mm")
binding.tvTestTime.text = myFormat.format(calendar.time)
val dateForm = SimpleDateFormat("yyyy-MM-dd")
binding.tvTestTime.text = myFormat.format(calendar.time)
dayDate = dateForm.format(calendar.time)
binding.tvShowDate.text = dayDate
mViewModel.getCurrentUricAcidValue(data.timeDay, id, isDemonstrate)
mViewModel.getUricAcidInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
}
}
@ -527,6 +532,11 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
when (type) {
1->{
it[type]!!.model = it[type]!!.mapDataToTimeNodes(it[type]!!.model)
}
2 -> {//周
val split = binding.tvShowDate.text.toString().split("")
val start = split[0]
@ -725,7 +735,11 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
val y = it.axisLeft
// y.axisMaximum=max
// y.axisMinimum=min
y.setLabelCountAndMaxMinValue(6, false, min - 10f, max + 10f)
y.setLabelCountAndMaxMinValue(
6,
false,
if (min - 1f > 0f) min - 1f else min,
if (max >= 0f) max + 1f else max)
y.textColor = ContextCompat.getColor(requireContext(), R.color.col_92a)
y.setDrawAxisLine(false)
y.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART)
@ -750,14 +764,15 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
val barsetsNew: java.util.ArrayList<ILineDataSet> = java.util.ArrayList()
var segments = splitDataIntoSegments(list)
if (segments.size > 0) {
segments = checkData(segments)
}
// if (segments.size > 0) {
// segments = checkData(segments)
// }
val dataSets = segments.mapNotNull { segment ->
if (segment.isEmpty()) return@mapNotNull null
val entries = segment.mapIndexed { index, model ->
Entry(
convertTimeToIndex(model.time, index).toFloat(),
model.uaValue,
@ -798,7 +813,7 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
m.postScale(
when (type) {
1 -> {
11.5f
0.5f
}
3 -> {
@ -836,7 +851,8 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
}
}
val y = it.axisLeft
y.setLabelCountAndMaxMinValue(6, false, min - 10, max + 10)
y.setLabelCountAndMaxMinValue(6, false, if (min - 1f > 0f) min - 1f else min,
if (max >= 0f) max + 1f else max)
y.textColor = ContextCompat.getColor(requireContext(), R.color.col_92a)
y.setDrawAxisLine(false)
y.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART)
@ -880,7 +896,12 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
}
val bard = BarData(dataBarSets)
bard.barWidth = calculateBarWidth(bard.dataSetCount)
if (type == 1) {
bard.barWidth = calculateBarWidth(bard.dataSetCount) / 4
} else {
bard.barWidth = calculateBarWidth(bard.dataSetCount)
}
// bard.barWidth = calculateBarWidth(bard.dataSetCount)
binding.mBarChart.data = bard
binding.mBarChart.invalidate()
}
@ -922,16 +943,17 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
var currentSegment = mutableListOf<UricAcidInfoBean.Model>()
for (model in dataList) {
if (model.uaValue.toFloat().isNaN()) {
// 遇到 Float.NaN如果当前线段不为空则添加到结果中并开始新的线段
if (currentSegment.isNotEmpty()) {
segments.add(currentSegment)
currentSegment = mutableListOf()
}
} else {
// 遇到有效数据,将其添加到当前线段中
currentSegment.add(model)
}
// if (model.uaValue.toFloat().isNaN()) {
// // 遇到 Float.NaN如果当前线段不为空则添加到结果中并开始新的线段
// if (currentSegment.isNotEmpty()) {
// segments.add(currentSegment)
// currentSegment = mutableListOf()
// }
// } else {
// // 遇到有效数据,将其添加到当前线段中
// currentSegment.add(model)
// }
currentSegment.add(model)
}
// 将最后一个线段添加到结果中
@ -1060,10 +1082,10 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
val minutes = parts[1].toInt()
// 计算对应的分钟数
val totalMinutes = hours * 60 + minutes
val totalMinutes = hours * 60
// 计算对应的索引值
index = totalMinutes / 10
index = hours - 5
}
2 -> {
@ -1180,13 +1202,14 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
private val mTabEntities: ArrayList<CustomTabEntity> = ArrayList()
private val mFragments: SparseArray<Fragment> = SparseArray()
private val mTitles = arrayOf(
"", "", ""
"", "", "", ""
)
private fun initTab() {
val currentDay = Date()
val day = TimeUtils.date2String(currentDay, "yyyy-MM-dd")
dayDate = day
weekDate = "${TimeUtils.date2String(getDateAdd(6), "yyyy-MM-dd")}$day"
mouthDate = TimeUtils.date2String(currentDay, "yyyy-MM")
yearDate = TimeUtils.date2String(currentDay, "yyyy")
@ -1206,17 +1229,21 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
binding.commonTabLayout.currentTab = position
when (position) {
0 -> { //周
0->{
binding.tvShowDate.text = dayDate
type = 1
}
1 -> { //周
binding.tvShowDate.text = weekDate
type = 2
}
1 -> { //月
2 -> { //月
binding.tvShowDate.text = mouthDate
type = 3
}
2 -> { //年
3 -> { //年
binding.tvShowDate.text = yearDate
type = 4
}
@ -1237,14 +1264,28 @@ class UricAcidFrag : BaseVmFrag<UricAcidVm>() {
private fun initTimeSelect() {
val currentDay = Date()
val day = TimeUtils.date2String(currentDay, "yyyy-MM-dd")
weekDate = "${TimeUtils.date2String(getDateAdd(6), "yyyy-MM-dd")}$day"
binding.tvShowDate.text = weekDate
// val currentDay = Date()
// val day = TimeUtils.date2String(currentDay, "yyyy-MM-dd")
// weekDate = "${TimeUtils.date2String(getDateAdd(6), "yyyy-MM-dd")}至$day"
// binding.tvShowDate.text = weekDate
//日筛选
val calendar = Calendar.getInstance()
timeSelect.startDate.set(1922, 1, 1)
timeSelect.endDate.set(
calendar[Calendar.YEAR], calendar[Calendar.MONTH], if (calendar[Calendar.HOUR] >= 11) {
calendar[Calendar.DATE]
} else {
calendar[Calendar.DATE]
}
)
binding.tvShowDate.text = RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd"))
binding.tvShowDate.setOnClickListener {
when (type) {
0,1->{
timeSelect.selectTime(it, "yyyy-MM-dd")
}
2 -> {
bottomSheetDialog?.show()
}

@ -211,15 +211,10 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
if (isDemonstrate) {
binding.tvXinLv.text = "84"
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
}
mViewModel.getXlData(
type,
RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd")),
id,
isDemonstrate
)
mViewModel.getSetting(Const.Xl_SETTING)
mViewModel.getLastData(id)
// binding.mTvTime.text = RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd"))
@ -292,7 +287,21 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
binding.tvXinLv.text = "${it.hrData.toInt()}"
binding.tvTestTime.text = RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
dayDate = RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
binding.tvShowDate.text = dayDate
mViewModel.getXlData(
type,
RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
),
id,
isDemonstrate
)
}
}
@ -310,7 +319,7 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
barValue.clear()
val rever = (list.indices).reversed()
if (selectDay()) {//如果是当天才操作
// if (selectDay()) {//如果是当天才操作
normalTime = 0
highTime = 0
lowTime = 0
@ -318,12 +327,12 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
highListTime.clear()
lowList.clear()
lowListTime.clear()
}
// }
for (t in daysModelList.indices) {
if (selectDay()) {//如果是当天才操作
// if (selectDay()) {//如果是当天才操作
getOrganStatu(daysModelList[daysModelList.size - t - 1])
}
// }
}
for (i in rever) {
// var times = list[i].time.toLong() * 1000
@ -345,9 +354,9 @@ class XinlvFrag : BaseVmFrag<XlVm>() {
)
)
}
if (selectDay()) {//如果是当天才操作
// if (selectDay()) {//如果是当天才操作
setOrganStatu()
}
// }
binding.mLineChart.clear()
binding.mBarChart.clear()
initChart(list, bean.value.min.toFloat(), bean.value.max.toFloat())

@ -241,8 +241,8 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
}
binding.mTvDynamicBloodSugar.isSelected = true
binding.mTvGlycosylated.isSelected = false
requestInfo()
requestDetail()
// requestInfo()
// requestDetail()
}
//糖化血红蛋白
R.id.mTvGlycosylated -> {
@ -330,13 +330,13 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
if (isDemonstrate) {
binding.tvXinLv.text = "6.2"
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
binding.mTvDynamicBloodSugar.isSelected = true
} else {
requestInfo()
}
requestDetail()
// requestDetail()
}
/**
@ -389,6 +389,17 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
mViewModel.xtInfo.observe(this) {
xtInfo = it.data
mModel = xtInfo!!.model
var infoBean =xtInfo!!
expireTimeStr = infoBean.expireTime
updateBloodsugarStatus(infoBean.model, expireTimeStr)
if (!infoBean.introUrl.isNullOrEmpty()) {
binding.ivXtangIntro.setImage(requireContext(), infoBean.introUrl)
}
updateHeaderInfo()
if (null != xtInfo) {
initChart(xuetangLineInfo?.model, xtInfo!!.min, xtInfo!!.max)
@ -472,14 +483,6 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
binding.mOrganView.root.visibility = View.GONE
}
var infoBean = (if (isBloodSugar) xtInfo else sugarInfo) ?: return
expireTimeStr = infoBean.expireTime
updateBloodsugarStatus(infoBean.model, expireTimeStr)
if (!infoBean.introUrl.isNullOrEmpty()) {
binding.ivXtangIntro.setImage(requireContext(), infoBean.introUrl)
}
}
@ -690,7 +693,7 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
binding.tvXinLv.text = "--"
}
}
binding.tvTestTime.text = RxTimeTool.getCurrentDateTime("HH:mm")
binding.tvTestTime.text = RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH:mm")
binding.tvModelingExplain.visibility = View.GONE
}
@ -722,22 +725,28 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
binding.tvModelingExplain.visibility = View.VISIBLE
binding.tvAfter.text = ""
// binding.mTvExpireTime.text = ""
binding.tvTestTime.text = RxTimeTool.getCurrentDateTime("HH:mm")
binding.tvTestTime.text = RxTimeTool.getCurrentDateTime("yyyy-MM-dd HH:mm")
}
2 -> {
val centerText: String
val unit: String
val bottomText: String
val dateText:String
if (isBloodSugar()) {
binding.mTvOper.text = "血糖校准"
binding.mTvOper.visibility = if (isMine) View.VISIBLE else View.GONE
centerText = if (null == xtInfo) "-" else xtInfo?.bloodsugar.toString()
unit = "mmol/L"
bottomText = if (null == xtInfo) "-" else RxTimeTool.simpleDateFormat(
"HH:mm",
"yyyy-MM-dd HH:mm",
RxTimeTool.string2Date("yyyy-MM-dd HH:mm:ss", xtInfo?.time)
)
dateText = if (null == xtInfo) "-" else RxTimeTool.simpleDateFormat(
"yyyy-MM-dd",
RxTimeTool.string2Date("yyyy-MM-dd", xtInfo?.time)
)
binding.mTvExpireTime.text = "到期时间:$expireTime"
val expireDay = RxTimeTool.getIntervalByNow(
expireTime,
@ -756,9 +765,14 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
if (null == sugarInfo) "-" else sugarInfo?.bloodsugar.toString()
unit = "%"
bottomText = if (null == sugarInfo) "-" else RxTimeTool.simpleDateFormat(
"HH:mm",
"yyyy-MM-dd HH:mm",
RxTimeTool.string2Date("yyyy-MM-dd HH:mm:ss", sugarInfo?.time)
)
dateText = if (null == sugarInfo) "-" else RxTimeTool.simpleDateFormat(
"yyyy-MM-dd",
RxTimeTool.string2Date("yyyy-MM-dd", sugarInfo?.time)
)
binding.mTvExpireTime.text = "监测周期:$expireTime"
binding.tvRenew.visibility = View.GONE
}
@ -771,9 +785,14 @@ class XueTangFrag : BaseVmFrag<XTangVm>() {
binding.tvAfter.text = "mmol/L"
// binding.mTvExpireTime.text = ""
binding.tvTestTime.text = bottomText
dayDate = dateText
binding.tvShowDate.text = dayDate
// binding.mFull.center_txt = centerText
binding.tvOpen.visibility = View.GONE
binding.tvModelingExplain.visibility = View.GONE
requestDetail()
}
}
}

@ -237,18 +237,17 @@ class XueyaFrag : BaseVmFrag<XyaVm>() {
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
)
binding.tvDateTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("yyyy-MM-dd")
)
} else {
mViewModel.getLastData(id)
}
CommonUtils.getMyUserInfo()?.let {
mViewModel.calibrationHistory(it.id)
}
mViewModel.getXyaData(
type,
RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd")),
id,
isDemonstrate
)
mViewModel.getSetting(Const.DBP_SETTING)
@ -399,6 +398,24 @@ class XueyaFrag : BaseVmFrag<XyaVm>() {
it.time.toLong() * 1000,
SimpleDateFormat("HH:mm")
)
binding.tvDateTime.text = RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
dayDate = RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
binding.tvShowDate.text = dayDate
mViewModel.getXyaData(
type,
RxTimeTool.milliseconds2String(
it.time.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
),
id,
isDemonstrate
)
}
}
}

@ -204,10 +204,9 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
if (isDemonstrate){
binding.tvXinLv.text = "98"
binding.tvTestTime.text = RxTimeTool.getCurTimeString(
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
}
mViewModel.getSoData(type, RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd")), id,isDemonstrate)
mViewModel.getSetting(Const.XY_SETTING)
mViewModel.getLastData(id)
binding.mTvTime.text = RxTimeTool.getCurTimeString(SimpleDateFormat("yyyy-MM-dd"))
@ -268,8 +267,17 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
binding.tvXinLv.text = "${it.soData.toInt()}"
binding.tvTestTime.text = RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("HH:mm")
SimpleDateFormat("yyyy-MM-dd HH:mm")
)
dayDate = RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")
)
binding.tvShowDate.text = dayDate
mViewModel.getSoData(type, RxTimeTool.milliseconds2String(
it.time!!.toLong() * 1000,
SimpleDateFormat("yyyy-MM-dd")), id,isDemonstrate)
}
}
@ -299,7 +307,7 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
barValue.clear()
var rever = (list.indices).reversed()
if (selectDay()) {
// if (selectDay()) {
normalTime = 0
highTime = 0
lowTime = 0
@ -307,11 +315,11 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
highListTime.clear()
lowList.clear()
lowListTime.clear()
}
// }
for (t in daysModelList.indices) {
if (selectDay()) {//如果是当天才操作
// if (selectDay()) {//如果是当天才操作
getOrganStatu(daysModelList[daysModelList.size - t - 1])
}
// }
}
for (i in rever) {
var bean = list[list.size - i - 1]
@ -336,9 +344,9 @@ class XueyangFrag : BaseVmFrag<XyVm>() {
)
}
if (selectDay()) {
// if (selectDay()) {
setOrganStatu()
}
// }
initChart(list, bean.value.min.toFloat(), bean.value.max.toFloat())
}

@ -255,7 +255,6 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
mViewModel.getBloodFatHead(id)
}
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
}
private fun setKindLayoutClickListener(view: BloodFatChartBinding) {
@ -413,10 +412,21 @@ class BloodFatFrag : BaseVmFrag<BloodFatVm>() {
calendar.time = format.parse(it.data.data.time!!)!!
val myFormat = SimpleDateFormat("HH:mm")
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
binding.clCurTc.tvTestTime.text = "mmol/L ${myFormat.format(calendar.time)}"
binding.clCurTg.tvTestTime.text = "mmol/L ${myFormat.format(calendar.time)}"
binding.clCurHdl.tvTestTime.text = "mmol/L ${myFormat.format(calendar.time)}"
binding.clCurLdl.tvTestTime.text = "mmol/L ${myFormat.format(calendar.time)}"
binding.clCurTc.tvDateTime.text = "${dateFormat.format(calendar.time)}"
binding.clCurTg.tvDateTime.text = "${dateFormat.format(calendar.time)}"
binding.clCurHdl.tvDateTime.text = "${dateFormat.format(calendar.time)}"
binding.clCurLdl.tvDateTime.text = "${dateFormat.format(calendar.time)}"
dayDate = dateFormat.format(calendar.time)
binding.tvShowDate.text = dayDate
mViewModel.getBloodFatInfo(type, binding.tvShowDate.text.toString(), id, isDemonstrate)
}
}
}

@ -1,5 +1,6 @@
package com.zj365.health.vm
import android.text.TextUtils
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.*
@ -18,6 +19,9 @@ class BloodFatVm : BaseVm() {
val oneDayData by lazy { MutableLiveData<RespBody<BloodFatBean>>() }
val renewOpenData by lazy { MutableLiveData<RespBody<OpenOrRenewBean>>() }
/**
* 获取演示数据
*/
@ -129,6 +133,30 @@ class BloodFatVm : BaseVm() {
var body = apiInterface().getBloodFatFindNow(retrofits.getRequestBody(json.toString()))
return body.getLoginStatus(nowData)
}
/**
* 血糖尿酸血脂续费
*/
fun renewOpenRequest(
userId: String,//用户ID
subject: Int,//3血糖续费开通4尿酸续费开通5血脂续费开通
channelName: String,//支付方式ALIPAY_APP支付宝支付WEIXIN_APP微信支付EXCHANGE_CODE兑换码兑换
exchangeCode: String//兑换码
) {
startHttp {
val json = JSONObject()
json.put("id", userId)
json.put("subject", subject)
json.put("channelName", channelName)
if (!TextUtils.isEmpty(exchangeCode)) {
json.put("exchangeCode", exchangeCode)
}
val renewOpen = apiInterface().renewOpen(
retrofits.getRequestBody(
json.toString()
)
)
renewOpen.getCodeStatus(renewOpenData, nowData)
}
}
}

@ -0,0 +1,53 @@
<?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="match_parent"
android:orientation="vertical"
android:background="#F2F6F7"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_21"
android:drawableStart="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/nsuan_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
/>
</LinearLayout>

@ -0,0 +1,48 @@
<?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="match_parent"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_18"
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/dp_16" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/xtang_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:layout_gravity="center"
/>
</LinearLayout>

@ -0,0 +1,53 @@
<?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="match_parent"
android:orientation="vertical"
android:background="#F2F6F7"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_21"
android:drawableStart="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/xzhi_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
/>
</LinearLayout>

@ -0,0 +1,140 @@
<?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:id="@+id/home_coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_24"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center|start"
android:text="兑换码开通"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_16"
tools:ignore="HardcodedText" />
<!-- 获取兑换码 -->
<TextView
android:id="@+id/mTvConvert"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/text_underline"
android:gravity="center"
android:text="如何获取兑换码?"
android:textColor="@color/col_25C"
android:textSize="@dimen/sp_12"
tools:ignore="HardcodedText" />
</LinearLayout>
<!-- 激活码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_28"
android:layout_marginEnd="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_24"
android:background="@drawable/shape_btn_select_bg_inside_white"
android:orientation="horizontal">
<EditText
android:id="@+id/mTvActCode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_weight="1"
android:background="@null"
android:hint="请填写激活码"
android:paddingStart="@dimen/dp_12"
android:paddingTop="@dimen/dp_14"
android:paddingBottom="@dimen/dp_14"
android:textColor="@color/col_3b4"
android:textColorHint="@color/col_6B6"
android:textSize="@dimen/sp_13"
tools:ignore="HardcodedText,RtlSymmetry" />
<LinearLayout
android:id="@+id/llScan"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/dp_5"
android:background="@mipmap/ic_scan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_20"
android:gravity="center_vertical"
android:text="去扫码"
android:textColor="@color/col_8D0"
android:textSize="@dimen/sp_12"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<!-- 分割线 -->
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:background="@color/col_e4e4"
android:visibility="gone" />
<!-- 开通须知 -->
<TextView
android:id="@+id/mPrivate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_31"
android:layout_marginRight="@dimen/dp_24"
android:drawableStart="@drawable/selctor_check_sel"
android:drawablePadding="@dimen/dp_6"
android:text="开通须知:此兑换码仅限本人使用,开通完成之后,无法二次兑换。"
android:textColor="@color/col_c2c"
android:textSize="@dimen/sp_15"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<!-- 确定兑换 -->
<TextView
android:id="@+id/mConfirm"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_50"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_135"
android:background="@drawable/selector_login_btn"
android:gravity="center"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
tools:ignore="HardcodedText" />
</LinearLayout>

@ -114,6 +114,14 @@
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/tvDateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="次/分"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_12"/>
</LinearLayout>

@ -41,9 +41,19 @@
android:textSize="@dimen/sp_11"
android:textStyle="bold"
tools:text="mmol/L 16:30" />
<TextView
android:id="@+id/tvDateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_11"
android:textStyle="bold"
tools:text="2023-03-26" />
</LinearLayout>
</LinearLayout>
<LinearLayout

@ -1,4 +1,5 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>

@ -36,14 +36,14 @@ data class UricAcidInfoBean(
val dateFormat = SimpleDateFormat("HH:mm", Locale.getDefault())
// 创建一天的时间节点
val calendar = Calendar.getInstance()
calendar.set(Calendar.HOUR_OF_DAY, 0)
calendar.set(Calendar.HOUR_OF_DAY, 5)
calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0)
calendar.set(Calendar.MILLISECOND, 0)
val startTime = calendar.time
calendar.add(Calendar.DAY_OF_MONTH, 1)
calendar.add(Calendar.MINUTE, -1)
calendar.add(Calendar.HOUR_OF_DAY, 4)
calendar.add(Calendar.MINUTE, 0)
var endTime = calendar.time
// 如果是时间是今天endTime为最近的时间
@ -69,11 +69,9 @@ data class UricAcidInfoBean(
)
)
calendar.time = currentTime
calendar.add(Calendar.MINUTE, 10)
calendar.add(Calendar.HOUR_OF_DAY, 1)
currentTime = calendar.time
}
val timestamp = 1688631900L
val time = Date(timestamp * 1000)
// 将数据集合中的时间映射到时间节点上
for (model in dataList) {
@ -198,20 +196,20 @@ data class UricAcidInfoBean(
var maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH)
// 如果是时间是今天endTime为最近的时间
val now = Calendar.getInstance()
val today = now.clone() as Calendar
try {
now.timeInMillis =
if (dataList.isEmpty()) System.currentTimeMillis() else dataList.first().time.toLong() * 1000
}catch (e:Exception){
}
if (today.get(Calendar.YEAR) == now.get(Calendar.YEAR) &&
today.get(Calendar.MONTH) == now.get(Calendar.MONTH)
) {
// If today, use the last time in the range
maxDay = now.get(Calendar.DAY_OF_MONTH)
}
// val now = Calendar.getInstance()
// val today = now.clone() as Calendar
// try {
// now.timeInMillis =
// if (dataList.isEmpty()) System.currentTimeMillis() else dataList.first().time.toLong() * 1000
// }catch (e:Exception){
// }
//
// if (today.get(Calendar.YEAR) == now.get(Calendar.YEAR) &&
// today.get(Calendar.MONTH) == now.get(Calendar.MONTH)
// ) {
// // If today, use the last time in the range
// maxDay = now.get(Calendar.DAY_OF_MONTH)
// }
// 循环遍历整个月份的每一天
for (day in 1..maxDay) {

Loading…
Cancel
Save