Commit 24bb902b authored by chengkun's avatar chengkun

加载商品网络图片

parent 95d8cf1b
......@@ -38,28 +38,28 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder.itemView.findViewById<TextView>(R.id.tv_goog1_name).text = data.order_item_list[0].goods_name
holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image2).visibility = View.GONE
holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image3).visibility = View.GONE
/*if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url)) {
if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url)) {
Glide.with(context).load(data.order_item_list[0].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image1))
}*/
}
}
2 -> {
holder.itemView.findViewById<TextView>(R.id.tv_goog1_name).text = data.order_item_list[0].goods_name
holder.itemView.findViewById<TextView>(R.id.tv_goog2_name).text = data.order_item_list[1].goods_name
holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image3).visibility = View.GONE
/*if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url) && Utils.isWebUrl(data.order_item_list[1].desc_pic_url)) {
if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url) && Utils.isWebUrl(data.order_item_list[1].desc_pic_url)) {
Glide.with(context).load(data.order_item_list[0].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image1))
Glide.with(context).load(data.order_item_list[1].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image2))
}*/
}
}
else -> {
holder.itemView.findViewById<TextView>(R.id.tv_goog1_name).text = data.order_item_list[0].goods_name
holder.itemView.findViewById<TextView>(R.id.tv_goog2_name).text = data.order_item_list[1].goods_name
holder.itemView.findViewById<TextView>(R.id.tv_good3_name).text = data.order_item_list[2].goods_name
/*if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url) && Utils.isWebUrl(data.order_item_list[1].desc_pic_url) && Utils.isWebUrl(data.order_item_list[2].desc_pic_url)) {
if (Utils.isWebUrl(data.order_item_list[0].desc_pic_url) && Utils.isWebUrl(data.order_item_list[1].desc_pic_url) && Utils.isWebUrl(data.order_item_list[2].desc_pic_url)) {
Glide.with(context).load(data.order_item_list[0].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image1))
Glide.with(context).load(data.order_item_list[1].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image2))
Glide.with(context).load(data.order_item_list[2].desc_pic_url).into(holder.itemView.findViewById(R.id.round_image3))
}*/
}
}
}
holder.itemView.findViewById<TextView>(R.id.tv_order_goods_count).text = "共${data.goods_num}件"
......
......@@ -82,7 +82,9 @@ data class OrderItem(
@SerializedName(value = "goods_sku_id")
val goods_sku_id: String,
@SerializedName(value = "price")
val price: Double
val price: Double,
@SerializedName(value = "desc_pic_url")
var desc_pic_url:String? = null
)
data class PlaceList(
......
......@@ -9,6 +9,9 @@ object Utils {
"top", "com.cn", "com", "net", "cn", "cc", "gov", "cn", "hk"
)
fun isWebUrl(url: String?): Boolean {
if (url == null) {
return false
}
val sb = StringBuilder()
sb.append("(")
for (anExt in come) {
......
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