Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
2b757d40
Commit
2b757d40
authored
Sep 13, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单列表已退款和部分退款冒号问题
parent
261292c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
40 deletions
+48
-40
OrderListAdapter.kt
...idian/shenghuoquan/buserorder/adapter/OrderListAdapter.kt
+42
-33
OrderListActivity.kt
...om/yidian/shenghuoquan/buserorder/ui/OrderListActivity.kt
+1
-1
border_recycle_order_item.xml
...erOrder/src/main/res/layout/border_recycle_order_item.xml
+5
-6
No files found.
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/adapter/OrderListAdapter.kt
View file @
2b757d40
package
com.yidian.shenghuoquan.buserorder.a
pp.a
dapter
package
com.yidian.shenghuoquan.buserorder.adapter
import
android.graphics.Typeface
import
android.net.Uri
...
...
@@ -7,7 +7,6 @@ import android.widget.LinearLayout
import
android.widget.RelativeLayout
import
android.widget.TextView
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.request.RequestOptions
import
com.chad.library.adapter.base.BaseQuickAdapter
...
...
@@ -19,7 +18,6 @@ import com.yidian.bcommon.utils.CPointUtils
import
com.yidian.shenghuoquan.buserorder.R
import
com.yidian.shenghuoquan.buserorder.app.bean.OrderWebData
import
com.yidian.shenghuoquan.buserorder.utils.Utils
import
com.yidian.shenghuoquan.buserorder.view.RoundImageView
import
com.yidian.xpage.XPageManager
import
org.json.JSONObject
import
timber.log.Timber
...
...
@@ -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_image3
).
visibility
=
View
.
GONE
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
->
{
...
...
@@ -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
<
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
))
{
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
[
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
[
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
[
1
].
desc_pic_url
)).
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
roundRadus
))).
into
(
holder
.
itemView
.
findViewById
(
R
.
id
.
round_image2
))
}
}
else
->
{
...
...
@@ -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_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
))
{
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
[
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
))
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
[
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
private
fun
setOrderStatus
(
data
:
OrderWebData
,
holder
:
BaseViewHolder
)
{
when
(
data
.
order_status
)
{
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_order_list_yuan).visibility = View.INVISIBLE
var
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
val
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.total_price}"
}
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_order_list_yuan
).
visibility
=
View
.
VISIBLE
va
r
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
va
l
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.total_price}"
}
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_order_list_yuan
).
visibility
=
View
.
VISIBLE
va
r
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
va
l
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.total_price}"
}
4
,
8
->
{
if
(
data
.
order_status
==
4
)
{
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_money_status
).
text
=
"已退款
:
"
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_status
).
text
=
"已退款"
}
else
{
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_money_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
va
r
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>
(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
va
l
money
:
TextView
=
holder
.
itemView
.
findViewById
(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.refund_amount}"
}
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_order_list_yuan
).
visibility
=
View
.
VISIBLE
va
r
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
va
l
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.total_price}"
}
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_order_list_yuan
).
visibility
=
View
.
VISIBLE
va
r
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
va
l
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
typeface
=
Typeface
.
DEFAULT_BOLD
money
.
text
=
"${data.total_price}"
}
}
...
...
@@ -186,14 +195,14 @@ class OrderListAdapter : BaseQuickAdapter<OrderWebData, BaseViewHolder>(R.layout
private
fun
getAllGoodsId
(
data
:
OrderWebData
)
:
String
{
var
ids
=
""
data
.
order_item_list
!!
.
forEach
{
data
.
order_item_list
.
forEach
{
ids
=
"$ids,${it.goods_sku_id}"
}
return
ids
}
private
fun
getAllGoodsName
(
data
:
OrderWebData
)
:
String
{
var
name
=
""
data
.
order_item_list
!!
.
forEach
{
data
.
order_item_list
.
forEach
{
name
=
"$name,${it.goods_name}"
}
return
name
...
...
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/ui/OrderListActivity.kt
View file @
2b757d40
...
...
@@ -11,7 +11,7 @@ import com.yidian.bcommon.extensions.initTitleBar
import
com.yidian.bcommon.mvvm.BaseMvvmActivity
import
com.yidian.news.ui.SystemBarUtils
import
com.yidian.shenghuoquan.buserorder.R
import
com.yidian.shenghuoquan.buserorder.a
pp.a
dapter.OrderListAdapter
import
com.yidian.shenghuoquan.buserorder.adapter.OrderListAdapter
import
com.yidian.shenghuoquan.buserorder.utils.SpaceItemDecoration
import
com.yidian.shenghuoquan.buserorder.databinding.BorderActivityOrderListBinding
import
com.yidian.shenghuoquan.buserorder.viewmodel.OrderListViewModel
...
...
Components/BUserOrder/src/main/res/layout/border_recycle_order_item.xml
View file @
2b757d40
...
...
@@ -82,7 +82,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/round_image1"
android:layout_width=
"
@dimen/dp82
"
android:layout_width=
"
match_parent
"
android:layout_height=
"@dimen/dp60"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
...
...
@@ -103,7 +103,7 @@
<LinearLayout
android:id=
"@+id/ll_order_image2"
android:layout_width=
"
70dp
"
android:layout_width=
"
@dimen/dp82
"
android:layout_height=
"match_parent"
android:layout_marginStart=
"@dimen/dp8"
android:layout_toRightOf=
"@+id/ll_order_image1"
...
...
@@ -115,7 +115,7 @@
android:layout_height=
"@dimen/dp60"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
app:radius=
"@dimen/dp1
2
"
/>
app:radius=
"@dimen/dp1
0
"
/>
<TextView
android:id=
"@+id/tv_goog2_name"
...
...
@@ -132,7 +132,7 @@
<LinearLayout
android:id=
"@+id/ll_order_image3"
android:layout_width=
"@dimen/dp
70
"
android:layout_width=
"@dimen/dp
82
"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp8"
android:layout_toRightOf=
"@+id/ll_order_image2"
...
...
@@ -144,7 +144,7 @@
android:layout_height=
"60dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/icon_default_order_pic"
app:radius=
"@dimen/dp1
2
"
/>
app:radius=
"@dimen/dp1
0
"
/>
<TextView
android:id=
"@+id/tv_good3_name"
...
...
@@ -166,7 +166,6 @@
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:gravity=
"center"
android:text=
""
android:textColor=
"#999999"
android:textSize=
"13sp"
/>
</RelativeLayout>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment