Commit 001458fb authored by jyx's avatar jyx

京东金融逻辑修改

parent a2108684
...@@ -16,6 +16,7 @@ public class DrawcashBean implements Serializable { ...@@ -16,6 +16,7 @@ public class DrawcashBean implements Serializable {
private List<CashOutMoneyArrBean> cashOutMoneyArr; private List<CashOutMoneyArrBean> cashOutMoneyArr;
private VedioRules vedioRules; private VedioRules vedioRules;
private boolean isJDNewUser; private boolean isJDNewUser;
private String JDUrl = null;
public String getJDUrl() { public String getJDUrl() {
return JDUrl; return JDUrl;
...@@ -25,8 +26,6 @@ public class DrawcashBean implements Serializable { ...@@ -25,8 +26,6 @@ public class DrawcashBean implements Serializable {
this.JDUrl = JDUrl; this.JDUrl = JDUrl;
} }
private String JDUrl;
public Boolean getIsJDNewUser() { public Boolean getIsJDNewUser() {
return isJDNewUser; return isJDNewUser;
} }
......
...@@ -5,6 +5,7 @@ import android.view.animation.AccelerateDecelerateInterpolator; ...@@ -5,6 +5,7 @@ import android.view.animation.AccelerateDecelerateInterpolator;
import com.daimajia.androidanimations.library.Techniques; import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo; import com.daimajia.androidanimations.library.YoYo;
import com.google.gson.JsonObject;
import com.mints.goodmoney.MintsApplication; import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo; import com.mints.goodmoney.common.DeviceInfo;
...@@ -154,7 +155,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -154,7 +155,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("oaid", MintsApplication.OAID); vo.put("oaid", MintsApplication.OAID);
} }
riskinfo(deviceInfo,getT()); riskinfo(deviceInfo, getT());
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.saveTerminalInfo(vo),
...@@ -232,6 +233,50 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -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;
}
}
});
}
/** /**
* 风控信息 * 风控信息
*/ */
......
...@@ -15,4 +15,8 @@ public interface DrawcashView extends BaseView { ...@@ -15,4 +15,8 @@ public interface DrawcashView extends BaseView {
void editUserMsgSuc(); void editUserMsgSuc();
void mergeAccount(String mobile, String wxOpenId, String key); void mergeAccount(String mobile, String wxOpenId, String key);
void checkJDNewUsersSuc(boolean isJdNewUser, String JDUrl);
void checkJDNewUsersFail();
} }
...@@ -477,6 +477,14 @@ public interface LoanService { ...@@ -477,6 +477,14 @@ public interface LoanService {
@POST("api/addCarrierTypeTime") @POST("api/addCarrierTypeTime")
Observable<BaseResponse<Object>> addCarrierTypeTime(@Body Map<String, Object> vo); Observable<BaseResponse<Object>> addCarrierTypeTime(@Body Map<String, Object> vo);
/**
* 检测是否京东金融新用户
*
* @return
*/
@POST("api/checkJDNewUsers")
Observable<BaseResponse<DrawcashBean>> checkJDNewUsers(@Body Map<String, Object> vo);
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -21,7 +21,9 @@ import com.mints.goodmoney.mvp.views.DrawcashView ...@@ -21,7 +21,9 @@ import com.mints.goodmoney.mvp.views.DrawcashView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.DrawcashAdapter import com.mints.goodmoney.ui.adapter.DrawcashAdapter
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener 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.DrawcashVideoDialog
import com.mints.goodmoney.ui.widgets.JDTintDialog
import com.mints.goodmoney.utils.LogUtil import com.mints.goodmoney.utils.LogUtil
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
...@@ -56,6 +58,7 @@ class DrawcashActivity : BaseActivity(), ...@@ -56,6 +58,7 @@ class DrawcashActivity : BaseActivity(),
private var isJDNewUser = false private var isJDNewUser = false
private var jumpJdUrl: String? = null private var jumpJdUrl: String? = null
private var jdTintDialog: JDTintDialog? = null
override fun getContentViewLayoutID() = R.layout.activity_drawcash override fun getContentViewLayoutID() = R.layout.activity_drawcash
...@@ -67,6 +70,8 @@ class DrawcashActivity : BaseActivity(), ...@@ -67,6 +70,8 @@ class DrawcashActivity : BaseActivity(),
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
tv_right_subtitle.visibility = View.VISIBLE tv_right_subtitle.visibility = View.VISIBLE
tv_right_subtitle.text = "提现记录" tv_right_subtitle.text = "提现记录"
tvDrawWechat.isChecked = true
rl_drawcash.setOnCheckedChangeListener(this)
view_title.text = "提现规则" view_title.text = "提现规则"
vedioAdingManager = VedioAdingManager.getInstance(this) vedioAdingManager = VedioAdingManager.getInstance(this)
...@@ -126,15 +131,15 @@ class DrawcashActivity : BaseActivity(), ...@@ -126,15 +131,15 @@ class DrawcashActivity : BaseActivity(),
R.id.tvDrawcashNext -> { R.id.tvDrawcashNext -> {
if (priceList != null && priceList!!.size > 0) { if (priceList != null && priceList!!.size > 0) {
// 跳转京东金融 // 跳转京东金融
if (isJDNewUser) { // if (isJDNewUser) {
jumpJdUrl?.let { // jumpJdUrl?.let {
val bundle = Bundle() // val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, "京东金融") // bundle.putString(WebActivity.WEB_TITLE, "京东金融")
bundle.putString(WebActivity.WEB_URL, jumpJdUrl) // bundle.putString(WebActivity.WEB_URL, jumpJdUrl)
readyGo(WebActivity::class.java, bundle) // readyGo(WebActivity::class.java, bundle)
return // return
} // }
} // }
// 校验当前金币< 选择金币 =提示 去做任务 // 校验当前金币< 选择金币 =提示 去做任务
if (userConfig?.coin!! < priceList!![drawcashAdapter.getPosition()].money * 10000) { if (userConfig?.coin!! < priceList!![drawcashAdapter.getPosition()].money * 10000) {
...@@ -191,14 +196,14 @@ class DrawcashActivity : BaseActivity(), ...@@ -191,14 +196,14 @@ class DrawcashActivity : BaseActivity(),
tvDrawcashName.setText(data.nickName) tvDrawcashName.setText(data.nickName)
} }
if (data.isJDNewUser) { // if (data.isJDNewUser) {
jumpJdUrl = data.jdUrl // jumpJdUrl = data.jdUrl
isJDNewUser = true // isJDNewUser = true
rl_drawcash.visibility = View.VISIBLE // rl_drawcash.visibility = View.VISIBLE
rl_drawcash.setOnCheckedChangeListener(this) // rl_drawcash.setOnCheckedChangeListener(this)
} else { // } else {
rl_drawcash.visibility = View.GONE // rl_drawcash.visibility = View.GONE
} // }
// 提现更改权重 // 提现更改权重
initAdWeight(data.vedioRules) initAdWeight(data.vedioRules)
...@@ -216,8 +221,6 @@ class DrawcashActivity : BaseActivity(), ...@@ -216,8 +221,6 @@ class DrawcashActivity : BaseActivity(),
if (isLoadRvItem) { if (isLoadRvItem) {
priceList = data.cashOutMoneyArr priceList = data.cashOutMoneyArr
initRvView() initRvView()
tvDrawJd.isChecked = true
} }
val allcoinBig = BigDecimal(data.coin.toString()) val allcoinBig = BigDecimal(data.coin.toString())
val rateBig = BigDecimal("10000") val rateBig = BigDecimal("10000")
...@@ -324,15 +327,59 @@ class DrawcashActivity : BaseActivity(), ...@@ -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) { override fun onCheckedChanged(group: RadioGroup?, checkedId: Int) {
if (group?.checkedRadioButtonId == R.id.tvDrawJd) { if (group?.checkedRadioButtonId == R.id.tvDrawJd) {
if (::drawcashAdapter.isInitialized) { jdTintDialog = JDTintDialog(this, object : DialogListener() {
drawcashAdapter.setIsAllUnEnable(true) 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 { } else {
if (::drawcashAdapter.isInitialized) { // if (::drawcashAdapter.isInitialized) {
drawcashAdapter.setIsAllUnEnable(false) // drawcashAdapter.setIsAllUnEnable(false)
} // }
} }
} }
} }
\ No newline at end of file
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
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<stroke <stroke
android:width="1dp" android:width="1dp"
android:color="@color/color_ccc" /> android:color="@color/color_ccc" />
<solid android:color="@color/color_FFDD0C" /> <solid android:color="@color/color_FF9837" />
<corners android:radius="10dp" /> <corners android:radius="10dp" />
</shape> </shape>
\ No newline at end of file
<?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
<?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
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_wechat_selected" android:state_checked="true" /> <item android:color="@color/white" android:state_checked="true" />
<item android:drawable="@drawable/shape_wechat_unselected" android:state_checked="false" /> <item android:color="@color/black" android:state_checked="false" />
</selector> </selector>
\ No newline at end of file
...@@ -108,8 +108,7 @@ ...@@ -108,8 +108,7 @@
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:orientation="horizontal" android:orientation="horizontal">
android:visibility="gone">
<RadioButton <RadioButton
android:id="@+id/tvDrawWechat" android:id="@+id/tvDrawWechat"
...@@ -118,14 +117,14 @@ ...@@ -118,14 +117,14 @@
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shape_wechat_selector" android:background="@drawable/shape_jd_selector"
android:button="@null" android:button="@null"
android:drawableStart="@mipmap/ic_draw_wx" android:drawableStart="@mipmap/ic_draw_wx"
android:drawablePadding="-30dp" android:drawablePadding="-30dp"
android:gravity="center" android:gravity="center"
android:paddingStart="30dp" android:paddingStart="30dp"
android:text="微信" android:text="微信"
android:textColor="@color/black" android:textColor="@drawable/text_color_jd_selector"
android:textSize="14sp" /> android:textSize="14sp" />
<RadioButton <RadioButton
...@@ -138,11 +137,11 @@ ...@@ -138,11 +137,11 @@
android:background="@drawable/shape_jd_selector" android:background="@drawable/shape_jd_selector"
android:button="@null" android:button="@null"
android:drawableStart="@mipmap/ic_draw_jd" android:drawableStart="@mipmap/ic_draw_jd"
android:drawablePadding="-30dp" android:drawablePadding="-20dp"
android:gravity="center" android:gravity="center"
android:paddingStart="30dp" android:paddingStart="30dp"
android:text="京东" android:text="京东金融"
android:textColor="@color/black" android:textColor="@drawable/text_color_jd_selector"
android:textSize="14sp" /> android:textSize="14sp" />
</RadioGroup> </RadioGroup>
......
<?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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment