中建365

develop
wlh 2 years ago
parent 778116e36e
commit d253ed4c83

@ -88,9 +88,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
/* kotlinOptions {
jvmTarget = '1.8'
}*/
viewBinding { viewBinding {
enabled = true enabled = true

@ -129,6 +129,9 @@
android:name=".activity.InfoSimpleAct" android:name=".activity.InfoSimpleAct"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".activity.HealthScienceAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.OneKeyBinderDeviceAct" <activity android:name=".activity.OneKeyBinderDeviceAct"
android:launchMode="singleTop" android:launchMode="singleTop"

@ -0,0 +1,57 @@
package com.zj365.dc.activity
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseListAct
import com.xty.common.UmengEventId
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.onEventObject
import com.xty.network.model.ScienceBean
import com.zj365.dc.adapter.ScienceAdapter
import com.zj365.dc.vm.HomeVm
import com.zj365.health.databinding.ActDataListBinding
@Route(path = ARouterUrl.SCIENCE_LIST)
class HealthScienceAct : BaseListAct<HomeVm> (){
val binding by lazy { ActDataListBinding.inflate(layoutInflater) }
val adapterSince by lazy { ScienceAdapter() }
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text ="健康科普"
binding.title.mIvBack.setOnClickListener {
finish()
}
}
override fun initAdapter() {
binding.mRecycle.layoutManager = LinearLayoutManager(this)
binding.mRecycle.adapter = adapterSince
adapterSince.setOnItemClickListener { adapter, view, position ->
bundle.clear()
var bean = adapter.getItem(position) as ScienceBean
bundle.putSerializable("bean", bean)
onEventObject(this, UmengEventId.HealthScience, "${bean.name}")
RouteManager.goAct(ARouterUrl.SCIENCE_DETAIL, bundle)
}
}
override fun loadData() {
mViewModel.getScinceList()
}
override fun liveObserver() {
mViewModel.scinceLive.observe(this) {
adapterSince.setNewInstance(it.data)
}
}
override fun setLayout() = binding.root
}

@ -85,51 +85,24 @@ class InfoSimpleAct : BaseVmAct<InfoSimpleVm>() {
binding.title.mTvTitle.text = getString(R.string.base_info) binding.title.mTvTitle.text = getString(R.string.base_info)
binding.title.mIvBack.setOnClickListener { finish() } binding.title.mIvBack.setOnClickListener { finish() }
binding.mImage.setOnClickListener { PictureUtils.openCamera(this) } binding.mImage.setOnClickListener { PictureUtils.openCamera(this) }
// val calendaryear = Calendar.getInstance()
// calendaryear.add(Calendar.YEAR, -14)
timeSelect.startDate.set(1922, 0, 1) timeSelect.startDate.set(1922, 0, 1)
// timeSelect.endDate = calendaryear
binding.llBirthday.setOnClickListener { binding.llBirthday.setOnClickListener {
RxKeyboardTool.hideSoftInput(this) RxKeyboardTool.hideSoftInput(this)
timeSelect.selectTime(binding.mBirthday) timeSelect.selectTime(binding.mBirthday)
} }
sexType = if (binding.checkSex.isChecked) 2 else 1 sexType = if (binding.checkSex.isChecked) 2 else 1
birthdayType = if (binding.checkBirthday.isChecked) 2 else 1 birthdayType = if (binding.checkBirthday.isChecked) 2 else 1
// binding.mRadio.setOnCheckedChangeListener { group, checkedId ->
// when(checkedId){
// R.id.mRadio1->birthdayType=1
// R.id.mRadio2->birthdayType=2
//
// }
// }
binding.bindingTv.setOnClickListener { binding.bindingTv.setOnClickListener {
isBinding = true isBinding = true
// dialogChooseDevice.show()
turnToSaveBaseData() turnToSaveBaseData()
} }
// binding.mGroup.setOnCheckedChangeListener { group, checkedId ->
// when(checkedId){
// R.id.mMale->sexType=1
// R.id.mGirl->sexType=2
// }
// }
binding.mName.addTextChangedListener(textListener) binding.mName.addTextChangedListener(textListener)
binding.mSubmit.setOnClickListener { binding.mSubmit.setOnClickListener {
isBinding = false isBinding = false
turnToSaveBaseData() turnToSaveBaseData()
//跳转注册
// var bean =SimpleInfoBean()
// if( binding.mImage.tag!=null){
// bean.avatar= binding.mImage.tag.toString()
// }
// bean.name=name
// bean.sex=sexType
// bundle.clear()
// bundle.putSerializable("bean",bean)
// RouteManager.goActRequest(ARouterUrl.REGIST_ACT,this,1000,bundle)
} }
} }
@ -140,11 +113,6 @@ class InfoSimpleAct : BaseVmAct<InfoSimpleVm>() {
val birthDay = binding.mBirthday.text.toString().trim() val birthDay = binding.mBirthday.text.toString().trim()
val name = binding.mName.text.toString().trim() val name = binding.mName.text.toString().trim()
// if (name.isEmpty()) {
// isBinding = false
// ToastUtils.show(R.string.please_input_name)
// return
// }
if (TimeUtils.getAgeByBirth(birthDay) < 14) { if (TimeUtils.getAgeByBirth(birthDay) < 14) {
CommonToastUtils.showToast("需要年满14岁才可使用") CommonToastUtils.showToast("需要年满14岁才可使用")
isBinding = false isBinding = false

@ -21,11 +21,13 @@ import com.xty.base.dialog.AppUpdateDialog
import com.xty.common.* import com.xty.common.*
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.WxLoginEvent import com.xty.common.event.WxLoginEvent
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.network.model.WxInfoBean import com.xty.network.model.WxInfoBean
import com.zj365.dc.databinding.ActLoginBinding import com.zj365.dc.databinding.ActLoginBinding
import com.zj365.dc.vm.LoginVm import com.zj365.dc.vm.LoginVm
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
import java.util.* import java.util.*
@ -230,20 +232,6 @@ class LoginAct : BaseVmAct<LoginVm>() {
} }
}) })
/*binding.mTvPswLogin.isSelected = true
binding.mTvPswLogin.setOnClickListener {
binding.mTvCodeLogin.isSelected = false
it.isSelected = true
}
binding.mTvCodeLogin.setOnClickListener {
binding.mTvPswLogin.isSelected = false
it.isSelected = true
binding.mRelPwd.visibility = View.GONE
binding.mRelCode.visibility = View.VISIBLE
getNowLoginStatus()
}*/
} }
//添加监听 //添加监听
@ -277,19 +265,22 @@ class LoginAct : BaseVmAct<LoginVm>() {
override fun liveObserver() { override fun liveObserver() {
mViewModel.mLogin.observe(this) { mViewModel.mLogin.observe(this) {
loadingView.dismiss() loadingView.dismiss()
initTab() // initTab()
mViewModel.getImUserSig("user_${it.data.id}") // mViewModel.getImUserSig("user_${it.data.id}")
// RouteManager.goAct(ARouterUrl.MAIN_ACT)
EventBus.getDefault().post(LoginOrRegisterEvent())
finish()
} }
// mViewModel.loginWx.observe(this) { // mViewModel.loginWx.observe(this) {
// loadingView.dismiss() // loadingView.dismiss()
// initTab() // initTab()
// mViewModel.getImUserSig("user_${it.data}") // mViewModel.getImUserSig("user_${it.data}")
// } // }
mViewModel.setLoginWxId.observe(this) { /* mViewModel.setLoginWxId.observe(this) {
loadingView.dismiss() loadingView.dismiss()
initTab() initTab()
mViewModel.getImUserSig("user_${it}") mViewModel.getImUserSig("user_${it}")
} }*/
mViewModel.getImUserSig.observe(this) { mViewModel.getImUserSig.observe(this) {
Log.e("simon", "login"+it.data) Log.e("simon", "login"+it.data)
TUILogin.login( TUILogin.login(

@ -12,6 +12,7 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.tamsiree.rxkit.RxActivityTool
import com.tamsiree.rxkit.RxKeyboardTool import com.tamsiree.rxkit.RxKeyboardTool
import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper import com.tencent.qcloud.tuikit.tuichat.util.PermissionHelper
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
@ -21,6 +22,7 @@ import com.xty.common.MyLinkedMovementMethod
import com.xty.common.TimeSelect import com.xty.common.TimeSelect
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.common.xqr_code.XQRCodeAct import com.xty.common.xqr_code.XQRCodeAct
@ -29,6 +31,7 @@ import com.zj365.dc.R
import com.zj365.dc.databinding.ActRegisterBinding import com.zj365.dc.databinding.ActRegisterBinding
import com.zj365.dc.model.SimpleInfoBean import com.zj365.dc.model.SimpleInfoBean
import com.zj365.dc.vm.RegisterVm import com.zj365.dc.vm.RegisterVm
import org.greenrobot.eventbus.EventBus
import java.util.* import java.util.*
/** /**
@ -99,8 +102,6 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
CommonToastUtils.showToast(R.string.please_agree_all) CommonToastUtils.showToast(R.string.please_agree_all)
return@setOnClickListener return@setOnClickListener
} }
var organCode = ""
var invitePhone = ""
val phone = binding.mAccount.text.toString().trim() val phone = binding.mAccount.text.toString().trim()
val code = binding.mCode.text.toString().trim() val code = binding.mCode.text.toString().trim()
@ -108,22 +109,10 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
mViewModel.register( mViewModel.register(
phone, phone,
code, code,
pwd, pwd
null,
null,
bean,
invitePhone
) )
} }
binding.mPrivate.setOnClickListener { 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 it.isSelected = !it.isSelected
} }
setPrv() setPrv()
@ -195,15 +184,13 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
override fun liveObserver() { override fun liveObserver() {
mViewModel.registerVm.observe(this) { mViewModel.registerVm.observe(this) {
CommonToastUtils.showSucceedToast("注册成功") CommonToastUtils.showSucceedToast("注册成功")
if (timer != null) {
timer!!.cancel()
timer = null
}
mViewModel.login(binding.mAccount.text.toString().trim(),binding.mPsw.text.toString().trim())
RxActivityTool.finishActivity(LoginAct::class.java)
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) { mViewModel.codeLive.observe(this) {
timeStart() timeStart()
@ -212,6 +199,15 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
isSelected = false isSelected = false
} }
} }
mViewModel.mLogin.observe(this){
4
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE)
EventBus.getDefault().post(LoginOrRegisterEvent())
this@RegisterAct.finish()
}
timeLive.observe(this) { timeLive.observe(this) {
--timeNow --timeNow
if (timeNow > 0) { if (timeNow > 0) {
@ -260,30 +256,7 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
} }
} }
XQRCodeAct.QRCODE_AGREEMENT -> {/* 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("扫描失败")
}
}*/
} }
} }
} }
@ -321,10 +294,21 @@ class RegisterAct : BaseVmAct<RegisterVm>() {
} }
} }
override fun onStop() {
super.onStop()
LogUtils.e("RegisterAct","onStop ${timer}")
if (timer != null) {
timer!!.cancel()
}
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
LogUtils.e("RegisterAct","onDestroy ${timer}")
if (timer != null) { if (timer != null) {
timer!!.cancel() timer!!.cancel()
timer = null
} }
} }
} }

