feat(home): 首页智慧体重/健康档案入口接入H5并切换生产环境

- 智慧体重、健康档案及AI随访banner由占位页改为跳转对应H5页面,
  携带加密参数并增加登录校验
- UrlConfig新增体重管理、健康档案H5地址,baseUrlType切换为PRODUCT
- 版本号升级至1.0.15(1015)
This commit is contained in:
zhanglei
2026-09-04 11:35:40 +08:00
parent 3c90d9f1d3
commit b06a08b029
3 changed files with 83 additions and 14 deletions
@@ -203,9 +203,22 @@ class HomeFragment :
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.img_left -> { R.id.img_left -> {
val bundle = Bundle() if (DataStoreManager.isLogin()) {
bundle.putString("title", "智慧体重") val value = mViewModel.enCryptInfoUrl.value
toActivity(EmptyActivity::class.java, bundle) if (TextUtils.isEmpty(value)) {
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
showToast("网络错误")
return
}
requireContext().startWebActivity(
UrlConfig.getWeightManagementH5Url() + "?param=" + value,
isFull = true,
myTitle = "",
hideStatus = true
)
} else {
startLoginActivity(requireContext())
}
} }
R.id.img_right -> { R.id.img_right -> {
@@ -219,9 +232,22 @@ class HomeFragment :
} }
R.id.home_head_tab1 -> { R.id.home_head_tab1 -> {
val bundle = Bundle() if (DataStoreManager.isLogin()) {
bundle.putString("title", "健康档案") val value = mViewModel.enCryptInfoUrl.value
toActivity(EmptyActivity::class.java, bundle) if (TextUtils.isEmpty(value)) {
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
showToast("网络错误")
return
}
requireContext().startWebActivity(
UrlConfig.getHealthFileH5Url() + "?param=" + value,
isFull = true,
myTitle = "",
hideStatus = true
)
} else {
startLoginActivity(requireContext())
}
} }
R.id.home_head_tab2 -> { R.id.home_head_tab2 -> {
@@ -356,10 +382,27 @@ class HomeFragment :
startLoginActivity(requireContext()) startLoginActivity(requireContext())
} }
} }
showBanner(mBinding.banner4, bannerList4) { showBanner(mBinding.banner4, bannerList4) {banner->
val bundle = Bundle() if (DataStoreManager.isLogin()) {
bundle.putString("title", "AI随访") if (banner.jumpUrl.isEmpty()) {
toActivity(EmptyActivity::class.java, bundle) toActivity(EmptyActivity::class.java, Bundle())
} else {
val value = mViewModel.enCryptInfoUrl.value
if (TextUtils.isEmpty(value)) {
mViewModel.getSysEnCryptInfo(UrlConfig.getHomeBankH5Url())
showToast("网络错误")
} else {
requireContext().startWebActivity(
banner.jumpUrl + "?param=" + value,
isFull = true,
myTitle = "健康体检",
hideStatus = true
)
}
}
} else {
startLoginActivity(requireContext())
}
} }
@@ -37,19 +37,24 @@ object UrlConfig {
private const val PRODUCT_HOME_HEALTH_CHECK_H5 = "https://console-jkglpt.iosp.ydpt.tech/hb/healthcheckweb/index.html" private const val PRODUCT_HOME_HEALTH_CHECK_H5 = "https://console-jkglpt.iosp.ydpt.tech/hb/healthcheckweb/index.html"
private const val TEST_HOME_HEALTH_CHECK_H5 = "https://gstest.superwx.cn/healthcheckweb/index.html" private const val TEST_HOME_HEALTH_CHECK_H5 = "https://gstest.superwx.cn/healthcheckweb/index.html"
//体重智能管理
private const val PRODUCT_HOME_WEIGHT_MANAGEMENT_H5 = "https://console-jkglpt.iosp.ydpt.tech/hb/healthweightweb/index.html"
//健康档案
private const val PRODUCT_HOME_HEALTH_FILE_H5 = "https://console-jkglpt.iosp.ydpt.tech/hb/healthfileweb/index.html"
//手机银行 //手机银行
const val SECRET_KEY = "XJp3EHpcnwReXc1A" const val SECRET_KEY = "XJp3EHpcnwReXc1A"
private const val TEST_HOME_BANK_IP = "https://gstest.superwx.cn/" private const val TEST_HOME_BANK_IP = "https://gstest.superwx.cn/"
val baseUrlType: BaseUrlType = BaseUrlType.TEST val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT
// const val middle = "xj_health/" //test // const val middle = "xj_health/" //test
// const val middleCheck = "healthcheck/" //test // const val middleCheck = "healthcheck/" //test
const val middle = "hb/" //product const val middle = "hb/" //product
const val middleCheck = "hb/" //product const val middleCheck = "hb/" //product
//
var isOpenIm: Boolean = true var isOpenIm: Boolean = true
enum class BaseUrlType(val type: Int) { enum class BaseUrlType(val type: Int) {
@@ -136,6 +141,27 @@ object UrlConfig {
} }
} }
fun getWeightManagementH5Url(baseUrlType: BaseUrlType = BaseUrlType.PRODUCT): String {
return when (baseUrlType) {
BaseUrlType.DEBUG, BaseUrlType.TEST-> {
PRODUCT_HOME_WEIGHT_MANAGEMENT_H5
}
BaseUrlType.PRODUCT -> {
PRODUCT_HOME_WEIGHT_MANAGEMENT_H5
}
}
}
fun getHealthFileH5Url(baseUrlType: BaseUrlType = BaseUrlType.PRODUCT): String {
return when (baseUrlType) {
BaseUrlType.DEBUG, BaseUrlType.TEST-> {
PRODUCT_HOME_HEALTH_FILE_H5
}
BaseUrlType.PRODUCT -> {
PRODUCT_HOME_HEALTH_FILE_H5
}
}
}
/** /**
* 健康资讯 H5 页面基础地址 * 健康资讯 H5 页面基础地址
*/ */
+2 -2
View File
@@ -2,8 +2,8 @@ ext {
minSdkVersion = 26 minSdkVersion = 26
targetSdkVersion = 32 targetSdkVersion = 32
compileSdkVersion = 33 compileSdkVersion = 33
versionCode = 1014 versionCode = 1015
versionName = "1.0.14" versionName = "1.0.15"
//Dependencies //Dependencies
junitVersion = "4.12" junitVersion = "4.12"
lifecycleVersion = "2.6.0-alpha01" lifecycleVersion = "2.6.0-alpha01"