添加会员页(待完善)

This commit is contained in:
wangyu 2026-01-06 18:48:42 +08:00
parent 2219226b82
commit c5213b643f
105 changed files with 1242 additions and 420 deletions

View File

@ -11,4 +11,9 @@ class VipGoodsEntity {
var tips: String = ""
var sign_value = ""
var value: String = ""
var invoice_tips: String = ""
var member_limit: String = ""
var member_price: String = ""
var origin_member_price: String = ""
}

View File

@ -0,0 +1,4 @@
package com.cheng.bole.event
class PaySuccessEvent {
}

View File

@ -8,17 +8,19 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import com.example.base.extensions.getColor
import com.example.base.extensions.onClick
import com.example.base.utils.ScreenUtils
import com.example.base.utils.SpanUtils
import com.cheng.bole.R
import com.cheng.bole.common.Constants
import com.cheng.bole.databinding.DialogPayTipBinding
import com.cheng.bole.manager.DialogEnum
import com.cheng.bole.utils.UrlHelper
import com.example.base.extensions.getColor
import com.example.base.extensions.onClick
import com.example.base.utils.ScreenUtils
import com.example.base.utils.SpanUtils
class PayTipDialog : DialogFragment() {
private val showPolicy by lazy { arguments?.getBoolean("show_policy") ?: false }
private val showAgreement by lazy { arguments?.getBoolean("show_agreement") ?: false }
private val showRenew by lazy { arguments?.getBoolean("show_renew") ?: false }
private var mOnBackListener: ((DialogEnum) -> Unit)? = null //回调事件
@ -63,11 +65,19 @@ class PayTipDialog : DialogFragment() {
private fun initAgreement() {
val spanUtils = SpanUtils.with(binding.tvContent)
.append("我已阅读并同意")
if (showPolicy) {
spanUtils.append("我已阅读并同意")
.append("《隐私协议》")
.setClickSpan(getColor(R.color.color_125ffe), false) {
UrlHelper.startPrivacyPolicy(requireContext())
}
} else if (showAgreement) {
spanUtils.append("我已阅读并同意")
.append("《会员服务协议规则》")
.setClickSpan(getColor(R.color.color_125ffe), false) {
UrlHelper.startUserAgreement(requireContext(), "会员服务协议规则")
}
}
if (showRenew) {
spanUtils.append("")
spanUtils.append("《自动续费服务规则》")
@ -83,8 +93,10 @@ class PayTipDialog : DialogFragment() {
}
companion object {
fun newInstance(showRenew: Boolean = false): PayTipDialog {
fun newInstance(showPolicy: Boolean = false, showAgreement: Boolean = false, showRenew: Boolean = false): PayTipDialog {
val arg = Bundle()
arg.putBoolean("show_policy", showPolicy)
arg.putBoolean("show_agreement", showAgreement)
arg.putBoolean("show_renew", showRenew)
val fragment = PayTipDialog()
fragment.arguments = arg

View File

@ -1,31 +1,38 @@
package com.cheng.bole.ui.fragment.mine.vip
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
import com.cheng.bole.R
import com.cheng.bole.bean.CorpInfoBean
import com.cheng.bole.bean.OrderPayEntity
import com.cheng.bole.bean.UserEntity
import com.cheng.bole.bean.VipGoodsEntity
import com.cheng.bole.common.Constants
import com.cheng.bole.common.EventConstants
import com.cheng.bole.databinding.FragmentVipBinding
import com.cheng.bole.event.PayStatusEnum
import com.cheng.bole.event.PayStatusEvent
import com.cheng.bole.event.VipPaySuccessEvent
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
import com.cheng.bole.utils.pay.PayUtils
import com.bytedance.ads.convert.event.ConvertReportHelper
import com.example.base.common.RxBus
import com.example.base.decoration.FirstItemOffsetDecoration
import com.example.base.common.RxCountDown
import com.example.base.decoration.GridSpaceItemDecoration
import com.example.base.decoration.SpacesItemDecoration
import com.example.base.extensions.getColor
@ -39,42 +46,59 @@ import com.example.base.utils.SpanUtils
import com.google.gson.Gson
import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.cheng.bole.common.Constants
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.onTouch
import org.jetbrains.anko.startActivity
import java.text.DecimalFormat
import java.util.concurrent.TimeUnit
class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
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 lateinit var api: IWXAPI
private var isAgree = false
private var payType = 0 //0微信支付 1支付宝支付
private var totalPrice = 0f
private val mealAdapter by lazy { VipMealAdapter() }
private val tipAdapter by lazy { VipTipAdapter() }
private var seatPrice = 0f
private var seatCount = 0
private var seatCountLimit = 3
private var userInfo: com.cheng.bole.bean.UserEntity? = null
private var vipGoodsEntity: com.cheng.bole.bean.VipGoodsEntity? = null
private var orderEntity: com.cheng.bole.bean.OrderPayEntity? = null
private val goodsAdapter by lazy { VipMealAdapter() }
private val userTipsList = mutableListOf<String>()
private val userTipsAdapter by lazy { VipUserTipsAdapter(requireContext(), userTipsList) }
private var userInfo: UserEntity? = null
private var goodsEntity: VipGoodsEntity? = null
private var orderEntity: OrderPayEntity? = null
private var corpInfo: CorpInfoBean? = null
private var payTypeCheckedRes = R.mipmap.ic_pay_checked1
private var countdownDisposable: Disposable? = null
private var scrollTask: Disposable? = null
override fun initView() {
super.initView()
mTitleBar?.background = null
setBackColor(R.color.white)
setPageStyle()
checkPayType()
binding.tvPrice.typeface = Constants.dDIN_PRO_M
binding.tvTipTitle.typeface = Constants.almmsht
binding.rvUserTips.adapter = userTipsAdapter
binding.rvMeal.adapter = mealAdapter
binding.rvTip.adapter = tipAdapter
tipAdapter.setList(com.cheng.bole.bean.VipTipItemEntity.getVipTipList())
binding.rvGoods.adapter = goodsAdapter
binding.cbAgree.visibility = if (UserConfigManager.isPayAgreementEnable()) View.VISIBLE else View.GONE
binding.tvAgree.visibility = if (UserConfigManager.isPayAgreementEnable()) View.VISIBLE else View.GONE
binding.tvPrice.typeface = Constants.dDIN_PRO_M
}
override fun initData() {
@ -82,7 +106,9 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
api = WXAPIFactory.createWXAPI(requireContext(), Constants.WechatAppId)
mViewModel.userInfo()
mViewModel.getGoodsList()
mViewModel.getPayUserTips()
mViewModel.getGoodsList(if (vipType == 0) "member" else "corp")
if (vipType == 1) mViewModel.getCorpInfo()
}
@SuppressLint("NotifyDataSetChanged", "SetTextI18n")
@ -91,63 +117,74 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
setBackPressed()
mTitleBar?.setNavigationOnClickListener {
if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "icon", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else {
requireActivity().finish()
}
}
mealAdapter.setOnItemClickListener { _, _, i ->
val item = mealAdapter.getItem(i)
if (item.goods_id == vipGoodsEntity?.goods_id) return@setOnItemClickListener
mealAdapter.data.forEach { it.checked = it.goods_id == item.goods_id }
mealAdapter.notifyDataSetChanged()
EventReportManager.eventReport(EventConstants.GOODS_SELECT, "${origin}:${item.goods_name}", Gson().toJson(item))
binding.rvUserTips.onTouch { _, _ -> true }
vipGoodsEntity = item
setPrice(vipGoodsEntity!!.price.toFloat())
goodsAdapter.setOnItemClickListener { _, _, i ->
val item = goodsAdapter.getItem(i)
if (item.goods_id == goodsEntity?.goods_id) return@setOnItemClickListener
goodsAdapter.data.forEach { it.checked = it.goods_id == item.goods_id }
goodsAdapter.notifyDataSetChanged()
goodsEntity = item
if (vipType == 1) {
seatCountLimit = goodsEntity!!.member_limit.toInt()
if (seatCount < seatCountLimit) seatCount = seatCountLimit
binding.tvSeatPrice.text = "+¥${DecimalFormat("0.##").format(goodsEntity!!.member_price.toFloat())}"
binding.tvSeatOriginPrice.text = "(原¥${DecimalFormat("0.##").format(goodsEntity!!.origin_member_price.toFloat())})"
setSeatCount()
seatPrice = (seatCount - seatCountLimit) * (goodsEntity?.member_price?.toFloat() ?: 0f)
setPrice(goodsEntity!!.price.toFloat() + seatPrice)
} else {
setPrice(goodsEntity!!.price.toFloat())
}
releasePayType()
}
binding.tvWxPay.onClick {
payType = 0
checkPayType()
EventReportManager.eventReport(EventConstants.PAY_SELECT, "weixin", origin)
binding.ivAdd.onClick {
seatCount++
setSeatCount()
seatPrice = (seatCount - seatCountLimit) * goodsEntity!!.member_price.toFloat()
setPrice(goodsEntity!!.price.toFloat() + seatPrice)
binding.ivSubtract.setImageResource(R.mipmap.ic_subtract_count_enable)
}
binding.ivSubtract.onClick {
if (seatCount > seatCountLimit) {
seatCount--
setSeatCount()
seatPrice = (seatCount - seatCountLimit) * goodsEntity!!.member_price.toFloat()
setPrice(goodsEntity!!.price.toFloat() + seatPrice)
binding.ivSubtract.setImageResource(if (seatCount > seatCountLimit) R.mipmap.ic_subtract_count_enable else R.mipmap.ic_subtract_count_disable)
}
}
binding.tvAliPay.onClick {
payType = 1
checkPayType()
EventReportManager.eventReport(EventConstants.PAY_SELECT, "alipay", origin)
}
binding.nextBtn.onClick {
if (vipGoodsEntity == null) return@onClick
if (!UserConfigManager.getNoLoginPay() && !LoginManager.isLogin()) {
toast("请登录后支付")
return@onClick
binding.tvWxPay.onClick {
payType = 0
checkPayType()
}
if (payType == 0 && !api.isWXAppInstalled) {
toast("您没有安装微信客户端,请先下载安装")
return@onClick
}
if (UserConfigManager.isPayAgreementEnable() && !isAgree) {
val f = PayTipDialog.newInstance(!TextUtils.isEmpty(vipGoodsEntity?.sign_value) && payType == 1)
f.setOnSelectListener {
binding.cbAgree.isChecked = true
if (this.payType == 0) {
mViewModel.payCreateOrder(vipGoodsEntity!!.goods_id, "weixin", origin)
} else {
mViewModel.payCreateOrder(vipGoodsEntity!!.goods_id, "alipay", origin)
}
}
f.show(childFragmentManager, PayTipDialog::class.java.simpleName)
} else {
if (this.payType == 0) {
mViewModel.payCreateOrder(vipGoodsEntity!!.goods_id, "weixin", origin)
} else {
mViewModel.payCreateOrder(vipGoodsEntity!!.goods_id, "alipay", origin)
}
}
EventReportManager.eventReport(EventConstants.PAY_PAY, if (payType == 0) "weixin" else "alipay", Gson().toJson(vipGoodsEntity))
binding.tvBankPay.onClick {
payType = 2
checkPayType()
}
binding.cbAgree.onCheckedChange { _, isChecked ->
@ -157,73 +194,141 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
binding.tvAgree.onClick {
binding.cbAgree.isChecked = !binding.cbAgree.isChecked
}
binding.tvPay.onClick {
if (goodsEntity == null) return@onClick
if (!UserConfigManager.getNoLoginPay() && !LoginManager.isLogin()) {
toast("请登录后支付")
return@onClick
}
if (payType == 0 && !api.isWXAppInstalled) {
toast("您没有安装微信客户端,请先下载安装")
return@onClick
}
if (UserConfigManager.isPayAgreementEnable() && !isAgree) {
val f = PayTipDialog.newInstance(showAgreement = true, showRenew = !TextUtils.isEmpty(goodsEntity?.sign_value) && payType == 1)
f.setOnSelectListener {
binding.cbAgree.isChecked = true
if (payType == 0) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "weixin", origin, "${seatCount - seatCountLimit}")
} else if (payType == 1) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "alipay", origin, "${seatCount - seatCountLimit}")
} else if (payType == 2) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "bank", origin, "${seatCount - seatCountLimit}")
}
}
f.show(childFragmentManager, PayTipDialog::class.java.simpleName)
} else {
if (payType == 0) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "weixin", origin, "${seatCount - seatCountLimit}")
} else if (payType == 1) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "alipay", origin, "${seatCount - seatCountLimit}")
} else if (payType == 2) {
mViewModel.payCreateOrder(goodsEntity!!.goods_id, "bank", origin, "${seatCount - seatCountLimit}")
}
}
EventReportManager.eventReport(
EventConstants.PAY_PAY,
if (payType == 0) "weixin" else if (payType == 1) "alipay" else "bank",
Gson().toJson(goodsEntity)
)
}
}
@SuppressLint("SetTextI18n")
@SuppressLint("NotifyDataSetChanged", "SetTextI18n")
override fun initObserve() {
super.initObserve()
mViewModel.userInfoLiveData.observe(this) {
userInfo = it
}
mViewModel.mealListLiveData.observe(this) { list ->
if (list.size <= 3) {
binding.rvMeal.layoutManager = GridLayoutManager(requireContext(), 3)
binding.rvMeal.setPadding(DensityUtils.dp2px(20f), 0, DensityUtils.dp2px(20f),0)
binding.rvMeal.addItemDecoration(GridSpaceItemDecoration(3, 0, DensityUtils.dp2px(10f)))
if (TextUtils.isEmpty(it.vip_expire)) {
binding.layoutCountdown.visible()
startCountdown(DateUtils.getDayEndTime() - System.currentTimeMillis() / 1000)
} else {
binding.rvMeal.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
binding.rvMeal.addItemDecoration(SpacesItemDecoration(DensityUtils.dp2px(10f), RecyclerView.HORIZONTAL))
binding.rvMeal.addItemDecoration(FirstItemOffsetDecoration(DensityUtils.dp2px(20f), FirstItemOffsetDecoration.left))
binding.layoutCountdown.gone()
}
}
mealAdapter.setList(list)
vipGoodsEntity = list.find { it.checked }
if (vipGoodsEntity == null && list.isNotEmpty()) {
vipGoodsEntity = list[0]
mViewModel.goodsListLiveData.observe(this) { list ->
if (list.size <= 3) {
binding.rvGoods.layoutManager = GridLayoutManager(requireContext(), 3)
binding.rvGoods.addItemDecoration(GridSpaceItemDecoration(3, 0, DensityUtils.dp2px(12f)))
} else {
binding.rvGoods.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
binding.rvGoods.addItemDecoration(SpacesItemDecoration(DensityUtils.dp2px(12f), RecyclerView.HORIZONTAL))
}
goodsAdapter.setList(list)
goodsEntity = list.find { it.checked }
if (goodsEntity == null && list.isNotEmpty()) {
goodsEntity = list[0]
}
if (goodsEntity != null) {
if (vipType == 1) {
seatCountLimit = goodsEntity!!.member_limit.toInt()
if (seatCount < seatCountLimit) seatCount = seatCountLimit
binding.tvSeatPrice.text = "+¥${DecimalFormat("0.##").format(goodsEntity!!.member_price.toFloat())}"
binding.tvSeatOriginPrice.text = "(原¥${DecimalFormat("0.##").format(goodsEntity!!.origin_member_price.toFloat())})"
setSeatCount()
seatPrice = (seatCount - seatCountLimit) * (goodsEntity?.member_price?.toFloat() ?: 0f)
setPrice(goodsEntity!!.price.toFloat() + seatPrice)
} else {
setPrice(goodsEntity!!.price.toFloat())
}
if (vipGoodsEntity != null) {
setPrice(vipGoodsEntity!!.price.toFloat())
releasePayType()
}
initPrivacyTv()
}
mViewModel.corpInfoLiveData.observe(this) {
corpInfo = it
if (!TextUtils.isEmpty(it.sub_user_limit)) {
seatCount = corpInfo!!.sub_user_limit.toInt()
}
setSeatCount()
}
mViewModel.createOrderLiveData.observe(this) {
orderEntity = it
if (this.payType == 0) {
if (payType == 0) {
PayUtils.toWXPay(requireActivity(), it)
} else {
} else if (payType == 1) {
PayUtils.toAliPay(requireActivity(), it.payParam, "")
} else {
// PublicActivity.start(requireContext(), CertificateFragment::class.java, Pair("orderId", orderEntity!!.orderId))
}
}
mViewModel.payTipsLiveData.observe(this) {
userTipsList.addAll(it)
userTipsAdapter.notifyDataSetChanged()
startScroll()
}
val payStatusDisposable = RxBus.defaultInstance.toObservable(PayStatusEvent::class.java).subscribe {
when (it.payStatus) {
PayStatusEnum.PAY_SUCCESS -> {
toast("支付成功")
sendBDReport(true)
EventReportManager.eventReport(
EventConstants.PAY_SUCCESS,
if (payType == 0) "weixin" else "alipay",
"{isGuide:$isGuide, orderId:${orderEntity?.orderId}, meal:${Gson().toJson(vipGoodsEntity)}}"
"{isGuide:$isGuide, orderId:${orderEntity?.orderId}, meal:${Gson().toJson(goodsEntity)}}"
)
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else {
RxBus.defaultInstance.post(VipPaySuccessEvent())
requireActivity().finish()
RxBus.defaultInstance.post(PaySuccessEvent())
}
requireActivity().finish()
}
PayStatusEnum.PAY_CANCEL -> {
toast("支付取消")
sendBDReport(false)
toast("已取消支付")
EventReportManager.eventReport(EventConstants.PAY_CANCEL, if (payType == 0) "weixin" else "alipay", "{isGuide:$isGuide, orderId:${orderEntity?.orderId}")
}
else -> {
toast("支付取消")
sendBDReport(false)
toast("已取消支付")
EventReportManager.eventReport(if (payType == 0) EventConstants.ERROR_CLIENT_WXPAY_ERR else EventConstants.ERROR_CLIENT_ALIPAY_ERR, "{isGuide:$isGuide, orderId:${orderEntity?.orderId}", it.message)
}
}
@ -231,19 +336,124 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
addDisposable(payStatusDisposable)
}
private fun checkPayType() {
if (payType == 0) {
val start1 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay)
val end1 = ContextCompat.getDrawable(requireContext(), payTypeCheckedRes)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start1, null, end1, null)
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null)
val start3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_transfer_pay)
val end3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvBankPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start3, null, end3, null)
} else if (payType == 1) {
val start1 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay)
val end1 = ContextCompat.getDrawable(requireContext(), payTypeCheckedRes)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start1, null, end1, null)
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null)
val start3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_transfer_pay)
val end3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvBankPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start3, null, end3, null)
} else {
val start1 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_transfer_pay)
val end1 = ContextCompat.getDrawable(requireContext(), payTypeCheckedRes)
binding.tvBankPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start1, null, end1, null)
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null)
val start3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay)
val end3 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_default)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start3, null, end3, null)
}
initPrivacyTv()
}
private fun releasePayType() {
val list = goodsEntity?.pay_type?.split(",")?.map { it.trim() }?.toList()
if (list?.find { it == "alipay" } != null) {
binding.tvAliPay.visible()
} else {
binding.tvAliPay.gone()
}
if (list?.find { it == "weixin" } != null) {
binding.tvWxPay.visible()
} else {
binding.tvWxPay.gone()
}
if (list?.find { it == "bank" } != null) {
binding.tvBankPay.visible()
} else {
binding.tvBankPay.gone()
}
if (goodsEntity?.pay_type!!.startsWith("weixin")) {
payType = 0
}
if (goodsEntity?.pay_type!!.startsWith("alipay")) {
payType = 1
}
if (goodsEntity?.pay_type!!.startsWith("bank")) {
payType = 2
}
checkPayType()
}
private fun initPrivacyTv() {
val spanUtils = SpanUtils.with(binding.tvAgree)
.append("我已阅读并同意")
.append("《会员服务协议规则》")
.setClickSpan(getColor(R.color.color_ff493c), false) {
UrlHelper.startUserAgreement(requireContext(), "会员服务协议规则")
}
if (!TextUtils.isEmpty(goodsEntity?.sign_value?.trim()) && payType == 1) {
spanUtils.append("")
spanUtils.append("《自动续费服务规则》")
spanUtils.setClickSpan(getColor(R.color.color_ff493c), false) {
UrlHelper.startRenewAgreement(requireContext())
}
}
spanUtils.create()
}
private fun setSeatCount() {
binding.tvCount.text = "$seatCount"
SpanUtils.with(binding.tvSeatTip2)
.append("当前")
.append("1个")
.setForegroundColor(Color.parseColor("#D6AA58"))
.append("主号+")
.append("${seatCount}")
.setForegroundColor(Color.parseColor("#D6AA58"))
.append("席位")
.create()
}
@SuppressLint("SetTextI18n")
private fun setPrice(price: Float) {
totalPrice = if (price < 0) 0f else price
SpanUtils.with(binding.tvPrice)
.append("")
.setFontSize(13, true)
.append(DecimalFormat("0.##").format(totalPrice))
.append(formatPricePeriod(vipGoodsEntity!!.value))
.append(formatPricePeriod(goodsEntity!!.value))
.setFontSize(13, true)
.create()
SpanUtils.with(binding.tvOriginPrice)
.append("${DecimalFormat("0.##").format(vipGoodsEntity!!.origin_price.toFloat())}")
.setStrikethrough()
.create()
val totalOriginPrice = if (vipType == 1) {
goodsEntity!!.origin_price.toFloat() + (seatCount - seatCountLimit) * (goodsEntity?.origin_member_price?.toFloat() ?: 0f)
} else {
goodsEntity!!.origin_price.toFloat()
}
binding.tvSavedPrice.text = "立省${DecimalFormat("0.##").format(totalOriginPrice - totalPrice)}"
}
private fun formatPricePeriod(value: String): String {
@ -265,78 +475,104 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
return ""
}
private fun checkPayType() {
if (payType == 0) {
val start = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay)
val end = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_true)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start, null, end, null)
private fun setPageStyle() {
if (vipType == 0) {
payTypeCheckedRes = R.mipmap.ic_pay_checked1
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_false)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null)
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)
val tipsLp = binding.ivTips.layoutParams as ConstraintLayout.LayoutParams
tipsLp.dimensionRatio = "h,1030:1010"
binding.ivTips.layoutParams = tipsLp
binding.ivTips.setImageResource(R.mipmap.ic_vip_tips1)
binding.tvDay.setBackgroundResource(R.drawable.shape_vip_countdown_bg1)
binding.tvHour.setBackgroundResource(R.drawable.shape_vip_countdown_bg1)
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.layoutSeat.gone()
} else {
val start = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay)
val end = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_true)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start, null, end, null)
payTypeCheckedRes = R.mipmap.ic_pay_checked2
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_false)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null)
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)
val tipsLp = binding.ivTips.layoutParams as ConstraintLayout.LayoutParams
tipsLp.dimensionRatio = "h,1030:1301"
binding.ivTips.layoutParams = tipsLp
binding.ivTips.setImageResource(R.mipmap.ic_vip_tips2)
SpanUtils.with(binding.tvSeatTip1)
.append("增加")
.append("1个")
.setForegroundColor(Color.parseColor("#146847"))
.append("席位")
.create()
binding.tvDay.setBackgroundResource(R.drawable.shape_vip_countdown_bg2)
binding.tvHour.setBackgroundResource(R.drawable.shape_vip_countdown_bg2)
binding.tvMinute.setBackgroundResource(R.drawable.shape_vip_countdown_bg2)
binding.tvSecond.setBackgroundResource(R.drawable.shape_vip_countdown_bg2)
binding.tvPay.setTextColor(Color.WHITE)
binding.layoutSeat.visible()
}
initPrivacyTv()
}
private fun releasePayType() {
val list = vipGoodsEntity?.pay_type?.split(",")?.map { it.trim() }?.toList()
if (list?.find { it == "alipay" } != null) {
binding.tvAliPay.visible()
} else {
binding.tvAliPay.gone()
private fun startCountdown(time: Long) {
countdownDisposable = RxCountDown.countdown(time)
.subscribe {
setCountdownTime(it)
}
if (list?.find { it == "weixin" } != null) {
binding.tvWxPay.visible()
} else {
binding.tvWxPay.gone()
}
if (vipGoodsEntity?.pay_type!!.startsWith("alipay")) {
payType = 1
}
if (vipGoodsEntity?.pay_type!!.startsWith("weixin")) {
payType = 0
//格式化倒计时
private fun setCountdownTime(seconds: Long) {
val minutes = seconds / 60
val hours = minutes / 60
val day = hours / 24
binding.tvDay.text = String.format("%02d", day)
binding.tvHour.text = if (day > 0) String.format("%02d", hours % 24) else String.format("%02d", hours)
binding.tvMinute.text = String.format("%02d", minutes % 60)
binding.tvSecond.text = String.format("%02d", seconds % 60)
}
checkPayType()
private fun startScroll() {
if (userTipsList.isEmpty() || scrollTask != null) return
scrollTask = Observable.interval(300, 9, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
if (activity != null) {
binding.rvUserTips.scrollBy(3, 0)
}
}
}
private fun initPrivacyTv() {
val spanUtils = SpanUtils.with(binding.tvAgree)
.append("我已阅读并同意")
.append("《会员服务协议规则》")
.setClickSpan(getColor(R.color.color_125ffe), false) {
UrlHelper.startUserAgreement(requireContext(), "会员服务协议规则")
}
if (!TextUtils.isEmpty(vipGoodsEntity?.sign_value) && payType == 1) {
spanUtils.append("")
spanUtils.append("《自动续费服务规则》")
spanUtils.setClickSpan(getColor(R.color.color_125ffe), false) {
UrlHelper.startRenewAgreement(requireContext())
}
}
spanUtils.create()
private fun stopScroll() {
scrollTask?.dispose()
scrollTask = null
}
private fun sendBDReport(isSuccess: Boolean) {
ConvertReportHelper.onEventPurchase(
"member",
vipGoodsEntity!!.goods_name,
vipGoodsEntity!!.goods_id,
1,
if (payType == 0) "weixin" else "alipay",
"¥",
isSuccess,
totalPrice.toInt()
)
override fun onStart() {
startScroll()
super.onStart()
}
override fun onStop() {
stopScroll()
super.onStop()
}
override fun onDestroyView() {
countdownDisposable?.dispose()
super.onDestroyView()
}
@SuppressLint("UnsafeOptInUsageError")
@ -344,8 +580,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
if (BuildCompat.isAtLeastT()) {
requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) {
if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else {
requireActivity().finish()
}
@ -353,8 +591,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
} else {
requireActivity().onBackPressedDispatcher.addCallback(this) {
if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else {
requireActivity().finish()
}

View File

@ -9,18 +9,19 @@ 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 com.cheng.bole.R
import com.cheng.bole.common.Constants
import java.text.DecimalFormat
class VipMealAdapter : LoadMoreAdapter<com.cheng.bole.bean.VipGoodsEntity>(R.layout.listitem_vip_meal) {
class VipMealAdapter : LoadMoreAdapter<VipGoodsEntity>(R.layout.listitem_vip_meal) {
@SuppressLint("NotifyDataSetChanged")
override fun convert(holder: BaseViewHolder, item: com.cheng.bole.bean.VipGoodsEntity) {
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)

View File

@ -0,0 +1,38 @@
package com.cheng.bole.ui.fragment.mine.vip
import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.RecyclerView
import coil.load
import coil.transform.CircleCropTransformation
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cheng.bole.R
import com.example.base.utils.DensityUtils
class VipUserTipsAdapter(val context: Context, val data: MutableList<String>): RecyclerView.Adapter<BaseViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
val view = View.inflate(context, R.layout.listitem_vip_user_tip, null)
val lp = ConstraintLayout.LayoutParams(LayoutParams.WRAP_CONTENT, DensityUtils.dp2px(24f))
lp.leftMargin = DensityUtils.dp2px(10f)
view.layoutParams = lp
return BaseViewHolder(view)
}
@SuppressLint("DiscouragedApi")
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
holder.getView<ImageView>(R.id.iv_avatar).load(context.resources.getIdentifier("yq_${position % 50}", "mipmap", context.packageName)) {
transformations(CircleCropTransformation())
}
holder.setText(R.id.tv_content, data[position % data.size])
}
override fun getItemCount(): Int {
return if (data.isNotEmpty()) Int.MAX_VALUE else 0
}
}

View File

@ -1,18 +1,28 @@
package com.cheng.bole.ui.fragment.mine.vip
import androidx.lifecycle.MutableLiveData
import com.cheng.bole.bean.CorpInfoBean
import com.cheng.bole.bean.CouponEntity
import com.cheng.bole.bean.OrderPayEntity
import com.cheng.bole.bean.UserEntity
import com.cheng.bole.bean.VipGoodsEntity
import com.cheng.bole.net.ApiFactory
import com.example.base.extensions.toast
import com.example.base.utils.L
import com.example.base.viewmodel.BaseViewModel
import com.google.gson.JsonObject
import com.ylqh.cube.bean.CouponActivityEntity
import okhttp3.RequestBody.Companion.toRequestBody
class VipViewModel : BaseViewModel() {
val userInfoLiveData = MutableLiveData<com.cheng.bole.bean.UserEntity>()
val mealListLiveData = MutableLiveData<List<com.cheng.bole.bean.VipGoodsEntity>>()
val couponListLiveData = MutableLiveData<List<com.cheng.bole.bean.CouponEntity>>()
val createOrderLiveData = MutableLiveData<com.cheng.bole.bean.OrderPayEntity>()
val userInfoLiveData = MutableLiveData<UserEntity>()
val goodsListLiveData = MutableLiveData<List<VipGoodsEntity>>()
val corpInfoLiveData = MutableLiveData<CorpInfoBean>()
val createOrderLiveData = MutableLiveData<OrderPayEntity>()
val payTipsLiveData = MutableLiveData<List<String>>()
val couponListLiveData = MutableLiveData<List<CouponEntity>>()
val couponActivityLiveData = MutableLiveData<List<CouponActivityEntity>>()
val getCouponLiveData = MutableLiveData<Any>()
fun userInfo() {
showDialog()
@ -29,11 +39,69 @@ class VipViewModel : BaseViewModel() {
})
}
fun getGoodsList() {
fun getGoodsList(type: String) {
showDialog()
launchOnUiTryCatch({
val response = ApiFactory.apiService.getGoodsList()
val response = ApiFactory.apiService.getGoodsList(type)
if (response.status) {
mealListLiveData.postValue(response.data)
goodsListLiveData.postValue(response.data)
} else toast(response.message, true)
dismissDialog()
}, {
dismissDialog()
setError(it)
L.d(it)
})
}
fun getCorpInfo() {
showDialog()
launchOnUiTryCatch({
val response = ApiFactory.apiService.getSeatInfo()
if (response.status) {
corpInfoLiveData.postValue(response.data)
} else toast(response.message, true)
dismissDialog()
}, {
dismissDialog()
setError(it)
L.d(it)
})
}
fun payCreateOrder(goos_id: String, pay_type: String, source: String, seatCount: String, coupon: String? = "") {
showDialog()
launchOnUiTryCatch({
val json = JsonObject()
json.addProperty("goods_id", goos_id)
json.addProperty("pay_type", pay_type)
json.addProperty("source", source)
json.addProperty("pay_source", "app")
json.addProperty("coupon", coupon ?: "")
val extra = JsonObject()
extra.addProperty("add_corp_limit", seatCount)
json.add("extra", extra)
L.d("TAG-->>$json")
val response = ApiFactory.apiService.payCreateOrder(json.toString().toRequestBody())
if (response.status) {
createOrderLiveData.postValue(response.data)
} else {
toast(response.message, true)
}
dismissDialog()
}, {
dismissDialog()
setError(it)
L.d(it)
})
}
fun getPayUserTips() {
launchOnUiTryCatch({
val response = ApiFactory.apiService.getPayUserTips()
if (response.status) {
payTipsLiveData.postValue(response.data)
}
}, {
setError(it)
@ -58,25 +126,24 @@ class VipViewModel : BaseViewModel() {
})
}
fun payCreateOrder(goos_id: String, pay_type: String, source: String) {
fun couponActivityList() {
launchOnUiTryCatch({
val response = ApiFactory.apiService.couponActivityList("cli_pay_return")
if (response.status) {
couponActivityLiveData.postValue(response.data)
}
},{
L.d(it)
})
}
fun getActivityCoupon(ids: String) {
showDialog()
launchOnUiTryCatch({
val json = JsonObject()
json.addProperty("goods_id", goos_id)
json.addProperty("pay_type", pay_type)
json.addProperty("source", source)
json.addProperty("pay_source", "app")
val extra = JsonObject()
// extra.addProperty("choose_red_packet", true)//红包选中
json.add("extra", extra)
L.d("TAG-->>$json")
val response = ApiFactory.apiService.payCreateOrder(json.toString().toRequestBody())
val response = ApiFactory.apiService.getActivityCoupons(ids)
if (response.status) {
createOrderLiveData.postValue(response.data)
} else {
toast(response.message, true)
}
getCouponLiveData.postValue(Any())
} else toast(response.message, true)
dismissDialog()
}, {
dismissDialog()

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_4" />
<solid android:color="#DAF0E6" />
</shape>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="@dimen/dp_20"
android:topRightRadius="@dimen/dp_20" />
<solid android:color="#1F2126" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#EFD3B1"/>
<corners android:radius="@dimen/dp_4"/>
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#7EDEAC"/>
<corners android:radius="@dimen/dp_4"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#99162c23" />
<stroke
android:width="0.6dp"
android:color="#39443F" />
<corners android:radius="@dimen/dp_6" />
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#BDDED0" />
<corners android:radius="@dimen/dp_8" />
</shape>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="@dimen/dp_46"
android:height="@dimen/dp_35"
android:gravity="center">
<bitmap android:src="@mipmap/ic_vip_tab_checked_bg" />
</item>
<item
android:width="@dimen/dp_20"
android:height="@dimen/dp_20"
android:gravity="center">
<bitmap android:src="@mipmap/ic_vip_tab_checked" />
</item>
</layer-list>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="@dimen/dp_46"
android:height="@dimen/dp_35"
android:gravity="center">
<color android:color="@color/transparent" />
</item>
<item
android:width="@dimen/dp_20"
android:height="@dimen/dp_20"
android:gravity="center">
<bitmap android:src="@mipmap/ic_vip_tab_default" />
</item>
</layer-list>

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#F94747"/>
<solid android:color="#F3453C" />
<corners
android:bottomLeftRadius="@dimen/dp_2"
android:bottomRightRadius="@dimen/dp_10"
android:topLeftRadius="@dimen/dp_10"
android:topRightRadius="@dimen/dp_2" />
android:bottomRightRadius="@dimen/dp_8"
android:topLeftRadius="@dimen/dp_8" />
</shape>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_25"/>
<solid android:color="#4dffffff"/>
<stroke android:width="@dimen/dp_1" android:color="@color/white"/>
</shape>

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0F1016">
android:background="#180602">
<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView"
@ -21,166 +21,532 @@
android:id="@+id/iv_top_bg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:src="@mipmap/ic_vip_top_bg"
app:layout_constraintDimensionRatio="h,1125:975"
android:src="@mipmap/ic_vip_top_bg1"
app:layout_constraintDimensionRatio="h,1125:1200"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_meal"
android:id="@+id/rv_user_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-60dp"
android:layout_marginTop="@dimen/dp_100"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/iv_top_bg"
app:spanCount="3"
tools:itemCount="3"
tools:listitem="@layout/listitem_vip_meal" />
app:layout_constraintTop_toTopOf="parent"
tools:listitem="@layout/listitem_vip_user_tip" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_tip"
android:id="@+id/layout_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@id/rv_meal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_24"
android:background="@drawable/shape_vip_tips_bg"
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_height="0dp"
android:layout_marginTop="363dp"
android:background="@mipmap/ic_vip_tab_bg"
app:layout_constraintDimensionRatio="h,1125:146"
app:layout_constraintTop_toTopOf="parent">
<com.cheng.bole.widget.CommonShapeView
android:id="@+id/btn_tab1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:drawableStart="@drawable/shape_vip_tab_checked"
android:text="个人会员"
android:textColor="@color/color_fff5e6"
android:textSize="@dimen/sp_16"
app:csb_drawablePosition="left"
app:csb_fillColor="@color/transparent"
app:layout_constraintEnd_toStartOf="@id/btn_tab2"
app:layout_constraintStart_toStartOf="parent" />
<com.cheng.bole.widget.CommonShapeView
android:id="@+id/btn_tab2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:drawableStart="@drawable/shape_vip_tab_default"
android:text="企业会员"
android:textColor="@color/color_1b6648"
android:textSize="@dimen/sp_16"
app:csb_drawablePosition="left"
app:csb_fillColor="@color/transparent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_tab1" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_12"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintTop_toBottomOf="@id/layout_tab"
app:spanCount="3"
tools:itemCount="3"
tools:listitem="@layout/listitem_vip_goods" />
<LinearLayout
android:id="@+id/layout_countdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/rv_goods">
<TextView
android:id="@+id/tv_tip_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@mipmap/ic_vip_tips_star"
android:drawableEnd="@mipmap/ic_vip_tips_star"
android:text="新人优惠结束"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_day"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:background="@drawable/shape_vip_countdown_bg1"
android:gravity="center"
android:text="00"
android:textColor="@color/color_7e4024"
android:textSize="@dimen/sp_12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="天"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_hour"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:background="@drawable/shape_vip_countdown_bg1"
android:gravity="center"
android:text="00"
android:textColor="@color/color_7e4024"
android:textSize="@dimen/sp_12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="时"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_minute"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:background="@drawable/shape_vip_countdown_bg1"
android:gravity="center"
android:text="00"
android:textColor="@color/color_7e4024"
android:textSize="@dimen/sp_12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="分"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_second"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_4"
android:background="@drawable/shape_vip_countdown_bg1"
android:gravity="center"
android:text="00"
android:textColor="@color/color_7e4024"
android:textSize="@dimen/sp_12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="秒"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_4"
android:layout_marginEnd="@dimen/dp_16"
android:background="@mipmap/ic_vip_pay_bg1"
android:paddingStart="@dimen/dp_8"
android:paddingTop="@dimen/dp_42"
android:paddingEnd="@dimen/dp_8"
android:paddingBottom="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/layout_countdown">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_seat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_vip_seat_bg"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_seat_icon1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_13"
android:src="@mipmap/ic_vip_seat"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_seat_icon2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_10"
android:src="@mipmap/ic_vip_tag_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_seat_tip1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_7"
android:text="增加1个席位"
android:textColor="@color/color_222222"
android:textSize="@dimen/sp_16"
app:layout_constraintBottom_toBottomOf="@id/iv_seat_icon1"
app:layout_constraintStart_toEndOf="@id/iv_seat_icon1"
app:layout_constraintTop_toTopOf="@id/iv_seat_icon1" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_seat_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_4"
android:src="@mipmap/ic_seat_arrow"
app:layout_constraintBottom_toBottomOf="@id/tv_seat_tip1"
app:layout_constraintStart_toEndOf="@id/tv_seat_tip1"
app:layout_constraintTop_toTopOf="@id/tv_seat_tip1" />
<com.cheng.bole.widget.CommonShapeView
android:id="@+id/tv_seat_price"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_18"
android:gravity="center"
android:paddingStart="@dimen/dp_5"
android:paddingEnd="@dimen/dp_5"
android:text="+¥100"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:csb_cornerRadius="@dimen/dp_3"
app:csb_fillColor="#F94747"
app:layout_constraintBottom_toBottomOf="@id/iv_seat_arrow"
app:layout_constraintStart_toEndOf="@id/iv_seat_arrow"
app:layout_constraintTop_toTopOf="@id/iv_seat_arrow" />
<TextView
android:id="@+id/tv_seat_origin_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_7"
android:text="(原¥480)"
android:textColor="#708479"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="@id/tv_seat_price"
app:layout_constraintStart_toEndOf="@id/tv_seat_price"
app:layout_constraintTop_toTopOf="@id/tv_seat_price" />
<TextView
android:id="@+id/tv_seat_tip2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_18"
android:text="当前1个主号+3个席位"
android:textColor="@color/color_222222"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/iv_seat_icon1"
app:layout_constraintTop_toBottomOf="@id/iv_seat_icon1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_12"
android:background="@drawable/shape_daf0e6_cor4"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/tv_seat_tip2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_seat_tip2">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_subtract"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:src="@mipmap/ic_subtract_count_disable" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:minWidth="@dimen/dp_36"
android:text="3"
android:textColor="@color/color_1a1a1a"
android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:src="@mipmap/ic_add_count" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/layout_coupon_redpacket"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_12"
android:background="@drawable/shape_vip_coupon_bg"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/layout_seat"
app:layout_goneMarginTop="@dimen/dp_16">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_coupon"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_44">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:drawableStart="@mipmap/ic_vip_coupon"
android:drawablePadding="@dimen/dp_8"
android:gravity="center"
android:text="解锁以下会员权益"
android:textColor="#FFEADB"
android:text="折扣优惠券"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_6"
android:drawableEnd="@mipmap/ic_arrow_dp16"
android:text="暂无可用的优惠券"
android:textColor="@color/color_fffaef"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#39443F" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_red_packet"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_44">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:drawableStart="@mipmap/ic_vip_redpacket"
android:drawablePadding="@dimen/dp_8"
android:gravity="center"
android:text="现金红包"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_6"
android:drawableEnd="@mipmap/ic_arrow_dp16"
android:text="暂无可用的红包"
android:textColor="@color/color_fffaef"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_wx_pay"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_54"
android:layout_marginTop="@dimen/dp_12"
android:drawableStart="@mipmap/ic_wx_pay"
android:drawableEnd="@mipmap/ic_pay_default"
android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_12"
android:paddingEnd="@dimen/dp_12"
android:text="微信支付"
android:textColor="@color/color_fdf7f0"
android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@id/layout_coupon_redpacket" />
<TextView
android:id="@+id/tv_ali_pay"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_54"
android:drawableStart="@mipmap/ic_ali_pay"
android:drawableEnd="@mipmap/ic_pay_checked1"
android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_12"
android:paddingEnd="@dimen/dp_12"
android:text="支付宝支付"
android:textColor="@color/color_fdf7f0"
android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@id/tv_wx_pay" />
<TextView
android:id="@+id/tv_bank_pay"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_54"
android:drawableStart="@mipmap/ic_transfer_pay"
android:drawableEnd="@mipmap/ic_pay_default"
android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_12"
android:paddingEnd="@dimen/dp_12"
android:text="对公转账"
android:textColor="@color/color_fdf7f0"
android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@id/tv_ali_pay" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_tips"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
android:src="@mipmap/ic_vip_tips1"
app:layout_constraintDimensionRatio="h,1030:1010"
app:layout_constraintTop_toBottomOf="@id/layout_pay" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_15"
app:layout_constraintTop_toBottomOf="@id/iv_tips" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0A0A0A"
android:paddingStart="@dimen/dp_16"
android:paddingTop="@dimen/dp_9"
android:paddingEnd="@dimen/dp_16"
android:paddingBottom="@dimen/dp_9"
app:layout_constraintBottom_toBottomOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_pay_btn"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@mipmap/ic_vip_pay_btn_bg1"
app:layout_constraintDimensionRatio="h,1005:138"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginTop="0dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_price"
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.588">
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_13"
android:text="¥398"
android:textColor="@color/color_fff4e6"
android:textSize="@dimen/sp_24"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/tv_saved_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_5"
android:text="立省2000"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toTopOf="@id/tv_invoice"
app:layout_constraintStart_toEndOf="@id/tv_price"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_invoice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_5"
android:text="(可开发票)"
android:textColor="@color/color_ecc9ae"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/tv_saved_price"
app:layout_constraintStart_toStartOf="@id/tv_saved_price"
app:layout_constraintTop_toBottomOf="@id/tv_saved_price" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_pay"
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="立即购买"
android:textColor="@color/color_703d27"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_tip_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:src="@mipmap/ic_vip_tips_divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tip_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintTop_toBottomOf="@id/iv_tip_divider"
app:spanCount="4"
tools:listitem="@layout/listitem_vip_tip" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_vip_tips_light"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_vip_tips_light"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_meal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@id/layout_tip">
<TextView
android:id="@+id/tv_pay_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_9"
android:text="支付方式"
android:textColor="#FFEADB"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvWxPay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@mipmap/ic_wx_pay"
android:drawableEnd="@mipmap/ic_pay_false"
android:drawablePadding="@dimen/dp_12"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:text="微信"
android:textColor="@color/color_80ffffff"
android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@+id/tv_pay_title" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:background="@color/color_1affffff"
app:layout_constraintTop_toBottomOf="@id/tvWxPay" />
<TextView
android:id="@+id/tvAliPay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@mipmap/ic_ali_pay"
android:drawableEnd="@mipmap/ic_pay_false"
android:drawablePadding="@dimen/dp_12"
android:gravity="center_vertical"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20"
android:text="支付宝"
android:textColor="@color/color_80ffffff"
android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@id/tvWxPay" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:background="@color/color_1affffff"
app:layout_constraintTop_toBottomOf="@id/tvAliPay" />
app:layout_constraintStart_toEndOf="@id/layout_price" />
</androidx.constraintlayout.widget.ConstraintLayout>
<CheckBox
@ -188,12 +554,12 @@
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:background="@null"
android:button="@null"
android:drawableStart="@drawable/selector_default_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_meal" />
app:layout_constraintTop_toBottomOf="@id/layout_pay_btn" />
<TextView
android:id="@+id/tv_agree"
@ -204,35 +570,13 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:text="我已阅读并同意《会员服务协议规则》和《自动续费服务规则》"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_fdf7f0"
android:textSize="@dimen/sp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cb_agree"
app:layout_constraintTop_toTopOf="@id/cb_agree" />
<!--<TextView
android:id="@+id/tv_agree"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:drawableStart="@mipmap/ic_pay_false"
android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical"
android:orientation="horizontal"
android:text="我已阅读并同意《会员服务协议规则》和《自动续费服务规则》"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
app:layout_constraintTop_toBottomOf="@id/layout_meal" />-->
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_15"
app:layout_constraintTop_toBottomOf="@id/tv_agree" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<com.example.base.widget.TitleBar
android:id="@+id/mTitleBar"
@ -243,58 +587,4 @@
app:navigationIcon="@drawable/ic_back_black"
app:title=" " />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_vip_bottom_bg"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_9"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_30"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥99.90/年"
android:textColor="#FBF4FA"
android:textSize="@dimen/sp_24"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_origin_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:text="¥129.9"
android:textColor="#999EAC"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="@id/tv_price"
app:layout_constraintStart_toEndOf="@id/tv_price" />
<com.cheng.bole.widget.CommonShapeView
android:id="@+id/nextBtn"
android:layout_width="@dimen/dp_170"
android:layout_height="@dimen/dp_46"
android:layout_marginStart="@dimen/dp_14"
android:text="立即开通"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
app:csb_activeEnable="true"
app:csb_cornerRadius="@dimen/dp_25"
app:csb_endColor="#204FC7"
app:csb_orientation="TOP_BOTTOM"
app:csb_startColor="#6E90E7"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/layout_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@mipmap/ic_personal_goods_checked"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="h,124:134"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_goods_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="月度会员"
android:fontFamily="sans-serif-medium"
android:textColor="@color/color_7e4024"
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:singleLine="true"
android:text="25"
android:textColor="@color/color_f11e1e"
android:textSize="@dimen/sp_30" />
<TextView
android:id="@+id/tv_origin_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:text="¥39"
android:textColor="@color/color_797069"
android:textSize="@dimen/sp_13" />
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="@+id/tv_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_vip_tag_bg"
android:drawableStart="@mipmap/ic_fire_tag"
android:drawablePadding="@dimen/dp_2"
android:paddingStart="@dimen/dp_6"
android:paddingTop="@dimen/dp_2"
android:paddingEnd="@dimen/dp_6"
android:paddingBottom="@dimen/dp_2"
android:text="限时优惠"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:layout_constraintStart_toStartOf="@id/layout_content"
app:layout_constraintTop_toTopOf="@id/layout_content" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_24"
android:layout_marginStart="@dimen/dp_10"
android:background="@drawable/shape_vip_user_tip_bg"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="@dimen/dp_10">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_avatar"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:src="@mipmap/ic_default_avatar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:text="恭喜 白芷 够买了 终身会员"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Some files were not shown because too many files have changed in this diff Show More