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
af834644
Commit
af834644
authored
Aug 31, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选择代金券逻辑优化
parent
bc03a3cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
OrderConfirmDto.kt
...ava/com/yidian/shenghuoquan/border/dto/OrderConfirmDto.kt
+0
-2
ConfirmOrderViewModel.kt
...an/shenghuoquan/border/viewmodel/ConfirmOrderViewModel.kt
+2
-2
border_activity_confirm_order.xml
...der/src/main/res/layout/border_activity_confirm_order.xml
+1
-1
No files found.
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/border/dto/OrderConfirmDto.kt
View file @
af834644
...
...
@@ -45,8 +45,6 @@ data class CouponDto(
val
endTime
:
String
?
=
null
,
// 有效期结束时间
@SerializedName
(
"status"
)
val
status
:
Int
?
=
null
,
// 优惠券状态
@SerializedName
(
"selected"
)
var
selected
:
Boolean
?
=
false
,
// 优惠券是否被选中
)
:
Parcelable
/**
...
...
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/border/viewmodel/ConfirmOrderViewModel.kt
View file @
af834644
...
...
@@ -126,6 +126,8 @@ class ConfirmOrderViewModel : BaseViewModel() {
* 选择代金券, 如果有上次选中的带过去最新的列表
*/
fun
chooseVoucher
()
{
//选择之前先将上次的金额清零
couponAmount
=
0.00
_chooseCouponEvent
.
value
=
couponsAvailableList
.
value
}
...
...
@@ -137,11 +139,9 @@ class ConfirmOrderViewModel : BaseViewModel() {
val
list
=
mutableListOf
<
CouponDto
>()
indexList
.
forEach
{
val
coupon
=
couponsAvailableList
.
value
?.
get
(
it
)
//将该优惠券更新为选中状态
coupon
?.
let
{
couponDto
->
// 累加优惠券金额
couponAmount
+=
couponDto
.
amount
?.
toDouble
()
?:
0.00
couponDto
.
selected
=
true
list
.
add
(
couponDto
)
}
}
...
...
Components/BUserOrder/src/main/res/layout/border_activity_confirm_order.xml
View file @
af834644
...
...
@@ -296,7 +296,7 @@
android:paddingTop=
"@dimen/dp2"
android:paddingEnd=
"@dimen/dp5"
android:paddingBottom=
"@dimen/dp2"
android:text=
"@{@string/amount(vm.couponAmountValue)}"
android:text=
'@{"- " + @string/amount(vm.couponAmountValue)}'
android:textColor=
"@color/color_FD7823"
android:textSize=
"11sp"
app:isShow=
"@{vm.selectedCouponList.size() > 0}"
...
...
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