中建365-二期开发-优化

develop
wlh 1 year ago
parent d3c1305b62
commit c8bc5dd436

@ -479,7 +479,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
mViewModel.getAllInfo(showIdInfo, false) mViewModel.getAllInfo(showIdInfo, false)
// mViewModel.getMySetting() // mViewModel.getMySetting()
mViewModel.getTips() mViewModel.getTips()
mViewModel.getRank(2) // mViewModel.getRank(2)
if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){ if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){

@ -566,9 +566,9 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
// 刷新注册 // 刷新注册
private fun refresh() { private fun refresh() {
refresh.setRefresh(binding.mRefresh) { /* refresh.setRefresh(binding.mRefresh) {
request() request()
} }*/
} }
private fun request() { private fun request() {

@ -103,6 +103,24 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
//刷新注册 //刷新注册
refresh() refresh()
Const.mainLiveData.value?.let {
user = it.user
binding.mName.text = it.user.name
binding.mPhone.text = "${it.user.phone}"
// binding.mDk.text = it.clock.toString()
// binding.mLevel.text = it.grade
if (it.user.avatarUrl.isNullOrEmpty()) {
binding.mImage.setImageResource(defaultIcon[if (it.user.sex - 1 < 0) 0 else it.user.sex - 1])
} else {
binding.mImage.setImageUser(
requireContext(),
it.user.avatarUrl,
it.user.sex.toString()
)
Const.CHAT_IMAGE = it.user.avatarUrl
}
}
binding.mNoNetwork.mRefreshBtn.isSelected = true binding.mNoNetwork.mRefreshBtn.isSelected = true
binding.mNoNetwork.mRefreshBtn.setOnClickListener { binding.mNoNetwork.mRefreshBtn.setOnClickListener {
mViewModel.getMySetting() mViewModel.getMySetting()
@ -489,7 +507,9 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (!TextUtils.isEmpty(showIdInfo)){ if (!TextUtils.isEmpty(showIdInfo)){
mViewModel.getMySetting()
Const.mainLiveData.value?: mViewModel.getMySetting()
// mViewModel.getAllInfo(showIdInfo,false) // mViewModel.getAllInfo(showIdInfo,false)
mViewModel.searchInviteInfo() mViewModel.searchInviteInfo()
// mViewModel.getUserOtherInfo() // mViewModel.getUserOtherInfo()
@ -551,21 +571,7 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
if (null == it) { if (null == it) {
return@observe return@observe
} }
user = it.user
binding.mName.text = it.user.name
binding.mPhone.text = "${it.user.phone}"
// binding.mDk.text = it.clock.toString()
// binding.mLevel.text = it.grade
if (it.user.avatarUrl.isNullOrEmpty()) {
binding.mImage.setImageResource(defaultIcon[if (it.user.sex - 1 < 0) 0 else it.user.sex - 1])
} else {
binding.mImage.setImageUser(
requireContext(),
it.user.avatarUrl,
it.user.sex.toString()
)
Const.CHAT_IMAGE = it.user.avatarUrl
}
} }
@ -583,6 +589,22 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
) )
} }
Const.mainLiveData.value = settingBean Const.mainLiveData.value = settingBean
user = settingBean.user
binding.mName.text = settingBean.user.name
binding.mPhone.text = "${settingBean.user.phone}"
// binding.mDk.text = it.clock.toString()
// binding.mLevel.text = it.grade
if (settingBean.user.avatarUrl.isNullOrEmpty()) {
binding.mImage.setImageResource(defaultIcon[if (settingBean.user.sex - 1 < 0) 0 else settingBean.user.sex - 1])
} else {
binding.mImage.setImageUser(
requireContext(),
settingBean.user.avatarUrl,
settingBean.user.sex.toString()
)
Const.CHAT_IMAGE = settingBean.user.avatarUrl
}
// binding.mNoNetwork.root.visibility = View.GONE // binding.mNoNetwork.root.visibility = View.GONE
} }
} }

