中建365-二期开发-优化相关页面

develop
wlh 2 years ago
parent 92f3f6f0f0
commit d187dadab9

@ -1,32 +1,23 @@
package com.zj365.dc.activity.shop package com.zj365.dc.activity.shop
import android.content.Intent import android.content.Intent
import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.tamsiree.rxkit.RxActivityTool import com.tamsiree.rxkit.RxActivityTool
import com.xty.base.act.BaseTenCentWebViewActivity import com.xty.base.act.BaseTenCentWebViewActivity
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.model.ChooseAddressBean import com.xty.network.model.ChooseAddressBean
import com.xty.base.model.ChooseCouponBean import com.xty.base.model.ChooseCouponBean
import com.xty.base.model.CreateOrderBean import com.xty.base.model.CreateOrderBean
import com.xty.base.utils.PayUtils import com.xty.base.utils.PayUtils
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.ReChangeEvent import com.xty.common.event.ReChangeEvent
import com.xty.common.setImage import com.xty.common.setImage
import com.xty.common.util.SpannableUtils
import com.xty.network.model.ShopGoodsOrderBean
import com.zj365.dc.BuildConfig import com.zj365.dc.BuildConfig
import com.zj365.dc.activity.DeviceChoiceAct
import com.zj365.dc.databinding.ActCreateGoodsOrderBinding import com.zj365.dc.databinding.ActCreateGoodsOrderBinding
import com.zj365.dc.vm.ShopMallVm import com.zj365.dc.vm.ShopMallVm
import com.zj365.health.R
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
@ -41,6 +32,8 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
var bottomSheetDialog: BottomSheetDialog? = null var bottomSheetDialog: BottomSheetDialog? = null
var hasCoup: Int = 2
companion object{ companion object{
const val REQUEST_ADDRESS = 0x000011 const val REQUEST_ADDRESS = 0x000011
const val REQUEST_COUP = 0x000012 const val REQUEST_COUP = 0x000012
@ -51,6 +44,21 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
PayUtils(this).payForGoods(it.data.pay_price.toFloat(),it.data.order_no) PayUtils(this).payForGoods(it.data.pay_price.toFloat(),it.data.order_no)
} }
mViewModel.hasCouponLiveData.observe(this){
hasCoup = it.data
if (it.data == 2){ //1有 2无
binding.tvDiscounts.text = "暂无优惠券"
}else{
binding.tvDiscounts.text = "可用优惠券"
}
}
mViewModel.defaultAddressLiveData.observe(this){
addrId = it.data.id
binding.tvChooseAddress.text = "${it.data.province}${it.data.city}${it.data.district}${it.data.address}"
}
} }
override fun initView() { override fun initView() {
@ -78,11 +86,14 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
binding.tvPlatformDiscounts.text = "${(bean.ori_price * bean.skuNum) - (bean.skuPrice * bean.skuNum)}" binding.tvPlatformDiscounts.text = "${(bean.ori_price * bean.skuNum) - (bean.skuPrice * bean.skuNum)}"
if (bean.delivery_mode == 0){ //0,无需发货1需要发货 if (bean.delivery_mode == 0){ //0,无需发货1需要发货
// binding.rxAddress.visibility = View.GONE binding.rxAddress.visibility = View.GONE
}else{ }else{
binding.rxAddress.visibility = View.VISIBLE binding.rxAddress.visibility = View.VISIBLE
mViewModel.getDefaultAddress()
} }
mViewModel.hasCoupon()
} }
@ -104,12 +115,15 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
} }
binding.tvDiscounts.setOnClickListener { binding.tvDiscounts.setOnClickListener {
bundle.clear() if(hasCoup == 1){
bundle.putString( bundle.clear()
"web_site_url", bundle.putString(
"${BuildConfig.h5url}pages/index/index?pageId=coupon&type=order" "web_site_url",
) "${BuildConfig.h5url}pages/index/index?pageId=coupon&type=order"
RouteManager.goActRequest(ARouterUrl.H5_ACT, this@CreateGoodsOrderAct,REQUEST_COUP,bundle) )
RouteManager.goActRequest(ARouterUrl.H5_ACT, this@CreateGoodsOrderAct,REQUEST_COUP,bundle)
}
} }
} }
@ -141,6 +155,10 @@ class CreateGoodsOrderAct : BaseVmAct<ShopMallVm>() {
if (couponBean != null) { if (couponBean != null) {
couponsId = couponBean.id couponsId = couponBean.id
binding.tvDiscounts.text = "可优惠${couponBean.as_amount}" binding.tvDiscounts.text = "可优惠${couponBean.as_amount}"
bean?.let {
binding.tvPlatformDiscounts.text = "${(it.ori_price * bean!!.skuNum) - (it.skuPrice * it.skuNum) - couponBean.as_amount}"
}
} }
} }
} }