@ -0,0 +1,17 @@
package com.zj365.dc.adapter
import android.content.Context
import android.widget.ImageView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.setImage
import com.xty.network.model.HomeLayoutBean
import com.zj365.dc.R
class HomeContentLayoutAdapter (context: Context)
: BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_home_content_layout){
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) {
holder.getView<ImageView>(R.id.img_content).setImage(context,item.imageUrl)
holder.setText(R.id.tv_content,item.name)
}
}

@ -0,0 +1,29 @@
package com.zj365.dc.adapter
import android.content.Context
import android.util.DisplayMetrics
import android.view.LayoutInflater
import android.view.WindowManager
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.common.LogUtils
import com.xty.common.setImage
import com.xty.network.model.HomeLayoutBean
import com.zj365.dc.R
class HomeTopLayoutAdapter(var mContext: Context): BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_home_top_layout){
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) {
var screenWidth = context.resources.displayMetrics.widthPixels
val layoutParam = holder.getView<LinearLayout>(R.id.root).layoutParams
layoutParam.width = screenWidth /4
holder.getView<LinearLayout>(R.id.root).layoutParams = layoutParam
holder.getView<ImageView>(R.id.img_top).setImage(context,item.imageUrl)
holder.setText(R.id.tv_top_name,item.name)
}
}

