diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d312772..20ec71e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -74,7 +74,7 @@ + android:value="0771c9b6ed759235927c3738ff4c070b" /> @@ -178,6 +178,22 @@ + + + + + + diff --git a/app/src/main/assets/tab.json b/app/src/main/assets/tab.json index fe3fc35..2140e7b 100644 --- a/app/src/main/assets/tab.json +++ b/app/src/main/assets/tab.json @@ -14,7 +14,7 @@ "iconSelected": "main_home_tab_index_selected" }, { - "tabName": "就医", + "tabName": "应急", "tabTag": "key_emergency_fragment", "iconNormal": "main_home_tab_emergency_normal", "iconSelected": "main_home_tab_emergency_selected", diff --git a/app/src/main/java/com/xjjk/healthyclients/MainActivity.kt b/app/src/main/java/com/xjjk/healthyclients/MainActivity.kt index 8102682..87ec179 100644 --- a/app/src/main/java/com/xjjk/healthyclients/MainActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/MainActivity.kt @@ -9,27 +9,44 @@ import android.os.Message import android.view.Gravity import android.view.KeyEvent import android.view.View +import android.widget.Toast import androidx.fragment.app.Fragment +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle import com.amap.api.maps.MapsInitializer import com.permissionx.guolindev.PermissionX import com.sw.healthyclients.data.local.DataStoreManager import com.sw.healthyclients.utils.CustomActivityManager +import com.sw.healthyclients.view.CustomToast +import com.tencent.qcloud.tuicore.TUICore +import com.tencent.qcloud.tuikit.tuichat.TUIChatService +import com.tencent.qcloud.tuikit.tuichat.classicui.event.IMChatEvent import com.xjjk.healthyclients.base.BaseVMBActivity import com.xjjk.healthyclients.bottomtab.HomeBottomTabLayout import com.xjjk.healthyclients.databinding.ActivityMainBinding +import com.xjjk.healthyclients.event.RefreshEvent +import com.xjjk.healthyclients.event.UserNoticeBean import com.xjjk.healthyclients.fragment.EmergencyFragment import com.xjjk.healthyclients.fragment.GuidanceFragment import com.xjjk.healthyclients.fragment.MonitorFragment +import com.xjjk.healthyclients.superfuntion.loginIm +import com.xjjk.healthyclients.superfuntion.startAllDoctorActivity import com.xjjk.healthyclients.superfuntion.startLoginActivity +import com.xjjk.healthyclients.ui.viewmodel.MainViewModel import com.xjjk.healthyclients.utils.ConstantUtils import com.xjjk.healthyclients.utils.LocationManager import com.xjjk.healthyclients.utils.SystemUtils +import com.xjjk.healthyclients.view.FuntionBlurbDialog import com.xjjk.healthyclients.view.PrivacyDialog import com.xjjk.healthyclients.view.TextViewDialog +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +import org.greenrobot.eventbus.EventBus import org.lzh.framework.updatepluginlib.UpdateBuilder -class MainActivity : BaseVMBActivity(R.layout.activity_main), +class MainActivity : BaseVMBActivity(R.layout.activity_main), HomeBottomTabLayout.HomeBottomTabLayoutCallback { //每个tab对应的tag,和json配置文件中保持一致 @@ -37,6 +54,9 @@ class MainActivity : BaseVMBActivity(R.layout val TAG_EMERGENCY = "key_emergency_fragment" val TAG_MONITOR = "key_monitor_fragment" val TAG_MY = "key_my_fragment" + var mIMChatEvent:IMChatEvent?=null + var doctorId="" + var textViewDialog: TextViewDialog? = null var mPermissionList = arrayListOf( Manifest.permission.WRITE_EXTERNAL_STORAGE, @@ -135,6 +155,102 @@ class MainActivity : BaseVMBActivity(R.layout super.onBackEvent() } + override fun createObserve() { + super.createObserve() + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.tokenOverdue.collectLatest { overdue -> + if (overdue) { + ConstantUtils.mCheckToken = true + EventBus.getDefault().post(RefreshEvent()) + if (DataStoreManager.getToken().isNotEmpty()) { + mViewModel.getNoticeData() + } + if (DataStoreManager.isLogin()) { + MyApplication.appViewModel?.getIMSig(successCall = { + loginIm(it.userId, it.userSig) + }) + } + } else { + ConstantUtils.mCheckToken = false +// startLoginActivity(this@MainActivity) + } + } + } + } + //用户弹窗 + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.noticeBean.collectLatest { bean -> + if (bean.title.isNotEmpty() && bean.content.isNotEmpty()) { + showBlurbDialog(bean) + } + } + } + } + //用户弹窗-结果提交 + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.submitNoticeChooseResult.collectLatest { success -> + if (success) { + mFunctionBlurbDialog?.cancel() + } + } + } + } + //用户弹窗-结果提交 + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.timePrescription.collectLatest { result -> + if (result=="1") { + //过期 +// val textViewDialog = TextViewDialog(CustomActivityManager.getInstance().TopActivity()) +// textViewDialog?.setDialogTitle("温馨提示", 18f) +// textViewDialog?.setContent("医生信息已过期!", 14f) +// textViewDialog?.setContentStyle(Gravity.LEFT) +// textViewDialog?.setBtnText("确认", 18f) +// textViewDialog?.setDialogCancelable(false) +// textViewDialog?.setOnAffirmClickListener(object : TextViewDialog.OnAffirmClickListener { +// override fun onAffirmClick(viewDialog: TextViewDialog) { +// +// } +// +// override fun onCancelClick(viewDialog: TextViewDialog) { +// +// } +// }) +// textViewDialog?.show() + CustomToast.makeText(CustomActivityManager.getInstance().TopActivity(), "医生信息已过期!", Toast.LENGTH_SHORT).show() + }else{ + //未过期 + val bundle = Bundle() + bundle.putString("doctorId", mIMChatEvent?.getDoctor()) + TUICore.startActivity( + TUIChatService.getAppContext(), + "DoctorHomepageActivity", + bundle + ) + } + } + } + } + + //全科医生校验 + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.selectTfHelper.collectLatest { success -> + if (success) { + //去查询全科医生信息 + if (doctorId.isNotEmpty()) { + mContext?.startAllDoctorActivity(doctorId) + } + } + } + } + } + + } + override fun onPause() { textViewDialog?.dismiss() super.onPause() @@ -205,6 +321,7 @@ class MainActivity : BaseVMBActivity(R.layout // } // } } + private val mFunctionBlurbDialog : FuntionBlurbDialog by lazy { FuntionBlurbDialog(this@MainActivity) } private var isExit = false var mHandler: Handler = @SuppressLint("HandlerLeak") @@ -234,5 +351,43 @@ class MainActivity : BaseVMBActivity(R.layout } return super.onKeyDown(keyCode, event) } + private fun showBlurbDialog(bean: UserNoticeBean) { + mFunctionBlurbDialog?.setTitle(bean.title) + mFunctionBlurbDialog?.setContent(bean.content) + mFunctionBlurbDialog?.setOnAffirmClickListener(object : + FuntionBlurbDialog.OnAffirmClickListener { + override fun onAffirmClick(type: Int, viewDialog: FuntionBlurbDialog) { + mViewModel.submitNoticeChooseItem(bean.id, type) + } + }) + mFunctionBlurbDialog?.show() + } + + + override fun onMessageEvent(event: Any?) { + super.onMessageEvent(event) + try { + event?.let { event -> + if (event is IMChatEvent) { + if (event.getType()==0) { + mIMChatEvent=event + mViewModel.initIMDialog() + mViewModel.selectDoctorCardExpireTime(event.time) + }else if (event.getType()==1){ + if (event.message.isNotEmpty()) { + CustomToast.makeText(CustomActivityManager.getInstance().TopActivity(), event.message, Toast.LENGTH_SHORT).show() + } + }else if (event.getType()==2){ + doctorId=event.doctor + mViewModel.initIMDialog() + mViewModel.selectTfHelper(event.doctor) + println("头像id"+doctorId) + } + } + } + } catch (e: Exception) { + } + } + } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/MyApplication.kt b/app/src/main/java/com/xjjk/healthyclients/MyApplication.kt index 3ab19d9..d6de4ae 100644 --- a/app/src/main/java/com/xjjk/healthyclients/MyApplication.kt +++ b/app/src/main/java/com/xjjk/healthyclients/MyApplication.kt @@ -12,6 +12,8 @@ import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelStore import androidx.lifecycle.ViewModelStoreOwner +import com.bumptech.glide.Glide +import com.bumptech.glide.load.model.GlideUrl import com.lzy.ninegrid.NineGridView import com.orhanobut.logger.AndroidLogAdapter import com.orhanobut.logger.Logger @@ -28,6 +30,7 @@ import com.tencent.qcloud.tuicore.TUIThemeManager import com.tencent.qcloud.tuicore.interfaces.TUILoginListener import com.tencent.qcloud.tuicore.util.ErrorMessageConverter import com.tencent.qcloud.tuicore.util.TUIUtil +import com.tencent.qcloud.tuikit.tuichat.classicui.widget.message.viewholder.LocationMessageHolder import com.tencent.qcloud.tuikit.tuichat.config.TUIChatConfigs import com.tencent.qcloud.tuikit.tuichat.interfaces.IMInputViewActionListener import com.xjjk.healthyclients.bean.AppUpdateBean @@ -44,6 +47,7 @@ import com.xjjk.healthyclients.utils.updateplugin.CustomDownloadNotifier import com.xjjk.healthyclients.utils.updateplugin.CustomInstallNotifier import com.xjjk.healthyclients.utils.updateplugin.CustomUpdateNotifier import com.xjjk.healthyclients.view.AppraiseDialog +import okhttp3.OkHttpClient import org.json.JSONException import org.json.JSONObject import org.lzh.framework.updatepluginlib.UpdateConfig @@ -71,6 +75,7 @@ class MyApplication : Application(), ViewModelStoreOwner { Log.i(TAG, "onCreate") super.onCreate() ConstantUtils.mIsCloseDialog=true + LocationMessageHolder.mapKey = "a87b89a2b4a32ed31da04d0996035cc1" Logger.addLogAdapter(AndroidLogAdapter()) appContext = this DownloadFileUtil.init(this) diff --git a/app/src/main/java/com/xjjk/healthyclients/adapter/user/UserContactsAdapter.kt b/app/src/main/java/com/xjjk/healthyclients/adapter/user/UserContactsAdapter.kt new file mode 100644 index 0000000..8913480 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/adapter/user/UserContactsAdapter.kt @@ -0,0 +1,28 @@ +package com.xjjk.healthyclients.adapter.user + +import android.content.Context +import android.widget.TextView +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.adapter.common.CommonAdapter +import com.xjjk.healthyclients.adapter.common.ViewHolder +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean + +class UserContactsAdapter( + var mContext: Context?, + var layoutId: Int, + var datas: ArrayList? +) : CommonAdapter(mContext, layoutId, datas) { + override fun convert(holder: ViewHolder?, bean: SelectEmergencyContactListBean?, position: Int) { + holder?.getView(R.id.item_user_name)?.let{ + bean?.apply { + it.text= "$name-$phone" + } + } + holder?.getView(R.id.item_user_concern)?.let{ + bean?.apply { + it.text= familyRelation_dictText + } + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/bean/user/IMDoctorInfoBean.java b/app/src/main/java/com/xjjk/healthyclients/bean/user/IMDoctorInfoBean.java new file mode 100644 index 0000000..d970660 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/bean/user/IMDoctorInfoBean.java @@ -0,0 +1,50 @@ +package com.xjjk.healthyclients.bean.user; + +public class IMDoctorInfoBean { + + private String id; + private String userId; + private String userName; + private String faceUrl; + private String memo; + + public String getId() { + return id == null ? "" : id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserId() { + return userId == null ? "" : userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return userName == null ? "" : userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getFaceUrl() { + return faceUrl == null ? "" : faceUrl; + } + + public void setFaceUrl(String faceUrl) { + this.faceUrl = faceUrl; + } + + public String getMemo() { + return memo == null ? "" : memo; + } + + public void setMemo(String memo) { + this.memo = memo; + } +} diff --git a/app/src/main/java/com/xjjk/healthyclients/chart/DoubleWheelBaseLayout.java b/app/src/main/java/com/xjjk/healthyclients/chart/DoubleWheelBaseLayout.java index 926e64b..addeace 100644 --- a/app/src/main/java/com/xjjk/healthyclients/chart/DoubleWheelBaseLayout.java +++ b/app/src/main/java/com/xjjk/healthyclients/chart/DoubleWheelBaseLayout.java @@ -23,13 +23,13 @@ import androidx.annotation.CallSuper; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.github.gzuliyujiang.wheelpicker.R; import com.github.gzuliyujiang.wheelpicker.contract.LinkageProvider; import com.github.gzuliyujiang.wheelpicker.contract.OnLinkageSelectedListener; import com.github.gzuliyujiang.wheelpicker.widget.BaseWheelLayout; import com.github.gzuliyujiang.wheelview.annotation.ScrollState; import com.github.gzuliyujiang.wheelview.contract.WheelFormatter; import com.github.gzuliyujiang.wheelview.widget.WheelView; +import com.xjjk.healthyclients.R; import java.util.Arrays; import java.util.List; @@ -68,7 +68,7 @@ public class DoubleWheelBaseLayout extends BaseWheelLayout { @Override protected int provideLayoutRes() { - return R.layout.wheel_picker_linkage; + return R.layout.wheel_picker_linkage_my; } @CallSuper diff --git a/app/src/main/java/com/xjjk/healthyclients/data/api/CommonApi.kt b/app/src/main/java/com/xjjk/healthyclients/data/api/CommonApi.kt index e818495..d465a6c 100644 --- a/app/src/main/java/com/xjjk/healthyclients/data/api/CommonApi.kt +++ b/app/src/main/java/com/xjjk/healthyclients/data/api/CommonApi.kt @@ -7,6 +7,8 @@ import com.xjjk.healthyclients.bean.LoginBean import com.xjjk.healthyclients.bean.SelectUserInfoBean import com.xjjk.healthyclients.bean.SelectUserMessageListBean import com.xjjk.healthyclients.bean.UploadFileResultBean +import com.xjjk.healthyclients.bean.user.IMDoctorInfoBean +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean import com.xjjk.healthyclients.data.bean.ApiResponse import com.xjjk.healthyclients.event.UserNoticeBean import okhttp3.MultipartBody @@ -79,6 +81,16 @@ interface CommonApi { */ @GET("/sys/api/messageRemind/changeAlRead") suspend fun changeAlRead(@QueryMap params: MutableMap): ApiResponse + /** + * 更新紧急联系人 + */ + @POST("/sys/api/emergencyContact/updateAndInsertEmergencyContact") + suspend fun updateAndInsertEmergencyContact(@Body bean: SelectEmergencyContactListBean): ApiResponse + /** + * 删除紧急联系人 + */ + @GET("/sys/api/emergencyContact/removeEmergencyContactList") + suspend fun removeEmergencyContactList(@QueryMap params: MutableMap): ApiResponse /** * 检查更新 @@ -96,6 +108,23 @@ interface CommonApi { */ @GET("/health-consultation/api/consult/notice/chooseToDontShowUp") suspend fun chooseToDontShowUp(@QueryMap params: MutableMap): ApiResponse + /** + * 卡片时效校验 + */ + @GET("health-consultation/api/consult/conSession/selectDoctorCardExpireTime") + suspend fun selectDoctorCardExpireTime(@QueryMap params: MutableMap): ApiResponse + + /** + * 全科医生校验 + */ + @GET("health-consultation/api/consult/conHelper/selectTfHelper") + suspend fun selectTfHelper(@QueryMap params: MutableMap): ApiResponse + + /** + * 查询全科医生信息 + */ + @GET("health-consultation/api/consult/conHelper/selectHelperInfoDesc") + suspend fun selectHelperInfoDesc(@QueryMap params: MutableMap): ApiResponse } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/api/GuidanceApi.kt b/app/src/main/java/com/xjjk/healthyclients/data/api/GuidanceApi.kt index e68101f..327d2ce 100644 --- a/app/src/main/java/com/xjjk/healthyclients/data/api/GuidanceApi.kt +++ b/app/src/main/java/com/xjjk/healthyclients/data/api/GuidanceApi.kt @@ -231,7 +231,7 @@ interface GuidanceApi { /** * 咨询小助手 */ - @GET("health-consultation/api/consult/conSession/insertUserAndHelperSession") + @GET("health-consultation/api/consult/conSession/insertUserAndHelperSessionNew") suspend fun submitAssistantConsultApply(): ApiResponse /** * 获取档案列表 diff --git a/app/src/main/java/com/xjjk/healthyclients/data/api/HealthRecordApi.kt b/app/src/main/java/com/xjjk/healthyclients/data/api/HealthRecordApi.kt deleted file mode 100644 index 442517b..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/data/api/HealthRecordApi.kt +++ /dev/null @@ -1,170 +0,0 @@ -package com.xjjk.healthyclients.data.api - - -import com.xjjk.healthyclients.bean.healthrecord.CheckRecordUserInfoBean -import com.xjjk.healthyclients.data.bean.ApiResponse -import retrofit2.http.GET -import retrofit2.http.QueryMap - -/** - * @author nanfeifei - * @time 2023/8/4 13:22 - * @description - */ -interface HealthRecordApi { -// /** -// * 健康数据分析 -// */ -// @GET("health-archives/api/archives/medicalDataAnalysis/selectMedicalDataAnalysisVOList") -// suspend fun getHealthDataAnalysisData(): ApiResponse> -// -// /** -// * 健康数据分析子项(比如:化学检查列表) -// */ -// @GET("health-archives/api/archives/medicalDataAnalysis/selectMedicalUniItemClassList") -// suspend fun getHealthDataAnalysisItemData(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 健康数据分析子项详情(比如:血常规) -// */ -// @GET("health-archives/api/archives/medicalUserResult/selectMedicalUserResult") -// suspend fun getHealthDataAnalysisItemDetailData(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 检查子项记录(比如:白细胞数) -// */ -// @GET("health-archives/api/archives/medicalUserResult/selectMedicalUserResultInfoById") -// suspend fun getHealthCheckItemRecordData(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 腰臀比 -// */ -// @GET("health-archives/api/archives/compute/waistHipRatio") -// suspend fun waistHipRatio(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 理想体重 -// */ -// @GET("health-archives/api/archives/compute/idealBodyWeight") -// suspend fun idealBodyWeight(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 能量需求 -// */ -// @GET("health-archives/api/archives/compute/energyDemand") -// suspend fun energyDemand(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 所有运动 -// */ -// @GET("health-archives/api/archives/compute/allExercise") -// suspend fun allExercise(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 减掉一公斤 -// */ -// @GET("health-archives/api/archives/compute/loseKilo") -// suspend fun loseKilo(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 一分钟了解自己 -// */ -// @GET("health-archives/api/archives/compute/knowYourselfInMinute") -// suspend fun knowYourselfInMinute(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 健康监测首页 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectHealthMonitoringInfo") -// suspend fun selectHealthMonitoringInfo(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重记录 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectHeightAndWeightBmiList") -// suspend fun selectHeightAndWeightBmiList(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 血脂记录 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectBloodFat") -// suspend fun selectBloodFat(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 血糖记录 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectBloodSugarList") -// suspend fun selectBloodSugarList(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 血压记录 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectBloodPresureList") -// suspend fun selectBloodPresureList(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 血糖详情 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectBloodSugarInfo") -// suspend fun selectBloodSugarInfo(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * BMI首页 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectHeightAndWeightBmi") -// suspend fun getBMIHomeData(): ApiResponse -// -// /** -// * 血压详情 -// */ -// @GET("health-archives/api/archives/healthMonitoring/selectBloodPresure") -// suspend fun selectBloodPresure(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 异常项列表 -// */ -// @GET("health-archives/api/archives/healthQuo/exceptionList") -// suspend fun getExceptionData(): ApiResponse> -// -// /** -// * 健康现状首页 -// */ -// @GET("health-archives/api/archives/healthQuo/info") -// suspend fun getHealthStatusData(): ApiResponse -// -// /** -// * 健康现状首页 -// */ -// @GET("health-archives/api/archives/medicalUserResult/selectMedicalMiddleResultExtVO") -// suspend fun getConclusionSuggestionData(@QueryMap params: MutableMap): ApiResponse -// - /** - * 体检报告人员信息 - */ - @GET("health-archives/historyReport/getHistoryReportById") - suspend fun getHistoryReportNoDetail(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 历年体检列表 -// */ -// @POST("health-archives/historyReport/getHistoryReportByPage") -// suspend fun getHistoryReportByPage(@Body requestBody: RequestBody): ApiResponse -// -// /** -// * 获取存在结论建议的日期列表 -// */ -// @GET("health-archives/api/archives/medicalUserResult/selectMedicalUserResultInfoExDate") -// suspend fun getConclusionSuggestionDateList(): ApiResponse> -// -// /** -// * 获取体检结论、建议语音文件 -// */ -// @GET("health-archives/historyReport/getVoiceUrl") -// suspend fun getReportVoiceUrl(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 生成体检结论、建议语音文件 -// */ -// @GET("health-archives/historyReport/convertVoice2") -// suspend fun convertReportVoiceUrl(@QueryMap params: MutableMap): ApiResponse -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionApi.kt b/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionApi.kt deleted file mode 100644 index 51f8cfd..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionApi.kt +++ /dev/null @@ -1,447 +0,0 @@ -package com.xjjk.healthyclients.data.api - -import com.sw.healthyclients.bean.intervention.NearbyAmbulanceBean -import com.xjjk.healthyclients.bean.AedNetworkingBean -import com.xjjk.healthyclients.bean.NearbyResourceBean -import com.xjjk.healthyclients.data.bean.ApiResponse -import retrofit2.http.GET -import retrofit2.http.QueryMap - -// -//import com.sw.healthyclients.bean.common.CommonSettingMenuBean -//import com.sw.healthyclients.bean.emergency.EmergencyGroupInfo -//import com.sw.healthyclients.bean.home.HomeWeightRankBean -//import com.sw.healthyclients.bean.intervention.AEDResultBean -//import com.sw.healthyclients.bean.intervention.DoctorListBean -//import com.sw.healthyclients.bean.intervention.ElectronicBookBean -//import com.sw.healthyclients.bean.intervention.EmergencySearchResponse -//import com.sw.healthyclients.bean.intervention.ImageTextBean -//import com.sw.healthyclients.bean.intervention.InterventionPlanBean -//import com.sw.healthyclients.bean.intervention.KnowledgeSuggestBean -//import com.sw.healthyclients.bean.intervention.KnowledgeSuggestDetailBean -//import com.sw.healthyclients.bean.intervention.MySportBean -//import com.sw.healthyclients.bean.intervention.MySportDetailBean -//import com.sw.healthyclients.bean.intervention.NearbyAmbulanceBean -//import com.sw.healthyclients.bean.intervention.NearbyResourceBean -//import com.sw.healthyclients.bean.intervention.PostHealthBean -//import com.sw.healthyclients.bean.intervention.PostHealthSecondaryBean -//import com.sw.healthyclients.bean.intervention.PsychologyConceptBean -//import com.sw.healthyclients.bean.intervention.ResourceStaffBean -//import com.sw.healthyclients.bean.intervention.RiskAssessmentResultBean -//import com.sw.healthyclients.bean.intervention.SelectFollowUpListBean -//import com.sw.healthyclients.bean.intervention.SelectMedicalResourceBean -//import com.sw.healthyclients.bean.intervention.SelectMedicinePrescriptionDTOListBean -//import com.sw.healthyclients.bean.intervention.SelectUserHaveNewTabBean -//import com.sw.healthyclients.bean.intervention.SportEffectBean -//import com.sw.healthyclients.bean.intervention.SportEffectVideoBean -//import com.sw.healthyclients.bean.intervention.SportWayBean -//import com.sw.healthyclients.bean.intervention.VisitRecordBean -//import com.sw.healthyclients.data.bean.ApiResponse -//import com.sw.healthyclients.ui.intervene2.bean.AskFollowCheckBean -//import com.sw.healthyclients.ui.intervene2.bean.DiabetesQuestionBean -//import com.sw.healthyclients.ui.intervene2.bean.EnrollBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightInterventionActionBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightListBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightRankBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodWarningBean -//import com.sw.healthyclients.ui.intervene2.bean.MonitorResultBean -//import com.sw.healthyclients.ui.intervene2.bean.PracticeBean -//import com.sw.healthyclients.ui.intervene2.bean.RankBean -//import com.sw.healthyclients.ui.intervene2.bean.RankListResult -//import com.sw.healthyclients.ui.intervene2.bean.UserWeightInfoBean -//import com.sw.healthyclients.ui.intervene2.bean.WeightChangeBean -//import com.sw.healthyclients.ui.intervene2.bean.WeightChangeTrendBean -//import okhttp3.RequestBody -//import retrofit2.http.Body -//import retrofit2.http.GET -//import retrofit2.http.POST -//import retrofit2.http.QueryMap -// -interface InterventionApi { -// -// /** -// * 专家知识列表 -// */ -// @POST("health-intervene/api/knowledge/post/queryKnowledgeBySpecialist") -// suspend fun queryKnowledgeBySpecialist(@Body requestBody: RequestBody): ApiResponse> -// /** -// * 公共知识列表 -// */ -// @POST("health-intervene/api/knowledge/post/queryKnowledgeList") -// suspend fun queryKnowledgeList(@Body requestBody: RequestBody): ApiResponse> -// -// /** -// * 专家列表 -// */ -// @POST("health-intervene/api/knowledge/post/querySpecialistList") -// suspend fun querySpecialistList(@Body requestBody: RequestBody): ApiResponse> -// -// /** -// * 健康技能-电子书列表 -// */ -// @POST("health-intervene/api/knowledge/post/querySpecialistList") -// suspend fun getElectronicBookList(@Body requestBody: RequestBody): ApiResponse> -// /** -// * 体检可视化-Fragment中一级标签 -// */ -// @POST("health-intervene/api/knowledge/post/querySpecialistList") -// suspend fun getPrimaryTagListData(@Body requestBody: RequestBody): ApiResponse> -// /** -// * 体检可视化-Fragment中二级标签 -// */ -// @POST("health-intervene/api/knowledge/post/querySpecialistList") -// suspend fun getSecondaryTagListData(@Body requestBody: RequestBody): ApiResponse> -// -// /** -// * 岗位列表 -// */ -// @GET("health-intervene/health-answer/class/app/list") -// suspend fun selectPostListById(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 岗位列表 -// */ -// @GET("health-intervene/api/knowledge/post/knowledgeListByPostId") -// suspend fun knowledgeListByPostId(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 运动效果-视频列表 -// */ -// @GET("health-intervene/rest/health-food-exercise/fitness/class/list") -// suspend fun getSportVideoListData(@QueryMap params: MutableMap): ApiResponse -// /** -// * 运动效果-详情 -// */ -// @GET("health-intervene/rest/health-food-exercise/fitness/detail") -// suspend fun getSportVideoDetailData(@QueryMap params: MutableMap): ApiResponse -// /** -// * 我的运动 -// */ -// @GET("health-intervene/rest/health-food-exercise/fitness/record") -// suspend fun getMySportListData(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 获取运动方式 -// */ -// @GET("health-intervene/rest/health-food-exercise/fitness/fitnessList") -// suspend fun getSportWayListData(): ApiResponse> -// /** -// * 上传运动 -// */ -// @POST("health-intervene/rest/health-food-exercise/fitness/upload") -// suspend fun uploadSportData(@Body requestBody: RequestBody): ApiResponse -// -// /** -// * 急救联动-资源列表 -// */ -// @POST("health-intervene/rest/aid/resource/search") -// suspend fun getEmergencySearch(@Body requestBody: RequestBody): ApiResponse -// /** -// * 急救联动-AED -// */ -// @GET("health-emergency/api/aed/nearbyAed") -// suspend fun getNearbyAed(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 我的运动详情 -// */ -// @GET("health-intervene/rest/health-food-exercise/fitness/analysisInfo") -// suspend fun getMySportDetailData(@QueryMap params: MutableMap): ApiResponse -// /** -// * 获取应急IM群组信息 -// */ -// @GET("/health-emergency/api/emergency/createGroupMag") -// suspend fun getIMGroupInfo(@QueryMap params: MutableMap): ApiResponse -// /** -// * 干预-测评列表 -// */ -// @GET("health-intervene/rest/health-survey/assess/template/listNew") -// suspend fun getRiskAssessmentListData(@QueryMap params: MutableMap): ApiResponse -// - /** - * 附近医疗点 - */ - @GET("medical-center/api/resource/nearbyResource") - suspend fun nearbyResource(@QueryMap params: MutableMap): ApiResponse> - /** - * 附近救护车 - */ - @GET("medical-center/api/ambulance/nearbyAmbulance") - suspend fun nearbyAmbulance(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 查询最近医疗点和就诊记录 -// */ -// @POST("medical-center/api/chronicDiseaseUser/selectMedicalResource") -// suspend fun selectMedicalResource(@QueryMap params: MutableMap): ApiResponse -// /** -// * 通过id查询医疗点 -// */ -// @GET("medical-center/medicalCenter/medicalResource/queryById") -// suspend fun MedicalResourcequeryById(@QueryMap params: MutableMap): ApiResponse -// /** -// * 通过id查询医疗点 -// */ -// @GET("medical-center/api/resource/resourceStaff") -// suspend fun resourceStaff(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 查询慢病管理的tab -// */ -// @GET("medical-center/api/followUpRecord/user/tab") -// suspend fun selectUserHaveTab(@QueryMap params: MutableMap): ApiResponse -// /** -// * 随访记录 -// */ -// @GET("medical-center/api/followUpRecord/selectFollowUpList") -// suspend fun selectFollowUpList(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 申请随访校验 -// */ -// @GET("medical-center/api/followUpRecord/apply-check") -// suspend fun askFollowCheck(@QueryMap params: MutableMap): ApiResponse -// /** -// * 申请随访提交 -// */ -// @POST("medical-center/api/followUpRecord/user-apply") -// suspend fun askFollowSubmit(@Body requestBody: RequestBody): ApiResponse -// /** -// * 膳食处方 -// */ -// @GET("medical-center/api/dietaryPrescription/selectDietaryPrescriptionList") -// suspend fun selectDietaryPrescriptionList(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 运动处方 -// */ -// @GET("medical-center/api/sportsPrescription/selectSportsPrescriptionDTOList") -// suspend fun selectSportsPrescriptionDTOList(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 用药方案 -// */ -// @GET("medical-center/api/medicinePrescription/selectMedicinePrescriptionDTOList") -// suspend fun selectMedicinePrescriptionDTOList(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 就诊记录 -// */ -// @GET("medical-center/api/dailyDiagnosis/list") -// suspend fun quertVisitRecordList(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 是否填写基础问卷 -// */ -// @GET("health-intervene/api/psychology/psychologyEvaluateBase/selectPsychologyBaseExist") -// suspend fun selectPsychologyBaseExist(@QueryMap params: MutableMap): ApiResponse -// /** -// * 心理概念知识 -// */ -// @GET("health-intervene/app/psychology/psychologyConceptKnow/list") -// suspend fun psychologyConcept(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 心理答题知识推荐 -// */ -// @GET("health-intervene/api/psychology/answer/knowledge/page") -// suspend fun knowledgeSuggest(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 心理答题知识推荐详情 -// */ -// @GET("health-intervene/api/psychology/answer/knowledge") -// suspend fun knowledgeAnswerDetails(@QueryMap params: MutableMap): ApiResponse -// -// -// /** -// * 体重管理-首页活动列表 -// */ -// @GET("health-intervene/api/intervene/activity/list") -// suspend fun list(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 体重管理-用户报名活动 -// */ -// @GET("health-intervene/api/intervene/activity/user/registration") -// suspend fun registration(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重管理-用户报名数据 -// */ -// @GET("health-intervene/api/intervene/activity/signUp") -// suspend fun signUp(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-体重变化 -// */ -// @GET("health-intervene/api/intervene/activity/weightChange") -// suspend fun weightChange(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-活动排名 -// */ -// @GET("health-intervene/api/intervene/activity/rank") -// suspend fun rank(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-更新体重 -// */ -// @GET("health-intervene/api/intervene/activity/user/updateWeight") -// suspend fun updateWeight(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-数据监控 -// */ -// @GET("health-intervene/api/intervene/activity/monitor") -// suspend fun monitor(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-活动历史 -// */ -// @GET("health-intervene/api/intervene/activity/history") -// suspend fun history(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 体重管理-全部排名 -// */ -// @GET("health-intervene/api/intervene/activity/all/rank") -// suspend fun actionRank(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-体重变化趋势 -// */ -// @GET("health-intervene/api/intervene/activity/user/weightChangeTrend") -// suspend fun weightChangeTrend(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 营养慢病-实测 -// */ -// @GET("health-intervene/meals/api/cd-nutrient/calculate/practice") -// suspend fun practice(@QueryMap params: MutableMap): ApiResponse -// /** -// * 营养慢病-模拟 -// */ -// @POST("health-intervene/meals/api/cd-nutrient/calculate/simulate") -// suspend fun simulate(@Body requestBody: RequestBody): ApiResponse -// -// /** -// * 慢病预警-查询用户是否提交过问卷 -// */ -// @GET("health-intervene/meals/api/cd-forecast/survey/check") -// suspend fun surveyCheck(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 慢病预警-获取问卷信息 -// */ -// @GET("health-intervene/meals/api/cd-forecast/survey/info") -// suspend fun surveyInfo(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 提交问卷-慢病预警 -// */ -// @POST("health-intervene/meals/api/cd-forecast/survey/submit") -// suspend fun postAnswerSurveyData(@Body requestBody: RequestBody): ApiResponse -// -// -// /** -// * 慢病预警-实测 -// */ -// @GET("health-intervene/meals/api/cd-forecast/user/practice") -// suspend fun getUserPractice(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 慢病预警-模拟 -// */ -// @POST("health-intervene/meals/api/cd-forecast/user/simulate") -// suspend fun postUserSimulate(@Body requestBody: RequestBody): ApiResponse -// -// -// /** -// * 干预首页-心理数据(返回最新的心理评估结果) -// */ -// @GET("health-intervene/intervene-home/psychology") -// suspend fun interveneHomePsychology(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-最新一天的膳食摄入(千卡) -// */ -// @GET("health-intervene/intervene-home/meals") -// suspend fun interveneHomeMeals(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-知识模块数据(返回学习时长) -// */ -// @GET("health-intervene/intervene-home/knowledge") -// suspend fun interveneHomeKnowledge(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-最新一天的运动消耗(卡) -// */ -// @GET("health-intervene/intervene-home/exercise") -// suspend fun interveneHomeExercise(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-环境数据(返回最近的室外空气质量设备数据) -// */ -// @GET("health-intervene/intervene-home/environment") -// suspend fun interveneHomeEnvironment(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-糖尿病(返回最新血糖) -// */ -// @GET("health-intervene/intervene-home/diabetes") -// suspend fun interveneHomeDiabetes(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-心血管(手表返回最新心率) -// */ -// @GET("health-intervene/intervene-home/cardiovascular") -// suspend fun interveneHomeCardiovascular(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 干预首页-癌症(返回重点指标是否异常) -// */ -// @GET("health-intervene/intervene-home/cancer") -// suspend fun interveneHomeCancer(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重管理-获取当前用户是否已经参加活动 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/getJoinPlanId") -// suspend fun getWeightJoinPlanId(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重管理-活动列表 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/list") -// suspend fun getWeightPlanList(@QueryMap params: MutableMap): ApiResponse> -// -// /** -// * 体重管理-获取当前登录人身高体重及目标体重 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/getUserInfoByPlanId") -// suspend fun getUserWeightInfo(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重管理-活动报名 -// */ -// @POST("health-intervene/app/healthMealsWeightPlan/signUp") -// suspend fun postWeightPlanSignUp(@Body requestBody: RequestBody): ApiResponse -// -// /** -// * 体重管理-获取活动详情 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/getPlanInfo") -// suspend fun getWeightPlanInfo(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-获取历史参与记录 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/joinHistory") -// suspend fun getWeightJoinHistory(@QueryMap params: MutableMap): ApiResponse> -// /** -// * 体重管理-分页获取计划排行榜 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/getPlanRank") -// suspend fun getWeightRank(@QueryMap params: MutableMap): ApiResponse -// /** -// * 体重管理-分页获取计划排行榜 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/getPlanRankNew") -// suspend fun getWeightRankNew(@QueryMap params: MutableMap): ApiResponse -// -// /** -// * 体重管理-更新体重 -// */ -// @GET("health-intervene/app/healthMealsWeightPlan/updateWeight") -// suspend fun getMealsUpdateWeight(@QueryMap params: MutableMap): ApiResponse -// -// -// - /** - * 心血管-AED组网 - */ - @GET("health-intervene/intervene/v2/aedEquipmentManger/nearbyAed") - suspend fun getAedNetworkingData(@QueryMap params: MutableMap): ApiResponse> - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionNetApi.kt b/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionNetApi.kt deleted file mode 100644 index 726bd1b..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/data/api/InterventionNetApi.kt +++ /dev/null @@ -1,129 +0,0 @@ -package com.xjjk.healthyclients.data.api - -import com.xjjk.healthyclients.retrofit.intervention.CustomInterventionResponseResult -import retrofit2.Call -import retrofit2.http.Body -import retrofit2.http.GET -import retrofit2.http.Header -import retrofit2.http.Headers -import retrofit2.http.POST -import retrofit2.http.Query -import java.util.SortedMap - -interface InterventionNetApi { - - /** - * 获取公钥 - */ - @Headers("urlType:levelTwo") - @GET("/gateway/sys/getPublicKey") - fun getPublicKey( - @Header("X-TIMESTAMP") timeStamp: String, - @Header("X-Sign") timeSign: String, - @Query("timeSign") timeSignStr: String - ): Call> - - /** - * 通过身份证获取Token - */ - @Headers("urlType:levelTwo") - @POST("/gateway/sys/thirdAppGetTokenByIdCard") - fun getTokenByIdCard( - @Header("X-TIMESTAMP") timeStamp: String, - @Header("X-Sign") signStr: String, - @Body idCardJson: SortedMap - ): Call> -// -// /** -// * 获取健康干预膳食信息 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getOneUserNutrimentHealthScores") -// fun getUserNutriment(): Call> -// -// /** -// * 获取膳食信息顶部用户数据 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getHomePageUserInfo") -// fun getFoodHomePageUserInfo(): Call> -// -// -// /** -// * 获取膳食信息底部数据 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/nutritionFood") -// fun getFoodHomePageNutritionFood(@Query("day") day: String): Call> -// -// /** -// * 获取单餐营养分析 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/queryUserTimes") -// fun getNutritionUserTimes( -// @Query("timesName") timesName: String, -// @Query("mainTimeDay") mainTimeDay: String -// ): Call> -// -// /** -// * 获取更多营养素 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/otherEnergyVOList") -// fun getOtherEnergyList( -// @Query("timesName") timesName: String, -// @Query("mainTimeDay") mainTimeDay: String -// ): Call>> -// -// -// /** -// * 食物营养排行榜 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getQueryStFoodNutritionVOList") -// fun getStFoodNutritionList( -// @Query("timesName") timesName: String, -// @Query("mainTimeDay") mainTimeDay: String, -// @Query("type") type: Int -// ): Call>> -// -// /** -// * 获取单餐就餐数据 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getWeChatOneTimesVOList") -// fun getOneTimesFoodList( -// @Query("timesName") timesName: String, -// @Query("mainTimeDay") mainTimeDay: String -// ): Call> -// -// /** -// * 获取单日营养分析 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/queryUserDayTimesNew") -// fun getDayNutritionUser( -// @Query("mainTimeDay") mainTimeDay: String -// ): Call> -// -// -// /** -// * 获取日就餐数据 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getUserEatWeekTimes") -// fun getUserEatWeekTimes( -// @Query("days") mainTimeDay: String -// ): Call>> -// -// /** -// * 获取日就餐数据 -// */ -// @Headers("urlType:levelTwo") -// @GET("/gateway/thirdAppProgram/getMonthCalendarAndStatus") -// fun getMonthCalendarAndStatus( -// @Query("monthTime") monthTime: String -// ): Call> - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/repository/CommonRepository.kt b/app/src/main/java/com/xjjk/healthyclients/data/repository/CommonRepository.kt index 7b790d3..a426738 100644 --- a/app/src/main/java/com/xjjk/healthyclients/data/repository/CommonRepository.kt +++ b/app/src/main/java/com/xjjk/healthyclients/data/repository/CommonRepository.kt @@ -6,6 +6,8 @@ import com.xjjk.healthyclients.bean.CommonSettingMenuBean import com.xjjk.healthyclients.bean.SelectUserInfoBean import com.xjjk.healthyclients.bean.SelectUserMessageListBean import com.xjjk.healthyclients.bean.UploadFileResultBean +import com.xjjk.healthyclients.bean.user.IMDoctorInfoBean +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean import com.xjjk.healthyclients.data.api.CommonApi import com.xjjk.healthyclients.data.bean.ApiResponse import com.xjjk.healthyclients.data.repository.EmergencyRepository.apiCall @@ -123,6 +125,24 @@ object CommonRepository { service.changeAlRead(map) } } + /** + * 更新紧急联系人 + */ + suspend fun updateAndInsertEmergencyContact(bean: SelectEmergencyContactListBean): ApiResponse { + return apiCall { + service.updateAndInsertEmergencyContact(bean) + } + } + /** + * 删除紧急联系人 + */ + suspend fun removeEmergencyContactList(id: String): ApiResponse { + return apiCall { + val map = mutableMapOf() + map.put("id",id) + service.removeEmergencyContactList(map) + } + } /** * 首页用户弹窗-选择多少天不显示 */ @@ -134,6 +154,16 @@ object CommonRepository { service.chooseToDontShowUp(map) } } + /** + * 卡片时效校验 + */ + suspend fun selectDoctorCardExpireTime(time:Long): ApiResponse { + return apiCall { + val map = mutableMapOf() + map.put("sendTime",time) + service.selectDoctorCardExpireTime(map) + } + } suspend fun getAppUpdateInfo(): ApiResponse{ val params = mutableMapOf() params["androidOrIos"] = 1 @@ -141,5 +171,26 @@ object CommonRepository { return apiCall { service.getAppUpdateInfo(params) } } + /** + * 全科医生校验 + */ + suspend fun selectTfHelper(id:String): ApiResponse { + return apiCall { + val map = mutableMapOf() + map.put("helpId",id) + service.selectTfHelper(map) + } + } + /** + * 查询全科医生信息 + */ + suspend fun selectHelperInfoDesc(id:String): ApiResponse { + return apiCall { + val map = mutableMapOf() + map.put("helpId",id) + service.selectHelperInfoDesc(map) + } + } + } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/repository/HealthRecordRepository.kt b/app/src/main/java/com/xjjk/healthyclients/data/repository/HealthRecordRepository.kt deleted file mode 100644 index 99294bf..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/data/repository/HealthRecordRepository.kt +++ /dev/null @@ -1,149 +0,0 @@ -import com.xjjk.healthyclients.base.repository.BaseRepository -import com.xjjk.healthyclients.bean.healthrecord.CheckRecordUserInfoBean -import com.xjjk.healthyclients.data.api.HealthRecordApi -import com.xjjk.healthyclients.data.bean.ApiResponse -import com.xjjk.healthyclients.retrofit.RetrofitManager - - -/** - * @author nanfeifei - * @time 2023/8/4 13:30 - * @description - */ -object HealthRecordRepository : BaseRepository() { - private val service by lazy { RetrofitManager.getService(HealthRecordApi::class.java) } -// suspend fun getHealthDataAnalysisData(): ApiResponse> { -// return apiCall { service.getHealthDataAnalysisData() } -// } -// suspend fun getHealthDataAnalysisItemData(id: String): ApiResponse> { -// val params = mutableMapOf() -// params["classId"] = id -// return apiCall { service.getHealthDataAnalysisItemData(params) } -// } -// suspend fun getHealthDataAnalysisItemDetailData(id: String): ApiResponse> { -// val params = mutableMapOf() -// params["modeId"] = id -// return apiCall { service.getHealthDataAnalysisItemDetailData(params) } -// } -// suspend fun getHealthCheckItemRecordData(id: String): ApiResponse { -// val params = mutableMapOf() -// params["modeId"] = id -// return apiCall { service.getHealthCheckItemRecordData(params) } -// } -// suspend fun waistHipRatio(sex: String,waist: String,hip: String): ApiResponse { -// val params = mutableMapOf() -// params["sex"] = sex -// params["waist"] = waist -// params["hip"] = hip -// return apiCall {service.waistHipRatio(params)} -// } -// -// suspend fun idealBodyWeight(age: String,height: String): ApiResponse { -// val params = mutableMapOf() -// params["age"] = age -// params["height"] = height -// return apiCall {service.idealBodyWeight(params)} -// } -// suspend fun energyDemand(sex: String,age: String,height: String,weight: String): ApiResponse { -// val params = mutableMapOf() -// params["sex"] = sex -// params["age"] = age -// params["height"] = height -// params["weight"] = weight -// return apiCall {service.energyDemand(params)} -// } -// suspend fun allExercise(): ApiResponse> { -// val params = mutableMapOf() -// return apiCall {service.allExercise(params)} -// } -// suspend fun loseKilo(exerciseId:String,weight:String): ApiResponse { -// val params = mutableMapOf() -// params["exerciseId"] = exerciseId -// params["weight"] = weight -// return apiCall {service.loseKilo(params)} -// } -// suspend fun knowYourselfInMinute(sex: String,age: String,height: String,weight: String): ApiResponse { -// val params = mutableMapOf() -// params["sex"] = sex -// params["age"] = age -// params["height"] = height -// params["weight"] = weight -// return apiCall {service.knowYourselfInMinute(params)} -// } -// suspend fun selectHealthMonitoringInfo(): ApiResponse { -// val params = mutableMapOf() -// return apiCall {service.selectHealthMonitoringInfo(params)} -// } -// suspend fun selectHeightAndWeightBmiList(year:String): ApiResponse> { -// val params = mutableMapOf() -// params["year"] = year -// return apiCall {service.selectHeightAndWeightBmiList(params)} -// } -// suspend fun selectBloodFat(year:String): ApiResponse> { -// val params = mutableMapOf() -// params["year"] = year -// return apiCall {service.selectBloodFat(params)} -// } -// suspend fun selectBloodSugarList(year:String): ApiResponse> { -// val params = mutableMapOf() -// params["year"] = year -// return apiCall { service.selectBloodSugarList(params) } -// } -// -// suspend fun getBMIHomeData(): ApiResponse { -// return apiCall {service.getBMIHomeData()} -// } -// suspend fun selectBloodPresureList(year:String): ApiResponse> { -// val params = mutableMapOf() -// params["year"] = year -// return apiCall {service.selectBloodPresureList(params)} -// } -// suspend fun selectBloodSugarInfo(): ApiResponse { -// val params = mutableMapOf() -// return apiCall {service.selectBloodSugarInfo(params)} -// } -// suspend fun selectBloodPresure(): ApiResponse { -// val params = mutableMapOf() -// return apiCall { service.selectBloodPresure(params) } -// } -// suspend fun getExceptionData(): ApiResponse> { -// return apiCall {service.getExceptionData()} -// } -// suspend fun getHealthStatusData(): ApiResponse { -// return apiCall {service.getHealthStatusData()} -// } -// suspend fun getConclusionSuggestionData(date: String): ApiResponse { -// val params = mutableMapOf() -// params["year"] = date -// return apiCall {service.getConclusionSuggestionData(params)} -// } - suspend fun getHistoryReportNoDetail(id: String): ApiResponse { - val params = mutableMapOf() - params["id"] = id - return apiCall {service.getHistoryReportNoDetail(params)} - } -// suspend fun getHistoryReportByPage(pageNo: String,pageSize:String="100",userId:String): ApiResponse { -// val params = mutableMapOf() -// params["pageNo"] = pageNo -// params["pageSize"] = pageSize -// params["userId"] = userId -// return apiCall { service.getHistoryReportByPage(params.toJson().toRequestBody()) } -// } -// -// suspend fun getConclusionSuggestionDateList(): ApiResponse> { -// return apiCall {service.getConclusionSuggestionDateList()} -// } -// -// suspend fun getReportVoiceUrl(id: String): ApiResponse { -// val params = mutableMapOf() -// params["resultId"] = id -// return apiCall {service.getReportVoiceUrl(params)} -// } -// -// suspend fun convertReportVoiceUrl(id: String, type: Int): ApiResponse { -// val params = mutableMapOf() -// params["resultId"] = id -// params["type"] = type -// return apiCall {service.convertReportVoiceUrl(params)} -// } -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/data/repository/InterventionRepository.kt b/app/src/main/java/com/xjjk/healthyclients/data/repository/InterventionRepository.kt deleted file mode 100644 index 7b06fa5..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/data/repository/InterventionRepository.kt +++ /dev/null @@ -1,771 +0,0 @@ -import com.sw.healthyclients.bean.intervention.NearbyAmbulanceBean -import com.xjjk.healthyclients.bean.AedNetworkingBean -import com.xjjk.healthyclients.bean.NearbyResourceBean -import com.xjjk.healthyclients.data.api.InterventionApi -import com.xjjk.healthyclients.data.bean.ApiResponse -import com.xjjk.healthyclients.data.repository.EmergencyRepository.apiCall -import com.xjjk.healthyclients.retrofit.RetrofitManager - -// -//import com.sw.healthyclients.bean.common.CommonSettingMenuBean -//import com.sw.healthyclients.bean.emergency.EmergencyGroupInfo -//import com.sw.healthyclients.bean.home.HomeWeightRankBean -//import com.sw.healthyclients.bean.intervention.AEDBeanRequest -//import com.sw.healthyclients.bean.intervention.AEDResultBean -//import com.sw.healthyclients.bean.intervention.DoctorListBean -//import com.sw.healthyclients.bean.intervention.ElectronicBookBean -//import com.sw.healthyclients.bean.intervention.EmergencySearchRequest -//import com.sw.healthyclients.bean.intervention.EmergencySearchResponse -//import com.sw.healthyclients.bean.intervention.ImageTextBean -//import com.sw.healthyclients.bean.intervention.InterventionPlanBean -//import com.sw.healthyclients.bean.intervention.KnowledgeSuggestBean -//import com.sw.healthyclients.bean.intervention.KnowledgeSuggestDetailBean -//import com.sw.healthyclients.bean.intervention.MySportBean -//import com.sw.healthyclients.bean.intervention.MySportDetailBean -//import com.sw.healthyclients.bean.intervention.NearbyAmbulanceBean -//import com.sw.healthyclients.bean.intervention.NearbyResourceBean -//import com.sw.healthyclients.bean.intervention.PostHealthBean -//import com.sw.healthyclients.bean.intervention.PostHealthSecondaryBean -//import com.sw.healthyclients.bean.intervention.PsychologyConceptBean -//import com.sw.healthyclients.bean.intervention.ResourceStaffBean -//import com.sw.healthyclients.bean.intervention.RiskAssessmentResultBean -//import com.sw.healthyclients.bean.intervention.SelectFollowUpListBean -//import com.sw.healthyclients.bean.intervention.SelectMedicalResourceBean -//import com.sw.healthyclients.bean.intervention.SelectMedicinePrescriptionDTOListBean -//import com.sw.healthyclients.bean.intervention.SelectUserHaveNewTabBean -//import com.sw.healthyclients.bean.intervention.SportEffectBean -//import com.sw.healthyclients.bean.intervention.SportEffectVideoBean -//import com.sw.healthyclients.bean.intervention.SportWayBean -//import com.sw.healthyclients.bean.intervention.VisitRecordBean -//import com.sw.healthyclients.data.api.InterventionApi -//import com.sw.healthyclients.data.bean.ApiResponse -//import com.sw.healthyclients.data.repository.EmergencyRepository.apiCall -//import com.sw.healthyclients.retrofit.RetrofitManager -//import com.sw.healthyclients.retrofit.RetrofitManager.toRequestBody -//import com.sw.healthyclients.superfuntion.toJson -//import com.sw.healthyclients.ui.intervene2.bean.AskFollowCheckBean -//import com.sw.healthyclients.ui.intervene2.bean.DiabetesQuestionBean -//import com.sw.healthyclients.ui.intervene2.bean.EnrollBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightInterventionActionBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightListBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodOverWeightRankBean -//import com.sw.healthyclients.ui.intervene2.bean.FoodWarningBean -//import com.sw.healthyclients.ui.intervene2.bean.MonitorResultBean -//import com.sw.healthyclients.ui.intervene2.bean.PracticeBean -//import com.sw.healthyclients.ui.intervene2.bean.RankBean -//import com.sw.healthyclients.ui.intervene2.bean.RankListResult -//import com.sw.healthyclients.ui.intervene2.bean.UserWeightInfoBean -//import com.sw.healthyclients.ui.intervene2.bean.UserWeightSignUpBean -//import com.sw.healthyclients.ui.intervene2.bean.WeightChangeBean -//import com.sw.healthyclients.ui.intervene2.bean.WeightChangeTrendBean -// -object InterventionRepository { - private val service by lazy { RetrofitManager.getService(InterventionApi::class.java) } -// -// /** -// * 专家知识列表 -// */ -// suspend fun queryKnowledgeBySpecialist( -// specialistId: String, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// map["specialistId"] = specialistId -// service.queryKnowledgeBySpecialist(map.toJson().toRequestBody()) -// } -// } -// -// /** -// * 公共知识列表 -// */ -// suspend fun queryKnowledgeList( -// knowledgeType: String, -// sourceType: Int?, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// map["flag"] = knowledgeType -// if (sourceType != null) { -// map["type"] = sourceType.toString() -// } -// service.queryKnowledgeList(map.toJson().toRequestBody()) -// } -// } -// -// /** -// * 专家列表 -// */ -// suspend fun querySpecialistList(pageNo: Int, pageSize: Int): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// service.querySpecialistList(map.toJson().toRequestBody()) -// } -// } -// -// suspend fun getElectronicBookList( -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// service.getElectronicBookList(map.toJson().toRequestBody()) -// } -// } -// -// suspend fun getPrimaryTagListData(): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// service.getPrimaryTagListData(map.toJson().toRequestBody()) -// } -// } -// -// suspend fun getSecondaryTagListData(): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// service.getSecondaryTagListData(map.toJson().toRequestBody()) -// } -// } -// -// /** -// * 岗位列表 -// */ -// suspend fun selectPostListById(classPatentNo: String="",classNo: String=""): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["classPatentNo"] = classPatentNo -// map["classNo"] = classNo -// service.selectPostListById(map) -// } -// } -// /** -// * 查询慢病管理的tab -// */ -// suspend fun selectUserHaveTab(): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// service.selectUserHaveTab(map) -// } -// } -// /** -// * 随访记录 -// */ -// suspend fun selectFollowUpList(type:Int,pageNo:Int,pageSize:Int): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["type"]=type -// map["pageNo"]=pageNo -// map["pageSize"]=pageSize -// service.selectFollowUpList(map) -// } -// } -// -// /** -// * 申请随访记录校验 -// */ -// suspend fun askFollowCheck(): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// service.askFollowCheck(map) -// } -// } -// -// /** -// * 申请随访提交 -// */ -// suspend fun askFollowSubmit(content:String): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map.put("applications",content) -// service.askFollowSubmit(map.toJson().toRequestBody()) -// } -// } -// /** -// * 膳食处方 -// */ -// suspend fun selectDietaryPrescriptionList(type:Int): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["type"]=type -// service.selectDietaryPrescriptionList(map) -// } -// } -// /** -// * 运动处方 -// */ -// suspend fun selectSportsPrescriptionDTOList(type:Int): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["type"]=type -// service.selectSportsPrescriptionDTOList(map) -// } -// } -// /** -// * 用药方案 -// */ -// suspend fun selectMedicinePrescriptionDTOList(type:Int): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["type"]=type -// service.selectMedicinePrescriptionDTOList(map) -// } -// } -// /** -// * 就诊记录 -// */ -// suspend fun quertVisitRecordList(): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// service.quertVisitRecordList(map) -// } -// } -// -// /** -// * 岗位二级列表 -// */ -// suspend fun knowledgeListByPostId( -// flag: String, -// id: String -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["postId"] = id -// map["flag"] = flag -// service.knowledgeListByPostId(map) -// } -// } -// -// suspend fun getSportVideoListData(tabId: String): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// if (tabId.isNotEmpty()) { -// map["category"] = tabId -// } -// service.getSportVideoListData(map) -// } -// } -// -// suspend fun getSportVideoDetailData(itemId: Int): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["fitnessNo"] = itemId -// service.getSportVideoDetailData(map) -// } -// } -// -// suspend fun getMySportListData( -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNum"] = pageNo -// map["pageSize"] = pageSize -// service.getMySportListData(map) -// } -// } -// -// suspend fun getEmergencySearch(bean: EmergencySearchRequest): ApiResponse { -// return apiCall { -// service.getEmergencySearch(bean.toJson().toRequestBody()) -// } -// } -// suspend fun getNearbyAed(bean: AEDBeanRequest): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// if(bean.longitude>0){ -// map["longitude"] = bean.longitude -// } -// if(bean.latitude>0){ -// map["latitude"] = bean.latitude -// } -// map["radiusRange"] = bean.radiusRange -// map["aedNum"] = "" -// service.getNearbyAed(map) -// } -// } -// -// suspend fun getSportWayListData(): ApiResponse> { -// return apiCall { service.getSportWayListData() } -// } -// -// suspend fun uploadSportData( -// sportWayId: Int, -// sportMinutes: Int, -// videoPath: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["fitnessNo"] = sportWayId -// map["minutes"] = sportMinutes -// map["video"] = videoPath -// service.uploadSportData(map.toJson().toRequestBody()) -// } -// } -// -// suspend fun getMySportDetailData(id: Int): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["id"] = id -// service.getMySportDetailData(map) -// } -// } -// -// /** -// * 急救联动发起咨询 -// * @param type 咨询类型0:图文 1:视频 -// */ -// suspend fun getIMGroupInfo(name: String, longitude: Double, -// latitude: Double, type: String): ApiResponse { -// var map = mutableMapOf() -// map["longitude"] = longitude -// map["latitude"] = latitude -// map["type"] = type -// map["name"] = name -// return apiCall { service.getIMGroupInfo(map) } -// } -// suspend fun getRiskAssessmentListData(pageType: Int): ApiResponse{ -// var map = mutableMapOf() -// map["module"] = pageType -// return apiCall { service.getRiskAssessmentListData(map) } -// } -// - suspend fun nearbyResource(name:String="",longitude: Double,latitude:Double,resourceNum:Int): ApiResponse> { - var map = mutableMapOf() - map["name"] = name - map["longitude"] = longitude - map["latitude"] = latitude - map["radiusRange"] = 100000 - map["resourceNum"] = resourceNum - return apiCall { service.nearbyResource(map) } - } - - suspend fun nearbyAmbulance(longitude: Double,latitude:Double): ApiResponse> { - var map = mutableMapOf() - map["longitude"] = longitude - map["latitude"] = latitude - map["radiusRange"] = 100000 - return apiCall { service.nearbyAmbulance(map) } - } -// -// suspend fun selectMedicalResource(longitude: Double,latitude:Double): ApiResponse{ -// var map = mutableMapOf() -// map["longitude"] = longitude -// map["latitude"] = latitude -// return apiCall { service.selectMedicalResource(map) } -// } -// suspend fun MedicalResourcequeryById(id:String): ApiResponse{ -// var map = mutableMapOf() -// map["id"] = id -// return apiCall { service.MedicalResourcequeryById(map) } -// } -// suspend fun resourceStaff(id:String): ApiResponse>{ -// var map = mutableMapOf() -// map["resourceId"] = id -// return apiCall { service.resourceStaff(map) } -// } -// -// /** -// * 体重管理-首页活动列表 -// */ -// suspend fun list( -// isJoin: Boolean, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["isJoin"] = isJoin -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// service.list(map) -// } -// } -// -// /** -// * 体重管理-用户报名 -// */ -// suspend fun registration( -// interveneId: String, -// height: String, -// weight: String, -// type: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["interveneId"] = interveneId -// map["height"] = height -// map["weight"] = weight -// map["type"] = type -// service.registration(map) -// } -// } -// /** -// * 体重管理-用户报名数据 -// */ -// suspend fun signUp( -// interveneId: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["interveneId"] = interveneId -// service.signUp(map) -// } -// } -// /** -// * 体重管理-体重变化 -// */ -// suspend fun weightChange( -// matchId: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["matchId"] = matchId -// service.weightChange(map) -// } -// } -// /** -// * 体重管理-活动排名 -// */ -// suspend fun rank( -// interveneId: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["interveneId"] = interveneId -// service.rank(map) -// } -// } -// /** -// * 体重管理-更新体重 -// */ -// suspend fun updateWeight( -// interveneId: String, -// weight: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["interveneId"] = interveneId -// map["weight"] = weight -// service.updateWeight(map) -// } -// } -// /** -// * 体重管理-数据监控 -// */ -// suspend fun monitor( -// interveneId: String, -// startTime: String, -// endTime: String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["interveneId"] = interveneId -// map["startTime"] = startTime -// map["endTime"] = endTime -// service.monitor(map) -// } -// } -// -// /** -// * 体重管理-活动历史 -// */ -// suspend fun history( -// pageNo: Int, -// pageSize: Int -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// service.history(map) -// } -// } -// /** -// * 体重管理-全部排名 -// */ -// suspend fun actionRank(column:String,interveneId:String, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// map["column"] = column -// map["order"] = "asc" -// map["interveneId"] = interveneId -// service.actionRank(map) -// } -// } -// /** -// * 体重管理-全部排名 -// */ -// suspend fun weightChangeTrend(matchId:String -// ): ApiResponse> { -// return apiCall { -// val map = mutableMapOf() -// map["matchId"] = matchId -// service.weightChangeTrend(map) -// } -// } -// /** -// * 营养慢病-实测 -// */ -// suspend fun practice(startDate:String,endDate:String -// ): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["startDate"] = startDate -// map["endDate"] = endDate -// service.practice(map) -// } -// } -// /** -// * 营养慢病-实测 -// */ -// suspend fun simulate(bean : PracticeBean.BasicDataDTO): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// service.simulate(bean.toJson().toRequestBody()) -// } -// } -// -// -// /** -// * 慢病预警-查询用户是否提交过问卷 -// */ -// suspend fun surveyCheck(): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// service.surveyCheck(map) -// } -// } -// -// /** -// * 慢病预警-获取问卷信息 -// */ -// suspend fun surveyInfo(): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// service.surveyInfo(map) -// } -// } -// -// -// /** -// * 提交问卷-慢病预警 -// */ -// suspend fun postAnswerSurveyData(map: MutableMap): ApiResponse { -// return apiCall { -// service.postAnswerSurveyData(map.toJson().toRequestBody()) -// -// } -// } -// -// /** -// * 慢病预警-实测 -// */ -// suspend fun getUserPractice(startDate:String,endDate:String): ApiResponse { -// return apiCall { -// val map = mutableMapOf() -// map["startDate"] = startDate -// map["endDate"] = endDate -// service.getUserPractice(map) -// } -// } -// -// /** -// * 慢病预警-实测 -// */ -// suspend fun postUserSimulate(bean: FoodWarningBean.BasicData): ApiResponse { -// return apiCall { -// service.postUserSimulate(bean.toJson().toRequestBody()) -// } -// } -// -// suspend fun selectPsychologyBaseExist(): ApiResponse{ -// var map = mutableMapOf() -// return apiCall { service.selectPsychologyBaseExist(map) } -// } -// suspend fun psychologyConcept(): ApiResponse>{ -// var map = mutableMapOf() -// map.put("pageNo",1) -// map.put("pageSize",100) -// return apiCall { service.psychologyConcept(map) } -// } -// suspend fun knowledgeSuggest(): ApiResponse>{ -// var map = mutableMapOf() -// map.put("pageNo",1) -// map.put("pageSize",100) -// return apiCall { service.knowledgeSuggest(map) } -// } -// suspend fun knowledgeAnswerDetails(id:String): ApiResponse{ -// var map = mutableMapOf() -// map.put("id",id) -// return apiCall { service.knowledgeAnswerDetails(map) } -// } -// -// /** -// * 干预首页 8个接口 -// */ -// suspend fun interveneHomePsychology(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomePsychology(map) } -// } -// suspend fun interveneHomeMeals(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeMeals(map) } -// } -// suspend fun interveneHomeKnowledge(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeKnowledge(map) } -// } -// suspend fun interveneHomeExercise(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeExercise(map) } -// } -// suspend fun interveneHomeEnvironment(longitude: Double, latitude: Double): ApiResponse{ -// val map = mutableMapOf() -// map["longitude"] = longitude -// map["latitude"] = latitude -// return apiCall { service.interveneHomeEnvironment(map) } -// } -// suspend fun interveneHomeDiabetes(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeDiabetes(map) } -// } -// suspend fun interveneHomeCardiovascular(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeCardiovascular(map) } -// } -// suspend fun interveneHomeCancer(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.interveneHomeCancer(map) } -// } -// -// /** -// * 体重管理-获取当前用户是否已经参加活动 -// */ -// suspend fun getWeightJoinPlanId(): ApiResponse{ -// val map = mutableMapOf() -// return apiCall { service.getWeightJoinPlanId(map) } -// } -// -// /** -// * 体重管理-活动列表 -// */ -// suspend fun getWeightPlanList(): ApiResponse>{ -// val map = mutableMapOf() -// map["pageNo"] = 1 -// map["pageSize"] = 100 -// map["state"] = 1 -// return apiCall { service.getWeightPlanList(map) } -// } -// -// /** -// * 体重管理-获取当前登录人身高体重及目标体重 -// */ -// suspend fun getUserWeightInfo(planId:String): ApiResponse{ -// val map = mutableMapOf() -// map["planId"] = planId -// return apiCall { service.getUserWeightInfo(map) } -// } -// -// /** -// * 体重管理-活动报名 -// */ -// suspend fun postWeightPlanSignUp(bean: UserWeightSignUpBean): ApiResponse { -// return service.postWeightPlanSignUp(bean.toJson().toRequestBody()) -// } -// -// /** -// * 体重管理-获取活动详情 -// */ -// suspend fun getWeightPlanInfo(planId:String,time:String): ApiResponse { -// val map = mutableMapOf() -// map["planId"] = planId -// map["time"] = time -// return apiCall { service.getWeightPlanInfo(map) } -// } -// -// /** -// * 体重管理-获取历史参与记录 -// */ -// suspend fun getWeightJoinHistory(): ApiResponse> { -// val map = mutableMapOf() -// return apiCall { service.getWeightJoinHistory(map) } -// } -// -// /** -// * 体重管理-分页获取计划排行榜 -// */ -// suspend fun getWeightRank( -// planId: String, -// type: Int, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse { -// val map = mutableMapOf() -// map["planId"] = planId -// map["type"] = type -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// return apiCall { service.getWeightRank(map) } -// } -// -// /** -// * 体重管理-分页获取计划排行榜-new -// */ -// suspend fun getWeightRankNew( -// planId: String?, -// type: Int, -// pageNo: Int, -// pageSize: Int -// ): ApiResponse { -// val map = mutableMapOf() -// map["planId"] = planId -// map["type"] = type -// map["pageNo"] = pageNo -// map["pageSize"] = pageSize -// return apiCall { service.getWeightRankNew(map) } -// } -// -// /** -// * 体重管理-更新体重 -// */ -// suspend fun getMealsUpdateWeight( -// planId: String, -// weight: String -// ): ApiResponse { -// val map = mutableMapOf() -// map["planId"] = planId -// map["weight"] = weight -// return apiCall { service.getMealsUpdateWeight(map) } -// } -// -/** - *心血管-AED组网 - */ -suspend fun getAedNetworkingData(longitude: Double,latitude: Double,radiusRange: Int,aedNum: String): ApiResponse> { - return apiCall { - val map = mutableMapOf() - map["longitude"] = longitude - map["latitude"] = latitude - map["radiusRange"] = radiusRange - map["aedNum"] = aedNum - service.getAedNetworkingData(map) - } -} -} diff --git a/app/src/main/java/com/xjjk/healthyclients/fragment/EmergencyFragment.kt b/app/src/main/java/com/xjjk/healthyclients/fragment/EmergencyFragment.kt index f468c44..39b9b97 100644 --- a/app/src/main/java/com/xjjk/healthyclients/fragment/EmergencyFragment.kt +++ b/app/src/main/java/com/xjjk/healthyclients/fragment/EmergencyFragment.kt @@ -7,6 +7,7 @@ import android.graphics.Color import android.net.Uri import android.os.Build import android.os.Bundle +import android.text.TextUtils import android.util.Log import android.view.View import androidx.annotation.RequiresApi @@ -57,8 +58,8 @@ class EmergencyFragment : var firstLocation = true //我当前位置的经纬度 - var mCurrentLat: Double = 34.327271 - var mCurrentLon: Double = 108.949845 + var mCurrentLat: Double = 43.793026 + var mCurrentLon: Double = 87.627704 //所选目标的经纬度 var mLat = 0.0 @@ -100,21 +101,23 @@ class EmergencyFragment : // mHeadType.add(EmergencyDictBean("全部","全部","全部","0",true)) mHeadType.add(EmergencyDictBean("油田医院","油田医院","油田医院","1",true)) mHeadType.add(EmergencyDictBean("合作医院","合作医院","合作医院","2",false)) - mHeadType.add(EmergencyDictBean("医疗点","医疗点","医疗点","3",false)) + mHeadType.add(EmergencyDictBean("健康小屋","健康小屋","健康小屋","3",false)) mHeadType.add(EmergencyDictBean("AED","AED","AED","4",false)) mHeadType.add(EmergencyDictBean("救护车","救护车","救护车","5",false)) mBinding.fragmentEmergencyHeadRv.setHeadData(mHeadType) { titleBean -> - if (titleBean.value.equals("3")) { - mViewModel.nearbyResource(mCurrentLat,mCurrentLon,100) - } else if (titleBean.value.equals("4")) { - mViewModel.getAedNetworkingData(mCurrentLon,mCurrentLat) - } else if (titleBean.value.equals("5")) { - mViewModel.nearbyAmbulance(mCurrentLat,mCurrentLon) - } else { - titleId = titleBean.value - mViewModel.getEmergencyData(titleBean.value, mCurrentLat, mCurrentLon) - } +// if (titleBean.value.equals("3")) { +// mViewModel.nearbyResource(mCurrentLat,mCurrentLon,100) +// } else if (titleBean.value.equals("4")) { +// mViewModel.getAedNetworkingData(mCurrentLon,mCurrentLat) +// } else if (titleBean.value.equals("5")) { +// mViewModel.nearbyAmbulance(mCurrentLat,mCurrentLon) +// } else { + titleId = titleBean.value + mViewModel.getEmergencyData(titleBean.value, mCurrentLat, mCurrentLon) + mBinding.fragmentEmergencyMarkerInfo.visibility = View.GONE + +// } } } @@ -357,12 +360,19 @@ class EmergencyFragment : var bean = getMarkerInfo(mLat, mLon, mViewModel.markList.value) if (bean != null) { mBinding?.let { - it.fragmentEmergencyHospitalTag.text = bean?.level + if (TextUtils.isEmpty(bean?.level_dictText)) { + it.fragmentEmergencyHospitalTag.visibility = View.GONE + } else { + it.fragmentEmergencyHospitalTag.visibility = View.VISIBLE + it.fragmentEmergencyHospitalTag.text = bean?.level_dictText + } it.fragmentEmergencyHospitalName.text = bean?.name - if(bean?.mobile?.isNullOrEmpty() == true){ - it.fragmentEmergencyPhone.visibility=View.INVISIBLE - }else{ - it.fragmentEmergencyPhone.visibility=View.VISIBLE + if (bean?.mobile == null) { + it.fragmentEmergencyPhone.visibility = View.GONE + it.fragmentEmergencyHospitalLandline.visibility = View.GONE + } else { + it.fragmentEmergencyPhone.visibility = View.VISIBLE + it.fragmentEmergencyHospitalLandline.visibility = View.VISIBLE } it.fragmentEmergencyHospitalLandline.text = bean?.mobile it.fragmentEmergencyHospitalAddress.text = bean?.address diff --git a/app/src/main/java/com/xjjk/healthyclients/fragment/MonitorFragment.kt b/app/src/main/java/com/xjjk/healthyclients/fragment/MonitorFragment.kt index 355935c..83bcb5b 100644 --- a/app/src/main/java/com/xjjk/healthyclients/fragment/MonitorFragment.kt +++ b/app/src/main/java/com/xjjk/healthyclients/fragment/MonitorFragment.kt @@ -4,6 +4,7 @@ import android.graphics.Color import android.os.Bundle import android.text.TextUtils import android.view.View +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.github.gzuliyujiang.wheelpicker.NumberPicker import com.github.gzuliyujiang.wheelview.contract.WheelFormatter import com.sw.healthyclients.data.local.DataStoreManager @@ -21,10 +22,13 @@ import com.xjjk.healthyclients.data.api.HealthCheckNetApi import com.xjjk.healthyclients.databinding.FragmentMonitorBinding import com.xjjk.healthyclients.retrofit.getHealthCheckRetrofit import com.xjjk.healthyclients.retrofit.intervention.CallbackInterventionManager +import com.xjjk.healthyclients.superfuntion.initColors import com.xjjk.healthyclients.ui.activity.CvdWarningHistoryActivity import com.xjjk.healthyclients.ui.activity.InterventionWebActivity +import com.xjjk.healthyclients.utils.ConstantUtils -class MonitorFragment: BaseVMBFragment(R.layout.fragment_monitor) { +class MonitorFragment: BaseVMBFragment(R.layout.fragment_monitor), + SwipeRefreshLayout.OnRefreshListener { private val COLOR_PICKER_OK = "#21BEBD" private val TYPE_HEART_RATE = "heart_rate" private val TYPE_SPO2 = "spo2" @@ -44,14 +48,16 @@ class MonitorFragment: BaseVMBFragment(R. private var cvdMainAdapter: CvdMainAdapter = CvdMainAdapter() private var mUserId: String = "" - private var mToken: String = "" override fun initView(root: View?, savedInstanceState: Bundle?) { + mBinding.apply { + swipeRefresh.initColors() + swipeRefresh.setOnRefreshListener(this@MonitorFragment) + } } override fun initData() { super.initData() - mToken = DataStoreManager.getToken() mUserId = DataStoreManager.getUserId().toString() // mUserId = "09fd6195cd4c4f1fb457f34678fa0011" @@ -62,12 +68,15 @@ class MonitorFragment: BaseVMBFragment(R. mBinding.recyclerView.adapter = cvdMainAdapter initListData() + getHomePageUserInfo() + } - override fun lazyLoadData() { - super.lazyLoadData() - getHomePageUserInfo() -// answer() + override fun onRefresh() { + mBinding.swipeRefresh.isRefreshing = false + if (ConstantUtils.mCheckToken) { + getHomePageUserInfo() + } } private fun initListData() { @@ -263,59 +272,6 @@ class MonitorFragment: BaseVMBFragment(R. } -// fun answer(){ -// dialog?.show() -// var getCvdHomeData = mApi.selectTfFillQuestion(mType.toString()) -// getCvdHomeData.enqueue(object : CallbackInterventionManager() { -// -// override fun onSuccess( -// code: Int, -// result: Boolean?, -// message: String, -// ok: Boolean -// ) { -// dialog?.dismiss() -// result?.let { -// if (it) { -// //已填写问卷 -// mBinding?.ccdwvAnswer?.answerState(true) -// getRiskInfo() -// }else{ -// mBinding?.ccdwvAnswer?.answerState(false) -// } -// } -// } -// -// override fun onFail(code: Int, errMsg: String?) { -// dialog?.dismiss() -// showToast(errMsg) -// } -// -// }) -// } -// -// fun getRiskInfo(){ -// var getCvdHomeData = mApi.selectAngiocarpyPreventionWarningDOByUserId(mType.toString()) -// getCvdHomeData.enqueue(object : CallbackInterventionManager() { -// -// override fun onSuccess( -// code: Int, -// result: CvdRiskInfoBean?, -// message: String, -// ok: Boolean -// ) { -// dialog?.dismiss() -// mBinding?.ccdwvAnswer?.setRiskInfo(result) -// } -// -// override fun onFail(code: Int, errMsg: String?) { -// showToast(errMsg) -// } -// -// }) -// } - - private fun showHeartPicker() { val picker = DoubleWheelBPicker(requireActivity()) picker.setData(HeartRateProvider()) @@ -367,7 +323,7 @@ class MonitorFragment: BaseVMBFragment(R. picker.setFormatter(WheelFormatter { item -> "$item %" }) picker.setRange(75, 90, 5) picker.setDefaultValue(spo2DefaultMin) - picker.setTitle("血氧阈值") + picker.setTitle("血氧阈值(下限)") picker.okView.text = "保存并同步" picker.okView.setTextColor(Color.parseColor(COLOR_PICKER_OK)) picker.show() @@ -388,37 +344,12 @@ class MonitorFragment: BaseVMBFragment(R. picker.setFormatter(WheelFormatter { item -> "$item" }) picker.setRange(80, 99, 1) picker.setDefaultValue(StressDefaultMin) - picker.setTitle("压力阈值") + picker.setTitle("压力阈值(上限)") picker.okView.text = "保存并同步" picker.okView.setTextColor(Color.parseColor(COLOR_PICKER_OK)) picker.show() } - private fun getTitleTagList(): MutableList { - val titleList: MutableList = mutableListOf() - var titleTag = TitleTagBean() - titleTag.text = "防范心梗" - titleTag.isSelect = true - titleList.add(titleTag) - - titleTag = TitleTagBean() - titleTag.text = "吃动平衡" - titleTag.isSelect = false - titleList.add(titleTag) - - titleTag = TitleTagBean() - titleTag.text = "血管健康" - titleTag.isSelect = false - titleList.add(titleTag) - - titleTag = TitleTagBean() - titleTag.text = "防脑卒中" - titleTag.isSelect = false - titleList.add(titleTag) - - return titleList - } - // private fun resetTitleTagStatus(position: Int) { // titleTextAdapter.data // for ((index, item) in titleTextAdapter.data.withIndex()) { diff --git a/app/src/main/java/com/xjjk/healthyclients/fragment/UserInfoFragment.kt b/app/src/main/java/com/xjjk/healthyclients/fragment/UserInfoFragment.kt index 469b8f7..3e65af3 100644 --- a/app/src/main/java/com/xjjk/healthyclients/fragment/UserInfoFragment.kt +++ b/app/src/main/java/com/xjjk/healthyclients/fragment/UserInfoFragment.kt @@ -1,4 +1,3 @@ - import android.os.Bundle import android.os.SystemClock import android.view.View @@ -22,6 +21,7 @@ import com.xjjk.healthyclients.superfuntion.startLoginActivity import com.xjjk.healthyclients.superfuntion.startUserInfoSettingActivity import com.xjjk.healthyclients.superfuntion.startUserMyGuidanceActivity import com.xjjk.healthyclients.superfuntion.startUserSettingActivity +import com.xjjk.healthyclients.superfuntion.startUserSoSContactsActivity import com.xjjk.healthyclients.ui.viewmodel.UserInfoFragmentViewModel import com.xjjk.healthyclients.utils.ConstantUtils import kotlinx.coroutines.flow.collectLatest @@ -30,9 +30,10 @@ import kotlinx.coroutines.launch /** *我的fragment */ -class UserInfoFragment: BaseVMBFragment(R.layout.fragment_user_info){ - var mList= arrayListOf() - var mUserMenuAdapter : UserMenuAdapter?=null +class UserInfoFragment : + BaseVMBFragment(R.layout.fragment_user_info) { + var mList = arrayListOf() + var mUserMenuAdapter: UserMenuAdapter? = null var time: Long = 2000 var mCount = 5 @@ -41,6 +42,7 @@ class UserInfoFragment: BaseVMBFragment { - context?.let{ + context?.let { if (DataStoreManager.getToken().isNullOrEmpty()) { startLoginActivity(it) - }else{ - startConsultantManagerActivity(it,true) + } else { + startConsultantManagerActivity(it, true) } } } + 3 -> { context?.let { startEmergencySeekDoctorActivity(it) } } + 8 -> { + requireContext().startUserSoSContactsActivity() + } + + else -> {} } } @@ -173,7 +193,7 @@ class UserInfoFragment: BaseVMBFragment { context?.let { if (ConstantUtils.mCheckToken) { @@ -231,26 +251,29 @@ class UserInfoFragment: BaseVMBFragment { context?.let { - var token= DataStoreManager.getToken() + var token = DataStoreManager.getToken() if (token.isNotEmpty()) { startUserInfoSettingActivity(it) - }else{ + } else { startLoginActivity(it) } } } + R.id.user_tv_name -> { context?.let { - var token= DataStoreManager.getToken() + var token = DataStoreManager.getToken() if (token.isNotEmpty()) { - }else{ + } else { startLoginActivity(it) } } } + R.id.title_iv_right -> { context?.let { startUserSettingActivity(it) } } + R.id.tv_login_out -> { context?.let { startLoginActivity(it) diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt b/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt index 98cc505..d50af7a 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt @@ -5,53 +5,52 @@ import com.xjjk.healthyclients.utils.UrlH5RouteUtils import okhttp3.HttpUrl.Companion.toHttpUrl object UrlConfig { -// private const val DEBUG_DEFAULT_IP_ADDRESS_REMOTE = "http://192.168.1.98/" // 开发环境 - private const val DEBUG_DEFAULT_IP_ADDRESS_REMOTE = "http://cqyt.dev.yg.dt.io/" // 开发环境 - private const val TEST_DEFAULT_IP_ADDRESS_REMOTE = "https://starry.test.icdat.cn/" // 测试环境 - private const val PRODUCT_DEFAULT_IP_ADDRESS_REMOTE = "https://health-api.tzgl.shuziweidao.com" -// private const val PRODUCT_DEFAULT_IP_ADDRESS_REMOTE = "http://192.168.1.98/" + private const val DEBUG_DEFAULT_IP_ADDRESS_REMOTE = "http://192.168.1.98/" // 开发环境 +// private const val DEBUG_DEFAULT_IP_ADDRESS_REMOTE = "http://cqyt.dev.yg.dt.io/" // 开发环境 +// private const val TEST_DEFAULT_IP_ADDRESS_REMOTE = "https://starry.test.icdat.cn/" // 测试环境 + private const val PRODUCT_DEFAULT_IP_ADDRESS_REMOTE = "https://xjgateway.mcrm.vip:8888" - private const val DEBUG_H5_ADDRESS_REMOTE = "http://cms.dev.yg.dt.io" // 开发环境 - private const val TEST_H5_ADDRESS_REMOTE = "https://starry.out.icdat.cn" // 测试环境 - private const val PRODUCT_H5_ADDRESS_REMOTE = "https://console.shuziweidao.com" +// private const val DEBUG_H5_ADDRESS_REMOTE = "http://cms.dev.yg.dt.io" // 开发环境 +// private const val TEST_H5_ADDRESS_REMOTE = "https://starry.out.icdat.cn" // 测试环境 + private const val PRODUCT_H5_ADDRESS_REMOTE = "https://xjconsole.mcrm.vip:8888" val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT var testDeviceList = mutableListOf("7e8e7e49a26340b1","bb2d17cc138d109f")//测试设备列表 荣耀 oppo vivo var isTestDevice: Boolean = false - var isOpenIm: Boolean = false + var isOpenIm: Boolean = true enum class BaseUrlType(val type: Int) { DEBUG(1), - TEST(2), +// TEST(2), PRODUCT(3) } - private fun getBaseUrl(baseUrlType: BaseUrlType = BaseUrlType.DEBUG): String { + private fun getBaseUrl(baseUrlType: BaseUrlType = BaseUrlType.PRODUCT): String { return when (baseUrlType) { BaseUrlType.DEBUG -> { DEBUG_DEFAULT_IP_ADDRESS_REMOTE } - - BaseUrlType.TEST -> { - TEST_DEFAULT_IP_ADDRESS_REMOTE - } +// +// BaseUrlType.TEST -> { +// TEST_DEFAULT_IP_ADDRESS_REMOTE +// } BaseUrlType.PRODUCT -> { PRODUCT_DEFAULT_IP_ADDRESS_REMOTE } } } - fun getH5BaseUrl(baseUrlType: BaseUrlType = BaseUrlType.DEBUG): String { + fun getH5BaseUrl(baseUrlType: BaseUrlType = BaseUrlType.PRODUCT): String { return when (baseUrlType) { BaseUrlType.DEBUG -> { - DEBUG_H5_ADDRESS_REMOTE - } - - BaseUrlType.TEST -> { - TEST_H5_ADDRESS_REMOTE + PRODUCT_H5_ADDRESS_REMOTE } +// +// BaseUrlType.TEST -> { +// TEST_H5_ADDRESS_REMOTE +// } BaseUrlType.PRODUCT -> { PRODUCT_H5_ADDRESS_REMOTE @@ -119,16 +118,16 @@ object UrlConfig { /** * 获取健康干预-膳食 接口地址 */ - fun getInterventionFoodUrl():String { - return when (baseUrlType) { - BaseUrlType.DEBUG,BaseUrlType.TEST -> { - "https://vip.shuziweidao.com" - } - BaseUrlType.PRODUCT -> { - "https://yyjk.shuziweidao.com/" - } - } - } +// fun getInterventionFoodUrl():String { +// return when (baseUrlType) { +// BaseUrlType.DEBUG,BaseUrlType.TEST -> { +// "https://vip.shuziweidao.com" +// } +// BaseUrlType.PRODUCT -> { +// "https://yyjk.shuziweidao.com/" +// } +// } +// } /** * H5访问地址 diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/CustomSignInterceptor.kt b/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/CustomSignInterceptor.kt index d6a60b1..318d6ce 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/CustomSignInterceptor.kt +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/CustomSignInterceptor.kt @@ -43,71 +43,17 @@ import java.util.concurrent.TimeUnit * 版本: v1.0

*/ class CustomSignInterceptor : BaseCustomDynamicInterceptor() { - companion object { + companion object{ var marketId = 10029 const val BODY_NO_ENCODE = "bodyNoEncode" } - override fun dynamicHeader(builder: Request.Builder): Request.Builder { // builder.addHeader("Content-Type", "application/json") builder.addHeader("X-Access-Token", DataStoreManager.getToken()) +// builder.addHeader("X-ClientSign", "Quarry") return builder } - override fun intercept(chain: Interceptor.Chain): Response { - var requestTimeout = chain.connectTimeoutMillis() - //获取request - val request = chain.request() - //从request中获取原有的HttpUrl实例oldHttpUrl - val oldHttpUrl = request.url - //获取request的创建者builder - val builder = request.newBuilder() - println("动态修改超时时间--${requestTimeout}") - //读取新的动态超时时间 - val requestTimeoutNew = request.header("TIMEOUT") - if (!requestTimeoutNew.isNullOrEmpty()) { - requestTimeout = requestTimeoutNew.toFormatInt() - println("动态修改超时时间connectTimeout:${requestTimeout}") - } - - - //从request中获取headers,通过给定的键url_name - val headerValues = request.headers("urlType") - if (headerValues != null && headerValues.size > 0) { - //如果有这个header,先将配置的header删除,因此header仅用作app和okhttp之间使用 - builder.removeHeader("urlType") - //匹配获得新的BaseUrl - val headerValue = headerValues[0] - var newBaseUrl: HttpUrl? = null - newBaseUrl = if ("levelTwo" == headerValue) { - UrlConfig.getInterventionFoodUrl().toHttpUrlOrNull() - } else { - oldHttpUrl - } - //重建新的HttpUrl,修改需要修改的url部分 - val newFullUrl = oldHttpUrl - .newBuilder() - .scheme("https") //更换网络协议 - .host(newBaseUrl!!.host) //更换主机名 - .port(newBaseUrl!!.port) //更换端口 - .build() - //重建这个request,通过builder.url(newFullUrl).build(); - if (getInterventionToken() != null && !getInterventionToken().isEmpty()) { - builder.header("X-Access-Token", getInterventionToken()) - } - // 然后返回一个response至此结束修改 - return chain.withConnectTimeout(requestTimeout, TimeUnit.MILLISECONDS) - .withReadTimeout(requestTimeout, TimeUnit.MILLISECONDS) - .withWriteTimeout(requestTimeout, TimeUnit.MILLISECONDS) - .proceed(builder.url(newFullUrl).build()) - } - return super.intercept( - chain.withConnectTimeout(requestTimeout, TimeUnit.MILLISECONDS) - .withReadTimeout(requestTimeout, TimeUnit.MILLISECONDS) - .withWriteTimeout(requestTimeout, TimeUnit.MILLISECONDS) - ) - } - override fun dynamic(dynamicMap: TreeMap?): TreeMap { //dynamicMap:是原有的全局参数+局部参数 // dynamicMap?.set("marketId".asEncode(), marketId.toString()) //示例 @@ -116,22 +62,22 @@ class CustomSignInterceptor : BaseCustomDynamicInterceptor() { override fun dynamicJson(json: String?): String { var jsonObj: Any - jsonObj = if (TextUtils.isEmpty(json)) { + jsonObj = if(TextUtils.isEmpty(json)){ JsonObject() - } else { + }else{ JsonParser.parseString(json) } json?.let { Logger.d(it) } - return if (jsonObj is JsonObject) { + return if(jsonObj is JsonObject){ // jsonObj.addProperty("marketId".asEncode(), marketId) //示例 - if (jsonObj.has(BODY_NO_ENCODE)) { + if(jsonObj.has(BODY_NO_ENCODE)){ jsonObj.remove(BODY_NO_ENCODE) encrypt(jsonObj.toJson(), false) - } else { + }else{ jsonObj.remove(BODY_NO_ENCODE) encrypt(jsonObj.toJson(), true) } - } else { + }else{ json!! } } diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/LoggingInterceptor2.java b/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/LoggingInterceptor2.java index 8d030fc..abb3105 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/LoggingInterceptor2.java +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/interceptor/LoggingInterceptor2.java @@ -57,6 +57,7 @@ public class LoggingInterceptor2 implements Interceptor { if (DataStoreManager.INSTANCE.getToken()!=null&&!DataStoreManager.INSTANCE.getToken().isEmpty() ) { requestBuilder.header("X-Access-Token", DataStoreManager.INSTANCE.getToken()); } +// requestBuilder.header("X-ClientSign", "Quarry"); // requestBuilder.header("Platform", ConstantUtils.mPlatform); // requestBuilder.header("VersionName", BuildConfig.VERSION_NAME); // requestBuilder.header("VersionCode", BuildConfig.VERSION_CODE+""); diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/InterventionRetrofitHelper.kt b/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/InterventionRetrofitHelper.kt index 68da559..577920b 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/InterventionRetrofitHelper.kt +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/InterventionRetrofitHelper.kt @@ -1,16 +1,7 @@ -package com.bihu.myapplication.retrofit +package com.xjjk.healthyclients.retrofit.intervention import com.xjjk.healthyclients.retrofit.RetrofitManager -import com.xjjk.healthyclients.retrofit.interceptor.LoggingInterceptor2 -import com.xjjk.healthyclients.retrofit.UrlConfig.getDefaultBaseUrl -import com.xjjk.healthyclients.retrofit.UrlConfig.getInterventionFoodUrl -import com.xjjk.healthyclients.retrofit.gson.GsonConverterFactoryNew -import com.xjjk.healthyclients.retrofit.intervention.TokenHeaderInterceptor -import com.xjjk.healthyclients.utils.ApiDns -import okhttp3.OkHttpClient import retrofit2.Retrofit -import retrofit2.converter.gson.GsonConverterFactory -import java.util.concurrent.TimeUnit fun getInterventionRetrofit(): Retrofit { // val builder = OkHttpClient.Builder() diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/TokenHeaderInterceptor.java b/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/TokenHeaderInterceptor.java index acb4399..f992b9e 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/TokenHeaderInterceptor.java +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/intervention/TokenHeaderInterceptor.java @@ -53,6 +53,8 @@ public class TokenHeaderInterceptor implements Interceptor { if (DataStoreManager.INSTANCE.getInterventionToken()!=null&&!DataStoreManager.INSTANCE.getInterventionToken().isEmpty() ) { requestBuilder.header("X-Access-Token", DataStoreManager.INSTANCE.getInterventionToken()); } +// requestBuilder.header("X-ClientSign", "Quarry"); + // requestBuilder.header("Platform", ConstantUtils.mPlatform); // requestBuilder.header("VersionName", BuildConfig.VERSION_NAME); // requestBuilder.header("VersionCode", BuildConfig.VERSION_CODE+""); diff --git a/app/src/main/java/com/xjjk/healthyclients/superfuntion/BindingViewExt.kt b/app/src/main/java/com/xjjk/healthyclients/superfuntion/BindingViewExt.kt index a14d2c4..124b013 100644 --- a/app/src/main/java/com/xjjk/healthyclients/superfuntion/BindingViewExt.kt +++ b/app/src/main/java/com/xjjk/healthyclients/superfuntion/BindingViewExt.kt @@ -3,6 +3,7 @@ package com.xjjk.healthyclients.superfuntion import android.widget.ImageView import androidx.databinding.BindingAdapter import com.allen.library.SuperTextView +import com.xjjk.healthyclients.R /** * DataBinding的自定义属性 @@ -19,7 +20,7 @@ fun ImageView.setImageUrl(url: String) { */ @BindingAdapter("circleImageUrl") fun ImageView.setCircleImageUrl(url: String?) { - loadCircle(url) + loadCircle(url,R.drawable.ic_default_doctor_head_img) } @BindingAdapter("sLeftTextString") fun SuperTextView.setLeftTextString(text: CharSequence) { diff --git a/app/src/main/java/com/xjjk/healthyclients/superfuntion/SeekDoctorSearchActivityFuntion.kt b/app/src/main/java/com/xjjk/healthyclients/superfuntion/SeekDoctorSearchActivityFuntion.kt deleted file mode 100644 index 3eea714..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/superfuntion/SeekDoctorSearchActivityFuntion.kt +++ /dev/null @@ -1,88 +0,0 @@ -package com.xjjk.healthyclients.superfuntion - -import android.os.Build -import android.view.View -import android.view.View.OnLongClickListener -import androidx.annotation.RequiresApi -import com.google.android.material.tabs.TabLayout -import com.xjjk.healthyclients.ui.activity.guidance.SeekDoctorSearchActivity - -fun SeekDoctorSearchActivity.getTab(name: String): TabLayout.Tab { - var newTab = mBinding.seekDoctorSearchTab.newTab() - newTab.view.setOnLongClickListener(object : OnLongClickListener { - override fun onLongClick(v: View?): Boolean { - return true - } - }) - newTab.setText(name) - return newTab -} - - -/** - * 切换tab刷新相关操作 - * //0 综合 1专家 2医院 3疾病 4科室 - * 切换 - */ -fun SeekDoctorSearchActivity.switchTabRefresh(position: Int) { - mBinding?.apply { - when (position) { - 0 -> { - seekDoctorDepartmentListRoot.visibility = View.VISIBLE - seekDoctorDoctorListRoot.visibility = View.VISIBLE - seekDoctorHospitalListRoot.visibility = View.VISIBLE - seekDoctorDiseaseListRoot.visibility = View.VISIBLE - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - 1 -> { - seekDoctorDoctorListRoot.visibility = View.VISIBLE - seekDoctorDepartmentListRoot.visibility = View.GONE - seekDoctorHospitalListRoot.visibility = View.GONE - seekDoctorDiseaseListRoot.visibility = View.GONE - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - 2 -> { - seekDoctorHospitalListRoot.visibility = View.VISIBLE - seekDoctorDoctorListRoot.visibility = View.GONE - seekDoctorDepartmentListRoot.visibility = View.GONE - seekDoctorDiseaseListRoot.visibility = View.GONE - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - 3 -> { - seekDoctorHospitalListRoot.visibility = View.GONE - seekDoctorDoctorListRoot.visibility = View.GONE - seekDoctorDepartmentListRoot.visibility = View.GONE - seekDoctorDiseaseListRoot.visibility = View.VISIBLE - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - 4 -> { - seekDoctorHospitalListRoot.visibility = View.GONE - seekDoctorDoctorListRoot.visibility = View.GONE - seekDoctorDepartmentListRoot.visibility = View.VISIBLE - seekDoctorDiseaseListRoot.visibility = View.GONE - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - } - } - -} diff --git a/app/src/main/java/com/xjjk/healthyclients/superfuntion/StartActivityManager.kt b/app/src/main/java/com/xjjk/healthyclients/superfuntion/StartActivityManager.kt index 1b3985d..57849b9 100644 --- a/app/src/main/java/com/xjjk/healthyclients/superfuntion/StartActivityManager.kt +++ b/app/src/main/java/com/xjjk/healthyclients/superfuntion/StartActivityManager.kt @@ -6,16 +6,19 @@ import android.net.Uri import android.os.Bundle import androidx.core.view.ContentInfoCompat import com.xjjk.healthyclients.bean.guidance.ConsultantBean +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean import com.xjjk.healthyclients.ui.activity.ChangePassWordActivity +import com.xjjk.healthyclients.ui.activity.EmergencyContactActivity import com.xjjk.healthyclients.ui.activity.FullScreenImageActivity import com.xjjk.healthyclients.ui.activity.LoginActivity import com.xjjk.healthyclients.ui.activity.RetrievePassWordActivity import com.xjjk.healthyclients.ui.activity.UserInfoSettingActivity import com.xjjk.healthyclients.ui.activity.UserSettingActivity +import com.xjjk.healthyclients.ui.activity.UserSoSContactsActivity import com.xjjk.healthyclients.ui.activity.WebActivity -import com.xjjk.healthyclients.ui.activity.emergency.AddBigDiseaseActivity import com.xjjk.healthyclients.ui.activity.emergency.EmergencySeekDoctorActivity import com.xjjk.healthyclients.ui.activity.emergency.EmergencySeekDoctorDetailsActivity +import com.xjjk.healthyclients.ui.activity.guidance.AllDoctorActivity import com.xjjk.healthyclients.ui.activity.guidance.AppointmentDetailActivity import com.xjjk.healthyclients.ui.activity.guidance.ArchivesDetailActivity import com.xjjk.healthyclients.ui.activity.guidance.BaseHealthyInfoAddActivity @@ -24,7 +27,6 @@ import com.xjjk.healthyclients.ui.activity.guidance.ConsultantManagerActivity import com.xjjk.healthyclients.ui.activity.guidance.DoctorAllAppraiseActivity import com.xjjk.healthyclients.ui.activity.guidance.DoctorHomepageActivity import com.xjjk.healthyclients.ui.activity.guidance.EditConsultantActivity -import com.xjjk.healthyclients.ui.activity.guidance.FilterSearchDoctorActivity import com.xjjk.healthyclients.ui.activity.guidance.GeneralPracticeGuidanceActivity import com.xjjk.healthyclients.ui.activity.guidance.GuidanceNoticeActivity import com.xjjk.healthyclients.ui.activity.guidance.MyGuidanceActivity @@ -297,10 +299,10 @@ fun startEditConsultantActivity(context: Context, consultantBean: ConsultantBean /** * 带筛选框的找专家 */ -fun startFilterSearchDoctorActivity(context: Context, value: String = "", bundle: Bundle) { - bundle.putString("search", value) - startActivity(context, bundle = bundle, targetClass = FilterSearchDoctorActivity::class.java) -} +//fun startFilterSearchDoctorActivity(context: Context, value: String = "", bundle: Bundle) { +// bundle.putString("search", value) +// startActivity(context, bundle = bundle, targetClass = FilterSearchDoctorActivity::class.java) +//} ///** // * 专家库咨询 // */ @@ -456,15 +458,15 @@ fun startLoginActivity(context: Context) { fun startUserInfoSettingActivity(context: Context) { startActivity(context, targetClass = UserInfoSettingActivity::class.java) } -// -///** -// * 紧急联系人 -// */ -//fun startEmergencyContactActivity(context: Context, bean: SelectEmergencyContactListBean?) { -// val bundle = Bundle() -// bundle.putSerializable("peopleInfo", bean) -// startActivity(context, bundle = bundle, targetClass = EmergencyContactActivity::class.java) -//} + +/** + * 紧急联系人 + */ +fun startEmergencyContactActivity(context: Context, bean: SelectEmergencyContactListBean?) { + val bundle = Bundle() + bundle.putSerializable("peopleInfo", bean) + startActivity(context, bundle = bundle, targetClass = EmergencyContactActivity::class.java) +} /** * 档案大图查看 @@ -580,9 +582,9 @@ fun startBaseHealthyInfoAddActivity(context: Context, memberId: String?) { /** * 新增大病就医 */ -fun startAddBigDiseaseActivity(context: Context) { - startActivity(context, targetClass = AddBigDiseaseActivity::class.java) -} +//fun startAddBigDiseaseActivity(context: Context) { +// startActivity(context, targetClass = AddBigDiseaseActivity::class.java) +//} /** * 大病就医详情 @@ -1343,13 +1345,22 @@ fun startMyGuidanceActivity(context: Context, value: String) { // val bundle = Bundle() // startActivity(this,bundle=bundle, targetClass = MotionStatActivity::class.java) //} -///** -// * 运动报表 -// */ -//fun Context.startUserSoSContactsActivity() { -// val bundle = Bundle() -// startActivity(this,bundle=bundle, targetClass = UserSoSContactsActivity::class.java) -//} +/** + * 紧急联系人 + */ +fun Context.startUserSoSContactsActivity() { + val bundle = Bundle() + startActivity(this,bundle=bundle, targetClass = UserSoSContactsActivity::class.java) +} + +/** + * 全科医生 + */ +fun Context.startAllDoctorActivity(id:String) { + val bundle = Bundle() + bundle.putString("id", id) + startActivity(this,bundle=bundle,targetClass = AllDoctorActivity::class.java) +} ///** // * 我的收藏与我的点赞 // */ diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/EmergencyContactActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/EmergencyContactActivity.kt new file mode 100644 index 0000000..198ef2f --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/EmergencyContactActivity.kt @@ -0,0 +1,165 @@ +package com.xjjk.healthyclients.ui.activity + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import com.github.gzuliyujiang.wheelpicker.OptionPicker +import com.luck.picture.lib.utils.ToastUtils.showToast +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.bean.CommonSettingMenuBean +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean +import com.xjjk.healthyclients.databinding.ActivityUserEmergencyContactBinding +import com.xjjk.healthyclients.ui.viewmodel.UserInfoFragmentViewModel +import com.xjjk.healthyclients.ui.viewmodel.UserInfoSettingViewModel +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch +import org.antlr.v4.runtime.misc.MurmurHash.finish + +/** + * 紧急联系人 + */ +class EmergencyContactActivity : + BaseVMBActivity(R.layout.activity_user_emergency_contact) { + var mBean: SelectEmergencyContactListBean? = null + val relationPicker: OptionPicker by lazy { OptionPicker(this) } + + override fun initView(savedInstanceState: Bundle?) { + mBinding?.apply { + } + + } + + override fun transparentStatusBar(): Boolean { + return false + } + + override fun initData() { + try { + mBean = intent.getSerializableExtra("peopleInfo") as SelectEmergencyContactListBean? + if (mBean != null) { + mBinding?.apply { + emergencyContactName.setText(mBean!!.name) + emergencyContactPhone.setText(mBean!!.phone) + emergencyContactIdcard.setText(mBean!!.idCard) + emergencyContactRelation.setText(mBean!!.familyRelation_dictText) + emergencyContactDel?.visibility=View.VISIBLE + } + }else{ + mBinding?.emergencyContactDel?.visibility=View.GONE + } + } catch (e: Exception) { + + } + mViewModel.getRelationList() + + } + + override fun createObserve() { + super.createObserve() + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.relationList.collectLatest { + if (it.isNullOrEmpty()) { + return@collectLatest + } + relationPicker.setData(it) + if (mBean == null) { + setRelationText(it[0]) + } else { + it.forEach { commonSettingMenuBean -> + if (mBean!!.familyRelation == commonSettingMenuBean.text + || mBean!!.familyRelation == commonSettingMenuBean.value + ) { + setRelationText(commonSettingMenuBean) + } + } + } + + + } + } + } + + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.upState.collectLatest { + if (it){ + finish() + } + } + } + } + + } + + private fun setRelationText(commonSettingMenuBean: CommonSettingMenuBean) { + mBinding.emergencyContactRelation.text = commonSettingMenuBean.text + if (mBean==null) { + mBean= SelectEmergencyContactListBean() + } + mBean?.familyRelation = commonSettingMenuBean.value + mBean?.familyRelation_dictText = commonSettingMenuBean.text + } + + private fun showRelationPicker() { + relationPicker.setBackgroundResource(R.drawable.rectangle_top_round_corner20_white) + relationPicker.setTitle(R.string.edit_consultant_relation_title) + relationPicker.setDefaultPosition(0) + relationPicker.wheelView.setFormatter { value -> + (value as CommonSettingMenuBean).text + } + relationPicker.setOnOptionPickedListener { position, item -> + setRelationText(item as CommonSettingMenuBean) + + } + relationPicker.show() + } + + + override fun bindEvent() { + mBinding?.apply { + addClickViews(emergencyContactRelation, emergencyContactDel, emergencyContactSave) + } + } + + override fun processClick(paramView: View?) { + when (paramView?.id) { + R.id.emergency_contact_relation -> { + showRelationPicker() + } + R.id.emergency_contact_del -> { + mBean?.let { mViewModel.removeEmergencyContactList(it.id) } + } + R.id.emergency_contact_save -> { + var name=mBinding.emergencyContactName.text.toString().trim() + if (name.length==0) { + showToast("请输入姓名") + return + } + var phone=mBinding.emergencyContactPhone.text.toString().trim() + if (phone.length==0) { + showToast("请输入手机号") + return + } + var idcard=mBinding.emergencyContactIdcard.text.toString().trim() + if (idcard.length==0) { + showToast("请输入身份证号") + return + } + var relation=mBinding.emergencyContactRelation.text.toString().trim() + if (relation.length==0) { + showToast("请选择关系") + return + } + mBean!!.name=name + mBean!!.phone=phone + mBean!!.idCard=idcard + mBean!!.familyRelation_dictText=relation + mViewModel.updateAndInsertEmergencyContact(mBean!!) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/InterventionWebActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/InterventionWebActivity.kt index 76648bc..adfb97c 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/InterventionWebActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/InterventionWebActivity.kt @@ -2,18 +2,17 @@ package com.xjjk.healthyclients.ui.activity import android.graphics.Bitmap import android.os.Bundle +import android.text.TextUtils import android.view.View import android.webkit.WebChromeClient import android.webkit.WebView import android.webkit.WebViewClient -import com.bihu.myapplication.retrofit.getInterventionRetrofit import com.sw.healthyclients.data.local.DataStoreManager import com.sw.healthyclients.utils.DateUtil import com.sw.healthyclients.utils.DateUtil.getEndDateOfMonth import com.xjjk.healthyclients.R import com.xjjk.healthyclients.base.BaseVMBActivity import com.xjjk.healthyclients.base.viewmodel.TestViewModel -import com.xjjk.healthyclients.data.api.InterventionNetApi import com.xjjk.healthyclients.databinding.ActivityInterventionWebBinding import com.xjjk.healthyclients.retrofit.UrlConfig import com.xjjk.healthyclients.retrofit.UrlConfig.getDefaultBaseUrl @@ -25,7 +24,6 @@ import java.util.Locale class InterventionWebActivity() : BaseVMBActivity(R.layout.activity_intervention_web) { - var mApi = getInterventionRetrofit().create(InterventionNetApi::class.java) private var isShowLoading = false @@ -62,6 +60,8 @@ class InterventionWebActivity() : var mUserId = DataStoreManager.getUserId().toString() // mUserId = "09fd6195cd4c4f1fb457f34678fa0011" var path = intent.getStringExtra("path") + val titleText = getTitleText(path) + mBinding.toolbarLay.title = titleText if (mToken.isNullOrEmpty()) { mToken = DataStoreManager.getToken() } @@ -82,6 +82,9 @@ class InterventionWebActivity() : localAdress = "${localAdress}p=$path&r=${url}&t=${mToken}&id=${mUserId}" var date = intent.getStringExtra("date") + if (TextUtils.isEmpty(date)) { + date = DateUtil.nowStringDateShort + } when (path) { "weekly" -> { mBinding.weeklyLayout.visibility = View.VISIBLE @@ -108,6 +111,19 @@ class InterventionWebActivity() : mBinding.webView.loadUrl("$localAdress&d=${date}&h=${urlType}") } + private fun getTitleText(path: String?): String { + return when (path) { + "heartRate" -> "心率" + "oxygenSaturation" -> "血氧饱和度" + "pressure" -> "压力" + "temperature" -> "体温" + "stepNumber" -> "步数" + "sleep" -> "睡眠" + else -> "健康监测" + } + + } + override fun bindEvent() { mBinding.let { addClickViews( diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/SelectLocationActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/SelectLocationActivity.kt new file mode 100644 index 0000000..9039b69 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/SelectLocationActivity.kt @@ -0,0 +1,153 @@ +package com.xjjk.healthyclients.ui.activity + +import android.Manifest +import android.content.Intent +import android.graphics.BitmapFactory +import android.os.Bundle +import android.provider.SyncStateContract +import android.view.View +import com.amap.api.location.AMapLocationClient +import com.amap.api.maps.AMap +import com.amap.api.maps.CameraUpdateFactory +import com.amap.api.maps.model.BitmapDescriptorFactory +import com.amap.api.maps.model.CameraPosition +import com.amap.api.maps.model.LatLng +import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.MyLocationStyle +import com.google.gson.Gson +import com.permissionx.guolindev.PermissionX +import com.tencent.qcloud.tuicore.util.ToastUtil +import com.tencent.qcloud.tuikit.tuichat.bean.message.LocationMessageBean +import com.tencent.qcloud.tuikit.tuichat.classicui.setting.ChatLayoutSetting +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.base.viewmodel.TestViewModel +import com.xjjk.healthyclients.databinding.ActivitySelectLocationBinding +import com.xjjk.healthyclients.superfuntion.toJson +import org.greenrobot.eventbus.EventBus + + +/** + * @author nanfeifei + * @time 2023/7/4 10:38 + * @description 选择位置(IM发送位置使用) + */ +class SelectLocationActivity : BaseVMBActivity( + R.layout.activity_select_location) { + //初始化地图控制器对象 + var aMap: AMap? = null + var mCurrentLat: Double = 0.0 + var mCurrentLon: Double = 0.0 + var mPermissionList= arrayListOf( + Manifest.permission.ACCESS_COARSE_LOCATION, + Manifest.permission.ACCESS_FINE_LOCATION) + + override fun onSaveInstanceState(outState: Bundle) { + super.onSaveInstanceState(outState) + mBinding.mapView.onSaveInstanceState(outState) + + } + + override fun onCreate(savedInstanceState: Bundle?) { + AMapLocationClient.updatePrivacyShow(this@SelectLocationActivity, true, true) + AMapLocationClient.updatePrivacyAgree(this@SelectLocationActivity, true) + super.onCreate(savedInstanceState) + } + override fun initView(savedInstanceState: Bundle?) { + mBinding.apply { + mapView.onCreate(savedInstanceState) + if (aMap == null) { + aMap = mapView.map + } + PermissionX.init(this@SelectLocationActivity) + .permissions(mPermissionList) + .request { allGranted, grantedList, deniedList -> + if (allGranted){ + setUpMap() + } + } + } + } + + override fun initData() { + + } + private fun setUpMap() { + // 自定义系统定位小蓝点 + val myLocationStyle = MyLocationStyle() + // 设置小蓝点的图 + myLocationStyle.myLocationIcon( + BitmapDescriptorFactory + .fromResource(R.mipmap.ic_my_location) + ) + myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_SHOW) + mBinding.apply { + aMap?.myLocationStyle = myLocationStyle + aMap?.moveCamera(CameraUpdateFactory.zoomTo(13F)) + aMap?.uiSettings?.isMyLocationButtonEnabled = true // 设置默认定位按钮是否显示 + aMap?.uiSettings?.isRotateGesturesEnabled = false + aMap?.uiSettings?.isTiltGesturesEnabled = false + aMap?.isMyLocationEnabled = true // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false + aMap?.setOnMyLocationChangeListener { + mCurrentLat = it.latitude + mCurrentLon = it.longitude + val markerOption = MarkerOptions() + markerOption.position(LatLng(mCurrentLat, mCurrentLon)) + aMap?.moveCamera(CameraUpdateFactory.newLatLng(LatLng(mCurrentLat, mCurrentLon))) + markerOption.icon( + BitmapDescriptorFactory.fromBitmap( + BitmapFactory + .decodeResource(resources, R.drawable.ic_select_location) + ) + ) + markerOption.isFlat = true + var marker = aMap?.addMarker(markerOption) + aMap?.setOnCameraChangeListener(object : AMap.OnCameraChangeListener { + override fun onCameraChange(cameraPosition: CameraPosition?) { + if (cameraPosition != null) { + marker?.position = cameraPosition.target + mCurrentLat = cameraPosition.target.latitude + mCurrentLon = cameraPosition.target.longitude + } + } + + override fun onCameraChangeFinish(p0: CameraPosition?) { + + } + }) + } + } + + } + override fun onResume() { + super.onResume() + mBinding.mapView.onResume() + } + + override fun onPause() { + super.onPause() + mBinding.mapView.onPause() + } + + override fun onDestroy() { + super.onDestroy() + mBinding.mapView.onDestroy() + } + override fun bindEvent() { + addClickViews(mBinding.toolbarLay.titleTvRight) + } + + override fun processClick(paramView: View?) { + when (paramView?.id) { + R.id.title_tv_right -> { + var intent = Intent() + var locationMessageBean = LocationMessageBean() + locationMessageBean.longitude = mCurrentLon + locationMessageBean.latitude = mCurrentLat + intent.putExtra(ChatLayoutSetting.KEY_CUSTOM_MESSAGE, locationMessageBean.toJson()) + setResult(ChatLayoutSetting.RESULT_CODE_LOCATION, intent) + finish() + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/UserSoSContactsActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/UserSoSContactsActivity.kt new file mode 100644 index 0000000..5cce1b9 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/UserSoSContactsActivity.kt @@ -0,0 +1,103 @@ +package com.xjjk.healthyclients.ui.activity + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter +import com.xjjk.healthyclients.adapter.user.UserContactsAdapter +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean +import com.xjjk.healthyclients.databinding.ActivityUserSosContactsBinding +import com.xjjk.healthyclients.superfuntion.startEmergencyContactActivity +import com.xjjk.healthyclients.ui.viewmodel.UserInfoSettingViewModel +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch + +/** + * 紧急联系人 + */ +class UserSoSContactsActivity : + BaseVMBActivity(R.layout.activity_user_sos_contacts), + MultiItemTypeAdapter.OnItemClickListener { + + var mUserContactsAdapter: UserContactsAdapter?=null + var mContactsList= arrayListOf() + + override fun initView(savedInstanceState: Bundle?) { + mBinding?.apply { + try { + mUserContactsAdapter= UserContactsAdapter(mContext, + R.layout.item_user_contacts,mContactsList) + var manager= LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL,false) + userInfoContactsRv.layoutManager=manager + mUserContactsAdapter?.setOnItemClickListener(this@UserSoSContactsActivity) + userInfoContactsRv.adapter=mUserContactsAdapter + + } catch (e: Exception) { + } + } + + + } + + override fun transparentStatusBar(): Boolean { + return false + } + + override fun initData() { + + + + + } + + override fun onResume() { + super.onResume() + mViewModel.selectEmergencyContactList() + } + + override fun createObserve() { + super.createObserve() + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.bean.collectLatest { + mContactsList.clear() + mContactsList.addAll(it) + mUserContactsAdapter?.notifyDataSetChanged() + } + } + } + } + + override fun bindEvent() { + mBinding?.apply { + addClickViews(toolbarLay.titleTvRight) + } + + } + + override fun processClick(paramView: View?) { + when (paramView?.id) { + R.id.title_tv_right -> { + mContext?.let { startEmergencyContactActivity(it,null) } + } + } + } + + override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { + mContext?.let { startEmergencyContactActivity(it,mContactsList[position]) } + } + + override fun onItemLongClick( + view: View?, + holder: RecyclerView.ViewHolder?, + position: Int + ): Boolean { + return false + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/AddBigDiseaseActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/AddBigDiseaseActivity.kt deleted file mode 100644 index eae6e79..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/AddBigDiseaseActivity.kt +++ /dev/null @@ -1,234 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.emergency - -import android.os.Bundle -import android.view.View -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.repeatOnLifecycle -import com.github.gzuliyujiang.wheelpicker.DatePicker -import com.github.gzuliyujiang.wheelpicker.OptionPicker -import com.github.gzuliyujiang.wheelpicker.TimePicker -import com.github.gzuliyujiang.wheelpicker.annotation.DateMode -import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode -import com.github.gzuliyujiang.wheelpicker.entity.DateEntity -import com.sw.healthyclients.data.local.DataStoreManager -import com.sw.healthyclients.utils.DateUtil -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.base.BaseVMBActivity -import com.xjjk.healthyclients.bean.CommonSettingMenuBean -import com.xjjk.healthyclients.bean.emergency.AddBigDiseaseSubmitBean -import com.xjjk.healthyclients.bean.emergency.HospitalBean -import com.xjjk.healthyclients.databinding.ActivityBigAddDiseaseBinding -import com.xjjk.healthyclients.ui.viewmodel.AddBigDiseaseViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch - -/** - * 大病就医 - */ -class AddBigDiseaseActivity : BaseVMBActivity(R.layout.activity_big_add_disease){ - val hospitalPicker: OptionPicker by lazy { OptionPicker(this) } - val registerTypePicker: OptionPicker by lazy { OptionPicker(this) } - val timePicker: DatePicker by lazy { DatePicker(this) } - val timePicker2: TimePicker by lazy { TimePicker(this) } - lateinit var currentDate: DateEntity - var mHospitalList= arrayListOf() - var mRegisterType= arrayListOf() - var mbean= AddBigDiseaseSubmitBean() - - - override fun initView(savedInstanceState: Bundle?) { - mBinding?.apply { - addDiseaseTime.text="${DateUtil.nowYear}-${DateUtil.nowMonth}-${DateUtil.nowDay}" - addDiseaseTime2.text="${DateUtil.nowHour}:${DateUtil.nowMinute}" - } - - } - - override fun initData() { - var defaultDate = DateEntity.yearOnFuture(0) - var name= DataStoreManager.getUserInfo().realname - if (name.isNullOrEmpty()) { - name= DataStoreManager.getUserInfo().username.toString() - } - mBinding?.addDiseaseName?.text=name - currentDate = DateEntity.target(defaultDate.year, defaultDate.month, defaultDate.day) - mViewModel.selectStationHospitalList() - mViewModel.getCommonSettingMenuList() - } - - override fun createObserve() { - super.createObserve() - mBinding?.apply { - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.messageList.collectLatest {list -> - mHospitalList.clear() - mHospitalList.addAll(list) - hospitalPicker.setData(mHospitalList) - } - } - } - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.registerType.collectLatest {list -> - mRegisterType.clear() - mRegisterType.addAll(list) - registerTypePicker.setData(mRegisterType) - } - } - } - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.isSubmit.collectLatest {isClose -> - if (isClose){ - finish() - } - } - } - } - } - - } - - - - - override fun bindEvent() { - mBinding?.apply { - addClickViews(addDiseaseSelectHospital,addDiseaseTime,addDiseaseRegisterType,bigDiseaseSubmit,addDiseaseTime2) - } - } - - override fun processClick(paramView: View?) { - when (paramView?.id) { - R.id.add_disease_select_hospital -> { - showHospitalPicker() - } - R.id.add_disease_time -> { - showDatePicker() - } - R.id.add_disease_time_2 -> { - showDatePicker2() - } - R.id.add_disease_register_type -> { - showRegisterTypePicker() - } - R.id.big_disease_submit -> { - mBinding?.apply { - if(addDiseaseSelectHospital.text.toString().trim().isEmpty()){ - showToast("请选择医院") - return - } - if(addDiseaseRegisterType.text.toString().trim().isEmpty()){ - showToast("请选择挂号类型") - return - } - if(addDiseaseTime.text.toString().trim().isEmpty()){ - showToast("请选择预约时间") - return - } - var time=addDiseaseTime.text.toString()+" "+addDiseaseTime2.text.toString() - var date= DateUtil.strToDateLong2(time) - mbean.desireTime = date.time - mbean.hospitalName=addDiseaseSelectHospital.text.toString().trim() - mbean.medicalCardNo=addDiseaseRegisterIdCard.text.toString().trim() - mbean.reservationOffice=addDiseaseDeparment.text.toString().trim() - mbean.reservationDoctor=addDiseaseDoctorName.text.toString().trim() - mbean.diseaseDescribe=addDiseaseSick.text.toString().trim() - mViewModel.appointmentSeeDoctor(mbean) - } - - } - } - } - - private fun showDatePicker() { - timePicker.setBackgroundResource(R.drawable.rectangle_top_round_corner20_white) - timePicker.setTitle("选择预约时间") -// (picker.headerView as TextView).gravity = Gravity.START - var wheelLayout = timePicker.wheelLayout - wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY) - wheelLayout.setRange(DateEntity.target(currentDate.year, 1, 1), DateEntity.target(currentDate.year+10, 1, 1), currentDate) - wheelLayout.setResetWhenLinkage(false) - timePicker.setOnDatePickedListener { year, month, day -> - setBirthDay(year, month, day) - } - timePicker.show() - } - private fun showDatePicker2() { - timePicker2.setBackgroundResource(R.drawable.rectangle_top_round_corner20_white) - timePicker2.setTitle("选择预约时间") -// (picker.headerView as TextView).gravity = Gravity.START - var wheelLayout = timePicker2.wheelLayout - wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND) - wheelLayout.setResetWhenLinkage(false) - timePicker2.setOnTimePickedListener { hour, minute, day -> - mBinding?.apply { - var m="$minute" - if(minute<10){ - m="0$minute" - } - addDiseaseTime2.text="${hour}:${m}" - } -// setBirthDay(year, month, day) - } - timePicker2.show() - } - - private fun setBirthDay(year: Int, month: Int, day: Int) { - currentDate = DateEntity.target(year, month, day) - mBinding.addDiseaseTime.text = currentDate.toString() - mBinding.addDiseaseTime.setTextColor(mContext!!.resources.getColor(R.color.text_black_33)) - } - - private fun showHospitalPicker() { - if(mHospitalList.size==0){ - showToast("暂无可选择医院数据") - return - } - hospitalPicker.setBackgroundResource(R.drawable.rectangle_top_round_corner20_white) - hospitalPicker.setTitle("选择预约医院") - hospitalPicker.setDefaultPosition(0) - hospitalPicker.wheelView.setFormatter { value -> - (value as HospitalBean).name - } - hospitalPicker.setOnOptionPickedListener { position, item -> - setHospitalText(item as HospitalBean) - - } - hospitalPicker.show() - } - private fun setHospitalText(commonSettingMenuBean: HospitalBean) { - mBinding.addDiseaseSelectHospital.text = commonSettingMenuBean.name - mBinding.addDiseaseSelectHospital.setTextColor(mContext!!.resources.getColor(R.color.text_black_33)) - mbean.hospitalId = commonSettingMenuBean.id.toString() - } - - private fun showRegisterTypePicker() { - if (mRegisterType.size==0){ - showToast("暂无可选择挂号类型数据") - return - } - registerTypePicker.setBackgroundResource(R.drawable.rectangle_top_round_corner20_white) - registerTypePicker.setTitle("选择挂号类型") - registerTypePicker.setDefaultPosition(0) - registerTypePicker.wheelView.setFormatter { value -> - (value as CommonSettingMenuBean).text - } - registerTypePicker.setOnOptionPickedListener { position, item -> - setRelationText(item as CommonSettingMenuBean) - - } - registerTypePicker.show() - } - private fun setRelationText(commonSettingMenuBean: CommonSettingMenuBean) { - mBinding.addDiseaseRegisterType.text = commonSettingMenuBean.text - mBinding.addDiseaseRegisterType.setTextColor(mContext!!.resources.getColor(R.color.text_black_33)) - mbean.registerCategory = commonSettingMenuBean.value - } - - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/EmergencySeekDoctorDetailsActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/EmergencySeekDoctorDetailsActivity.kt index 123412e..757dd1b 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/EmergencySeekDoctorDetailsActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/emergency/EmergencySeekDoctorDetailsActivity.kt @@ -11,7 +11,6 @@ import com.xjjk.healthyclients.R import com.xjjk.healthyclients.base.BaseVMBActivity import com.xjjk.healthyclients.bean.emergency.GetOrderBySessionIdBean import com.xjjk.healthyclients.databinding.ActivityEmergencySeekDoctorDetailsBinding -import com.xjjk.healthyclients.superfuntion.startAddBigDiseaseActivity import com.xjjk.healthyclients.superfuntion.toHtml import com.xjjk.healthyclients.ui.activity.emergency.adapter.EmergencySeekDoctorDetailsAdapter import com.xjjk.healthyclients.ui.viewmodel.EmergencySeekDoctorDetailsViewModel @@ -164,9 +163,9 @@ class EmergencySeekDoctorDetailsActivity : BaseVMBActivity { switchMenu(1) } - R.id.big_disease_add -> { - mContext?.let { startAddBigDiseaseActivity(it) } - } +// R.id.big_disease_add -> { +// mContext?.let { startAddBigDiseaseActivity(it) } +// } else -> {} } } diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AllDoctorActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AllDoctorActivity.kt new file mode 100644 index 0000000..138ac2b --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AllDoctorActivity.kt @@ -0,0 +1,73 @@ +package com.xjjk.healthyclients.ui.activity.guidance + +import android.os.Bundle +import android.view.View +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.databinding.ActivityAllDoctorInfoBinding +import com.xjjk.healthyclients.superfuntion.loadCircle +import com.xjjk.healthyclients.ui.viewmodel.MainViewModel +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch + +/** + * 全科医生信息 + */ +class AllDoctorActivity : + BaseVMBActivity(R.layout.activity_all_doctor_info){ + + override fun initView(savedInstanceState: Bundle?) { + mBinding?.apply { + } + + + } + + override fun transparentStatusBar(): Boolean { + return false + } + + override fun initData() { + var id=intent.getStringExtra("id") + if (id != null) { + mViewModel.selectHelperInfoDesc(id) + } + + } + + override fun onResume() { + super.onResume() + } + + override fun createObserve() { + super.createObserve() + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.doctorInfo.collectLatest { bean -> + if (bean==null) { + return@collectLatest + } + mBinding?.apply { + ivIcon.loadCircle(bean.faceUrl) + tvName.text=bean.userName + tvDesc.text=bean.memo + } + } + } + } + } + + override fun bindEvent() { + mBinding?.apply { + } + + } + + override fun processClick(paramView: View?) { + when (paramView?.id) { + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AppointmentDetailActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AppointmentDetailActivity.kt index 67032e9..ae1f7d0 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AppointmentDetailActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/AppointmentDetailActivity.kt @@ -59,7 +59,7 @@ class AppointmentDetailActivity : lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.CREATED) { mViewModel.followStatus.collectLatest { - mBinding.llAppointmentInformation.getFollowView().isSelected = it +// mBinding.llAppointmentInformation.getFollowView().isSelected = it } } } @@ -90,7 +90,7 @@ class AppointmentDetailActivity : addClickViews( mBinding.btnCancel, mBinding.btnAppraise, - mBinding.llAppointmentInformation.getFollowView(), +// mBinding.llAppointmentInformation.getFollowView(), mBinding.llAppointmentInformation.mBinding.tvArchivesDetail ) mBinding.llAppointmentInformation.mBinding.stvPhysicalExaminationReportInfo.setRightTvClickListener { @@ -107,14 +107,15 @@ class AppointmentDetailActivity : override fun onBackEvent() { super.onBackEvent() if (!isGuidance) { - if (CustomActivityManager.getInstance().isActivityExist(DoctorsGuidanceActivity::class.java)) { - CustomActivityManager.getInstance().finishActivityTohome(DoctorsGuidanceActivity::class.java) - }else if (CustomActivityManager.getInstance().isActivityExist(DoctorHomepageActivity::class.java)) { +// if (CustomActivityManager.getInstance().isActivityExist(DoctorsGuidanceActivity::class.java)) { +// CustomActivityManager.getInstance().finishActivityTohome(DoctorsGuidanceActivity::class.java) +// }else + if (CustomActivityManager.getInstance().isActivityExist(DoctorHomepageActivity::class.java)) { CustomActivityManager.getInstance().finishActivityTohome(DoctorHomepageActivity::class.java) - }else if (CustomActivityManager.getInstance().isActivityExist(FilterSearchDoctorActivity::class.java)){ - CustomActivityManager.getInstance().finishActivityTohome(FilterSearchDoctorActivity::class.java) - }else if (CustomActivityManager.getInstance().isActivityExist(SeekDoctorSearchActivity::class.java)){ - CustomActivityManager.getInstance().finishActivityTohome(SeekDoctorSearchActivity::class.java) +// }else if (CustomActivityManager.getInstance().isActivityExist(FilterSearchDoctorActivity::class.java)){ +// CustomActivityManager.getInstance().finishActivityTohome(FilterSearchDoctorActivity::class.java) +// }else if (CustomActivityManager.getInstance().isActivityExist(SeekDoctorSearchActivity::class.java)){ +// CustomActivityManager.getInstance().finishActivityTohome(SeekDoctorSearchActivity::class.java) } } } diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorHomepageActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorHomepageActivity.kt index 91957b7..ed3fc2f 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorHomepageActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorHomepageActivity.kt @@ -100,36 +100,33 @@ class DoctorHomepageActivity : } } } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED) { - mViewModel.followStatus.collectLatest { - mBinding.viewDoctorBaseInfo.getFollowView().isSelected = it - } - } - } +// lifecycleScope.launch { +// repeatOnLifecycle(Lifecycle.State.CREATED) { +// mViewModel.followStatus.collectLatest { +// mBinding.viewDoctorBaseInfo.getFollowView().isSelected = it +// } +// } +// } lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.CREATED){ mViewModel.noticeBean.collectLatest {bean -> - if (bean!=null) { - if (bean.isRead==1) { - if (mType=="1") { - startSelectConsultantActivity( - this@DoctorHomepageActivity, - ConstantUtils.ConsultType.IMAGE_TEXT_CONSULT, - doctorId - ) - }else if (mType=="0"){ - startSelectAppointmentTimeActivity(this@DoctorHomepageActivity, doctorId) - } - }else if (bean.isRead==2){ - if (mType=="1") { - doctorId?.let { startGuidanceNoticeActivity(this@DoctorHomepageActivity, it,"1") } - }else if (mType=="0"){ - doctorId?.let { startGuidanceNoticeActivity(this@DoctorHomepageActivity, it,"0") } - } + if (bean.isRead==1) { + if (mType=="1") { + startSelectConsultantActivity( + this@DoctorHomepageActivity, + ConstantUtils.ConsultType.IMAGE_TEXT_CONSULT, + doctorId + ) + }else if (mType=="0"){ + startSelectAppointmentTimeActivity(this@DoctorHomepageActivity, doctorId) + } + }else if (bean.isRead==2){ + if (mType=="1") { + doctorId?.let { startGuidanceNoticeActivity(this@DoctorHomepageActivity, it,"1") } + }else if (mType=="0"){ + doctorId?.let { startGuidanceNoticeActivity(this@DoctorHomepageActivity, it,"0") } } - } } } @@ -146,7 +143,7 @@ class DoctorHomepageActivity : addClickViews( mBinding.btnImageTextConsult, mBinding.btnAudioVideoConsult, - mBinding.viewDoctorBaseInfo.getFollowView(), +// mBinding.viewDoctorBaseInfo.getFollowView(), mBinding.tvMoreAppraise ) } @@ -170,9 +167,9 @@ class DoctorHomepageActivity : } } - R.id.btn_follow -> { - mViewModel.followDoctor(doctorId) - } +// R.id.btn_follow -> { +// mViewModel.followDoctor(doctorId) +// } R.id.tv_more_appraise -> { startDoctorAllAppraiseActivity(this, doctorId) @@ -180,13 +177,13 @@ class DoctorHomepageActivity : } } - @Subscribe(threadMode = ThreadMode.MAIN) - open fun onMessageEvent(event: FollowDoctorEvent) { - if (event == null) { - return - } - lifecycleScope.launch { - mViewModel.followStatus.emit(event.followStatus) - } - } +// @Subscribe(threadMode = ThreadMode.MAIN) +// open fun onMessageEvent(event: FollowDoctorEvent) { +// if (event == null) { +// return +// } +// lifecycleScope.launch { +// mViewModel.followStatus.emit(event.followStatus) +// } +// } } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorsGuidanceActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorsGuidanceActivity.kt deleted file mode 100644 index 7a3fefa..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/DoctorsGuidanceActivity.kt +++ /dev/null @@ -1,122 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance - -import android.app.ProgressDialog -import android.os.Bundle -import android.view.View -import android.view.Window -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.repeatOnLifecycle -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.sw.healthyclients.view.LoadingDialog -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter -import com.xjjk.healthyclients.base.BaseVMBActivity -import com.xjjk.healthyclients.bean.guidance.DoctorChildBean -import com.xjjk.healthyclients.bean.guidance.selectDictListByNHDSRequestBean -import com.xjjk.healthyclients.databinding.ActivityDoctorsGuidanceBinding -import com.xjjk.healthyclients.superfuntion.startDoctorHomepageActivity -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorDoctorAdapter -import com.xjjk.healthyclients.ui.viewmodel.DoctorsGuidanceViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch - -/** - * 专家库咨询 - */ -class DoctorsGuidanceActivity : - BaseVMBActivity(R.layout.activity_doctors_guidance){ - private var mDoctorList=arrayListOf() //医生列表 - private var mSeekDoctorDoctorAdapter: SeekDoctorDoctorAdapter?=null - - //科室数据 - - var mOfficeIds = arrayListOf() - var mSicksIds = arrayListOf() - var mDialog:LoadingDialog?=null - var mBean= selectDictListByNHDSRequestBean() - override fun initView(savedInstanceState: Bundle?) { - mBinding?.apply { - mSeekDoctorDoctorAdapter= SeekDoctorDoctorAdapter(mContext!!, - R.layout.item_recycle_seek_doctor_doctor_child,mDoctorList) - val doctorLayoutManager = LinearLayoutManager(this@DoctorsGuidanceActivity) - mFilterContentView.layoutManager = doctorLayoutManager - mFilterContentView.adapter = mSeekDoctorDoctorAdapter - } - - - } - - override fun transparentStatusBar(): Boolean { - return false - } - - override fun initData() { - var intents=intent - var office=intents.getStringArrayListExtra("officeIds") - if (office!=null) { - mOfficeIds.addAll(office) - } - var sick= intents.getStringArrayListExtra("sicksIds") - if (sick!=null) { - mSicksIds.addAll(sick) - } - mViewModel.selectDictListBySickAndDepartment(mOfficeIds,mSicksIds) - - } - - override fun createObserve() { - super.createObserve() - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDoctorSoure.collectLatest {list -> - mDoctorList.clear() - mDoctorList.addAll(list) - if(mDoctorList.size>0){ - mBinding?.includeEmpty?.visibility=View.GONE - } - mSeekDoctorDoctorAdapter?.notifyDataSetChanged() - } - } - } - - } - - override fun bindEvent() { - - mSeekDoctorDoctorAdapter?.setOnItemClickListener(object : - MultiItemTypeAdapter.OnItemClickListener { - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { startDoctorHomepageActivity(it,mDoctorList[position].id) } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - } - - override fun processClick(paramView: View?) { - when (paramView?.id) { - } - } - - - fun createDialog2() { - mDialog = LoadingDialog( - mContext, - ProgressDialog.STYLE_SPINNER, "数据加载中" - ) - mDialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE) - mDialog!!.setCanceledOnTouchOutside(false) - mDialog!!.setCancelable(false) - mDialog!!.setMessage("请稍后...") - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/FilterSearchDoctorActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/FilterSearchDoctorActivity.kt deleted file mode 100644 index 15e25a4..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/FilterSearchDoctorActivity.kt +++ /dev/null @@ -1,333 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance - -import android.app.ProgressDialog -import android.os.Bundle -import android.view.View -import android.view.Window -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.repeatOnLifecycle -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.sw.healthyclients.view.LoadingDialog -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter -import com.xjjk.healthyclients.base.BaseVMBActivity -import com.xjjk.healthyclients.bean.guidance.DepartListBean -import com.xjjk.healthyclients.bean.guidance.DoctorChildBean -import com.xjjk.healthyclients.bean.guidance.FilterSearchBean -import com.xjjk.healthyclients.bean.guidance.SickListBean -import com.xjjk.healthyclients.bean.guidance.selectDictListByNHDSRequestBean -import com.xjjk.healthyclients.databinding.ActivityFilterSearchDoctorBinding -import com.xjjk.healthyclients.superfuntion.startDoctorHomepageActivity -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorDoctorAdapter -import com.xjjk.healthyclients.ui.viewmodel.FilterSearchDoctorViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch - -/** - * 带筛选的找专家 - */ -class FilterSearchDoctorActivity : - BaseVMBActivity(R.layout.activity_filter_search_doctor){ - private var mDoctorList=arrayListOf() //医生列表 - private var mHospitalList=arrayListOf() //医院 - private var mDepartList=arrayListOf() //科室 - private var mSickList=arrayListOf() //疾病 - private var mSeekDoctorDoctorAdapter: SeekDoctorDoctorAdapter?=null - - //科室数据 - private var mDepartmentListLeft=arrayListOf() //科室列表 - private var mSickListLeft=arrayListOf() //科室列表 - private var mDepartmentListRight=arrayListOf() //科室列表 - private var mSickListRight=arrayListOf() //科室列表 - - var Re_hospitalId="" - var Re_search="" - var Re_hospitalName="" - var Re_departId="" - var Re_departName="" - var Re_sickId="" - var Re_sickName="" - var mDialog: LoadingDialog?=null - var mBean= selectDictListByNHDSRequestBean() - override fun initView(savedInstanceState: Bundle?) { -// initFilterDropDownView() - mBinding?.apply { - mSeekDoctorDoctorAdapter= SeekDoctorDoctorAdapter(mContext!!, - R.layout.item_recycle_seek_doctor_doctor_child,mDoctorList) - val doctorLayoutManager = LinearLayoutManager(this@FilterSearchDoctorActivity) - mFilterContentView.layoutManager = doctorLayoutManager - mFilterContentView.adapter = mSeekDoctorDoctorAdapter - } - - - } - - override fun transparentStatusBar(): Boolean { - return false - } - - override fun initData() { - var intents=intent - Re_search=intents.getStringExtra("search").toString() - Re_hospitalId= intents.getStringExtra("hospitalId").toString() - Re_hospitalName=intents.getStringExtra("hospitalName").toString() - Re_departId=intents.getStringExtra("departId").toString() - Re_departName=intents.getStringExtra("departName").toString() - Re_sickId=intents.getStringExtra("sickId").toString() - Re_sickName=intents.getStringExtra("sickName").toString() - mBinding.seekDoctorSearch.initEtContext(Re_search) - refreshState() - - lifecycleScope.launch { - if (Re_hospitalName.isNotEmpty()) { - mViewModel.titleText.emit(Re_hospitalName) - }else{ - mViewModel.titleText.emit("找专家") - } - } - - //科室左侧数据 - mViewModel.selectDepartListByHospitalId(Re_hospitalId,"0") - - //疾病左侧数据 - mViewModel.selectDepartListSick("0") - mViewModel.selectSickListByDepartmentId("0") - - } - - override fun createObserve() { - super.createObserve() - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDepartmentSoure.collectLatest {list -> - mDepartList.clear() - mDepartList.addAll(list) - mBinding.dropDownMenu.setDepartData(mDepartList) - } - } - } - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mHospitalSoure.collectLatest {list -> - mHospitalList.clear() - mHospitalList.addAll(list) - mBinding.dropDownMenu.setHospitalData(mHospitalList) - } - } - } - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDiseaseSoure.collectLatest {list -> - mSickList.clear() - mSickList.addAll(list) - mBinding.dropDownMenu.setSickData(mSickList) - } - } - } - - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDoctorSoure.collectLatest {list -> - mDoctorList.clear() - mDoctorList.addAll(list) - mSeekDoctorDoctorAdapter?.notifyDataSetChanged() - if (mDoctorList.size==0) { - showEmptys() - }else{ - hindEmptys() - } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mCloseDialog.collectLatest {isClose -> - if (isClose) { - mDialog?.dismiss() - } - } - } - } - - //科室左侧数据 - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mLeftSoure.collectLatest { - mDepartmentListLeft.clear() - mDepartmentListLeft.addAll(it) - if(mDepartmentListLeft.size>0){ - mDepartmentListLeft[0].isSelect=true -// mViewModel.selectDepartList(mDepartmentListLeft[0].id) - mViewModel.selectDepartListByHospitalId(Re_hospitalId,mDepartmentListLeft[0].id) - mBinding.dropDownMenu.setLeftData(mDepartmentListLeft) - } - - } - } - } - //科室右侧数据 - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mRightSoure.collectLatest { - mDepartmentListRight.clear() - mDepartmentListRight.addAll(it) - mBinding.dropDownMenu.setDepartRightData(mDepartmentListRight) - } - } - } - //疾病左侧数据 - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mLeftSickSoure.collectLatest { - mSickListLeft.clear() - mSickListLeft.addAll(it) - if(mSickListLeft.size>0){ - mSickListLeft[0].isSelect=true - } - mBinding.dropDownMenu.setSickLeftData(mSickListLeft) - } - } - } - //疾病右侧数据 - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mRightSickSoure.collectLatest { - mSickListRight.clear() - mSickListRight.addAll(it) - mBinding.dropDownMenu.setSickRightData(mSickListRight) - } - } - } - } - - override fun bindEvent() { - mBinding.dropDownMenu.setFilterListener { - //二级筛选条件 - if (it.tfSort.isNotEmpty()) { - mBean.tfSort= it.tfSort - } - if (it.hospitalId.isNotEmpty()) { - mBean.hospitalId= it.hospitalId - } - if (it.isSelectHospital) { - mBean.hospitalId="" - } - - mBean.departmentId= it.departmentId - mBean.sickId= it.sickId - if(Re_hospitalId!=mBean.hospitalId){ - Re_hospitalId=mBean.hospitalId - mBean.departmentId="" - mBean.sickId="" - mBinding.dropDownMenu.setDepartResettingText("全部科室") - mBinding.dropDownMenu.setSickResettingText("全部疾病") - }else{ - Re_hospitalId=mBean.hospitalId - } - if(Re_departId!= it.departmentId){ - Re_departId= it.departmentId - mBean.sickId="" - mBinding.dropDownMenu.setSickResettingText("全部疾病") - }else{ - Re_departId= it.departmentId - } - mViewModel.selectDepartListByHospitalId(Re_hospitalId,"0") - - - mBean.doctorName= mBinding.seekDoctorSearch.getInoputText() - mViewModel.selectDictListByNHDS(mBean) - } - - mBinding.seekDoctorSearch.setOnCustomClickListener { - mBean.doctorName=mBinding.seekDoctorSearch.getInoputText() - mViewModel.selectDictListByNHDS(mBean) - } - - mBinding.dropDownMenu.setDoubleListListener { type, id -> - // type 0 科室 1疾病 - when(type){ - 0 -> { -// mViewModel.selectDepartList(id) - mViewModel.selectDepartListByHospitalId(Re_hospitalId,id) - } - 1 -> { - mViewModel.selectSickListByDepartmentId(id) - } - } - } - - mSeekDoctorDoctorAdapter?.setOnItemClickListener(object : - MultiItemTypeAdapter.OnItemClickListener { - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { startDoctorHomepageActivity(it,mDoctorList[position].id) } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - } - - override fun processClick(paramView: View?) { - when (paramView?.id) { - } - } - - fun showEmptys(){ - mBinding?.tvEmpty?.visibility=View.VISIBLE - } - fun hindEmptys(){ - mBinding?.tvEmpty?.visibility=View.GONE - } - - fun refreshState(){ - if (Re_hospitalId.isNotEmpty()&&Re_hospitalName.isNotEmpty()){ - //从医院详情页点击全部科室 - mBinding.dropDownMenu.hideHospitalFilter() - }else if (Re_departId.isNotEmpty()&&Re_departName.isNotEmpty()){ - //点击科室进来的 - if (Re_departName.contains("全部")) { - Re_departId="" - }else{ - mBinding.dropDownMenu.setDepartText(Re_departName,Re_departId) - } - }else if (Re_sickId.isNotEmpty()&&Re_sickName.isNotEmpty()){ - //点击疾病进来的 - if (Re_sickName.contains("全部")) { - Re_sickId="" - }else{ - mBinding.dropDownMenu.setSickText(Re_sickName,Re_sickId) - } - } - createDialog2() - mDialog?.show() - mBean.doctorName= mBinding.seekDoctorSearch.getInoputText() - mBean.sickId=Re_sickId - mBean.departmentId=Re_departId - mBean.hospitalId=Re_hospitalId - mBinding.dropDownMenu.setDataBean(mBean) - mViewModel.selectDictListByNHDS(mBean) - - mSeekDoctorDoctorAdapter?.notifyDataSetChanged() - } - - fun createDialog2() { - mDialog = LoadingDialog( - mContext, - ProgressDialog.STYLE_SPINNER, "数据加载中" - ) - mDialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE) - mDialog!!.setCanceledOnTouchOutside(false) - mDialog!!.setCancelable(false) - mDialog!!.setMessage("请稍后...") - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/IMSelectArchivesActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/IMSelectArchivesActivity.kt new file mode 100644 index 0000000..3240f6e --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/IMSelectArchivesActivity.kt @@ -0,0 +1,81 @@ +package com.xjjk.healthyclients.ui.activity.guidance + +import android.content.Intent +import android.os.Bundle +import android.view.View +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.lifecycleScope +import androidx.lifecycle.repeatOnLifecycle +import androidx.recyclerview.widget.LinearLayoutManager +import com.buddy.kredit.android.view.SpaceItemDecoration +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.listener.OnItemChildClickListener +import com.tencent.qcloud.tuikit.tuichat.classicui.setting.ChatLayoutSetting +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.bean.guidance.ArchivesBean +import com.xjjk.healthyclients.databinding.ActivityImSelectArchivesBinding +import com.xjjk.healthyclients.superfuntion.toJson +import com.xjjk.healthyclients.ui.activity.guidance.adapter.IMSelectArchivesAdapter +import com.xjjk.healthyclients.ui.viewmodel.IMSelectArchivesViewModel +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.launch + +/** + * @author nanfeifei + * @time 2023/7/5 10:32 + * @description IM选择档案 + */ +class IMSelectArchivesActivity : BaseVMBActivity( + R.layout.activity_im_select_archives), OnItemChildClickListener { + var memberId: String? = null + val mAdapter by lazy { IMSelectArchivesAdapter() } + override fun initView(savedInstanceState: Bundle?) { + memberId = intent.extras?.getString("memberId") ?: "" + mBinding.apply { + val linearLayoutManager = LinearLayoutManager(this@IMSelectArchivesActivity) + rvList.layoutManager = linearLayoutManager + rvList.addItemDecoration(SpaceItemDecoration(this@IMSelectArchivesActivity, R.drawable.decoration_item_gray, 1f)) + } + } + + override fun createObserve() { + super.createObserve() + mBinding.apply { + lifecycleScope.launch { + repeatOnLifecycle(Lifecycle.State.CREATED) { + mViewModel.archivesBeanList.collectLatest { list -> + list?.let { + mAdapter.setList(list) + mAdapter.loadMoreModule.loadMoreComplete() + if (rvList.adapter == null) { + mAdapter.setEmptyView(R.layout.layout_empty) + mAdapter.setOnItemChildClickListener(this@IMSelectArchivesActivity) + rvList.adapter = mAdapter + } + } + } + } + } + } + } + override fun initData() { + mViewModel.getArchivesList(memberId) + } + + override fun bindEvent() { + + } + + override fun processClick(paramView: View?) { + + } + + override fun onItemChildClick(adapter: BaseQuickAdapter<*, *>, view: View, position: Int) { + var archivesBean: ArchivesBean = adapter.getItem(position) as ArchivesBean + var intent = Intent() + intent.putExtra(ChatLayoutSetting.KEY_CUSTOM_MESSAGE, archivesBean.toIMArchivesMessageBean().toJson()) + setResult(ChatLayoutSetting.RESULT_CODE_ARCHIVES, intent) + finish() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SeekDoctorSearchActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SeekDoctorSearchActivity.kt deleted file mode 100644 index 77ef00b..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SeekDoctorSearchActivity.kt +++ /dev/null @@ -1,459 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance - -import android.os.Bundle -import android.view.View -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.repeatOnLifecycle -import androidx.recyclerview.widget.GridLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.google.android.flexbox.AlignItems -import com.google.android.flexbox.FlexDirection -import com.google.android.flexbox.FlexWrap -import com.google.android.flexbox.FlexboxLayoutManager -import com.google.android.material.tabs.TabLayout -import com.google.android.material.tabs.TabLayout.OnTabSelectedListener -import com.sw.healthyclients.bean.guidance.DiseaseBean -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter -import com.xjjk.healthyclients.base.BaseVMBActivity -import com.xjjk.healthyclients.bean.guidance.DepartmentchildBean -import com.xjjk.healthyclients.bean.guidance.DoctorChildBean -import com.xjjk.healthyclients.bean.guidance.HospitalchildBean -import com.xjjk.healthyclients.databinding.ActivitySeekDoctorSearchBinding -import com.xjjk.healthyclients.superfuntion.getTab -import com.xjjk.healthyclients.superfuntion.startDoctorHomepageActivity -import com.xjjk.healthyclients.superfuntion.startFilterSearchDoctorActivity -import com.xjjk.healthyclients.superfuntion.switchTabRefresh -import com.xjjk.healthyclients.ui.activity.guidance.adapter.DiseaseAdapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorDepartmentAdapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorDoctorAdapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorHospitalAdapter -import com.xjjk.healthyclients.ui.viewmodel.SeekDoctorSearchActivityViewModel -import kotlinx.coroutines.flow.collectLatest -import kotlinx.coroutines.launch - -/** - * 找专家-搜索页 - */ -class SeekDoctorSearchActivity : BaseVMBActivity(R.layout.activity_seek_doctor_search){ - private var mSeekDoctorHospitalAdapter: SeekDoctorHospitalAdapter?=null - private var mSeekDoctorDoctorAdapter: SeekDoctorDoctorAdapter?=null - private var mSeekDoctorDepartmentAdapter: SeekDoctorDepartmentAdapter?=null - private var mDiseaseAdapter: DiseaseAdapter?=null - private var mDoctorList=arrayListOf() //医生列表 - private var mHospitalList=arrayListOf() //医院列表 - private var mDepartmentList=arrayListOf() //科室列表 - private var mDiseaseList=arrayListOf() //疾病 - private var mPosition=0 //0 综合 1专家 2医院 3疾病 4科室 - override fun initView(savedInstanceState: Bundle?) { - mBinding.apply { - seekDoctorSearch.initView(getString(R.string.search_input_hint)) - //tablayout - seekDoctorSearchTab.addTab(getTab("综合")) - seekDoctorSearchTab.addTab(getTab("专家")) - seekDoctorSearchTab.addTab(getTab("医院")) - seekDoctorSearchTab.addTab(getTab("疾病")) - seekDoctorSearchTab.addTab(getTab("科室")) - //医生 - mSeekDoctorDoctorAdapter= SeekDoctorDoctorAdapter(mContext!!,R.layout.item_recycle_seek_doctor_doctor_child,mDoctorList) - val doctorLayoutManager = LinearLayoutManager(this@SeekDoctorSearchActivity) - seekDoctorDoctorList.layoutManager = doctorLayoutManager - seekDoctorDoctorList.adapter = mSeekDoctorDoctorAdapter - //医院 - mSeekDoctorHospitalAdapter= SeekDoctorHospitalAdapter(mContext!!, - R.layout.item_recycle_seek_doctor_hospital_child,mHospitalList) - val linearLayoutManager = LinearLayoutManager(this@SeekDoctorSearchActivity) - seekDoctorHospitalList.layoutManager = linearLayoutManager - seekDoctorHospitalList.adapter = mSeekDoctorHospitalAdapter - //科室 - mSeekDoctorDepartmentAdapter= SeekDoctorDepartmentAdapter(mContext!!, - R.layout.item_recycle_seek_doctor_department_child,mDepartmentList) - val linearLayoutManager2 = GridLayoutManager(this@SeekDoctorSearchActivity,2,GridLayoutManager.VERTICAL,false) - seekDoctorDepartmentList.layoutManager = linearLayoutManager2 - seekDoctorDepartmentList.adapter = mSeekDoctorDepartmentAdapter - //疾病 - var manager= FlexboxLayoutManager(mContext) - manager.setFlexDirection(FlexDirection.ROW) - //设置是否换行 - manager.setFlexWrap(FlexWrap.WRAP) - manager.setAlignItems(AlignItems.STRETCH) - seekDoctorDiseaseList.layoutManager=manager - mDiseaseAdapter= DiseaseAdapter(mContext, - R.layout.item_recycle_seek_doctor_disease_child,mDiseaseList){} - seekDoctorDiseaseList.adapter=mDiseaseAdapter - - rlDoctor.visibility=View.GONE - rlHospital.visibility=View.GONE - rlDisease.visibility=View.GONE - rlDepartment.visibility=View.GONE - } - } - - override fun initData() { - - var mIntent=intent - var content=mIntent.getStringExtra("search") - mBinding?.apply { - seekDoctorSearch.initEtContext(content) - if (content != null) { - mViewModel.searchComprehensive(content) - } - } - - - } - - override fun createObserve() { - super.createObserve() - mBinding?.apply { - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mHospitalSoure.collectLatest {list -> -// if(list.size==0){ -// mBinding?.seekDoctorHospitalListRoot?.visibility=View.GONE -// }else{ -// mBinding?.seekDoctorHospitalListRoot?.visibility=View.VISIBLE - mHospitalList.clear() - mHospitalList.addAll(list) - mSeekDoctorHospitalAdapter?.notifyDataSetChanged() -// } - - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDepartmentSoure.collectLatest {list -> -// if(list.size==0){ -// mBinding?.seekDoctorDepartmentListRoot?.visibility=View.GONE -// }else{ -// mBinding?.seekDoctorDepartmentListRoot?.visibility=View.VISIBLE - mDepartmentList.clear() - mDepartmentList.addAll(list) - mSeekDoctorDepartmentAdapter?.notifyDataSetChanged() -// } - - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDiseaseSoure.collectLatest {list -> -// if(list.size==0){ -// mBinding?.seekDoctorDiseaseListRoot?.visibility=View.GONE -// }else{ -// mBinding?.seekDoctorDiseaseListRoot?.visibility=View.VISIBLE - mDiseaseList.clear() - mDiseaseList.addAll(list) - mDiseaseAdapter?.notifyDataSetChanged() -// } - - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDoctorSoure.collectLatest {list -> -// if(list.size==0){ -// mBinding?.seekDoctorDoctorListRoot?.visibility=View.GONE -// }else{ -// mBinding?.seekDoctorDoctorListRoot?.visibility=View.VISIBLE - mDoctorList.clear() - mDoctorList.addAll(list) - mSeekDoctorDoctorAdapter?.notifyDataSetChanged() -// } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mAllState.collectLatest {state -> - if(!state){ - if (mPosition==0) { - showEmptys() - }else{ - hindEmptys() - } - }else{ - hindEmptys() - } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mHospitalSoureState.collectLatest {state -> - if(!state){ - if (mPosition==2) { - showEmptys() - }else{ - hindEmptys() - } - mBinding?.seekDoctorHospitalListRoot?.visibility=View.GONE - if (mPosition==0){ - rlHospital.visibility=View.GONE - } - }else{ - if (mPosition==0){ - rlHospital.visibility=View.VISIBLE - } - mBinding?.seekDoctorHospitalListRoot?.visibility=View.VISIBLE - hindEmptys() - } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDoctorSoureState.collectLatest {state -> - if(!state){ - mBinding?.seekDoctorDoctorListRoot?.visibility=View.GONE - if (mPosition==1) { - showEmptys() - }else{ - hindEmptys() - } - if (mPosition==0) { - rlDoctor.visibility=View.GONE - } - }else{ - mBinding?.seekDoctorDoctorListRoot?.visibility=View.VISIBLE - hindEmptys() - if (mPosition==0) { - rlDoctor.visibility=View.VISIBLE - } - } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDepartmentSoureState.collectLatest {state -> - if(!state){ - if (mPosition==4) { - showEmptys() - }else{ - hindEmptys() - } - mBinding?.seekDoctorDepartmentListRoot?.visibility=View.GONE - if (mPosition==0){ - rlDepartment.visibility=View.GONE - } - }else{ - mBinding?.seekDoctorDepartmentListRoot?.visibility=View.VISIBLE - hindEmptys() - if (mPosition==0){ - rlDepartment.visibility=View.VISIBLE - } - } - } - } - } - lifecycleScope.launch { - repeatOnLifecycle(Lifecycle.State.CREATED){ - mViewModel.mDiseaseSoureState.collectLatest {state -> - if(!state){ - if (mPosition==3) { - showEmptys() - }else{ - hindEmptys() - } - mBinding?.seekDoctorDiseaseListRoot?.visibility=View.GONE - if (mPosition==0) { - rlDisease.visibility=View.GONE - } - }else{ - mBinding?.seekDoctorDiseaseListRoot?.visibility=View.VISIBLE - hindEmptys() - if (mPosition==0) { - rlDisease.visibility=View.VISIBLE - } - } - } - } - } - } - } - - fun showEmptys(){ - mBinding?.tvEmpty?.visibility=View.VISIBLE - } - fun hindEmptys(){ - mBinding?.tvEmpty?.visibility=View.GONE - } - - override fun bindEvent() { - mBinding.seekDoctorSearch.setOnCustomClickListener { - if(it.isNotEmpty()){ -// mViewModel.searchComprehensive(it) - when(mPosition){ - 0 -> { - mViewModel.searchComprehensive(it) - } - 1 -> { - mViewModel.searchConDoctor(it) - } - 2 -> { - mViewModel.searchConResource(it) - } - 3 -> { - mViewModel.searchconSicksList(it) - } - 4 -> { - mViewModel.searchConDepartment(it) - } - } - }else{ - showToast("搜索内容不能为空") - } - } - mBinding?.apply{ - addClickViews(tvDoctorMore,tvHospitalMore,tvDiseaseMore,tvDepartmentMore) - } - - mBinding.seekDoctorSearchTab.addOnTabSelectedListener(object:OnTabSelectedListener{ - override fun onTabSelected(tab: TabLayout.Tab?) { - mPosition=tab?.position!! - switchTabRefresh(mPosition) - mBinding?.let{ - when(mPosition){ - 0 -> { - mViewModel.searchComprehensive(it.seekDoctorSearch.getInoputText()) - } - 1 -> { - mViewModel.searchConDoctor(it.seekDoctorSearch.getInoputText()) - } - 2 -> { - mViewModel.searchConResource(it.seekDoctorSearch.getInoputText()) - } - 3 -> { - mViewModel.searchconSicksList(it.seekDoctorSearch.getInoputText()) - } - 4 -> { - mViewModel.searchConDepartment(it.seekDoctorSearch.getInoputText()) - } - } - } - - } - - override fun onTabUnselected(tab: TabLayout.Tab?) { - } - - override fun onTabReselected(tab: TabLayout.Tab?) { - } - }) - - mSeekDoctorDoctorAdapter?.setOnItemClickListener(object : MultiItemTypeAdapter.OnItemClickListener{ - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { startDoctorHomepageActivity(it,mDoctorList[position].id) } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - - mSeekDoctorHospitalAdapter?.setOnItemClickListener(object : MultiItemTypeAdapter.OnItemClickListener{ - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { - - val bundle = Bundle() - bundle.putString("hospitalId", mHospitalList[position].id) - bundle.putString("hospitalName", mHospitalList[position].name) - bundle.putString("departId", "") - bundle.putString("departName", "") - bundle.putString("sickId", "") - bundle.putString("sickName", "") - startFilterSearchDoctorActivity(it,"",bundle) - } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - mDiseaseAdapter?.setOnItemClickListener(object : MultiItemTypeAdapter.OnItemClickListener{ - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { - - val bundle = Bundle() - bundle.putString("hospitalId", "") - bundle.putString("hospitalName", "") - bundle.putString("departId", "") - bundle.putString("departName", "") - bundle.putString("sickId", mDiseaseList[position].id) - bundle.putString("sickName", mDiseaseList[position].name) - startFilterSearchDoctorActivity(it,"",bundle) - } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - mSeekDoctorDepartmentAdapter?.setOnItemClickListener(object : MultiItemTypeAdapter.OnItemClickListener{ - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mContext?.let { - - val bundle = Bundle() - bundle.putString("hospitalId", "") - bundle.putString("hospitalName", "") - bundle.putString("departId", mDepartmentList[position].departmentId) - bundle.putString("departName", mDepartmentList[position].departmentName) - bundle.putString("sickId", "") - bundle.putString("sickName", "") - startFilterSearchDoctorActivity(it,"",bundle) - - } - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - } - - override fun processClick(paramView: View?) { - when (paramView?.id) { - R.id.tv_doctor_more -> { - mBinding.seekDoctorSearchTab.getTabAt(1)?.select() - } - R.id.tv_hospital_more -> { - mBinding.seekDoctorSearchTab.getTabAt(2)?.select() - } - R.id.tv_disease_more -> { - mBinding.seekDoctorSearchTab.getTabAt(3)?.select() - } - R.id.tv_department_more -> { - mBinding.seekDoctorSearchTab.getTabAt(4)?.select() - } - else -> {} - } - } - -// override fun onClick(view: View) { -// when(view?.id){ -// -// } -// } - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SelectAppointmentTimeActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SelectAppointmentTimeActivity.kt index f378c8a..56aa5cf 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SelectAppointmentTimeActivity.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/SelectAppointmentTimeActivity.kt @@ -82,7 +82,7 @@ class SelectAppointmentTimeActivity : lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.CREATED) { mViewModel.followStatus.collectLatest { - headerBinding.viewDoctorBaseInfo.getFollowView().isSelected = it +// headerBinding.viewDoctorBaseInfo.getFollowView().isSelected = it } } } @@ -101,7 +101,7 @@ class SelectAppointmentTimeActivity : } override fun bindEvent() { - addClickViews(headerBinding.viewDoctorBaseInfo.getFollowView()) +// addClickViews(headerBinding.viewDoctorBaseInfo.getFollowView()) } override fun processClick(paramView: View?) { diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/ViewLocationActivity.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/ViewLocationActivity.kt new file mode 100644 index 0000000..cc5e1ec --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/ViewLocationActivity.kt @@ -0,0 +1,126 @@ +package com.sw.healthyclients.ui.guidance + +import android.Manifest +import android.graphics.BitmapFactory +import android.os.Bundle +import android.provider.SyncStateContract +import android.view.View +import com.amap.api.location.AMapLocationClient +import com.amap.api.maps.AMap +import com.amap.api.maps.CameraUpdateFactory +import com.amap.api.maps.model.BitmapDescriptorFactory +import com.amap.api.maps.model.CameraPosition +import com.amap.api.maps.model.LatLng +import com.amap.api.maps.model.MarkerOptions +import com.amap.api.maps.model.MyLocationStyle +import com.permissionx.guolindev.PermissionX +import com.tencent.qcloud.tuicore.util.ToastUtil +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.base.BaseVMBActivity +import com.xjjk.healthyclients.base.viewmodel.TestViewModel +import com.xjjk.healthyclients.databinding.ActivityViewLocationBinding + + +/** + * @author nanfeifei + * @time 2023/7/4 10:38 + * @description 查看位置(IM查看位置使用) + */ +class ViewLocationActivity : BaseVMBActivity( + R.layout.activity_view_location) { + //初始化地图控制器对象 + var aMap: AMap? = null + var mCurrentLat: Double = 0.0 + var mCurrentLon: Double = 0.0 + var mPermissionList= arrayListOf( + Manifest.permission.ACCESS_COARSE_LOCATION, + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.QUERY_ALL_PACKAGES) + override fun onSaveInstanceState(outState: Bundle) { + super.onSaveInstanceState(outState) + mBinding.mapView.onSaveInstanceState(outState) + + } + + override fun onCreate(savedInstanceState: Bundle?) { + AMapLocationClient.updatePrivacyShow(this@ViewLocationActivity, true, true) + AMapLocationClient.updatePrivacyAgree(this@ViewLocationActivity, true) + super.onCreate(savedInstanceState) + } + override fun initView(savedInstanceState: Bundle?) { + intent.extras?.let { + mCurrentLat = it.getDouble("latitude") + mCurrentLon = it.getDouble("longitude") + } + mBinding.apply { + mapView.onCreate(savedInstanceState) + if (aMap == null) { + aMap = mapView.map + } + PermissionX.init(this@ViewLocationActivity) + .permissions(mPermissionList) + .request { allGranted, grantedList, deniedList -> + setUpMap(allGranted) + } + } + } + + override fun initData() { + + } + private fun setUpMap(allGranted: Boolean) { + + mBinding.apply { + if (allGranted){ + // 自定义系统定位小蓝点 + val myLocationStyle = MyLocationStyle() + // 设置小蓝点的图 + myLocationStyle.myLocationIcon( + BitmapDescriptorFactory + .fromResource(R.mipmap.ic_my_location) + ) + myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_SHOW) + aMap?.myLocationStyle = myLocationStyle + aMap?.uiSettings?.isMyLocationButtonEnabled = true // 设置默认定位按钮是否显示 + aMap?.uiSettings?.isRotateGesturesEnabled = false + aMap?.uiSettings?.isTiltGesturesEnabled = false + aMap?.isMyLocationEnabled = true // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false + } + aMap?.moveCamera(CameraUpdateFactory.zoomTo(13F)) + val markerOption = MarkerOptions() + markerOption.position(LatLng(mCurrentLat, mCurrentLon)) + aMap?.moveCamera(CameraUpdateFactory.newLatLng(LatLng(mCurrentLat, mCurrentLon))) + markerOption.icon( + BitmapDescriptorFactory.fromBitmap( + BitmapFactory + .decodeResource(resources, R.drawable.ic_select_location) + ) + ) + markerOption.isFlat = true + aMap?.addMarker(markerOption) + } + + } + override fun onResume() { + super.onResume() + mBinding.mapView.onResume() + } + + override fun onPause() { + super.onPause() + mBinding.mapView.onPause() + } + + override fun onDestroy() { + super.onDestroy() + mBinding.mapView.onDestroy() + } + override fun bindEvent() { + + } + + override fun processClick(paramView: View?) { + + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/GuidanceFragmentDoctorAdapter.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/GuidanceFragmentDoctorAdapter.kt index aa90098..e2f377b 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/GuidanceFragmentDoctorAdapter.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/GuidanceFragmentDoctorAdapter.kt @@ -2,6 +2,7 @@ package com.xjjk.healthyclients.ui.activity.guidance.adapter import android.content.Context import android.graphics.Color +import android.net.Uri import android.view.View import android.widget.ImageView import android.widget.TextView diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/IMSelectArchivesAdapter.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/IMSelectArchivesAdapter.kt new file mode 100644 index 0000000..3258168 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/IMSelectArchivesAdapter.kt @@ -0,0 +1,24 @@ +package com.xjjk.healthyclients.ui.activity.guidance.adapter + +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.module.LoadMoreModule +import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder +import com.chad.library.adapter.base.viewholder.BaseViewHolder +import com.sw.healthyclients.utils.DateUtil +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.bean.guidance.ArchivesBean + +class IMSelectArchivesAdapter() : + BaseQuickAdapter( + R.layout.item_recycle_im_select_archives + ), LoadMoreModule { + override fun bindViewClickListener(viewHolder: BaseViewHolder, viewType: Int) { + addChildClickViewIds(R.id.btn_send) + super.bindViewClickListener(viewHolder, viewType) + } + override fun convert(holder: BaseViewHolder, item: ArchivesBean) { + holder.setText(R.id.tv_archives_name, item.recordsName) + holder.setText(R.id.tv_archives_intro, item.medicalDescribe) + holder.setText(R.id.tv_archives_time, context.getString(R.string.im_select_archives_update_time, item.updateTime)) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartment3Adapter.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartment3Adapter.kt deleted file mode 100644 index 9c95054..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartment3Adapter.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance.adapter - -import android.content.Context -import android.widget.TextView -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.CommonAdapter -import com.xjjk.healthyclients.adapter.common.ViewHolder -import com.xjjk.healthyclients.bean.guidance.DepartListBean - - -class SeekDoctorDepartment3Adapter(var mContext: Context, var layoutId: Int, var datas: ArrayList?) : CommonAdapter(mContext,layoutId,datas){ - override fun convert(holder: ViewHolder?, bean: DepartListBean?, position: Int) { - holder?.getView(R.id.item_key)?.let{ - //医院名称 - it.text=bean?.departmentName - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartmentAdapter.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartmentAdapter.kt deleted file mode 100644 index 0f19881..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDepartmentAdapter.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance.adapter - -import android.content.Context -import android.widget.TextView -import com.allen.library.CircleImageView -import com.sw.healthyclients.utils.StringUtils -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.CommonAdapter -import com.xjjk.healthyclients.adapter.common.ViewHolder -import com.xjjk.healthyclients.bean.guidance.DepartmentchildBean -import com.xjjk.healthyclients.superfuntion.load - - -class SeekDoctorDepartmentAdapter(var mContext: Context, var layoutId: Int, var datas: ArrayList?) : CommonAdapter(mContext,layoutId,datas){ - override fun convert(holder: ViewHolder?, bean: DepartmentchildBean?, position: Int) { - holder?.getView(R.id.item_recycler_seek_doctor_department_img)?.let{ - //加载医院icon -// ImageLoader.loadImage( -// mContext, -// it, -// bean?.departmentImg, -// R.drawable.ic_default -// ) - it.load(bean?.departmentImg,true, R.drawable.ic_department_default) - } - holder?.getView(R.id.item_recycler_seek_doctor_department_name)?.let{ - //医院名称 - it.text=bean?.departmentName - } - holder?.getView(R.id.item_recycler_seek_doctor_number)?.let{ - var doctorNumber=bean?.doctorNum - var value="有${doctorNumber}名专家" - StringUtils.setSizeSpan(mContext, - it,value,1,1+(doctorNumber.toString().length),10,mContext.resources.getColor(R.color.text_green_BD),true) - } - holder?.getView(R.id.item_recycler_seek_doctor_department_hint)?.let{ - //医院重点科室 - it.text=bean?.hint - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDoctorAdapter.kt b/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDoctorAdapter.kt deleted file mode 100644 index 2b8f799..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/ui/activity/guidance/adapter/SeekDoctorDoctorAdapter.kt +++ /dev/null @@ -1,150 +0,0 @@ -package com.xjjk.healthyclients.ui.activity.guidance.adapter - -import android.content.Context -import android.view.View -import android.widget.ImageView -import android.widget.LinearLayout -import android.widget.TextView -import com.allen.library.CircleImageView -import com.sw.healthyclients.utils.TextViewSpanUtil -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.CommonAdapter -import com.xjjk.healthyclients.adapter.common.ViewHolder -import com.xjjk.healthyclients.bean.guidance.DoctorChildBean -import com.xjjk.healthyclients.superfuntion.load -import com.xjjk.healthyclients.superfuntion.startSelectAppointmentTimeActivity -import com.xjjk.healthyclients.superfuntion.startSelectConsultantActivity -import com.xjjk.healthyclients.utils.ConstantUtils - - -class SeekDoctorDoctorAdapter(var mContext: Context, var layoutId: Int, var datas: ArrayList?) : CommonAdapter(mContext,layoutId,datas){ - override fun convert(holder: ViewHolder?, bean: DoctorChildBean?, position: Int) { - holder?.getView(R.id.item_recycle_seek_doctor_doctor_icon)?.let{ - //医生icon -// ImageLoader.loadImage( -// mContext, -// it, -// bean?.icon, -// R.drawable.ic_default -// ) - it.load(bean?.icon,defaultResId= R.drawable.ic_default_doctor_head_img) - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_name)?.let{ - //医生姓名 - it.text=bean?.name - } - holder?.getView(R.id.item_recycle_seek_doctor_guidance_root)?.let{ - if (bean?.doctorStatus=="3") { - holder?.getView(R.id.item_recycle_seek_doctor_video)?.let { view-> - view.setTextColor(mContext.resources.getColor(R.color.text_color_black_99)) - it.setOnClickListener {} - } - holder?.getView(R.id.item_recycle_seek_doctor_image_text)?.let { view-> - view.setTextColor(mContext.resources.getColor(R.color.text_color_black_99)) - it.setOnClickListener {} - } - }else{ -// it.visibility=View.VISIBLE - holder?.getView(R.id.item_recycle_seek_doctor_video)?.let { view-> - view.setTextColor(mContext.resources.getColor(R.color.text_green_BD)) - } - holder?.getView(R.id.item_recycle_seek_doctor_image_text)?.let { view-> - view.setTextColor(mContext.resources.getColor(R.color.text_green_BD)) - } - } - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_title)?.let{ - //医生名称 - it.text=bean?.title - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_hot)?.let{ - //医生名称 - if (!bean?.tfShowFire.isNullOrEmpty()){ - it.visibility=View.VISIBLE - }else{ - it.visibility=View.INVISIBLE - } - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_history)?.let{ - //医生历史咨询 - if (bean?.history.isNullOrEmpty()) { - it.visibility=View.INVISIBLE - }else{ - it.visibility=View.VISIBLE - } - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_tag)?.let{ - //医生所属医院tag - if (bean?.tag.isNullOrEmpty()) { - it.visibility=View.INVISIBLE - }else{ - it.visibility=View.VISIBLE - } - it.text=bean?.tag - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_hospital_name)?.let{ - //医生所属医院名字 - it.text=bean?.hospitalName - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_hint)?.let{ - //医生擅长描述 - it.text=bean?.hint - TextViewSpanUtil.toggleEllipsize(mContext,it,3,bean?.hint,"", R.color.red,false) - } - holder?.getView(R.id.item_recycle_seek_doctor_doctor_rate)?.let{ - //医生擅长描述 - var evaluate="0" - if (!bean?.evaluate.isNullOrEmpty()) { - evaluate= bean?.evaluate.toString() - } - if (evaluate == "null"){ - evaluate="0" - } - var guidanceNumber="0" - if (!bean?.guidanceNumber.isNullOrEmpty()) { - guidanceNumber= bean?.guidanceNumber.toString() - } - if (guidanceNumber=="null"){ - guidanceNumber="0" - } - var reply="0" - if (!bean?.reply.isNullOrEmpty()) { - reply= bean?.reply.toString() - } - if (reply=="null"){ - reply="0" - } - it.text="/综合评价:${evaluate} / 回复率:${reply} / 咨询量:${guidanceNumber}" - } - - holder?.getView(R.id.item_recycle_seek_doctor_image_text)?.let{ - if (bean?.doctorStatus!="3") { - it.setOnClickListener { - bean?.id?.let { it1 -> - startSelectConsultantActivity( - mContext, - ConstantUtils.ConsultType.IMAGE_TEXT_CONSULT, - it1 - ) - } - } - }else{ - it.setOnClickListener {} - } - } - - holder?.getView(R.id.item_recycle_seek_doctor_video)?.let{ - if (bean?.doctorStatus!="3") { - if (bean?.audioStatus == "1") { - it.setTextColor(mContext.resources.getColor(R.color.text_green_BD)) - it.setOnClickListener { - bean?.id?.let { it1 -> startSelectAppointmentTimeActivity(mContext, it1) } - } - } else { - it.setTextColor(mContext.resources.getColor(R.color.text_color_black_99)) - it.setOnClickListener {} - } - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/ConsultantManagerViewModel.kt b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/ConsultantManagerViewModel.kt index cd027bb..cc7d017 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/ConsultantManagerViewModel.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/ConsultantManagerViewModel.kt @@ -15,7 +15,7 @@ class ConsultantManagerViewModel: BaseViewModel() { var isRefreshing = MutableStateFlow(false) //如果需要下拉刷新监听此Flow更改刷新组件状态 var isLoadMoreEnd = MutableSharedFlow() var darkStyle = MutableStateFlow(false) - private val pageSize = Int.MAX_VALUE + private val pageSize = 1000 var pageIndex = 1 override fun init() { } @@ -23,7 +23,6 @@ class ConsultantManagerViewModel: BaseViewModel() { launch(tryBlock = { if (isRefresh) { isRefreshing.emit(true) - isLoadMoreEnd.emit(false) pageIndex = 1 } handleRequest(ConsultantManagerRepository.getConsultantManagerData(pageIndex, pageSize), successBlock = { diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/EmergencyViewModel.kt b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/EmergencyViewModel.kt index 720905e..69addea 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/EmergencyViewModel.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/EmergencyViewModel.kt @@ -1,6 +1,5 @@ package com.xjjk.healthyclients.ui.viewmodel -import InterventionRepository import com.xjjk.healthyclients.base.viewmodel.BaseViewModel import com.xjjk.healthyclients.bean.emergency.EmergencyGroupInfo import com.xjjk.healthyclients.bean.emergency.LocationResourceBean @@ -100,99 +99,99 @@ class EmergencyViewModel : BaseViewModel() { }) }) } - - /** - * 附近医疗点 - */ - fun nearbyResource(latitude: Double, longitude: Double, resourceNum: Int) { - launch( - { - handleRequest( - InterventionRepository.nearbyResource( - "", - longitude, - latitude, resourceNum - ), - successBlock = { - val mutableListOf = mutableListOf() - it.result?.forEach { - mutableListOf.add( - LocationResourceBean( - address = it.address, - mobile = it.mobile, - latitude = it.latitude, - longitude = it.longitude, - name = it.name, - type = "3", - ) - ) - } - markList.emit(mutableListOf) - }) - } - ) - } - - /** - * 附近救护车 - */ - fun nearbyAmbulance(latitude: Double, longitude: Double) { - launch( - { - handleRequest( - InterventionRepository.nearbyAmbulance(longitude, latitude), - successBlock = { - val mutableListOf = mutableListOf() - it.result?.forEach { - mutableListOf.add( - LocationResourceBean( - mobile = it.phone, - latitude = it.latitude, - longitude = it.longitude, - address = it.propagateArea.orEmptyDefault(), - name = it.belongName.orEmptyDefault(), - type = "5", - ) - ) - } - markList.emit(mutableListOf) - }) - } - ) - } - - /** - * 心血管-aed组网 - */ - fun getAedNetworkingData( - longitude: Double, - latitude: Double, - radiusRange: Int = 100000, - aedNum: String = "" - ) { - - launch( - { - handleRequest( - InterventionRepository.getAedNetworkingData( - longitude, latitude, radiusRange, aedNum - ), successBlock = { - val mutableListOf = mutableListOf() - it.result?.forEach { - mutableListOf.add( - LocationResourceBean( - address = it.installAddress.orEmptyDefault(), - mobile = it.chargeFirstMobile.orEmptyDefault(), - latitude = it.latitude, - longitude = it.longitude, - name = it.name.orEmptyDefault(), - type = "4", - ) - ) - } - markList.emit(mutableListOf) - }) - } - ) - } +// +// /** +// * 附近医疗点 +// */ +// fun nearbyResource(latitude: Double, longitude: Double, resourceNum: Int) { +// launch( +// { +// handleRequest( +// InterventionRepository.nearbyResource( +// "", +// longitude, +// latitude, resourceNum +// ), +// successBlock = { +// val mutableListOf = mutableListOf() +// it.result?.forEach { +// mutableListOf.add( +// LocationResourceBean( +// address = it.address, +// mobile = it.mobile, +// latitude = it.latitude, +// longitude = it.longitude, +// name = it.name, +// type = "3", +// ) +// ) +// } +// markList.emit(mutableListOf) +// }) +// } +// ) +// } +// +// /** +// * 附近救护车 +// */ +// fun nearbyAmbulance(latitude: Double, longitude: Double) { +// launch( +// { +// handleRequest( +// InterventionRepository.nearbyAmbulance(longitude, latitude), +// successBlock = { +// val mutableListOf = mutableListOf() +// it.result?.forEach { +// mutableListOf.add( +// LocationResourceBean( +// mobile = it.phone, +// latitude = it.latitude, +// longitude = it.longitude, +// address = it.propagateArea.orEmptyDefault(), +// name = it.belongName.orEmptyDefault(), +// type = "5", +// ) +// ) +// } +// markList.emit(mutableListOf) +// }) +// } +// ) +// } +// +// /** +// * 心血管-aed组网 +// */ +// fun getAedNetworkingData( +// longitude: Double, +// latitude: Double, +// radiusRange: Int = 100000, +// aedNum: String = "" +// ) { +// +// launch( +// { +// handleRequest( +// InterventionRepository.getAedNetworkingData( +// longitude, latitude, radiusRange, aedNum +// ), successBlock = { +// val mutableListOf = mutableListOf() +// it.result?.forEach { +// mutableListOf.add( +// LocationResourceBean( +// address = it.installAddress.orEmptyDefault(), +// mobile = it.chargeFirstMobile.orEmptyDefault(), +// latitude = it.latitude, +// longitude = it.longitude, +// name = it.name.orEmptyDefault(), +// type = "4", +// ) +// ) +// } +// markList.emit(mutableListOf) +// }) +// } +// ) +// } } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/IMSelectArchivesViewModel.kt b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/IMSelectArchivesViewModel.kt new file mode 100644 index 0000000..2653350 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/IMSelectArchivesViewModel.kt @@ -0,0 +1,31 @@ +package com.xjjk.healthyclients.ui.viewmodel + +import com.xjjk.healthyclients.base.viewmodel.BaseViewModel +import com.xjjk.healthyclients.bean.guidance.ArchivesBean +import com.xjjk.healthyclients.data.repository.GuidanceRepository +import com.xjjk.healthyclients.superfuntion.handleRequest +import com.xjjk.healthyclients.superfuntion.launch +import kotlinx.coroutines.flow.MutableStateFlow + +/** + * @author nanfeifei + * @time 2023/7/5 10:32 + * @description + */ +class IMSelectArchivesViewModel: BaseViewModel() { + var archivesBeanList = MutableStateFlow?>(null) + override fun init() { + + } + fun getArchivesList(memberId: String?){ + launch({ + handleRequest(GuidanceRepository.getArchivesList(memberId), successBlock = { + if (it.result.isNullOrEmpty()){ + archivesBeanList.emit(mutableListOf()) + }else{ + archivesBeanList.emit(it.result!!) + } + }) + }) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/MainViewModel.kt b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/MainViewModel.kt new file mode 100644 index 0000000..1295ddd --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/MainViewModel.kt @@ -0,0 +1,195 @@ +package com.xjjk.healthyclients.ui.viewmodel + +import android.app.ProgressDialog +import android.view.Window +import com.sw.healthyclients.data.local.DataStoreManager +import com.sw.healthyclients.utils.CustomActivityManager +import com.sw.healthyclients.view.LoadingDialog +import com.xjjk.healthyclients.base.viewmodel.BaseViewModel +import com.xjjk.healthyclients.bean.user.IMDoctorInfoBean +import com.xjjk.healthyclients.data.repository.CommonRepository +import com.xjjk.healthyclients.event.UserNoticeBean +import com.xjjk.healthyclients.retrofit.UrlConfig +import com.xjjk.healthyclients.superfuntion.handleRequest +import com.xjjk.healthyclients.superfuntion.launch +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.MutableStateFlow + +/** + * @author nanfeifei + * @time 2023/9/4 13:10 + * @description + */ +class MainViewModel : BaseViewModel() { + var noticeBean = MutableStateFlow(UserNoticeBean()) + var doctorInfo = MutableStateFlow(IMDoctorInfoBean()) + var tokenOverdue = MutableSharedFlow() + var timePrescription = MutableSharedFlow() + var selectTfHelper = MutableSharedFlow() + var submitNoticeChooseResult = MutableSharedFlow() + var imDialog: LoadingDialog? = null + override fun init() { +// getNoticeData() + checkTokenIsEffective() + } + + fun initIMDialog(){ + imDialog = LoadingDialog( + CustomActivityManager.getInstance().TopActivity(), + ProgressDialog.STYLE_SPINNER, "数据加载中" + ) + imDialog?.requestWindowFeature(Window.FEATURE_NO_TITLE) + imDialog?.setCanceledOnTouchOutside(false) + imDialog?.setCancelable(false) + imDialog?.setMessage("请稍后...") + } + + /** + * 首页用户弹窗 + */ + fun getNoticeData() { + launch( + { + handleRequest( + CommonRepository.selectUserNotice("2"), + successBlock = { + it.result?.let { result -> + noticeBean.emit(result) + } + }) + } + ) + } + + /** + * 监测token是否有效 + */ + fun checkTokenIsEffective() { + launch( + { + handleRequest( + CommonRepository.selectTokenExpire(DataStoreManager.getToken()), + successBlock = { + it.result?.let { result -> + tokenOverdue.emit(result) + } + }) + } + ) + } + + /** + * 首页弹窗用户选择内容提交 + */ + fun submitNoticeChooseItem(id: String, notShow: Int) { + launch( + { + handleRequest( + CommonRepository.chooseToDontShowUp(id, notShow), + successBlock = { + submitNoticeChooseResult.emit(true) + }) + } + ) + } + + /** + * 医生卡片时效校验 + */ + fun selectDoctorCardExpireTime(time: Long) { + imDialog?.show() + launch( + { + handleRequest( + CommonRepository.selectDoctorCardExpireTime(time), + successBlock = { + it.result?.let { it1 -> timePrescription.emit(it1) } + }, errorBlock = { + false + }) + }, finallyBlock = { + imDialog?.dismiss() + } + ) + } + + fun getAgreement(){ + launch({ + handleRequest(CommonRepository.getCommonSettingMenuList("qh_jump_url"), successBlock = { + it.result?.let { list -> + if (list != null) { + list?.let { + for (index in 0 until it.size){ + when(it[index].value){ + "1" -> { + //用户协议 + if (it[index].text.isNotEmpty()) { + DataStoreManager.saveUserAgreementUrl( + UrlConfig.getH5BaseUrl( + UrlConfig.baseUrlType)+ it[index].text) + } + } + "2" -> { + //隐私政策 + if (it[index].text.isNotEmpty()) { + DataStoreManager.savePrivacyAgreementUrl( + UrlConfig.getH5BaseUrl( + UrlConfig.baseUrlType)+ it[index].text) + } + } + "3" -> { + //相关法律说明 + if (it[index].text.isNotEmpty()) { + DataStoreManager.saveLawUrl( + UrlConfig.getH5BaseUrl( + UrlConfig.baseUrlType)+ it[index].text) + } + } + } + } + } + } + } + }) + },isAutoShowEmpty=true) + } + + /** + * 全科医生校验 + */ + fun selectTfHelper(id: String) { + imDialog?.show() + launch( + { + handleRequest( + CommonRepository.selectTfHelper(id), + successBlock = { + it.result?.let { it1 -> selectTfHelper.emit(it1) } + }, errorBlock = { + false + }) + }, finallyBlock = { + imDialog?.dismiss() + } + ) + } + + /** + * 获取全科医生信息 + */ + fun selectHelperInfoDesc(id: String) { + launch(showDialog=true, + { + handleRequest( + CommonRepository.selectHelperInfoDesc(id), + successBlock = { + it.result?.let { it1 -> doctorInfo.emit(it1) } + }, errorBlock = { + false + }) + }, finallyBlock = { + } + ) + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/UserInfoSettingViewModel.kt b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/UserInfoSettingViewModel.kt index 80df3bb..be86c6a 100644 --- a/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/UserInfoSettingViewModel.kt +++ b/app/src/main/java/com/xjjk/healthyclients/ui/viewmodel/UserInfoSettingViewModel.kt @@ -1,18 +1,24 @@ package com.xjjk.healthyclients.ui.viewmodel import com.xjjk.healthyclients.base.viewmodel.BaseViewModel +import com.xjjk.healthyclients.bean.CommonSettingMenuBean import com.xjjk.healthyclients.bean.SelectUserInfoBean import com.xjjk.healthyclients.bean.user.SelectEmergencyContactListBean import com.xjjk.healthyclients.data.repository.CommonRepository +import com.xjjk.healthyclients.data.repository.ConsultantManagerRepository import com.xjjk.healthyclients.data.repository.GuidanceRepository import com.xjjk.healthyclients.superfuntion.handleRequest import com.xjjk.healthyclients.superfuntion.launch +import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow class UserInfoSettingViewModel : BaseViewModel() { var bean = MutableStateFlow(mutableListOf()) var userInfo = MutableStateFlow(SelectUserInfoBean()) + var relationList = MutableStateFlow(mutableListOf()) + var upState= MutableSharedFlow() + override fun init() { } @@ -52,4 +58,54 @@ class UserInfoSettingViewModel : BaseViewModel() { ) } + + /** + * 紧急联系人列表 + */ + fun getRelationList(){ + launch({ + handleRequest(ConsultantManagerRepository.getMemberRelationList(), successBlock = { + it.result?.let { it1 -> + relationList.emit(it1) + } + }) + }) + } + + /** + * 更新联系人 + */ + fun updateAndInsertEmergencyContact(bean: SelectEmergencyContactListBean){ + launch({ + handleRequest(CommonRepository.updateAndInsertEmergencyContact(bean), successBlock = { +// it.result?.let { it1 -> +// if (it1=="1") { +// upState.emit(true) +// }else{ +// upState.emit(false) +// } +// +// } + upState.emit(true) + }) + }) + } + /** + * 删除联系人 + */ + fun removeEmergencyContactList(id: String){ + launch({ + handleRequest(CommonRepository.removeEmergencyContactList(id), successBlock = { + it.result?.let { it1 -> + if (it1=="1") { + upState.emit(true) + }else{ + upState.emit(false) + } + + } + }) + }) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/utils/ConstantUtils.kt b/app/src/main/java/com/xjjk/healthyclients/utils/ConstantUtils.kt index 91f0e94..9b5d4d1 100644 --- a/app/src/main/java/com/xjjk/healthyclients/utils/ConstantUtils.kt +++ b/app/src/main/java/com/xjjk/healthyclients/utils/ConstantUtils.kt @@ -6,9 +6,9 @@ import kotlinx.android.parcel.Parcelize object ConstantUtils { const val mIsDebug = false const val mRSAKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmZfR/bA9X3vp86y1aEpvwzXJYKRRF1fLau2+05/ZtaITLpV8bhkmSf3neSy/Q9gAdvG75Fr73E+GWE+K5b0BpvIS1jDGo319+PpZR39SaZTKZ27XFXrosmJTZutN79t819HS1VseleunHAFgMVufE9U5jP6LGzl/wbkSy01GhzwIDAQAB" - var mCurrentLat = 34.327271 + var mCurrentLat = 43.793026 var mCheckToken = false - var mCurrentLon = 108.949845 + var mCurrentLon = 87.627704 var mNutritionMonitor = false var mIsCloseDialog = false var mPrivacy = "本平台由西安仁康信息科技有限公司开发和运维,平台深知个人信息对您的重要性,并会尽全力保护您的个人信息安全可靠。我们致力于维持您对我们的信任,恪守以下原则,保护您的个人信息:权责一致原则、目的明确原则、选择同意原则、最少够用原则、确保安全原则、主体参与原则、公开透明原则等。同时,我们承诺将采取相应的安全保护措施来保护您的个人信息。请在使用平台服务前,仔细阅读并了解本隐私权政策,我们将按照本政策收集、处理及披露您的信息。\n" + @@ -57,17 +57,17 @@ object ConstantUtils { "(14) 个人位置信息(包括精准定位信息、经纬度等);\n" + "(15) 其他平台基于为您提供服务需要而收集或汇总的您的信息。\n" + "三、我们如何收集和使用您的个人信息\n" + - "1. 您直接提供的信息:我们可能会收集您在蚁熊健康注册账号、申请或使用我们的服务时填写,通过现场交谈、电话、视频或其他联系方式与我们联系时所提供的信息,以及您在使用我们服务过程中产生的与您的交易和活动有关的信息。\n" + + "1. 您直接提供的信息:我们可能会收集您在健康油我注册账号、申请或使用我们的服务时填写,通过现场交谈、电话、视频或其他联系方式与我们联系时所提供的信息,以及您在使用我们服务过程中产生的与您的交易和活动有关的信息。\n" + "(1) 帮助您成为我们的一员\n" + "您需要向平台提供真实姓名、邮箱、有效身份证件(包括但不限于身份证)的号码,以便于我们进行实名认证。您可以修改和补充您的昵称、性别、生日、职级、职称、学历、亲属、紧急联系人、工作信息(单位部门)、婚姻状况、健康类型、兴趣爱好以及您的实名认证等一系列相关信息相关信息,这些信息均属于您的“账号信息”。您补充的账户信息将有助于我们为您提供与您信息更匹配的相关业务服务(急救协助、医院体检、健康知识推送等)。如果您不提供这些信息,可能会影响您对平台部分核心业务功能的正常使用,如咨询专家等,但不会影响您进行基本的浏览、搜索。如果您不提供这些信息,将会影响您使用平台的部分功能,如咨询专家,但不会影响您使用平台服务的基本浏览、搜索功能。在您主动注销账号时,我们将根据相关法律法规的要求尽快使其匿名或删除您的个人信息。\n" + "(2) 咨询专家\n" + "为便于您能够咨询专家,您需提供真实姓名、手机号、身份证号码、性别、出生日期、身高体重等信息。为更好地向您提供咨询服务解决您的问题,更加精准、快速地向您推荐医生,我们可能需要您在健康咨询时提供个人健康信息,例如:病症、患病时长、检验报告、体检报告、医院就诊信息、诊治情况、用药记录、以往病史、过敏信息、家族史、患病史等。如您不提供上述信息,将会影响您使用部分健康咨询等功能,但不影响您使用平台产品或服务的基本浏览、搜索功能。应急救援\n" + - "(1) 您实名成为蚁熊健康的用户后,若您或您的朋友发生了意外事件,你可以通过查看系统内的相关医疗资源,并向平台发起帮助请求。在此过程中,我们可能会通过您的基本信息和聊天功能获取您的手机号、您的紧急联系人姓名和联系 电话,位置、姓名、性别、年龄、健康状况、事故详情介绍的图文、音视频沟通的信息。搜索\n" + + "(1) 您实名成为健康油我的用户后,若您或您的朋友发生了意外事件,你可以通过查看系统内的相关医疗资源,并向平台发起帮助请求。在此过程中,我们可能会通过您的基本信息和聊天功能获取您的手机号、您的紧急联系人姓名和联系 电话,位置、姓名、性别、年龄、健康状况、事故详情介绍的图文、音视频沟通的信息。搜索\n" + "(3) 搜索\n" + "为了让您快速地找到您所需要的专家、知识文章、软件功能、医院等,我们可能会收集您使用我们的产品记录为您提供这些信息展示的最优方式。我们也会为了不断改进和优化上述的功能来使用您的上述个人信息。\n" + "您也可以通过搜索来精准地找到您所需要的专家、医院、系统功能。我们会保留您的搜索内容以方便您重复输入或为您展示与您搜索内容相关联的产品或服务。\n" + "(4) 应急救援\n" + - "您实名成为蚁熊健康的用户后,若您或您的朋友发生了意外事件,你可以通过查看系统内的相关医疗资源,并向平台发起帮助请求。在此过程中,我们可能会通过您的基本信息和聊天功能获取您的手机号、您的紧急联系人姓名和联系 电话,位置、姓名、性别、年龄、健康状况、事故详情介绍的图文、音视频沟通的信息。\n" + + "您实名成为健康油我的用户后,若您或您的朋友发生了意外事件,你可以通过查看系统内的相关医疗资源,并向平台发起帮助请求。在此过程中,我们可能会通过您的基本信息和聊天功能获取您的手机号、您的紧急联系人姓名和联系 电话,位置、姓名、性别、年龄、健康状况、事故详情介绍的图文、音视频沟通的信息。\n" + "(5) 大病就医(挂号)\n" + "为了帮您预约医院的专家,我们需要您在预约时提供个人基本信息:姓名、性别、年龄、预约医院、挂号类型、预约时间等基本信息;你可补充病况、就诊卡号、预约科室、医师来进一步享受更为准确的服务。\n" + "(6) 体检预约、体检报告查看、体检指标分析\n" + @@ -247,7 +247,7 @@ object ConstantUtils { "(5) 响应您的请求将导致您或其他个人、组织的合法权益受到严重损害的;\n" + "(6) 涉及商业秘密的。\n" + "九、我们如何处理未成年人的个人信息\n" + - "1.蚁熊健康非常重视对未成年人个人信息的保护。若您是18周岁以下的未成年人,在使用我们的产品与/或服务前,应事先取得您监护人的同意。蚁熊健康根据国家相关法律法规的规定保护未成年人的个人信息。\n" + + "1.健康油我非常重视对未成年人个人信息的保护。若您是18周岁以下的未成年人,在使用我们的产品与/或服务前,应事先取得您监护人的同意。健康油我根据国家相关法律法规的规定保护未成年人的个人信息。\n" + "2.我们不会主动直接向未成年人收集其个人信息。对于经监护人同意而收集未成年人个人信息的情况,我们只会在受到法律允许、监护人同意或者保护未成年人所必要的情况下使用、共享、转让或披露此信息。\n" + "3.如果有事实证明未成年人在未取得监护人同意的情况下注册使用了我们的产品与/或服务,我们会与相关监护人协商,并设法尽快删除相关个人信息。\n" + "十、本声明和政策如何更新\n" + diff --git a/app/src/main/java/com/xjjk/healthyclients/utils/IMInputActionSettingUtils.kt b/app/src/main/java/com/xjjk/healthyclients/utils/IMInputActionSettingUtils.kt index ab8f2b1..45207c4 100644 --- a/app/src/main/java/com/xjjk/healthyclients/utils/IMInputActionSettingUtils.kt +++ b/app/src/main/java/com/xjjk/healthyclients/utils/IMInputActionSettingUtils.kt @@ -2,6 +2,7 @@ package com.xjjk.healthyclients.utils import com.xjjk.healthyclients.retrofit.UrlConfig import com.tencent.qcloud.tuikit.tuichat.classicui.setting.InputActionSetting +import com.xjjk.healthyclients.BuildConfig object IMInputActionSettingUtils { /** @@ -9,9 +10,10 @@ object IMInputActionSettingUtils { */ fun createEmergencySetting(){ var inputActionSetting = InputActionSetting.createInstance() + inputActionSetting.packageName = BuildConfig.APPLICATION_ID inputActionSetting.CurrentResourceHost = UrlConfig.IMAGE_BASE_URL inputActionSetting.isDisableAudioCall = false - inputActionSetting.isDisableVideoCall = false + inputActionSetting.isDisableVideoCall = true inputActionSetting.isDisableArchives = true inputActionSetting.disableFinishName = true inputActionSetting.disableEvaluate = false @@ -24,9 +26,10 @@ object IMInputActionSettingUtils { */ fun createImageTextConsultSetting(isSelf: Boolean = false, disableSendMessage: Boolean = false, disableEvaluate: Boolean = false){ var inputActionSetting = InputActionSetting.createInstance() + inputActionSetting.packageName = BuildConfig.APPLICATION_ID inputActionSetting.CurrentResourceHost = UrlConfig.IMAGE_BASE_URL - inputActionSetting.isDisableAudioCall = true - inputActionSetting.isDisableVideoCall = true + inputActionSetting.isDisableAudioCall = false + inputActionSetting.isDisableVideoCall = false inputActionSetting.isDisableArchives = false inputActionSetting.disableFinishName = false inputActionSetting.disableEvaluate = disableEvaluate @@ -39,6 +42,7 @@ object IMInputActionSettingUtils { */ fun createAssistantSetting(){ var inputActionSetting = InputActionSetting.createInstance() + inputActionSetting.packageName = BuildConfig.APPLICATION_ID inputActionSetting.CurrentResourceHost = UrlConfig.IMAGE_BASE_URL inputActionSetting.isDisableAudioCall = false inputActionSetting.isDisableVideoCall = false @@ -54,6 +58,7 @@ object IMInputActionSettingUtils { */ fun createEmergencyLinkageSetting(){ var inputActionSetting = InputActionSetting.createInstance() + inputActionSetting.packageName = BuildConfig.APPLICATION_ID inputActionSetting.CurrentResourceHost = UrlConfig.IMAGE_BASE_URL inputActionSetting.isDisableAudioCall = false inputActionSetting.isDisableVideoCall = false diff --git a/app/src/main/java/com/xjjk/healthyclients/utils/MapUtils.java b/app/src/main/java/com/xjjk/healthyclients/utils/MapUtils.java index 9099cf2..f53dee2 100644 --- a/app/src/main/java/com/xjjk/healthyclients/utils/MapUtils.java +++ b/app/src/main/java/com/xjjk/healthyclients/utils/MapUtils.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.text.TextUtils; import androidx.annotation.DrawableRes; @@ -102,6 +103,9 @@ public class MapUtils { } public static @DrawableRes int getMarkerIcon(String type){ + if (TextUtils.isEmpty(type)) { + return R.drawable.ic_oil_hospital; + } switch (type){ case "1": { return R.drawable.ic_oil_hospital; @@ -187,7 +191,7 @@ public class MapUtils { double Hyp = Math.sqrt(X * X + Y * Y); double Lat = Math.atan2(Z, Hyp); Lon=Math.abs(Lon); - LatLng latLng=new LatLng(34.190432,108.873027); + LatLng latLng=new LatLng(43.793026,87.627704); DecimalFormat decimalFormat = new DecimalFormat("#0.#####"); String strLat = decimalFormat.format(Lat * 180 / Math.PI); String strLon = decimalFormat.format(Lon * 180 / Math.PI); diff --git a/app/src/main/java/com/xjjk/healthyclients/view/AppointmentInformationView.kt b/app/src/main/java/com/xjjk/healthyclients/view/AppointmentInformationView.kt index 4033035..81e92e6 100644 --- a/app/src/main/java/com/xjjk/healthyclients/view/AppointmentInformationView.kt +++ b/app/src/main/java/com/xjjk/healthyclients/view/AppointmentInformationView.kt @@ -336,7 +336,7 @@ class AppointmentInformationView : LinearLayout { } } - fun getFollowView(): ImageButton { - return mBinding.btnFollow - } +// fun getFollowView(): ImageButton { +// return mBinding.btnFollow +// } } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/view/CustomFilterSearchView.kt b/app/src/main/java/com/xjjk/healthyclients/view/CustomFilterSearchView.kt deleted file mode 100644 index a0ae023..0000000 --- a/app/src/main/java/com/xjjk/healthyclients/view/CustomFilterSearchView.kt +++ /dev/null @@ -1,596 +0,0 @@ -package com.xjjk.healthyclients.view - -import android.content.Context -import android.util.AttributeSet -import android.view.LayoutInflater -import android.view.View -import android.widget.RelativeLayout -import androidx.databinding.DataBindingUtil -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.xjjk.healthyclients.R -import com.xjjk.healthyclients.adapter.common.MultiItemTypeAdapter -import com.xjjk.healthyclients.bean.guidance.DepartListBean -import com.xjjk.healthyclients.bean.guidance.FilterSearchBean -import com.xjjk.healthyclients.bean.guidance.SickListBean -import com.xjjk.healthyclients.bean.guidance.selectDictListByNHDSRequestBean -import com.xjjk.healthyclients.databinding.CustomFilterSearchViewBinding -import com.xjjk.healthyclients.ui.activity.guidance.adapter.CustomFilterAdapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.FilterSearchDepartment2Adapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorDepartment3Adapter -import com.xjjk.healthyclients.ui.activity.guidance.adapter.SeekDoctorSick3Adapter - -/** - * 切换医院时,科室和疾病的筛选条件,切换科室时,清空疾病的筛选条件 - */ -class CustomFilterSearchView : RelativeLayout { - - var mContext:Context?=null - var mBinding: CustomFilterSearchViewBinding - var mCustomFilterAdapter: CustomFilterAdapter?=null - var mHospitalList= arrayListOf() - var mDepartList= arrayListOf() - var mSickList= arrayListOf() - private var mSeekDoctorDepartmentAdapter2: FilterSearchDepartment2Adapter?=null - private var mSeekDoctorSick3Adapter: SeekDoctorSick3Adapter?=null - private var mSeekDoctorDepartmentAdapter3: SeekDoctorDepartment3Adapter?=null - private var mDepartmentListLeft=arrayListOf() //左侧列表 - private var mSickListLeft=arrayListOf() //左侧列表 - private var mDepartmentListRight=arrayListOf() //科室右侧列表 - private var mSickListRight=arrayListOf() //疾病右侧列表 - private var mSickAndDepartIndex=0 - - var mType=0 - var mType2=1 //1 好评 2 热度 3回复 - var bean= - selectDictListByNHDSRequestBean() - - var mClickListener:((type:Int,id:String) -> Unit?)? =null - - var mMethod: ((selectDictListByNHDSRequestBean) -> Unit?)? =null - constructor(context: Context?,attrs : AttributeSet?): super(context, attrs,0){ - mContext=context - mBinding = DataBindingUtil.inflate( - LayoutInflater.from(context), - R.layout.custom_filter_search_view, this,true) - initView() - } - - private fun initView() { - mType2=1 - bean.tfSort=mType.toString() - mMethod?.let { it(bean) } - refreshState() - mCustomFilterAdapter= CustomFilterAdapter(mContext, - R.layout.item_custom_filter,mType,mHospitalList){} - var manager=LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false) - mBinding.customFilterSelectRv.layoutManager=manager - mBinding.customFilterSelectRv.adapter=mCustomFilterAdapter - mBinding.customFilterSelectRvRoot.setOnClickListener { } - //科室 - mSeekDoctorDepartmentAdapter2= FilterSearchDepartment2Adapter(mContext!!, - R.layout.item_recycle_seek_doctor_department_child2,mDepartmentListLeft) - val linearLayoutManager = LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false) - mBinding.seekDoctorDepartmentListLeft.layoutManager = linearLayoutManager - mBinding.seekDoctorDepartmentListLeft.adapter = mSeekDoctorDepartmentAdapter2 - - mSeekDoctorSick3Adapter= SeekDoctorSick3Adapter(mContext!!, - R.layout.item_recycle_seek_doctor_department_child3,mSickListRight) - val linearLayoutManager2 = LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false) - mBinding.seekDoctorDepartmentListRight.layoutManager = linearLayoutManager2 - mBinding.seekDoctorDepartmentListRight.adapter = mSeekDoctorSick3Adapter - - mSeekDoctorDepartmentAdapter3= SeekDoctorDepartment3Adapter(mContext!!, - R.layout.item_recycle_seek_doctor_department_child3,mDepartmentListRight) - val linearLayoutManager3 = LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false) - mBinding.seekDoctorDepartmentListRight.layoutManager = linearLayoutManager3 - mBinding.seekDoctorDepartmentListRight.adapter = mSeekDoctorDepartmentAdapter3 - - - //筛选头点击 - mBinding.customFilterSelectHospital.setOnClickListener { - if (mType==0) { - if (mBinding.customFilterSelectRvRoot.visibility==View.VISIBLE){ - mBinding.customFilterSelectRvRoot.visibility=View.GONE -// val drawableLeft = resources.getDrawable(R.drawable.common_filter_arrow_down) -// mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, -// null, drawableLeft, null) -// mBinding.customFilterSelectHospital.setCompoundDrawablePadding(4) - setfilterTitleIcon(0,1) - }else{ - mBinding.customFilterSelectRvRoot.visibility=View.VISIBLE - mBinding.customFilterSelectRv.visibility=View.VISIBLE - mBinding.customFilterSelectDepart.visibility=View.GONE -// val drawableLeft = resources.getDrawable(R.drawable.common_filter_arrow_up) -// mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, -// null, drawableLeft, null) -// mBinding.customFilterSelectHospital.setCompoundDrawablePadding(4) - setfilterTitleIcon(0,0) - } - }else{ -// if (mBinding.customFilterSelectRvRoot.visibility==View.GONE){ - mBinding.customFilterSelectRvRoot.visibility=View.VISIBLE - mBinding.customFilterSelectRv.visibility=View.VISIBLE - mBinding.customFilterSelectDepart.visibility=View.GONE -// } - setfilterTitleIcon(0,0) - } - mType=0 - mCustomFilterAdapter?.setDataType(0) - mCustomFilterAdapter?.setmDatas(mHospitalList) - mCustomFilterAdapter?.notifyDataSetChanged() - } - mBinding.customFilterSelectDepartment.setOnClickListener { - if(mDepartmentListLeft.size==0){ - return@setOnClickListener - } - if (mType==1) { - if (mBinding.customFilterSelectRvRoot.visibility==View.VISIBLE){ - mBinding.customFilterSelectRvRoot.visibility=View.GONE -// val drawableLeft = resources.getDrawable(R.drawable.common_filter_arrow_down) -// mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, -// null, drawableLeft, null) -// mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - setfilterTitleIcon(1,1) - }else{ - mBinding.customFilterSelectRvRoot.visibility=View.VISIBLE - mBinding.customFilterSelectRv.visibility=View.GONE - mBinding.customFilterSelectDepart.visibility=View.VISIBLE -// val drawableLeft = resources.getDrawable(R.drawable.common_filter_arrow_up) -// mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, -// null, drawableLeft, null) -// mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - setfilterTitleIcon(1,0) - } - }else{ -// if (mBinding.customFilterSelectRvRoot.visibility==View.GONE){ - mBinding.customFilterSelectRvRoot.visibility=View.VISIBLE - mBinding.customFilterSelectRv.visibility=View.GONE - mBinding.customFilterSelectDepart.visibility=View.VISIBLE -// val drawableLeft = resources.getDrawable(R.drawable.common_filter_arrow_up) -// mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, -// null, drawableLeft, null) -// mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - setfilterTitleIcon(1,0) -// } - } - mBinding.customFilterSelectRv.visibility=View.GONE - - mType=1 - mCustomFilterAdapter?.setDataType(1) - mSeekDoctorDepartmentAdapter2?.setmDatas(mDepartmentListLeft) - mSeekDoctorDepartmentAdapter3?.setmDatas(mDepartmentListRight) - mBinding.seekDoctorDepartmentListRight.adapter = mSeekDoctorDepartmentAdapter3 - if (mDepartmentListRight.size==0) { - if(mDepartmentListLeft.size>0){ - mClickListener?.let { - if(mSickAndDepartIndex0&&mSickAndDepartIndex { - var name=mHospitalList[position].hospitalName - mBinding.customFilterSelectHospital.text=name - if (name=="全部医院") { - bean.hospitalId="" - bean.isSelectHospital=true - }else{ - bean.hospitalId=mHospitalList[position].hospitalId - bean.isSelectHospital=false - } - mMethod?.let { it(bean) } - } - 1 -> { - mBinding.customFilterSelectDepartment.text=mDepartList[position].departmentName - bean.departmentId=mDepartList[position].departmentid - mMethod?.let { it(bean) } - } - 2 -> { - mBinding.customFilterSelectSick.text=mSickList[position].sicksName - bean.sickId=mSickList[position].sickId - mMethod?.let { it(bean) } - } - } - mBinding.customFilterSelectRvRoot.visibility=View.GONE - setfilterTitleIcon(0,1) - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - mSeekDoctorDepartmentAdapter3?.setOnItemClickListener(object : - MultiItemTypeAdapter.OnItemClickListener { - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - var id=mDepartmentListLeft[mSickAndDepartIndex].id - if (position==0&&id=="1") { - bean.departmentId="" - mBinding.customFilterSelectDepartment.text=mDepartmentListLeft[mSickAndDepartIndex].departmentName - }else{ - var name=mDepartmentListRight[position].departmentName - if (name.contains("全部")){ - name=mDepartmentListLeft[mSickAndDepartIndex].departmentName - } - mBinding.customFilterSelectDepartment.text=name - bean.departmentId=mDepartmentListRight[position].id - } - - mMethod?.let { it(bean) } - mBinding.customFilterSelectRvRoot.visibility=View.GONE - setfilterTitleIcon(1,1) - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - mSeekDoctorSick3Adapter?.setOnItemClickListener(object : - MultiItemTypeAdapter.OnItemClickListener { - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - var id=mSickListLeft[mSickAndDepartIndex].id - if (position==0&&id=="0") { - bean.sickId="" - mBinding.customFilterSelectSick.text=mSickListLeft[mSickAndDepartIndex].departmentName - }else{ - bean.sickId=mSickListRight[position].id - mBinding.customFilterSelectSick.text=mSickListRight[position].sicksName - } - - mMethod?.let { it(bean) } - mBinding.customFilterSelectRvRoot.visibility=View.GONE - setfilterTitleIcon(2,1) - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - mSeekDoctorDepartmentAdapter2?.setOnItemClickListener(object : - MultiItemTypeAdapter.OnItemClickListener { - override fun onItemClick(view: View?, holder: RecyclerView.ViewHolder?, position: Int) { - mSickAndDepartIndex=position - when(mType){ - 1 -> { - //科室 -// mBinding.customFilterSelectDepartment.text=mDepartList[position].departmentName -// bean.departmentId=mDepartList[position].departmentid -// mMethod?.let { it(bean) } - for (index in 0 until mDepartmentListLeft.size){ - if (index==position) { - mDepartmentListLeft[index].isSelect=true - }else{ - mDepartmentListLeft[index].isSelect=false - } - } - mSeekDoctorDepartmentAdapter2?.notifyDataSetChanged() - mClickListener?.let{ - it(0,mDepartmentListLeft[position].id) - } - } - 2 -> { - //疾病 -// mBinding.customFilterSelectSick.text=mSickList[position].sicksName -// bean.sickId=mSickList[position].sickId -// mMethod?.let { it(bean) } - for (index in 0 until mSickListLeft.size){ - if (index==position) { - mSickListLeft[index].isSelect=true - }else{ - mSickListLeft[index].isSelect=false - } - } - mSeekDoctorDepartmentAdapter2?.notifyDataSetChanged() - mClickListener?.let{ - it(1,mSickListLeft[position].id) - } - } - } -// mBinding.customFilterSelectRvRoot.visibility=View.GONE - } - - override fun onItemLongClick( - view: View?, - holder: RecyclerView.ViewHolder?, - position: Int - ): Boolean { - return false - } - }) - } - - /** - * type 0 医院 1科室 2疾病 - * type2 0 上 1下 - */ - fun setfilterTitleIcon(type:Int,tyep2:Int){ - val down = resources.getDrawable(R.drawable.common_filter_arrow_down) - val up = resources.getDrawable(R.drawable.common_filter_arrow_up) - when(type){ - 0 -> { - if(tyep2==0){ - mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, - null, up, null) - }else{ - mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - } - mContext?.let{ - if (mBinding.customFilterSelectHospital.text.toString()!="全部医院") { - mBinding.customFilterSelectHospital.setTextColor(it.resources.getColor(R.color.text_green_BD)) - }else{ - mBinding.customFilterSelectHospital.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - - mBinding.customFilterSelectHospital.setCompoundDrawablePadding(4) - mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - mBinding.customFilterSelectSick.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - mBinding.customFilterSelectSick.setCompoundDrawablePadding(4) - - } - 1 -> { - if(tyep2==0){ - mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, - null, up, null) - }else{ - mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - } - mContext?.let{ - if (mBinding.customFilterSelectDepartment.text.toString()!="全部科室") { - mBinding.customFilterSelectDepartment.setTextColor(it.resources.getColor(R.color.text_green_BD)) - }else{ - mBinding.customFilterSelectDepartment.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - - mBinding.customFilterSelectHospital.setCompoundDrawablePadding(4) - mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - - mBinding.customFilterSelectSick.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - mBinding.customFilterSelectSick.setCompoundDrawablePadding(4) - } - 2 -> { - if(tyep2==0){ - mBinding.customFilterSelectSick.setCompoundDrawablesWithIntrinsicBounds(null, - null, up, null) - }else{ - mBinding.customFilterSelectSick.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - } - mContext?.let{ - if (mBinding.customFilterSelectSick.text.toString()!="全部疾病") { - mBinding.customFilterSelectSick.setTextColor(it.resources.getColor(R.color.text_green_BD)) - }else{ - mBinding.customFilterSelectSick.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - mBinding.customFilterSelectSick.setCompoundDrawablePadding(4) - - mBinding.customFilterSelectHospital.setCompoundDrawablePadding(4) - mBinding.customFilterSelectHospital.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - - - mBinding.customFilterSelectDepartment.setCompoundDrawablesWithIntrinsicBounds(null, - null, down, null) - mBinding.customFilterSelectDepartment.setCompoundDrawablePadding(4) - - } - } - } - - fun setLeftData(list:ArrayList){ - mDepartmentListLeft.clear() - mDepartmentListLeft.addAll(list) - } - - fun setSickLeftData(list:ArrayList){ - mSickListLeft.clear() - mSickListLeft.addAll(list) - } - - fun setSickRightData(list:ArrayList){ - mSickListRight.clear() - mSickListRight.addAll(list) - mSeekDoctorSick3Adapter?.notifyDataSetChanged() - } - - fun setDepartRightData(list:ArrayList){ - mDepartmentListRight.clear() - mDepartmentListRight.addAll(list) - mSeekDoctorDepartmentAdapter3?.notifyDataSetChanged() - } - - fun setHospitalData(list:ArrayList){ - mHospitalList.clear() - mHospitalList.addAll(list) - } - - fun setDepartData(list:ArrayList){ - mDepartList.clear() - mDepartList.addAll(list) - } - - fun setSickData(list:ArrayList){ - mSickList.clear() - mSickList.addAll(list) - } - - fun hideHospitalFilter(){ - mBinding.customFilterSelectHospital.visibility=View.GONE - } - - fun refreshState(){ - when (mType2) { - 1 -> { - mContext?.let{ - mBinding.customFilterSelectMark.setTextColor(it.resources.getColor(R.color.text_green_BD)) - mBinding.customFilterSelectHot.setTextColor(it.resources.getColor(R.color.text_black_33)) - mBinding.customFilterSelectReply.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - 2 -> { - mContext?.let{ - mBinding.customFilterSelectMark.setTextColor(it.resources.getColor(R.color.text_black_33)) - mBinding.customFilterSelectHot.setTextColor(it.resources.getColor(R.color.text_green_BD)) - mBinding.customFilterSelectReply.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - 3 -> { - mContext?.let{ - mBinding.customFilterSelectMark.setTextColor(it.resources.getColor(R.color.text_black_33)) - mBinding.customFilterSelectHot.setTextColor(it.resources.getColor(R.color.text_black_33)) - mBinding.customFilterSelectReply.setTextColor(it.resources.getColor(R.color.text_green_BD)) - } - } - else -> {} - } - } - - fun setFilterListener( method: (bean: selectDictListByNHDSRequestBean) -> Unit){ - mMethod=method - } - fun setDoubleListListener( method: ((type:Int,id:String) -> Unit?)){ - mClickListener=method - } - - fun setDataBean(beans: selectDictListByNHDSRequestBean){ - bean=beans - } - - fun setDepartText(text:String,id:String=""){ - mBinding.customFilterSelectDepartment.text=text - mContext?.let { - mBinding.customFilterSelectDepartment.setTextColor(it.resources.getColor(R.color.text_green_BD)) - } - } - fun setDepartResettingText(text:String){ - mBinding.customFilterSelectDepartment.text=text - mContext?.let { - mBinding.customFilterSelectDepartment.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - - fun setSickResettingText(text:String){ - mBinding.customFilterSelectSick.text=text - mContext?.let { - mBinding.customFilterSelectSick.setTextColor(it.resources.getColor(R.color.text_black_33)) - } - } - - fun setSickText(text:String,id:String){ - mBinding.customFilterSelectSick.text=text - mContext?.let { - mBinding.customFilterSelectSick.setTextColor(it.resources.getColor(R.color.text_green_BD)) - } - } - - -} \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/view/DoctorBaseInfoView.kt b/app/src/main/java/com/xjjk/healthyclients/view/DoctorBaseInfoView.kt index 43a2d1e..46660bb 100644 --- a/app/src/main/java/com/xjjk/healthyclients/view/DoctorBaseInfoView.kt +++ b/app/src/main/java/com/xjjk/healthyclients/view/DoctorBaseInfoView.kt @@ -54,7 +54,7 @@ class DoctorBaseInfoView: LinearLayout { } } - fun getFollowView(): ImageButton { - return mBinding.btnFollow - } +// fun getFollowView(): ImageButton { +// return mBinding.btnFollow +// } } \ No newline at end of file diff --git a/app/src/main/java/com/xjjk/healthyclients/view/FuntionBlurbDialog.kt b/app/src/main/java/com/xjjk/healthyclients/view/FuntionBlurbDialog.kt new file mode 100644 index 0000000..7b6db90 --- /dev/null +++ b/app/src/main/java/com/xjjk/healthyclients/view/FuntionBlurbDialog.kt @@ -0,0 +1,101 @@ +package com.xjjk.healthyclients.view + +import android.app.AlertDialog +import android.content.Context +import android.graphics.Color +import android.graphics.drawable.ColorDrawable +import android.os.Build +import android.os.Bundle +import android.view.Gravity +import android.view.LayoutInflater +import android.view.View +import android.widget.LinearLayout +import androidx.databinding.DataBindingUtil +import com.xjjk.healthyclients.R +import com.xjjk.healthyclients.databinding.DialogFuntionBlurbViewBinding +import com.xjjk.healthyclients.superfuntion.toHtml + +/** + * 首页 功能简介弹窗 + */ +open class FuntionBlurbDialog constructor(context: Context +) : AlertDialog(context) { + lateinit var mOnAffirmClickListener: OnAffirmClickListener + protected lateinit var binding: DialogFuntionBlurbViewBinding + init { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + create() + } else { + onCreate(null) + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = DataBindingUtil.inflate(LayoutInflater.from(context), + R.layout.dialog_funtion_blurb_view, null, false) + setContentView(binding.root) + window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))//设置dialog背景透明 + window?.setLayout(context.resources.displayMetrics.widthPixels * 28/30, LinearLayout.LayoutParams.WRAP_CONTENT);//设置对话框大小 + binding.dialogConfirm7DayNoRemindLl.setOnClickListener{ + binding.dialogConfirm7DayNoRemindIv.setImageResource(R.drawable.ic_marital_state_select) + mOnAffirmClickListener?.onAffirmClick(0,this@FuntionBlurbDialog) +// this.cancel() + } + binding.dialogConfirm1MonthNoRemindLl.setOnClickListener{ + binding.dialogConfirm1MonthNoRemindIv.setImageResource(R.drawable.ic_marital_state_select) + mOnAffirmClickListener?.onAffirmClick(1,this@FuntionBlurbDialog) +// this.cancel() + } + binding.dialogConfirm6MonthNoRemindLl.setOnClickListener{ + mOnAffirmClickListener?.onAffirmClick(2,this@FuntionBlurbDialog) + binding.dialogConfirm6MonthNoRemindIv.setImageResource(R.drawable.ic_marital_state_select) +// this.cancel() + } + binding.dialogConfirmNoRemindLl.setOnClickListener{ + mOnAffirmClickListener?.onAffirmClick(3,this@FuntionBlurbDialog) + binding.dialogConfirmNoRemindIv.setImageResource(R.drawable.ic_marital_state_select) +// this.cancel() + } + binding.dialogConfirmClose.setOnClickListener{ +// mOnAffirmClickListener?.onAffirmClick(this@FuntionBlurbDialog) + this.cancel() + } +// binding.dialogConfirmCloseRoot.setOnClickListener{ +// mOnAffirmClickListener?.onCancelClick(this@FuntionBlurbDialog) +// this.cancel() +// } +// +// binding.dialogConfirmLlUnmarried.setOnClickListener { +// setMaritalState(0) +// } +// +// binding.dialogConfirmLlMarried.setOnClickListener { +// setMaritalState(1) +// } + setCancelable(false) + + } + + fun setOnAffirmClickListener(onAffirmClickListener: OnAffirmClickListener): FuntionBlurbDialog{ + this.mOnAffirmClickListener = onAffirmClickListener + return this + } + interface OnAffirmClickListener{ + fun onAffirmClick(type:Int,viewDialog: FuntionBlurbDialog) + } + + fun setContent(string: String){ + if (binding!=null) { + binding.dialogContent.text=string.toHtml() + } + } + + fun setTitle(string: String){ + if (binding!=null) { + binding.dialogTitle.text=string + } + } + + +} \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/ic_select_location.png b/app/src/main/res/drawable-xxhdpi/ic_select_location.png new file mode 100644 index 0000000..3ebaf34 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_select_location.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_user_contacts.png b/app/src/main/res/drawable-xxhdpi/ic_user_contacts.png new file mode 100644 index 0000000..94b019a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_user_contacts.png differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_normal.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_normal.jpg index 1d5bf7b..9b2681f 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_normal.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_normal.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_selected.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_selected.jpg index bad3f73..7f822ce 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_selected.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_emergency_selected.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_index_normal.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_index_normal.jpg index f631ea5..5b7ce51 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_index_normal.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_index_normal.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_index_selected.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_index_selected.jpg index a55aaed..a3e2b57 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_index_selected.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_index_selected.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_normal.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_normal.jpg index 9773071..f03acc6 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_normal.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_normal.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_selected.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_selected.jpg index 4d29730..fb37ddc 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_selected.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_monitor_selected.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_my_normal.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_my_normal.jpg index 5aafd3b..ac4e7dc 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_my_normal.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_my_normal.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/main_home_tab_my_selected.jpg b/app/src/main/res/drawable-xxhdpi/main_home_tab_my_selected.jpg index 0b8fb38..291ff71 100644 Binary files a/app/src/main/res/drawable-xxhdpi/main_home_tab_my_selected.jpg and b/app/src/main/res/drawable-xxhdpi/main_home_tab_my_selected.jpg differ diff --git a/app/src/main/res/drawable/ic_down_close.png b/app/src/main/res/drawable/ic_down_close.png new file mode 100644 index 0000000..8582395 Binary files /dev/null and b/app/src/main/res/drawable/ic_down_close.png differ diff --git a/app/src/main/res/layout/activity_all_doctor_info.xml b/app/src/main/res/layout/activity_all_doctor_info.xml new file mode 100644 index 0000000..ca77368 --- /dev/null +++ b/app/src/main/res/layout/activity_all_doctor_info.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_big_add_disease.xml b/app/src/main/res/layout/activity_big_add_disease.xml deleted file mode 100644 index 6b15239..0000000 --- a/app/src/main/res/layout/activity_big_add_disease.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_big_add_disease_details.xml b/app/src/main/res/layout/activity_big_add_disease_details.xml deleted file mode 100644 index a0e89e4..0000000 --- a/app/src/main/res/layout/activity_big_add_disease_details.xml +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_big_disease.xml b/app/src/main/res/layout/activity_big_disease.xml deleted file mode 100644 index 534dd3e..0000000 --- a/app/src/main/res/layout/activity_big_disease.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_filter_search_doctor.xml b/app/src/main/res/layout/activity_filter_search_doctor.xml deleted file mode 100644 index 8026353..0000000 --- a/app/src/main/res/layout/activity_filter_search_doctor.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_intervention_web.xml b/app/src/main/res/layout/activity_intervention_web.xml index ebc13a2..5370908 100644 --- a/app/src/main/res/layout/activity_intervention_web.xml +++ b/app/src/main/res/layout/activity_intervention_web.xml @@ -14,8 +14,7 @@ + app:darkStyle="@{true}"/> diff --git a/app/src/main/res/layout/activity_search_department.xml b/app/src/main/res/layout/activity_search_department.xml deleted file mode 100644 index bbb0536..0000000 --- a/app/src/main/res/layout/activity_search_department.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_search_disease.xml b/app/src/main/res/layout/activity_search_disease.xml deleted file mode 100644 index 6aeee77..0000000 --- a/app/src/main/res/layout/activity_search_disease.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_seek_doctor.xml b/app/src/main/res/layout/activity_seek_doctor.xml deleted file mode 100644 index d767554..0000000 --- a/app/src/main/res/layout/activity_seek_doctor.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_seek_doctor_department.xml b/app/src/main/res/layout/activity_seek_doctor_department.xml deleted file mode 100644 index 2eafa0b..0000000 --- a/app/src/main/res/layout/activity_seek_doctor_department.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_seek_doctor_disease.xml b/app/src/main/res/layout/activity_seek_doctor_disease.xml deleted file mode 100644 index 7fd2cfb..0000000 --- a/app/src/main/res/layout/activity_seek_doctor_disease.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_seek_doctor_hospital.xml b/app/src/main/res/layout/activity_seek_doctor_hospital.xml deleted file mode 100644 index a412a5f..0000000 --- a/app/src/main/res/layout/activity_seek_doctor_hospital.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_seek_doctor_search.xml b/app/src/main/res/layout/activity_seek_doctor_search.xml deleted file mode 100644 index 80b1023..0000000 --- a/app/src/main/res/layout/activity_seek_doctor_search.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_user_emergency_contact.xml b/app/src/main/res/layout/activity_user_emergency_contact.xml new file mode 100644 index 0000000..b793cc5 --- /dev/null +++ b/app/src/main/res/layout/activity_user_emergency_contact.xml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_doctors_guidance.xml b/app/src/main/res/layout/activity_user_sos_contacts.xml similarity index 62% rename from app/src/main/res/layout/activity_doctors_guidance.xml rename to app/src/main/res/layout/activity_user_sos_contacts.xml index f8d691f..38b3b3c 100644 --- a/app/src/main/res/layout/activity_doctors_guidance.xml +++ b/app/src/main/res/layout/activity_user_sos_contacts.xml @@ -10,26 +10,24 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> - + app:rightText="@{@string/title_user_add_contact}" + app:title="@{@string/title_user_info_contact}" /> + android:layout_height="wrap_content"> - + android:layout_height="wrap_content"/> + \ No newline at end of file diff --git a/app/src/main/res/layout/bottom_tab_item_layout.xml b/app/src/main/res/layout/bottom_tab_item_layout.xml index db96da3..46abbf6 100644 --- a/app/src/main/res/layout/bottom_tab_item_layout.xml +++ b/app/src/main/res/layout/bottom_tab_item_layout.xml @@ -8,10 +8,10 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_emergency.xml b/app/src/main/res/layout/fragment_emergency.xml index 80fa039..f3568e8 100644 --- a/app/src/main/res/layout/fragment_emergency.xml +++ b/app/src/main/res/layout/fragment_emergency.xml @@ -1,6 +1,7 @@ + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -76,93 +77,113 @@ android:src="@drawable/ic_emergency_seek_doctor" /> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_monitor.xml b/app/src/main/res/layout/fragment_monitor.xml index 317bdcc..6617e62 100644 --- a/app/src/main/res/layout/fragment_monitor.xml +++ b/app/src/main/res/layout/fragment_monitor.xml @@ -26,6 +26,10 @@ android:textSize="@dimen/txt18" android:textStyle="bold" android:background="#14BEBE" /> + - + \ No newline at end of file diff --git a/app/src/main/res/layout/item_recycle_seek_doctor_doctor_child.xml b/app/src/main/res/layout/item_recycle_seek_doctor_doctor_child.xml deleted file mode 100644 index 54e9749..0000000 --- a/app/src/main/res/layout/item_recycle_seek_doctor_doctor_child.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_user_contacts.xml b/app/src/main/res/layout/item_user_contacts.xml new file mode 100644 index 0000000..6ddd57f --- /dev/null +++ b/app/src/main/res/layout/item_user_contacts.xml @@ -0,0 +1,43 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_appointment_information.xml b/app/src/main/res/layout/view_appointment_information.xml index d092848..4d3e131 100644 --- a/app/src/main/res/layout/view_appointment_information.xml +++ b/app/src/main/res/layout/view_appointment_information.xml @@ -62,6 +62,7 @@ /> + ~ + ~ The software is licensed under the Mulan PSL v2. + ~ You can use this software according to the terms and conditions of the Mulan PSL v2. + ~ You may obtain a copy of Mulan PSL v2 at: + ~ http://license.coscl.org.cn/MulanPSL2 + ~ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + ~ PURPOSE. + ~ See the Mulan PSL v2 for more details. + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1609f7b..ae2b2ac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ - 健康长庆 + 健康油我 找专家 @@ -54,7 +54,7 @@ 用户评价 基本健康信息 图文咨询 - 小助手 + 全科医生 选择位置 位置 选择档案 @@ -112,7 +112,8 @@ 体检项目分析 历史记录 预警历史 - 健康干预 + 健康监测 + 全科医生主页 @@ -408,7 +409,7 @@ 预计开始时间 开始时间 约定时间:%s    %s~%s - 音频通话:%s    时长:%s + 视频通话:%s    时长:%s %s    %s~%s 请打开APP并保证网络流畅 预约人信息 @@ -464,7 +465,7 @@ %scm / %skg 快速咨询 下一步 - 请选择咨询人档案 + 请选择或新增咨询人档案 咨询人信息