@ -6,10 +6,12 @@ import android.text.TextUtils
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.tamsiree.rxkit.RxKeyboardTool import com.tamsiree.rxkit.RxKeyboardTool
import com.xty.base.fragment.BaseFragList import com.xty.base.fragment.BaseFragList
import com.xty.base.fragment.BaseVmFrag import com.xty.base.fragment.BaseVmFrag
@ -17,6 +19,7 @@ import com.xty.base.vm.BaseVm
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.util.CommonToastUtils import com.xty.common.util.CommonToastUtils
import com.xty.common.weight.ExpandStaggeredManager
import com.xty.network.model.GoodsRecordsBean import com.xty.network.model.GoodsRecordsBean
import com.xty.network.model.ShopCategoryBean import com.xty.network.model.ShopCategoryBean
import com.zj365.dc.BuildConfig import com.zj365.dc.BuildConfig
@ -38,7 +41,8 @@ class ShopFragment: BaseFragList<ShopMallVm>() {
override fun initAdapter() { override fun initAdapter() {
binding.recyclerView.adapter = mGoodsAdapter binding.recyclerView.adapter = mGoodsAdapter
binding.recyclerView.layoutManager = GridLayoutManager(requireContext(),2) binding.recyclerView.layoutManager = ExpandStaggeredManager(2,
StaggeredGridLayoutManager.VERTICAL)
binding.categoryRecyclerView.adapter = mCategoryAdapter binding.categoryRecyclerView.adapter = mCategoryAdapter

@ -154,18 +154,6 @@ class DynamicManagementVm : BaseVm() {
} }
} }
/**
* 获取家人
*/
fun getMyFamilyList() {
startHttp(false) {
val json = JSONObject()
/* json.put("pageNum","1")
json.put("pageSize",Const.PAGE_SIZE)*/
val request = apiInterface().getMyFamily(retrofits.getRequestBody(json.toString()))
request.getCodeStatus(familyLive, nowData)
}
}
/** /**
* 首页小贴士 * 首页小贴士

@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.util.CommonUtils import com.xty.common.util.CommonUtils
import com.xty.network.model.BannerBean import com.xty.network.model.BannerBean
@ -154,14 +155,6 @@ class MainVm : 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){ fun confirmInvite(id:String, status:String){
startHttp(false) { startHttp(false) {
var json = JSONObject() var json = JSONObject()
@ -193,6 +186,8 @@ class MainVm : BaseVm() {
*/ */
fun getMySetting() { fun getMySetting() {
startHttp(false) { startHttp(false) {
LogUtils.e("eeeeee","主界面请求个人中心数据啦")
val body = apiInterface().getMySetting() val body = apiInterface().getMySetting()
body.getCodeStatus(settingLive, nowData) body.getCodeStatus(settingLive, nowData)
} }

@ -39,7 +39,7 @@ class ShopMallVm : BaseVm() {
} }
json.put("categoryId",categoryId) json.put("categoryId",categoryId)
json.put("isRec",isRec) json.put("isRec",isRec)
json.put("pageSize",20) json.put("pageSize",10)
json.put("pageNum",pageSize) json.put("pageNum",pageSize)
var code = apiInterface().getGoodsList(retrofits.getRequestBody(json.toString())) var code = apiInterface().getGoodsList(retrofits.getRequestBody(json.toString()))
code.getCodeStatus(goodsLiveData, nowData) code.getCodeStatus(goodsLiveData, nowData)

@ -64,7 +64,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/child_recyclerView" android:id="@+id/child_recyclerView"
android:layout_width="@dimen/dp_76" android:layout_width="@dimen/dp_88"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"/> android:background="@color/white"/>

@ -17,21 +17,6 @@
<!-- 下拉刷新控件 --> <!-- 下拉刷新控件 -->
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:srlAccentColor="@color/white">
<!-- 经典下拉头部 -->
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foregroundTint="@color/white"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="@color/white" />
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -168,5 +153,4 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>

@ -13,6 +13,7 @@
android:layout_marginLeft="@dimen/dp_16" android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16" android:layout_marginRight="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_56" android:layout_marginTop="@dimen/dp_56"
android:layout_marginBottom="@dimen/dp_17"
app:corner_radius="@dimen/dp_18" app:corner_radius="@dimen/dp_18"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
@ -44,42 +45,61 @@
android:layout_marginLeft="@dimen/dp_7"/> android:layout_marginLeft="@dimen/dp_7"/>
</com.ruffian.library.widget.RRelativeLayout> </com.ruffian.library.widget.RRelativeLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
android:layout_marginTop="@dimen/dp_17" <LinearLayout
android:background="@color/white" android:layout_width="match_parent"
android:layout_marginBottom="@dimen/dp_5" android:layout_height="match_parent"
android:id="@+id/category_recyclerView"/> android:orientation="vertical">
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/mRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foregroundTint="@color/white"
app:srlAccentColor="@color/black"
app:srlPrimaryColor="@color/white" />
<com.scwang.smart.refresh.layout.SmartRefreshLayout <LinearLayout
android:id="@+id/mRefresh" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="0dp" android:orientation="vertical">
android:layout_weight="1"
android:background="@color/col_6f7"
android:layout_marginTop="@dimen/dp_30"
app:srlAccentColor="@color/col_6f7">
<com.scwang.smart.refresh.header.ClassicsHeader <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:foregroundTint="@color/white" android:background="@color/white"
app:srlAccentColor="@color/black" android:layout_marginBottom="@dimen/dp_5"
app:srlPrimaryColor="@color/white" /> android:id="@+id/category_recyclerView"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_7"
android:id="@+id/recyclerView"/>
<com.scwang.smart.refresh.footer.ClassicsFooter <androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:background="@color/col_6f7"
android:paddingTop="@dimen/dp_15"
app:srlAccentColor="@color/col_6f7"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15"
android:id="@+id/recyclerView"/>
</LinearLayout>
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>

@ -2,12 +2,15 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_child_category" android:id="@+id/tv_child_category"
android:layout_width="@dimen/dp_76" android:layout_width="wrap_content"
android:layout_height="@dimen/dp_39" android:layout_height="@dimen/dp_39"
android:minWidth="@dimen/dp_88"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textStyle="bold" android:maxLines="1"
tools:text="女士" android:ellipsize="end"
android:maxEms="5"
tools:text="女士女士女士女士女士女士"
android:gravity="center" android:gravity="center"
android:background="@color/white" android:background="@color/white"
/> />

@ -5,6 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_round_white" android:background="@drawable/shape_round_white"
android:layout_marginTop="@dimen/dp_15"
tools:ignore="MissingDefaultResource"> tools:ignore="MissingDefaultResource">
<com.ruffian.library.widget.RImageView <com.ruffian.library.widget.RImageView
@ -15,26 +16,22 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginLeft="@dimen/dp_15" android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_12"
android:scaleType="fitXY" android:scaleType="fitXY"
app:is_circle="false" app:is_circle="false"
app:corner_radius_bottom_left="@dimen/dp_0" app:corner_radius="@dimen/dp_5"/>
app:corner_radius_bottom_right="@dimen/dp_0"
app:corner_radius_top_right="@dimen/dp_8"
app:corner_radius_top_left="@dimen/dp_8"/>
<TextView <TextView
android:id="@+id/tv_goods_name" android:id="@+id/tv_goods_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="@+id/img_goods"
app:layout_constraintLeft_toRightOf="@+id/img_goods" app:layout_constraintLeft_toRightOf="@+id/img_goods"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_price"
android:gravity="left" android:gravity="left"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12" android:layout_marginRight="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_7" android:layout_marginLeft="@dimen/dp_7"
tools:text="中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航..." tools:text="中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航..."
@ -45,26 +42,22 @@
android:id="@+id/tv_price" android:id="@+id/tv_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tv_goods_name"
app:layout_constraintLeft_toRightOf="@+id/img_goods" app:layout_constraintLeft_toRightOf="@+id/img_goods"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@+id/tv_line_price"
android:textColor="@color/col_2621" android:textColor="@color/col_2621"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_16"
tools:text="¥1999.00"/> tools:text="¥1999.00"/>
<TextView <TextView
android:id="@+id/tv_line_price" android:id="@+id/tv_line_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/tv_goods_name" app:layout_constraintLeft_toRightOf="@+id/img_goods"
app:layout_constraintLeft_toRightOf="@+id/tv_price"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="@+id/img_goods"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_13"
android:layout_marginLeft="@dimen/dp_7" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_16"
tools:text="¥1999.00"/> tools:text="¥1999.00"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -6,7 +6,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:id="@+id/root" android:id="@+id/root"
android:gravity="center" android:gravity="center"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.ruffian.library.widget.RImageView <com.ruffian.library.widget.RImageView
@ -26,7 +26,10 @@
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textStyle="bold" android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
android:maxEms="5"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
tools:text="低卡零食"/> tools:text="低卡零食低卡零食"/>
</LinearLayout> </LinearLayout>

@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_round_white" android:background="@drawable/shape_round_white"
android:paddingBottom="@dimen/dp_21" android:paddingBottom="@dimen/dp_11"
tools:ignore="MissingDefaultResource"> tools:ignore="MissingDefaultResource">
<com.ruffian.library.widget.RImageView <com.ruffian.library.widget.RImageView
@ -29,10 +29,13 @@
app:layout_constraintTop_toBottomOf="@+id/img_goods" app:layout_constraintTop_toBottomOf="@+id/img_goods"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_price"
android:gravity="left" android:gravity="left"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:layout_margin="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
tools:text="中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航..." tools:text="中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航中健健康智能手表血糖血脂尿酸风险长续航..."
android:maxLines="2" android:maxLines="2"
android:ellipsize="end"/> android:ellipsize="end"/>
@ -46,7 +49,7 @@
android:textColor="@color/col_2621" android:textColor="@color/col_2621"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_16" android:layout_marginTop="@dimen/dp_10"
tools:text="¥1999.00"/> tools:text="¥1999.00"/>
<TextView <TextView
@ -56,9 +59,9 @@
app:layout_constraintTop_toBottomOf="@+id/tv_goods_name" app:layout_constraintTop_toBottomOf="@+id/tv_goods_name"
app:layout_constraintLeft_toRightOf="@+id/tv_price" app:layout_constraintLeft_toRightOf="@+id/tv_price"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:layout_marginTop="@dimen/dp_10"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:layout_marginLeft="@dimen/dp_7" android:layout_marginLeft="@dimen/dp_7"
android:layout_marginTop="@dimen/dp_16"
tools:text="¥1999.00"/> tools:text="¥1999.00"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -60,13 +60,10 @@ import org.json.JSONObject
} }
var data = Bundle() var data = Bundle()
//true表示标准全屏false表示X5全屏不设置默认false
//true表示标准全屏false表示X5全屏不设置默认false //true表示标准全屏false表示X5全屏不设置默认false
data.putBoolean("standardFullScreen", false) data.putBoolean("standardFullScreen", false)
//false关闭小窗true开启小窗不设置默认true
//false关闭小窗true开启小窗不设置默认true //false关闭小窗true开启小窗不设置默认true
data.putBoolean("supportLiteWnd", false) data.putBoolean("supportLiteWnd", false)
//1以页面内开始播放2以全屏开始播放不设置默认1
//1以页面内开始播放2以全屏开始播放不设置默认1 //1以页面内开始播放2以全屏开始播放不设置默认1
data.putInt("DefaultVideoScreen", 2) data.putInt("DefaultVideoScreen", 2)
@ -127,7 +124,7 @@ import org.json.JSONObject
mWebSetting!!.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS mWebSetting!!.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
mWebSetting!!.setSupportZoom(true) //设置支持缩放 mWebSetting!!.setSupportZoom(false) //设置支持缩放
mWebSetting!!.builtInZoomControls = true mWebSetting!!.builtInZoomControls = true
mWebSetting!!.useWideViewPort = true //将图片调整到合适的webView大小 mWebSetting!!.useWideViewPort = true //将图片调整到合适的webView大小