@ -38,6 +38,8 @@ import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.ChangeFamilyEvent import com.xty.common.event.ChangeFamilyEvent
import com.xty.common.event.FamilyEvent import com.xty.common.event.FamilyEvent
import com.xty.common.event.Health24HourStatusEvent import com.xty.common.event.Health24HourStatusEvent
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.LoginOutEvent
import com.xty.common.event.MyInfoEvent import com.xty.common.event.MyInfoEvent
import com.xty.common.event.WorkManagerEvent import com.xty.common.event.WorkManagerEvent
import com.xty.common.marqueen.SimpleMF import com.xty.common.marqueen.SimpleMF
@ -1829,4 +1831,14 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
super.onDestroy() super.onDestroy()
tenJob?.cancel() tenJob?.cancel()
} }
@Subscribe(threadMode = ThreadMode.MAIN)
fun LoginOrRegisterChange(event: LoginOrRegisterEvent){
request()
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun loginOutChange(event: LoginOutEvent){
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -4,9 +4,13 @@ import android.graphics.Color
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.xty.base.fragment.BaseFragList import com.xty.base.fragment.BaseFragList
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.LoginOutEvent
import com.zj365.dc.adapter.HomeMessageAdapter import com.zj365.dc.adapter.HomeMessageAdapter
import com.zj365.dc.databinding.FragMessageBinding import com.zj365.dc.databinding.FragMessageBinding
import com.zj365.dc.vm.MessageVm import com.zj365.dc.vm.MessageVm
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
class MessageFragment : BaseFragList<MessageVm>() { class MessageFragment : BaseFragList<MessageVm>() {
@ -45,4 +49,14 @@ class MessageFragment : BaseFragList<MessageVm>() {
override fun setLayout()=binding.root override fun setLayout()=binding.root
@Subscribe(threadMode = ThreadMode.MAIN)
fun LoginOrRegisterChange(event: LoginOrRegisterEvent){
refresh()
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun loginOutChange(event: LoginOutEvent){
}
} }

@ -1,24 +1,29 @@
package com.zj365.dc.fragment package com.zj365.dc.fragment
import android.os.Build import android.os.Build
import android.text.TextUtils
import android.view.View import android.view.View
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import com.xty.base.dialog.AppUpdateDialog
import com.xty.base.fragment.BaseVmFrag import com.xty.base.fragment.BaseVmFrag
import com.xty.common.* import com.xty.common.*
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.YCBBlueConnectHelper import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.LoginOutEvent
import com.xty.common.event.MyInfoEvent import com.xty.common.event.MyInfoEvent
import com.xty.common.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils import com.xty.common.util.CommonUtils
import com.xty.network.model.SettingBean import com.xty.network.model.SettingBean
import com.zj365.dc.BuildConfig
import com.zj365.dc.activity.MainActivity import com.zj365.dc.activity.MainActivity
import com.zj365.dc.databinding.FragMineBinding import com.zj365.dc.databinding.FragMineBinding
import com.zj365.health.weight.DialogTip import com.zj365.health.weight.DialogTip
import com.zj365.mime.vm.SettingVm import com.zj365.mime.vm.SettingVm
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
/** /**
** 我的 ** 我的
@ -28,6 +33,14 @@ import org.greenrobot.eventbus.EventBus
class MineFrag : BaseVmFrag<SettingVm>() { class MineFrag : BaseVmFrag<SettingVm>() {
private val binding by lazy { FragMineBinding.inflate(layoutInflater) } private val binding by lazy { FragMineBinding.inflate(layoutInflater) }
private val dialog by lazy {
AppUpdateDialog(requireActivity()) {
if (it) {
//finish()
}
}
}
override fun setLayout(): View = binding.root override fun setLayout(): View = binding.root
private val defaultIcon by lazy { private val defaultIcon by lazy {
@ -64,9 +77,14 @@ class MineFrag : BaseVmFrag<SettingVm>() {
} }
binding.mllIntegral.setOnClickListener { //积分 binding.mllIntegral.setOnClickListener { //积分
bundle.clear() if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
bundle.putSerializable("user", user) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
RouteManager.goAct(ARouterUrl.MY_INTEGRAL, bundle) }else{
bundle.clear()
bundle.putSerializable("user", user)
RouteManager.goAct(ARouterUrl.MY_INTEGRAL, bundle)
}
} }
binding.llAboutUs.setOnClickListener { binding.llAboutUs.setOnClickListener {
RouteManager.goAct(ARouterUrl.ABOUT) RouteManager.goAct(ARouterUrl.ABOUT)
@ -138,10 +156,20 @@ class MineFrag : BaseVmFrag<SettingVm>() {
} }
} }
} }
binding.llDataComparsion.setOnClickListener {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
goComparePage()
}
}
binding.llUpGraded.setOnClickListener {
mViewModel.getVersionNew(BuildConfig.VERSION_CODE)
}
/*binding.mInfo.setOnClickListener { /*binding.mInfo.setOnClickListener {
RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE, bundle) RouteManager.goAct(ARouterUrl.BASE_INFO_CHANGE, bundle)
}*/ }*/
mViewModel.getNesProg("")
} }
override fun onResume() { override fun onResume() {
@ -153,10 +181,6 @@ class MineFrag : BaseVmFrag<SettingVm>() {
mViewModel.getMySetting() mViewModel.getMySetting()
} }
mViewModel.getScore(1) mViewModel.getScore(1)
// mViewModel.getMyFamilyList()
// mViewModel.getNesProg("")
// mViewModel.getInviteCountRequest(CommonUtils.getMyUserId().toString())
// mViewModel.getNotReadCount()
} }
} }
@ -167,7 +191,16 @@ class MineFrag : BaseVmFrag<SettingVm>() {
mViewModel.scoreLive.observe(this) { mViewModel.scoreLive.observe(this) {
binding.mIntegral.text = (if (it.data.num.isNullOrEmpty()) "0" else it.data.num!!) binding.mIntegral.text = (if (it.data.num.isNullOrEmpty()) "0" else it.data.num!!)
} }
//设置邀请人数
mViewModel.updateLive.observe(this) {
if (!it.data.url.isNullOrEmpty()) {
dialog.showUploadDialog(it.data.url!!, it.data.log,it.data.versionName ,it.data.isupdate) { show ->
}
}else{
CommonToastUtils.showSucceedToast("已经是最新版本")
}
}
Const.mainLiveData.observe(this) { Const.mainLiveData.observe(this) {
if (null == it) { if (null == it) {
@ -225,6 +258,24 @@ class MineFrag : BaseVmFrag<SettingVm>() {
} }
private fun goComparePage() {
bundle.clear()
bundle.putString("id", user?.id)
RouteManager.goAct(ARouterUrl.COMPARE_PAGE_DATA_ACT, bundle)
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onLoginOrRegisterSuccess(event: LoginOrRegisterEvent){
mViewModel.getMySetting()
mViewModel.getScore(1)
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onLoginOutUIChange(event: LoginOutEvent){
refreshLogoutUI()
}
/*** 设置消息数量*/ /*** 设置消息数量*/
@ -251,4 +302,12 @@ class MineFrag : BaseVmFrag<SettingVm>() {
// } // }
} }
fun refreshLogoutUI(){
user = null
binding.mIntegral.text = "0"
binding.mName.text = ""
binding.mPhone.text = "账户:"
binding.mImage.setImageResource(defaultIcon[0])
}
} }

@ -122,17 +122,17 @@ class HealthVm : BaseVm() {
} }
} }
/** /* *//**
* 首页轮播图 * 首页轮播图
* *
* @param id 机构ID * @param id 机构ID
*/ *//*
fun getBanners(id: String?){ fun getBanners(id: String?){
startHttp(false) { startHttp(false) {
var value=apiInterface().getBanners(id) var value=apiInterface().getBanners(id)
value.getCodeStatus(bannerLive,nowData) value.getCodeStatus(bannerLive,nowData)
} }
} }*/
/** /**
* 首页小贴士 * 首页小贴士

@ -0,0 +1,83 @@
package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.BannerBean
import com.xty.network.model.FamilyBean
import com.xty.network.model.HomeLayoutBean
import com.xty.network.model.RespBody
import com.xty.network.model.ScienceBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
import org.json.JSONObject
class HomeVm: BaseVm() {
val bannerLive by lazy { MutableLiveData<MutableMap<Int,MutableList<BannerBean>>>() }
val familyLive by lazy { MutableLiveData<RespBody<MutableList<FamilyBean>>>() }
val scinceLive by lazy{MutableLiveData<RespBody<MutableList<ScienceBean>>>()}
val layoutLive by lazy { MutableLiveData<RespBody<HomeLayoutBean>>() }
fun getBanners(id: String?,location:Int){
startHttp(false) {
withContext(Dispatchers.IO){
var json = JSONObject()
json.put("userId",id)
json.put("location",location) // 1,首页顶部2首页中部
var nowLine = async{apiInterface().getBanners(retrofits.getRequestBody(json.toString()))}
var showInfo = nowLine.await()
// var value=apiInterface().getBanners(retrofits.getRequestBody(json.toString()))
var dataMap = setMapValue(bannerLive.value,showInfo.data,location)
if (dataMap != null){
bannerLive.postValue(dataMap)
}
// value.getCodeStatus(bannerLive,nowData)
}
}
}
fun <T> setMapValue(map: MutableMap<Int, MutableList<T>>?, list: MutableList<T>?, type: Int): MutableMap<Int, MutableList<T>>? {
if (list == null) {
return null
} else { //当得到的值不是空的时候
var mapNew = mutableMapOf<Int, MutableList<T>>()
if (map == null) {
mapNew[type] = list
return mapNew
} else {
map[type] = list
return map
}
}
}
fun getMyFamilyList(){
startHttp (false){
var json= JSONObject()
var request= apiInterface().getMyFamily(retrofits.getRequestBody(json.toString()))
request.getCodeStatus(familyLive,nowData)
}
}
fun getScinceList(){
startHttp {
var body= apiInterface().getScinceList()
body.getCodeStatus(scinceLive,nowData)
}
}
fun getHomeLayout(){
startHttp {
var body= apiInterface().getHomeLayout()
body.getCodeStatus(layoutLive,nowData)
}
}
}

@ -36,14 +36,19 @@ class LoginVm() : BaseVm() {
return return
} }
if (pwd.isEmpty()) { if (pwd.isEmpty()) {
CommonToastUtils.showToast(R.string.please_input_password) CommonToastUtils.showToast(R.string.please_input_new_pwd)
return return
} else {
if (pwd.length < 6) {
CommonToastUtils.showToast(R.string.please_input_new_pwd)
return
}
} }
startHttp { startHttp {
val json = JSONObject() val json = JSONObject()
json.put("phone", account) json.put("phone", account)
json.put("userPwd", RxTool.Md5(pwd)) json.put("userPwd", RxTool.Md5(pwd))
//json.put("userPwd", pwd)
val login = apiInterface().login(retrofits.getRequestBody(json.toString())) val login = apiInterface().login(retrofits.getRequestBody(json.toString()))
if (login.body()?.code == 500) { if (login.body()?.code == 500) {
login.body()?.msg?.let { CommonToastUtils.showToast(it) } login.body()?.msg?.let { CommonToastUtils.showToast(it) }

@ -41,11 +41,7 @@ class RegisterVm : BaseVm() {
fun register( fun register(
phone: String, phone: String,
code: String, code: String,
password: String, password: String
birthday: String? = null,
bean: WxInfoBean? = null,
simple: SimpleInfoBean? = null,
invitePhone: String? = ""
) { ) {
if (phone.isEmpty()) { if (phone.isEmpty()) {
CommonToastUtils.showToast(R.string.please_input_phone) CommonToastUtils.showToast(R.string.please_input_phone)
@ -69,29 +65,8 @@ class RegisterVm : BaseVm() {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
val json = JSONObject() val json = JSONObject()
json.put("phone", phone) json.put("phone", phone)
// json.put("sex",1) //性别默认传1
json.put("birthday", birthday)
// json.put("birthdayType",birthdayType)
json.put("code", code) json.put("code", code)
json.put("password", RxTool.Md5(password)) 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())) val register = apiInterface().register(retrofits.getRequestBody(json.toString()))
saveToken(register.raw().headers) saveToken(register.raw().headers)
register.body()?.getCodeStatus(registerVm, nowData) register.body()?.getCodeStatus(registerVm, nowData)
@ -115,4 +90,23 @@ class RegisterVm : BaseVm() {
var body = apiInterface().uploadImage(fileRb) var body = apiInterface().uploadImage(fileRb)
return body.data return body.data
} }
fun login(account: String, pwd: String) {
startHttp {
val json = JSONObject()
json.put("phone", account)
json.put("userPwd", RxTool.Md5(pwd))
//json.put("userPwd", pwd)
val login = apiInterface().login(retrofits.getRequestBody(json.toString()))
if (login.body()?.code == 500) {
login.body()?.msg?.let { CommonToastUtils.showToast(it) }
return@startHttp
}
saveToken(login.raw().headers)
val bodys = login.body() as RespBody
MMkvHelper.put(Const.USER_ID, bodys.data.id)
bodys.getCodeStatus(mLogin, nowData, loading)
}
}
} }

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/col_6f7">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_52"
android:background="@mipmap/icon_calorie_analyze"
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/img_calorie"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_calorie"
android:layout_marginLeft="@dimen/dp_11"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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_marginTop="@dimen/dp_9"
android:text="肉类 蔬菜 水果 面包"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_52"
android:background="@mipmap/icon_healthy_diet"
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/img_healthy_diet"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_healthy_diet"
android:layout_marginLeft="@dimen/dp_11"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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_marginTop="@dimen/dp_9"
android:text="食疗 增肌 减脂 营养"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_52"
android:background="@mipmap/icon_medicine_food"
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/img_medicine_food"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_medicine_food"
android:layout_marginLeft="@dimen/dp_11"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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_marginTop="@dimen/dp_9"
android:text="多吃 少吃 不吃"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_52"
android:background="@mipmap/icon_food_diary"
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/img_food_diary"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_food_diary"
android:layout_marginLeft="@dimen/dp_11"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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_marginTop="@dimen/dp_9"
android:text="早餐 中餐 晚餐"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_52"
android:background="@mipmap/icon_diet_more"
android:layout_marginLeft="@dimen/dp_16"
android:id="@+id/img_more"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_more"
android:layout_marginLeft="@dimen/dp_11"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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_marginTop="@dimen/dp_9"
android:text="敬请期待"
android:textColor="@color/col_6B6"
android:textSize="@dimen/sp_13"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

@ -265,7 +265,7 @@
android:paddingRight="@dimen/dp_20" android:paddingRight="@dimen/dp_20"
android:paddingLeft="@dimen/dp_20" android:paddingLeft="@dimen/dp_20"
android:background="@drawable/shape_btn_select_bg_white" android:background="@drawable/shape_btn_select_bg_white"
android:textColor="@color/col_8D0" android:textColor="@color/col_02c"
android:textSize="@dimen/dp_16" android:textSize="@dimen/dp_16"
android:text="去绑定手表"/> android:text="去绑定手表"/>

@ -76,6 +76,7 @@
android:paddingTop="@dimen/dp_18" android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18" android:paddingBottom="@dimen/dp_18"
android:singleLine="true" android:singleLine="true"
android:maxLength="11"
android:text="" android:text=""
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textColorHint="@color/col_c7c" android:textColorHint="@color/col_c7c"

@ -53,6 +53,7 @@
android:hint="@string/please_input_phone" android:hint="@string/please_input_phone"
android:inputType="phone" android:inputType="phone"
android:layout_marginTop="@dimen/dp_62" android:layout_marginTop="@dimen/dp_62"
android:maxLength="11"
android:paddingTop="@dimen/dp_18" android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18" android:paddingBottom="@dimen/dp_18"
android:textColorHint="@color/col_c7c" android:textColorHint="@color/col_c7c"
@ -112,10 +113,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_r25_eeeeee" android:background="@drawable/shape_r25_eeeeee"
android:hint="请输入6位密码" android:hint="请输入6位以上密码"
android:paddingTop="@dimen/dp_18" android:paddingTop="@dimen/dp_18"
android:paddingBottom="@dimen/dp_18" android:paddingBottom="@dimen/dp_18"
android:textColorHint="@color/col_c7c" android:textColorHint="@color/col_c7c"
android:inputType="textPassword"
android:paddingLeft="@dimen/dp_20" android:paddingLeft="@dimen/dp_20"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:singleLine="true" android:singleLine="true"

@ -14,9 +14,15 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/home_content_rv"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
@ -93,6 +99,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout

@ -142,6 +142,7 @@
/> />
<TextView <TextView
android:id="@+id/tv_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_12" android:paddingBottom="@dimen/dp_12"

@ -52,6 +52,7 @@
android:id="@+id/mMsg" android:id="@+id/mMsg"
android:layout_width="@dimen/dp_20" android:layout_width="@dimen/dp_20"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:src="@mipmap/ic_health_msg" /> android:src="@mipmap/ic_health_msg" />
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
@ -85,36 +86,19 @@
app:layout_constraintTop_toBottomOf="@+id/mHeaderLayout" app:layout_constraintTop_toBottomOf="@+id/mHeaderLayout"
app:layout_constraintLeft_toLeftOf="parent"> app:layout_constraintLeft_toLeftOf="parent">
<LinearLayout <androidx.recyclerview.widget.RecyclerView
android:id="@+id/ll_daily_benefit" android:layout_width="match_parent"
android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:id="@+id/rv_layout"/>
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 <LinearLayout
android:id="@+id/ll_video_interview" android:id="@+id/ll_video_interview"
android:layout_width="@dimen/dp_0" android:layout_width="@dimen/dp_0"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
@ -139,6 +123,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
@ -163,6 +148,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView

@ -0,0 +1,33 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_ai_tongue_diagnosis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:background="@mipmap/bg_home_item"
android:orientation="vertical">
<ImageView
android:id="@+id/img_content"
android:layout_width="@dimen/dp_34"
android:layout_height="@dimen/dp_34"
tools:background="@mipmap/icon_ai_tongue_diagnosis"/>
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="AI舌诊"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_10"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,28 @@
<?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:orientation="vertical"
android:gravity="center"
android:id="@+id/root"
tools:ignore="MissingDefaultResource">
<ImageView
android:id="@+id/img_top"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@mipmap/icon_daily_benefit"/>
<TextView
android:id="@+id/tv_top_name"
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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

@ -29,6 +29,7 @@ abstract class BaseVmAct<V:BaseVm>: IBaseAct() {
mViewModel.nowData.observe(this){ mViewModel.nowData.observe(this){
loadingView.dismiss() loadingView.dismiss()
MMkvHelper.clearUserInfo()
/*if(componentName.className!="LoginAct" ){ /*if(componentName.className!="LoginAct" ){
ToastUtils.show(R.string.again_login) ToastUtils.show(R.string.again_login)
RxActivityTool.finishAllActivity() RxActivityTool.finishAllActivity()

@ -24,13 +24,14 @@ abstract class BaseVmFrag<T : BaseVm> : IBaseFrag() {
super.initView() super.initView()
mViewModel = setViewModel() mViewModel = setViewModel()
mViewModel.loading = loadingView mViewModel.loading = loadingView
/* mViewModel.nowData.observe(this) {
mViewModel.nowData.observe(this) {
loadingView.dismiss() loadingView.dismiss()
ToastUtils.show(R.string.again_login) ToastUtils.show(R.string.again_login)
RxActivityTool.finishAllActivity() //RxActivityTool.finishAllActivity()
MMkvHelper.clearUserInfo() MMkvHelper.clearUserInfo()
RouteManager.goAct(ARouterUrl.LOGIN_ACT) // RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}*/ }
observer() observer()
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 179 KiB

@ -103,4 +103,6 @@ dependencies {
api 'com.google.zxing:core:3.3.3' api 'com.google.zxing:core:3.3.3'
api 'com.github.maning0303:MNZXingCode:V2.1.9' api 'com.github.maning0303:MNZXingCode:V2.1.9'
api 'pub.devrel:easypermissions:3.0.0'
} }

@ -3,17 +3,18 @@ package com.xty.common.arouter
class ARouterUrl { class ARouterUrl {
companion object { companion object {
//app //app
const val MAIN_ACT = "/com/zj365/dc/act/MainActivity" const val MAIN_ACT = "/com/zj365/dc/activity/MainActivity"
const val LOGIN_ACT = "/com/zj365/dc/act/LoginAct" const val LOGIN_ACT = "/com/zj365/dc/activity/LoginAct"
const val REGIST_ACT = "/com/zj365/dc/act/RegisterAct" const val REGIST_ACT = "/com/zj365/dc/activity/RegisterAct"
const val DEVICE_ACTIVE = "/com/zj365/dc/act/OneKeyBinderDeviceAct" const val DEVICE_ACTIVE = "/com/zj365/dc/activity/OneKeyBinderDeviceAct"
const val BASIC_INFO = "/com/zj365/dc/act/BasicInfoAct" const val BASIC_INFO = "/com/zj365/dc/act/BasicInfoAct"
const val BIND_WX_PHONE = "/com/zj365/dc/act/BindWxPhone" const val BIND_WX_PHONE = "/com/zj365/dc/act/BindWxPhone"
const val DEVICE_CONNECT = "/com/zj365/dc/act/DeviceConnectAct" const val DEVICE_CONNECT = "/com/zj365/dc/activity/DeviceConnectAct"
const val DEVICE_CHOICE = "/com/zj365/dc/act/DeviceChoiceAct" const val DEVICE_CHOICE = "/com/zj365/dc/activity/DeviceChoiceAct"
const val INFO_SIMPLE = "/com/zj365/dc/act/InfoSimpleAct" const val INFO_SIMPLE = "/com/zj365/dc/act/InfoSimpleAct"
const val DEVICE_SEARCH = "/com/zj365/dc/act/DeviceSearchBodyFatAct" const val DEVICE_SEARCH = "/com/zj365/dc/activity/DeviceSearchBodyFatAct"
const val DEVICE_BIND = "/com/zj365/dc/act/DeviceBindAct" const val DEVICE_BIND = "/com/zj365/dc/activity/DeviceBindAct"
const val SCIENCE_LIST = "/com/zj365/dc/activity/HealthScienceAct"
// const val FAMILY_INFO="/com/zj365/dc/act/FamilyMainAct" // const val FAMILY_INFO="/com/zj365/dc/act/FamilyMainAct"

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

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

@ -144,7 +144,7 @@
<string name="please_input_phone">请输入账号 (手机号)</string> <string name="please_input_phone">请输入账号 (手机号)</string>
<string name="please_input_jigou_id">请输入机构授权码(选填)</string> <string name="please_input_jigou_id">请输入机构授权码(选填)</string>
<string name="please_input_ok_phone">请输入正确的手机号</string> <string name="please_input_ok_phone">请输入正确的手机号</string>
<string name="please_input_password">请输入密码</string> <string name="please_input_password">请输入6位以上密码</string>
<string name="please_input_ok_password">请输入不少于6位数的密码</string> <string name="please_input_ok_password">请输入不少于6位数的密码</string>
<string name="please_setting_password">请输入不少于6位数的密码</string> <string name="please_setting_password">请输入不少于6位数的密码</string>
<string name="please_input_new_pwd">请输入不少于6位数的密码</string> <string name="please_input_new_pwd">请输入不少于6位数的密码</string>

@ -6,7 +6,7 @@ ext {
appId : "com.zj365.dc", appId : "com.zj365.dc",
minSdk : 23, minSdk : 23,
targetSdk : 32, targetSdk : 32,
versionCode : 1, versionCode : 2,
versionName : "1.0.0" versionName : "1.0.0"
] ]
@ -28,7 +28,7 @@ ext {
/* debug_url : "https://auprty.com/app/", /* debug_url : "https://auprty.com/app/",
release_url: "https://auprty.com/app/"*/ release_url: "https://auprty.com/app/"*/
// //
debug_url : "http://175.6.39.20:8181/app/", debug_url : "http://java01.zhongjian365.com/app/",
release_url: "http://175.6.39.20:8181/app/" release_url: "http://175.6.39.20:8181/app/"
] ]

@ -21,4 +21,5 @@ android.enableJetifier=true
kotlin.code.style=official kotlin.code.style=official
kotlin.incremental=true kotlin.incremental=true
org.gradle.parallel=true org.gradle.parallel=true
android.injected.testOnly=false android.injected.testOnly=false
android.defaults.buildfeatures.buildconfig=true

@ -229,6 +229,12 @@
<activity android:name=".act.BloodLipidAdjustRecordsAct" <activity android:name=".act.BloodLipidAdjustRecordsAct"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name="com.zj365.health.act.datamanage.IllHistoryAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.ComparePageDataAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>

@ -147,7 +147,7 @@
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10" android:paddingBottom="@dimen/dp_10"
android:text="管理" android:text="管理"
android:textColor="@color/col_8D0" android:textColor="@color/col_02c"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"

@ -63,7 +63,7 @@
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10" android:paddingBottom="@dimen/dp_10"
android:text="管理" android:text="管理"
android:textColor="@color/col_8D0" android:textColor="@color/col_02c"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"

@ -15,14 +15,11 @@
android:id="@+id/llUploadSuccess" android:id="@+id/llUploadSuccess"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14" android:layout_margin="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:background="@drawable/shape_white_8radius" android:background="@drawable/shape_white_8radius"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/dp_16" android:paddingLeft="@dimen/dp_16"
android:paddingTop="@dimen/dp_23" android:paddingTop="@dimen/dp_20"
android:paddingRight="@dimen/dp_16"> android:paddingRight="@dimen/dp_16">
<LinearLayout <LinearLayout
@ -30,11 +27,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <com.ruffian.library.widget.RImageView
android:id="@+id/tvGoodsIms" android:id="@+id/tvGoodsIms"
android:layout_width="@dimen/dp_100" android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_83" android:layout_height="@dimen/dp_83"
android:layout_marginEnd="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16"
app:is_circle="false"
app:corner_radius="@dimen/dp_5"
android:scaleType="centerCrop"
android:src="@drawable/shape_sleep_bg" /> android:src="@drawable/shape_sleep_bg" />
<LinearLayout <LinearLayout

@ -23,7 +23,7 @@
android:id="@+id/mRecycle" android:id="@+id/mRecycle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="@dimen/dp_10" android:layout_margin="@dimen/dp_14"
android:background="@drawable/shape_round_white" android:background="@drawable/shape_round_white"
android:paddingLeft="@dimen/dp_5" android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5" /> android:paddingRight="@dimen/dp_5" />

@ -9,10 +9,7 @@
android:id="@+id/llUploadSuccess" android:id="@+id/llUploadSuccess"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="@dimen/dp_20"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -20,6 +17,9 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
@ -30,7 +30,7 @@
tools:src="@drawable/shape_sleep_bg" /> tools:src="@drawable/shape_sleep_bg" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -77,7 +77,7 @@
android:layout_marginBottom="@dimen/dp_8" android:layout_marginBottom="@dimen/dp_8"
android:text="交易成功" android:text="交易成功"
android:textColor="@color/col_D9BD" android:textColor="@color/col_D9BD"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_13"
android:textStyle="bold" android:textStyle="bold"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
@ -89,18 +89,21 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="68.9" tools:text="68.9"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textStyle="bold"
android:textSize="@dimen/sp_13" /> android:textSize="@dimen/sp_13" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_15"
android:background="@color/col_0f2" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_20"
android:background="@color/col_0f2" />
</LinearLayout> </LinearLayout>

@ -1,33 +1,47 @@
package com.zj365.mime.act package com.zj365.mime.act
import android.Manifest
import android.content.Intent
import android.net.Uri
import android.text.SpannableString
import android.text.Spanned
import android.text.TextPaint
import android.text.style.ClickableSpan
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.MyLinkedMovementMethod
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.event.BlueToothConnectEvent import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.MyInfoEvent import com.xty.common.event.MyInfoEvent
import com.xty.network.MyRetrofit
import com.xty.network.model.SettingBean
import com.zj365.mime.R import com.zj365.mime.R
import com.zj365.mime.databinding.ActDevInfoBinding import com.zj365.mime.databinding.ActDevInfoBinding
import com.zj365.mime.vm.SettingVm import com.zj365.mime.vm.SettingVm
import com.zj365.mime.weight.FactorySettingDialog import com.zj365.mime.weight.FactorySettingDialog
import com.xty.network.MyRetrofit
import com.xty.network.model.SettingBean
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import pub.devrel.easypermissions.EasyPermissions
/** /**
* 设备解绑 设备信息 * 设备解绑 设备信息
*/ */
@Route(path = ARouterUrl.DEV_INFO) @Route(path = ARouterUrl.DEV_INFO)
class DevInfoAct : BaseVmAct<SettingVm>() { class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
val binding by lazy { ActDevInfoBinding.inflate(layoutInflater) } val binding by lazy { ActDevInfoBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root override fun setLayout() = binding.root
companion object{
val perssionCode = 0x0001
}
var user: SettingBean.User? = null var user: SettingBean.User? = null
var userId: String? = null var userId: String? = null
private val unBindDialog by lazy { private val unBindDialog by lazy {
@ -76,6 +90,32 @@ class DevInfoAct : BaseVmAct<SettingVm>() {
userId?.let { userId?.let {
mViewModel.getUserDeviceInfo(userId!!) mViewModel.getUserDeviceInfo(userId!!)
} }
var txtCol = ContextCompat.getColor(this, R.color.col_02c)
binding.tvContactKefu.movementMethod = MyLinkedMovementMethod().getInstance()
var span = SpannableString("续期或信号问题请联系客服")
span.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
if(EasyPermissions.hasPermissions(this@DevInfoAct,Manifest.permission.CALL_PHONE)){
startActivity(Intent(Intent.ACTION_CALL, Uri.parse("400 0063 365")))
}else{
EasyPermissions.requestPermissions(this@DevInfoAct,"申请打电话权限",perssionCode,Manifest.permission.CALL_PHONE);
}
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = txtCol
ds.isUnderlineText = false
}
}, 8, span.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
} }
override fun liveObserver() { override fun liveObserver() {
@ -131,4 +171,11 @@ class DevInfoAct : BaseVmAct<SettingVm>() {
} }
} }
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>) {
startActivity(Intent(Intent.ACTION_CALL, Uri.parse("400 0063 365")))
}
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
}
} }

@ -11,6 +11,7 @@ import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.YCBBlueConnectHelper import com.xty.common.bracelet.YCBBlueConnectHelper
import com.xty.common.event.BlueToothConnectEvent import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.LoginOutEvent
import com.xty.common.work.MyWorkManger import com.xty.common.work.MyWorkManger
import com.xty.network.MyRetrofit import com.xty.network.MyRetrofit
import com.xty.network.model.SettingBean import com.xty.network.model.SettingBean
@ -145,8 +146,9 @@ class SettingNewAct: BaseVmAct<SettingVm>() {
MMkvHelper.clearUserInfo()//清除用户登录信息 MMkvHelper.clearUserInfo()//清除用户登录信息
YCBBlueConnectHelper.disconnect()//断开蓝牙连接 YCBBlueConnectHelper.disconnect()//断开蓝牙连接
YCBBlueConnectHelper.cancelTimer()//断开重连定时器 YCBBlueConnectHelper.cancelTimer()//断开重连定时器
EventBus.getDefault().post(LoginOutEvent())
EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息 EventBus.getDefault().post(BlueToothConnectEvent())//刷新蓝牙连接信息
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
RxActivityTool.finishAllActivity() finish()
} }
} }

@ -9,6 +9,7 @@ import com.xty.network.model.RespBody
import com.xty.network.model.ScoreBean import com.xty.network.model.ScoreBean
import com.xty.network.model.SettingBean import com.xty.network.model.SettingBean
import com.xty.network.model.UnReadMessageBean import com.xty.network.model.UnReadMessageBean
import com.xty.network.model.Update
import com.xty.network.model.UserEquipmentInformationizationBean import com.xty.network.model.UserEquipmentInformationizationBean
import org.json.JSONObject import org.json.JSONObject
@ -24,6 +25,8 @@ class SettingVm : BaseVm() {
val deviceInfo by lazy { MutableLiveData<RespBody<UserEquipmentInformationizationBean>>() } val deviceInfo by lazy { MutableLiveData<RespBody<UserEquipmentInformationizationBean>>() }
val inviteCountLive by lazy { MutableLiveData<RespBody<String>>() } val inviteCountLive by lazy { MutableLiveData<RespBody<String>>() }
val updateLive by lazy { MutableLiveData<RespBody<Update>>() }
fun getNesProg(id: String) { fun getNesProg(id: String) {
startHttp { startHttp {
val json = JSONObject() val json = JSONObject()
@ -135,4 +138,11 @@ class SettingVm : BaseVm() {
response.getCodeStatus(destLive,nowData) response.getCodeStatus(destLive,nowData)
} }
} }
fun getVersionNew(versionCode:Int) {
startHttp {
var response = apiInterface().getVersionNew(versionCode)
response.getCodeStatus(updateLive, nowData)
}
}
} }

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -15,6 +15,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_18" android:layout_marginStart="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_16" android:layout_marginTop="@dimen/dp_16"
android:layout_below="@+id/title"
android:layout_marginEnd="@dimen/dp_18" android:layout_marginEnd="@dimen/dp_18"
app:cardCornerRadius="@dimen/dp_8"> app:cardCornerRadius="@dimen/dp_8">
@ -105,4 +106,38 @@
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</LinearLayout> <LinearLayout
android:id="@+id/ll_device_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_27"
android:visibility="gone"
android:orientation="vertical">
<TextView
android:id="@+id/tv_contact_kefu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="续期或信号问题请联系客服"
android:textColor="@color/col_c7c"
android:layout_gravity="center"/>
<TextView
android:id="@+id/tv_device_setting"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:text="手表设置"
android:textColor="@color/white"
android:textStyle="bold"
android:gravity="center"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginRight="@dimen/dp_25"
android:background="@drawable/shape_r25_02c"
/>
</LinearLayout>
</RelativeLayout>

