Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
X
xxsq
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
xxsq
Commits
420711c4
Commit
420711c4
authored
Dec 28, 2022
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改话费券bug
parent
c6d250a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
26 deletions
+43
-26
RechargeActivity.kt
...ain/java/com/zxbw/modulemain/activity/RechargeActivity.kt
+43
-26
No files found.
moduleMain/src/main/java/com/zxbw/modulemain/activity/RechargeActivity.kt
View file @
420711c4
...
@@ -531,53 +531,70 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -531,53 +531,70 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mAdapter
?.
notifyDataSetChanged
()
mAdapter
?.
notifyDataSetChanged
()
if
(!
result
.
goodsList
.
isNullOrEmpty
())
{
if
(!
result
.
goodsList
.
isNullOrEmpty
())
{
if
(
result
.
goodsList
!!
.
size
>=
0
)
{
if
(
result
.
goodsList
!!
.
size
>=
0
)
{
useCoupn
(
0
,
0
)
useCoupn
(
0
,
0
,
0
)
}
}
}
}
}
}
fun
useCoupn
(
default
:
Int
,
price
:
Int
)
{
fun
useCoupn
(
position
:
Int
,
default
:
Int
,
price
:
Int
)
{
if
(!
mCouponsResult
.
isNullOrEmpty
())
{
if
(!
mCouponsResult
.
isNullOrEmpty
())
{
for
(
i
in
mCouponsResult
!!
)
{
for
(
i
in
mCouponsResult
!!
)
{
if
(
price
==
200
)
{
if
(
price
==
200
)
{
if
(
TextUtils
.
equals
(
i
.
amount
,
"10.0"
))
{
if
(
TextUtils
.
equals
(
i
.
amount
,
"10.0"
))
{
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
Log
.
e
(
"MXL"
,
"优先使用10元优惠券"
)
Log
.
e
(
"MXL"
,
"优先使用10元优惠券"
)
if
(
position
==
2
||
position
==
0
)
{
couponsentity
=
i
couponsentity
=
i
setCouponInfo
(
couponsentity
)
setCouponInfo
(
couponsentity
)
}
else
{
couponsentity
=
null
setCouponInfo
(
null
)
}
break
break
}
else
{
couponsentity
=
null
setCouponInfo
(
null
)
}
}
}
else
{
}
else
{
if
(
TextUtils
.
equals
(
i
.
amount
,
"5.0"
))
{
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
Log
.
e
(
"MXL"
,
"使用5元优惠券"
)
if
(
default
==
0
)
{
if
(
default
==
0
)
{
mAdapter
?.
setPosition
(
1
)
mAdapter
?.
setPosition
(
1
)
selectPrice
=
mAdapter
?.
getItem
(
1
)
?.
originalPrice
selectPrice
=
mAdapter
?.
getItem
(
1
)
?.
originalPrice
goodsID
=
mAdapter
?.
getItem
(
1
)
?.
goodsId
goodsID
=
mAdapter
?.
getItem
(
1
)
?.
goodsId
memberentity
=
mAdapter
?.
getItem
(
1
)
memberentity
=
mAdapter
?.
getItem
(
1
)
}
}
if
(
TextUtils
.
equals
(
i
.
amount
,
"5.0"
))
{
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
Log
.
e
(
"MXL"
,
"使用5元优惠券"
)
if
(
position
==
1
||
position
==
0
)
{
couponsentity
=
i
couponsentity
=
i
setCouponInfo
(
couponsentity
)
setCouponInfo
(
couponsentity
)
break
}
else
{
}
couponsentity
=
null
setCouponInfo
(
null
)
}
}
break
}
else
{
couponsentity
=
null
setCouponInfo
(
null
)
break
}
}
Log
.
e
(
"MXL"
,
"循环结束取到优惠券信息"
)
if
(
couponsentity
==
null
)
{
Log
.
e
(
"MXL"
,
"没有5元的 使用10元券"
)
if
(
default
==
0
)
{
mAdapter
?.
setPosition
(
2
)
selectPrice
=
mAdapter
?.
getItem
(
2
)
?.
originalPrice
goodsID
=
mAdapter
?.
getItem
(
2
)
?.
goodsId
memberentity
=
mAdapter
?.
getItem
(
2
)
}
}
couponsentity
=
mCouponsResult
!!
.
get
(
0
)
setCouponInfo
(
couponsentity
)
}
}
// Log.e("MXL", "循环结束取到优惠券信息" + couponsentity?.amount)
// if (couponsentity == null) {
// Log.e("MXL", "没有5元的 使用10元券")
// if (default == 0 || default == 1) {
// mAdapter?.setPosition(2)
// selectPrice = mAdapter?.getItem(2)?.originalPrice
// goodsID = mAdapter?.getItem(2)?.goodsId
// memberentity = mAdapter?.getItem(2)
// }
// couponsentity = mCouponsResult!!.get(0)
//
// setCouponInfo(couponsentity)
// }
Log
.
e
(
"MXL"
,
"price:"
+
price
+
"default:"
+
default
)
Log
.
e
(
"MXL"
,
"price:"
+
price
+
"default:"
+
default
)
// mAdapter?.updateData( couponsentity?.amount.toString())
// mAdapter?.updateData( couponsentity?.amount.toString())
...
@@ -620,13 +637,13 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -620,13 +637,13 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}
}
1
->
{
1
->
{
Log
.
e
(
"MXL"
,
"选1"
)
Log
.
e
(
"MXL"
,
"选1"
)
useCoupn
(
1
,
100
)
useCoupn
(
position
,
1
,
100
)
setBootomPrice
(
data
)
setBootomPrice
(
data
)
return
return
}
}
2
->
{
2
->
{
Log
.
e
(
"MXL"
,
"选2"
)
Log
.
e
(
"MXL"
,
"选2"
)
useCoupn
(
1
,
200
)
useCoupn
(
position
,
1
,
200
)
setBootomPrice
(
data
)
setBootomPrice
(
data
)
return
return
}
}
...
...
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