Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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_vedio
Commits
805bac58
Commit
805bac58
authored
Feb 20, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
4ae4c218
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
16 deletions
+249
-16
FirstCancel.java
.../main/java/com/duben/shortplay/mvp/model/FirstCancel.java
+100
-0
SecondCancel.java
...main/java/com/duben/shortplay/mvp/model/SecondCancel.java
+100
-0
VipBean.java
.../src/main/java/com/duben/shortplay/mvp/model/VipBean.java
+19
-0
VipActivity.kt
...main/java/com/duben/shortplay/ui/activitys/VipActivity.kt
+28
-15
VipPayCancelDialog.kt
...java/com/duben/shortplay/ui/widgets/VipPayCancelDialog.kt
+2
-1
No files found.
video/app/src/main/java/com/duben/shortplay/mvp/model/FirstCancel.java
0 → 100644
View file @
805bac58
package
com
.
duben
.
shortplay
.
mvp
.
model
;
import
java.io.Serializable
;
public
class
FirstCancel
implements
Serializable
{
private
boolean
weixin
;
private
boolean
alipay
;
private
boolean
showCycTips
;
// 判断是否提示
private
double
firstPayPrice
;
private
double
oldPrice
;
private
int
days
;
private
int
trial
;
//是否签约 0-没签约 1-签约
private
int
trialFirstDay
;
private
int
activityType
;
//0-不显示 1-显示
private
String
remarks
;
//底部描述
private
String
pid
;
private
String
title
;
private
String
topTitle
;
private
String
buttonText
;
public
String
getButtonText
()
{
return
buttonText
;
}
public
boolean
isWeixin
()
{
return
weixin
;
}
public
boolean
isAlipay
()
{
return
alipay
;
}
public
double
getPrice
()
{
return
firstPayPrice
;
}
public
double
getOldPrice
()
{
return
oldPrice
;
}
public
void
setOldPrice
(
double
oldPrice
)
{
this
.
oldPrice
=
oldPrice
;
}
public
int
getDays
()
{
return
days
;
}
public
void
setDays
(
int
days
)
{
this
.
days
=
days
;
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
;
}
public
String
getPid
()
{
return
pid
;
}
public
void
setPid
(
String
pid
)
{
this
.
pid
=
pid
;
}
public
int
getActivityType
()
{
return
activityType
;
}
public
void
setActivityType
(
int
activityType
)
{
this
.
activityType
=
activityType
;
}
public
String
getTitle
()
{
return
title
;
}
public
String
getTopTitle
()
{
return
topTitle
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
boolean
isShowCycTips
()
{
return
showCycTips
;
}
public
int
getTrialFirstDay
()
{
return
trialFirstDay
;
}
public
int
getTrial
()
{
return
trial
;
}
}
video/app/src/main/java/com/duben/shortplay/mvp/model/SecondCancel.java
0 → 100644
View file @
805bac58
package
com
.
duben
.
shortplay
.
mvp
.
model
;
import
java.io.Serializable
;
public
class
SecondCancel
implements
Serializable
{
private
boolean
weixin
;
private
boolean
alipay
;
private
boolean
showCycTips
;
// 判断是否提示
private
double
firstPayPrice
;
private
double
oldPrice
;
private
int
days
;
private
int
trial
;
//是否签约 0-没签约 1-签约
private
int
trialFirstDay
;
private
int
activityType
;
//0-不显示 1-显示
private
String
remarks
;
//底部描述
private
String
pid
;
private
String
title
;
private
String
topTitle
;
private
String
buttonText
;
public
String
getButtonText
()
{
return
buttonText
;
}
public
boolean
isWeixin
()
{
return
weixin
;
}
public
boolean
isAlipay
()
{
return
alipay
;
}
public
double
getPrice
()
{
return
firstPayPrice
;
}
public
double
getOldPrice
()
{
return
oldPrice
;
}
public
void
setOldPrice
(
double
oldPrice
)
{
this
.
oldPrice
=
oldPrice
;
}
public
int
getDays
()
{
return
days
;
}
public
void
setDays
(
int
days
)
{
this
.
days
=
days
;
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
;
}
public
String
getPid
()
{
return
pid
;
}
public
void
setPid
(
String
pid
)
{
this
.
pid
=
pid
;
}
public
int
getActivityType
()
{
return
activityType
;
}
public
void
setActivityType
(
int
activityType
)
{
this
.
activityType
=
activityType
;
}
public
String
getTitle
()
{
return
title
;
}
public
String
getTopTitle
()
{
return
topTitle
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
boolean
isShowCycTips
()
{
return
showCycTips
;
}
public
int
getTrialFirstDay
()
{
return
trialFirstDay
;
}
public
int
getTrial
()
{
return
trial
;
}
}
video/app/src/main/java/com/duben/shortplay/mvp/model/VipBean.java
View file @
805bac58
...
...
@@ -6,6 +6,9 @@ import java.util.List;
public
class
VipBean
implements
Serializable
{
private
List
<
ListBean
>
list
;
private
FirstCancel
firstCancel
;
private
SecondCancel
secondCancel
;
private
boolean
needClick
;
// 是否勾选协议 true-勾选
...
...
@@ -17,6 +20,22 @@ public class VipBean implements Serializable {
return
list
;
}
public
FirstCancel
getFirstCancel
()
{
return
firstCancel
;
}
public
void
setFirstCancel
(
FirstCancel
firstCancel
)
{
this
.
firstCancel
=
firstCancel
;
}
public
SecondCancel
getSecondCancel
()
{
return
secondCancel
;
}
public
void
setSecondCancel
(
SecondCancel
secondCancel
)
{
this
.
secondCancel
=
secondCancel
;
}
public
class
ListBean
implements
Serializable
{
private
boolean
weixin
;
...
...
video/app/src/main/java/com/duben/shortplay/ui/activitys/VipActivity.kt
View file @
805bac58
...
...
@@ -79,6 +79,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private
val
vipPresenter
by
lazy
{
VipPresenter
()
}
private
lateinit
var
vipAdapter
:
VipAdapter
private
var
vipList
:
MutableList
<
VipBean
.
ListBean
>?
=
null
private
var
vipData
:
VipBean
=
null
private
var
isCheckAgreeFlag
:
Boolean
=
true
private
var
isGuide
:
Boolean
=
false
// 从启动页进入vip界面,返回时要回到首页
private
var
isMain
:
Boolean
=
false
...
...
@@ -154,6 +155,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
override
fun
getVipProductSuc
(
data
:
VipBean
)
{
this
.
vipData
=
data
if
(!
isFinishing
)
{
if
(
data
.
list
!=
null
&&
data
.
list
.
size
>
0
)
{
vipList
=
data
.
list
...
...
@@ -491,15 +493,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
val
alipayCount
=
AppPreferencesManager
.
get
().
getInt
(
Constant
.
ALIPAY_COUNT
,
0
)
AppPreferencesManager
.
get
().
put
(
Constant
.
ALIPAY_COUNT
,
alipayCount
+
1
)
showPayCancelDialog
()
// if (vipList != null && vipList!!.size > 0) {
// val vipBean = vipList!![vipAdapter.getPosition()]
// // 0.01
// if (vipBean.trial != 0) {
// showPayCancelDialog()
// }
// }
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
// 0.01
if
(
vipBean
.
trial
!=
0
)
{
showPayCancelDialog
()
}
}
},
2000
...
...
@@ -741,20 +742,32 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
// 金额
val
alipayCount
=
AppPreferencesManager
.
get
().
getInt
(
Constant
.
ALIPAY_COUNT
,
0
)
var
vipBean
=
vipList
!!
[
0
]
var
price
=
vipBean
.
price
var
pid
=
vipBean
.
pid
var
oldPrice
=
vipBean
.
oldPrice
if
(
alipayCount
==
1
)
{
}
else
if
(
alipayCount
==
2
)
{
if
(
vipData
!=
null
&&
vipData
.
firstCancel
!=
null
)
{
price
=
vipData
.
firstCancel
.
price
pid
=
vipData
.
firstCancel
.
pid
oldPrice
=
vipData
.
firstCancel
.
oldPrice
}
val
vipBean
=
vipList
!!
[
0
]
VipPayCancelDialog
(
this
,
vipBean
.
price
,
object
:
DialogListener
()
{
}
else
if
(
alipayCount
>=
2
)
{
if
(
vipData
!=
null
&&
vipData
.
secondCancel
!=
null
)
{
price
=
vipData
.
secondCancel
.
price
pid
=
vipData
.
secondCancel
.
pid
oldPrice
=
vipData
.
secondCancel
.
oldPrice
}
}
VipPayCancelDialog
(
this
,
price
,
oldPrice
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
pid
,
isAliPayInstalled
()
)
}
})
...
...
video/app/src/main/java/com/duben/shortplay/ui/widgets/VipPayCancelDialog.kt
View file @
805bac58
...
...
@@ -14,6 +14,7 @@ import kotlinx.android.synthetic.main.dialog_vip_pay_cancel.*
class
VipPayCancelDialog
(
val
activity
:
Activity
,
val
cash
:
Double
,
val
coupon
:
Double
,
private
val
listener
:
DialogListener
)
:
Dialog
(
activity
,
R
.
style
.
dialog
)
{
...
...
@@ -42,7 +43,7 @@ class VipPayCancelDialog(
dismiss
()
}
tv_cancel_cash
.
text
=
"${cash}元"
tv_cancel_coupon
.
text
=
"赠送${cash}元体验券"
tv_cancel_coupon
.
text
=
"赠送${c
oupon-c
ash}元体验券"
listener
.
setDialog
(
this
)
findViewById
<
View
>(
R
.
id
.
btn
).
setOnClickListener
(
listener
)
...
...
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