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
001458fb
Commit
001458fb
authored
Dec 25, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
京东金融逻辑修改
parent
a2108684
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
276 additions
and
54 deletions
+276
-54
DrawcashBean.java
...main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
+1
-2
DrawcashPresenter.java
...com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
+46
-1
DrawcashView.java
...main/java/com/mints/goodmoney/mvp/views/DrawcashView.java
+4
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+8
-0
DrawcashActivity.kt
...java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
+72
-25
JDTintDialog.kt
.../main/java/com/mints/goodmoney/ui/widgets/JDTintDialog.kt
+50
-0
shape_jd_selected.xml
GoodMoney/app/src/main/res/drawable/shape_jd_selected.xml
+1
-1
shape_wechat_selected.xml
...Money/app/src/main/res/drawable/shape_wechat_selected.xml
+0
-9
shape_wechat_unselected.xml
...ney/app/src/main/res/drawable/shape_wechat_unselected.xml
+0
-9
text_color_jd_selector.xml
...oney/app/src/main/res/drawable/text_color_jd_selector.xml
+5
-0
activity_drawcash.xml
GoodMoney/app/src/main/res/layout/activity_drawcash.xml
+6
-7
dialog_jd_bind_mobile.xml
GoodMoney/app/src/main/res/layout/dialog_jd_bind_mobile.xml
+83
-0
ic_draw_jd.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_draw_jd.png
+0
-0
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
View file @
001458fb
...
...
@@ -16,6 +16,7 @@ public class DrawcashBean implements Serializable {
private
List
<
CashOutMoneyArrBean
>
cashOutMoneyArr
;
private
VedioRules
vedioRules
;
private
boolean
isJDNewUser
;
private
String
JDUrl
=
null
;
public
String
getJDUrl
()
{
return
JDUrl
;
...
...
@@ -25,8 +26,6 @@ public class DrawcashBean implements Serializable {
this
.
JDUrl
=
JDUrl
;
}
private
String
JDUrl
;
public
Boolean
getIsJDNewUser
()
{
return
isJDNewUser
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/DrawcashPresenter.java
View file @
001458fb
...
...
@@ -5,6 +5,7 @@ import android.view.animation.AccelerateDecelerateInterpolator;
import
com.daimajia.androidanimations.library.Techniques
;
import
com.daimajia.androidanimations.library.YoYo
;
import
com.google.gson.JsonObject
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.DeviceInfo
;
...
...
@@ -154,7 +155,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
}
riskinfo
(
deviceInfo
,
getT
());
riskinfo
(
deviceInfo
,
getT
());
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
...
...
@@ -232,6 +233,50 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
});
}
/**
* 检测是否京东金融新用户
*/
public
void
checkJDNewUsers
(
String
mobile
)
{
view
.
showLoading
(
"加载中..."
);
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"mobile"
,
mobile
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
checkJDNewUsers
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
DrawcashBean
>>()
{
@Override
public
void
onCompleted
()
{
if
(
isLinkView
())
return
;
view
.
hideLoading
();
}
@Override
public
void
onError
(
Throwable
e
)
{
if
(
isLinkView
())
return
;
view
.
hideLoading
();
view
.
showToast
(
e
.
getMessage
());
view
.
checkJDNewUsersFail
();
}
@Override
public
void
onNext
(
BaseResponse
<
DrawcashBean
>
baseResponse
)
{
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
view
.
showToast
(
baseResponse
.
getMessage
());
switch
(
code
)
{
case
200
:
//成功
view
.
checkJDNewUsersSuc
(
baseResponse
.
getData
().
getIsJDNewUser
(),
baseResponse
.
getData
().
getJDUrl
());
break
;
default
:
view
.
checkJDNewUsersFail
();
break
;
}
}
});
}
/**
* 风控信息
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/DrawcashView.java
View file @
001458fb
...
...
@@ -15,4 +15,8 @@ public interface DrawcashView extends BaseView {
void
editUserMsgSuc
();
void
mergeAccount
(
String
mobile
,
String
wxOpenId
,
String
key
);
void
checkJDNewUsersSuc
(
boolean
isJdNewUser
,
String
JDUrl
);
void
checkJDNewUsersFail
();
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
001458fb
...
...
@@ -477,6 +477,14 @@ public interface LoanService {
@POST
(
"api/addCarrierTypeTime"
)
Observable
<
BaseResponse
<
Object
>>
addCarrierTypeTime
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 检测是否京东金融新用户
*
* @return
*/
@POST
(
"api/checkJDNewUsers"
)
Observable
<
BaseResponse
<
DrawcashBean
>>
checkJDNewUsers
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
View file @
001458fb
...
...
@@ -21,7 +21,9 @@ import com.mints.goodmoney.mvp.views.DrawcashView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.adapter.DrawcashAdapter
import
com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.ui.widgets.DrawcashVideoDialog
import
com.mints.goodmoney.ui.widgets.JDTintDialog
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.json.JsonUtil
...
...
@@ -56,6 +58,7 @@ class DrawcashActivity : BaseActivity(),
private
var
isJDNewUser
=
false
private
var
jumpJdUrl
:
String
?
=
null
private
var
jdTintDialog
:
JDTintDialog
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_drawcash
...
...
@@ -67,6 +70,8 @@ class DrawcashActivity : BaseActivity(),
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
tv_right_subtitle
.
visibility
=
View
.
VISIBLE
tv_right_subtitle
.
text
=
"提现记录"
tvDrawWechat
.
isChecked
=
true
rl_drawcash
.
setOnCheckedChangeListener
(
this
)
view_title
.
text
=
"提现规则"
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
this
)
...
...
@@ -126,15 +131,15 @@ class DrawcashActivity : BaseActivity(),
R
.
id
.
tvDrawcashNext
->
{
if
(
priceList
!=
null
&&
priceList
!!
.
size
>
0
)
{
// 跳转京东金融
if
(
isJDNewUser
)
{
jumpJdUrl
?.
let
{
val
bundle
=
Bundle
()
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
"京东金融"
)
bundle
.
putString
(
WebActivity
.
WEB_URL
,
jumpJdUrl
)
readyGo
(
WebActivity
::
class
.
java
,
bundle
)
return
}
}
//
if (isJDNewUser) {
//
jumpJdUrl?.let {
//
val bundle = Bundle()
//
bundle.putString(WebActivity.WEB_TITLE, "京东金融")
//
bundle.putString(WebActivity.WEB_URL, jumpJdUrl)
//
readyGo(WebActivity::class.java, bundle)
//
return
//
}
//
}
// 校验当前金币< 选择金币 =提示 去做任务
if
(
userConfig
?.
coin
!!
<
priceList
!!
[
drawcashAdapter
.
getPosition
()].
money
*
10000
)
{
...
...
@@ -191,14 +196,14 @@ class DrawcashActivity : BaseActivity(),
tvDrawcashName
.
setText
(
data
.
nickName
)
}
if
(
data
.
isJDNewUser
)
{
jumpJdUrl
=
data
.
jdUrl
isJDNewUser
=
true
rl_drawcash
.
visibility
=
View
.
VISIBLE
rl_drawcash
.
setOnCheckedChangeListener
(
this
)
}
else
{
rl_drawcash
.
visibility
=
View
.
GONE
}
//
if (data.isJDNewUser) {
//
jumpJdUrl = data.jdUrl
//
isJDNewUser = true
//
rl_drawcash.visibility = View.VISIBLE
//
rl_drawcash.setOnCheckedChangeListener(this)
//
} else {
//
rl_drawcash.visibility = View.GONE
//
}
// 提现更改权重
initAdWeight
(
data
.
vedioRules
)
...
...
@@ -216,8 +221,6 @@ class DrawcashActivity : BaseActivity(),
if
(
isLoadRvItem
)
{
priceList
=
data
.
cashOutMoneyArr
initRvView
()
tvDrawJd
.
isChecked
=
true
}
val
allcoinBig
=
BigDecimal
(
data
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
...
...
@@ -324,15 +327,59 @@ class DrawcashActivity : BaseActivity(),
}
}
override
fun
checkJDNewUsersSuc
(
isJdNewUser
:
Boolean
,
JDUrl
:
String
?)
{
jdTintDialog
?.
dismiss
()
if
(
isJdNewUser
)
{
JDUrl
?.
let
{
val
bundle
=
Bundle
()
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
"京东金融"
)
bundle
.
putString
(
WebActivity
.
WEB_URL
,
it
)
readyGo
(
WebActivity
::
class
.
java
,
bundle
)
return
}
}
showLoading
(
"手机号已注册京东金融"
)
}
override
fun
checkJDNewUsersFail
()
{
jdTintDialog
?.
dismiss
()
}
override
fun
onCheckedChanged
(
group
:
RadioGroup
?,
checkedId
:
Int
)
{
if
(
group
?.
checkedRadioButtonId
==
R
.
id
.
tvDrawJd
)
{
if
(
::
drawcashAdapter
.
isInitialized
)
{
drawcashAdapter
.
setIsAllUnEnable
(
true
)
}
jdTintDialog
=
JDTintDialog
(
this
,
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
ivClose
->
{
jdTintDialog
?.
dismiss
()
tvDrawWechat
.
isChecked
=
true
}
R
.
id
.
btnBindMobile
->
{
if
(
jdTintDialog
?.
getMobileNum
()
!!
.
length
<
11
)
{
showToast
(
"请输入手机号"
)
return
}
val
mobileNum
=
jdTintDialog
?.
getMobileNum
()
!!
.
replace
(
" "
.
toRegex
(),
""
)
jdTintDialog
?.
dismiss
()
tvDrawWechat
.
isChecked
=
true
drawcashPresenter
.
checkJDNewUsers
(
mobileNum
)
}
}
}
})
jdTintDialog
?.
show
()
// if (::drawcashAdapter.isInitialized) {
// drawcashAdapter.setIsAllUnEnable(true)
// }
}
else
{
if
(
::
drawcashAdapter
.
isInitialized
)
{
drawcashAdapter
.
setIsAllUnEnable
(
false
)
}
//
if (::drawcashAdapter.isInitialized) {
//
drawcashAdapter.setIsAllUnEnable(false)
//
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/JDTintDialog.kt
0 → 100644
View file @
001458fb
package
com.mints.goodmoney.ui.widgets
import
android.app.Dialog
import
android.content.Context
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.WindowManager
import
android.widget.Button
import
android.widget.ImageView
import
com.mints.goodmoney.R
/**
* 提示弹框
*/
class
JDTintDialog
(
context
:
Context
,
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
etLoginMobile
:
ClearEditText
private
val
btnBindMobile
:
Button
private
val
ivClose
:
ImageView
init
{
setContentView
(
R
.
layout
.
dialog_jd_bind_mobile
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
false
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
// 查找View
etLoginMobile
=
findViewById
(
R
.
id
.
etLoginMobile
)
btnBindMobile
=
findViewById
(
R
.
id
.
btnBindMobile
)
ivClose
=
findViewById
(
R
.
id
.
ivClose
)
ivClose
.
setOnClickListener
(
listener
)
etLoginMobile
.
setOnClickListener
(
listener
)
btnBindMobile
.
setOnClickListener
(
listener
)
}
fun
getMobileNum
():
String
{
return
etLoginMobile
.
text
.
toString
().
trim
()
}
}
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/shape_jd_selected.xml
View file @
001458fb
...
...
@@ -4,6 +4,6 @@
<stroke
android:width=
"1dp"
android:color=
"@color/color_ccc"
/>
<solid
android:color=
"@color/color_FF
DD0C
"
/>
<solid
android:color=
"@color/color_FF
9837
"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/shape_wechat_selected.xml
deleted
100644 → 0
View file @
a2108684
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<stroke
android:width=
"1dp"
android:color=
"@color/color_ccc"
/>
<solid
android:color=
"@color/color_4BB93F"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/shape_wechat_unselected.xml
deleted
100644 → 0
View file @
a2108684
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<stroke
android:width=
"1dp"
android:color=
"@color/color_ccc"
/>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"10dp"
/>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/
shape_wechat
_selector.xml
→
GoodMoney/app/src/main/res/drawable/
text_color_jd
_selector.xml
View file @
001458fb
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:
drawable=
"@drawable/shape_wechat_selected
"
android:state_checked=
"true"
/>
<item
android:
drawable=
"@drawable/shape_wechat_unselected
"
android:state_checked=
"false"
/>
<item
android:
color=
"@color/white
"
android:state_checked=
"true"
/>
<item
android:
color=
"@color/black
"
android:state_checked=
"false"
/>
</selector>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/activity_drawcash.xml
View file @
001458fb
...
...
@@ -108,8 +108,7 @@
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"20dp"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
android:orientation=
"horizontal"
>
<RadioButton
android:id=
"@+id/tvDrawWechat"
...
...
@@ -118,14 +117,14 @@
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_weight=
"1"
android:background=
"@drawable/shape_
wechat
_selector"
android:background=
"@drawable/shape_
jd
_selector"
android:button=
"@null"
android:drawableStart=
"@mipmap/ic_draw_wx"
android:drawablePadding=
"-30dp"
android:gravity=
"center"
android:paddingStart=
"30dp"
android:text=
"微信"
android:textColor=
"@
color/black
"
android:textColor=
"@
drawable/text_color_jd_selector
"
android:textSize=
"14sp"
/>
<RadioButton
...
...
@@ -138,11 +137,11 @@
android:background=
"@drawable/shape_jd_selector"
android:button=
"@null"
android:drawableStart=
"@mipmap/ic_draw_jd"
android:drawablePadding=
"-
3
0dp"
android:drawablePadding=
"-
2
0dp"
android:gravity=
"center"
android:paddingStart=
"30dp"
android:text=
"京东"
android:textColor=
"@
color/black
"
android:text=
"京东
金融
"
android:textColor=
"@
drawable/text_color_jd_selector
"
android:textSize=
"14sp"
/>
</RadioGroup>
...
...
GoodMoney/app/src/main/res/layout/dialog_jd_bind_mobile.xml
0 → 100644
View file @
001458fb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"300dp"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_banner_write"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
android:padding=
"10dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_marginBottom=
"10dp"
android:text=
"为保证您的资金安全"
android:textColor=
"@color/black"
android:textSize=
"18sp"
/>
<ImageView
android:id=
"@+id/ivClose"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end"
android:layout_marginBottom=
"6dp"
android:padding=
"12dp"
android:src=
"@mipmap/ic_close"
/>
</RelativeLayout>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:text=
"请提交您的手机号码"
android:textColor=
"@color/gray"
/>
<com.mints.goodmoney.ui.widgets.ClearEditText
android:id=
"@+id/etLoginMobile"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"20dp"
android:background=
"@drawable/shape_vip_adapter"
android:gravity=
"center"
android:hint=
"请输入手机号"
android:inputType=
"number"
android:maxLength=
"11"
android:maxLines=
"1"
android:paddingStart=
"10dp"
android:paddingEnd=
"10dp"
android:textColor=
"@color/color_172B54"
android:textColorHint=
"@color/color_BEC2CC"
android:textSize=
"12sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"仅限未注册过京东金融的用户"
android:textColor=
"@color/gray"
/>
<Button
android:id=
"@+id/btnBindMobile"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"20dp"
android:background=
"@drawable/shape_tv_gold"
android:gravity=
"center"
android:text=
"绑定手机号"
android:textColor=
"@color/white"
android:textSize=
"14sp"
/>
</LinearLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_draw_jd.png
View replaced file @
a2108684
View file @
001458fb
3.65 KB
|
W:
|
H:
7.64 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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