Commit 23d224b4 by 刘鹏

feat : user模块代码提交

parent eae736e4
...@@ -17,6 +17,13 @@ modular { ...@@ -17,6 +17,13 @@ modular {
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()] version = rootProject.ext.ydlPublishVersion[childProject.getName()]
} }
medical{
groupId = "com.ydl"
artifactId = "m-user-module-medical"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
} }
api { api {
......
...@@ -35,8 +35,8 @@ class LoginApiRequestUtil { ...@@ -35,8 +35,8 @@ class LoginApiRequestUtil {
/** /**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定 * 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/ */
fun checkPhoneStatus(phone: String, countryCode: String?): Observable<BaseResponse<ChcekPhoneResponeBean>> { fun checkPhoneStatus(phone: String, countryCode: String?,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return getUserApi().checkPhoneStatus(phone, countryCode!!) return getUserApi().checkPhoneStatus(phone, countryCode!!,gatewayUrl)
} }
/** /**
...@@ -78,8 +78,8 @@ class LoginApiRequestUtil { ...@@ -78,8 +78,8 @@ class LoginApiRequestUtil {
/** /**
* 发送登录验证码 * 发送登录验证码
*/ */
fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>> { fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>> {
return getUserApi().sendLoginMsgCode(phone, countryCode) return getUserApi().sendLoginMsgCode(phone, countryCode,gatewayUrl)
} }
/** /**
......
package com.yidianling.user.http package com.yidianling.user.http
import com.google.gson.internal.LinkedTreeMap import com.google.gson.internal.LinkedTreeMap
import com.ydl.ydlcommon.base.config.* import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_LOGIN_BASE_URL
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
...@@ -26,9 +29,9 @@ interface UserApi { ...@@ -26,9 +29,9 @@ interface UserApi {
fun login(@FieldMap params: Map<String, String>): Observable<BaseResponse<UserResponseBean>> fun login(@FieldMap params: Map<String, String>): Observable<BaseResponse<UserResponseBean>>
//国家列表 //国家列表
@FormUrlEncoded @GET("ydl-yiliao-api/api/client/login/v1/get_country_code_list")
@POST("user/country-list") @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun countryList(@Field(YDLConstants.HOLDER_PARAM ) params: String): Observable<BaseResponse<CountryResponse>> fun countryList(@Query("gatewayUrl") gatewayUrl: String): Observable<BaseResponse<List<CountryResponse>>>
//判断手机号是否存在 //判断手机号是否存在
@FormUrlEncoded @FormUrlEncoded
...@@ -57,11 +60,10 @@ interface UserApi { ...@@ -57,11 +60,10 @@ interface UserApi {
//设置推送的channelId //设置推送的channelId
@POST("user/device/modify") @POST("user/device/modify")
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun setChannelId(@Body body: RequestBody): Observable<BaseResponse<LinkedTreeMap<String, String>>> fun setChannelId(@Body body: RequestBody): Observable<BaseResponse<LinkedTreeMap<String, String>>>
//设置用户信息 //设置用户信息
@FormUrlEncoded @FormUrlEncoded
@POST("user/set-info") @POST("user/set-info")
...@@ -94,7 +96,7 @@ interface UserApi { ...@@ -94,7 +96,7 @@ interface UserApi {
//登出 //登出
@FormUrlEncoded @FormUrlEncoded
@POST("user/logout") @POST("ydl-yiliao-api/api/client/login/v1/logout")
fun logout(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>> fun logout(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>>
//更换手机时密码验证 //更换手机时密码验证
...@@ -109,11 +111,10 @@ interface UserApi { ...@@ -109,11 +111,10 @@ interface UserApi {
//同意隐私政策接口 //同意隐私政策接口
@GET("user/agreePrivacyAgreement") @GET("user/agreePrivacyAgreement")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun privacyAgree(@Query("uid") uid: String): Observable<BaseResponse<Any>> fun privacyAgree(@Query("uid") uid: String): Observable<BaseResponse<Any>>
//服务端校验阿里一键认证 //服务端校验阿里一键认证
@POST("phone/verification/init") @POST("phone/verification/init")
fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>> fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>>
...@@ -130,101 +131,116 @@ interface UserApi { ...@@ -130,101 +131,116 @@ interface UserApi {
//上传用户信息数据接口 //上传用户信息数据接口
@POST("user/collect/submit") @POST("user/collect/submit")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun uploadUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<Any>> fun uploadUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//获取关注问题数据接口 //获取关注问题数据接口
@GET("cate/list-parentId") @GET("cate/list-parentId")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>> fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
//获取新用户引导页面url //获取新用户引导页面url
@FormUrlEncoded @FormUrlEncoded
@POST("user/getNewUserJumpUrl") @POST("user/getNewUserJumpUrl")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserJumpUrl(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<String>> //获取新用户引导页面url fun getNewUserJumpUrl(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<String>> //获取新用户引导页面url
//第三方登录获取用户信息 //第三方登录获取用户信息
@POST("login/v2/login_wechat_qq") @POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun thirdPartJavaLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>> fun thirdPartJavaLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 绑定手机号 * 绑定手机号
*/ */
@POST("login/v2/bind_phone") @POST("login/v2/bind_phone")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun bindPhone(@Body body: RequestBody): Observable<BaseResponse<Any>> fun bindPhone(@Body body: RequestBody): Observable<BaseResponse<Any>>
/** /**
* 一键登录和本机号码校验 * 一键登录和本机号码校验
*/ */
@POST("login/v2/login_direct") @POST("login/v2/login_direct")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun autoLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>> fun autoLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 密码登录 * 密码登录
*/ */
@POST("login/v2/login_pwd") @POST("ydl-yiliao-api/api/client/login/v1/login_pwd")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun loginByPassword(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>> fun loginByPassword(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 验证码登录 * 验证码登录
*/ */
@POST("login/v2/login_sms") @POST("ydl-yiliao-api/api/client/login/v1/login_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun loginByMsgCode(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>> fun loginByMsgCode(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 第三方登录 * 第三方登录
*/ */
@POST("login/v2/login_wechat_qq") @POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun thirdPartyLogin(@Body body: RequestBody): Observable<BaseAPIResponse<UserResponseBean>> fun thirdPartyLogin(@Body body: RequestBody): Observable<BaseAPIResponse<UserResponseBean>>
/** /**
* 检查手机号来源 * 检查手机号来源
*/ */
@GET("login/v2/phone_detection") @GET("ydl-yiliao-api/api/client/login/v1/phone_detection")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun checkPhoneStatus(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>> fun checkPhoneStatus(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("gatewayUrl") gatewayUrl: String
): Observable<BaseResponse<ChcekPhoneResponeBean>>
/** /**
* 验证重置密码的短信验证码 * 验证重置密码的短信验证码
*/ */
@GET("login/v2/pre_check_reset_sms") @GET("login/v2/pre_check_reset_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun checkResetCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String, @Query("code") code: String): Observable<BaseResponse<Any>> fun checkResetCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("code") code: String
): Observable<BaseResponse<Any>>
/** /**
* 重置密码 * 重置密码
*/ */
@POST("login/v2/reset_pwd") @POST("login/v2/reset_pwd")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun resetPwd(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>> fun resetPwd(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 发送登录验证码 * 发送登录验证码
*/ */
@GET("login/v2/send_login_sms") @GET("ydl-yiliao-api/api/client/login/v1/send_login_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun sendLoginMsgCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<Any>> fun sendLoginMsgCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("gatewayUrl") gatewayUrl: String
): Observable<BaseResponse<Any>>
/** /**
* 发送忘记密码重置密码的验证码 * 发送忘记密码重置密码的验证码
*/ */
@GET("login/v2/send_reset_sms") @GET("login/v2/send_reset_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun sendResetCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<Any>> fun sendResetCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String
): Observable<BaseResponse<Any>>
/** /**
* 第三方登录解绑 * 第三方登录解绑
*/ */
@POST("login/v2/unbind_wechat_qq") @POST("login/v2/unbind_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>> fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>>
/** /**
...@@ -232,13 +248,13 @@ interface UserApi { ...@@ -232,13 +248,13 @@ interface UserApi {
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("user/forbid_login") @POST("user/forbid_login")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>> fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
/** /**
* 是否需要强绑定手机号 * 是否需要强绑定手机号
*/ */
@POST("login/v2/is_need_strong_bind") @POST("login/v2/is_need_strong_bind")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT) @Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun isNeedForceBindPhone(@Body map: Map<String,String>): Observable<BaseAPIResponse<Boolean>> fun isNeedForceBindPhone(@Body map: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
} }
\ No newline at end of file
...@@ -28,7 +28,7 @@ interface UserHttp { ...@@ -28,7 +28,7 @@ interface UserHttp {
fun login(param: LoginParam): Observable<BaseResponse<UserResponseBean>> fun login(param: LoginParam): Observable<BaseResponse<UserResponseBean>>
fun countryList(): Observable<BaseResponse<CountryResponse>> fun countryList(gatewayUrl:String): Observable<BaseResponse<List<CountryResponse>>>
fun phoneExist(param: ExistParam): Observable<BaseResponse<ExistResponse>> fun phoneExist(param: ExistParam): Observable<BaseResponse<ExistResponse>>
......
...@@ -66,8 +66,8 @@ class UserHttpImpl private constructor() : UserHttp { ...@@ -66,8 +66,8 @@ class UserHttpImpl private constructor() : UserHttp {
.flatMap { getUserApi().login(it) } .flatMap { getUserApi().login(it) }
} }
override fun countryList(): Observable<BaseResponse<CountryResponse>> { override fun countryList(gatewayUrl:String): Observable<BaseResponse<List<CountryResponse>>> {
return getUserApi().countryList("") return getUserApi().countryList(gatewayUrl)
.compose(RxUtils.netCheck()) .compose(RxUtils.netCheck())
} }
......
...@@ -11,5 +11,6 @@ data class PhoneLoginPwdParam( ...@@ -11,5 +11,6 @@ data class PhoneLoginPwdParam(
var password: String,//密码 var password: String,//密码
var countryCode: String,//手机区号 var countryCode: String,//手机区号
var phoneNumber: String,//手机号 var phoneNumber: String,//手机号
var gatewayUrl: String="",//网关
var type: Int = 2 //Android 端 var type: Int = 2 //Android 端
) )
\ No newline at end of file
...@@ -5,9 +5,7 @@ package com.yidianling.user.http.response ...@@ -5,9 +5,7 @@ package com.yidianling.user.http.response
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/02/03 * time : 2018/02/03
*/ */
data class CountryResponse(val countryList: List<Country>) { data class CountryResponse(val countryCode: String,
data class Country(val code: String,
val en_name: String, val en_name: String,
val name: String) val country: String,
} val prefix: String)
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA; ...@@ -13,6 +13,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity; import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.http.ThrowableConsumer; import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager; import com.ydl.ydlcommon.modular.ModularServiceManager;
...@@ -122,7 +123,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick ...@@ -122,7 +123,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
return; return;
} }
showProgressDialog(); showProgressDialog();
LoginApiRequestUtil.Companion.checkPhoneStatus(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code()) LoginApiRequestUtil.Companion.checkPhoneStatus(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code(), HttpConfig.Companion.getGET_GATEWAY_BASE_URL())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> { .subscribe(response -> {
......
...@@ -11,7 +11,9 @@ import android.widget.BaseAdapter; ...@@ -11,7 +11,9 @@ import android.widget.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.http.RxUtils; import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer; import com.ydl.ydlcommon.data.http.ThrowableConsumer;
...@@ -20,14 +22,16 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper; ...@@ -20,14 +22,16 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.user.R; import com.yidianling.user.R;
import com.yidianling.user.http.UserHttp; import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl; import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.response.CountryResponse.Country; import com.yidianling.user.http.response.CountryResponse;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/** /**
* 选择国家和地区 * 选择国家和地区
...@@ -39,7 +43,7 @@ public class CountryListActivity extends BaseActivity { ...@@ -39,7 +43,7 @@ public class CountryListActivity extends BaseActivity {
String userCountryCode; String userCountryCode;
private CountryAdapter mAdapter; private CountryAdapter mAdapter;
private List<Country> list = new ArrayList<>(); private List<CountryResponse> list = new ArrayList<>();
@Override @Override
protected int layoutResId() { protected int layoutResId() {
...@@ -77,12 +81,12 @@ public class CountryListActivity extends BaseActivity { ...@@ -77,12 +81,12 @@ public class CountryListActivity extends BaseActivity {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
public void getData() { public void getData() {
UserHttp userHttp = UserHttpImpl.Companion.getInstance(); UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.countryList() userHttp.countryList(HttpConfig.Companion.getGET_GATEWAY_BASE_URL())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(countryResponse -> { .subscribe(countryResponse -> {
list.addAll(countryResponse.getCountryList()); list.addAll(countryResponse);
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
}, new ThrowableConsumer() { }, new ThrowableConsumer() {
@Override @Override
...@@ -95,11 +99,11 @@ public class CountryListActivity extends BaseActivity { ...@@ -95,11 +99,11 @@ public class CountryListActivity extends BaseActivity {
public class CountryAdapter extends BaseAdapter { public class CountryAdapter extends BaseAdapter {
private List<Country> list; private List<CountryResponse> list;
private Context context; private Context context;
private String userCountryCode; private String userCountryCode;
public CountryAdapter(List<Country> list, Context context, String userCountryCode) { public CountryAdapter(List<CountryResponse> list, Context context, String userCountryCode) {
this.list = list; this.list = list;
this.context = context; this.context = context;
this.userCountryCode = userCountryCode; this.userCountryCode = userCountryCode;
...@@ -125,19 +129,19 @@ public class CountryListActivity extends BaseActivity { ...@@ -125,19 +129,19 @@ public class CountryListActivity extends BaseActivity {
View view = LayoutInflater.from(context).inflate(R.layout.user_item_country_phone_code, parent, false); View view = LayoutInflater.from(context).inflate(R.layout.user_item_country_phone_code, parent, false);
TextView nameTv = view.findViewById(R.id.tv_name); TextView nameTv = view.findViewById(R.id.tv_name);
TextView codeTv = view.findViewById(R.id.tv_code); TextView codeTv = view.findViewById(R.id.tv_code);
final Country c = list.get(position); final CountryResponse c = list.get(position);
nameTv.setText(c.getName()); nameTv.setText(c.getCountry());
codeTv.setText("+" + c.getCode().replace("00", "")); codeTv.setText("+" + c.getPrefix());
if (c.getCode().equals(userCountryCode)) { if (c.getCountryCode().equals(userCountryCode)) {
nameTv.setTextColor(Color.parseColor("#1DA1F2")); nameTv.setTextColor(Color.parseColor("#1DA1F2"));
codeTv.setTextColor(Color.parseColor("#1DA1F2")); codeTv.setTextColor(Color.parseColor("#1DA1F2"));
} }
view.setOnClickListener(v -> { view.setOnClickListener(v -> {
Intent i = new Intent(); Intent i = new Intent();
i.putExtra("code", c.getCode()); i.putExtra("code", c.getCountryCode());
i.putExtra("name", c.getName()); i.putExtra("name", c.getCountry());
i.putExtra("en_name", c.getEn_name()); i.putExtra("en_name", c.getEn_name());
setResult(45, i); setResult(45, i);
overridePendingTransition(0, R.anim.platform_slide_out_to_bottom); overridePendingTransition(0, R.anim.platform_slide_out_to_bottom);
......
...@@ -10,6 +10,8 @@ import android.text.TextUtils ...@@ -10,6 +10,8 @@ import android.text.TextUtils
import android.text.TextWatcher import android.text.TextWatcher
import android.view.View import android.view.View
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.GET_GATEWAY_BASE_URL
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
...@@ -173,7 +175,7 @@ class BindPhoneActivity : BaseActivity() { ...@@ -173,7 +175,7 @@ class BindPhoneActivity : BaseActivity() {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private fun checkPhoneStatus() { private fun checkPhoneStatus() {
val phone = et_phone_number.text.toString().replace(" ", "") val phone = et_phone_number.text.toString().replace(" ", "")
LoginApiRequestUtil.checkPhoneStatus(phone, countryCode) LoginApiRequestUtil.checkPhoneStatus(phone, countryCode, GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
...@@ -196,7 +198,7 @@ class BindPhoneActivity : BaseActivity() { ...@@ -196,7 +198,7 @@ class BindPhoneActivity : BaseActivity() {
*/ */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private fun getBindPhoneCode(phone: String) { private fun getBindPhoneCode(phone: String) {
LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode) LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode, HttpConfig.Companion.GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { showProgressDialog() } .doOnSubscribe { showProgressDialog() }
......
...@@ -15,6 +15,7 @@ import com.alibaba.android.arouter.facade.annotation.Route ...@@ -15,6 +15,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.meituan.android.walle.WalleChannelReader import com.meituan.android.walle.WalleChannelReader
import com.umeng.socialize.UMShareAPI import com.umeng.socialize.UMShareAPI
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformRamImpl import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
...@@ -255,7 +256,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -255,7 +256,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (checkPhone()) { if (checkPhone()) {
LogUtil.e("进入checkPhone()") LogUtil.e("进入checkPhone()")
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, false) mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, false,
HttpConfig.Companion.GET_GATEWAY_BASE_URL
)
} else { } else {
} }
......
...@@ -62,7 +62,7 @@ interface ILoginContract { ...@@ -62,7 +62,7 @@ interface ILoginContract {
/** /**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定 * 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/ */
fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean) fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean,gatewayUrl :String)
} }
interface Model : IModel { interface Model : IModel {
...@@ -70,7 +70,7 @@ interface ILoginContract { ...@@ -70,7 +70,7 @@ interface ILoginContract {
/** /**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定 * 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/ */
fun checkPhoneStatus(phone: String, countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>> fun checkPhoneStatus(phone: String, countryCode: String,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>>
} }
} }
...@@ -93,7 +93,7 @@ interface IVerificationCodeContract { ...@@ -93,7 +93,7 @@ interface IVerificationCodeContract {
/** /**
* 发送登录验证码 * 发送登录验证码
*/ */
fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>> fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>>
/** /**
* 验证码验证码登录 * 验证码验证码登录
......
...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.model ...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.model
import android.app.Activity import android.app.Activity
import com.umeng.socialize.bean.SHARE_MEDIA import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_LOGIN_BASE_URL
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.http.LoginApiRequestUtil import com.yidianling.user.http.LoginApiRequestUtil
...@@ -28,8 +29,8 @@ class LoginModelImpl : ILoginContract.Model { ...@@ -28,8 +29,8 @@ class LoginModelImpl : ILoginContract.Model {
/** /**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定 * 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/ */
override fun checkPhoneStatus(phone: String, countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>> { override fun checkPhoneStatus(phone: String, countryCode: String,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return LoginApiRequestUtil.checkPhoneStatus(phone, countryCode) return LoginApiRequestUtil.checkPhoneStatus(phone, countryCode,gatewayUrl)
} }
} }
\ No newline at end of file
...@@ -49,8 +49,8 @@ class VerificationCodeModelImpl : IVerificationCodeContract.Model { ...@@ -49,8 +49,8 @@ class VerificationCodeModelImpl : IVerificationCodeContract.Model {
/** /**
* 发送登录验证码 * 发送登录验证码
*/ */
override fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>> { override fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>> {
return LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode) return LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode,gatewayUrl)
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter ...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.text.TextUtils import android.text.TextUtils
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StringUtils import com.ydl.ydlcommon.utils.StringUtils
...@@ -89,7 +90,7 @@ class InputPassWordPresenterImpl : ...@@ -89,7 +90,7 @@ class InputPassWordPresenterImpl :
phoneCountryCode: String phoneCountryCode: String
) { ) {
var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone) var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone,HttpConfig.Companion.GET_GATEWAY_BASE_URL)
mModel.userLoginByPassword(param) mModel.userLoginByPassword(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -49,15 +49,19 @@ class LoginPresenterImpl(view: ILoginContract.View) : ...@@ -49,15 +49,19 @@ class LoginPresenterImpl(view: ILoginContract.View) :
} }
/** /**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定 * 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*@param isBind 是否是第三方登录成功后的绑定操作 *@param isBind 是否是第三方登录成功后的绑定操作
*/ */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean) { override fun checkPhoneStatus(
phone: String,
countryCode: String,
isBind: Boolean,
gatewayUrl: String
) {
mView.showLoading(true) mView.showLoading(true)
mModel.checkPhoneStatus(phone, countryCode) mModel.checkPhoneStatus(phone, countryCode, gatewayUrl)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
......
...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter ...@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.text.TextUtils import android.text.TextUtils
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
...@@ -35,7 +36,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base ...@@ -35,7 +36,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
//发送登录验证码 //发送登录验证码
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun sendLoginCode(phone: String, phoneCountryCode: String) { override fun sendLoginCode(phone: String, phoneCountryCode: String) {
mModel.sendLoginMsgCode(phone, phoneCountryCode) mModel.sendLoginMsgCode(phone, phoneCountryCode,HttpConfig.Companion.GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { mView.showLoading(true) } .doOnSubscribe { mView.showLoading(true) }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/platform_main_gradient_start_color"
android:endColor="@color/platform_main_gradient_end_color"/>
</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">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/platform_main_gradient_start_color_un"
android:endColor="@color/platform_main_gradient_end_color_un"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
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