Commit dcf53e4f79eb49b7fb34dd9213530b693d1c06da
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer
Showing
8 changed files
with
103 additions
and
6 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/api/LoginRegisterApi.java
1 | 1 | package com.shunzhi.parent.api; |
2 | 2 | |
3 | 3 | import com.google.gson.JsonObject; |
4 | +import com.shunzhi.parent.bean.CurrentBean; | |
4 | 5 | |
5 | 6 | import io.reactivex.Observable; |
6 | 7 | import retrofit2.http.Field; |
7 | 8 | import retrofit2.http.FormUrlEncoded; |
8 | 9 | import retrofit2.http.GET; |
9 | 10 | import retrofit2.http.POST; |
11 | +import retrofit2.http.Query; | |
10 | 12 | |
11 | 13 | /** |
12 | 14 | * Created by Administrator on 2018/3/7 0007. |
... | ... | @@ -32,10 +34,10 @@ public interface LoginRegisterApi { |
32 | 34 | |
33 | 35 | @GET("api/Account/ChangePhoneCaptcha") |
34 | 36 | Observable<JsonObject> getidCodeResult( |
35 | - @Field("mobile") String username); | |
37 | + @Query("mobile") String username); | |
36 | 38 | |
37 | 39 | @FormUrlEncoded |
38 | - @POST("api/Account/CurrentInfo") | |
39 | - Observable<JsonObject> getUserInfo(@Field("grant_type") String grant_type); | |
40 | + @POST("/api/ParentHelper/GetParentInfo") | |
41 | + Observable<CurrentBean> getUserInfo(); | |
40 | 42 | |
41 | 43 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/bean/CurrentBean.java
0 → 100644
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
... | ... | @@ -4,6 +4,7 @@ import com.google.gson.JsonObject; |
4 | 4 | import com.share.mvpsdk.base.BasePresenter; |
5 | 5 | import com.share.mvpsdk.base.IBaseFragment; |
6 | 6 | import com.share.mvpsdk.base.IBaseModel; |
7 | +import com.shunzhi.parent.bean.CurrentBean; | |
7 | 8 | |
8 | 9 | import io.reactivex.Observable; |
9 | 10 | |
... | ... | @@ -31,7 +32,7 @@ public interface LoginAndRegisterContract { |
31 | 32 | Observable<JsonObject> getidCodeResult(String phoneNumber); |
32 | 33 | |
33 | 34 | //获取登录用户信息 |
34 | -// Observable<CurrentBean> getUserInfo(); | |
35 | + Observable<CurrentBean> getUserInfo(); | |
35 | 36 | } |
36 | 37 | interface ILoginView extends IBaseFragment { |
37 | 38 | ... | ... |
app/src/main/java/com/shunzhi/parent/model/loginandregister/LoginAndRegisterModel.java
... | ... | @@ -5,6 +5,7 @@ import com.share.mvpsdk.base.BaseModel; |
5 | 5 | import com.share.mvpsdk.helper.RetrofitCreateHelper; |
6 | 6 | import com.share.mvpsdk.helper.RxHelper; |
7 | 7 | import com.shunzhi.parent.api.LoginRegisterApi; |
8 | +import com.shunzhi.parent.bean.CurrentBean; | |
8 | 9 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
9 | 10 | |
10 | 11 | import io.reactivex.Observable; |
... | ... | @@ -40,4 +41,10 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste |
40 | 41 | .compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
41 | 42 | } |
42 | 43 | |
44 | + @Override | |
45 | + public Observable<CurrentBean> getUserInfo() { | |
46 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getUserInfo() | |
47 | + .compose(RxHelper.<CurrentBean>rxSchedulerHelper()); | |
48 | + } | |
49 | + | |
43 | 50 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
... | ... | @@ -105,7 +105,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre |
105 | 105 | @Override |
106 | 106 | public void accept(JsonObject jsonObject) throws Exception { |
107 | 107 | //TODO 获取验证码返回 |
108 | - Log.e("111", jsonObject.toString()); | |
108 | + ToastUtils.showToast("已发送短信,请注意查收"); | |
109 | 109 | } |
110 | 110 | }, new Consumer<Throwable>() { |
111 | 111 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
... | ... | @@ -158,14 +158,18 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist |
158 | 158 | if (loginAndRegister.getText().toString().trim().equals("登录")) { |
159 | 159 | if (!TextUtils.isEmpty(phoneNumber.getText().toString()) && !TextUtils.isEmpty(password.getText().toString())) { |
160 | 160 | loginAndRegister.setEnabled(true); |
161 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn); | |
161 | 162 | } else { |
162 | 163 | loginAndRegister.setEnabled(false); |
164 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn_unclick); | |
163 | 165 | } |
164 | 166 | } else if (loginAndRegister.getText().toString().trim().equals("注册")) { |
165 | 167 | if (!TextUtils.isEmpty(phoneNumber.getText().toString()) && !TextUtils.isEmpty(idCode.getText().toString()) && !TextUtils.isEmpty(password.getText().toString())) { |
166 | 168 | loginAndRegister.setEnabled(true); |
169 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn); | |
167 | 170 | } else { |
168 | 171 | loginAndRegister.setEnabled(false); |
172 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn_unclick); | |
169 | 173 | } |
170 | 174 | } |
171 | 175 | } | ... | ... |
... | ... | @@ -0,0 +1,6 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + <stroke android:color="#00000000" android:width="1dp"/> | |
4 | + <solid android:color="#D2D2D2" /> | |
5 | + <corners android:radius="5dp"/> | |
6 | +</shape> | |
0 | 7 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/fragment_login_and_regist.xml
... | ... | @@ -137,13 +137,52 @@ |
137 | 137 | android:background="@color/bottomline" /> |
138 | 138 | |
139 | 139 | </LinearLayout> |
140 | + <LinearLayout | |
141 | + android:id="@+id/passwordLayout_new" | |
142 | + android:layout_width="match_parent" | |
143 | + android:layout_height="wrap_content" | |
144 | + android:visibility="gone" | |
145 | + android:orientation="vertical"> | |
146 | + | |
147 | + <LinearLayout | |
148 | + android:layout_width="match_parent" | |
149 | + android:layout_height="wrap_content"> | |
150 | + | |
151 | + <EditText | |
152 | + android:id="@+id/et_password_new" | |
153 | + android:layout_width="wrap_content" | |
154 | + android:layout_height="50dp" | |
155 | + android:layout_weight="1" | |
156 | + android:background="@null" | |
157 | + android:hint="请设置密码:6~16个字符" | |
158 | + android:maxLength="16" | |
159 | + android:inputType="textPassword" | |
160 | + android:textColorHint="@color/hintTextColor" | |
161 | + android:textSize="@dimen/sp_16" /> | |
162 | + | |
163 | + <ImageView | |
164 | + android:id="@+id/img_eye_new" | |
165 | + android:layout_width="wrap_content" | |
166 | + android:layout_height="match_parent" | |
167 | + android:layout_gravity="center" | |
168 | + android:layout_marginRight="10dp" | |
169 | + android:src="@drawable/eye_close" /> | |
170 | + | |
171 | + </LinearLayout> | |
172 | + | |
173 | + <TextView | |
174 | + android:layout_width="match_parent" | |
175 | + android:layout_height="1dp" | |
176 | + android:background="@color/bottomline" /> | |
177 | + | |
178 | + </LinearLayout> | |
140 | 179 | |
141 | 180 | <TextView |
142 | 181 | android:id="@+id/loginAndRegister" |
143 | 182 | android:layout_width="match_parent" |
144 | 183 | android:layout_height="wrap_content" |
145 | 184 | android:layout_marginTop="40dp" |
146 | - android:background="@drawable/rudiobtn" | |
185 | + android:background="@drawable/rudiobtn_unclick" | |
147 | 186 | android:gravity="center" |
148 | 187 | android:paddingBottom="10dp" |
149 | 188 | android:paddingTop="10dp" |
... | ... | @@ -153,10 +192,12 @@ |
153 | 192 | android:textSize="@dimen/sp_16" /> |
154 | 193 | |
155 | 194 | <LinearLayout |
195 | + android:id="@+id/zhuce" | |
156 | 196 | android:layout_width="match_parent" |
157 | 197 | android:layout_height="wrap_content" |
158 | 198 | android:layout_marginTop="30dp" |
159 | 199 | android:gravity="center" |
200 | + android:visibility="gone" | |
160 | 201 | android:orientation="horizontal"> |
161 | 202 | |
162 | 203 | <TextView |
... | ... | @@ -177,6 +218,31 @@ |
177 | 218 | android:textSize="@dimen/sp_16" /> |
178 | 219 | |
179 | 220 | </LinearLayout> |
221 | + <LinearLayout | |
222 | + android:id="@+id/denglu" | |
223 | + android:layout_width="match_parent" | |
224 | + android:layout_height="wrap_content" | |
225 | + android:layout_marginTop="30dp" | |
226 | + android:orientation="horizontal"> | |
227 | + | |
228 | + <TextView | |
229 | + android:id="@+id/tv_info_login" | |
230 | + android:layout_width="wrap_content" | |
231 | + android:layout_height="wrap_content" | |
232 | + android:text="还没有账号,快速" | |
233 | + android:textColor="@color/hintTextColor" | |
234 | + android:textSize="@dimen/sp_16" /> | |
235 | + | |
236 | + <TextView | |
237 | + android:id="@+id/tv_goto_login" | |
238 | + android:layout_width="wrap_content" | |
239 | + android:layout_height="wrap_content" | |
240 | + android:text="注册" | |
241 | + android:textColor="#acc9fc" | |
242 | + android:textSize="@dimen/sp_16" /> | |
243 | + | |
244 | + | |
245 | + </LinearLayout> | |
180 | 246 | |
181 | 247 | |
182 | 248 | </LinearLayout> | ... | ... |