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
eba5811b
Commit
eba5811b
authored
Jun 10, 2022
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
cd95bbcc
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
189 additions
and
38 deletions
+189
-38
NetConfig.java
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
+1
-1
SettingPreference.java
cms/src/main/java/com/zxhl/cms/net/SettingPreference.java
+11
-0
IHomeApi.kt
cms/src/main/java/com/zxhl/cms/net/api/IHomeApi.kt
+1
-1
colors.xml
cms/src/main/res/values/colors.xml
+1
-0
RechargeActivity.kt
...ain/java/com/zxbw/modulemain/activity/RechargeActivity.kt
+130
-13
RechargeAdapter.kt
.../main/java/com/zxbw/modulemain/adapter/RechargeAdapter.kt
+30
-14
RechargeContract.kt
...ain/java/com/zxbw/modulemain/contract/RechargeContract.kt
+1
-1
UserCenterFragment.kt
...n/java/com/zxbw/modulemain/fragment/UserCenterFragment.kt
+2
-1
RechargePresenter.kt
...n/java/com/zxbw/modulemain/presenter/RechargePresenter.kt
+2
-2
DialogUtils.kt
...ain/src/main/java/com/zxbw/modulemain/view/DialogUtils.kt
+1
-1
activity_layout_recharge.xml
moduleMain/src/main/res/layout/activity_layout_recharge.xml
+9
-4
No files found.
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
View file @
eba5811b
...
@@ -21,7 +21,7 @@ public class NetConfig {
...
@@ -21,7 +21,7 @@ public class NetConfig {
}
}
// 根据调试选项更新环境
// 根据调试选项更新环境
public
static
Environment
sEnvironment
=
DEV
;
// 当前环境
public
static
Environment
sEnvironment
=
PRODUCT
;
// 当前环境
public
static
String
BASE_WEB_URL
=
""
;
public
static
String
BASE_WEB_URL
=
""
;
public
static
String
BASE_URL
=
""
;
public
static
String
BASE_URL
=
""
;
public
static
String
BASE_NEW_URL
=
""
;
public
static
String
BASE_NEW_URL
=
""
;
...
...
cms/src/main/java/com/zxhl/cms/net/SettingPreference.java
View file @
eba5811b
...
@@ -1741,5 +1741,16 @@ public class SettingPreference {
...
@@ -1741,5 +1741,16 @@ public class SettingPreference {
editor
.
putInt
(
"PAY_TIPS_DIALOG"
,
num
);
editor
.
putInt
(
"PAY_TIPS_DIALOG"
,
num
);
editor
.
commit
();
editor
.
commit
();
}
}
public
static
String
getShowUseDiscount
()
{
SharedPreferences
settings
=
AppContext
.
get
().
getSharedPreferences
(
USER_SETTING
,
0
);
return
settings
.
getString
(
"SHOW_USE_DISCOUNT_DIALOG"
,
"0"
);
}
public
static
void
setShowUseDiscount
(
String
isshow
)
{
SharedPreferences
settings
=
AppContext
.
get
().
getSharedPreferences
(
USER_SETTING
,
0
);
SharedPreferences
.
Editor
editor
=
settings
.
edit
();
editor
.
putString
(
"SHOW_USE_DISCOUNT_DIALOG"
,
isshow
);
editor
.
commit
();
}
}
}
cms/src/main/java/com/zxhl/cms/net/api/IHomeApi.kt
View file @
eba5811b
...
@@ -398,5 +398,5 @@ interface IHomeApi {
...
@@ -398,5 +398,5 @@ interface IHomeApi {
//获取用户话费券列表
//获取用户话费券列表
@GET
(
NetConfig
.
QY
.
XX_GOODS_FETCHALL_CARD
)
@GET
(
NetConfig
.
QY
.
XX_GOODS_FETCHALL_CARD
)
fun
getFetchallCard
(
@Query
(
"phone"
)
phone
:
String
?
):
Observable
<
Response
<
List
<
CouponsEntity
>>>
fun
getFetchallCard
():
Observable
<
Response
<
List
<
CouponsEntity
>>>
}
}
\ No newline at end of file
cms/src/main/res/values/colors.xml
View file @
eba5811b
...
@@ -37,5 +37,6 @@
...
@@ -37,5 +37,6 @@
<color
name=
"color_b28a17"
>
#B28A17
</color>
<color
name=
"color_b28a17"
>
#B28A17
</color>
<color
name=
"color_ddcb97"
>
#DDCB97
</color>
<color
name=
"color_ddcb97"
>
#DDCB97
</color>
<color
name=
"color_ba7e36"
>
#BA7E36
</color>
<color
name=
"color_ba7e36"
>
#BA7E36
</color>
<color
name=
"color_f8e8cc"
>
#F8E8CC
</color>
</resources>
</resources>
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/activity/RechargeActivity.kt
View file @
eba5811b
...
@@ -3,10 +3,12 @@ package com.zxbw.modulemain.activity
...
@@ -3,10 +3,12 @@ package com.zxbw.modulemain.activity
import
android.app.Dialog
import
android.app.Dialog
import
android.graphics.Paint
import
android.graphics.Paint
import
android.os.Handler
import
android.os.Handler
import
android.text.TextUtils
import
android.util.Log
import
android.util.Log
import
android.view.View
import
android.view.View
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.GridLayoutManager
import
com.zxbw.modulemain.R
import
com.zxbw.modulemain.R
import
com.zxbw.modulemain.adapter.OperatorAdapter
import
com.zxbw.modulemain.adapter.RechargeAdapter
import
com.zxbw.modulemain.adapter.RechargeAdapter
import
com.zxbw.modulemain.contract.RechargeContract
import
com.zxbw.modulemain.contract.RechargeContract
import
com.zxbw.modulemain.presenter.RechargePresenter
import
com.zxbw.modulemain.presenter.RechargePresenter
...
@@ -16,7 +18,10 @@ import com.zxhl.cms.common.Constant
...
@@ -16,7 +18,10 @@ import com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.box.MobileOpEntity
import
com.zxhl.cms.net.model.qy.CouponsEntity
import
com.zxhl.cms.net.model.qy.CouponsEntity
import
com.zxhl.cms.net.model.qy.RightsDetailEntity
import
com.zxhl.cms.net.model.qy.SkillGoodsEntity
import
com.zxhl.cms.net.model.uc.AliPayEntity
import
com.zxhl.cms.net.model.uc.AliPayEntity
import
com.zxhl.cms.net.model.uc.PayResultEntity
import
com.zxhl.cms.net.model.uc.PayResultEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.net.model.video.MemberEntity
...
@@ -36,20 +41,24 @@ import kotlinx.android.synthetic.main.activity_layout_recharge.id_rl_h5_pay_view
...
@@ -36,20 +41,24 @@ import kotlinx.android.synthetic.main.activity_layout_recharge.id_rl_h5_pay_view
class
RechargeActivity
:
BaseActivity
(),
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>,
class
RechargeActivity
:
BaseActivity
(),
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>,
RechargeContract
.
View
{
RechargeContract
.
View
{
private
var
mAdapter
:
RechargeAdapter
?
=
null
private
var
mAdapter
:
RechargeAdapter
?
=
null
private
var
mOperatorAdapter
:
OperatorAdapter
?=
null
private
var
mPresenter
:
RechargePresenter
?
=
null
private
var
mPresenter
:
RechargePresenter
?
=
null
private
var
couponsentity
:
CouponsEntity
?
=
null
private
var
couponsentity
:
CouponsEntity
?
=
null
private
var
mLoading
:
LoadingDialog
?
=
null
private
var
mLoading
:
LoadingDialog
?
=
null
private
var
pay_type
:
Int
?
=
RightsDetailActivity
.
H5_PAY
private
var
pay_type
:
Int
?
=
RightsDetailActivity
.
H5_PAY
private
var
payResultObservable
:
Observable
<
PayResultEntity
>?
=
null
private
var
payResultObservable
:
Observable
<
PayResultEntity
>?
=
null
private
var
mobileOp
:
String
?=
""
private
var
selectPrice
:
String
?=
""
var
goodsID
:
String
?
=
""
var
goodsID
:
String
?
=
""
var
couponId
:
String
?
=
""
var
couponId
:
String
?
=
""
private
var
position
:
Int
?=-
1
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
)
{
when
(
v
)
{
id_tv_select_coupons
->
{
id_tv_select_coupons
->
{
//如果有默认选中,传入默认选中的优惠券
//如果有默认选中,传入默认选中的优惠券
DialogUtils
.
showFetchAllCard
(
DialogUtils
.
showFetchAllCard
(
this
,
this
,
"100"
,
selectPrice
.
toString
()
,
null
,
null
,
mCouponsResult
,
mCouponsResult
,
object
:
DialogUtils
.
OnFetchCardListener
{
object
:
DialogUtils
.
OnFetchCardListener
{
...
@@ -73,13 +82,30 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -73,13 +82,30 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}
}
override
fun
init
()
{
override
fun
init
()
{
id_img_back
?.
setOnClickListener
{
finish
()
}
val
user
=
SettingPreference
.
getUserInfoData
()
val
user
=
SettingPreference
.
getUserInfoData
()
initPay
()
initPay
()
mOperatorAdapter
=
OperatorAdapter
(
this
,
OnRecycleItemClickListener
<
MobileOpEntity
>
{
view
,
position
,
data
->
mobileOp
=
data
.
value
})
id_rl_yunyingshang
?.
layoutManager
=
GridLayoutManager
(
this
,
3
)
id_rl_yunyingshang
?.
adapter
=
mOperatorAdapter
var
result
=
SettingPreference
.
getConfig
()
if
(!
result
?.
mobileOpList
.
isNullOrEmpty
()){
mOperatorAdapter
?.
clear
()
mOperatorAdapter
?.
appendToList
(
result
?.
mobileOpList
)
mOperatorAdapter
?.
notifyDataSetChanged
()
}
mPresenter
=
RechargePresenter
(
this
)
mPresenter
=
RechargePresenter
(
this
)
mAdapter
=
RechargeAdapter
(
this
,
this
)
mAdapter
=
RechargeAdapter
(
this
,
this
)
id_rl_recharge
?.
layoutManager
=
GridLayoutManager
(
this
,
3
)
id_rl_recharge
?.
layoutManager
=
GridLayoutManager
(
this
,
3
)
id_rl_recharge
?.
adapter
=
mAdapter
id_rl_recharge
?.
adapter
=
mAdapter
mPresenter
?.
getFetchCard
(
user
.
nickname
)
mPresenter
?.
getFetchCard
()
mPresenter
?.
getPayList
(
"mobileFee"
)
mPresenter
?.
getPayList
(
"mobileFee"
)
id_edit_user_phone
?.
setText
(
user
.
nickname
.
toString
())
id_edit_user_phone
?.
setText
(
user
.
nickname
.
toString
())
id_tv_select_coupons
?.
setOnClickListener
(
this
)
id_tv_select_coupons
?.
setOnClickListener
(
this
)
...
@@ -169,6 +195,10 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -169,6 +195,10 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
showToast
(
"请检查要兑换的手机号"
)
showToast
(
"请检查要兑换的手机号"
)
return
return
}
}
if
(
TextUtils
.
isEmpty
(
mobileOp
)){
showToast
(
"请选择运营商"
)
return
}
isClickPayBtn
=
true
isClickPayBtn
=
true
mLoading
?.
setLoading
(
"请稍后..."
)
mLoading
?.
setLoading
(
"请稍后..."
)
mLoading
?.
show
()
mLoading
?.
show
()
...
@@ -180,17 +210,17 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -180,17 +210,17 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
false
,
false
,
""
,
""
,
couponsentity
?.
id
,
couponsentity
?.
id
,
"SHKC_CT"
mobileOp
)
)
}
}
private
var
mCouponsResult
:
List
<
CouponsEntity
>?
=
null
;
private
var
mCouponsResult
:
List
<
CouponsEntity
>?
=
null
override
fun
setCouponsList
(
result
:
List
<
CouponsEntity
>?)
{
override
fun
setCouponsList
(
result
:
List
<
CouponsEntity
>?)
{
mCouponsResult
=
result
mCouponsResult
=
result
if
(!
result
.
isNullOrEmpty
())
{
//
if (!result.isNullOrEmpty()) {
couponsentity
=
result
.
get
(
0
)
//
couponsentity = result.get(0)
setCouponInfo
(
couponsentity
)
//
setCouponInfo(couponsentity)
}
//
}
}
}
override
fun
requestOrderSuc
(
result
:
AliPayEntity
)
{
override
fun
requestOrderSuc
(
result
:
AliPayEntity
)
{
...
@@ -265,20 +295,105 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -265,20 +295,105 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mAdapter
?.
notifyDataSetChanged
()
mAdapter
?.
notifyDataSetChanged
()
if
(!
result
.
goodsList
.
isNullOrEmpty
())
{
if
(!
result
.
goodsList
.
isNullOrEmpty
())
{
if
(
result
.
goodsList
!!
.
size
>=
3
)
{
if
(
result
.
goodsList
!!
.
size
>=
3
)
{
useCoupn
(
0
,
0
)
}
}
}
fun
useCoupn
(
default
:
Int
,
price
:
Int
){
if
(!
mCouponsResult
.
isNullOrEmpty
()){
for
(
i
in
mCouponsResult
!!
){
if
(
price
==
200
){
if
(
TextUtils
.
equals
(
i
.
amount
,
"10.0"
)){
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
Log
.
e
(
"MXL"
,
"优先使用10元优惠券"
)
couponsentity
=
i
setCouponInfo
(
couponsentity
)
break
}
}
else
{
if
(
TextUtils
.
equals
(
i
.
amount
,
"5.0"
)){
//判断当有5元券时 帮他选择100元档位且使用当前5元的券
Log
.
e
(
"MXL"
,
"使用5元优惠券"
)
if
(
default
==
0
){
mAdapter
?.
setPosition
(
1
)
selectPrice
=
mAdapter
?.
getItem
(
1
)
?.
originalPrice
goodsID
=
mAdapter
?.
getItem
(
1
)
?.
goodsId
memberentity
=
mAdapter
?.
getItem
(
1
)
}
couponsentity
=
i
setCouponInfo
(
couponsentity
)
break
}
}
}
Log
.
e
(
"MXL"
,
"循环结束取到优惠券信息"
)
if
(
couponsentity
==
null
){
Log
.
e
(
"MXL"
,
"没有5元的 使用10元券"
)
if
(
default
==
0
){
mAdapter
?.
setPosition
(
2
)
mAdapter
?.
setPosition
(
2
)
goodsID
=
result
.
goodsList
?.
get
(
2
)
?.
goodsId
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
)
// mAdapter?.updateData( couponsentity?.amount.toString())
if
(
SettingPreference
.
getShowUseDiscount
().
equals
(
"0"
)){
DialogUtils
.
showHuafeiTips
(
this
)
}
}
else
{
Log
.
e
(
"MXL"
,
"当前无可用优惠券"
)
mAdapter
?.
updateData
(
""
)
if
(
default
==
0
){
memberentity
=
mAdapter
?.
getItem
(
1
)
mAdapter
?.
setPosition
(
1
)
selectPrice
=
mAdapter
?.
getItem
(
1
)
?.
originalPrice
goodsID
=
mAdapter
?.
getItem
(
1
)
?.
goodsId
}
couponsentity
=
null
setCouponInfo
(
couponsentity
)
}
}
}
var
memberentity
:
MemberEntity
.
ProductDetail
?
=
null
var
memberentity
:
MemberEntity
.
ProductDetail
?
=
null
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
,
data
:
MemberEntity
.
ProductDetail
?)
{
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
,
data
:
MemberEntity
.
ProductDetail
?)
{
memberentity
=
data
memberentity
=
data
selectPrice
=
data
?.
originalPrice
goodsID
=
data
?.
goodsId
goodsID
=
data
?.
goodsId
chosseData
(
position
,
data
)
}
fun
chosseData
(
position
:
Int
,
data
:
MemberEntity
.
ProductDetail
?){
when
(
position
)
{
0
->{
Log
.
e
(
"MXL"
,
"选0"
)
couponsentity
=
null
setCouponInfo
(
couponsentity
)
setBootomPrice
(
data
)
setBootomPrice
(
data
)
return
}
1
->{
Log
.
e
(
"MXL"
,
"选1"
)
useCoupn
(
1
,
100
)
setBootomPrice
(
data
)
return
}
2
->{
Log
.
e
(
"MXL"
,
"选2"
)
useCoupn
(
1
,
200
)
setBootomPrice
(
data
)
return
}
}
}
}
fun
setBootomPrice
(
data
:
MemberEntity
.
ProductDetail
?)
{
fun
setBootomPrice
(
data
:
MemberEntity
.
ProductDetail
?)
{
if
(
couponsentity
==
null
)
{
if
(
couponsentity
==
null
)
{
id_tv_cash
?.
text
=
"${data?.cash}"
id_tv_cash
?.
text
=
"${data?.cash}"
...
@@ -296,10 +411,12 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -296,10 +411,12 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
setBootomPrice
(
memberentity
)
setBootomPrice
(
memberentity
)
if
(
entity
!=
null
)
{
if
(
entity
!=
null
)
{
Log
.
e
(
"MXL"
,
"选择这个优惠券"
)
Log
.
e
(
"MXL"
,
"选择这个优惠券"
)
mAdapter
?.
updateData
(
entity
?.
amount
.
toString
())
id_tv_select_coupons
?.
text
=
"您已选择${entity?.amount}元优惠券"
id_tv_select_coupons
?.
text
=
"您已选择${entity?.amount}元优惠券"
}
else
{
}
else
{
Log
.
e
(
"MXL"
,
"无优惠券可选"
)
Log
.
e
(
"MXL"
,
"无优惠券可选"
)
id_tv_select_coupons
?.
text
=
"未选择优惠券"
mAdapter
?.
updateData
(
""
)
id_tv_select_coupons
?.
text
=
"无可用优惠券"
}
}
}
}
...
...
moduleMain/src/main/java/com/zxbw/modulemain/adapter/RechargeAdapter.kt
View file @
eba5811b
...
@@ -3,6 +3,8 @@ package com.zxbw.modulemain.adapter
...
@@ -3,6 +3,8 @@ package com.zxbw.modulemain.adapter
import
android.app.Activity
import
android.app.Activity
import
android.graphics.Color
import
android.graphics.Color
import
android.graphics.Paint
import
android.graphics.Paint
import
android.text.TextUtils
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
...
@@ -15,12 +17,14 @@ import com.zxhl.cms.common.base.BaseRecyclerAdapter
...
@@ -15,12 +17,14 @@ import com.zxhl.cms.common.base.BaseRecyclerAdapter
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.utils.OnRecycleItemClickListener
import
com.zxhl.cms.utils.OnRecycleItemClickListener
class
RechargeAdapter
:
BaseRecyclerAdapter
<
MemberEntity
.
ProductDetail
,
RechargeAdapter
.
ViewHolder
>
{
class
RechargeAdapter
:
BaseRecyclerAdapter
<
MemberEntity
.
ProductDetail
,
RechargeAdapter
.
ViewHolder
>
{
private
var
mContext
:
Activity
?
=
null
private
var
mContext
:
Activity
?
=
null
private
val
listener
:
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>
private
val
listener
:
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>
private
val
mSelectColor
:
Int
private
val
mSelectColor
:
Int
private
val
mUnSelectColor
:
Int
private
val
mUnSelectColor
:
Int
private
var
position
=
-
1
private
var
position
=
-
1
private
var
price
:
String
?=
""
constructor
(
constructor
(
content
:
Activity
?,
content
:
Activity
?,
listener
:
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>
listener
:
OnRecycleItemClickListener
<
MemberEntity
.
ProductDetail
>
...
@@ -30,22 +34,36 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
...
@@ -30,22 +34,36 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
mSelectColor
=
AppContext
.
get
().
resources
.
getColor
(
R
.
color
.
color_ba7e36
)
mSelectColor
=
AppContext
.
get
().
resources
.
getColor
(
R
.
color
.
color_ba7e36
)
mUnSelectColor
=
AppContext
.
get
().
resources
.
getColor
(
R
.
color
.
color_333333
)
mUnSelectColor
=
AppContext
.
get
().
resources
.
getColor
(
R
.
color
.
color_333333
)
}
}
fun
setPosition
(
pos
:
Int
)
{
fun
setPosition
(
pos
:
Int
)
{
position
=
pos
position
=
pos
notifyDataSetChanged
()
notifyDataSetChanged
()
}
}
fun
updateData
(
discountprice
:
String
)
{
price
=
discountprice
notifyDataSetChanged
()
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
pos
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
pos
:
Int
)
{
var
bean
=
mList
[
pos
]
var
bean
=
mList
[
pos
]
if
(
pos
==
position
){
holder
.
id_tv_activity_price_text
?.
text
=
"活动价"
holder
.
id_tv_price
?.
text
=
"${bean.cash}"
if
(
pos
==
position
)
{
if
(!
TextUtils
.
isEmpty
(
price
)){
Log
.
e
(
"MXL"
,
"更新ui"
)
holder
.
id_tv_activity_price_text
?.
text
=
"已减${price}元"
holder
.
id_tv_price
?.
text
=
"${bean.cash?.toDoubleOrNull()?.minus(price?.toDoubleOrNull()!!)}"
}
holder
.
id_ll_item
?.
setBackgroundResource
(
R
.
drawable
.
shape_edd49d_r6
)
holder
.
id_ll_item
?.
setBackgroundResource
(
R
.
drawable
.
shape_edd49d_r6
)
holder
.
id_tv_activity_price_text
?.
setBackgroundResource
(
R
.
drawable
.
shape_edd49d_r11
)
holder
.
id_tv_activity_price_text
?.
setBackgroundResource
(
R
.
drawable
.
shape_edd49d_r11
)
holder
.
id_tv_activity_price_text
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_activity_price_text
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_price
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_price
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_orgin_price
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_orgin_price
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_rmb
?.
setTextColor
(
mSelectColor
)
holder
.
id_tv_rmb
?.
setTextColor
(
mSelectColor
)
listener
.
onItemClick
(
holder
.
itemView
,
pos
,
bean
)
//
listener.onItemClick(holder.itemView, pos, bean)
}
else
{
}
else
{
holder
.
id_ll_item
?.
setBackgroundResource
(
R
.
drawable
.
shape_cbcbcb_r6
)
holder
.
id_ll_item
?.
setBackgroundResource
(
R
.
drawable
.
shape_cbcbcb_r6
)
holder
.
id_tv_activity_price_text
?.
setBackgroundResource
(
R
.
drawable
.
shape_a3a4a6_r10
)
holder
.
id_tv_activity_price_text
?.
setBackgroundResource
(
R
.
drawable
.
shape_a3a4a6_r10
)
holder
.
id_tv_activity_price_text
?.
setTextColor
(
Color
.
parseColor
(
"#ffffff"
))
holder
.
id_tv_activity_price_text
?.
setTextColor
(
Color
.
parseColor
(
"#ffffff"
))
...
@@ -53,14 +71,11 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
...
@@ -53,14 +71,11 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
holder
.
id_tv_orgin_price
?.
setTextColor
(
Color
.
parseColor
(
"#999999"
))
holder
.
id_tv_orgin_price
?.
setTextColor
(
Color
.
parseColor
(
"#999999"
))
holder
.
id_tv_rmb
?.
setTextColor
(
mUnSelectColor
)
holder
.
id_tv_rmb
?.
setTextColor
(
mUnSelectColor
)
}
}
holder
.
id_tv_activity_price_text
?.
text
=
"活动价"
holder
.
id_tv_price
?.
text
=
"${bean.cash}"
holder
.
id_tv_orgin_price
?.
text
=
"原价 ¥${bean.originalPrice}"
holder
.
id_tv_orgin_price
?.
text
=
"原价 ¥${bean.originalPrice}"
holder
.
id_tv_orgin_price
?.
getPaint
()
?.
setFlags
(
Paint
.
STRIKE_THRU_TEXT_FLAG
)
holder
.
id_tv_orgin_price
?.
getPaint
()
?.
setFlags
(
Paint
.
STRIKE_THRU_TEXT_FLAG
)
// holder.id_ll_item?.setOnClickListener {
// listener.onItemClick(it, position, bean)
// }
}
}
// override fun getItemCount(): Int {
// override fun getItemCount(): Int {
...
@@ -84,22 +99,23 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
...
@@ -84,22 +99,23 @@ class RechargeAdapter : BaseRecyclerAdapter<MemberEntity.ProductDetail, Recharge
var
id_tv_orgin_price
:
TextView
?
var
id_tv_orgin_price
:
TextView
?
constructor
(
constructor
(
itemView
:
View
itemView
:
View
)
:
super
(
itemView
)
{
)
:
super
(
itemView
)
{
id_ll_item
=
id_ll_item
=
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
id_ll_item
)
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
id_ll_item
)
id_tv_activity_price_text
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_activity_price_text
)
id_tv_activity_price_text
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_activity_price_text
)
id_tv_rmb
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_rmb
)
id_tv_rmb
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_rmb
)
id_tv_price
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_price
)
id_tv_price
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_price
)
id_tv_orgin_price
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_orgin_price
)
id_tv_orgin_price
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_orgin_price
)
id_ll_item
?.
setOnClickListener
{
id_ll_item
?.
setOnClickListener
{
val
pos
=
adapterPosition
val
pos
=
adapterPosition
Log
.
e
(
"MXL"
,
"pos:"
+
pos
)
if
(
pos
>=
0
&&
pos
<
mList
.
size
)
{
if
(
pos
>=
0
&&
pos
<
mList
.
size
)
{
setPosition
(
pos
)
setPosition
(
pos
)
notifyDataSetChanged
(
)
listener
.
onItemClick
(
it
,
pos
,
mList
[
pos
]
)
}
}
}
}
}
}
...
...
moduleMain/src/main/java/com/zxbw/modulemain/contract/RechargeContract.kt
View file @
eba5811b
...
@@ -21,7 +21,7 @@ class RechargeContract {
...
@@ -21,7 +21,7 @@ class RechargeContract {
}
}
interface
Presenter
{
interface
Presenter
{
fun
getFetchCard
(
phone
:
String
)
fun
getFetchCard
()
fun
getPayList
(
payModel
:
String
)
fun
getPayList
(
payModel
:
String
)
fun
requestRightsAliPay
(
fun
requestRightsAliPay
(
goodsId
:
String
,
goodsId
:
String
,
...
...
moduleMain/src/main/java/com/zxbw/modulemain/fragment/UserCenterFragment.kt
View file @
eba5811b
...
@@ -26,7 +26,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
...
@@ -26,7 +26,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
override
fun
init
(
view
:
View
?)
{
override
fun
init
(
view
:
View
?)
{
id_ll_member
?.
setOnClickListener
{
id_ll_member
?.
setOnClickListener
{
JumpUtils
.
RechargeJump
()
// JumpUtils.RechargeJump()
}
}
id_img_kefu
?.
setOnClickListener
{
id_img_kefu
?.
setOnClickListener
{
JumpUtils
.
webJump
(
"客服"
,
NetConfig
.
H5
.
WEB_URL_CUSTOMER_SERVICE
)
JumpUtils
.
webJump
(
"客服"
,
NetConfig
.
H5
.
WEB_URL_CUSTOMER_SERVICE
)
...
...
moduleMain/src/main/java/com/zxbw/modulemain/presenter/RechargePresenter.kt
View file @
eba5811b
...
@@ -21,8 +21,8 @@ class RechargePresenter : RechargeContract.Presenter {
...
@@ -21,8 +21,8 @@ class RechargePresenter : RechargeContract.Presenter {
this
.
mView
=
mView
this
.
mView
=
mView
}
}
override
fun
getFetchCard
(
phone
:
String
)
{
override
fun
getFetchCard
()
{
ApiClient
.
homeApi
.
getFetchallCard
(
phone
).
compose
(
RxSchedulers
.
observableIO2Main
())
ApiClient
.
homeApi
.
getFetchallCard
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
List
<
CouponsEntity
>>()
{
.
subscribe
(
object
:
BaseObserver
<
List
<
CouponsEntity
>>()
{
override
fun
onSuccess
(
result
:
List
<
CouponsEntity
>?)
{
override
fun
onSuccess
(
result
:
List
<
CouponsEntity
>?)
{
mView
.
setCouponsList
(
result
)
mView
.
setCouponsList
(
result
)
...
...
moduleMain/src/main/java/com/zxbw/modulemain/view/DialogUtils.kt
View file @
eba5811b
...
@@ -460,7 +460,7 @@ object DialogUtils {
...
@@ -460,7 +460,7 @@ object DialogUtils {
Gravity
.
CENTER
Gravity
.
CENTER
)
)
SettingPreference
.
setShowUseDiscount
(
"1"
)
mDialog
.
setCanceledOnTouchOutside
(
true
)
mDialog
.
setCanceledOnTouchOutside
(
true
)
mDialog
.
setCancelable
(
true
)
mDialog
.
setCancelable
(
true
)
mDialog
.
show
()
mDialog
.
show
()
...
...
moduleMain/src/main/res/layout/activity_layout_recharge.xml
View file @
eba5811b
...
@@ -75,7 +75,10 @@
...
@@ -75,7 +75,10 @@
android:inputType=
"phone"
android:inputType=
"phone"
android:textCursorDrawable=
"@drawable/cursor_color"
android:textCursorDrawable=
"@drawable/cursor_color"
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/id_rl_yunyingshang"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
...
@@ -125,6 +128,7 @@
...
@@ -125,6 +128,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/id_img_huafei_bg"
android:layout_below=
"@+id/id_img_huafei_bg"
android:layout_marginTop=
"-10dp"
android:layout_marginTop=
"-10dp"
android:paddingBottom=
"16dp"
android:background=
"@drawable/shape_ffffff_r6"
android:background=
"@drawable/shape_ffffff_r6"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -166,7 +170,8 @@
...
@@ -166,7 +170,8 @@
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
android:layout_marginBottom=
"16dp"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -178,7 +183,7 @@
...
@@ -178,7 +183,7 @@
android:textSize=
"10sp"
/>
android:textSize=
"10sp"
/>
<TextView
<TextView
android:layout_width=
"
wrap_content
"
android:layout_width=
"
1dp
"
android:layout_height=
"15dp"
android:layout_height=
"15dp"
android:layout_marginLeft=
"32dp"
android:layout_marginLeft=
"32dp"
android:layout_marginRight=
"32dp"
android:layout_marginRight=
"32dp"
...
@@ -314,7 +319,7 @@
...
@@ -314,7 +319,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:text=
"
94.8
"
android:text=
""
android:textColor=
"#BA7E36"
android:textColor=
"#BA7E36"
android:textSize=
"28sp"
android:textSize=
"28sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
...
...
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