feat(home): 首页智慧体重/健康档案入口接入H5并切换生产环境
- 智慧体重、健康档案及AI随访banner由占位页改为跳转对应H5页面, 携带加密参数并增加登录校验 - UrlConfig新增体重管理、健康档案H5地址,baseUrlType切换为PRODUCT - 版本号升级至1.0.15(1015)
This commit is contained in:
@@ -203,9 +203,22 @@ class HomeFragment :
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.img_left -> {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("title", "智慧体重")
|
||||
toActivity(EmptyActivity::class.java, bundle)
|
||||
if (DataStoreManager.isLogin()) {
|
||||
val value = mViewModel.enCryptInfoUrl.value
|
||||
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 -> {
|
||||
@@ -219,9 +232,22 @@ class HomeFragment :
|
||||
}
|
||||
|
||||
R.id.home_head_tab1 -> {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("title", "健康档案")
|
||||
toActivity(EmptyActivity::class.java, bundle)
|
||||
if (DataStoreManager.isLogin()) {
|
||||
val value = mViewModel.enCryptInfoUrl.value
|
||||
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 -> {
|
||||
@@ -356,10 +382,27 @@ class HomeFragment :
|
||||
startLoginActivity(requireContext())
|
||||
}
|
||||
}
|
||||
showBanner(mBinding.banner4, bannerList4) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("title", "AI随访")
|
||||
toActivity(EmptyActivity::class.java, bundle)
|
||||
showBanner(mBinding.banner4, bannerList4) {banner->
|
||||
if (DataStoreManager.isLogin()) {
|
||||
if (banner.jumpUrl.isEmpty()) {
|
||||
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 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"
|
||||
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 middleCheck = "healthcheck/" //test
|
||||
const val middle = "hb/" //product
|
||||
const val middleCheck = "hb/" //product
|
||||
//
|
||||
|
||||
var isOpenIm: Boolean = true
|
||||
|
||||
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 页面基础地址
|
||||
*/
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ ext {
|
||||
minSdkVersion = 26
|
||||
targetSdkVersion = 32
|
||||
compileSdkVersion = 33
|
||||
versionCode = 1014
|
||||
versionName = "1.0.14"
|
||||
versionCode = 1015
|
||||
versionName = "1.0.15"
|
||||
//Dependencies
|
||||
junitVersion = "4.12"
|
||||
lifecycleVersion = "2.6.0-alpha01"
|
||||
|
||||
Reference in New Issue
Block a user