Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6b5966261 | ||
|
|
008408470a | ||
|
|
967aff4103 |
@@ -172,25 +172,23 @@ class HomeFragment :
|
|||||||
}
|
}
|
||||||
|
|
||||||
R.id.home_head_tab4 -> {
|
R.id.home_head_tab4 -> {
|
||||||
if (UrlConfig.baseUrlType == UrlConfig.BaseUrlType.TEST) {
|
if (DataStoreManager.isLogin()) {
|
||||||
if (DataStoreManager.isLogin()) {
|
val value = mViewModel.enCryptInfoUrl.value
|
||||||
val value = mViewModel.enCryptInfoUrl.value
|
if (TextUtils.isEmpty(value)) {
|
||||||
if (TextUtils.isEmpty(value)) {
|
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
|
||||||
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
|
showToast("网络错误")
|
||||||
showToast("网络错误")
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
requireContext().startWebActivity(UrlConfig.HOME_BANK_H5+"?param="+ value, myTitle = "健康银行")
|
|
||||||
} else {
|
|
||||||
startLoginActivity(requireContext())
|
|
||||||
}
|
}
|
||||||
return
|
requireContext().startWebActivity(
|
||||||
|
UrlConfig.getBankH5Url()+ "?param=" + value,
|
||||||
|
isFull = true,
|
||||||
|
myTitle = "健康银行",
|
||||||
|
hideStatus = true
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
startLoginActivity(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
val bundle = Bundle()
|
|
||||||
bundle.putString("title", "健康银行")
|
|
||||||
toActivity(EmptyActivity::class.java, bundle)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,10 +354,10 @@ class HomeFragment :
|
|||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
mViewModel.getHomeBannerList()
|
mViewModel.getHomeBannerList()
|
||||||
mViewModel.selectDoctorRecommendHome()
|
|
||||||
|
|
||||||
if (DataStoreManager.isLogin()) {
|
if (DataStoreManager.isLogin()) {
|
||||||
homeNoticeStartRepeat()
|
homeNoticeStartRepeat()
|
||||||
|
mViewModel.selectDoctorRecommendHome()
|
||||||
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
||||||
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
|
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
|
||||||
}
|
}
|
||||||
@@ -385,7 +383,9 @@ class HomeFragment :
|
|||||||
}
|
}
|
||||||
if (DataStoreManager.isLogin()) {
|
if (DataStoreManager.isLogin()) {
|
||||||
mViewModel.getHomeNoticeListRepeat()
|
mViewModel.getHomeNoticeListRepeat()
|
||||||
|
mViewModel.selectDoctorRecommendHome()
|
||||||
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
mViewModel.getHomeWatchInfo(DataStoreManager.getUserId())
|
||||||
|
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.xjjk.healthyclients.retrofit
|
package com.xjjk.healthyclients.retrofit
|
||||||
|
|
||||||
import com.sw.healthyclients.data.local.DataStoreManager
|
import com.sw.healthyclients.data.local.DataStoreManager
|
||||||
import com.xjjk.healthyclients.utils.UrlH5RouteUtils
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
|
||||||
object UrlConfig {
|
object UrlConfig {
|
||||||
@@ -28,7 +27,9 @@ object UrlConfig {
|
|||||||
|
|
||||||
// 安眼修改密码
|
// 安眼修改密码
|
||||||
const val ANYAN_CHANGE_PASSWORD_H5 = "https://sso.iosp.ydpt.tech/SSOManageClient/userController/changePassword"
|
const val ANYAN_CHANGE_PASSWORD_H5 = "https://sso.iosp.ydpt.tech/SSOManageClient/userController/changePassword"
|
||||||
const val HOME_BANK_H5 = "https://gstest.superwx.cn/healthbank/index.html"
|
|
||||||
|
private const val TEST_HOME_BANK_H5 = "https://gstest.superwx.cn/healthbank/index.html"
|
||||||
|
private const val PRODUCT_HOME_BANK_H5 = "https://console-jkglpt.iosp.ydpt.tech/hb/healthweb/index.html"
|
||||||
|
|
||||||
|
|
||||||
val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT
|
val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT
|
||||||
@@ -71,6 +72,17 @@ object UrlConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getBankH5Url(baseUrlType: BaseUrlType = BaseUrlType.PRODUCT): String {
|
||||||
|
return when (baseUrlType) {
|
||||||
|
BaseUrlType.DEBUG, BaseUrlType.TEST-> {
|
||||||
|
TEST_HOME_BANK_H5
|
||||||
|
}
|
||||||
|
BaseUrlType.PRODUCT -> {
|
||||||
|
PRODUCT_HOME_BANK_H5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 方便后续加一些其他逻辑
|
* 方便后续加一些其他逻辑
|
||||||
*/
|
*/
|
||||||
@@ -111,67 +123,26 @@ object UrlConfig {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun urlReplace(): String {
|
||||||
|
return getDefaultBaseUrl().replace("http://", "")
|
||||||
|
.replace("https://", "")
|
||||||
|
.replace("/", "")
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取评估报告模块地址
|
|
||||||
* @param type 0,健康风险 1,心理评估
|
|
||||||
*/
|
|
||||||
|
|
||||||
// fun getEvaluationReportUrl(type: Int): String {
|
|
||||||
// var httpUrl = getDefaultBaseUrl().toHttpUrl()
|
|
||||||
// return getH5Url() +
|
|
||||||
// "/?scheme=" + httpUrl.scheme +
|
|
||||||
// "&host=" + httpUrl.host +
|
|
||||||
// "&mobile=0" +
|
|
||||||
// "&tokenF=" + DataStoreManager.getToken() +
|
|
||||||
// "&type=" + type
|
|
||||||
// }
|
|
||||||
fun getKnowledgeDetailUrl(@UrlH5RouteUtils.RouteType routeType: String, map: MutableMap<String, Any?> = mutableMapOf()):String{
|
|
||||||
// return "http://192.168.1.22:9000/#/rich-text?id=sacsacasc&value=123132132"
|
|
||||||
var params=""
|
|
||||||
map.mapKeys {
|
|
||||||
params += "&${it.key}=${it.value}"
|
|
||||||
}
|
|
||||||
var httpUrl = getDefaultBaseUrl().toHttpUrl()
|
|
||||||
return getH5Url() + "/" +routeType+
|
|
||||||
"?scheme=" + httpUrl.scheme +
|
|
||||||
"&host=" + httpUrl.host +
|
|
||||||
"&tokenF=" + DataStoreManager.getToken() +
|
|
||||||
params
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
// fun getKnowledgeDetailUrl(@UrlH5RouteUtils.RouteType routeType: String, map: MutableMap<String, Any?> = mutableMapOf()):String{
|
||||||
* 获取健康干预-膳食 接口地址
|
//// return "http://192.168.1.22:9000/#/rich-text?id=sacsacasc&value=123132132"
|
||||||
*/
|
// var params=""
|
||||||
// fun getInterventionFoodUrl():String {
|
// map.mapKeys {
|
||||||
// return when (baseUrlType) {
|
// params += "&${it.key}=${it.value}"
|
||||||
// BaseUrlType.DEBUG,BaseUrlType.TEST -> {
|
|
||||||
// "https://vip.shuziweidao.com"
|
|
||||||
// }
|
|
||||||
// BaseUrlType.PRODUCT -> {
|
|
||||||
// "https://yyjk.shuziweidao.com/"
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
|
// var httpUrl = getDefaultBaseUrl().toHttpUrl()
|
||||||
|
// return getH5Url() + "/" +routeType+
|
||||||
|
// "?scheme=" + httpUrl.scheme +
|
||||||
|
// "&host=" + httpUrl.host +
|
||||||
|
// "&tokenF=" + DataStoreManager.getToken() +
|
||||||
|
// params
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
|
||||||
* H5访问地址
|
|
||||||
*/
|
|
||||||
fun getH5PdfUrl(): String {
|
|
||||||
// https://jkgy.wcrcnet.cn/static/mobile/indexSon?
|
|
||||||
// // scheme=http
|
|
||||||
// // s&host=jkgy.wcrcnet.cn
|
|
||||||
// // &hostAfter=gateway
|
|
||||||
// // &pdfUrl=temp/20240530/AED%E4%BD%BF%E7%94%A8.pdf_1717056401896.pdf
|
|
||||||
|
|
||||||
val baseUrl = getH5BaseUrl(baseUrlType) + "/static/mobile/indexSon?"
|
|
||||||
var httpUrl = getDefaultBaseUrl().toHttpUrl()
|
|
||||||
return baseUrl +
|
|
||||||
"scheme=" + httpUrl.scheme +
|
|
||||||
"&host=" + httpUrl.host +
|
|
||||||
"&title=" + "文件详情" +
|
|
||||||
"&pdfUrl="
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -793,16 +793,16 @@ fun startEmergencySeekDoctorDetailsActivity(context: Context, id: String, sessio
|
|||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
* Web页面 source == 1 绿色主题 darkStyle=false 白色顶部
|
* Web页面 darkStyle=false 白色顶部
|
||||||
*/
|
*/
|
||||||
fun Context.startWebActivity(url: String, scale: Boolean = false,myTitle:String="", source: Int = 0,darkStyle: Boolean = true,isFull:Boolean=false) {
|
fun Context.startWebActivity(url: String, scale: Boolean = false,myTitle:String="",darkStyle: Boolean = true,isFull:Boolean=false,hideStatus:Boolean=false) {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString("url", url)
|
bundle.putString("url", url)
|
||||||
bundle.putBoolean("Scale", scale)
|
bundle.putBoolean("Scale", scale)
|
||||||
bundle.putInt("source", source)
|
|
||||||
bundle.putString("title", myTitle)
|
bundle.putString("title", myTitle)
|
||||||
bundle.putBoolean("darkStyle", darkStyle)//主题
|
bundle.putBoolean("darkStyle", darkStyle)//主题
|
||||||
bundle.putBoolean("isFull", isFull)//是否全屏
|
bundle.putBoolean("isFull", isFull)//是否全屏
|
||||||
|
bundle.putBoolean("hideStatus", hideStatus)//是否隐藏状态栏
|
||||||
startActivity(this, bundle = bundle, targetClass = WebActivity::class.java)
|
startActivity(this, bundle = bundle, targetClass = WebActivity::class.java)
|
||||||
}
|
}
|
||||||
///**
|
///**
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.xjjk.healthyclients.ui.activity
|
package com.xjjk.healthyclients.ui.activity
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo
|
import android.content.pm.ActivityInfo
|
||||||
import android.content.res.Configuration
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.Color
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -70,20 +68,20 @@ class WebActivity : BaseVMBActivity<WebViewModel, ActivityWebBinding>(R.layout.a
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dataBindingFinish() {
|
override fun dataBindingFinish() {
|
||||||
val source = intent.getIntExtra("source", 0)
|
|
||||||
customTitle = intent.getStringExtra("title")
|
customTitle = intent.getStringExtra("title")
|
||||||
if (source == 1) {//深绿色
|
|
||||||
mBinding.toolbarLay.rlTitleLay.setBackgroundColor(Color.parseColor("#117474"))
|
|
||||||
}
|
|
||||||
mBinding.toolbarLay.darkStyle = intent.getBooleanExtra("darkStyle", true)
|
mBinding.toolbarLay.darkStyle = intent.getBooleanExtra("darkStyle", true)
|
||||||
if (intent.getBooleanExtra("isFull", false)) {
|
if (intent.getBooleanExtra("isFull", false)) {
|
||||||
mBinding.toolbarLay.root.visibility = View.GONE
|
mBinding.toolbarLay.root.visibility = View.GONE
|
||||||
mBinding.statusView.visibility = View.VISIBLE
|
if (intent.getBooleanExtra("hideStatus", false)) {
|
||||||
|
mBinding.statusView.visibility = View.GONE
|
||||||
val statusBarHeight = StatusbarUtil.getStatusBarHeight(this)
|
setTransparentStatusBar(true,false)
|
||||||
val layoutParams = mBinding.statusView.layoutParams
|
} else {
|
||||||
layoutParams.height = statusBarHeight
|
mBinding.statusView.visibility = View.VISIBLE
|
||||||
mBinding.statusView.layoutParams = layoutParams
|
val statusBarHeight = StatusbarUtil.getStatusBarHeight(this)
|
||||||
|
val layoutParams = mBinding.statusView.layoutParams
|
||||||
|
layoutParams.height = statusBarHeight
|
||||||
|
mBinding.statusView.layoutParams = layoutParams
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,14 +96,14 @@ class WebActivity : BaseVMBActivity<WebViewModel, ActivityWebBinding>(R.layout.a
|
|||||||
/**
|
/**
|
||||||
* 监听横竖屏切换改变状态栏,页面本身设置为强制竖屏模式,触发切换只存在于H5中视频的全屏播放,全屏播放时需要为透明状态栏
|
* 监听横竖屏切换改变状态栏,页面本身设置为强制竖屏模式,触发切换只存在于H5中视频的全屏播放,全屏播放时需要为透明状态栏
|
||||||
*/
|
*/
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
// override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
super.onConfigurationChanged(newConfig)
|
// super.onConfigurationChanged(newConfig)
|
||||||
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {//横屏
|
// if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {//横屏
|
||||||
setTransparentStatusBar(isTransparent = true, isStatusBarDarkFont = false)
|
// setTransparentStatusBar(isTransparent = true, isStatusBarDarkFont = false)
|
||||||
} else {//竖屏
|
// } else {//竖屏
|
||||||
setTransparentStatusBar(isTransparent = false, isStatusBarDarkFont = false)
|
// setTransparentStatusBar(isTransparent = false, isStatusBarDarkFont = false)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
override fun onBackEvent() {
|
override fun onBackEvent() {
|
||||||
if (!mAgentWeb.back()) {
|
if (!mAgentWeb.back()) {
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ class AndroidInterface(val agentWeb: AgentWeb, val context: Activity) {
|
|||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
fun finishActivity() {
|
fun finishActivity() {
|
||||||
context.runOnUiThread {
|
context.runOnUiThread {
|
||||||
EventBus.getDefault().post(WebReloadEvent())
|
|
||||||
context.finish()
|
context.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,190 +0,0 @@
|
|||||||
package com.xjjk.healthyclients.utils
|
|
||||||
|
|
||||||
import androidx.annotation.StringDef
|
|
||||||
|
|
||||||
object UrlH5RouteUtils {
|
|
||||||
/**
|
|
||||||
* 知识库文章详情
|
|
||||||
*/
|
|
||||||
const val RICH_TEXT = "knowledge-page"
|
|
||||||
/**
|
|
||||||
* 岗位健康详情页
|
|
||||||
*/
|
|
||||||
const val JOBDETAILS = "jobDetails"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 知识库健-康答题
|
|
||||||
*/
|
|
||||||
const val HEALTH_QUESTION = "mergeQuestion/physical-questions"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 知识库答题记录
|
|
||||||
*/
|
|
||||||
const val ANSWER_RECORDSLIST = "answer-recordsList"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 膳食-慢病预警测评结果
|
|
||||||
*/
|
|
||||||
const val DISEASE_ASSESSMENT_RESULT = "disease-assessment-result"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 膳食-体重管理
|
|
||||||
*/
|
|
||||||
const val FOOD_OVERWEIGHT_INTERVENTION = "overweightIntervention"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运动-运动平台
|
|
||||||
*/
|
|
||||||
const val SPORT_PLATFORM = "sports-platform"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运动-运动排名
|
|
||||||
*/
|
|
||||||
const val SPORT_RANKING = "sport-ranking"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 步数
|
|
||||||
*/
|
|
||||||
const val STEP_STATISTICS = "step-statistics"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 心理-心理评估
|
|
||||||
*/
|
|
||||||
const val MENTAL_PSYCHOLOGICAL_ASSESSMENT = "assessment-home"
|
|
||||||
/**
|
|
||||||
* 心理-心理评估-基础信息basic-information
|
|
||||||
*/
|
|
||||||
const val MENTAL_PSYCHOLOGICAL_ASSESSMENT_BASIC_INFORMATION = "basic-information"
|
|
||||||
/**
|
|
||||||
* 心理-心理评估-测评模式self-evaluation
|
|
||||||
*/
|
|
||||||
const val MENTAL_PSYCHOLOGICAL_ASSESSMENT_SELF_EVALUATION = "self-evaluation"
|
|
||||||
/**
|
|
||||||
* 心理-知识答题-答题模式
|
|
||||||
*/
|
|
||||||
const val MENTAL_KNOWLEDGE_CHOOSE_TOPIC = "choose-topic"
|
|
||||||
/**
|
|
||||||
* 心理-心理评估-测评历史reportHistory
|
|
||||||
*/
|
|
||||||
const val MENTAL_PSYCHOLOGICAL_ASSESSMENT_REPORTHISTORY = "reportHistory"
|
|
||||||
/**
|
|
||||||
* 心理-知识答题-答题历史
|
|
||||||
*/
|
|
||||||
const val MENTAL_KNOWLEDGE_ANSWER_HISTORY = "answer-history"
|
|
||||||
/**
|
|
||||||
* 心理-心理评估-单位组织task
|
|
||||||
*/
|
|
||||||
const val MENTAL_PSYCHOLOGICAL_ASSESSMENT_TASK = "task"
|
|
||||||
/**
|
|
||||||
* 心理-知识答题-单位组织task
|
|
||||||
*/
|
|
||||||
const val MENTAL_KNOWLEDGE_TASK_TOPIC = "task-topic"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 心理-规律起居
|
|
||||||
*/
|
|
||||||
const val MENTAL_REGULAR_LIVING = "livingIndependent"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 糖尿病-血糖监测
|
|
||||||
*/
|
|
||||||
const val DIABETES_BLOOD_GLUCOSE_MONITORING = "bloodGlucose"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 糖尿病-信号预警
|
|
||||||
*/
|
|
||||||
const val DIABETES_SIGNAL_WARNING = "health"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 癌症-病因溯源
|
|
||||||
*/
|
|
||||||
const val CANCER_ETIOLOGICAL_TRACING = "etiological"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 癌症-免疫预警
|
|
||||||
*/
|
|
||||||
const val CANCER_IMMUNE_EARLY_WARNING = "immuneWarning"
|
|
||||||
/**
|
|
||||||
* 知识-体检可视化
|
|
||||||
*/
|
|
||||||
const val PHYSICAL_EXAMINATION_HOME = "physicalExaminationIndex"
|
|
||||||
/**
|
|
||||||
* 心血管-吃动平衡
|
|
||||||
*/
|
|
||||||
const val CARDIOVASCULAR_EATING_BALANCE = "healthIndependentC"
|
|
||||||
/**
|
|
||||||
* 随访记录详情
|
|
||||||
*/
|
|
||||||
const val INTERVENTION_FOLLOW = "follow"
|
|
||||||
/**
|
|
||||||
* 就诊记录详情
|
|
||||||
*/
|
|
||||||
const val INTERVENTION_TREATMENTDETAIL = "treatmentDetail"
|
|
||||||
/**
|
|
||||||
* 急救培训开始答题
|
|
||||||
*/
|
|
||||||
const val HEALTH_ANSWER = "mergeQuestion/physical-answer"
|
|
||||||
/**
|
|
||||||
* 癌症-信号预判
|
|
||||||
*/
|
|
||||||
const val CANCER_SIGNAL_PREDICTION = "mergeQuestion/home-prediction"
|
|
||||||
/**
|
|
||||||
* 癌症-免疫预警
|
|
||||||
*/
|
|
||||||
const val INTERVENTION_IMMUNE_WARNING = "mergeQuestion/immune-warning"
|
|
||||||
/**
|
|
||||||
* 病因溯源填写问卷
|
|
||||||
*/
|
|
||||||
const val IMAGE_TRACEABILITY = "mergeQuestion/image-traceability"
|
|
||||||
/**
|
|
||||||
* 急救培训答题回顾
|
|
||||||
*/
|
|
||||||
const val HEALTH_ANSWER_REVIEW = "mergeQuestion/physical-review"
|
|
||||||
/**
|
|
||||||
* 吃动平衡问卷调查
|
|
||||||
*/
|
|
||||||
const val Eating_ANSWER_REVIEW = "mergeQuestion/eating-balance"
|
|
||||||
/**
|
|
||||||
* 心理知识答题-知识详情
|
|
||||||
*/
|
|
||||||
const val KNOWLEDGE_DETAIL = "knowledge-detail"
|
|
||||||
/**
|
|
||||||
* 心血管-防范心梗问卷
|
|
||||||
*/
|
|
||||||
const val HEART_ATTACK = "heart-attack"
|
|
||||||
/**
|
|
||||||
* 心血管-风险详情
|
|
||||||
*/
|
|
||||||
const val HEART_FACTORS = "heart-factors"
|
|
||||||
|
|
||||||
|
|
||||||
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION)
|
|
||||||
@MustBeDocumented
|
|
||||||
@StringDef(
|
|
||||||
RICH_TEXT,
|
|
||||||
JOBDETAILS, HEALTH_QUESTION, ANSWER_RECORDSLIST, DISEASE_ASSESSMENT_RESULT,
|
|
||||||
SPORT_RANKING, STEP_STATISTICS, MENTAL_PSYCHOLOGICAL_ASSESSMENT, SPORT_PLATFORM, MENTAL_REGULAR_LIVING,
|
|
||||||
DIABETES_BLOOD_GLUCOSE_MONITORING, DIABETES_SIGNAL_WARNING, CANCER_ETIOLOGICAL_TRACING,
|
|
||||||
CANCER_IMMUNE_EARLY_WARNING, FOOD_OVERWEIGHT_INTERVENTION, PHYSICAL_EXAMINATION_HOME,
|
|
||||||
CARDIOVASCULAR_EATING_BALANCE,
|
|
||||||
INTERVENTION_FOLLOW,
|
|
||||||
INTERVENTION_TREATMENTDETAIL,
|
|
||||||
HEALTH_ANSWER,
|
|
||||||
CANCER_SIGNAL_PREDICTION,
|
|
||||||
INTERVENTION_IMMUNE_WARNING,
|
|
||||||
IMAGE_TRACEABILITY,
|
|
||||||
HEALTH_ANSWER_REVIEW,
|
|
||||||
Eating_ANSWER_REVIEW
|
|
||||||
,
|
|
||||||
INTERVENTION_TREATMENTDETAIL,
|
|
||||||
MENTAL_PSYCHOLOGICAL_ASSESSMENT_BASIC_INFORMATION,
|
|
||||||
MENTAL_PSYCHOLOGICAL_ASSESSMENT_SELF_EVALUATION,
|
|
||||||
MENTAL_PSYCHOLOGICAL_ASSESSMENT_REPORTHISTORY,
|
|
||||||
MENTAL_PSYCHOLOGICAL_ASSESSMENT_TASK,
|
|
||||||
KNOWLEDGE_DETAIL,MENTAL_KNOWLEDGE_CHOOSE_TOPIC,MENTAL_KNOWLEDGE_ANSWER_HISTORY,MENTAL_KNOWLEDGE_TASK_TOPIC,HEART_ATTACK,HEART_FACTORS
|
|
||||||
)
|
|
||||||
@kotlin.annotation.Retention(AnnotationRetention.SOURCE)
|
|
||||||
annotation class RouteType
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,7 @@ import androidx.databinding.DataBindingUtil
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import com.sw.healthyclients.adapter.common.ViewPagerAdapter
|
import com.sw.healthyclients.adapter.common.ViewPagerAdapter
|
||||||
import com.sw.healthyclients.bean.common.TabItemBean
|
import com.sw.healthyclients.bean.common.TabItemBean
|
||||||
|
import com.sw.healthyclients.data.local.DataStoreManager
|
||||||
import com.xjjk.healthyclients.R
|
import com.xjjk.healthyclients.R
|
||||||
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean
|
||||||
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
import com.xjjk.healthyclients.bean.home.WatchInfoBean
|
||||||
@@ -24,10 +25,12 @@ import org.greenrobot.eventbus.EventBus
|
|||||||
class HomeWatchView(context: Context?, attrs: AttributeSet?) :
|
class HomeWatchView(context: Context?, attrs: AttributeSet?) :
|
||||||
RelativeLayout(context, attrs, 0), ViewPagerAdapter.OnCreateFragmentListener {
|
RelativeLayout(context, attrs, 0), ViewPagerAdapter.OnCreateFragmentListener {
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
companion object {
|
||||||
/** 自动轮播间隔时间(毫秒) */
|
/** 自动轮播间隔时间(毫秒) */
|
||||||
private const val AUTO_PLAY_INTERVAL = 5000L
|
private const val AUTO_PLAY_INTERVAL = 5000L
|
||||||
}
|
}
|
||||||
|
private var hasWatch :Boolean=false
|
||||||
|
|
||||||
var mContext: Context? = context
|
var mContext: Context? = context
|
||||||
var mBinding: LayoutHomeItemWatchBinding = DataBindingUtil.inflate(
|
var mBinding: LayoutHomeItemWatchBinding = DataBindingUtil.inflate(
|
||||||
@@ -64,9 +67,19 @@ class HomeWatchView(context: Context?, attrs: AttributeSet?) :
|
|||||||
mBinding.viewPager.visibility = View.GONE
|
mBinding.viewPager.visibility = View.GONE
|
||||||
stopAutoPlay()
|
stopAutoPlay()
|
||||||
} else {
|
} else {
|
||||||
mBinding.viewPager.visibility = View.VISIBLE
|
if (!DataStoreManager.isLogin()) {
|
||||||
mBinding.emptyText.visibility = View.GONE
|
mBinding.viewPager.visibility = View.GONE
|
||||||
startAutoPlay()
|
mBinding.emptyText.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.text = "暂未登录"
|
||||||
|
}else if (hasWatch) {
|
||||||
|
mBinding.viewPager.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.visibility = View.GONE
|
||||||
|
startAutoPlay()
|
||||||
|
} else {
|
||||||
|
mBinding.viewPager.visibility = View.GONE
|
||||||
|
mBinding.emptyText.visibility = View.VISIBLE
|
||||||
|
mBinding.emptyText.text = "您目前未配备智能穿戴设备"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,26 +26,57 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="30dp">
|
android:paddingBottom="30dp">
|
||||||
|
|
||||||
<ImageView
|
<com.allen.library.shape.ShapeRelativeLayout
|
||||||
android:id="@+id/head_img"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="450dp"
|
||||||
|
app:shapeGradientAngle="top_bottom"
|
||||||
|
app:shapeGradientCenterColor="#3BBCB7"
|
||||||
|
app:shapeGradientEndColor="#FFFFFF"
|
||||||
|
app:shapeGradientStartColor="#22C8A0"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:adjustViewBounds="true"
|
android:layout_marginTop="45dp">
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@drawable/icon_home_head" />
|
<ImageView
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@mipmap/home_head_img1" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@mipmap/home_head_img2" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- <ImageView-->
|
||||||
|
<!-- android:id="@+id/head_img"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:adjustViewBounds="true"-->
|
||||||
|
<!-- android:scaleType="fitXY"-->
|
||||||
|
<!-- android:src="@drawable/icon_home_head" />-->
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="135dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.allen.library.shape.ShapeRelativeLayout
|
<com.allen.library.shape.ShapeRelativeLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/layout_notice"
|
android:id="@+id/layout_notice"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
|
android:visibility="gone"
|
||||||
app:shapeCornersRadius="8dp"
|
app:shapeCornersRadius="8dp"
|
||||||
app:shapeGradientAngle="top_bottom"
|
app:shapeGradientAngle="top_bottom"
|
||||||
app:shapeGradientEndColor="#F2FFFD"
|
app:shapeGradientEndColor="#F2FFFD"
|
||||||
@@ -111,10 +142,11 @@
|
|||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginTop="10dp" />
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
<com.xjjk.healthyclients.view.HomeWatchView
|
<com.xjjk.healthyclients.view.HomeWatchView
|
||||||
android:id="@+id/watch_view"
|
android:id="@+id/watch_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<com.youth.banner.Banner
|
<com.youth.banner.Banner
|
||||||
android:id="@+id/banner3"
|
android:id="@+id/banner3"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 91 KiB |
Reference in New Issue
Block a user