Commit 3c84d046 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :加入盲盒类型和会员支付页
parent 9fdfaddb
......@@ -160,6 +160,6 @@ public interface IUserInfoApi {
* @return
*/
@POST(NetConfig.User.URL_PAY_RIGHTS_ORDER)
Observable<Response<AliPayEntity>> aliPayRights(@Query("goodsId") String goodsId, @Query("payType") String payType,@Query("phone") String phone);
Observable<Response<AliPayEntity>> aliPayRights(@Query("goodsId") String goodsId, @Query("payType") String payType, @Query("phone") String phone,@Query("rechargeType") String rechargeType);
}
package com.zxhl.cms.net.model.box
class TabEntity {
var name: String? = ""
var use: String = ""
var name: String = ""
var id: String? = ""
var value: String? = ""
var value: String = ""
}
\ No newline at end of file
package com.zxhl.cms.net.model.qy
import com.zxhl.cms.net.model.box.GoodList
import com.zxhl.cms.net.model.box.HomeBoxListEntity
import java.io.Serializable
/**
......@@ -49,5 +51,37 @@ class TbGoodsItemEntity : Serializable {
var coupon_start_time: String? = ""
var coupon_end_time: String? = ""
var viewType: Int = 3
//BoxEntity============================================S
var id: String? = ""
var boxId: String? = ""
var mainImage: String? = ""
var boxName: String? = ""
var description: String? = ""
var onePrice: Double? =0.0
var fivePrice: Double? =0.0
var totalSalesVolume: String? =""
var goodsList:List<GoodList>?=null
var headImages:List<String>?=null
var otherList:List<HomeBoxListEntity>?=null
var maxPriceStr: String? = ""
var minPriceStr: String? = ""
var onePriceStr: String? = ""
var text: String? = ""
var fiveShow: Int? = 1
var activitiesType: Int? = 0
var activitiesPrice: String? = ""
var activitiesRefreshImage: String? = ""
var activitiesRefreshName: String? = ""
var newUserPrice: String? = ""
var activitiesTimes: Int? = 0
var activitiesRefreshId: String = ""
var activitiesDiscount: String? = ""
var originalPrice: String = ""
var discount: String = ""
var bannerType: String = ""
//BoxEntity============================================E
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.zxhl.cms.pay
import android.app.Activity
import android.app.Dialog
import android.content.Intent
import android.net.Uri
import android.net.http.SslError
import android.os.Handler
import android.util.Log
......@@ -51,7 +53,7 @@ object PayDialog : PayContract.View {
private var mDialog: Dialog? = null;
private var mPayFunAdapter: PaymentFunAdapter? = null;
private var mActivity: Activity? = null
private var mHandler: Handler = Handler {
when (it.what) {
0 -> {
......@@ -75,6 +77,7 @@ object PayDialog : PayContract.View {
if (mDialog == null) {
mDialog = Dialog(context, R.style.CenterCompatDialogTheme)
}
mActivity = context
mPayCallBack = payCallBack
val mDialogView =
CenterDialog.showBottomDialog(
......@@ -311,8 +314,8 @@ object PayDialog : PayContract.View {
try {
if (url.startsWith("alipays://") //支付宝
) {
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
// startActivity(intent)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
mActivity?.startActivity(intent)
return true
}
} catch (e: Exception) { //防止crash (如果手机上没有安装处理某个scheme开头的url的APP, 会导致crash)
......
......@@ -209,6 +209,9 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://tb_goods_detail")
fun getIntentTbGoodsDetail(): Intent
@RounterUri(Constant.scheme + "://member_order")
fun getIntentMemberOrder(): Intent
@RounterUri(Constant.scheme + "://after_login")
fun getIntentAfterLogin(
@RounterParam("boxid") boxid: String,
......
......@@ -63,6 +63,17 @@ public class JumpUtils {
}
}
//开会员订单
public static void MemberOrderJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentMemberOrder();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void AfterLoginJump(String boxid, String needprice, String type, String onePrice, String fivePrice, String newPeople, String page) {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentAfterLogin(boxid, needprice, type, onePrice, fivePrice, newPeople, page);
......@@ -369,6 +380,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void FlashSaleJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentFlashSale();
......@@ -378,6 +390,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void WithdrawalJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentWithdrawal();
......
......@@ -129,6 +129,18 @@
</intent-filter>
</activity>
<activity android:name=".activity.OpenMemberOrderActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="member_order"
android:scheme="xxsq" />
</intent-filter>
</activity>
</application>
......
package com.zxbw.modulemain.activity
import android.view.View
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.pay.PayContract
import com.zxhl.cms.pay.PayPresenter
/**
* @author (wangXuewei)
* @datetime 2022-05-30 14:12 GMT+8
* @detail :
*/
class OpenMemberOrderActivity : BaseActivity(),PayContract.View {
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun onClick(v: View?) {
}
override fun layoutID(): Int {
return R.layout.activity_layout_member_order
}
override fun init() {
}
override fun updatePriceList(data: List<MemberEntity.ProductDetail>) {
}
override fun verifyOrderFail(errorMsg: String) {
}
override fun requestOrderSuc() {
}
override fun requestH5OrderSuc(form: String) {
}
override fun verifyOrderSuc(orsder: String) {
}
override fun setCanInvest(boolean: Boolean?) {
}
override fun setOrderNo(order: String?) {
}
override fun setAppInfo(result: AppInEntity?) {
}
}
\ No newline at end of file
package com.zxbw.modulemain.activity
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.text.Html
import android.util.Log
import android.view.View
import android.webkit.*
import androidx.recyclerview.widget.GridLayoutManager
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CircleCrop
......@@ -16,27 +19,21 @@ import com.zxbw.modulemain.presenter.RightsDetailPresenter
import com.zxbw.modulemain.presenter.RightsPayPresenter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.pay.PayContract
import com.zxhl.cms.pay.PayPresenter
import com.zxhl.cms.pay.PayActivity
import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.MainLooper
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.utils.RxBus
import com.zxhl.cms.utils.*
import com.zxhl.cms.widget.LoadingDialog
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.activity_layout_rights_detail.*
import kotlinx.android.synthetic.main.activity_login.*
import kotlinx.android.synthetic.main.activity_layout_rights_detail.id_img_back
import me.jessyan.autosize.utils.ScreenUtils
import java.text.DecimalFormat
......@@ -147,7 +144,6 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
mLoading?.setLoading("请稍后...")
mLoading?.show()
mPayPresenter?.requestRightsAliPay(mRightsData?.id ?: "", pay_type.toString(), phoneNumber)
}
private var payResultObservable: Observable<PayResultEntity>? = null
......@@ -157,9 +153,10 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
const val WECHAT_PAY = 2 //微信支付类型
const val MINI_PROGRAM = 11 //微信支付类型
const val MIN_PAY_PROGRAM = 13 //敏付
const val H5_PAY = 21 //h5支付
}
private var pay_type: Int? = ALI_PAY
private var pay_type: Int? = H5_PAY
private fun initPay() {
mLoading = LoadingDialog.getLoadingDialog(
this,
......@@ -193,6 +190,18 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
showResultLoading(false)
}
}, Consumer<Throwable> { })
var result = SettingPreference.getConfig()
if (result != null) {
if (result != null && !result.pay_config_v2.isNullOrEmpty()) {
for (i in result.pay_config_v2!!.indices) {
if (result?.pay_config_v2!![i].open == 1) {
pay_type = result?.pay_config_v2!![i].type
break
}
}
}
}
}
private var mHandler: Handler = Handler {
......@@ -207,7 +216,22 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
}
override fun requestOrderSuc(result: AliPayEntity) {
AlipayServer.payV2(this, result.wakeup!!)
if (pay_type == MIN_PAY_PROGRAM) {
SettingPreference.setOutTradeNo(result?.outTradeNo)
JumpUtils.h5Jump("https://api.minpayment.com/pay.do?sendMsg=" + result.wakeup)
} else if (pay_type == H5_PAY) {
SettingPreference.setOutTradeNo(result?.outTradeNo)
if (result.outTradeNo.isNullOrEmpty()) {
EventUtils.onEvent("h5_pay_error")
showResultLoading(false)
} else {
loadH5Pay(result.outTradeNo!!)
}
} else if (pay_type == ALI_PAY) {
AlipayServer.payV2(this, result.wakeup!!)
} else {
showToast("暂不支持")
}
}
override fun requestOrderFail(errorMsg: String) {
......@@ -216,11 +240,14 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
override fun verifyOrderSuc(order: String) {
showResultLoading(true)
showToast("成功!")
Log.d("wxw","成功")
}
override fun verifyOrderFail(errorMsg: String) {
showResultLoading(false)
}
private fun showResultLoading(isPaySuc: Boolean) {
if (isPaySuc) {
mLoading?.setResult(true, "支付成功", 1000)
......@@ -228,9 +255,104 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
mLoading?.setResult(false, "支付失败", 1000)
}
}
override fun onPause() {
super.onPause()
isPause = true
}
private var isPause = false
override fun onResume() {
super.onResume()
Log.d("wxw","OnResume")
if (isPause) {
Log.d("wxw","1OnResume"+pay_type)
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) {
//如果是敏支付或者H5支付
mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else {
Log.d("wxw","2OnResume"+pay_type)
mHandler?.sendEmptyMessageDelayed(0, 2000)
}
}
}
override fun onDestroy() {
super.onDestroy()
if (payResultObservable != null)
RxBus.get().unregister(Constant.PAY_RESULT, payResultObservable!!)
}
private fun loadH5Pay(form: String) {
// id_rights_pay_web_view.visibility = View.VISIBLE
Log.d("wxw", "startTime" + System.currentTimeMillis())
val webSettings = id_rights_pay_web_view.settings
//如果访问的页面中要与Javascript交互,则webview必须设置支持Javascript
webSettings.javaScriptEnabled = true
//设置自适应屏幕,两者合用
webSettings.useWideViewPort = true //将图片调整到适合webview的大小
webSettings.loadWithOverviewMode = true // 缩放至屏幕的大小
//其他细节操作
webSettings.cacheMode = WebSettings.LOAD_NO_CACHE //关闭webview中缓存
webSettings.allowFileAccess = true //设置可以访问文件
webSettings.javaScriptCanOpenWindowsAutomatically = true //支持通过JS打开新窗口
webSettings.loadsImagesAutomatically = true //支持自动加载图片
webSettings.defaultTextEncodingName = "utf-8" //设置编码格式
webSettings.domStorageEnabled = true
webSettings.allowFileAccessFromFileURLs = true;
webSettings.allowUniversalAccessFromFileURLs = true;
id_rights_pay_web_view?.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
Log.e("WXW", "dURL" + url.toString())
if (url == null) return false
try {
if (url.startsWith("alipays://") //支付宝
) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
return true
}
} catch (e: Exception) { //防止crash (如果手机上没有安装处理某个scheme开头的url的APP, 会导致crash)
EventUtils.onEvent("h5_open_zfb_error", e.toString())
showResultLoading(false)
return true //没有安装该app时,返回true,表示拦截自定义链接,但不跳转,避免弹出上面的错误页面
}
//处理http和https开头的url
view?.loadUrl(url)
return false
}
override fun onPageFinished(view: WebView?, url: String?) {
Log.e("WXW", "cURL" + url.toString())
Log.d("wxw", "EndTime" + System.currentTimeMillis())
super.onPageFinished(view, url)
if (url?.contains(NetConfig.H5.WEB_URL_H5_PAY) == true) {
id_rights_pay_web_view?.loadUrl("javascript:loadPayHtml('$form')");
}
}
override fun onReceivedError(
view: WebView?,
request: WebResourceRequest?,
error: WebResourceError?
) {
super.onReceivedError(view, request, error)
EventUtils.onEvent("h5_pay_error1", error.toString())
showResultLoading(false)
}
override fun onReceivedHttpError(
view: WebView?,
request: WebResourceRequest?,
errorResponse: WebResourceResponse?
) {
super.onReceivedHttpError(view, request, errorResponse)
EventUtils.onEvent("h5_pay_error2", errorResponse.toString())
showResultLoading(false)
}
}
id_rights_pay_web_view.loadUrl(NetConfig.H5.WEB_URL_H5_PAY)
}
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ import me.jessyan.autosize.utils.ScreenUtils
* @datetime 2022-05-24 17:12 GMT+8
* @detail : 淘宝商品详情
*/
class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View,OnRecycleItemClickListener<TbGoodsItemEntity> {
private var mLoading: LoadingDialog? = null
private var mGoodsAdapter: GoodsListAdapter? = null;
private var mPresenter: TbGoodsDetailPresenter? = null;
......@@ -60,21 +60,15 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
// mPresenter?.getGoodsDetail(goodsDetail?.item_id ?: "")
}
private fun refreshData(){
private fun refreshData() {
mPresenter = TbGoodsDetailPresenter(this)
mGoodsAdapter = GoodsListAdapter(this,
OnRecycleItemClickListener<TbGoodsItemEntity> { view, position, data ->
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(this, TbGoodsDetailActivity().javaClass)
startActivity(intent)
})
mGoodsAdapter = GoodsListAdapter(this,this)
id_rcl_recommend_goods_list?.layoutManager = LinearLayoutManager(this)
id_rcl_recommend_goods_list.adapter = mGoodsAdapter
id_img_close_btn?.setOnClickListener(this)
id_ll_tb_buy_view?.setOnClickListener(this)
id_tv_open_vip_btn?.setOnClickListener(this)
initView()
......@@ -90,8 +84,8 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Log.d("wxw","newIntent")
if (intent!=null){
Log.d("wxw", "newIntent")
if (intent != null) {
goodsDetail = intent.getSerializableExtra("goods") as TbGoodsItemEntity
refreshData()
}
......@@ -112,7 +106,7 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
id_tv_tm_price?.text = goodsDetail?.reserve_price
id_tv_tm_buy_price?.text = goodsDetail?.reserve_price
id_tv_sale_num?.text = goodsDetail?.volume ?: "0"
id_tv_not_vip_desc.text = "会员下单,立省${goodsDetail?.coupon_amount?.toDoubleOrNull() ?: 0}元"
if (goodsDetail?.coupon_amount.isNullOrEmpty()) {
id_tv_xx_price?.text = "${goodsDetail?.reserve_price}"
id_tv_vip_buy_price?.text = "${goodsDetail?.reserve_price}"
......@@ -128,6 +122,7 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
id_tv_xx_price?.text = vipPrice
id_tv_vip_buy_price?.text = vipPrice
}
if (!goodsDetail?.small_images.isNullOrEmpty()) {
var mPagerAdapter = DetailBannerAdapter(goodsDetail?.small_images!!)
id_detail_top_banner.adapter = mPagerAdapter
......@@ -157,6 +152,9 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
id_img_close_btn -> {
finish()
}
id_tv_open_vip_btn -> {
JumpUtils.MemberOrderJump()
}
id_ll_tb_buy_view -> {
if (tbLink == "") {
showToast("未获取到信息,请重试")
......@@ -189,7 +187,7 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
}
override fun setTjGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?) {
if (!result.isNullOrEmpty()){
if (!result.isNullOrEmpty()) {
mGoodsAdapter?.clear()
mGoodsAdapter?.appendToList(result)
}
......@@ -272,4 +270,12 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
id_tb_web_view.loadUrl(sortUrl)
}
override fun onItemClick(view: View?, position: Int, data: TbGoodsItemEntity?) {
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(this, TbGoodsDetailActivity().javaClass)
startActivity(intent)
}
}
\ No newline at end of file
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.graphics.Paint
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import com.zhpan.indicator.IndicatorView
import com.zxbw.modulemain.R
import com.zxbw.modulemain.box.adapter.ItemBoxGoodsAdapter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.qy.JgqQyEntity
......@@ -31,6 +34,7 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
private val VIEW_TYPE_QY_VIEW = 1
private val VIEW_TYPE_ZERO_VIEW = 2
private val VIEW_TYPE_GOODS_VIEW = 3
private val VIEW_TYPE_BOX_VIEW = 4
constructor(
content: Activity?,
......@@ -51,10 +55,15 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
notifyDataSetChanged()
}
override fun getItemViewType(position: Int): Int {
var realPos = position;
if (mIsShowQyView) {
realPos = position - 1;
}
if (position == 0 && mIsShowQyView) {
return VIEW_TYPE_QY_VIEW
} else if (mList.size > 1 && mList[realPos].bannerType == "blindBox") {
return VIEW_TYPE_BOX_VIEW
} else {
return VIEW_TYPE_GOODS_VIEW
}
......@@ -69,26 +78,26 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
var viewNum = 0;
if (mIsShowQyView) {
viewNum = 1;
}
if (holder is GoodsViewHolder) {
var viewNum = 0;
if (mIsShowQyView) {
viewNum = 1;
}
val bean = mList[position - viewNum]
holder.id_tv_goods_name?.text = bean.title
if (mContext?.isFinishing == false) {
if(bean.pict_url?.startsWith("//img") == true){
holder.id_item_goods_img?.setLoadImageUrl("https:"+bean.pict_url, 0, 5)
}else{
if (bean.pict_url?.startsWith("//img") == true) {
holder.id_item_goods_img?.setLoadImageUrl("https:" + bean.pict_url, 0, 5)
} else {
holder.id_item_goods_img?.setLoadImageUrl(bean.pict_url, 0, 5)
}
}
holder.id_tv_tb_price_value?.text = "淘宝商城价 : ¥${bean.reserve_price}"
if (bean.coupon_amount.isNullOrEmpty()){
holder.id_tv_yhq_value?.visibility =View.GONE
holder.id_tv_goods_price?.text ="${bean.reserve_price}"
}else{
holder.id_tv_yhq_value?.visibility =View.VISIBLE
if (bean.coupon_amount.isNullOrEmpty()) {
holder.id_tv_yhq_value?.visibility = View.GONE
holder.id_tv_goods_price?.text = "${bean.reserve_price}"
} else {
holder.id_tv_yhq_value?.visibility = View.VISIBLE
holder.id_tv_yhq_value?.text = "${bean.coupon_amount}元券"
var r_price = bean.reserve_price?.toDoubleOrNull() ?: 0 as Double
var c_price = bean.coupon_amount?.toDoubleOrNull() ?: 0 as Double
......@@ -100,10 +109,10 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
)
}
if (bean.coupon_info.isNullOrEmpty()){
holder.id_tv_manjian_value?.visibility =View.GONE
}else{
holder.id_tv_manjian_value?.visibility =View.VISIBLE
if (bean.coupon_info.isNullOrEmpty()) {
holder.id_tv_manjian_value?.visibility = View.GONE
} else {
holder.id_tv_manjian_value?.visibility = View.VISIBLE
holder.id_tv_manjian_value?.text = "${bean.coupon_info}"
}
......@@ -143,13 +152,34 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
holder.qy_vp?.postDelayed(Runnable {
holder.qy_vp?.requestLayout()
}, 100)
holder.id_qy_indicator_view?.setSliderGap(60f)
holder.id_qy_indicator_view?.setSliderGap(40f)
holder.id_qy_indicator_view?.setupWithViewPager(holder.qy_vp!!)
} else {
holder.qy_item_view?.visibility = View.GONE
}
} else if (holder is ZeroViewHolder) {
} else if (holder is BoxViewHolder) {
val bean = mList[position - viewNum]
holder.box_main_img?.setLoadImageUrl(bean.mainImage, 0, 5)
holder.box_name?.text =bean.boxName
holder.box_price?.text =bean.onePriceStr
holder.box_old_price?.text = "¥ ${bean.originalPrice}"
holder.box_old_price?.paint?.flags = Paint.STRIKE_THRU_TEXT_FLAG
var a_price = bean.originalPrice?.toDoubleOrNull() ?: 0 as Double
var b_price = bean.onePriceStr?.toDoubleOrNull() ?: 0 as Double
holder.box_discount_desc?.text = "已减${Utils.getNoMoreThanTwoDigits(Utils.sub(a_price,b_price))}元"
var mAdapter: ItemBoxGoodsAdapter? = ItemBoxGoodsAdapter(mContext)
holder.box_goods_list?.layoutManager = LinearLayoutManager(mContext, RecyclerView.HORIZONTAL, false)
holder.box_goods_list?.adapter = mAdapter
mAdapter?.clear()
mAdapter?.appendToList(bean.goodsList)
holder.box_item_view?.setOnClickListener {
listener.onItemClick(it, position, bean)
}
}
}
......@@ -164,6 +194,11 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_home_zero_buy_view, parent, false)
)
} else if (viewType == VIEW_TYPE_BOX_VIEW) {
return BoxViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_box_goods_view, parent, false)
)
} else {
return GoodsViewHolder(
LayoutInflater.from(AppContext.get())
......@@ -173,6 +208,7 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
}
//商品
class GoodsViewHolder : RecyclerView.ViewHolder {
var id_rl_goods_item_view: RelativeLayout?
var id_item_goods_img: RecycleImageView?
......@@ -196,6 +232,7 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
}
}
//权益
class QyViewHolder : RecyclerView.ViewHolder {
var qy_item_view: RelativeLayout?
var qy_vp: ViewPager?
......@@ -210,6 +247,7 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
}
}
//零元购
class ZeroViewHolder : RecyclerView.ViewHolder {
constructor(
......@@ -218,4 +256,27 @@ class HomeRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView
}
}
//盲盒
class BoxViewHolder : RecyclerView.ViewHolder {
var box_item_view: RelativeLayout?
var box_main_img: RecycleImageView?
var box_name: TextView?
var box_discount_desc: TextView?
var box_price: TextView?
var box_old_price: TextView?
var box_goods_list: RecyclerView?
constructor(
itemView: View
) : super(itemView) {
box_item_view = itemView.findViewById<RelativeLayout>(R.id.id_rl_box_item_view)
box_main_img = itemView.findViewById<RecycleImageView>(R.id.id_item_box_main_img)
box_name = itemView.findViewById<TextView>(R.id.id_tv_box_name)
box_discount_desc = itemView.findViewById<TextView>(R.id.id_tv_box_discount_desc)
box_price = itemView.findViewById<TextView>(R.id.id_tv_box_price)
box_old_price = itemView.findViewById<TextView>(R.id.id_tv_box_old_price)
box_goods_list = itemView.findViewById<RecyclerView>(R.id.id_rcl_box_goods_list)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.box.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.box.GoodList
import com.zxhl.cms.widget.RecycleImageView
class ItemBoxGoodsAdapter : BaseRecyclerAdapter<GoodList, ItemBoxGoodsAdapter.ViewHolder> {
private var mContext: Context? = null
constructor(
content: Context?
) : super() {
mContext = content
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position]
holder.item_goods_img?.setLoadImageUrl(bean.mainImage, false)
// holder.item_goods_name?.text = bean.productName
// holder.item_goods_price?.text = "¥${bean.salePriceStr}"
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_box_goods_item_layout, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var item_goods_img: RecycleImageView?
var item_goods_name: TextView?
var item_goods_price: TextView?
constructor(
itemView: View
) : super(itemView) {
item_goods_img = itemView.findViewById<RecycleImageView>(R.id.id_img_goods)
item_goods_name = itemView.findViewById<TextView>(R.id.id_tv_goods_name)
item_goods_price = itemView.findViewById<TextView>(R.id.id_tv_goods_price)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
......@@ -19,7 +20,7 @@ class HomeRecommendContract {
interface Presenter {
fun getQyCardList(tabName: String)
fun getTbGoodsList(isRefresh: Boolean, cate: String)
fun getTbGoodsList(isRefresh: Boolean,tabEntity: TabEntity)
fun getGuessLikeGoodsList(isRefresh: Boolean)
}
......
......@@ -90,53 +90,39 @@ class HomeFragment : BaseFragment(), HomeContract.View {
positionOffset: Float,
positionOffsetPixels: Int
) {
}
override fun onPageSelected(position: Int) {
if (result[position].bannerType.equals("blindBox")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#8B3AFE"))
} else if (result[position].bannerType.equals("H5")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#628E43"))
} else {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FCFFFFFF")
id_fragment_home_tab.indicatorColor = Color.parseColor("#FFFFFF")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFED2E28"))
}
setHomeTabColor(result[position].bannerType)
}
override fun onPageScrollStateChanged(state: Int) {
}
})
if (result[0].bannerType.equals("blindBox")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#66597B")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#8B3AFE"))
} else if (result[0].bannerType.equals("H5")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#5C6C52")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#628E43"))
} else {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FFDBDB")
id_fragment_home_tab.indicatorColor = Color.parseColor("#FFFFFF")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFED2E28"))
}
setHomeTabColor(result[0].bannerType)
}
indicator_view.setupWithViewPager(id_home_top_banner)
}
private fun setHomeTabColor(bannerType:String){
if (bannerType.equals("blindBox")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FCFFFFFF")
id_fragment_home_tab.indicatorColor = Color.parseColor("#FFFFFF")
toolbar_layout.setContentScrimColor(Color.parseColor("#8B3AFE"))
} else if (bannerType.equals("H5")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#5C6C52")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#628E43"))
} else {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FFDBDB")
id_fragment_home_tab.indicatorColor = Color.parseColor("#FFFFFF")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFED2E28"))
}
}
override fun setTabList(result: List<TabEntity>?) {
if (result.isNullOrEmpty()) {
showToast("加载失败,请重试")
......@@ -145,7 +131,7 @@ class HomeFragment : BaseFragment(), HomeContract.View {
val adapter = FragmentAdapter(childFragmentManager)
for (i in 0 until (result.size ?: 0)) {
val title = result[i].name ?: ""
adapter.addFrag(RecommendFragment.newInstance(title), title)
adapter.addFrag(RecommendFragment.newInstance(result[i]), title)
}
viewPager?.adapter = adapter
id_fragment_home_tab?.setTextSelectSize(Utils.dip2px(20).toFloat())
......
......@@ -15,6 +15,7 @@ import com.zxbw.modulemain.adapter.ZeroBuyGoodsListAdapter
import com.zxbw.modulemain.contract.HomeRecommendContract
import com.zxbw.modulemain.presenter.HomeRecommendPresenter
import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
import com.zxhl.cms.utils.JumpUtils
......@@ -29,7 +30,7 @@ import kotlinx.android.synthetic.main.fragment_layout_recommend.*
class RecommendFragment : BaseFragment, HomeRecommendContract.View,
OnRecycleItemClickListener<TbGoodsItemEntity> {
private val title: String
private val tabEntity: TabEntity
private var mPresenter: HomeRecommendPresenter? = null
private var mGoodsAdapter: HomeRecommendAdapter? = null;
......@@ -42,51 +43,52 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View,
mGoodsAdapter = HomeRecommendAdapter(activity, this)
mGoodsAdapter?.IsShowQyView(title == "推荐")
mGoodsAdapter?.IsShowQyView(tabEntity.name == "推荐")
//底部商品列表
id_rcl_goods_list?.layoutManager = LinearLayoutManager(activity)
id_rcl_goods_list.adapter = mGoodsAdapter
id_refresh_view.setRefreshHeader(ClassicsHeader(activity))
id_refresh_view.setRefreshFooter(ClassicsFooter(activity))
//TODO 测试只加载权益,不加载列表是否有问题
id_refresh_view.setOnRefreshListener {
// it.finishRefresh(2000/*,false*/);//传入false表示加载失败
if (title.equals("猜你喜欢")) {
if (tabEntity.name == "猜你喜欢") {
mPresenter?.getGuessLikeGoodsList(true)
} else {
mPresenter?.getTbGoodsList(true, title)
mPresenter?.getTbGoodsList(true, tabEntity)
}
mPresenter?.getQyCardList(title)
mPresenter?.getQyCardList(tabEntity.name)
}
id_refresh_view.setOnLoadMoreListener {
// it.finishLoadMore(2000/*,false*/);//传入false表示加载失败
if (title.equals("猜你喜欢")) {
if (tabEntity.name == "猜你喜欢") {
mPresenter?.getGuessLikeGoodsList(false)
} else {
mPresenter?.getTbGoodsList(false, title)
mPresenter?.getTbGoodsList(false, tabEntity)
}
}
if (title.equals("猜你喜欢")) {
if (tabEntity.name == "猜你喜欢") {
mPresenter?.getGuessLikeGoodsList(true)
} else {
mPresenter?.getTbGoodsList(true, title)
mPresenter?.getTbGoodsList(true, tabEntity)
}
mPresenter?.getQyCardList(title)
mPresenter?.getQyCardList(tabEntity.name)
}
companion object {
fun newInstance(string: String): RecommendFragment {
return RecommendFragment(string)
fun newInstance(tab: TabEntity): RecommendFragment {
return RecommendFragment(tab)
}
}
constructor(title: String) : super() {
this.title = title
constructor(tab: TabEntity) : super() {
this.tabEntity = tab
}
constructor() : super() {
this.title = ""
this.tabEntity = TabEntity()
}
override fun setQyCardList(result: List<JgqQyEntity>?) {
......@@ -96,9 +98,9 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View,
}
override fun setTbGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?) {
if (isRefresh){
if (isRefresh) {
id_refresh_view.finishRefresh(!result.isNullOrEmpty());//传入false表示加载失败
}else{
} else {
id_refresh_view.finishLoadMore(!result.isNullOrEmpty());//传入false表示加载失败
}
......@@ -112,11 +114,16 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View,
override fun onItemClick(view: View?, position: Int, data: TbGoodsItemEntity?) {
// JumpUtils.TbGoodsDetailJump()
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(activity!!, TbGoodsDetailActivity().javaClass)
activity?.startActivity(intent)
if (data?.bannerType.equals("blindBox")){
JumpUtils.goodsDetailJump(data?.boxId)
}else{
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(activity!!, TbGoodsDetailActivity().javaClass)
activity?.startActivity(intent)
}
}
}
\ No newline at end of file
......@@ -22,7 +22,7 @@ class CardDetailPresenter : CardDetailContract.Presenter {
override fun requestRightsAliPay(goodsId: String, payType: String, phone: String) {
ApiClient.userInfoAPi.aliPayRights(goodsId, payType, phone)
ApiClient.userInfoAPi.aliPayRights(goodsId, payType, phone,"51")
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AliPayEntity>() {
override fun onSuccess(result: AliPayEntity?) {
......
......@@ -5,6 +5,7 @@ import com.zxbw.modulemain.contract.HomeRecommendContract
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsEntity
......@@ -38,11 +39,18 @@ class HomeRecommendPresenter : HomeRecommendContract.Presenter {
private var searchPage = 1;
private var pageSize = 20;
override fun getTbGoodsList(isRefresh: Boolean, cate: String) {
if (isRefresh) {
override fun getTbGoodsList(isRefresh: Boolean, tabEntity: TabEntity) {
if (isRefresh && tabEntity.name == "推荐") {
searchPage = 1;
}
ApiClient.homeApi.getGoodsListSearch(cate, cate, searchPage, pageSize)
var cate = ""
var keyword = ""
if (tabEntity.use == "cate") {
cate = tabEntity.value
} else {
keyword = tabEntity.name
}
ApiClient.homeApi.getGoodsListSearch(cate, keyword, searchPage, pageSize)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<TbGoodsEntity>() {
override fun onSuccess(result: TbGoodsEntity?) {
......@@ -55,7 +63,6 @@ class HomeRecommendPresenter : HomeRecommendContract.Presenter {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "code$code")
mView.setTbGoodsList(isRefresh, null)
}
})
......@@ -63,9 +70,9 @@ class HomeRecommendPresenter : HomeRecommendContract.Presenter {
private var guessLikePage = 1;
override fun getGuessLikeGoodsList(isRefresh: Boolean) {
if (isRefresh) {
guessLikePage = 1;
}
// if (isRefresh) {
// guessLikePage = 1;
// }
ApiClient.homeApi.getGoodsGuessLike(guessLikePage, pageSize)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<TbGoodsEntity>() {
......
......@@ -39,7 +39,7 @@ class RightsPayPresenter : RightsPayContract.Presenter {
override fun requestRightsAliPay(goodsId: String, payType: String, phone: String) {
ApiClient.userInfoAPi.aliPayRights(goodsId, payType, phone)
ApiClient.userInfoAPi.aliPayRights(goodsId, payType, phone, "50")
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AliPayEntity>() {
override fun onSuccess(result: AliPayEntity?) {
......@@ -77,10 +77,18 @@ class RightsPayPresenter : RightsPayContract.Presenter {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
}else if(payType==13){
} else if (payType == 13) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
}else if (payType == 21) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
} else {
mView?.verifyOrderFail("支付成功后 订单id为null")
}
}else{
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType")
}
} catch (e: Exception) {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:${e.cause} msg:${e.message}")
......@@ -96,7 +104,7 @@ class RightsPayPresenter : RightsPayContract.Presenter {
if (TextUtils.equals("200", result.status)) {
mView?.verifyOrderSuc(result.payStatus)
} else {
mView?.verifyOrderFail("订单校验请求成功 校验异常${result?.status?:-1}")
mView?.verifyOrderFail("订单校验请求成功 校验异常${result?.status ?: -1}")
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp" />
<stroke
android:width="1dp"
android:color="#D8D8D8" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F8F8F8"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/img_vip_top_bg" />
<View
android:id="@+id/id_vip_order_detail_title_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="15dp" />
<ImageView
android:id="@+id/id_img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/id_vip_order_detail_title_sys_bar_view"
android:src="@drawable/img_vip_fanhui_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/id_vip_order_detail_title_sys_bar_view"
android:layout_centerHorizontal="true"
android:text="确认订单"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/id_img_back"
android:layout_marginTop="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="@drawable/img_vip_top_order_bg">
<ImageView
android:id="@+id/id_img_check_vip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="26dp"
android:layout_marginRight="16dp"
android:src="@drawable/img_vip_check_icon" />
<TextView
android:id="@+id/id_tv_vip_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/id_img_check_vip"
android:layout_toRightOf="@id/id_img_check_vip"
android:text="恭喜您!会员资格已锁定"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/id_tv_vip_desc"
android:layout_toEndOf="@id/id_img_check_vip"
android:orientation="horizontal">
<TextView
android:id="@+id/id_tv_vip_lock_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:text="15:00:00"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="后失效"
android:textColor="@color/color_333333"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="20dp"
android:layout_marginBottom="51dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="会员费:"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="21元"
android:textColor="@color/color_333333"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="20dp"
android:layout_marginBottom="20dp"
android:text="会员费仅支付1次,终身免年费"
android:textColor="@color/color_333333"
android:textSize="12sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:background="@drawable/shape_white_r10"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="12dp"
android:paddingRight="18dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:src="@drawable/img_vip_phone_icon" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="会员手机号"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_user_vip_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_white_r10"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingTop="20dp"
android:paddingRight="12dp"
android:paddingBottom="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="16dp"
android:background="@drawable/shape_edd49d_r2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="限时秒杀"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/img_vip_rights_banner" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/img_vip_rights_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/shape_white_r10"
android:orientation="vertical"
android:paddingLeft="12dp"
android:paddingTop="20dp"
android:paddingRight="12dp"
android:layout_marginBottom="95dp"
android:paddingBottom="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="16dp"
android:background="@drawable/shape_edd49d_r2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="支付方式"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_vip_payment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp"
android:layout_alignParentBottom="true"
android:background="@drawable/img_vip_bottom_pay_btn_bg"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="限时¥ "
android:textColor="#FDDFA5"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="13dp"
android:text="21"
android:textColor="#FDDFA5"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="限时¥ 21"
android:textColor="#FDDFA5"
android:textSize="10sp" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="确认支付"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
......@@ -2,12 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F0F0F0">
<View
android:layout_width="match_parent"
android:layout_height="230dp"
android:background="@color/white" />
android:background="@color/white">
<RelativeLayout
android:id="@+id/id_rl_title_view"
......@@ -88,7 +83,8 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/id_rl_title_view">
android:layout_below="@id/id_rl_title_view"
android:background="#F3F4F5">
<LinearLayout
android:layout_width="match_parent"
......@@ -96,53 +92,61 @@
android:orientation="vertical">
<!--会员账号-->
<LinearLayout
android:id="@+id/id_ll_vip_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/id_ll_vip_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="会员账号"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="会员账号"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<EditText
android:id="@+id/id_edt_user_phone_number"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@id/id_ll_vip_phone"
android:layout_marginLeft="23dp"
android:layout_marginRight="23dp"
android:background="@color/white"
android:gravity="bottom"
android:hint="请输入您的手机号"
android:inputType="phone"
android:paddingBottom="8dp"
android:textColorHint="@color/color_999999"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="23dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="23dp"
android:background="#F0F0F0" />
</LinearLayout>
<EditText
android:id="@+id/id_edt_user_phone_number"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@id/id_ll_vip_phone"
android:layout_marginLeft="23dp"
android:layout_marginRight="23dp"
android:background="@color/white"
android:gravity="bottom"
android:hint="请输入您的手机号"
android:inputType="phone"
android:paddingBottom="8dp"
android:textColorHint="@color/color_999999"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="23dp"
android:layout_marginRight="23dp"
android:background="#F0F0F0" />
<View
android:layout_width="match_parent"
android:layout_height="10dp"
......@@ -150,37 +154,45 @@
android:background="#F3F4F5" />
<!--套餐-->
<LinearLayout
android:id="@+id/id_ll_vip_package"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/id_ll_vip_package"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="会员套餐"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="会员套餐"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_vip_package_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:layout_marginRight="12dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_vip_package_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:layout_marginRight="12dp" />
<View
android:layout_width="match_parent"
......@@ -190,42 +202,50 @@
<!--权益说明-->
<LinearLayout
android:id="@+id/id_ll_rights_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
android:background="@color/white"
android:orientation="vertical">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
<LinearLayout
android:id="@+id/id_ll_rights_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="3dp"
android:layout_height="14dp"
android:background="@drawable/shape_edd49d_r2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="权益说明"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:id="@+id/id_tv_rights_instructions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="权益说明"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:textStyle="bold" />
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:text=""
android:textColor="@color/color_666666"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_rights_instructions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:text=""
android:textColor="@color/color_666666"
android:textSize="12sp" />
<View
android:layout_width="match_parent"
android:layout_height="88dp"
......@@ -286,5 +306,9 @@
android:textStyle="bold" />
</LinearLayout>
<WebView
android:id="@+id/id_rights_pay_web_view"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
......@@ -122,17 +122,19 @@
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
<View
android:id="@+id/id_tb_goods_detail_title_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp" />
<ImageView
android:id="@+id/id_img_close_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/id_tb_goods_detail_title_sys_bar_view"
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_below="@id/id_tb_goods_detail_title_sys_bar_view"
android:src="@drawable/img_tb_goods_detail_fanhui" />
<!-- 商品价格信息-->
<RelativeLayout
......@@ -320,6 +322,7 @@
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_open_vip_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/img_tb_goods_detail_btn_bg"
......@@ -372,12 +375,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:visibility="invisible"
android:layout_marginRight="8dp"
android:drawableTop="@drawable/img_tb_goods_detail_select"
android:text="收藏"
android:textColor="@color/color_333333"
android:textSize="10sp" />
android:textSize="10sp"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/id_ll_tb_buy_view"
......@@ -460,7 +463,7 @@
<WebView
android:id="@+id/id_tb_web_view"
android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:visibility="gone" />
</RelativeLayout>
......@@ -24,7 +24,8 @@
<RelativeLayout
android:id="@+id/id_home_top_banner_view"
android:layout_width="match_parent"
android:layout_height="260dp">
android:layout_height="280dp"
android:paddingBottom="20dp">
<androidx.viewpager.widget.ViewPager
android:id="@+id/id_home_top_banner"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_margin="2.5dp"
android:background="@drawable/shape_d8d8d8_r2"
android:gravity="center"
android:orientation="vertical">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_img_goods"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/id_tv_goods_name"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/id_tv_goods_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="5dp"
android:includeFontPadding="false"
android:textColor="#FF2E31"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_rl_box_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center_horizontal"
android:orientation="horizontal">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_item_box_main_img"
android:layout_width="124dp"
android:layout_height="118dp"
android:layout_gravity="center"
android:layout_margin="10dp"
android:layout_marginEnd="10dp"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon_box_jiaobiao"
android:gravity="center"
android:text="限时盲盒"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_box_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_toEndOf="@id/id_item_box_main_img"
android:ellipsize="end"
android:layout_marginBottom="7dp"
android:maxLines="2"
android:text="商品名称商品名称品名称商品名称商品名称品名称商"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/id_ll_youhui_view"
android:layout_width="110dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:layout_below="@id/id_tv_box_name"
android:layout_toEndOf="@id/id_item_box_main_img"
android:background="@drawable/icon_box_youhui_tips"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="18dp"
android:layout_height="20dp"
android:gravity="center"
android:text="减"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_box_discount_desc"
android:layout_width="match_parent"
android:layout_height="20dp"
android:gravity="center_vertical"
android:text="已减10元幸运币"
android:textColor="#437EEE"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_box_price_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/id_ll_youhui_view"
android:layout_toEndOf="@id/id_item_box_main_img"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="¥"
android:textColor="#D81D00"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_box_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:text="0"
android:textColor="#D81D00"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_box_old_price_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="原价 "
android:textColor="@color/color_999999"
android:textSize="10sp" />
<TextView
android:id="@+id/id_tv_box_old_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥ 299"
android:textColor="@color/color_999999"
android:textSize="10sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_box_goods_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_ll_box_price_view"
android:layout_toEndOf="@id/id_item_box_main_img" />
</RelativeLayout>
\ No newline at end of file
......@@ -4,8 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center_horizontal"
......@@ -31,7 +31,7 @@
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<!-- 优惠券-->
<TextView
android:id="@+id/id_tv_yhq_value"
android:layout_width="wrap_content"
......@@ -47,7 +47,7 @@
android:text="1元券"
android:textColor="@color/white"
android:textSize="10sp" />
<!--满减-->
<TextView
android:id="@+id/id_tv_manjian_value"
android:layout_width="wrap_content"
......@@ -63,7 +63,7 @@
android:textColor="@color/white"
android:textSize="10sp" />
<!-- 淘宝价-->
<TextView
android:id="@+id/id_tv_tb_price_value"
android:layout_width="wrap_content"
......@@ -117,9 +117,9 @@
android:drawableLeft="@drawable/icon_vip_price"
android:drawablePadding="3dp"
android:text="会员到手价"
android:textStyle="bold"
android:textColor="#F8E8CC"
android:textSize="11sp" />
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
......
......@@ -18,9 +18,10 @@
android:id="@+id/id_qy_indicator_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/id_vp_home_jgq_qy_list"
android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:layout_below="@+id/id_vp_home_jgq_qy_list"
android:layout_marginBottom="15dp"
app:vpi_slider_checked_color="#F1352C"
app:vpi_slider_normal_color="#E8DFDF"
app:vpi_slider_radius="3dp" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment