Commit 6e039dc5 by YKai

feat:强绑手机号页面提交

parent dddecd84
...@@ -35,7 +35,6 @@ import com.ydl.confide.home.ConfideHomeActivity ...@@ -35,7 +35,6 @@ import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils import com.yidianling.user.StatusUtils
import com.yidianling.user.ui.login.OneKeyLoginHelp import com.yidianling.user.ui.login.OneKeyLoginHelp
......
...@@ -136,7 +136,7 @@ ext { ...@@ -136,7 +136,7 @@ ext {
"cardview-v7" : "com.android.support:cardview-v7:${version["androidSupportSdkVersion"]}", "cardview-v7" : "com.android.support:cardview-v7:${version["androidSupportSdkVersion"]}",
"annotations" : "com.android.support:support-annotations:${version["androidSupportSdkVersion"]}", "annotations" : "com.android.support:support-annotations:${version["androidSupportSdkVersion"]}",
"recyclerview-v7" : "com.android.support:recyclerview-v7:${version["androidSupportSdkVersion"]}", "recyclerview-v7" : "com.android.support:recyclerview-v7:${version["androidSupportSdkVersion"]}",
"constraint-layout" : "com.android.support.constraint:constraint-layout:1.1.3", "constraint-layout" : "com.android.support.constraint:constraint-layout:2.0.4",
//network //network
"retrofit" : "com.squareup.retrofit2:retrofit:${version["retrofitSdkVersion"]}", "retrofit" : "com.squareup.retrofit2:retrofit:${version["retrofitSdkVersion"]}",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package="com.yidianling.user"> package="com.yidianling.user">
<application> <application>
<activity android:name=".ui.login.BindPhoneActivity"></activity>
<activity <activity
android:name=".ui.LoginActivity" android:name=".ui.LoginActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -52,7 +53,6 @@ ...@@ -52,7 +53,6 @@
android:name=".safePrivate.SetHandUnLockActivity" android:name=".safePrivate.SetHandUnLockActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name=".ui.login.RegisterAndLoginActivity" android:name=".ui.login.RegisterAndLoginActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -73,96 +73,93 @@ ...@@ -73,96 +73,93 @@
android:name=".wxapi.WXEntryActivity" android:name=".wxapi.WXEntryActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<activity <activity
android:name=".ui.login.SecretActivity" android:name=".ui.login.SecretActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.AboutUsActivity" android:name=".mine.AboutUsActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.AccountHistoryActivity" android:name=".mine.AccountHistoryActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.AccountSettingActivity" android:name=".mine.AccountSettingActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.ContactCustomerServiceActivity" android:name=".mine.ContactCustomerServiceActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.FeedBackActivity" android:name=".mine.FeedBackActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateUnspecified" /> android:windowSoftInputMode="adjustPan|stateUnspecified" />
<activity <activity
android:name="com.yidianling.user.mine.MyFeedBackActivity" android:name=".mine.MyFeedBackActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.FeedBackSuccessActivity" android:name=".mine.FeedBackSuccessActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.HelpActivity" android:name=".mine.HelpActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.NotificationsSettingActivity" android:name=".mine.NotificationsSettingActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.PersonalDesActivity" android:name=".mine.PersonalDesActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.PersonalInfoActivity" android:name=".mine.PersonalInfoActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.RechargeActivity" android:name=".mine.RechargeActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.SetInfoActivity" android:name=".mine.SetInfoActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.WithDrawActivity" android:name=".mine.WithDrawActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.WithDrawSuccessActivity" android:name=".mine.WithDrawSuccessActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.ChooseAccountActivity" android:name=".mine.ChooseAccountActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.EditAccountActivity" android:name=".mine.EditAccountActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.AddAccountActivity" android:name=".mine.AddAccountActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.RechargeResultActivity" android:name=".mine.RechargeResultActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.PwdCheckActivity" android:name=".mine.PwdCheckActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name="com.yidianling.user.mine.PhoneChangeActivity" android:name=".mine.PhoneChangeActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
...@@ -170,7 +167,6 @@ ...@@ -170,7 +167,6 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" android:theme="@style/platform_NoTitleTheme"
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize" />
<activity <activity
android:name=".mine.ReceiveRedPacketActivity" android:name=".mine.ReceiveRedPacketActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
...@@ -180,35 +176,27 @@ ...@@ -180,35 +176,27 @@
android:name=".ui.collect.CollectSexAndBirthActivity" android:name=".ui.collect.CollectSexAndBirthActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
<activity <activity
android:name=".ui.collect.CollectFocusActivity" android:name=".ui.collect.CollectFocusActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTop" /> android:launchMode="singleTop" /> <!-- 联通电信授权页 -->
<!--联通电信授权页-->
<activity <activity
android:name="com.mobile.auth.gatewayauth.LoginAuthActivity" android:name="com.mobile.auth.gatewayauth.LoginAuthActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/authsdk_activity_dialog" /> android:theme="@style/authsdk_activity_dialog" /> <!-- 协议页面webview -->
<!--协议页面webview-->
<activity <activity
android:name="com.mobile.auth.gatewayauth.activity.AuthWebVeiwActivity" android:name="com.mobile.auth.gatewayauth.activity.AuthWebVeiwActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="behind" /> android:screenOrientation="behind" /> <!-- 移动授权页 -->
<!--移动授权页-->
<activity <activity
android:name="com.cmic.sso.sdk.activity.LoginAuthActivity" android:name="com.cmic.sso.sdk.activity.LoginAuthActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false" android:exported="false"
android:launchMode="singleTop" /> android:launchMode="singleTop" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -106,7 +106,7 @@ class LoginApiRequestUtil { ...@@ -106,7 +106,7 @@ class LoginApiRequestUtil {
/** /**
* 一键登录 * 绑定手机号
*/ */
fun bindPhone(param: BindPhoneJavaParam): Observable<BaseResponse<Any>> { fun bindPhone(param: BindPhoneJavaParam): Observable<BaseResponse<Any>> {
var str = Gson().toJson(param) var str = Gson().toJson(param)
......
package com.yidianling.user.ui.login
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.support.v4.content.ContextCompat
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.R
import com.yidianling.user.UserHelper
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.BindPhoneJavaParam
import com.yidianling.user.ui.CountryListActivity
import com.yidianling.user.widget.ZDialog
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_bind_phone.*
import kotlinx.android.synthetic.main.user_activity_verification_code_new.*
import java.util.concurrent.TimeUnit
class BindPhoneActivity : BaseActivity() {
private val REQUEST_CODE_COUNTRY = 1001
private var countryCode: String = "0086"//国家或地区手机区号
private var msgCodeDispoable: Disposable? = null
private var mKeFuDialog: ZDialog? = null
companion object {
/**
* 启动BindPhoneActivity
*/
fun startActivity(context: Context) {
val intent = Intent(context, BindPhoneActivity::class.java)
context.startActivity(intent)
}
}
override fun layoutResId(): Int {
return R.layout.activity_bind_phone
}
override fun initDataAndEvent() {
setWindowStatusBarColor()
iv_back.setOnClickListener {
LoginUtils.logout()
finish()
}
tv_country_code.setOnClickListener {
val intent = Intent(this, CountryListActivity::class.java)
intent.putExtra("userCountryCode", countryCode)
startActivityForResult(intent, REQUEST_CODE_COUNTRY)
overridePendingTransition(R.anim.platform_slide_in_from_bottom, R.anim.user_slide_null)
}
// 删除按钮
iv_del.setOnClickListener {
et_phone_number.setText("")
}
// 获取验证码按钮
tv_get_code.setOnClickListener {
checkPhoneStatus()
}
// 收不到验证码
tv_no_get_code.setOnClickListener {
showKeFuDialog()
}
// 绑定手机号
tv_bind.setOnClickListener {
bindPhone()
}
et_phone_number.setListener {
if (TextUtils.isEmpty(it)) {
iv_del.visibility = View.INVISIBLE
iv_del.isEnabled = false
} else {
iv_del.visibility = View.VISIBLE
iv_del.isEnabled = true
}
// 判断绑定按钮状态
if ((tv_country_code.text == "+86") && it.toString().length == 13) {
setTvGetCodeStatus(true, 1f)
if (et_code.text.isNotEmpty()) {
setTvBindPhoneStatus(true, R.drawable.bg_one_click_login)
}
} else {
if ((tv_country_code.text == "+86")) {
setTvGetCodeStatus()
setTvBindPhoneStatus()
return@setListener
}
if (!tv_country_code.text?.equals("+86")!! && it.toString().isNotEmpty()) {
setTvGetCodeStatus(true, 1f)
if (et_code.text.isNotEmpty()) {
setTvBindPhoneStatus(true, R.drawable.bg_one_click_login)
}
} else {
setTvGetCodeStatus()
setTvBindPhoneStatus()
}
}
}
// 验证码输入监听
et_code.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
if (s?.length ?: 0 > 0 && et_phone_number.text.isNotEmpty()) {
setTvBindPhoneStatus(true, R.drawable.bg_one_click_login)
} else {
setTvBindPhoneStatus()
}
}
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
}
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
}
})
setTvGetCodeStatus()
}
/**
* 检查手机号是否是用户版号码、是否有设置密码、是否被绑定
*/
@SuppressLint("CheckResult")
private fun checkPhoneStatus() {
val phone = et_phone_number.text.toString().replace(" ", "")
LoginApiRequestUtil.checkPhoneStatus(phone, countryCode)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
if (it.data == null || it.code != 200) {
ToastUtil.toastShort(it.msg)
return@subscribe
}
// 获取验证码
getBindPhoneCode(phone)
}, {
if (null != it && !TextUtils.isEmpty(it.message)) {
YdlCommonOut.showToast(it.message!!)
}
})
}
/**
* 获取绑定手机验证码
* @param phone
*/
@SuppressLint("CheckResult")
private fun getBindPhoneCode(phone:String){
LoginApiRequestUtil.sendLoginMsgCode(phone,countryCode)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { showProgressDialog()}
.doAfterTerminate { dismissProgressDialog() }
.subscribe({
if (it.code == 200) {
startCountdown(60)
} else {
ToastUtil.toastShort(it.msg)
}
}, {
ToastUtil.toastShort(it.message)
})
}
/**
* 绑定手机号
* @param phone
* @param code
*/
@SuppressLint("CheckResult")
private fun bindPhone() {
val phone = et_phone_number.text.toString().replace(" ", "")
val code = et_code.text.toString()
val bindPhoneParams = BindPhoneJavaParam("", countryCode, phone, code, UserHelper.getUserInfo()!!.uid!!)
LoginApiRequestUtil.bindPhone(bindPhoneParams)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { showProgressDialog() }
.doAfterTerminate { dismissProgressDialog() }
.subscribe({
if (it.data != null && it.code == 200) {
ToastUtil.toastShort("手机号绑定成功")
UserHelper.getUserInfo()!!.userInfo!!.bind_phone = 1
UserHelper.getUserInfo()!!.userInfo!!.phone = phone
RxKeyboardTool.hideSoftInput(this)
LoginUtils.loginSuccessOperate(this)
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
}
}, {
ToastUtil.toastShort(it.message)
})
}
/**
* 开始倒计时
*/
@SuppressLint("SetTextI18n")
private fun startCountdown(remainTime: Int) {
et_code.postDelayed({RxKeyboardTool.showSoftInput(this,et_code)},300)
tv_get_code.isEnabled = false
msgCodeDispoable = Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation())
.take(remainTime.toLong())
.map {
(remainTime - it).toString()
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
tv_get_code.text = it + "s"
}, {
}, {
tv_get_code.isEnabled = true
tv_get_code.text = "重新发送"
})
}
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == 45 && requestCode == REQUEST_CODE_COUNTRY) {
countryCode = data?.getStringExtra("code") ?: "0086"
tv_country_code.text = "+${countryCode.replace("00", "")}"
}
}
/**
* 设置获取验证码按钮状态
* @param isEnabled 按钮是否可点击
* @param alpha 获取验证码透明度
*/
private fun setTvGetCodeStatus(isEnabled: Boolean = false, alpha: Float = 0.6f) {
tv_get_code.isEnabled = isEnabled
tv_get_code.alpha = alpha
}
/**
* 设置绑定按钮状态
* @param isEnabled 按钮是否可点击
* @param bg 绑定按钮背景图片
*/
private fun setTvBindPhoneStatus(
isEnabled: Boolean = false,
bg: Int = R.drawable.login_password_unable_bg_24dp
) {
tv_bind.isEnabled = isEnabled
tv_bind.background = ContextCompat.getDrawable(this, bg)
}
/**
* 设置状态栏
*/
private fun setWindowStatusBarColor() {
StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.white)
StatusBarUtils.Companion.setStatusBarLightMode(this, true)
}
private fun showKeFuDialog() {
if (mKeFuDialog == null) {
mKeFuDialog = ZDialog.Builder(this)
.setContentView(R.layout.user_kefu_tipdialog)
.setOnClickListener(R.id.cancel_dialog) {
mKeFuDialog?.dismiss()
mKeFuDialog = null
}
.setAnimation(0)//取消动画
.setOnClickListener(R.id.dial_right_now) {
mKeFuDialog?.dismiss()
mKeFuDialog = null
val dialIntent =
Intent(
Intent.ACTION_DIAL,
Uri.parse(String.format("tel:" + "400-765-1010"))
)
startActivity(dialIntent)
}
.show()
}
}
override fun onDestroy() {
super.onDestroy()
if (msgCodeDispoable != null) {
msgCodeDispoable!!.dispose()
}
}
}
\ No newline at end of file
## 新的登录注册
\ No newline at end of file
...@@ -538,22 +538,23 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -538,22 +538,23 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*三方登录成功 *三方登录成功
*/ */
override fun thirdLoginSuccess(userInfo: UserResponseBean.UserInfo) { override fun thirdLoginSuccess(userInfo: UserResponseBean.UserInfo) {
var bindPhone = userInfo.bind_phone if (userInfo.bind_phone != 1) {
if (bindPhone != 1) { // countryCode = userInfo.country_code
countryCode = userInfo.country_code // isBindPhone = true
isBindPhone = true // skip_bind.visibility = View.VISIBLE
skip_bind.visibility = View.VISIBLE //// tv_des.text = "首次绑定即送大礼包"
// tv_des.text = "首次绑定即送大礼包" //// tv_des.visibility = View.GONE
// tv_des.visibility = View.GONE // iv_select_protocol.visibility = View.GONE
iv_select_protocol.visibility = View.GONE //// tv_des_first.visibility = View.VISIBLE
// tv_des_first.visibility = View.VISIBLE // bind_phone_hint.visibility = View.VISIBLE
bind_phone_hint.visibility = View.VISIBLE // login_wechat.visibility = View.GONE
login_wechat.visibility = View.GONE // login_qq.visibility = View.GONE
login_qq.visibility = View.GONE // tv_login_title.text = "绑定手机号"
tv_login_title.text = "绑定手机号" // tv_protocol.visibility = View.GONE
tv_protocol.visibility = View.GONE // other_login_style.visibility = View.GONE
other_login_style.visibility = View.GONE // country_code.text = "+86"
country_code.text = "+86" BindPhoneActivity.startActivity(this)
finish()
} else { } else {
when { when {
isFromGuide -> { isFromGuide -> {
......
...@@ -190,20 +190,15 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra ...@@ -190,20 +190,15 @@ class LoginPresenterImpl(view: ILoginContract.View) : BasePresenter<ILoginContra
ToastUtil.toastShort(it.msg) ToastUtil.toastShort(it.msg)
return@subscribe return@subscribe
} }
if (media == SHARE_MEDIA.QQ) { if (it.data.firstLogin==1){ // 第一次登录:是注册
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true StatusUtils.isFirstLogin = true
if (media==SHARE_MEDIA.QQ){
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_QQ_REGISTER_CLICK)
} else { }else{
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1)
}
} else {
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK) mView.baiduActionBury(it.data.uid,UserBIConstants.POSITION_WX_REGISTER_CLICK)
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1)
} }
}else{
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, it.data.uid!!,sign1)
} }
LoginUtils.onLogin(it.data) LoginUtils.onLogin(it.data)
mView.thirdLoginSuccess(it.data.userInfo!!) mView.thirdLoginSuccess(it.data.userInfo!!)
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.login.BindPhoneActivity"
tools:ignore="ResourceName">
<ImageView
android:id="@+id/iv_back"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="44dp"
android:padding="@dimen/platform_dp_10"
android:src="@drawable/user_ic_back_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_40"
android:layout_marginTop="@dimen/platform_dp_32"
android:text="绑定手机号"
android:textColor="@color/pay_color_242424"
android:textSize="22sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_back" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入您的常用手机号码"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<TextView
android:id="@+id/tv_country_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:drawableEnd="@drawable/user_triangle_down"
android:drawablePadding="@dimen/platform_dp_4"
android:text="+86"
android:textColor="@color/pay_color_666666"
android:textSize="17sp"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<com.ydl.ydlcommon.view.PhoneEditText
android:id="@+id/et_phone_number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical|left"
android:hint="输入手机号"
android:inputType="number"
android:lines="1"
android:maxLength="13"
android:textColor="@color/platform_color_242424"
android:textColorHint="@color/platform_color_BFBFBF"
android:textCursorDrawable="@null"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@id/tv_country_code"
app:layout_constraintEnd_toStartOf="@id/iv_del"
app:layout_constraintStart_toEndOf="@id/tv_country_code"
app:layout_constraintTop_toTopOf="@id/tv_country_code" />
<View
android:id="@+id/view_lin"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="@dimen/platform_dp_40"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_marginEnd="@dimen/platform_dp_40"
android:background="@color/platform_color_EBEBEB"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_country_code" />
<ImageView
android:id="@+id/iv_del"
android:layout_width="23dp"
android:layout_height="23dp"
android:layout_gravity="center_vertical"
android:paddingStart="@dimen/platform_dp_5"
android:paddingTop="@dimen/platform_dp_5"
android:paddingBottom="@dimen/platform_dp_5"
android:src="@drawable/user_ic_del_new"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/et_phone_number"
app:layout_constraintEnd_toEndOf="@id/view_lin"
app:layout_constraintTop_toTopOf="@id/et_phone_number" />
<EditText
android:id="@+id/et_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_36"
android:layout_marginEnd="@dimen/platform_dp_16"
android:background="@null"
android:hint="输入验证码"
android:inputType="number"
android:textColor="@color/platform_color_242424"
android:textColorHint="@color/platform_color_BFBFBF"
android:textSize="20sp"
app:layout_constraintEnd_toStartOf="@id/tv_get_code"
app:layout_constraintStart_toStartOf="@id/tv_country_code"
app:layout_constraintTop_toBottomOf="@id/view_lin" />
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_40"
android:alpha="0.6"
android:text="获取验证码"
android:textColor="@color/platform_color_1DA1F2"
app:layout_constraintEnd_toEndOf="@id/view_lin"
app:layout_constraintTop_toBottomOf="@id/view_lin" />
<View
android:id="@+id/v_line"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="@dimen/platform_dp_40"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_marginEnd="@dimen/platform_dp_40"
android:background="@color/platform_color_EBEBEB"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_code" />
<TextView
android:id="@+id/tv_no_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_15"
android:text="收不到验证码?"
android:textColor="@color/platform_color_666666"
app:layout_constraintEnd_toEndOf="@id/v_line"
app:layout_constraintTop_toBottomOf="@id/v_line" />
<TextView
android:id="@+id/tv_bind"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_38"
android:layout_marginTop="@dimen/platform_dp_38"
android:layout_marginEnd="@dimen/platform_dp_38"
android:background="@drawable/login_password_unable_bg_24dp"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_13"
android:paddingBottom="@dimen/platform_dp_13"
android:text="绑定"
android:textColor="@color/white"
android:textSize="17sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_no_get_code" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<string name="user_edittext_hint"></string> <string name="user_edittext_hint"></string>
<string name="redpacket_tips_title">红包说明</string> <string name="redpacket_tips_title">红包说明</string>
<string name="redpacket_tips_content1" >1.红包仅限于感谢使用,不能用于支付咨询费,无咨询售后保障</string> <string name="redpacket_tips_content1">1.红包仅限于感谢使用,不能用于支付咨询费,无咨询售后保障</string>
<string name="redpacket_tips_content2">2.红包一经发送且咨询师已收取,不支持退款</string> <string name="redpacket_tips_content2">2.红包一经发送且咨询师已收取,不支持退款</string>
<string name="redpacket_tips_content3">3.咨询师未确认收取红包会在24小时退回账户</string> <string name="redpacket_tips_content3">3.咨询师未确认收取红包会在24小时退回账户</string>
......
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