中建365-版本1.1.0

develop
wlh 1 year ago
parent 2e5dfc8f4e
commit ef4b7361b4

@ -89,7 +89,7 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
@RequiresApi(Build.VERSION_CODES.O) @RequiresApi(Build.VERSION_CODES.O)
override fun initView() { override fun initView() {
super.initView() super.initView()
// statusBar(binding.mStatusBar) // statusBar(binding.statusBar)
showIdInfo =if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") { showIdInfo =if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {
"" ""
} else { } else {
@ -328,9 +328,11 @@ class MineFrag : BaseVmFrag<SettingVm>(),EasyPermissions.PermissionCallbacks {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else { }else {
bundle.clear() CommonToastUtils.showToast("敬请期待")
bundle.putString("id", user?.id)
RouteManager.goAct(ARouterUrl.ORDER_LIST, bundle) /* bundle.clear()
bundle.putString("id", user?.id)
RouteManager.goAct(ARouterUrl.ORDER_LIST, bundle)*/
} }
} }

@ -208,9 +208,9 @@ class LoginVm() : BaseVm() {
var headerIterator = headers.iterator() var headerIterator = headers.iterator()
while (headerIterator.hasNext()) { while (headerIterator.hasNext()) {
var next = headerIterator.next() var next = headerIterator.next()
if (Const.Auth_Token == next.first) MMkvHelper.put(Const.Auth_Token, next.second) if (Const.Auth_Token == next.first || "auth-token".equals(next.first)) MMkvHelper.put(Const.Auth_Token, next.second)
if (Const.Auth_Id == next.first) MMkvHelper.put(Const.Auth_Id, next.second) if (Const.Auth_Id == next.first || "auth-id".equals(next.first)) MMkvHelper.put(Const.Auth_Id, next.second)
} }
} }

@ -78,8 +78,8 @@ class RegisterVm : BaseVm() {
var headerIterator = headers.iterator() var headerIterator = headers.iterator()
while (headerIterator.hasNext()) { while (headerIterator.hasNext()) {
var next = headerIterator.next() var next = headerIterator.next()
if (Const.Auth_Token == next.first) MMkvHelper.put(Const.Auth_Token, next.second) if (Const.Auth_Token == next.first || "auth-token".equals(next.first)) MMkvHelper.put(Const.Auth_Token, next.second)
if (Const.Auth_Id == next.first) MMkvHelper.put(Const.Auth_Id, next.second) if (Const.Auth_Id == next.first || "auth-id".equals(next.first)) MMkvHelper.put(Const.Auth_Id, next.second)
} }
} }

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<include <include

@ -24,9 +24,11 @@ import com.xty.common.BuildConfig
import com.xty.common.LogUtils import com.xty.common.LogUtils
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.ReChangeEvent
import com.xty.common.event.WxPayEvent import com.xty.common.event.WxPayEvent
import com.xty.common.util.SpannableUtils import com.xty.common.util.SpannableUtils
import com.xty.network.model.WeixinPayBean import com.xty.network.model.WeixinPayBean
import org.greenrobot.eventbus.EventBus
open class PayUtils(var context: Context) { open class PayUtils(var context: Context) {
@ -190,6 +192,8 @@ open class PayUtils(var context: Context) {
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) )
.show() .show()
EventBus.getDefault().post(ReChangeEvent())
} else { } else {
Toast.makeText( Toast.makeText(
context, context,
@ -214,6 +218,7 @@ open class PayUtils(var context: Context) {
bundle.putString("orderNo", orderNo) bundle.putString("orderNo", orderNo)
bundle.putString("orderType", "1") bundle.putString("orderType", "1")
RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle)*/ RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle)*/
EventBus.getDefault().post(ReChangeEvent())
Toast.makeText( Toast.makeText(
context, context,
"支付成功", "支付成功",

@ -58,7 +58,10 @@ class MyApp : Application() {
super.onCreate() super.onCreate()
LogUtils.d("MyApp onCreate!!!!") LogUtils.d("MyApp onCreate!!!!")
// initCrash() if (BuildConfig.isRelease){
initCrash()
}
// 初始化 Toast 框架 // 初始化 Toast 框架
getInstance(this) getInstance(this)
MMkvHelper.initMmkv(this) MMkvHelper.initMmkv(this)
@ -74,7 +77,7 @@ class MyApp : Application() {
initX5() initX5()
//bugly 上报 在release版本才会上报 //bugly 上报 在release版本才会上报
// if(BuildConfig.isRelease){ // if(BuildConfig.isRelease){
// CrashReport.initCrashReport(this, "", true) // CrashReport.initCrashReport(this, "", true)
// } // }
//删除角标 //删除角标
ShortcutBadger.applyCount(applicationContext, 0) ShortcutBadger.applyCount(applicationContext, 0)
@ -271,7 +274,7 @@ class MyApp : Application() {
/** /**
* 崩溃拦截框架 * 崩溃拦截框架
*/ */
/* @SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
private fun initCrash() { private fun initCrash() {
CrashGuard.install(this, object : ExceptionHandler() { CrashGuard.install(this, object : ExceptionHandler() {
override fun onUncaughtException(thread: Thread, throwable: Throwable) { override fun onUncaughtException(thread: Thread, throwable: Throwable) {
@ -283,7 +286,7 @@ class MyApp : Application() {
LogUtils.e("simon", "生命周期异常 thread:${thread.name} throwable:${e.message}") LogUtils.e("simon", "生命周期异常 thread:${thread.name} throwable:${e.message}")
} }
}) })
}*/ }
// CaocConfig.Builder.create() // CaocConfig.Builder.create()
// .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) // .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT)

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

@ -25,14 +25,17 @@ ext {
url = [ url = [
// //
/* debug_url : "https://auprty.com/app/", debug_url : "https://app.zhongjian365.com/app/",
release_url: "https://auprty.com/app/"*/ release_url: "https://app.zhongjian365.com/app/",
h5_debug_url : "https://built.zhongjian365.com/",
h5_release_url : "https://built.zhongjian365.com/"
// //
debug_url : "http://java01.zhongjian365.com/app/", /* debug_url : "http://java01.zhongjian365.com/app/",
release_url: "http://java01.zhongjian365.com/app/", release_url: "http://java01.zhongjian365.com/app/",*/
h5_debug_url : "http://testbuilt.zhongjian365.com/", /* h5_debug_url : "http://testbuilt.zhongjian365.com/",
h5_release_url : "http://testbuilt.zhongjian365.com/" h5_release_url : "http://testbuilt.zhongjian365.com/"*/
] ]

@ -98,8 +98,11 @@ class MedicalHistoryAct : BaseVmAct<MedicalHistoryVm>() {
if (trim.isNullOrEmpty()) { if (trim.isNullOrEmpty()) {
return@setOnClickListener return@setOnClickListener
} }
mAdapter.isCheckNone = false
mAdapter.data[inputPosition].inputStr = trim mAdapter.data[inputPosition].inputStr = trim
mAdapter.notifyItemChanged(inputPosition) mAdapter.data[inputPosition].isSelect = true
// mAdapter.notifyItemChanged(inputPosition)
mAdapter.notifyDataSetChanged()
hideInputSoft() hideInputSoft()
} }
//设置起始时间 //设置起始时间

@ -1,5 +1,6 @@
package com.zj365.health.act.familyhealth package com.zj365.health.act.familyhealth
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.GsonUtils import com.blankj.utilcode.util.GsonUtils
@ -7,12 +8,15 @@ import com.xty.base.act.BaseListAct
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.AddSuccessEvent import com.xty.common.event.AddSuccessEvent
import com.xty.common.util.CommonUtils
import com.xty.network.model.CancerGoodsBean import com.xty.network.model.CancerGoodsBean
import com.xty.network.model.FamilyHealthBean import com.xty.network.model.FamilyHealthBean
import com.xty.network.model.InviteCustodyBean
import com.zj365.health.R import com.zj365.health.R
import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter import com.zj365.health.adapter.familyhealth.HealthFamilyAdapter
import com.zj365.health.databinding.ActHealthFamilyBinding import com.zj365.health.databinding.ActHealthFamilyBinding
import com.zj365.health.vm.FamilyHealthVm import com.zj365.health.vm.FamilyHealthVm
import com.zj365.health.weight.DialogTipNew
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
@ -20,6 +24,22 @@ import org.greenrobot.eventbus.ThreadMode
class FamilyHealthAct : BaseListAct<FamilyHealthVm>() { class FamilyHealthAct : BaseListAct<FamilyHealthVm>() {
val binding by lazy { ActHealthFamilyBinding.inflate(layoutInflater) } val binding by lazy { ActHealthFamilyBinding.inflate(layoutInflater) }
val mAdapter by lazy { HealthFamilyAdapter() } val mAdapter by lazy { HealthFamilyAdapter() }
var inviteCustodyBean: InviteCustodyBean? = null
val dialogInvite by lazy {
DialogTipNew(this, "监护邀请","", "确认","取消",false,{
inviteCustodyBean?.let {
mViewModel.confirmInvite(it.id,"1")
}
}){
inviteCustodyBean?.let {
mViewModel.confirmInvite(it.id,"0")
}
}
}
override fun liveObserver() { override fun liveObserver() {
mViewModel.familyHealthListData.observe(this){ mViewModel.familyHealthListData.observe(this){
mAdapter.setNewInstance(it.data) mAdapter.setNewInstance(it.data)
@ -29,6 +49,15 @@ class FamilyHealthAct : BaseListAct<FamilyHealthVm>() {
page =1 page =1
loadData() loadData()
} }
mViewModel.findInfoLiveData.observe(this){
if (it.data != null){
inviteCustodyBean = it.data
dialogInvite.setContentNew("${CommonUtils.replaceMiddleNumber(it.data.phone)}用户邀请您成为 监护人")
dialogInvite.show()
}
}
} }
override fun setLayout() = binding.root override fun setLayout() = binding.root
@ -69,6 +98,9 @@ class FamilyHealthAct : BaseListAct<FamilyHealthVm>() {
} }
override fun loadData() { override fun loadData() {
if(page == 1){
mViewModel.searchInviteInfo()
}
mViewModel.getFamilyHealthList() mViewModel.getFamilyHealthList()
} }
@ -79,6 +111,9 @@ class FamilyHealthAct : BaseListAct<FamilyHealthVm>() {
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun addSuccess(event: AddSuccessEvent){ fun addSuccess(event: AddSuccessEvent){
page = 1 page = 1
if(page == 1){
mViewModel.searchInviteInfo()
}
loadData() loadData()
} }

@ -62,7 +62,7 @@ class HealthFamilyAdapter: BaseAdapter<FamilyHealthBean>(R.layout.item_health_fa
holder.setGone(R.id.user_avatar_recycler,true) holder.setGone(R.id.user_avatar_recycler,true)
holder.setGone(R.id.tv_num,true) holder.setGone(R.id.tv_num,true)
holder.setGone(R.id.tv_watch_him,false) holder.setGone(R.id.tv_watch_him,true)
} }

@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.network.model.FamilyGuardianBean import com.xty.network.model.FamilyGuardianBean
import com.xty.network.model.FamilyHealthBean import com.xty.network.model.FamilyHealthBean
import com.xty.network.model.InviteCustodyBean
import com.xty.network.model.RespBody import com.xty.network.model.RespBody
import org.json.JSONObject import org.json.JSONObject
@ -19,6 +20,10 @@ class FamilyHealthVm :BaseVm() {
val deleteGuardianLiveData by lazy { MutableLiveData<RespBody<Any>>() } val deleteGuardianLiveData by lazy { MutableLiveData<RespBody<Any>>() }
val findInfoLiveData by lazy { MutableLiveData<RespBody<InviteCustodyBean>>() }
val confirmInviteLiveData by lazy { MutableLiveData<RespBody<Any>>() }
fun getFamilyHealthList(){ fun getFamilyHealthList(){
startHttp (true){ startHttp (true){
@ -63,5 +68,24 @@ class FamilyHealthVm :BaseVm() {
} }
} }
fun searchInviteInfo(){
startHttp(false) {
var json = JSONObject()
val response = apiInterface().findConfirmInfo(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(findInfoLiveData, nowData)
}
}
fun confirmInvite(id:String, status:String){
startHttp(false) {
var json = JSONObject()
json.put("id",id)
json.put("status",status)
val response = apiInterface().confirmInvited(retrofits.getRequestBody(json.toString()))
response.getCodeStatus(confirmInviteLiveData,nowData)
}
}
} }

@ -21,6 +21,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/img_avatar" android:layout_toRightOf="@+id/img_avatar"
android:layout_toLeftOf="@+id/desc"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginLeft="@dimen/dp_13" android:layout_marginLeft="@dimen/dp_13"
android:layout_centerVertical="true"> android:layout_centerVertical="true">
@ -32,6 +33,8 @@
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:textStyle="bold" android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
tools:text="大哥"/> tools:text="大哥"/>
<TextView <TextView

@ -20,6 +20,7 @@ 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.MyInfoEvent import com.xty.common.event.MyInfoEvent
import com.xty.common.event.ReChangeEvent
import com.xty.network.MyRetrofit import com.xty.network.MyRetrofit
import com.xty.network.model.SettingBean import com.xty.network.model.SettingBean
import com.zj365.mime.BuildConfig import com.zj365.mime.BuildConfig
@ -28,6 +29,8 @@ 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 org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import pub.devrel.easypermissions.EasyPermissions import pub.devrel.easypermissions.EasyPermissions
@ -198,4 +201,11 @@ class DevInfoAct : BaseVmAct<SettingVm>(),EasyPermissions.PermissionCallbacks {
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) { override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
} }
@Subscribe(threadMode = ThreadMode.MAIN)
fun refreshUI(event: ReChangeEvent){
user?.let {
mViewModel.getUserDeviceInfo(it.id)
}
}
} }
Loading…
Cancel
Save