中建365-兑换码

dev_second
wlh 1 year ago
parent 417542f6ad
commit abc608e326

@ -40,9 +40,9 @@ android {
//.
JPUSH_CHANNEL : "developer-default",
OPPO_APPKEY : "OP-", // OPPOappkey
OPPO_APPID : "OP-", // OPPOappid
OPPO_APPSECRET: "OP-",//OPPOappsecret
OPPO_APPKEY : "OP-5c4377948c564b09ba4894642e0bb6fc", // OPPOappkey
OPPO_APPID : "OP-31015591", // OPPOappid
OPPO_APPSECRET: "OP-7240a5dfcb2b4017bd50193d18c74f79",//OPPOappsecret
XIAOMI_APPKEY : "MI-5992028541716",// appkey
XIAOMI_APPID : "MI-2882303761520285716", // appid

@ -1,54 +1,44 @@
package com.zj365.dc.activity
import android.Manifest
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.Uri
import android.os.Build
import android.text.TextUtils
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.cardview.widget.CardView
import androidx.fragment.app.Fragment
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import cn.jpush.android.api.JPushInterface
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.fastjson.JSON
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.blankj.utilcode.util.ArrayUtils
import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationMenuView
/*import com.lifesense.android.ble.core.serializer.AbstractMeasureData
import com.lifesense.android.ble.device.fatscale.model.WeightMeasureData*/
import com.tamsiree.rxkit.RxActivityTool
import com.tamsiree.rxkit.RxSPTool
import com.xty.base.act.BaseVmAct
import com.xty.base.dialog.AppUpdateDialog
import com.xty.base.dialog.DialogActivities
import com.xty.base.vp2.VpAdapter
import com.xty.common.Const
import com.xty.common.LogUtils
import com.xty.common.MMkvHelper
import com.xty.common.aMapUtils.AmapInit
import com.xty.common.app.MyApp
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BindDevEvent
import com.xty.common.event.LoginOrRegisterEvent
import com.xty.common.event.MeasureWeightEvent
import com.xty.common.event.MqttReceive
import com.xty.common.event.MyInfoEvent
import com.xty.common.util.CommonToastUtils
import com.xty.common.util.CommonUtils
import com.xty.common.util.ViewScreenshotUtils
import com.xty.network.model.InviteCustodyBean
import com.xty.network.utils.AppUtils
import com.zj365.dc.BuildConfig
@ -60,18 +50,13 @@ import com.zj365.dc.fragment.MessageFragment
import com.zj365.dc.fragment.MineFrag
import com.zj365.dc.fragment.ShopFragment
import com.zj365.dc.vm.MainVm
import com.zj365.health.act.binddevice.BaseDeviceBindListAct
import com.zj365.health.act.binddevice.BlueUtil
import com.zj365.health.weight.DialogTipNew
import com.zj365.mime.act.DevInfoAct
import io.reactivex.functions.Consumer
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import me.leolin.shortcutbadger.ShortcutBadger
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.Date
@Route(path = ARouterUrl.MAIN_ACT)
class MainActivity : BaseVmAct<MainVm>()/*, Consumer<AbstractMeasureData>*/ {
@ -487,8 +472,6 @@ class MainActivity : BaseVmAct<MainVm>()/*, Consumer<AbstractMeasureData>*/ {
}
}*/
override fun onDestroy() {
super.onDestroy()
AmapInit.stopLocation()

@ -35,6 +35,7 @@ import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission
import com.xty.common.bracelet.isGpsOpen
import com.xty.common.event.AddSuccessEvent
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BindDevEvent
import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.event.ChangeFamilyEvent
@ -1263,7 +1264,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
private var mDisposable: Disposable? = null
fun startUpdateHealthInfoLive(){
LogUtils.e("DynamicManagementFrag","刷新数据 disposable:${mDisposable}")
if(mDisposable == null){
Observable.interval(1000 * 60,60*1000,TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<Long>{
@ -1621,7 +1621,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
@Subscribe(threadMode = ThreadMode.MAIN)
fun loginOutChange(event: LoginOutEvent){
LogUtils.e(TAG,"loginOutChange")
isJob = false
cancelTimer()
@ -1659,6 +1658,20 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun backGroundEvent(event:BackGroundEvent){
if (event.isBackGround){
if(!TextUtils.isEmpty(showIdInfo)){
isJob = false
cancelTimer()
}
}else{
if(!TextUtils.isEmpty(showIdInfo)){
request()
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun bindDevSuccess(event: BindDevEvent){
// getXtInfo(showIdInfo)

@ -138,7 +138,6 @@
android:layout_marginBottom="@dimen/dp_85"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_10"
android:visibility="gone"
android:paddingBottom="@dimen/dp_10">
<TextView

@ -34,6 +34,7 @@ import com.umeng.commonsdk.UMConfigure
import com.xty.common.*
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.bracelet.getBluePermission
import com.xty.common.event.BackGroundEvent
import com.xty.common.event.BlueToothConnectEvent
import com.xty.common.receiver.BluetoothMonitorReceiver
import com.xty.network.utils.AppUtils
@ -120,6 +121,11 @@ class MyApp : Application() {
override fun onActivityStarted(p0: Activity) {
LogUtils.e("APP","前台呀")
if(activityCount == 0){
EventBus.getDefault().post(BackGroundEvent(false))
}
activityCount++
}
@ -133,6 +139,9 @@ class MyApp : Application() {
LogUtils.e("APP","后台")
activityCount--
LogUtils.e("APP","后台${activityCount}")
if(activityCount == 0){
EventBus.getDefault().post(BackGroundEvent(true))
}
}

@ -171,15 +171,17 @@ class ARouterUrl {
const val XT_OPEN = "/health/com/zj365/health/act/XTangOpenAct"
const val XT_HISTORY = "/health/com/zj365/health/act/XTangHistoryAct"
const val XT_UPLOAD = "/health/com/zj365/health/act/XTangUploadAct"
// const val XT_HOW_OPEN = "/health/com/zj365/health/act/XTangHowOpenAct"
const val XT_HOW_OPEN = "/health/com/zj365/health/act/XTangHowOpenAct"
//尿酸
const val NS_OPEN = "/health/com/zj365/health/act/NSuanOpenAct"
// const val NS_HOW_OPEN = "/health/com/zj365/health/act/NSuanHowOpenAct"
const val NS_HOW_OPEN = "/health/com/zj365/health/act/NSuanHowOpenAct"
const val NS_MESSAGE_PERFECT = "/health/com/zj365/health/act/NSuanMessagePerfectAct"
const val URIC_CALIBRATION_SUBMIT = "/health/com/xty/health/act/UricCalibrationSubmitAct"
const val URIC_CALIBRATION_HISTORY = "/health/com/xty/health/act/UricCalibrationHistoryAct"
const val XZ_OPEN = "/health/com/xty/health/act/XZhiOpenAct"
const val XZ_HOW_OPEN = "/health/com/xty/health/act/XZhiHowOpenAct"
const val BL_FAT_EXCEPTION_DATA = "/health/com/zj365/health/fragment/bloodlipid/BloodFatExceptionDataAct"
const val BL_ADJUST_RECORD ="/health/com/zj365/health/act/BloodLipidAdjustRecordsAct" //血脂校准记录
const val BL_ADJUST = "/health/com/zj365/health/act/BloodLipidAdjustAct" //血脂校准

@ -0,0 +1,4 @@
package com.xty.common.event
class BackGroundEvent(var isBackGround:Boolean) {
}

@ -80,6 +80,8 @@
<string name="xt_open">血糖开通</string>
<string name="xt_renew">血糖续费</string>
<string name="ns_renew">尿酸续费</string>
<string name="xz_renew">血脂续费</string>
<string name="xt_history">上传记录</string>
<string name="xt_upload">血糖上传</string>
<string name="xt_calibration">血糖校准</string>
@ -87,6 +89,7 @@
<string name="xd_detail">心电详情</string>·
<string name="blood_align_history">校准记录</string>
<string name="xz_open">血脂开通</string>
<string name="ns_open">尿酸开通</string>
<string name="ns_message_perfect">完善尿酸信息</string>
@ -184,7 +187,7 @@
<string name="sleep_oo_intro">参考值:≥95%</string>
<string name="xtang_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买无创血糖趋势监测服务卡,刮开加密区即可获得血糖兑换码或扫描血糖卡中的二维码获取血糖兑换码。</string>
<string name="nsuan_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买尿酸服务卡,刮开加密区即可获得尿酸兑换码或扫描尿酸服务卡中二维码获取尿酸兑换码</string>
<string name="xzhi_how_open">您可以在中健三六五指定合作机构或中健三六五商城购买血脂服务卡,刮开加密区即可获得血脂兑换码或扫描血脂服务卡中二维码获取血脂兑换码</string>
<string name="login_log">欢迎来到中健365</string>
<string name="private_info">同意《用户协议》和《隐私政策》</string>

@ -25,17 +25,17 @@ ext {
url = [
releaseTime: String.valueOf(new Date().format("ddHHmm")),
//
debug_url : "https://app.zhongjian365.com/app/",
release_url: "https://app.zhongjian365.com/app/",
h5_debug_url : "https://built.zhongjian365.com/",
h5_release_url : "https://built.zhongjian365.com/"
// debug_url : "https://app.zhongjian365.com/app/",
// release_url: "https://app.zhongjian365.com/app/",
//
// h5_debug_url : "https://built.zhongjian365.com/",
// h5_release_url : "https://built.zhongjian365.com/"
//
/*debug_url : "http://java01.zhongjian365.com/app/",
debug_url : "http://java01.zhongjian365.com/app/",
release_url: "http://java01.zhongjian365.com/app/",
h5_debug_url : "http://testbuilt.zhongjian365.com/",
h5_release_url : "http://testbuilt.zhongjian365.com/"*/
h5_release_url : "http://testbuilt.zhongjian365.com/"
]
@ -132,18 +132,18 @@ ext {
liBan : 'top.zibin:Luban:1.1.8',
bugly : 'com.tencent.bugly:crashreport:latest.release',
jpush_jcore : 'cn.jiguang.sdk:jcore:3.2.4',
jpush : 'cn.jiguang.sdk:jpush:4.7.0',
// jpush_jcore : 'cn.jiguang.sdk:jcore:3.2.4',
jpush : 'cn.jiguang.sdk:jpush:5.0.0',
hms : 'com.huawei.hms:push:6.3.0.304',
jpush_hms : 'cn.jiguang.sdk.plugin:huawei:4.7.0',
hms : 'com.huawei.hms:push:6.5.0.300',
jpush_hms : 'cn.jiguang.sdk.plugin:huawei:5.0.0',
oppo_gson : 'com.google.code.gson:gson:2.8.6',
oppo_codec : 'commons-codec:commons-codec:1.6',
annoation : 'androidx.annotation:annotation:1.1.0',
jpush_xiaomi : 'cn.jiguang.sdk.plugin:xiaomi:4.7.0',
// jpush_oppo : 'cn.jiguang.sdk.plugin:oppo:4.7.0',
jpush_xiaomi : 'cn.jiguang.sdk.plugin:xiaomi:5.0.0',
// jpush_oppo : 'cn.jiguang.sdk.plugin:oppo:5.0.0',
// jpush_vivo : 'cn.jiguang.sdk.plugin:vivo:4.7.0',
// jpush_honor : 'cn.jiguang.sdk.plugin:honor:4.7.0',
//

@ -351,7 +351,24 @@
<activity android:name=".act.UricCalibrationHistoryAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XTangOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.NSuanOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XZhiOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XZhiHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.XTangHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".act.NSuanHowOpenAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
</application>
</manifest>

@ -0,0 +1,35 @@
package com.zj365.health.act
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActNsuanHowOpenBinding
/**
* 尿酸如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.NS_HOW_OPEN)
class NSuanHowOpenAct : IBaseAct() {
val binding by lazy { ActNsuanHowOpenBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/ns.png")
}
}

@ -75,7 +75,7 @@ class NSuanOpenAct : BaseVmAct<NSuanVm>() , EasyPermissions.PermissionCallbacks
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
// RouteManager.goAct(ARouterUrl.NS_HOW_OPEN)
RouteManager.goAct(ARouterUrl.NS_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {

@ -236,7 +236,7 @@ class OpenOrRenewAct : BaseVmAct<XTangVm>() {
bundle.clear()
bundle.putString("id", userId)
bundle.putBoolean("isOpen", false)
RouteManager.goAct(ARouterUrl.XT_OPEN, bundle)
RouteManager.goAct(ARouterUrl.XZ_OPEN, bundle)
}
else ->{}
}
@ -260,8 +260,8 @@ class OpenOrRenewAct : BaseVmAct<XTangVm>() {
3 -> {
bundle.clear()
bundle.putString("id", userId)
bundle.putBoolean("isOpen", false)
RouteManager.goAct(ARouterUrl.XT_OPEN, bundle)
bundle.putBoolean("isOpen", true)
RouteManager.goAct(ARouterUrl.XZ_OPEN, bundle)
}
else ->{}
}

@ -0,0 +1,40 @@
package com.zj365.health.act
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActXtangHowOpenBinding
/**
* 血糖如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.XT_HOW_OPEN)
class XTangHowOpenAct : IBaseAct() {
val binding by lazy { ActXtangHowOpenBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
// intent.extras?.let {
// url = it.getString("url", "")
// titleName = it.getString("title", "")
// }
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/xt.png")
}
}

@ -107,7 +107,7 @@ class XTangOpenAct : BaseVmAct<XTangVm>(), EasyPermissions.PermissionCallbacks ,
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
// RouteManager.goAct(ARouterUrl.XT_HOW_OPEN)
RouteManager.goAct(ARouterUrl.XT_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {

@ -0,0 +1,36 @@
package com.zj365.health.act
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.arouter.ARouterUrl
import com.xty.common.setImage
import com.xty.common.setRoundImage
import com.zj365.health.databinding.ActXzhiHowOpenBinding
/**
* 尿酸如何获取兑换码 显示加载
*/
@Route(path = ARouterUrl.XZ_HOW_OPEN)
class XZhiHowOpenAct : IBaseAct() {
val binding by lazy { ActXzhiHowOpenBinding.inflate(layoutInflater) }
override fun setLayout(): View = binding.root
private var url = ""
private var titleName = "如何获取兑换码"
override fun initData() {
super.initData()
isDarkBar = true
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mIvBack.setOnClickListener { finish() }
binding.title.mTvTitle.text = titleName
binding.imgDesc.setImage(this,"https://image.zhongjian365.com/images/fwk/xz.png")
}
}

@ -0,0 +1,204 @@
package com.zj365.health.act
import android.Manifest
import android.content.Intent
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.xty.base.act.BaseVmAct
import com.xty.common.LogUtils
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.util.CommonToastUtils
import com.xty.common.event.BloodFilipOpenSuccessEvent
import com.xty.common.event.OpenOrRenewEvent
import com.xty.common.util.JumpPermissionManagement
import com.xty.common.xqr_code.XQRCodeAct
import com.xuexiang.xqrcode.XQRCode
import com.zj365.health.R
import com.zj365.health.databinding.ActXzhiOpenBinding
import com.zj365.health.vm.BloodFatVm
import com.zj365.health.weight.DialogTip
import org.greenrobot.eventbus.EventBus
import pub.devrel.easypermissions.EasyPermissions
/**
* 血脂卡片开通
*/
@Route(path = ARouterUrl.XZ_OPEN)
class XZhiOpenAct : BaseVmAct<BloodFatVm>() {
val binding by lazy { ActXzhiOpenBinding.inflate(layoutInflater) }
override fun setLayout() = binding.root
private var isOpen = false
var userId = ""
override fun initData() {
super.initData()
isDarkBar = true//设置状态栏字体为深色
intent.extras?.let {
isOpen = it.getBoolean("isOpen", false)
userId = it.getString("id").toString()
}
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = if (isOpen) {
getString(R.string.xz_renew)
} else {
getString(R.string.xz_open)
}
binding.title.mIvBack.apply {
this.setOnClickListener {
finish()
}
}
binding.mConfirm.isSelected = true
binding.mTvConvert.setOnClickListener(onClickListener)
binding.mPrivate.setOnClickListener(onClickListener)
binding.mConfirm.setOnClickListener(onClickListener)
binding.llScan.setOnClickListener {
startScan()
}
}
/**
* 扫码
*/
private fun startScan() {
if(EasyPermissions.hasPermissions(this,
Manifest.permission.CAMERA)){
XQRCodeAct.start(
this@XZhiOpenAct,
XQRCodeAct.QRCODE_AGREEMENT,
R.style.XQRCodeTheme_Custom
)
}else{
if (EasyPermissions.somePermissionDenied(this,
Manifest.permission.CAMERA)){
DialogTip(
this,
"中健365需要相机权限,需要打开设置页面么?"
) {
JumpPermissionManagement.GoToSetting(this@XZhiOpenAct)
}.show()
}else{
DialogTip(
this,
"中健365需要相机权限以便您使用扫一扫功能"
) {
EasyPermissions.requestPermissions(this,"",
0x00011,
Manifest.permission.CAMERA)
}.show()
}
}
}
private val onClickListener = View.OnClickListener {
when (it.id) {
//获取兑换码
R.id.mTvConvert -> {
bundle.clear()
RouteManager.goAct(ARouterUrl.XZ_HOW_OPEN)
}
//开通须知
R.id.mPrivate -> {
binding.mPrivate.isSelected = !binding.mPrivate.isSelected
}
//确定兑换
R.id.mConfirm -> {
confirm()
}
}
}
private fun confirm() {
if (binding.mTvActCode.text.isNullOrEmpty()) {
CommonToastUtils.showToast("请输入激活码")
return
}
if (!binding.mPrivate.isSelected) {
CommonToastUtils.showToast("请阅读开通须知")
return
}
mViewModel.renewOpenRequest(
userId,
5,
"EXCHANGE_CODE",
binding.mTvActCode.text.toString()
)
}
override fun liveObserver() {
mViewModel.renewOpenData.observe(this) {
if (null == it.data) {
LogUtils.e("操作异常!")
return@observe
}
val code = it.code
if (code != 0) {
if (isOpen) {
CommonToastUtils.showToast("续费失败:${it.msg}")
} else {
CommonToastUtils.showToast("开通失败:${it.msg}")
}
return@observe
} else {
if (isOpen) {
CommonToastUtils.showSucceedToast("续费成功")
} else {
CommonToastUtils.showSucceedToast("开通成功")
}
EventBus.getDefault().post(BloodFilipOpenSuccessEvent())
EventBus.getDefault().post(OpenOrRenewEvent())
finish()
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode === RESULT_OK) {
when (requestCode) {
XQRCodeAct.QRCODE_AGREEMENT -> {
when (data!!.getIntExtra(XQRCode.RESULT_TYPE, 0)) {
XQRCode.RESULT_SUCCESS -> {
try {
val result = data.extras!!.getString(XQRCode.RESULT_DATA)
LogUtils.d("扫描结果:$result")
if (!result.isNullOrEmpty()) {
val gson = Gson()
//设置扫描结果
binding.mTvActCode.setText(result)
} else {
CommonToastUtils.showToast("扫码失败,请重试...")
}
} catch (e: Exception) {
LogUtils.e("二维码扫描:$e")
CommonToastUtils.showToast("请确认二维码是否正确!")
}
}
XQRCode.RESULT_FAILED -> {
LogUtils.d("扫描失败")
}
}
}
}
}
}
}

@ -1,5 +1,6 @@
package com.zj365.health.vm
import android.text.TextUtils
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.network.model.*
@ -18,6 +19,9 @@ class BloodFatVm : BaseVm() {
val oneDayData by lazy { MutableLiveData<RespBody<BloodFatBean>>() }
val renewOpenData by lazy { MutableLiveData<RespBody<OpenOrRenewBean>>() }
/**
* 获取演示数据
*/
@ -129,6 +133,30 @@ class BloodFatVm : BaseVm() {
var body = apiInterface().getBloodFatFindNow(retrofits.getRequestBody(json.toString()))
return body.getLoginStatus(nowData)
}
/**
* 血糖尿酸血脂续费
*/
fun renewOpenRequest(
userId: String,//用户ID
subject: Int,//3血糖续费开通4尿酸续费开通5血脂续费开通
channelName: String,//支付方式ALIPAY_APP支付宝支付WEIXIN_APP微信支付EXCHANGE_CODE兑换码兑换
exchangeCode: String//兑换码
) {
startHttp {
val json = JSONObject()
json.put("id", userId)
json.put("subject", subject)
json.put("channelName", channelName)
if (!TextUtils.isEmpty(exchangeCode)) {
json.put("exchangeCode", exchangeCode)
}
val renewOpen = apiInterface().renewOpen(
retrofits.getRequestBody(
json.toString()
)
)
renewOpen.getCodeStatus(renewOpenData, nowData)
}
}
}

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#F2F6F7"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_21"
android:drawableStart="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/nsuan_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
/>
</LinearLayout>

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_18"
android:drawableLeft="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/dp_16" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/xtang_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:layout_gravity="center"
/>
</LinearLayout>

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#F2F6F7"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginStart="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_12"
android:background="@drawable/shape_round_white"
android:orientation="vertical"
android:padding="@dimen/dp_24">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_21"
android:drawableStart="@drawable/shape_head_tip_new"
android:drawablePadding="@dimen/dp_10"
android:text="如何获取兑换码 "
android:textColor="@color/col_313"
android:textSize="@dimen/sp_17"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/xzhi_how_open" />
</LinearLayout>
<ImageView
android:id="@+id/img_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
/>
</LinearLayout>

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/home_coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
android:id="@+id/title"
layout="@layout/white_title_dark_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginRight="@dimen/dp_24"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center|start"
android:text="兑换码开通"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_16"
tools:ignore="HardcodedText" />
<!-- 获取兑换码 -->
<TextView
android:id="@+id/mTvConvert"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/text_underline"
android:gravity="center"
android:text="如何获取兑换码?"
android:textColor="@color/col_25C"
android:textSize="@dimen/sp_12"
tools:ignore="HardcodedText" />
</LinearLayout>
<!-- 激活码 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_28"
android:layout_marginEnd="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_24"
android:background="@drawable/shape_btn_select_bg_inside_white"
android:orientation="horizontal">
<EditText
android:id="@+id/mTvActCode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_weight="1"
android:background="@null"
android:hint="请填写激活码"
android:paddingStart="@dimen/dp_12"
android:paddingTop="@dimen/dp_14"
android:paddingBottom="@dimen/dp_14"
android:textColor="@color/col_3b4"
android:textColorHint="@color/col_6B6"
android:textSize="@dimen/sp_13"
tools:ignore="HardcodedText,RtlSymmetry" />
<LinearLayout
android:id="@+id/llScan"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/dp_5"
android:background="@mipmap/ic_scan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_20"
android:gravity="center_vertical"
android:text="去扫码"
android:textColor="@color/col_8D0"
android:textSize="@dimen/sp_12"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<!-- 分割线 -->
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:background="@color/col_e4e4"
android:visibility="gone" />
<!-- 开通须知 -->
<TextView
android:id="@+id/mPrivate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_31"
android:layout_marginRight="@dimen/dp_24"
android:drawableStart="@drawable/selctor_check_sel"
android:drawablePadding="@dimen/dp_6"
android:text="开通须知:此兑换码仅限本人使用,开通完成之后,无法二次兑换。"
android:textColor="@color/col_c2c"
android:textSize="@dimen/sp_15"
tools:ignore="HardcodedText,UseCompatTextViewDrawableXml" />
<!-- 确定兑换 -->
<TextView
android:id="@+id/mConfirm"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_50"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_135"
android:background="@drawable/selector_login_btn"
android:gravity="center"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
tools:ignore="HardcodedText" />
</LinearLayout>

@ -1,4 +1,5 @@
<resources>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
Loading…
Cancel
Save