diff --git a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipFragment.kt b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipFragment.kt index c945b7c..3899c3f 100644 --- a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipFragment.kt +++ b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipFragment.kt @@ -1,14 +1,11 @@ package com.cheng.bole.ui.fragment.mine.vip +import android.animation.ValueAnimator import android.annotation.SuppressLint -import android.graphics.Color import android.text.TextUtils import android.view.View -import android.window.OnBackInvokedDispatcher -import androidx.activity.addCallback import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat -import androidx.core.os.BuildCompat import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -26,7 +23,6 @@ import com.cheng.bole.event.PaySuccessEvent import com.cheng.bole.manager.EventReportManager import com.cheng.bole.manager.LoginManager import com.cheng.bole.manager.UserConfigManager -import com.cheng.bole.ui.activity.MainActivity import com.cheng.bole.ui.dialog.PayTipDialog import com.cheng.bole.utils.DateUtils import com.cheng.bole.utils.UrlHelper @@ -37,7 +33,6 @@ import com.example.base.decoration.GridSpaceItemDecoration import com.example.base.decoration.SpacesItemDecoration import com.example.base.extensions.getColor import com.example.base.extensions.gone -import com.example.base.extensions.onClick import com.example.base.extensions.toast import com.example.base.extensions.visible import com.example.base.ui.BaseFragment @@ -50,27 +45,28 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.disposables.Disposable import org.jetbrains.anko.sdk27.listeners.onCheckedChange +import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onTouch -import org.jetbrains.anko.startActivity import java.text.DecimalFormat import java.util.concurrent.TimeUnit class VipFragment : BaseFragment() { private val origin by lazy { arguments?.getString("origin") ?: "center" } - private val isGuide by lazy { origin == "bootpage" } - private val vipType by lazy { arguments?.getInt("vipType") ?: 0 } // 0 个人版 1 企业版 + private var vipType = 0 // 0 个人版 1 企业版 private lateinit var api: IWXAPI private var isAgree = false private var payType = 0 //0微信支付 1支付宝支付 private var totalPrice = 0f + private var lastGoodsPrice = 0f + private var seatPrice = 0f private var seatCount = 0 private var seatCountLimit = 3 - private val goodsAdapter by lazy { VipMealAdapter() } + private var goodsAdapter = VipGoodsAdapter(vipType) private val userTipsList = mutableListOf() private val userTipsAdapter by lazy { VipUserTipsAdapter(requireContext(), userTipsList) } @@ -88,7 +84,7 @@ class VipFragment : BaseFragment() { override fun initView() { super.initView() setBackColor(R.color.white) - setPageStyle() + updatePageStyle() checkPayType() binding.rvUserTips.adapter = userTipsAdapter @@ -108,24 +104,12 @@ class VipFragment : BaseFragment() { mViewModel.userInfo() mViewModel.getPayUserTips() mViewModel.getGoodsList(if (vipType == 0) "member" else "corp") - if (vipType == 1) mViewModel.getCorpInfo() + mViewModel.getCorpInfo() } @SuppressLint("NotifyDataSetChanged", "SetTextI18n") override fun initListener() { super.initListener() - setBackPressed() - mTitleBar?.setNavigationOnClickListener { - if (isGuide) { - EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "icon", pageDuration()) - } - if (isGuide) { - requireActivity().startActivity() - } else { - requireActivity().finish() - } - } - binding.rvUserTips.onTouch { _, _ -> true } goodsAdapter.setOnItemClickListener { _, _, i -> @@ -150,6 +134,20 @@ class VipFragment : BaseFragment() { releasePayType() } + binding.btnTab1.onClick { + if (vipType != 0) { + vipType = 0 + updatePageStyle() + } + } + + binding.btnTab2.onClick { + if (vipType != 1) { + vipType = 1 + updatePageStyle() + } + } + binding.ivAdd.onClick { seatCount++ setSeatCount() @@ -249,6 +247,11 @@ class VipFragment : BaseFragment() { } mViewModel.goodsListLiveData.observe(this) { list -> + goodsAdapter.data.forEach { _ -> + if (binding.rvGoods.itemDecorationCount > 0) { + binding.rvGoods.removeItemDecorationAt(0) + } + } if (list.size <= 3) { binding.rvGoods.layoutManager = GridLayoutManager(requireContext(), 3) binding.rvGoods.addItemDecoration(GridSpaceItemDecoration(3, 0, DensityUtils.dp2px(12f))) @@ -256,6 +259,7 @@ class VipFragment : BaseFragment() { binding.rvGoods.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false) binding.rvGoods.addItemDecoration(SpacesItemDecoration(DensityUtils.dp2px(12f), RecyclerView.HORIZONTAL)) } + goodsAdapter.type = vipType goodsAdapter.setList(list) goodsEntity = list.find { it.checked } @@ -312,24 +316,20 @@ class VipFragment : BaseFragment() { EventReportManager.eventReport( EventConstants.PAY_SUCCESS, if (payType == 0) "weixin" else "alipay", - "{isGuide:$isGuide, orderId:${orderEntity?.orderId}, meal:${Gson().toJson(goodsEntity)}}" + "{orderId:${orderEntity?.orderId}, meal:${Gson().toJson(goodsEntity)}}" ) - if (isGuide) { - requireActivity().startActivity() - } else { - RxBus.defaultInstance.post(PaySuccessEvent()) - } + RxBus.defaultInstance.post(PaySuccessEvent()) requireActivity().finish() } PayStatusEnum.PAY_CANCEL -> { toast("已取消支付") - EventReportManager.eventReport(EventConstants.PAY_CANCEL, if (payType == 0) "weixin" else "alipay", "{isGuide:$isGuide, orderId:${orderEntity?.orderId}") + EventReportManager.eventReport(EventConstants.PAY_CANCEL, if (payType == 0) "weixin" else "alipay", "{orderId:${orderEntity?.orderId}") } else -> { toast("已取消支付") - EventReportManager.eventReport(if (payType == 0) EventConstants.ERROR_CLIENT_WXPAY_ERR else EventConstants.ERROR_CLIENT_ALIPAY_ERR, "{isGuide:$isGuide, orderId:${orderEntity?.orderId}", it.message) + EventReportManager.eventReport(if (payType == 0) EventConstants.ERROR_CLIENT_WXPAY_ERR else EventConstants.ERROR_CLIENT_ALIPAY_ERR, "{orderId:${orderEntity?.orderId}", it.message) } } } @@ -430,30 +430,33 @@ class VipFragment : BaseFragment() { SpanUtils.with(binding.tvSeatTip2) .append("当前") .append("1个") - .setForegroundColor(Color.parseColor("#D6AA58")) + .setForegroundColor(getColor(R.color.color_146847)) .append("主号+") .append("${seatCount}个") - .setForegroundColor(Color.parseColor("#D6AA58")) + .setForegroundColor(getColor(R.color.color_146847)) .append("席位") .create() } @SuppressLint("SetTextI18n") private fun setPrice(price: Float) { + lastGoodsPrice = totalPrice totalPrice = if (price < 0) 0f else price - SpanUtils.with(binding.tvPrice) - .append("¥") - .setFontSize(13, true) - .append(DecimalFormat("0.##").format(totalPrice)) - .append(formatPricePeriod(goodsEntity!!.value)) - .setFontSize(13, true) - .create() - val totalOriginPrice = if (vipType == 1) { - goodsEntity!!.origin_price.toFloat() + (seatCount - seatCountLimit) * (goodsEntity?.origin_member_price?.toFloat() ?: 0f) - } else { - goodsEntity!!.origin_price.toFloat() + + val valueAnim = ValueAnimator.ofFloat(0f, 1f).setDuration(500) + valueAnim.addUpdateListener { + val percent = it.animatedValue as Float + val diffPrice = totalPrice - lastGoodsPrice + val animPrice = if (percent == 1f) totalPrice * percent else (lastGoodsPrice + diffPrice * percent).toInt() + SpanUtils.with(binding.tvPrice) + .append("¥") + .setFontSize(13, true) + .append(DecimalFormat("0.##").format(animPrice)) + .append(formatPricePeriod(goodsEntity!!.value)) + .setFontSize(13, true) + .create() } - binding.tvSavedPrice.text = "立省${DecimalFormat("0.##").format(totalOriginPrice - totalPrice)}" + valueAnim.start() } private fun formatPricePeriod(value: String): String { @@ -475,10 +478,16 @@ class VipFragment : BaseFragment() { return "" } - private fun setPageStyle() { + private fun updatePageStyle() { + mViewModel.getGoodsList(if (vipType == 0) "member" else "corp") if (vipType == 0) { payTypeCheckedRes = R.mipmap.ic_pay_checked1 + binding.btnTab1.setTextColor(getColor(R.color.color_fff5e6)) + binding.btnTab1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.shape_vip_tab_checked, 0, 0, 0) + binding.btnTab2.setTextColor(getColor(R.color.color_1b6648)) + binding.btnTab2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.shape_vip_tab_default, 0, 0, 0) + binding.ivTopBg.setImageResource(R.mipmap.ic_vip_top_bg1) binding.layoutPay.setBackgroundResource(R.mipmap.ic_vip_pay_bg1) binding.layoutPayBtn.setBackgroundResource(R.mipmap.ic_vip_pay_btn_bg1) @@ -493,12 +502,19 @@ class VipFragment : BaseFragment() { binding.tvMinute.setBackgroundResource(R.drawable.shape_vip_countdown_bg1) binding.tvSecond.setBackgroundResource(R.drawable.shape_vip_countdown_bg1) - binding.tvPay.setTextColor(Color.parseColor("#080501")) + binding.tvPrice.setTextColor(getColor(R.color.color_fff4e6)) + binding.tvInvoice.setTextColor(getColor(R.color.color_ecc9ae)) + binding.tvPay.setTextColor(getColor(R.color.color_703d27)) binding.layoutSeat.gone() } else { payTypeCheckedRes = R.mipmap.ic_pay_checked2 + binding.btnTab1.setTextColor(getColor(R.color.color_1b6648)) + binding.btnTab1.setCompoundDrawablesWithIntrinsicBounds(R.drawable.shape_vip_tab_default, 0, 0, 0) + binding.btnTab2.setTextColor(getColor(R.color.color_fff5e6)) + binding.btnTab2.setCompoundDrawablesWithIntrinsicBounds(R.drawable.shape_vip_tab_checked, 0, 0, 0) + binding.ivTopBg.setImageResource(R.mipmap.ic_vip_top_bg2) binding.layoutPay.setBackgroundResource(R.mipmap.ic_vip_pay_bg2) binding.layoutPayBtn.setBackgroundResource(R.mipmap.ic_vip_pay_btn_bg2) @@ -511,7 +527,7 @@ class VipFragment : BaseFragment() { SpanUtils.with(binding.tvSeatTip1) .append("增加") .append("1个") - .setForegroundColor(Color.parseColor("#146847")) + .setForegroundColor(getColor(R.color.color_146847)) .append("席位") .create() @@ -520,7 +536,9 @@ class VipFragment : BaseFragment() { binding.tvMinute.setBackgroundResource(R.drawable.shape_vip_countdown_bg2) binding.tvSecond.setBackgroundResource(R.drawable.shape_vip_countdown_bg2) - binding.tvPay.setTextColor(Color.WHITE) + binding.tvPrice.setTextColor(getColor(R.color.color_f6fbd0)) + binding.tvInvoice.setTextColor(getColor(R.color.color_7ead99)) + binding.tvPay.setTextColor(getColor(R.color.color_753906)) binding.layoutSeat.visible() } @@ -534,6 +552,7 @@ class VipFragment : BaseFragment() { } //格式化倒计时 + @SuppressLint("DefaultLocale") private fun setCountdownTime(seconds: Long) { val minutes = seconds / 60 val hours = minutes / 60 @@ -574,31 +593,4 @@ class VipFragment : BaseFragment() { countdownDisposable?.dispose() super.onDestroyView() } - - @SuppressLint("UnsafeOptInUsageError") - private fun setBackPressed() { - if (BuildCompat.isAtLeastT()) { - requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) { - if (isGuide) { - EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration()) - } - if (isGuide) { - requireActivity().startActivity() - } else { - requireActivity().finish() - } - } - } else { - requireActivity().onBackPressedDispatcher.addCallback(this) { - if (isGuide) { - EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration()) - } - if (isGuide) { - requireActivity().startActivity() - } else { - requireActivity().finish() - } - } - } - } } \ No newline at end of file diff --git a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipGoodsAdapter.kt b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipGoodsAdapter.kt new file mode 100644 index 0000000..bf387f2 --- /dev/null +++ b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipGoodsAdapter.kt @@ -0,0 +1,91 @@ +package com.cheng.bole.ui.fragment.mine.vip + +import android.annotation.SuppressLint +import android.graphics.Typeface +import android.view.ViewGroup +import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.view.setPadding +import androidx.recyclerview.widget.GridLayoutManager +import com.chad.library.adapter.base.BaseQuickAdapter +import com.chad.library.adapter.base.viewholder.BaseViewHolder +import com.cheng.bole.R +import com.cheng.bole.bean.VipGoodsEntity +import com.cheng.bole.common.Constants +import com.example.base.extensions.getColor +import com.example.base.utils.DensityUtils +import com.example.base.utils.SpanUtils +import java.text.DecimalFormat + +class VipGoodsAdapter(var type: Int) : BaseQuickAdapter(R.layout.listitem_vip_goods) { + + override fun convert(holder: BaseViewHolder, item: VipGoodsEntity) { + holder.setGone(R.id.tv_tag, true) + if (item.tips.isNotEmpty()) { + holder.setVisible(R.id.tv_tag, true) + holder.setText(R.id.tv_tag, item.tips) + } + + holder.setText(R.id.tv_goods_name, item.goods_name) + holder.getView(R.id.tv_goods_name).textSize = if (item.checked) 18f else 12f + holder.getView(R.id.tv_goods_name).typeface = if (item.checked) Typeface.DEFAULT_BOLD else Typeface.DEFAULT + + SpanUtils.with(holder.getView(R.id.tv_price)) + .append("¥") + .setFontSize(if (item.checked) 12 else 10, true) + .append(DecimalFormat("0.##").format(item.price.toFloat())) + .setFontSize(if (item.checked) 30 else 22, true) + .setTypeface(Constants.dDIN_PRO_M) + .create() + SpanUtils.with(holder.getView(R.id.tv_origin_price)) + .append("¥${item.origin_price}") + .setFontSize(if (item.checked) 13 else 10, true) + .setStrikethrough() + .create() + + val layoutContent = holder.getView(R.id.layout_content) + val layoutParams = layoutContent.layoutParams as ConstraintLayout.LayoutParams + if (item.checked) { + holder.itemView.setPadding(0) + + layoutParams.dimensionRatio = "h,124:134" + layoutContent.layoutParams = layoutParams + + if (type == 0) { + holder.setTextColor(R.id.tv_goods_name, getColor(R.color.color_7e4024)) + holder.setTextColor(R.id.tv_price, getColor(R.color.color_f11e1e)) + holder.setTextColor(R.id.tv_origin_price, getColor(R.color.color_797069)) + holder.setBackgroundResource(R.id.layout_content, R.mipmap.ic_personal_goods_checked) + } else { + holder.setTextColor(R.id.tv_goods_name, getColor(R.color.color_c5ffe1)) + holder.setTextColor(R.id.tv_price, getColor(R.color.color_f6fbd0)) + holder.setTextColor(R.id.tv_origin_price, getColor(R.color.color_779086)) + holder.setBackgroundResource(R.id.layout_content, R.mipmap.ic_enterprise_goods_checked) + } + } else { + holder.itemView.setPadding(DensityUtils.dp2px(10f)) + + layoutParams.dimensionRatio = "h,96:104" + layoutContent.layoutParams = layoutParams + + if (type == 0) { + holder.setTextColor(R.id.tv_goods_name, getColor(R.color.color_fffaee)) + holder.setTextColor(R.id.tv_price, getColor(R.color.color_fffaee)) + holder.setTextColor(R.id.tv_origin_price, getColor(R.color.color_797069)) + holder.setBackgroundResource(R.id.layout_content, R.mipmap.ic_personal_goods_default) + } else { + holder.setTextColor(R.id.tv_goods_name, getColor(R.color.color_9eb9ab)) + holder.setTextColor(R.id.tv_price, getColor(R.color.color_9eb9ab)) + holder.setTextColor(R.id.tv_origin_price, getColor(R.color.color_56665f)) + holder.setBackgroundResource(R.id.layout_content, R.mipmap.ic_enterprise_goods_default) + } + } + + if (recyclerView.layoutManager is GridLayoutManager) { + holder.itemView.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) + } else { + val itemWidth = (recyclerView.width - DensityUtils.dp2px(50f)) / 3 + holder.itemView.layoutParams = ViewGroup.LayoutParams(itemWidth, ViewGroup.LayoutParams.MATCH_PARENT) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipMealAdapter.kt b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipMealAdapter.kt deleted file mode 100644 index 9437700..0000000 --- a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipMealAdapter.kt +++ /dev/null @@ -1,82 +0,0 @@ -package com.cheng.bole.ui.fragment.mine.vip - -import android.annotation.SuppressLint -import android.graphics.Color -import android.util.TypedValue -import android.view.ViewGroup -import android.widget.TextView -import androidx.core.view.setPadding -import androidx.recyclerview.widget.GridLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager -import com.chad.library.adapter.base.viewholder.BaseViewHolder -import com.cheng.bole.R -import com.cheng.bole.bean.VipGoodsEntity -import com.cheng.bole.common.Constants -import com.example.base.extensions.getColor -import com.example.base.ui.list.LoadMoreAdapter -import com.example.base.utils.DensityUtils -import com.example.base.utils.SpanUtils -import java.text.DecimalFormat - -class VipMealAdapter : LoadMoreAdapter(R.layout.listitem_vip_meal) { - - @SuppressLint("NotifyDataSetChanged") - override fun convert(holder: BaseViewHolder, item: VipGoodsEntity) { - holder.setGone(R.id.tv_tag, true) - if (item.tips.isNotEmpty()) { - holder.setVisible(R.id.tv_tag, true) - holder.setText(R.id.tv_tag, item.tips) - } - - holder.setText(R.id.tv_goods_name, item.goods_name) - SpanUtils.with(holder.getView(R.id.tv_price)) - .append("¥") - .setFontSize(if (item.checked) 12 else 10, true) - .append(DecimalFormat("0.##").format(item.price.toFloat())) - .setFontSize(if (item.checked) 28 else 22, true) - .setTypeface(Constants.dDIN_PRO_M) - .create() - SpanUtils.with(holder.getView(R.id.tv_origin_price)) - .append("¥${item.origin_price}") - .setStrikethrough() - .create() - holder.setText(R.id.tv_save_price, "限时立省¥${DecimalFormat("0.##").format(item.origin_price.toFloat() - item.price.toFloat())}") - - holder.setBackgroundResource(R.id.tv_save_price, if (item.checked) R.drawable.shape_vip_meal_checked_bottom_bg else R.drawable.shape_vip_meal_default_bottom_bg) - holder.setBackgroundResource(R.id.layout_content, if (item.checked) R.drawable.shape_vip_meal_check_true else R.drawable.shape_vip_meal_check_false) - - holder.getView(R.id.tv_tag).setTextSize(TypedValue.COMPLEX_UNIT_SP, if (item.checked) 12f else 10f) - holder.getView(R.id.tv_goods_name).setTextSize(TypedValue.COMPLEX_UNIT_SP, if (item.checked) 15f else 12f) - holder.getView(R.id.tv_origin_price).setTextSize(TypedValue.COMPLEX_UNIT_SP, if (item.checked) 14f else 10f) - holder.getView(R.id.tv_save_price).setTextSize(TypedValue.COMPLEX_UNIT_SP, if (item.checked) 12f else 10f) - - if (item.checked) { - holder.itemView.setPadding(0) - holder.getView(R.id.layout_content).setPadding(0, DensityUtils.dp2px(9f),0, 0) - holder.getView(R.id.tv_tag).setPadding(DensityUtils.dp2px(6f), DensityUtils.dp2px(2f), DensityUtils.dp2px(6f), DensityUtils.dp2px(2f)) - holder.getView(R.id.tv_save_price).setPadding(0, DensityUtils.dp2px(6f),0, DensityUtils.dp2px(6f)) - - holder.setTextColor(R.id.tv_goods_name, getColor(R.color.color_54230c)) - holder.setTextColor(R.id.tv_price, getColor(R.color.color_f94747)) - holder.setTextColor(R.id.tv_origin_price, getColor(R.color.color_896451)) - holder.setTextColor(R.id.tv_save_price, getColor(R.color.color_54220b)) - } else { - holder.itemView.setPadding(DensityUtils.dp2px(5f), 0, DensityUtils.dp2px(5f),0) - holder.getView(R.id.tv_tag).setPadding(DensityUtils.dp2px(4f), DensityUtils.dp2px(1f), DensityUtils.dp2px(4f), DensityUtils.dp2px(1f)) - holder.getView(R.id.layout_content).setPadding(0, DensityUtils.dp2px(7f),0, 0) - holder.getView(R.id.tv_save_price).setPadding(0, DensityUtils.dp2px(4f),0, DensityUtils.dp2px(4f)) - - holder.setTextColor(R.id.tv_goods_name, Color.parseColor("#ABABAB")) - holder.setTextColor(R.id.tv_price, Color.parseColor("#EAEAEA")) - holder.setTextColor(R.id.tv_origin_price, Color.parseColor("#6B6B6B")) - holder.setTextColor(R.id.tv_save_price, getColor(R.color.color_80ffffff)) - } - - if (recyclerView.layoutManager is GridLayoutManager) { - holder.itemView.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) - } else if (recyclerView.layoutManager is LinearLayoutManager) { - holder.itemView.layoutParams = - ViewGroup.LayoutParams(DensityUtils.dp2px(if (item.checked) 125f else 110f), ViewGroup.LayoutParams.MATCH_PARENT) - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipViewModel.kt b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipViewModel.kt index ab1b686..763d21d 100644 --- a/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipViewModel.kt +++ b/app/src/main/java/com/cheng/bole/ui/fragment/mine/vip/VipViewModel.kt @@ -39,8 +39,8 @@ class VipViewModel : BaseViewModel() { }) } - fun getGoodsList(type: String) { - showDialog() + fun getGoodsList(type: String, showLoading: Boolean = false) { + if (showLoading) showDialog() launchOnUiTryCatch({ val response = ApiFactory.apiService.getGoodsList(type) if (response.status) { diff --git a/app/src/main/res/drawable/shape_vip_meal_check_false.xml b/app/src/main/res/drawable/shape_vip_meal_check_false.xml deleted file mode 100644 index 40c70db..0000000 --- a/app/src/main/res/drawable/shape_vip_meal_check_false.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_vip_meal_check_true.xml b/app/src/main/res/drawable/shape_vip_meal_check_true.xml deleted file mode 100644 index f270e15..0000000 --- a/app/src/main/res/drawable/shape_vip_meal_check_true.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_vip_meal_checked_bottom_bg.xml b/app/src/main/res/drawable/shape_vip_meal_checked_bottom_bg.xml deleted file mode 100644 index 3ac53ce..0000000 --- a/app/src/main/res/drawable/shape_vip_meal_checked_bottom_bg.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_vip_meal_default_bottom_bg.xml b/app/src/main/res/drawable/shape_vip_meal_default_bottom_bg.xml deleted file mode 100644 index 79ba8b4..0000000 --- a/app/src/main/res/drawable/shape_vip_meal_default_bottom_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_vip.xml b/app/src/main/res/layout/fragment_vip.xml index 500a4c2..c9d2678 100644 --- a/app/src/main/res/layout/fragment_vip.xml +++ b/app/src/main/res/layout/fragment_vip.xml @@ -93,6 +93,7 @@ android:layout_marginTop="@dimen/dp_32" android:gravity="center" android:orientation="horizontal" + android:visibility="gone" app:layout_constraintTop_toBottomOf="@id/rv_goods"> - - + app:layout_constraintBottom_toBottomOf="@id/tv_price" + app:layout_constraintStart_toEndOf="@id/tv_price" /> diff --git a/app/src/main/res/layout/listitem_vip_meal.xml b/app/src/main/res/layout/listitem_vip_meal.xml deleted file mode 100644 index 6b74a09..0000000 --- a/app/src/main/res/layout/listitem_vip_meal.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_checked.webp b/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_checked.webp new file mode 100644 index 0000000..6c2c7c5 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_checked.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_default.webp b/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_default.webp new file mode 100644 index 0000000..f09a1df Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_enterprise_goods_default.webp differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 7b4cb14..ea9e77a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -101,8 +101,16 @@ #FFF5E6 #1B6648 #FFFAEF + #FFFAEE #FDF7F0 #FFF4E6 + #F6FBD0 + #779086 + #9EB9AB + #56665F #ECC9AE + #7EAD99 #703D27 + #753906 + #146847 \ No newline at end of file