Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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
android
android_goodmoney
Commits
d9f50969
Commit
d9f50969
authored
Dec 08, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
ccc34aaf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
59 deletions
+49
-59
DrawcashBean.java
...main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
+5
-0
DrawcashPresenter.java
...com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
+1
-5
DrawcashActivity.kt
...java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
+41
-50
DrawcashVideoDialog.kt
...ava/com/mints/goodmoney/ui/widgets/DrawcashVideoDialog.kt
+2
-4
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
View file @
d9f50969
...
@@ -10,6 +10,7 @@ public class DrawcashBean implements Serializable {
...
@@ -10,6 +10,7 @@ public class DrawcashBean implements Serializable {
private
String
drawcashRule
;
private
String
drawcashRule
;
private
String
drawcashHint
;
private
String
drawcashHint
;
private
int
coin
;
private
int
coin
;
private
double
maxCashout
;
private
int
vedioComplete
;
private
int
vedioComplete
;
private
String
remark
;
private
String
remark
;
private
List
<
CashOutMoneyArrBean
>
cashOutMoneyArr
;
private
List
<
CashOutMoneyArrBean
>
cashOutMoneyArr
;
...
@@ -35,6 +36,10 @@ public class DrawcashBean implements Serializable {
...
@@ -35,6 +36,10 @@ public class DrawcashBean implements Serializable {
return
drawcashHint
;
return
drawcashHint
;
}
}
public
double
getMaxCashout
()
{
return
maxCashout
;
}
public
int
getCoin
()
{
public
int
getCoin
()
{
return
coin
;
return
coin
;
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
View file @
d9f50969
...
@@ -205,15 +205,11 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
...
@@ -205,15 +205,11 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
if
(
isLinkView
())
return
;
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
int
code
=
baseResponse
.
getStatus
();
String
message
=
baseResponse
.
getMessage
(
);
view
.
showToast
(
baseResponse
.
getMessage
()
);
switch
(
code
)
{
switch
(
code
)
{
case
200
:
//成功
case
200
:
//成功
view
.
showToast
(
"提现成功"
);
getUserTaskMsg
();
getUserTaskMsg
();
break
;
break
;
default
:
view
.
showToast
(
message
);
break
;
}
}
}
}
});
});
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
View file @
d9f50969
...
@@ -45,19 +45,19 @@ class DrawcashActivity : BaseActivity(),
...
@@ -45,19 +45,19 @@ class DrawcashActivity : BaseActivity(),
private
val
TAG
=
DrawcashActivity
::
class
.
java
.
simpleName
private
val
TAG
=
DrawcashActivity
::
class
.
java
.
simpleName
private
var
drawcashVideoDialog
:
DrawcashVideoDialog
?
=
null
private
lateinit
var
vedioAdingManager
:
VedioAdingManager
private
val
drawcashPresenter
by
lazy
{
DrawcashPresenter
()
}
private
val
drawcashPresenter
by
lazy
{
DrawcashPresenter
()
}
private
lateinit
var
drawcashAdapter
:
DrawcashAdapter
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
loginApi
by
lazy
{
LoginApi
()
}
private
val
loginApi
by
lazy
{
LoginApi
()
}
private
lateinit
var
drawcashAdapter
:
DrawcashAdapter
private
var
priceList
:
MutableList
<
DrawcashBean
.
CashOutMoneyArrBean
>?
=
null
private
var
priceList
:
MutableList
<
DrawcashBean
.
CashOutMoneyArrBean
>?
=
null
private
var
wxInfo
:
WXInfo
?
=
null
private
var
wxInfo
:
WXInfo
?
=
null
private
var
userConfig
:
DrawcashBean
?
=
null
private
var
userConfig
:
DrawcashBean
?
=
null
private
var
drawcashVideoDialog
:
DrawcashVideoDialog
?
=
null
private
var
isLoadRvItem
:
Boolean
=
true
//是否首次加载rv item
private
var
isLoadRvItem
:
Boolean
=
true
//是否首次加载rv item
private
lateinit
var
vedioAdingManager
:
VedioAdingManager
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_drawcash
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_drawcash
...
@@ -86,6 +86,8 @@ class DrawcashActivity : BaseActivity(),
...
@@ -86,6 +86,8 @@ class DrawcashActivity : BaseActivity(),
super
.
onDestroy
()
super
.
onDestroy
()
loginApi
.
setOnLoginListener
(
null
)
loginApi
.
setOnLoginListener
(
null
)
drawcashVideoDialog
?.
setOnClickListener
(
null
)
drawcashVideoDialog
?.
onDestory
()
drawcashPresenter
.
detachView
()
drawcashPresenter
.
detachView
()
}
}
...
@@ -150,10 +152,16 @@ class DrawcashActivity : BaseActivity(),
...
@@ -150,10 +152,16 @@ class DrawcashActivity : BaseActivity(),
return
return
}
}
// 可提金额
if
(
priceList
!!
[
drawcashAdapter
.
getPosition
()].
money
>
userConfig
?.
maxCashout
!!
)
{
showToast
(
"请先提现${userConfig?.maxCashout}元"
)
return
}
val
curCount
=
userConfig
?.
vedioComplete
!!
val
curCount
=
userConfig
?.
vedioComplete
!!
val
sumCount
=
priceList
!!
[
drawcashAdapter
.
getPosition
()].
vedio
val
sumCount
=
priceList
!!
[
drawcashAdapter
.
getPosition
()].
vedio
if
(
curCount
>=
sumCount
)
{
if
(
curCount
>=
sumCount
)
{
drawcashPresenter
.
saveTerminalInfo
(
priceList
!!
[
drawcashAdapter
?
.
getPosition
()].
money
)
drawcashPresenter
.
saveTerminalInfo
(
priceList
!!
[
drawcashAdapter
.
getPosition
()].
money
)
}
else
{
}
else
{
drawcashVideoDialog
(
curCount
,
sumCount
)
drawcashVideoDialog
(
curCount
,
sumCount
)
}
}
...
@@ -175,25 +183,27 @@ class DrawcashActivity : BaseActivity(),
...
@@ -175,25 +183,27 @@ class DrawcashActivity : BaseActivity(),
tvDrawcashName
.
setText
(
data
.
nickName
)
tvDrawcashName
.
setText
(
data
.
nickName
)
}
}
if
(
isLoadRvItem
)
{
// 提现更改权重
priceList
=
data
.
cashOutMoneyArr
initRvView
()
}
val
allcoinBig
=
BigDecimal
(
data
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
tvDrawcashGoldabout
.
setText
(
"约"
+
cashStr
+
"元"
)
initAdWeight
(
data
.
vedioRules
)
initAdWeight
(
data
.
vedioRules
)
// 修改提现弹窗内容
if
(
drawcashVideoDialog
!=
null
&&
drawcashVideoDialog
!!
.
isShowing
)
{
if
(
drawcashVideoDialog
!=
null
&&
drawcashVideoDialog
!!
.
isShowing
)
{
drawcashVideoDialog
?.
setContent
(
"观看视频并下载后立即提现(${data.vedioComplete}/${data.cashOutMoneyArr[drawcashAdapter.getPosition()].vedio})"
)
drawcashVideoDialog
?.
setContent
(
"观看视频并
点击
下载后立即提现(${data.vedioComplete}/${data.cashOutMoneyArr[drawcashAdapter.getPosition()].vedio})"
)
if
(
data
.
vedioComplete
>=
data
.
cashOutMoneyArr
[
drawcashAdapter
.
getPosition
()].
vedio
)
{
if
(
data
.
vedioComplete
>=
data
.
cashOutMoneyArr
[
drawcashAdapter
.
getPosition
()].
vedio
)
{
drawcashVideoDialog
?.
setBtnText
(
"去提现"
)
drawcashVideoDialog
?.
setBtnText
(
"去提现"
)
}
else
{
}
else
{
drawcashVideoDialog
?.
setBtnText
(
"去观看"
)
drawcashVideoDialog
?.
setBtnText
(
"去观看"
)
}
}
}
}
if
(
isLoadRvItem
)
{
priceList
=
data
.
cashOutMoneyArr
initRvView
()
}
val
allcoinBig
=
BigDecimal
(
data
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
tvDrawcashGoldabout
.
setText
(
"约"
+
cashStr
+
"元"
)
}
}
override
fun
editUserMsgSuc
()
{
override
fun
editUserMsgSuc
()
{
...
@@ -233,27 +243,6 @@ class DrawcashActivity : BaseActivity(),
...
@@ -233,27 +243,6 @@ class DrawcashActivity : BaseActivity(),
return
false
return
false
}
}
private
fun
initText
()
{
tvDrawcashExplain
.
setText
(
SpanUtils
()
.
append
(
"提现说明:"
)
.
append
(
"\n"
)
.
append
(
"1、所有提现金额【无门槛】直接提现!新用户提现秒到账!"
)
.
append
(
"\n"
)
.
append
(
"2、由于提现需要实名制,非实名用户账号无法支持提现,请务必使用实名认证过的账号提现!"
)
.
append
(
"\n"
)
.
append
(
"3、单笔提现金额最低"
+
0.3
+
"元,最高"
+
1000
+
"元。"
)
.
append
(
"\n"
)
.
append
(
"4、提现申请将在3-5个工作日审核到账,请耐心等待。"
)
.
append
(
"\n"
)
.
append
(
"5、每日可申请提现一次,若当日限额已满,请次日申请。"
)
.
create
())
tvDrawcashHint
.
text
=
"* 如您或好友通过刷机等违规操作获取非法收益,平台将视情况扣除违规所得或冻结账号。"
+
"\n* 最终解释权归本公司所有。"
}
private
fun
initRvView
()
{
private
fun
initRvView
()
{
val
gridLayoutManager
=
GridLayoutManager
(
this
,
3
)
val
gridLayoutManager
=
GridLayoutManager
(
this
,
3
)
rvCash
.
layoutManager
=
gridLayoutManager
rvCash
.
layoutManager
=
gridLayoutManager
...
@@ -295,19 +284,21 @@ class DrawcashActivity : BaseActivity(),
...
@@ -295,19 +284,21 @@ class DrawcashActivity : BaseActivity(),
if
(
drawcashVideoDialog
==
null
)
{
if
(
drawcashVideoDialog
==
null
)
{
drawcashVideoDialog
=
DrawcashVideoDialog
(
this
)
drawcashVideoDialog
=
DrawcashVideoDialog
(
this
)
}
}
if
(
sumCount
==
1
)
{
drawcashVideoDialog
?.
let
{
drawcashVideoDialog
?.
setContent
(
"观看视频并下载后可立即提现"
)
if
(
sumCount
==
1
)
{
}
else
{
it
.
setContent
(
"观看视频并点击下载后可立即提现"
)
drawcashVideoDialog
?.
setContent
(
"观看视频并下载后可立即提现(${curCount}/${sumCount})"
)
}
else
{
}
it
.
setContent
(
"观看视频并点击下载后可立即提现(${curCount}/${sumCount})"
)
drawcashVideoDialog
?.
setOnClickListener
(
object
:
DrawcashVideoDialog
.
OnClickListener
{
override
fun
onClick
()
{
if
(
priceList
!=
null
&&
priceList
!!
.
size
>
0
)
{
drawcashPresenter
.
saveTerminalInfo
(
priceList
!!
[
drawcashAdapter
?.
getPosition
()].
money
)
}
}
}
it
.
setOnClickListener
(
object
:
DrawcashVideoDialog
.
OnClickListener
{
override
fun
onClick
()
{
if
(
priceList
!=
null
&&
priceList
!!
.
size
>
0
)
{
drawcashPresenter
.
saveTerminalInfo
(
priceList
!!
[
drawcashAdapter
.
getPosition
()].
money
)
}
}
})
it
.
show
()
}
})
drawcashVideoDialog
?.
show
()
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/DrawcashVideoDialog.kt
View file @
d9f50969
...
@@ -49,9 +49,7 @@ class DrawcashVideoDialog(activity: Activity) :
...
@@ -49,9 +49,7 @@ class DrawcashVideoDialog(activity: Activity) :
this
.
activity
=
activity
this
.
activity
=
activity
}
}
override
fun
dismiss
()
{
fun
onDestory
(){
super
.
dismiss
()
vedioAdingManager
?.
setVedioAdingListener
(
null
)
vedioAdingManager
?.
setVedioAdingListener
(
null
)
vedioAdingManager
?.
onDestory
()
vedioAdingManager
?.
onDestory
()
...
@@ -139,7 +137,7 @@ class DrawcashVideoDialog(activity: Activity) :
...
@@ -139,7 +137,7 @@ class DrawcashVideoDialog(activity: Activity) :
fun
onClick
()
fun
onClick
()
}
}
fun
setOnClickListener
(
onClickListener
:
OnClickListener
)
{
fun
setOnClickListener
(
onClickListener
:
OnClickListener
?
)
{
this
.
onClickListener
=
onClickListener
this
.
onClickListener
=
onClickListener
}
}
}
}
\ No newline at end of file
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