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
a0a7f777
Commit
a0a7f777
authored
Aug 26, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 订单详情优惠券数据结构
parent
f5d2397d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
35 deletions
+45
-35
OrderDetailCommodityListAdapter.kt
...huoquan/border/adapter/OrderDetailCommodityListAdapter.kt
+4
-4
OrderDetailDto.kt
...java/com/yidian/shenghuoquan/border/dto/OrderDetailDto.kt
+33
-23
OrderCommodityInfoView.kt
...n/shenghuoquan/border/ui/widget/OrderCommodityInfoView.kt
+2
-2
border_item_order_detail_commodity_list.xml
...in/res/layout/border_item_order_detail_commodity_list.xml
+2
-2
border_view_order_commodity_info.xml
.../src/main/res/layout/border_view_order_commodity_info.xml
+3
-3
border_view_order_pickup_point_info.xml
...c/main/res/layout/border_view_order_pickup_point_info.xml
+1
-1
No files found.
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/adapter/OrderDetailCommodityListAdapter.kt
View file @
a0a7f777
...
...
@@ -8,7 +8,7 @@ import androidx.databinding.DataBindingUtil
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.shenghuoquan.border.R
import
com.yidian.shenghuoquan.border.databinding.BorderItemOrderDetailCommodityListBinding
import
com.yidian.shenghuoquan.border.dto.OrderItem
import
com.yidian.shenghuoquan.border.dto.
Merge
OrderItem
import
com.yidian.shenghuoquan.border.viewmodel.OrderDetailCommodityListItemViewModel
import
com.yidian.utils.DensityUtil
...
...
@@ -17,10 +17,10 @@ import com.yidian.utils.DensityUtil
* date: 2021/8/23 16:18
* description: 订单详情商品列表
*/
class
OrderDetailCommodityListAdapter
(
data
:
List
<
OrderItem
>?)
:
class
OrderDetailCommodityListAdapter
(
data
:
List
<
Merge
OrderItem
>?)
:
RecyclerView
.
Adapter
<
OrderDetailCommodityListAdapter
.
OrderDetailCommodityListViewHolder
>()
{
private
val
data
by
lazy
{
ArrayList
<
OrderItem
>()
}
private
val
data
by
lazy
{
ArrayList
<
Merge
OrderItem
>()
}
init
{
data
?.
let
{
...
...
@@ -31,7 +31,7 @@ class OrderDetailCommodityListAdapter(data: List<OrderItem>?) :
/**
* 更新数据
*/
fun
updateData
(
data
:
List
<
OrderItem
>?)
{
fun
updateData
(
data
:
List
<
Merge
OrderItem
>?)
{
data
?.
let
{
notifyItemRangeRemoved
(
0
,
this
.
data
.
size
)
this
.
data
.
clear
()
...
...
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/dto/OrderDetailDto.kt
View file @
a0a7f777
...
...
@@ -69,11 +69,11 @@ data class OrderDetailDto(
val
refundAmount
:
Double
,
@SerializedName
(
"refund_apply_time"
)
// 退款申请时间
val
refundApplyTime
:
String
,
@SerializedName
(
"refund_finish_time"
)
// 退款时间
@SerializedName
(
"refund_finish_time"
)
// 退款
完成
时间
val
refundFinishTime
:
String
,
@SerializedName
(
"shop_id"
)
val
shopId
:
String
,
@SerializedName
(
"total_price"
)
// 合计金额
@SerializedName
(
"total_price"
)
// 合计金额
= 优惠金额 + 支付金额
val
totalPrice
:
Double
,
@SerializedName
(
"update_time"
)
val
updateTime
:
String
,
...
...
@@ -86,28 +86,38 @@ data class OrderDetailDto(
)
data class
Coupon
(
@SerializedName
(
"amount"
)
val
amount
:
String
,
@SerializedName
(
"coupon_amount"
)
val
couponAmount
:
Double
,
val
couponAmount
:
Int
,
@SerializedName
(
"coupon_id"
)
val
couponId
:
String
,
@SerializedName
(
"create_time"
)
val
createTime
:
String
,
@SerializedName
(
"goods_sku_id"
)
val
goodsSkuId
:
String
,
@SerializedName
(
"order_id"
)
val
orderId
:
String
,
@SerializedName
(
"order_item_id"
)
val
orderItemId
:
String
,
@SerializedName
(
"recover_coupon_amount"
)
val
recoverCouponAmount
:
Double
,
@SerializedName
(
"share_coupon_amount"
)
val
shareCouponAmount
:
Double
,
@SerializedName
(
"share_coupon_id"
)
val
shareCouponId
:
Long
,
@SerializedName
(
"update_time"
)
val
updateTime
:
String
,
@SerializedName
(
"user_id"
)
val
userId
:
Long
@SerializedName
(
"desc"
)
// 优惠券描述
val
desc
:
String
,
@SerializedName
(
"end_time"
)
val
endTime
:
String
,
@SerializedName
(
"id"
)
val
id
:
String
,
@SerializedName
(
"jump_url"
)
val
jumpUrl
:
String
,
@SerializedName
(
"name"
)
// 优惠券名称
val
name
:
String
,
@SerializedName
(
"start_time"
)
val
startTime
:
String
,
@SerializedName
(
"status"
)
val
status
:
Int
,
@SerializedName
(
"thumbnail"
)
val
thumbnail
:
String
,
@SerializedName
(
"type"
)
val
type
:
Int
,
@SerializedName
(
"use_activity_type"
)
val
useActivityType
:
Int
,
@SerializedName
(
"use_amount_min"
)
val
useAmountMin
:
Int
,
@SerializedName
(
"use_amount_type"
)
val
useAmountType
:
Int
,
@SerializedName
(
"use_shop_type"
)
val
useShopType
:
Int
)
data class
MergeOrderItem
(
...
...
@@ -160,7 +170,7 @@ data class OrderItem(
val
orderItemId
:
String
,
@SerializedName
(
"payment"
)
val
payment
:
Double
,
@SerializedName
(
"price"
)
// 商品
价格
@SerializedName
(
"price"
)
// 商品
单价
val
price
:
Double
,
@SerializedName
(
"refund_amount"
)
val
refundAmount
:
Double
,
...
...
@@ -175,7 +185,7 @@ data class OrderItem(
@SerializedName
(
"settle_code"
)
val
settleCode
:
Long
,
@SerializedName
(
"share_coupon"
)
val
shareCoupon
:
Double
,
val
shareCoupon
:
Int
,
@SerializedName
(
"shop_id"
)
val
shopId
:
String
,
@SerializedName
(
"sub_shop_id"
)
...
...
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/ui/widget/OrderCommodityInfoView.kt
View file @
a0a7f777
...
...
@@ -66,7 +66,7 @@ class OrderCommodityInfoView @JvmOverloads constructor(context: Context, attrs:
vm
.
requestApplyRefund
(
it
)
}
},
null
,
R
.
color
.
color_FD7823
)
},
null
,
R
.
color
.
color_FD7823
)
.
show
()
})
// 监听申请退款接口请求结果
vm
.
applyRefundResult
.
observe
(
context
as
LifecycleOwner
,
{
...
...
@@ -98,6 +98,6 @@ class OrderCommodityInfoView @JvmOverloads constructor(context: Context, attrs:
binding
.
vm
=
vm
binding
.
status
=
status
binding
.
data
=
info
adapter
.
updateData
(
info
.
o
rderItemList
)
adapter
.
updateData
(
info
.
mergeO
rderItemList
)
}
}
Components/BOrder/src/main/res/layout/border_item_order_detail_commodity_list.xml
View file @
a0a7f777
...
...
@@ -11,7 +11,7 @@
<variable
name=
"data"
type=
"com.yidian.shenghuoquan.border.dto.OrderItem"
/>
type=
"com.yidian.shenghuoquan.border.dto.
Merge
OrderItem"
/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
...
...
@@ -22,7 +22,7 @@
android:id=
"@+id/iv_commodity_pic"
android:layout_width=
"@dimen/dp82"
android:layout_height=
"@dimen/dp60"
app:commodityImageUrl=
"@{data.descPicUrl.get(0)}"
app:commodityImageUrl=
'@{data.descPicUrl.size() > 0 ? data.descPicUrl.get(0) : ""}'
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:src=
"@drawable/img_order_commodity_placeholder"
/>
...
...
Components/BOrder/src/main/res/layout/border_view_order_commodity_info.xml
View file @
a0a7f777
...
...
@@ -113,7 +113,7 @@
android:layout_marginStart=
"@dimen/dp3"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
'@{data.couponList.size() > 0 ? data.couponList.get(0).
couponId
: @string/red_packet_or_coupon}'
android:text=
'@{data.couponList.size() > 0 ? data.couponList.get(0).
name
: @string/red_packet_or_coupon}'
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp14"
android:visibility=
"@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}"
...
...
@@ -127,7 +127,7 @@
android:id=
"@+id/tv_coupon_amount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'@{
data.couponList.size() > 0 ? "-¥" + String.valueOf(data.couponList.get(0).shareCouponAmount) : ""
}'
android:text=
'@{
"- ¥" + String.valueOf(data.discountFee)
}'
android:textColor=
"@color/color_FB4653"
android:textSize=
"@dimen/sp14"
android:visibility=
"@{data.couponList.size() > 0 ? View.VISIBLE : View.GONE}"
...
...
@@ -185,7 +185,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp24"
android:text=
'@{
"¥" + String.valueOf(data.totalPrice
)}'
android:text=
'@{
String.format("¥%.2f", data.payment
)}'
android:textColor=
"@color/black"
android:textSize=
"@dimen/sp18"
android:textStyle=
"bold"
...
...
Components/BOrder/src/main/res/layout/border_view_order_pickup_point_info.xml
View file @
a0a7f777
...
...
@@ -67,7 +67,7 @@
android:layout_marginTop=
"@dimen/dp8"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@{data.
address
}"
android:text=
"@{data.
location
}"
android:textColor=
"@color/color_999999"
android:textSize=
"@dimen/sp14"
android:visibility=
"@{data != null ? View.VISIBLE : View.GONE}"
...
...
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