Commit 58bc56a7 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :跳转订单UI
parent ab18a99d
......@@ -22,6 +22,7 @@ class RightsDetailEntity : Serializable {
var status: String? = ""
var productCode: String? = ""
var icon: String? = ""
var bgImage: String? = ""
var skillPrice: String? = ""
var eqText: String? = ""
......
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
......@@ -15,17 +18,21 @@ import com.zxhl.cms.widget.RecycleImageView
class ItemVipOrderAdapter :
BaseRecyclerAdapter<RightsDetailEntity, ItemVipOrderAdapter.ViewHolder> {
private var mContext: Context? = null
private var mContext: Activity? = null
constructor(
content: Context?
content: Activity?
) : super() {
mContext = content
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position]
holder.id_img_rights_icon?.setLoadImageUrl(bean.icon,false)
if (mContext?.isDestroyed != true){
Glide.with(mContext!!).load(bean.bgImage).placeholder(R.drawable.img_vip_rights_bg)
.into(holder?.id_img_rights_bg!!)
}
holder.id_img_rights_icon?.setLoadImageUrl(bean.icon, false)
holder.id_tv_vip_goods_name?.text = "${bean.brand} ${bean.category} ${bean.goodsName}"
holder.id_tv_vip_goods_price?.text = "¥${bean.salePrice}"
// holder.id_tv_vip_goods_num?.text = "${bean.salePrice}"
......@@ -40,6 +47,7 @@ class ItemVipOrderAdapter :
}
class ViewHolder : RecyclerView.ViewHolder {
var id_img_rights_bg: ImageView?
var id_img_rights_icon: RecycleImageView?
var id_tv_vip_goods_name: TextView?
var id_tv_vip_goods_price: TextView?
......@@ -48,6 +56,7 @@ class ItemVipOrderAdapter :
constructor(
itemView: View
) : super(itemView) {
id_img_rights_bg = itemView.findViewById<ImageView>(R.id.id_img_rights_bg)
id_img_rights_icon = itemView.findViewById<RecycleImageView>(R.id.id_img_rights_icon)
id_tv_vip_goods_name = itemView.findViewById<TextView>(R.id.id_tv_vip_goods_name)
id_tv_vip_goods_price = itemView.findViewById<TextView>(R.id.id_tv_vip_goods_price)
......
......@@ -38,7 +38,7 @@ class MyOrderAdapter : BaseRecyclerAdapter<ShopOrderEntity, RecyclerView.ViewHol
} else if (mList[position].orderType == "99") {
return VIEW_TYPE_GOODS_VIEW
} else {
return VIEW_TYPE_CARD_VIEW
return VIEW_TYPE_GOODS_VIEW
}
}
......@@ -51,8 +51,13 @@ class MyOrderAdapter : BaseRecyclerAdapter<ShopOrderEntity, RecyclerView.ViewHol
copy(holder.id_tv_order_no?.text.toString())
}
holder.id_tv_total_price?.text = "¥${bean.cash}"
holder.id_tv_pricedesc?.text =
"总价:¥${bean.totalPrice}|优惠:¥${bean.discount}|运费:¥${bean.freight}|"
if (bean.orderType=="99"){
holder.id_tv_pricedesc?.text =
"总价:|"
}else{
holder.id_tv_pricedesc?.text =
"总价:¥${bean.totalPrice}|优惠:¥${bean.discount}|运费:¥${bean.freight}|"
}
holder.id_tv_order_no?.text = bean.orderNo
holder.id_tv_pay_time?.text = bean.payTime
if (!bean.goodsList.isNullOrEmpty()) {
......@@ -105,9 +110,9 @@ class MyOrderAdapter : BaseRecyclerAdapter<ShopOrderEntity, RecyclerView.ViewHol
.inflate(R.layout.items_layout_box_order, parent, false)
)
} else {
return CardRightsOrderViewHolder(
return GoodsOrderViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.items_layout_card_rights_order, parent, false)
.inflate(R.layout.items_layout_box_order, parent, false)
)
}
......
......@@ -12,8 +12,12 @@
<RelativeLayout
android:layout_width="70dp"
android:layout_height="52dp"
android:layout_marginRight="10dp"
android:background="@drawable/img_vip_rights_bg">
android:layout_marginRight="10dp">
<ImageView
android:id="@+id/id_img_rights_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_img_rights_icon"
......
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