Commit 2b757d40 authored by shiyl's avatar shiyl

修改订单列表已退款和部分退款冒号问题

parent 261292c0
package com.yidian.shenghuoquan.buserorder.app.adapter package com.yidian.shenghuoquan.buserorder.adapter
import android.graphics.Typeface import android.graphics.Typeface
import android.net.Uri import android.net.Uri
...@@ -7,7 +7,6 @@ import android.widget.LinearLayout ...@@ -7,7 +7,6 @@ import android.widget.LinearLayout
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
...@@ -19,7 +18,6 @@ import com.yidian.bcommon.utils.CPointUtils ...@@ -19,7 +18,6 @@ import com.yidian.bcommon.utils.CPointUtils
import com.yidian.shenghuoquan.buserorder.R import com.yidian.shenghuoquan.buserorder.R
import com.yidian.shenghuoquan.buserorder.app.bean.OrderWebData import com.yidian.shenghuoquan.buserorder.app.bean.OrderWebData
import com.yidian.shenghuoquan.buserorder.utils.Utils import com.yidian.shenghuoquan.buserorder.utils.Utils
import com.yidian.shenghuoquan.buserorder.view.RoundImageView
import com.yidian.xpage.XPageManager import com.yidian.xpage.XPageManager
import org.json.JSONObject import org.json.JSONObject
import timber.log.Timber import timber.log.Timber
...@@ -51,7 +49,9 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout ...@@ -51,7 +49,9 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image2).visibility = View.GONE holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image2).visibility = View.GONE
holder.itemView.findViewById<LinearLayout>(R.id.ll_order_image3).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(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image1)) Glide.with(context).load(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
roundRadus
))).into(holder.itemView.findViewById(R.id.round_image1))
} }
} }
2 -> { 2 -> {
...@@ -59,8 +59,12 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout ...@@ -59,8 +59,12 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder.itemView.findViewById<TextView>(R.id.tv_goog2_name).text = data.order_item_list[1].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 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(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image1)) Glide.with(context).load(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
Glide.with(context).load(Uri.parse( data.order_item_list[1].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image2)) roundRadus
))).into(holder.itemView.findViewById(R.id.round_image1))
Glide.with(context).load(Uri.parse( data.order_item_list[1].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
roundRadus
))).into(holder.itemView.findViewById(R.id.round_image2))
} }
} }
else -> { else -> {
...@@ -68,9 +72,15 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout ...@@ -68,9 +72,15 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
holder.itemView.findViewById<TextView>(R.id.tv_goog2_name).text = data.order_item_list[1].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 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(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image1)) Glide.with(context).load(Uri.parse(data.order_item_list[0].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
Glide.with(context).load(Uri.parse(data.order_item_list[1].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image2)) roundRadus
Glide.with(context).load(Uri.parse(data.order_item_list[2].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(roundRadus))).into(holder.itemView.findViewById(R.id.round_image3)) ))).into(holder.itemView.findViewById(R.id.round_image1))
Glide.with(context).load(Uri.parse(data.order_item_list[1].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
roundRadus
))).into(holder.itemView.findViewById(R.id.round_image2))
Glide.with(context).load(Uri.parse(data.order_item_list[2].desc_pic_url)).apply(RequestOptions.bitmapTransform(RoundedCorners(
roundRadus
))).into(holder.itemView.findViewById(R.id.round_image3))
} }
} }
} }
...@@ -100,58 +110,57 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout ...@@ -100,58 +110,57 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
private fun setOrderStatus(data: OrderWebData, holder: BaseViewHolder) { private fun setOrderStatus(data: OrderWebData, holder: BaseViewHolder) {
when(data.order_status) { when(data.order_status) {
1 -> { 1 -> {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "未支付:" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "未支付"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "未支付" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "未支付"
// holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.INVISIBLE val money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count)
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) money.typeface = Typeface.DEFAULT_BOLD
money.setTypeface(Typeface.DEFAULT_BOLD)
money.text = "${data.total_price}" money.text = "${data.total_price}"
} }
2 -> { 2 -> {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付:" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已支付" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已支付"
holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) val money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count)
money.setTypeface(Typeface.DEFAULT_BOLD) money.typeface = Typeface.DEFAULT_BOLD
money.text = "${data.total_price}" money.text = "${data.total_price}"
} }
3 -> { 3 -> {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付:" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "待退款" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "待退款"
holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) val money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count)
money.setTypeface(Typeface.DEFAULT_BOLD) money.typeface = Typeface.DEFAULT_BOLD
money.text = "${data.total_price}" money.text = "${data.total_price}"
} }
4,8 -> { 4,8 -> {
if (data.order_status == 4) { if (data.order_status == 4) {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已退款" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已退款"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已退款:" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已退款"
} else { } else {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "部分退款" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "部分退款"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "部分退款:" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "部分退款"
} }
holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) val money:TextView = holder.itemView.findViewById(R.id.tv_pay_money_count)
money.setTypeface(Typeface.DEFAULT_BOLD) money.typeface = Typeface.DEFAULT_BOLD
money.text = "${data.refund_amount}" money.text = "${data.refund_amount}"
} }
5 -> { 5 -> {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付:" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "退款中" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "退款中"
holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) val money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count)
money.setTypeface(Typeface.DEFAULT_BOLD) money.typeface = Typeface.DEFAULT_BOLD
money.text = "${data.total_price}" money.text = "${data.total_price}"
} }
6 -> { 6 -> {
holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付:" holder.itemView.findViewById<TextView>(R.id.tv_pay_money_status).text = "已支付"
holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已拒绝" holder.itemView.findViewById<TextView>(R.id.tv_pay_status).text = "已拒绝"
holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE holder.itemView.findViewById<TextView>(R.id.tv_order_list_yuan).visibility = View.VISIBLE
var money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count) val money:TextView = holder.itemView.findViewById<TextView>(R.id.tv_pay_money_count)
money.setTypeface(Typeface.DEFAULT_BOLD) money.typeface = Typeface.DEFAULT_BOLD
money.text = "${data.total_price}" money.text = "${data.total_price}"
} }
} }
...@@ -186,14 +195,14 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout ...@@ -186,14 +195,14 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
private fun getAllGoodsId(data: OrderWebData) : String { private fun getAllGoodsId(data: OrderWebData) : String {
var ids = "" var ids = ""
data.order_item_list!!.forEach { data.order_item_list.forEach {
ids = "$ids,${it.goods_sku_id}" ids = "$ids,${it.goods_sku_id}"
} }
return ids return ids
} }
private fun getAllGoodsName(data: OrderWebData) : String { private fun getAllGoodsName(data: OrderWebData) : String {
var name = "" var name = ""
data.order_item_list!!.forEach { data.order_item_list.forEach {
name = "$name,${it.goods_name}" name = "$name,${it.goods_name}"
} }
return name return name
......
...@@ -11,7 +11,7 @@ import com.yidian.bcommon.extensions.initTitleBar ...@@ -11,7 +11,7 @@ import com.yidian.bcommon.extensions.initTitleBar
import com.yidian.bcommon.mvvm.BaseMvvmActivity import com.yidian.bcommon.mvvm.BaseMvvmActivity
import com.yidian.news.ui.SystemBarUtils import com.yidian.news.ui.SystemBarUtils
import com.yidian.shenghuoquan.buserorder.R import com.yidian.shenghuoquan.buserorder.R
import com.yidian.shenghuoquan.buserorder.app.adapter.OrderListAdapter import com.yidian.shenghuoquan.buserorder.adapter.OrderListAdapter
import com.yidian.shenghuoquan.buserorder.utils.SpaceItemDecoration import com.yidian.shenghuoquan.buserorder.utils.SpaceItemDecoration
import com.yidian.shenghuoquan.buserorder.databinding.BorderActivityOrderListBinding import com.yidian.shenghuoquan.buserorder.databinding.BorderActivityOrderListBinding
import com.yidian.shenghuoquan.buserorder.viewmodel.OrderListViewModel import com.yidian.shenghuoquan.buserorder.viewmodel.OrderListViewModel
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/round_image1" android:id="@+id/round_image1"
android:layout_width="@dimen/dp82" android:layout_width="match_parent"
android:layout_height="@dimen/dp60" android:layout_height="@dimen/dp60"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/icon_default_order_pic" android:src="@drawable/icon_default_order_pic"
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_order_image2" android:id="@+id/ll_order_image2"
android:layout_width="70dp" android:layout_width="@dimen/dp82"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp8" android:layout_marginStart="@dimen/dp8"
android:layout_toRightOf="@+id/ll_order_image1" android:layout_toRightOf="@+id/ll_order_image1"
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
android:layout_height="@dimen/dp60" android:layout_height="@dimen/dp60"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/icon_default_order_pic" android:src="@drawable/icon_default_order_pic"
app:radius="@dimen/dp12" /> app:radius="@dimen/dp10" />
<TextView <TextView
android:id="@+id/tv_goog2_name" android:id="@+id/tv_goog2_name"
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_order_image3" android:id="@+id/ll_order_image3"
android:layout_width="@dimen/dp70" android:layout_width="@dimen/dp82"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp8" android:layout_marginLeft="@dimen/dp8"
android:layout_toRightOf="@+id/ll_order_image2" android:layout_toRightOf="@+id/ll_order_image2"
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
android:layout_height="60dp" android:layout_height="60dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@drawable/icon_default_order_pic" android:src="@drawable/icon_default_order_pic"
app:radius="@dimen/dp12" /> app:radius="@dimen/dp10" />
<TextView <TextView
android:id="@+id/tv_good3_name" android:id="@+id/tv_good3_name"
...@@ -166,7 +166,6 @@ ...@@ -166,7 +166,6 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:gravity="center" android:gravity="center"
android:text=""
android:textColor="#999999" android:textColor="#999999"
android:textSize="13sp" /> android:textSize="13sp" />
</RelativeLayout> </RelativeLayout>
......
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