@ -480,8 +480,8 @@ interface ApiInterface {
/** /**
* 首页轮播图 * 首页轮播图
*/ */
@GET("customer/bannerImg/listNew") @POST("customer/bannerImg/listNew")
suspend fun getBanners(@Query("userId") id: String?): RespBody<List<BannerBean>> suspend fun getBanners(@Body rb: RequestBody): RespBody<MutableList<BannerBean>>
/** /**
* 打卡首页信息 * 打卡首页信息
@ -901,6 +901,12 @@ interface ApiInterface {
@GET("customer/analyse/coupeNew") @GET("customer/analyse/coupeNew")
suspend fun getScinceList(): RespBody<MutableList<ScienceBean>> suspend fun getScinceList(): RespBody<MutableList<ScienceBean>>
/**
* 获取首页布局
*/
@POST("customer/layout/list")
suspend fun getHomeLayout():RespBody<HomeLayoutBean>
/** /**
* 关于 * 关于
*/ */

@ -0,0 +1,18 @@
package com.xty.network.model
data class HomeLayoutBean(
val middle:ArrayList<HomeChildBean>,
val top:ArrayList<HomeChildBean>
){
data class HomeChildBean(
var id:Int,
var name:String, //名称
var imageUrl:String, //图标
var type:Int,
var jumpType:Int, //1原生跳转2h5跳转3小程序跳转
var jumpUrl:String?, //跳转地址或编码
var status:Int,
var seq:String
)
}
Loading…
Cancel
Save