添加会员页(待完善)

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

View File

@ -1,31 +1,38 @@
package com.cheng.bole.ui.fragment.mine.vip package com.cheng.bole.ui.fragment.mine.vip
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.graphics.Color
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.window.OnBackInvokedDispatcher import android.window.OnBackInvokedDispatcher
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.os.BuildCompat import androidx.core.os.BuildCompat
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.cheng.bole.R 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.common.EventConstants
import com.cheng.bole.databinding.FragmentVipBinding import com.cheng.bole.databinding.FragmentVipBinding
import com.cheng.bole.event.PayStatusEnum import com.cheng.bole.event.PayStatusEnum
import com.cheng.bole.event.PayStatusEvent 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.EventReportManager
import com.cheng.bole.manager.LoginManager import com.cheng.bole.manager.LoginManager
import com.cheng.bole.manager.UserConfigManager import com.cheng.bole.manager.UserConfigManager
import com.cheng.bole.ui.activity.MainActivity import com.cheng.bole.ui.activity.MainActivity
import com.cheng.bole.ui.dialog.PayTipDialog import com.cheng.bole.ui.dialog.PayTipDialog
import com.cheng.bole.utils.DateUtils
import com.cheng.bole.utils.UrlHelper import com.cheng.bole.utils.UrlHelper
import com.cheng.bole.utils.pay.PayUtils import com.cheng.bole.utils.pay.PayUtils
import com.bytedance.ads.convert.event.ConvertReportHelper
import com.example.base.common.RxBus 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.GridSpaceItemDecoration
import com.example.base.decoration.SpacesItemDecoration import com.example.base.decoration.SpacesItemDecoration
import com.example.base.extensions.getColor import com.example.base.extensions.getColor
@ -39,42 +46,59 @@ import com.example.base.utils.SpanUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.tencent.mm.opensdk.openapi.IWXAPI import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory 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.onCheckedChange
import org.jetbrains.anko.sdk27.listeners.onTouch
import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivity
import java.text.DecimalFormat import java.text.DecimalFormat
import java.util.concurrent.TimeUnit
class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() { class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
private val origin by lazy { arguments?.getString("origin") ?: "center" } private val origin by lazy { arguments?.getString("origin") ?: "center" }
private val isGuide by lazy { origin == "bootpage" } private val isGuide by lazy { origin == "bootpage" }
private val vipType by lazy { arguments?.getInt("vipType") ?: 0 } // 0 个人版 1 企业版
private lateinit var api: IWXAPI private lateinit var api: IWXAPI
private var isAgree = false private var isAgree = false
private var payType = 0 //0微信支付 1支付宝支付 private var payType = 0 //0微信支付 1支付宝支付
private var totalPrice = 0f private var totalPrice = 0f
private val mealAdapter by lazy { VipMealAdapter() } private var seatPrice = 0f
private val tipAdapter by lazy { VipTipAdapter() } private var seatCount = 0
private var seatCountLimit = 3
private var userInfo: com.cheng.bole.bean.UserEntity? = null private val goodsAdapter by lazy { VipMealAdapter() }
private var vipGoodsEntity: com.cheng.bole.bean.VipGoodsEntity? = null
private var orderEntity: com.cheng.bole.bean.OrderPayEntity? = null 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() { override fun initView() {
super.initView() super.initView()
mTitleBar?.background = null
setBackColor(R.color.white) setBackColor(R.color.white)
setPageStyle()
checkPayType()
binding.tvPrice.typeface = Constants.dDIN_PRO_M binding.rvUserTips.adapter = userTipsAdapter
binding.tvTipTitle.typeface = Constants.almmsht
binding.rvMeal.adapter = mealAdapter binding.rvGoods.adapter = goodsAdapter
binding.rvTip.adapter = tipAdapter
tipAdapter.setList(com.cheng.bole.bean.VipTipItemEntity.getVipTipList())
binding.cbAgree.visibility = if (UserConfigManager.isPayAgreementEnable()) View.VISIBLE else View.GONE binding.cbAgree.visibility = if (UserConfigManager.isPayAgreementEnable()) View.VISIBLE else View.GONE
binding.tvAgree.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() { override fun initData() {
@ -82,7 +106,9 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
api = WXAPIFactory.createWXAPI(requireContext(), Constants.WechatAppId) api = WXAPIFactory.createWXAPI(requireContext(), Constants.WechatAppId)
mViewModel.userInfo() mViewModel.userInfo()
mViewModel.getGoodsList() mViewModel.getPayUserTips()
mViewModel.getGoodsList(if (vipType == 0) "member" else "corp")
if (vipType == 1) mViewModel.getCorpInfo()
} }
@SuppressLint("NotifyDataSetChanged", "SetTextI18n") @SuppressLint("NotifyDataSetChanged", "SetTextI18n")
@ -91,63 +117,74 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
setBackPressed() setBackPressed()
mTitleBar?.setNavigationOnClickListener { mTitleBar?.setNavigationOnClickListener {
if (isGuide) { if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "icon", pageDuration()) EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "icon", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else { } else {
requireActivity().finish() requireActivity().finish()
} }
} }
mealAdapter.setOnItemClickListener { _, _, i -> binding.rvUserTips.onTouch { _, _ -> true }
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))
vipGoodsEntity = item goodsAdapter.setOnItemClickListener { _, _, i ->
setPrice(vipGoodsEntity!!.price.toFloat()) 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() releasePayType()
} }
binding.tvWxPay.onClick {
payType = 0 binding.ivAdd.onClick {
checkPayType() seatCount++
EventReportManager.eventReport(EventConstants.PAY_SELECT, "weixin", origin) 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 { binding.tvAliPay.onClick {
payType = 1 payType = 1
checkPayType() checkPayType()
EventReportManager.eventReport(EventConstants.PAY_SELECT, "alipay", origin)
} }
binding.nextBtn.onClick {
if (vipGoodsEntity == null) return@onClick binding.tvWxPay.onClick {
if (!UserConfigManager.getNoLoginPay() && !LoginManager.isLogin()) { payType = 0
toast("请登录后支付") checkPayType()
return@onClick }
}
if (payType == 0 && !api.isWXAppInstalled) { binding.tvBankPay.onClick {
toast("您没有安装微信客户端,请先下载安装") payType = 2
return@onClick checkPayType()
}
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.cbAgree.onCheckedChange { _, isChecked -> binding.cbAgree.onCheckedChange { _, isChecked ->
@ -157,73 +194,141 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
binding.tvAgree.onClick { binding.tvAgree.onClick {
binding.cbAgree.isChecked = !binding.cbAgree.isChecked 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() { override fun initObserve() {
super.initObserve() super.initObserve()
mViewModel.userInfoLiveData.observe(this) { mViewModel.userInfoLiveData.observe(this) {
userInfo = it userInfo = it
} if (TextUtils.isEmpty(it.vip_expire)) {
mViewModel.mealListLiveData.observe(this) { list -> binding.layoutCountdown.visible()
if (list.size <= 3) { startCountdown(DateUtils.getDayEndTime() - System.currentTimeMillis() / 1000)
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)))
} else { } else {
binding.rvMeal.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false) binding.layoutCountdown.gone()
binding.rvMeal.addItemDecoration(SpacesItemDecoration(DensityUtils.dp2px(10f), RecyclerView.HORIZONTAL))
binding.rvMeal.addItemDecoration(FirstItemOffsetDecoration(DensityUtils.dp2px(20f), FirstItemOffsetDecoration.left))
} }
}
mealAdapter.setList(list) mViewModel.goodsListLiveData.observe(this) { list ->
if (list.size <= 3) {
vipGoodsEntity = list.find { it.checked } binding.rvGoods.layoutManager = GridLayoutManager(requireContext(), 3)
if (vipGoodsEntity == null && list.isNotEmpty()) { binding.rvGoods.addItemDecoration(GridSpaceItemDecoration(3, 0, DensityUtils.dp2px(12f)))
vipGoodsEntity = list[0] } else {
binding.rvGoods.layoutManager = LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
binding.rvGoods.addItemDecoration(SpacesItemDecoration(DensityUtils.dp2px(12f), RecyclerView.HORIZONTAL))
} }
if (vipGoodsEntity != null) { goodsAdapter.setList(list)
setPrice(vipGoodsEntity!!.price.toFloat())
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())
}
releasePayType() releasePayType()
} }
initPrivacyTv() 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) { mViewModel.createOrderLiveData.observe(this) {
orderEntity = it orderEntity = it
if (this.payType == 0) { if (payType == 0) {
PayUtils.toWXPay(requireActivity(), it) PayUtils.toWXPay(requireActivity(), it)
} else { } else if (payType == 1) {
PayUtils.toAliPay(requireActivity(), it.payParam, "") 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 { val payStatusDisposable = RxBus.defaultInstance.toObservable(PayStatusEvent::class.java).subscribe {
when (it.payStatus) { when (it.payStatus) {
PayStatusEnum.PAY_SUCCESS -> { PayStatusEnum.PAY_SUCCESS -> {
toast("支付成功") toast("支付成功")
sendBDReport(true)
EventReportManager.eventReport( EventReportManager.eventReport(
EventConstants.PAY_SUCCESS, EventConstants.PAY_SUCCESS,
if (payType == 0) "weixin" else "alipay", 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) { if (isGuide) {
requireActivity().startActivity<MainActivity>() requireActivity().startActivity<MainActivity>()
} else { } else {
RxBus.defaultInstance.post(VipPaySuccessEvent()) RxBus.defaultInstance.post(PaySuccessEvent())
requireActivity().finish()
} }
requireActivity().finish()
} }
PayStatusEnum.PAY_CANCEL -> { PayStatusEnum.PAY_CANCEL -> {
toast("支付取消") toast("已取消支付")
sendBDReport(false)
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", "{isGuide:$isGuide, orderId:${orderEntity?.orderId}")
} }
else -> { else -> {
toast("支付取消") toast("已取消支付")
sendBDReport(false)
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, "{isGuide:$isGuide, orderId:${orderEntity?.orderId}", it.message)
} }
} }
@ -231,19 +336,124 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
addDisposable(payStatusDisposable) 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) { private fun setPrice(price: Float) {
totalPrice = if (price < 0) 0f else price totalPrice = if (price < 0) 0f else price
SpanUtils.with(binding.tvPrice) SpanUtils.with(binding.tvPrice)
.append("") .append("")
.setFontSize(13, true) .setFontSize(13, true)
.append(DecimalFormat("0.##").format(totalPrice)) .append(DecimalFormat("0.##").format(totalPrice))
.append(formatPricePeriod(vipGoodsEntity!!.value)) .append(formatPricePeriod(goodsEntity!!.value))
.setFontSize(13, true) .setFontSize(13, true)
.create() .create()
SpanUtils.with(binding.tvOriginPrice) val totalOriginPrice = if (vipType == 1) {
.append("${DecimalFormat("0.##").format(vipGoodsEntity!!.origin_price.toFloat())}") goodsEntity!!.origin_price.toFloat() + (seatCount - seatCountLimit) * (goodsEntity?.origin_member_price?.toFloat() ?: 0f)
.setStrikethrough() } else {
.create() goodsEntity!!.origin_price.toFloat()
}
binding.tvSavedPrice.text = "立省${DecimalFormat("0.##").format(totalOriginPrice - totalPrice)}"
} }
private fun formatPricePeriod(value: String): String { private fun formatPricePeriod(value: String): String {
@ -265,78 +475,104 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
return "" return ""
} }
private fun checkPayType() { private fun setPageStyle() {
if (payType == 0) { if (vipType == 0) {
val start = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay) payTypeCheckedRes = R.mipmap.ic_pay_checked1
val end = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_true)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start, null, end, null)
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay) binding.ivTopBg.setImageResource(R.mipmap.ic_vip_top_bg1)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_false) binding.layoutPay.setBackgroundResource(R.mipmap.ic_vip_pay_bg1)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null) 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 { } else {
val start = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_ali_pay) payTypeCheckedRes = R.mipmap.ic_pay_checked2
val end = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_true)
binding.tvAliPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start, null, end, null)
val start2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_wx_pay) binding.ivTopBg.setImageResource(R.mipmap.ic_vip_top_bg2)
val end2 = ContextCompat.getDrawable(requireContext(), R.mipmap.ic_pay_false) binding.layoutPay.setBackgroundResource(R.mipmap.ic_vip_pay_bg2)
binding.tvWxPay.setCompoundDrawablesRelativeWithIntrinsicBounds(start2, null, end2, null) 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() { private fun startCountdown(time: Long) {
val list = vipGoodsEntity?.pay_type?.split(",")?.map { it.trim() }?.toList() countdownDisposable = RxCountDown.countdown(time)
if (list?.find { it == "alipay" } != null) { .subscribe {
binding.tvAliPay.visible() setCountdownTime(it)
} else {
binding.tvAliPay.gone()
}
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
}
checkPayType()
}
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 sendBDReport(isSuccess: Boolean) { //格式化倒计时
ConvertReportHelper.onEventPurchase( private fun setCountdownTime(seconds: Long) {
"member", val minutes = seconds / 60
vipGoodsEntity!!.goods_name, val hours = minutes / 60
vipGoodsEntity!!.goods_id, val day = hours / 24
1, binding.tvDay.text = String.format("%02d", day)
if (payType == 0) "weixin" else "alipay", binding.tvHour.text = if (day > 0) String.format("%02d", hours % 24) else String.format("%02d", hours)
"¥", binding.tvMinute.text = String.format("%02d", minutes % 60)
isSuccess, binding.tvSecond.text = String.format("%02d", seconds % 60)
totalPrice.toInt() }
)
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 stopScroll() {
scrollTask?.dispose()
scrollTask = null
}
override fun onStart() {
startScroll()
super.onStart()
}
override fun onStop() {
stopScroll()
super.onStop()
}
override fun onDestroyView() {
countdownDisposable?.dispose()
super.onDestroyView()
} }
@SuppressLint("UnsafeOptInUsageError") @SuppressLint("UnsafeOptInUsageError")
@ -344,8 +580,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
if (BuildCompat.isAtLeastT()) { if (BuildCompat.isAtLeastT()) {
requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) { requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) {
if (isGuide) { if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration()) EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else { } else {
requireActivity().finish() requireActivity().finish()
} }
@ -353,8 +591,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
} else { } else {
requireActivity().onBackPressedDispatcher.addCallback(this) { requireActivity().onBackPressedDispatcher.addCallback(this) {
if (isGuide) { if (isGuide) {
requireActivity().startActivity<MainActivity>()
EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration()) EventReportManager.eventReport(EventConstants.GUIDE_SKIP, "back", pageDuration())
}
if (isGuide) {
requireActivity().startActivity<MainActivity>()
} else { } else {
requireActivity().finish() requireActivity().finish()
} }

View File

@ -9,18 +9,19 @@ import androidx.core.view.setPadding
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.chad.library.adapter.base.viewholder.BaseViewHolder 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.extensions.getColor
import com.example.base.ui.list.LoadMoreAdapter import com.example.base.ui.list.LoadMoreAdapter
import com.example.base.utils.DensityUtils import com.example.base.utils.DensityUtils
import com.example.base.utils.SpanUtils import com.example.base.utils.SpanUtils
import com.cheng.bole.R
import com.cheng.bole.common.Constants
import java.text.DecimalFormat 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") @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) holder.setGone(R.id.tv_tag, true)
if (item.tips.isNotEmpty()) { if (item.tips.isNotEmpty()) {
holder.setVisible(R.id.tv_tag, true) 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 package com.cheng.bole.ui.fragment.mine.vip
import androidx.lifecycle.MutableLiveData 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.cheng.bole.net.ApiFactory
import com.example.base.extensions.toast import com.example.base.extensions.toast
import com.example.base.utils.L import com.example.base.utils.L
import com.example.base.viewmodel.BaseViewModel import com.example.base.viewmodel.BaseViewModel
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.ylqh.cube.bean.CouponActivityEntity
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
class VipViewModel : BaseViewModel() { class VipViewModel : BaseViewModel() {
val userInfoLiveData = MutableLiveData<com.cheng.bole.bean.UserEntity>() val userInfoLiveData = MutableLiveData<UserEntity>()
val mealListLiveData = MutableLiveData<List<com.cheng.bole.bean.VipGoodsEntity>>() val goodsListLiveData = MutableLiveData<List<VipGoodsEntity>>()
val couponListLiveData = MutableLiveData<List<com.cheng.bole.bean.CouponEntity>>() val corpInfoLiveData = MutableLiveData<CorpInfoBean>()
val createOrderLiveData = MutableLiveData<com.cheng.bole.bean.OrderPayEntity>() 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() { fun userInfo() {
showDialog() showDialog()
@ -29,11 +39,69 @@ class VipViewModel : BaseViewModel() {
}) })
} }
fun getGoodsList() { fun getGoodsList(type: String) {
showDialog()
launchOnUiTryCatch({ launchOnUiTryCatch({
val response = ApiFactory.apiService.getGoodsList() val response = ApiFactory.apiService.getGoodsList(type)
if (response.status) { 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) 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() showDialog()
launchOnUiTryCatch({ launchOnUiTryCatch({
val json = JsonObject() val response = ApiFactory.apiService.getActivityCoupons(ids)
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())
if (response.status) { if (response.status) {
createOrderLiveData.postValue(response.data) getCouponLiveData.postValue(Any())
} else { } else toast(response.message, true)
toast(response.message, true)
}
dismissDialog() dismissDialog()
}, { }, {
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"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#F94747"/> <solid android:color="#F3453C" />
<corners <corners
android:bottomLeftRadius="@dimen/dp_2" android:bottomRightRadius="@dimen/dp_8"
android:bottomRightRadius="@dimen/dp_10" android:topLeftRadius="@dimen/dp_8" />
android:topLeftRadius="@dimen/dp_10"
android:topRightRadius="@dimen/dp_2" />
</shape> </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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#0F1016"> android:background="#180602">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView" android:id="@+id/nestedScrollView"
@ -21,219 +21,563 @@
android:id="@+id/iv_top_bg" android:id="@+id/iv_top_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:src="@mipmap/ic_vip_top_bg" android:src="@mipmap/ic_vip_top_bg1"
app:layout_constraintDimensionRatio="h,1125:975" app:layout_constraintDimensionRatio="h,1125:1200"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_meal" android:id="@+id/rv_user_tips"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="-60dp" android:layout_marginTop="@dimen/dp_100"
android:orientation="horizontal" android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/iv_top_bg" app:layout_constraintTop_toTopOf="parent"
app:spanCount="3" tools:listitem="@layout/listitem_vip_user_tip" />
tools:itemCount="3"
tools:listitem="@layout/listitem_vip_meal" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_tip" android:id="@+id/layout_tab"
android:layout_width="match_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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_20" android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_12"
app:layout_constraintTop_toBottomOf="@id/rv_meal"> 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: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_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 <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_seat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24" android:background="@drawable/shape_vip_seat_bg"
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"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<TextView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/tv_tip_title" android:id="@+id/iv_seat_icon1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableStart="@mipmap/ic_vip_tips_star" android:layout_marginStart="@dimen/dp_12"
android:drawableEnd="@mipmap/ic_vip_tips_star" android:layout_marginTop="@dimen/dp_13"
android:drawablePadding="@dimen/dp_8" android:src="@mipmap/ic_vip_seat"
android:gravity="center"
android:text="解锁以下会员权益"
android:textColor="#FFEADB"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_tip_divider" android:id="@+id/iv_seat_icon2"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16" android:layout_marginStart="@dimen/dp_24"
android:src="@mipmap/ic_vip_tips_divider" android:layout_marginTop="@dimen/dp_10"
app:layout_constraintEnd_toEndOf="parent" android:src="@mipmap/ic_vip_tag_small"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_tip_title" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <TextView
android:id="@+id/rv_tip" android:id="@+id/tv_seat_tip1"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2" android:layout_marginStart="@dimen/dp_7"
android:overScrollMode="never" android:text="增加1个席位"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" android:textColor="@color/color_222222"
app:layout_constraintTop_toBottomOf="@id/iv_tip_divider" android:textSize="@dimen/sp_16"
app:spanCount="4" app:layout_constraintBottom_toBottomOf="@id/iv_seat_icon1"
tools:listitem="@layout/listitem_vip_tip" /> 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> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatImageView <LinearLayout
android:layout_width="wrap_content" android:id="@+id/layout_coupon_redpacket"
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_width="match_parent"
android:layout_height="wrap_content" 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="@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:drawableStart="@mipmap/ic_wx_pay"
android:drawableEnd="@mipmap/ic_pay_false" android:drawableEnd="@mipmap/ic_pay_default"
android:drawablePadding="@dimen/dp_12" android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="@dimen/dp_20" android:paddingStart="@dimen/dp_12"
android:paddingTop="@dimen/dp_20" android:paddingEnd="@dimen/dp_12"
android:paddingEnd="@dimen/dp_20" android:text="微信支付"
android:paddingBottom="@dimen/dp_20" android:textColor="@color/color_fdf7f0"
android:text="微信"
android:textColor="@color/color_80ffffff"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@+id/tv_pay_title" /> app:layout_constraintTop_toBottomOf="@id/layout_coupon_redpacket" />
<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 <TextView
android:id="@+id/tvAliPay" android:id="@+id/tv_ali_pay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_54"
android:drawableStart="@mipmap/ic_ali_pay" android:drawableStart="@mipmap/ic_ali_pay"
android:drawableEnd="@mipmap/ic_pay_false" android:drawableEnd="@mipmap/ic_pay_checked1"
android:drawablePadding="@dimen/dp_12" android:drawablePadding="@dimen/dp_10"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="@dimen/dp_20" android:paddingStart="@dimen/dp_12"
android:paddingTop="@dimen/dp_20" android:paddingEnd="@dimen/dp_12"
android:paddingEnd="@dimen/dp_20" android:text="支付宝支付"
android:paddingBottom="@dimen/dp_20" android:textColor="@color/color_fdf7f0"
android:text="支付宝"
android:textColor="@color/color_80ffffff"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
app:layout_constraintTop_toBottomOf="@id/tvWxPay" /> app:layout_constraintTop_toBottomOf="@id/tv_wx_pay" />
<View <TextView
android:id="@+id/tv_bank_pay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_1" android:layout_height="@dimen/dp_54"
android:layout_marginStart="@dimen/dp_20" android:drawableStart="@mipmap/ic_transfer_pay"
android:layout_marginEnd="@dimen/dp_20" android:drawableEnd="@mipmap/ic_pay_default"
android:background="@color/color_1affffff" android:drawablePadding="@dimen/dp_10"
app:layout_constraintTop_toBottomOf="@id/tvAliPay" /> 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.constraintlayout.widget.ConstraintLayout>
<CheckBox <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/cb_agree" android:id="@+id/iv_tips"
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:background="@null"
android:button="@null"
android:drawableStart="@drawable/selector_default_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_meal" />
<TextView
android:id="@+id/tv_agree"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_20"
android:gravity="center_vertical"
android:orientation="horizontal"
android:text="我已阅读并同意《会员服务协议规则》和《自动续费服务规则》"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_20" android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_20" android:src="@mipmap/ic_vip_tips1"
android:drawableStart="@mipmap/ic_pay_false" app:layout_constraintDimensionRatio="h,1030:1010"
android:drawablePadding="@dimen/dp_10" app:layout_constraintTop_toBottomOf="@id/layout_pay" />
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 <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_15" android:layout_height="@dimen/dp_15"
app:layout_constraintTop_toBottomOf="@id/tv_agree" /> app:layout_constraintTop_toBottomOf="@id/iv_tips" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </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_toEndOf="@id/layout_price" />
</androidx.constraintlayout.widget.ConstraintLayout>
<CheckBox
android:id="@+id/cb_agree"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@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_pay_btn" />
<TextView
android:id="@+id/tv_agree"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_20"
android:gravity="center_vertical"
android:orientation="horizontal"
android:text="我已阅读并同意《会员服务协议规则》和《自动续费服务规则》"
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" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.example.base.widget.TitleBar <com.example.base.widget.TitleBar
android:id="@+id/mTitleBar" android:id="@+id/mTitleBar"
style="@style/Custom.TitleBar" style="@style/Custom.TitleBar"
@ -243,58 +587,4 @@
app:navigationIcon="@drawable/ic_back_black" app:navigationIcon="@drawable/ic_back_black"
app:title=" " /> 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> </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