@ -187,6 +187,7 @@ open class CloudJSBridge(val context: Context, val listener: IJsBridge) {
baseActivity.bundle.clear() baseActivity.bundle.clear()
baseActivity.bundle.putLong("answerId", bean.id) baseActivity.bundle.putLong("answerId", bean.id)
RouteManager.goAct(ARouterUrl.PSYCHOLOGICAL_RESULT_ACT, baseActivity.bundle) RouteManager.goAct(ARouterUrl.PSYCHOLOGICAL_RESULT_ACT, baseActivity.bundle)
baseActivity.finish()
} }
} }

@ -0,0 +1,44 @@
package com.xty.common.weight;
import android.content.Context;
import android.util.AttributeSet;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
public class ExpandStaggeredManager extends StaggeredGridLayoutManager {
public ExpandStaggeredManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public ExpandStaggeredManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
try {
super.onLayoutChildren(recycler, state);
}catch (Exception e){
e.printStackTrace();
}
}
/**
* try catch
* @param state
*/
@Override
public void onScrollStateChanged(int state) {
try {
super.onScrollStateChanged(state);
}catch (Exception e){
e.printStackTrace();
}
}
}

@ -33,8 +33,6 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
private var userId: String = "" private var userId: String = ""
private val MAX_LENGTH = 10 private val MAX_LENGTH = 10
private var recordNumber = 0
private val timSelect by lazy { private val timSelect by lazy {
TimeSelect(this) { TimeSelect(this) {
}.apply { }.apply {
@ -47,6 +45,7 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
override fun initData() { override fun initData() {
super.initData() super.initData()
addChildViews() addChildViews()
userId = intent.getStringExtra("userId").toString() userId = intent.getStringExtra("userId").toString()
} }
@ -103,11 +102,9 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
PointLengthFilter(2) PointLengthFilter(2)
) )
val mTvTimeView = childView.findViewById<TextView>(R.id.mVTimeView) val mTvTimeView = childView.findViewById<TextView>(R.id.mVTimeView)
mTvTimeView.tag = viewNum - 1
mTvTimeView.setOnClickListener { mTvTimeView.setOnClickListener {
RxKeyboardTool.hideSoftInput(this) RxKeyboardTool.hideSoftInput(this)
timSelect.selectTime(it, "yyyy-MM-dd HH:mm") timSelect.selectTime(it, "yyyy-MM-dd HH:mm")
recordNumber = it.tag.toString().toInt()
} }
childView.setPadding(0, 0, 0, dp2px(0)) childView.setPadding(0, 0, 0, dp2px(0))
@ -120,14 +117,10 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
val list: MutableList<UricCalibrationBean> = mutableListOf() val list: MutableList<UricCalibrationBean> = mutableListOf()
for (i in 0 until binding.childLayout.childCount) { for (i in 0 until binding.childLayout.childCount) {
val uricCalibrationBean = UricCalibrationBean() val uricCalibrationBean = UricCalibrationBean()
uricCalibrationBean.bpTime = (getChildView( uricCalibrationBean.bpTime =
i, (getChildView(i, R.id.mVTimeView) as TextView).text.toString()
R.id.mVTimeView uricCalibrationBean.uaValue =
) as TextView).text.toString() (getChildView(i, R.id.edUricValue) as TextView).text.toString()
uricCalibrationBean.uaValue = (getChildView(
i,
R.id.edUricValue
) as TextView).text.toString()
if (uricCalibrationBean.bpTime.isNullOrEmpty()) { if (uricCalibrationBean.bpTime.isNullOrEmpty()) {
CommonToastUtils.showToast("请选择测量时间") CommonToastUtils.showToast("请选择测量时间")
@ -146,11 +139,8 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
} }
private fun getChildView(index: Int, childId: Int = 0): View { private fun getChildView(index: Int, childId: Int = 0): View {
return if (childId == 0) { return if (childId == 0) binding.childLayout[index]
binding.childLayout[index] else binding.childLayout[index].findViewById(childId)
} else {
binding.childLayout[index].findViewById(childId)
}
} }
override fun liveObserver() { override fun liveObserver() {
@ -165,27 +155,5 @@ class UricCalibrationSubmitAct : BaseVmAct<UricAcidVm>() {
CommonToastUtils.showToast("提交失败:${it.msg}") CommonToastUtils.showToast("提交失败:${it.msg}")
} }
} }
//获取尿酸检测数据
mViewModel.getUricAcidMeasurementRecordLive.observe(this) {
if (it.code == 0) {
if (it.data != null) {
val data = it.data
val line = getChildView(recordNumber, R.id.vUricAcidLine)
line.isVisible = false
val lastLayout = getChildView(recordNumber, R.id.llUricAcidLyout)
lastLayout.isVisible = true
(getChildView(
recordNumber,
R.id.tvUricAcidLastValue
) as TextView).text = data.uaValue.toString()
} else {
val line = getChildView(recordNumber, R.id.vUricAcidLine)
line.isVisible = true
val lastLayout = getChildView(recordNumber, R.id.llUricAcidLyout)
lastLayout.isVisible = false
}
}
}
} }
} }

@ -19,7 +19,7 @@ class UricCalibrationListAdapter : BaseAdapter<UricCalibrationListBean>(
val textColor by lazy { val textColor by lazy {
arrayOf( arrayOf(
R.color.col_9BD, R.color.col_9BD,
R.color.col_25C, R.color.col_02c,
R.color.col_FDA481 R.color.col_FDA481
) )
} }
@ -36,25 +36,45 @@ class UricCalibrationListAdapter : BaseAdapter<UricCalibrationListBean>(
val view = holder.getView<ImageView>(R.id.ivSelected) val view = holder.getView<ImageView>(R.id.ivSelected)
view.isSelected = item.isSelected view.isSelected = item.isSelected
var result = ""
val colorIndex = when (item.upType) { val colorIndex = when (item.upType) {
1 -> 0 1 -> {
2, 5 -> 1 0
else -> 2 }
2, 5 -> {
1
}
else -> {
2
}
} }
val result = when (item.upType) { when (item.upType) {
1 -> "用户上传" 1 -> {
2 -> "管家上传" result = "用户上传"
3 -> "物联网上传" }
4 -> "管理员上传"
else -> "家人上传" 2 -> {
result = "管家上传"
}
3 -> {
result = "物联网上传"
}
4 -> {
result = "管理员上传"
}
else -> {
result = "家人上传"
}
} }
holder.setBackgroundResource(R.id.tvStatus, bg[colorIndex]) holder.setBackgroundResource(R.id.tvStatus, bg[colorIndex])
holder.setTextColor( holder.setTextColor(
R.id.tvStatus, R.id.tvStatus,
ContextCompat.getColor( ContextCompat.getColor(context, textColor[colorIndex])
context,
textColor[colorIndex]
)
) )
holder.getView<TextView>(R.id.tvStatus).apply { holder.getView<TextView>(R.id.tvStatus).apply {
text = result text = result
@ -70,15 +90,7 @@ class UricCalibrationListAdapter : BaseAdapter<UricCalibrationListBean>(
holder.setText(R.id.tvUploadingName, "上传人:${item.upName}") holder.setText(R.id.tvUploadingName, "上传人:${item.upName}")
holder.setText(R.id.tvMeasurementTime, "测量时间:${item.bpTime}") holder.setText(R.id.tvMeasurementTime, "测量时间:${item.bpTime}")
holder.setText(R.id.tvMeasurementValue, "尿酸数值:${item.uaValue.toFloat().toInt()}μmol/L") holder.setText(R.id.tvMeasurementValue, "测量值:${item.uaValue.toFloat().toInt()}μmol/L")
val sysValue = item.sysValue
if (sysValue > 0) {
holder.setGone(R.id.llLastValueLayout, false)
holder.setText(R.id.tvItemLastUricAcidValue, "尿酸数值:${sysValue}μmol/L")
} else {
holder.setGone(R.id.llLastValueLayout, true)
}
} }
fun getSelectData(): MutableList<UricCalibrationListBean> { fun getSelectData(): MutableList<UricCalibrationListBean> {

@ -27,8 +27,6 @@ class UricAcidVm : BaseVm() {
val submitUricCalibrationLive by lazy { MutableLiveData<RespBody<Any>>() } val submitUricCalibrationLive by lazy { MutableLiveData<RespBody<Any>>() }
val getUricCalibrationListLive by lazy { MutableLiveData<RespBody<PaingBean<UricCalibrationListBean>>>() } val getUricCalibrationListLive by lazy { MutableLiveData<RespBody<PaingBean<UricCalibrationListBean>>>() }
val deteleUricCalibrationLive by lazy { MutableLiveData<RespBody<Any>>() } val deteleUricCalibrationLive by lazy { MutableLiveData<RespBody<Any>>() }
val servicePeriodData by lazy { MutableLiveData<RespBody<String>>() }
val getUricAcidMeasurementRecordLive by lazy { MutableLiveData<RespBody<BoodfatFatMeasurementRecordBean>>() }
fun getUserInfo(id:String){ fun getUserInfo(id:String){
startHttp(false) { startHttp(false) {

@ -8,12 +8,11 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_14" android:paddingHorizontal="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:layout_marginHorizontal="@dimen/dp_14"
android:background="@drawable/shape_8round_white" android:background="@drawable/shape_8round_white"
android:orientation="vertical" android:orientation="vertical">
android:paddingHorizontal="@dimen/dp_16"
android:paddingBottom="@dimen/dp_20">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -44,8 +43,8 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -54,17 +53,17 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_17" android:textSize="@dimen/sp_17"
tools:text="上传人:张晓峰" /> tools:text="上传人:张晓峰"/>
<TextView <TextView
android:id="@+id/tvStatus" android:id="@+id/tvStatus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8" android:layout_marginStart="@dimen/dp_8"
tools:text="用户上传"
android:textColor="@color/col_96D" android:textColor="@color/col_96D"
android:textSize="@dimen/sp_11" android:textSize="@dimen/sp_11"
android:textStyle="bold" android:textStyle="bold" />
tools:text="用户上传" />
</LinearLayout> </LinearLayout>
@ -72,7 +71,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_1" android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
android:background="@color/col_0F2" /> android:background="@color/col_0F2"/>
<TextView <TextView
android:id="@+id/tvMeasurementTime" android:id="@+id/tvMeasurementTime"
@ -81,53 +80,17 @@
android:layout_marginTop="@dimen/dp_17" android:layout_marginTop="@dimen/dp_17"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
tools:text="测量时间2023-03-09 14:46" /> tools:text="测量时间2023-03-09 14:46"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="测量值"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/tvMeasurementValue" android:id="@+id/tvMeasurementValue"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_17" android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_20"
android:textColor="@color/col_c7c" android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
tools:text="测量值380" /> tools:text="测量值380"/>
<LinearLayout
android:id="@+id/llLastValueLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="监测值"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tvItemLastUricAcidValue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_17"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_15"
tools:text="低密度脂蛋白1.68mmol/L" />
</LinearLayout>
</LinearLayout> </LinearLayout>

@ -60,37 +60,28 @@
android:drawablePadding="@dimen/dp_4" android:drawablePadding="@dimen/dp_4"
android:gravity="end|center_vertical" android:gravity="end|center_vertical"
android:hint="@string/please_select_time" android:hint="@string/please_select_time"
android:textColorHint="@color/col_c7c"
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10" android:paddingBottom="@dimen/dp_10"
android:textColor="@color/col_3a4" android:textColor="@color/col_3a4"
android:textColorHint="@color/col_c7c"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
tools:ignore="UseCompatTextViewDrawableXml" /> tools:ignore="UseCompatTextViewDrawableXml" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_10"
android:text="测量值"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText" />
<LinearLayout <LinearLayout
android:id="@+id/llEditCholesterol" android:id="@+id/llEditCholesterol"
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_12"
android:layout_marginHorizontal="@dimen/dp_16" android:layout_marginHorizontal="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_10" android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="尿酸数值" android:text="测量值"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
tools:ignore="HardcodedText" /> tools:ignore="HardcodedText" />
@ -99,16 +90,16 @@
android:id="@+id/edUricValue" android:id="@+id/edUricValue"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_6"
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:gravity="end" android:gravity="end"
android:hint="@string/please_input_gdbp" android:hint="@string/please_input_gdbp"
android:inputType="number"
android:paddingVertical="@dimen/dp_10" android:paddingVertical="@dimen/dp_10"
android:textColor="@color/col_3a4" android:layout_marginHorizontal="@dimen/dp_6"
android:inputType="number"
android:textColorHint="@color/col_c7c" android:textColorHint="@color/col_c7c"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:textColor="@color/col_3a4"
app:layout_constraintRight_toLeftOf="@+id/mUnit" /> app:layout_constraintRight_toLeftOf="@+id/mUnit" />
<TextView <TextView
@ -116,8 +107,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="μmol/L" android:text="μmol/L"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
android:textColor="@color/col_313"
app:layout_constraintBottom_toBottomOf="@+id/mEditGdbp" app:layout_constraintBottom_toBottomOf="@+id/mEditGdbp"
app:layout_constraintLeft_toRightOf="@+id/mEditGdbp" app:layout_constraintLeft_toRightOf="@+id/mEditGdbp"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
@ -126,82 +117,6 @@
</LinearLayout> </LinearLayout>
<View
android:id="@+id/vUricAcidLine"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_18"
android:layout_marginHorizontal="@dimen/dp_16"
android:visibility="visible" />
<LinearLayout
android:id="@+id/llUricAcidLyout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_28"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:background="@color/col_0F2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_21"
android:text="监测值"
android:textColor="@color/col_c7c"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_25">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:text="尿酸数值"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
tools:ignore="HardcodedText" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvUricAcidLastValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
tools:text="345" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:text="μmol/L"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"
tools:ignore="HardcodedText" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

@ -3,6 +3,7 @@ package com.zj365.mime.vm
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.network.model.FamilyBean import com.xty.network.model.FamilyBean
import com.xty.network.model.InviteCustodyBean import com.xty.network.model.InviteCustodyBean
import com.xty.network.model.MainBean import com.xty.network.model.MainBean
@ -73,6 +74,7 @@ class SettingVm : BaseVm() {
*/ */
fun getMySetting() { fun getMySetting() {
startHttp { startHttp {
LogUtils.e("eeeeee","请求个人中心数据啦")
val body = apiInterface().getMySetting() val body = apiInterface().getMySetting()
body.getCodeStatus(settingLive, nowData) body.getCodeStatus(settingLive, nowData)
} }

@ -2,6 +2,7 @@ package com.xty.network.model
data class PsychologicalResultBean( data class PsychologicalResultBean(
var title:String,
var conclusionText:String, var conclusionText:String,
var recList:ArrayList<RecommendPsychologicalBean> var recList:ArrayList<RecommendPsychologicalBean>

Loading…
Cancel
Save