@ -12,7 +12,7 @@ import org.w3c.dom.Text
class ShopGoodsAdapter : BaseAdapter<GoodsRecordsBean.GoodsBean>(R.layout.item_shop_list) { class ShopGoodsAdapter : BaseAdapter<GoodsRecordsBean.GoodsBean>(R.layout.item_shop_list) {
override fun convert(holder: BaseViewHolder, item: GoodsRecordsBean.GoodsBean) { override fun convert(holder: BaseViewHolder, item: GoodsRecordsBean.GoodsBean) {
holder.getView<RImageView>(R.id.img_goods).setImage(context,item.imgs) holder.getView<RImageView>(R.id.img_goods).setImage(context,item.pic)
holder.setText(R.id.tv_goods_name,item.prodName) holder.setText(R.id.tv_goods_name,item.prodName)
holder.setText(R.id.tv_price,"¥ ${item.price}") holder.setText(R.id.tv_price,"¥ ${item.price}")
SpannableUtils.setMoney(holder.getView<TextView>(R.id.tv_line_price),item.oriPrice) SpannableUtils.setMoney(holder.getView<TextView>(R.id.tv_line_price),item.oriPrice)

@ -11,7 +11,7 @@ import com.zj365.dc.R
class ShopGoodsTwoAdapter : BaseAdapter<GoodsRecordsBean.GoodsBean>(R.layout.item_goods_list_two_style) { class ShopGoodsTwoAdapter : BaseAdapter<GoodsRecordsBean.GoodsBean>(R.layout.item_goods_list_two_style) {
override fun convert(holder: BaseViewHolder, item: GoodsRecordsBean.GoodsBean) { override fun convert(holder: BaseViewHolder, item: GoodsRecordsBean.GoodsBean) {
holder.getView<RImageView>(R.id.img_goods).setImage(context,item.imgs) holder.getView<RImageView>(R.id.img_goods).setImage(context,item.pic)
holder.setText(R.id.tv_goods_name,item.prodName) holder.setText(R.id.tv_goods_name,item.prodName)
holder.setText(R.id.tv_price,"¥ ${item.price}") holder.setText(R.id.tv_price,"¥ ${item.price}")
SpannableUtils.setMoney(holder.getView<TextView>(R.id.tv_line_price),item.oriPrice) SpannableUtils.setMoney(holder.getView<TextView>(R.id.tv_line_price),item.oriPrice)

@ -133,6 +133,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
private val tenLive by lazy { MutableLiveData<String>() } private val tenLive by lazy { MutableLiveData<String>() }
private var isShrinkage = false//记录是否收缩 private var isShrinkage = false//记录是否收缩
private var functionList= ArrayList<DeviceFunctionBean>() private var functionList= ArrayList<DeviceFunctionBean>()
private var isJob = false
/** /**
* -1步数 0:心率 1血氧 2呼吸率 3体温 4睡眠 5血压 6血糖 7:心电|血脂 * -1步数 0:心率 1血氧 2呼吸率 3体温 4睡眠 5血压 6血糖 7:心电|血脂
@ -169,8 +170,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
//点击事件 //点击事件
setOnClickListener() setOnClickListener()
if(!TextUtils.isEmpty(showIdInfo)){
request()
}
request()
//刷新注册 //刷新注册
refresh() refresh()
@ -462,8 +465,9 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
// 刷新注册 // 刷新注册
private fun refresh() { private fun refresh() {
refresh.setRefresh(binding.mRefresh) { refresh.setRefresh(binding.mRefresh) {
isJob = false
getXtInfo(showIdInfo) getXtInfo(showIdInfo)
get24HourReportInfo(showIdInfo) // get24HourReportInfo(showIdInfo)
request() request()
uploadWhatchData() uploadWhatchData()
} }
@ -475,7 +479,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
mViewModel.getTips() mViewModel.getTips()
mViewModel.getRank(2) mViewModel.getRank(2)
get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态
if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){ if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){
mViewModel.getWeather() mViewModel.getWeather()
}else{ }else{
@ -806,9 +810,9 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
} }
// } // }
if(!isJob){
get24HourReportInfo(showIdInfo)// 这里调用一次接口防止首次进入App不会刷新评估状态
}
//设置健康监测按钮列表数据 //设置健康监测按钮列表数据
healthMonitoringList.clear() healthMonitoringList.clear()
healthMonitoringListExceed.clear() healthMonitoringListExceed.clear()
@ -1216,7 +1220,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
LogUtils.e("DynamicManagementFrag","刷新数据") LogUtils.e("DynamicManagementFrag","刷新数据")
getHealthInfoJob = mainScope.launch (Dispatchers.IO){ getHealthInfoJob = mainScope.launch (Dispatchers.IO){
if(mDisposable == null){ if(mDisposable == null){
Observable.interval(1000 * 60,60*60*1000,TimeUnit.MILLISECONDS) Observable.interval(1000 * 60,60*1000,TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<Long>{ .observeOn(AndroidSchedulers.mainThread()).subscribe(object : Observer<Long>{
override fun onSubscribe(d: Disposable) { override fun onSubscribe(d: Disposable) {
mDisposable = d mDisposable = d
@ -1232,6 +1236,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
override fun onNext(t: Long) { override fun onNext(t: Long) {
LogUtils.e("DynamicManagementFrag","刷新数据${t}s") LogUtils.e("DynamicManagementFrag","刷新数据${t}s")
isJob = true
mViewModel.getAllInfo(showIdInfo, false,true) mViewModel.getAllInfo(showIdInfo, false,true)
} }
@ -1243,8 +1248,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
} }
fun cancelTimer(){ fun cancelTimer(){
getHealthInfoJob?.cancel()
mDisposable?.let { mDisposable?.let {
if(it.isDisposed){ if(it.isDisposed){
LogUtils.e("DynamicManagementFrag","取消定时")
it.dispose() it.dispose()
} }
@ -1538,7 +1545,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun updateHealthInfo(event:ChangeFamilyEvent){ fun updateHealthInfo(event:ChangeFamilyEvent){
isJob= false
mViewModel.getAllInfo(event.showUserId, false) mViewModel.getAllInfo(event.showUserId, false)
getXtInfo(event.showUserId) getXtInfo(event.showUserId)
get24HourReportInfo(event.showUserId) get24HourReportInfo(event.showUserId)
@ -1547,11 +1554,15 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
tenJob?.cancel() tenJob?.cancel()
cancelTimer()
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun loginOutChange(event: LoginOutEvent){ fun loginOutChange(event: LoginOutEvent){
LogUtils.e("DynamicManagementFrag","loginOutChange")
isJob = false
cancelTimer()
} }
@ -1579,6 +1590,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
} }
getXtInfo(showIdInfo) getXtInfo(showIdInfo)
isJob = false
get24HourReportInfo(showIdInfo) get24HourReportInfo(showIdInfo)
request() request()
uploadWhatchData() uploadWhatchData()
@ -1588,6 +1600,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun bindDevSuccess(event: BindDevEvent){ fun bindDevSuccess(event: BindDevEvent){
getXtInfo(showIdInfo) getXtInfo(showIdInfo)
isJob = false
get24HourReportInfo(showIdInfo) get24HourReportInfo(showIdInfo)
request() request()
uploadWhatchData() uploadWhatchData()

@ -251,11 +251,19 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
when(contentData.jumpUrl){ when(contentData.jumpUrl){
"health_data" ->{ "health_data" ->{
RouteManager.goAct(ARouterUrl.FAMILY_RECORD_ACT) if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
RouteManager.goAct(ARouterUrl.FAMILY_RECORD_ACT)
}
// CommonToastUtils.showToast("敬请期待") // CommonToastUtils.showToast("敬请期待")
} }
"health_dic" ->{ "health_dic" ->{
RouteManager.goAct(ARouterUrl.HEALTH_CODE_MAIN_ACT) if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
RouteManager.goAct(ARouterUrl.HEALTH_CODE_MAIN_ACT)
}
// CommonToastUtils.showToast("敬请期待") // CommonToastUtils.showToast("敬请期待")
} }
@ -334,7 +342,6 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){ if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else { }else {
onEventObject(requireContext(), UmengEventId.HealthRisk)
bundle.clear() bundle.clear()
bundle.putString("id", showIdInfo) bundle.putString("id", showIdInfo)
RouteManager.goAct(ARouterUrl.TONGUE_MAIN_ACTIVITY, bundle) RouteManager.goAct(ARouterUrl.TONGUE_MAIN_ACTIVITY, bundle)
@ -359,15 +366,25 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
} }
"PSYCHOLOGY" ->{ "PSYCHOLOGY" ->{
RouteManager.goAct(ARouterUrl.PSYCHOLOGICAL_TEST_LIST_ACT) if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else {
RouteManager.goAct(ARouterUrl.PSYCHOLOGICAL_TEST_LIST_ACT)
}
// CommonToastUtils.showToast("敬请期待") // CommonToastUtils.showToast("敬请期待")
} }
"AI_SUGAR_MEDICINE" ->{ "AI_SUGAR_MEDICINE" ->{
if(MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
bundle.clear() RouteManager.goAct(ARouterUrl.LOGIN_ACT)
bundle.putInt("type",1) }else {
RouteManager.goAct(ARouterUrl.AI_SKIN_MEASUREMENT_ACTIVITY,bundle) bundle.clear()
bundle.putInt("type", 1)
RouteManager.goAct(
ARouterUrl.AI_SKIN_MEASUREMENT_ACTIVITY,
bundle
)
}
} }
"AI_SKIN" ->{ "AI_SKIN" ->{

@ -2,11 +2,13 @@ package com.zj365.dc.fragment
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.text.TextUtils
import android.view.View import android.view.View
import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.xty.base.fragment.BaseFragList import com.xty.base.fragment.BaseFragList
import com.xty.common.Const import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.common.R import com.xty.common.R
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
@ -99,7 +101,17 @@ class MessageFragment : BaseFragList<MessageVm>() {
}*/ }*/
override fun refresh() { override fun refresh() {
mViewModel.getSystemMsg() val userId = if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {
""
} else {
MMkvHelper.getLong(Const.USER_ID).toString()
}
if(!TextUtils.isEmpty(userId)){
mViewModel.getSystemMsg()
}
} }
override fun setViewModel()= MessageVm() override fun setViewModel()= MessageVm()

@ -388,7 +388,7 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
RouteManager.goAct(ARouterUrl.LOGIN_ACT) RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else { }else {
otherInfo?.let { otherInfo?.let {
if (!TextUtils.isEmpty(it.placard)){ if (!TextUtils.isEmpty(it.operation_guide)){
bundle.clear() bundle.clear()
bundle.putString("title", "操作手册") bundle.putString("title", "操作手册")
bundle.putBoolean("isAgree", false) bundle.putBoolean("isAgree", false)
@ -479,19 +479,14 @@ class MineFrag : BaseVmFrag<SettingVm>() , EasyPermissions.PermissionCallbacks{
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
/* if (!checkNetworkAvailable(requireContext())) { if (!TextUtils.isEmpty(showIdInfo)){
binding.mNoNetwork.root.visibility = View.VISIBLE mViewModel.getMySetting()
} else { mViewModel.getAllInfo(showIdInfo,false)
if (binding.mNoNetwork.root.visibility == View.VISIBLE) {*/ mViewModel.searchInviteInfo()
mViewModel.getMySetting()
// }
mViewModel.getAllInfo(showIdInfo,false) mViewModel.getUserOtherInfo()
// mViewModel.getScore(1) }
mViewModel.searchInviteInfo()
mViewModel.getUserOtherInfo()
// }
} }
override fun observer() { override fun observer() {

@ -1,5 +1,6 @@
package com.zj365.dc.fragment package com.zj365.dc.fragment
import android.graphics.Rect
import android.os.Parcelable import android.os.Parcelable
import android.text.TextUtils import android.text.TextUtils
import android.view.KeyEvent import android.view.KeyEvent
@ -8,6 +9,7 @@ import android.view.inputmethod.EditorInfo
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.tamsiree.rxkit.RxKeyboardTool import com.tamsiree.rxkit.RxKeyboardTool
import com.xty.base.fragment.BaseFragList import com.xty.base.fragment.BaseFragList
import com.xty.base.fragment.BaseVmFrag import com.xty.base.fragment.BaseVmFrag
@ -89,6 +91,15 @@ class ShopFragment: BaseFragList<ShopMallVm>() {
} }
}) })
binding.recyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() {
override fun getItemOffsets(outRect: Rect, itemPosition: Int, parent: RecyclerView) {
super.getItemOffsets(outRect, itemPosition, parent)
outRect.bottom = 12
outRect.left = 7
outRect.right = 7
}
})
} }
override fun setViewModel()= ShopMallVm() override fun setViewModel()= ShopMallVm()

@ -3,6 +3,7 @@ package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import com.alibaba.fastjson.JSONObject import com.alibaba.fastjson.JSONObject
import com.xty.base.vm.BaseVm import com.xty.base.vm.BaseVm
import com.xty.network.model.ChooseAddressBean
import com.xty.network.model.GoodsRecordsBean import com.xty.network.model.GoodsRecordsBean
import com.xty.network.model.RespBody import com.xty.network.model.RespBody
import com.xty.network.model.ShopCategoryBean import com.xty.network.model.ShopCategoryBean
@ -16,6 +17,10 @@ class ShopMallVm : BaseVm() {
val createOrderLiveData by lazy { MutableLiveData<RespBody<ShopGoodsOrderBean>>() } val createOrderLiveData by lazy { MutableLiveData<RespBody<ShopGoodsOrderBean>>() }
val defaultAddressLiveData by lazy { MutableLiveData<RespBody<ChooseAddressBean>>() }
val hasCouponLiveData by lazy { MutableLiveData<RespBody<Int>> ()}
fun getGoodsCategory(parentId:Long){ fun getGoodsCategory(parentId:Long){
startHttp { startHttp {
var code = apiInterface().getGoodsCategory(parentId) var code = apiInterface().getGoodsCategory(parentId)
@ -56,4 +61,18 @@ class ShopMallVm : BaseVm() {
} }
} }
fun getDefaultAddress(){
startHttp(false) {
var code = apiInterface().getDefaultAddress()
code.getCodeStatus(defaultAddressLiveData, nowData)
}
}
fun hasCoupon(){
startHttp(false) {
var code = apiInterface().hasCoupons()
code.getCodeStatus(hasCouponLiveData, nowData)
}
}
} }

@ -73,8 +73,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_15" android:layout_marginLeft="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_15" android:layout_marginRight="@dimen/dp_7"
android:id="@+id/recyclerView"/> android:id="@+id/recyclerView"/>
<com.scwang.smart.refresh.footer.ClassicsFooter <com.scwang.smart.refresh.footer.ClassicsFooter

@ -8,11 +8,10 @@ import android.os.Bundle
import android.webkit.JavascriptInterface import android.webkit.JavascriptInterface
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.GsonUtils import com.blankj.utilcode.util.GsonUtils
import com.google.gson.Gson
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import com.tencent.mm.opensdk.openapi.WXAPIFactory import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.model.ChooseAddressBean import com.xty.network.model.ChooseAddressBean
import com.xty.base.model.ChooseCouponBean import com.xty.base.model.ChooseCouponBean
import com.xty.base.model.CreateOrderBean import com.xty.base.model.CreateOrderBean
import com.xty.base.model.OpenWXBean import com.xty.base.model.OpenWXBean
@ -25,7 +24,6 @@ import com.xty.common.LogUtils
import com.xty.common.MMkvHelper import com.xty.common.MMkvHelper
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.util.ToastUtils
import org.json.JSONObject import org.json.JSONObject
import pub.devrel.easypermissions.EasyPermissions import pub.devrel.easypermissions.EasyPermissions

@ -12,7 +12,7 @@ data class CreateOrderBean (
var is_agree:Int, var is_agree:Int,
var delivery_mode:Int, var delivery_mode:Int,
var ori_price:Double, var ori_price:Double,
var price:Double, var price:Double?,
var sold_num:Int, var sold_num:Int,
var content:String, var content:String,
var skuId:Long, var skuId:Long,

@ -23,16 +23,34 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mView" /> app:layout_constraintTop_toBottomOf="@+id/mView" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line1"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_1"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.2"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line2"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_1"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.8"/>
<TextView <TextView
android:id="@+id/mTvTitle" android:id="@+id/mTvTitle"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/col_313" android:textColor="@color/col_313"
android:textSize="@dimen/sp_18" android:textSize="@dimen/sp_18"
android:textStyle="bold" android:textStyle="bold"
android:gravity="center"
android:maxWidth="@dimen/dp_300"
android:maxLines="1"
android:ellipsize="end"
app:layout_constraintBottom_toBottomOf="@+id/mIvBack" app:layout_constraintBottom_toBottomOf="@+id/mIvBack"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="@+id/line1"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="@+id/line2"
app:layout_constraintTop_toTopOf="@+id/mIvBack" app:layout_constraintTop_toTopOf="@+id/mIvBack"
tools:text="标题标题" /> tools:text="标题标题" />

@ -20,6 +20,7 @@ import com.xty.common.arouter.RouteManager
import com.xty.common.onEventObject import com.xty.common.onEventObject
import com.xty.common.setImageUser import com.xty.common.setImageUser
import com.xty.common.weight.HealthBodyView import com.xty.common.weight.HealthBodyView
import com.zj365.health.BuildConfig
import com.zj365.health.adapter.familyhealth.HealthFamilyTargetAdapter import com.zj365.health.adapter.familyhealth.HealthFamilyTargetAdapter
import com.zj365.health.databinding.ActHealthRecordMainBinding import com.zj365.health.databinding.ActHealthRecordMainBinding
import com.zj365.health.model.MyReportBean import com.zj365.health.model.MyReportBean
@ -107,6 +108,15 @@ class HealthRecordMainAct : BaseVmAct<HealthRecordMainVm>() {
} }
binding.tvDairyRecords.setOnClickListener {
bundle.clear()
bundle.putString(
"web_site_url",
"${BuildConfig.h5url}pages/index/index?pageId=diary"
)
RouteManager.goAct(ARouterUrl.H5_ACT, bundle)
}
binding.llHealthWeekRecord.setOnClickListener { binding.llHealthWeekRecord.setOnClickListener {
bundle.clear() bundle.clear()
var showIdInfo =if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") { var showIdInfo =if (MMkvHelper.getLong(Const.USER_ID).toString() == "0") {

@ -0,0 +1,37 @@
package com.zj365.health.act.skin
import android.view.Gravity
import android.view.View
import com.xty.base.dialog.BaseDialogFragment
import com.xty.common.Const
import com.xty.common.Dateutils
import com.xty.common.util.CommonUtils
import com.zj365.health.databinding.DialogAiIcingBinding
class AiIcingPaySuccessDialog(var orderNo:String) : BaseDialogFragment() {
val binding by lazy { DialogAiIcingBinding.inflate(layoutInflater) }
override fun onCreateView(): View = binding.root
override fun initView() {
}
override fun initData() {
binding.tvOrderNo.text = "订单编号:${orderNo}"
binding.tvOrderTime.text = "下单时间:${Dateutils.formatTime(System.currentTimeMillis(),Dateutils.YYYY_MM_DD_HH_MM_SS)}"
Const.mainLiveData.value?.let {
binding.tvTel.text = "预留电话:${it.user.phone}"
}
}
override fun initListener() {
binding.tvConfirm.setOnClickListener {
dismiss()
}
}
override fun getGravity(): Int = Gravity.CENTER
}

@ -47,14 +47,6 @@ class SkinMeasurementMainAct : BaseVmAct<SkinMeasurementVm>() {
var payGoodsBean: PayGoodsBean? = null var payGoodsBean: PayGoodsBean? = null
/* val tipDialog by lazy {
CancerDialog(this, false, "温馨提示", {
bottomSheetDialog?.show()
}, {
bundle.clear()
RouteManager.goAct(ARouterUrl.TONGUE_ORDER_LIST_ACTIVITY, bundle)
})
}*/
override fun liveObserver() { override fun liveObserver() {
mViewModel.payGoodsObservable.observe(this){ mViewModel.payGoodsObservable.observe(this){
@ -105,7 +97,7 @@ class SkinMeasurementMainAct : BaseVmAct<SkinMeasurementVm>() {
binding.title.mTvRight.visibility = View.VISIBLE binding.title.mTvRight.visibility = View.VISIBLE
}else{ }else{
binding.title.mTvTitle.text ="AI糖医" binding.title.mTvTitle.text ="AI糖医"
binding.title.mTvRight.text ="购买记录" binding.title.mTvRight.text ="订单记录"
binding.title.mTvRight.setTextColor(resources.getColor(R.color.col_02c)) binding.title.mTvRight.setTextColor(resources.getColor(R.color.col_02c))
binding.title.mTvRight.visibility = View.VISIBLE binding.title.mTvRight.visibility = View.VISIBLE
mViewModel.getAIGoods() mViewModel.getAIGoods()
@ -128,6 +120,7 @@ class SkinMeasurementMainAct : BaseVmAct<SkinMeasurementVm>() {
binding.tvSubmit.setOnClickListener { binding.tvSubmit.setOnClickListener {
bottomSheetDialog?.show() bottomSheetDialog?.show()
} }
@ -253,10 +246,17 @@ class SkinMeasurementMainAct : BaseVmAct<SkinMeasurementVm>() {
if (TextUtils.equals(resultStatus, "9000")) { if (TextUtils.equals(resultStatus, "9000")) {
payGoodsBean?.let { payGoodsBean?.let {
bundle.clear() if(type == 1){
bundle.putString("orderNo", mViewModel.payObservable.value?.data?.orderNo) AiIcingPaySuccessDialog(mViewModel.payObservable.value?.data?.orderNo!!).show(supportFragmentManager,"AiIcingPaySuccessDialog")
bundle.putString("orderType", it.goodsType.toString())
RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle) }else{
bundle.clear()
bundle.putString("orderNo", mViewModel.payObservable.value?.data?.orderNo)
bundle.putString("orderType", it.goodsType.toString())
RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle)
}
} }
} else { } else {
@ -270,10 +270,16 @@ class SkinMeasurementMainAct : BaseVmAct<SkinMeasurementVm>() {
when (event.code) { when (event.code) {
BaseResp.ErrCode.ERR_OK -> { BaseResp.ErrCode.ERR_OK -> {
payGoodsBean?.let { payGoodsBean?.let {
bundle.clear() if(type == 1){
bundle.putString("orderNo", mViewModel.payObservable.value?.data?.orderNo) AiIcingPaySuccessDialog(mViewModel.payObservable.value?.data?.orderNo!!).show(supportFragmentManager,"AiIcingPaySuccessDialog")
bundle.putString("orderType", it.goodsType.toString())
RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle) }else{
bundle.clear()
bundle.putString("orderNo", mViewModel.payObservable.value?.data?.orderNo)
bundle.putString("orderType", it.goodsType.toString())
RouteManager.goAct(ARouterUrl.PAY_SUCCESS, bundle)
}
} }
} }

@ -265,6 +265,7 @@
android:layout_marginTop="@dimen/dp_22"/> android:layout_marginTop="@dimen/dp_22"/>
<TextView <TextView
android:id="@+id/tv_dairy_records"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="前往记录" android:text="前往记录"

@ -75,13 +75,12 @@
android:layout_width="@dimen/dp_70" android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_70" android:layout_height="@dimen/dp_70"
app:corner_radius="@dimen/dp_5" app:corner_radius="@dimen/dp_5"
android:layout_marginTop="11dp" android:layout_marginTop="@dimen/dp_11"
android:layout_marginBottom="@dimen/dp_11"
android:background="@mipmap/bg_templete"
app:is_circle="false"/> app:is_circle="false"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:background="@color/col_0f2"/>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"

@ -46,7 +46,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:padding="@dimen/dp_10" android:padding="@dimen/dp_10"
android:textColor="@color/col_25C" android:textColor="@color/col_02c"
android:textSize="@dimen/sp_17" android:textSize="@dimen/sp_17"
tools:text="确认" /> tools:text="确认" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

@ -18,6 +18,7 @@ import com.amap.api.maps.model.MarkerOptions
import com.amap.api.maps.model.MyLocationStyle import com.amap.api.maps.model.MyLocationStyle
import com.amap.api.services.core.PoiItem import com.amap.api.services.core.PoiItem
import com.xty.base.act.BaseVmAct import com.xty.base.act.BaseVmAct
import com.xty.base.weight.TipDialog
import com.xty.common.arouter.ARouterUrl import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager import com.xty.common.arouter.RouteManager
import com.xty.common.event.BtFenceSettingSuccessEvent import com.xty.common.event.BtFenceSettingSuccessEvent
@ -124,9 +125,12 @@ class ElectronicAddOrModifyAct : BaseVmAct<ElectronicFenceSettingVm>() {
binding.tvCancel.setOnClickListener { binding.tvCancel.setOnClickListener {
if(type == 2){ if(type == 2){
bean?.let { TipDialog(this , "确定要删除该电子围栏",true ,"确认","取消") {
mViewModel.deleteBtFence(it.id) bean?.let {
mViewModel.deleteBtFence(it.id)
}
} }
}else{ }else{
finish() finish()
} }

@ -74,7 +74,7 @@ class ElectronicFenceSettingAct : BaseVmAct<ElectronicFenceSettingVm>() {
if(it.type == 1){ if(it.type == 1){
aMap?.let { aMap?.let {
var markerOptions = MarkerOptions().position(latLng) var markerOptions = MarkerOptions().position(latLng)
.icon(BitmapDescriptorFactory.fromView(View.inflate(this,R.layout.layout_bt_fence_enter,null))) .icon(BitmapDescriptorFactory.fromView(View.inflate(this,R.layout.layout_bt_fence_enter,null))).anchor(0.5f,0.5f)
var marker = it.addMarker(markerOptions) var marker = it.addMarker(markerOptions)
it.addCircle(CircleOptions().center(latLng) it.addCircle(CircleOptions().center(latLng)

@ -1935,4 +1935,16 @@ interface ApiInterface {
*/ */
@GET("customer/mall/order/getOrderInfo") @GET("customer/mall/order/getOrderInfo")
suspend fun applyReturn(@Query("orderId") orderId:Long):RespBody<Any> suspend fun applyReturn(@Query("orderId") orderId:Long):RespBody<Any>
/**
* 获取默认地址
*/
@POST("customer/user/getDefaultAddr")
suspend fun getDefaultAddress() : RespBody<ChooseAddressBean>
/**
* 是否有优惠券
*/
@POST("customer/user/getIsCoupons")
suspend fun hasCoupons() : RespBody<Int>
} }

@ -1,4 +1,4 @@
package com.xty.base.model package com.xty.network.model
import android.os.Parcelable import android.os.Parcelable
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
Loading…
Cancel
Save