Commit 26d17696350730d99f6cb292660e4606bd351c93
1 parent
de0d72ae
Exists in
yxb_dev
and in
2 other branches
no message
Showing
14 changed files
with
78 additions
and
57 deletions
 
Show diff stats
app/src/main/AndroidManifest.xml
| @@ -64,17 +64,17 @@ | @@ -64,17 +64,17 @@ | ||
| 64 | android:name="com.amap.api.v2.apikey" | 64 | android:name="com.amap.api.v2.apikey" | 
| 65 | android:value="1d130afb822d8a1019e6592cbaf10bcc" /> | 65 | android:value="1d130afb822d8a1019e6592cbaf10bcc" /> | 
| 66 | 66 | ||
| 67 | - <activity android:name=".ui.activity.LoginAndRegistActivity"> | 67 | + <activity android:name=".ui.MainActivity"> | 
| 68 | <intent-filter> | 68 | <intent-filter> | 
| 69 | <action android:name="android.intent.action.MAIN" /> | 69 | <action android:name="android.intent.action.MAIN" /> | 
| 70 | 70 | ||
| 71 | <category android:name="android.intent.category.LAUNCHER" /> | 71 | <category android:name="android.intent.category.LAUNCHER" /> | 
| 72 | </intent-filter> | 72 | </intent-filter> | 
| 73 | </activity> | 73 | </activity> | 
| 74 | - <activity | ||
| 75 | - android:name=".ui.MainActivity" | ||
| 76 | - android:screenOrientation="portrait" | ||
| 77 | - android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> | 74 | + <!--<activity--> | 
| 75 | + <!--android:name=".ui.MainActivity"--> | ||
| 76 | + <!--android:screenOrientation="portrait"--> | ||
| 77 | + <!--android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />--> | ||
| 78 | <activity | 78 | <activity | 
| 79 | android:name=".ui.activity.MyChildActivity" | 79 | android:name=".ui.activity.MyChildActivity" | 
| 80 | android:screenOrientation="portrait" /> | 80 | android:screenOrientation="portrait" /> | 
| @@ -94,9 +94,9 @@ | @@ -94,9 +94,9 @@ | ||
| 94 | android:name=".ui.activity.binding.SelectSchoolActivity" | 94 | android:name=".ui.activity.binding.SelectSchoolActivity" | 
| 95 | android:screenOrientation="portrait" | 95 | android:screenOrientation="portrait" | 
| 96 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 96 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 
| 97 | - <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" --> | ||
| 98 | - <!-- android:screenOrientation="portrait" --> | ||
| 99 | - <!-- /> --> | 97 | + <activity android:name=".ui.activity.LoginAndRegistActivity" | 
| 98 | + android:screenOrientation="portrait" | ||
| 99 | + /> | ||
| 100 | <activity | 100 | <activity | 
| 101 | android:name=".ui.activity.PersonInfoActivity" | 101 | android:name=".ui.activity.PersonInfoActivity" | 
| 102 | android:screenOrientation="portrait" | 102 | android:screenOrientation="portrait" | 
app/src/main/java/com/shunzhi/parent/AppConfig.java
| @@ -22,19 +22,19 @@ public class AppConfig { | @@ -22,19 +22,19 @@ public class AppConfig { | ||
| 22 | public static String USER_SEX = "user_sex"; | 22 | public static String USER_SEX = "user_sex"; | 
| 23 | public static String USER_IMAGE = "user_image"; | 23 | public static String USER_IMAGE = "user_image"; | 
| 24 | public static String PARENT_ID = "parent_id"; | 24 | public static String PARENT_ID = "parent_id"; | 
| 25 | + public static boolean ISLOGIN = false; | ||
| 25 | 26 | ||
| 26 | - public static int BINDING_SUCCESS_HEZUO = 1; | ||
| 27 | - public static int BINDING_SUCCESS_NOT= 2; | ||
| 28 | - public static int ORDER_CENTER = 3; | 27 | + public static int BINDING_SUCCESS_HEZUO = 1; | 
| 28 | + public static int BINDING_SUCCESS_NOT = 2; | ||
| 29 | + public static int ORDER_CENTER = 3; | ||
| 29 | 30 | ||
| 30 | - public static String USER_ID="user_id"; | ||
| 31 | - public static String APP_IS_START="app_is_start"; | 31 | + public static String USER_ID = "user_id"; | 
| 32 | + public static String APP_IS_START = "app_is_start"; | ||
| 32 | 33 | ||
| 33 | //http://campus.myjxt.com/ | 34 | //http://campus.myjxt.com/ | 
| 34 | - public static String BASE_URL="http://60.190.202.57:1000/"; | ||
| 35 | - public static String BASE_URL_IMG="http://60.190.202.57:1000"; | ||
| 36 | - public static String BASE_URL_ORDER="http://60.190.202.57:8101/"; | ||
| 37 | - | 35 | + public static String BASE_URL = "http://60.190.202.57:1000/"; | 
| 36 | + public static String BASE_URL_IMG = "http://60.190.202.57:1000"; | ||
| 37 | + public static String BASE_URL_ORDER = "http://60.190.202.57:8101/"; | ||
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | //默认日志保存的路径 | 40 | //默认日志保存的路径 | 
app/src/main/java/com/shunzhi/parent/api/MineApi.java
| @@ -32,7 +32,7 @@ public interface MineApi { | @@ -32,7 +32,7 @@ public interface MineApi { | ||
| 32 | @FormUrlEncoded | 32 | @FormUrlEncoded | 
| 33 | @POST("/api/ParentHelper/BindlingChildren") | 33 | @POST("/api/ParentHelper/BindlingChildren") | 
| 34 | Observable<JsonObject> addChildResult( | 34 | Observable<JsonObject> addChildResult( | 
| 35 | - @Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag | 35 | + @Field("sex") int sex ,@Field("studentName") String studentName ,@Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag | 
| 36 | , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); | 36 | , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); | 
| 37 | 37 | ||
| 38 | @GET("/api/ParentHelper/GetClassOrGrade") | 38 | @GET("/api/ParentHelper/GetClassOrGrade") | 
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
| @@ -21,7 +21,7 @@ public interface MyChildContract { | @@ -21,7 +21,7 @@ public interface MyChildContract { | ||
| 21 | 21 | ||
| 22 | abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { | 22 | abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { | 
| 23 | public abstract void loadChildList(String mobile, int school_id, String captcha); | 23 | public abstract void loadChildList(String mobile, int school_id, String captcha); | 
| 24 | - public abstract void addChild(int parentId, boolean mobileFlag,boolean cooperateFlag | 24 | + public abstract void addChild( int sex ,String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag | 
| 25 | , int schoolId,int classId,int studentId,String studentUserId); | 25 | , int schoolId,int classId,int studentId,String studentUserId); | 
| 26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); | 26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); | 
| 27 | 27 | ||
| @@ -31,7 +31,7 @@ public interface MyChildContract { | @@ -31,7 +31,7 @@ public interface MyChildContract { | ||
| 31 | 31 | ||
| 32 | interface IMyChildModel extends IBaseModel { | 32 | interface IMyChildModel extends IBaseModel { | 
| 33 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); | 33 | Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); | 
| 34 | - Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | 34 | + Observable<JsonObject> addChildResult( int sex , String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag | 
| 35 | , int schoolId,int classId,int studentId,String studentUserId); | 35 | , int schoolId,int classId,int studentId,String studentUserId); | 
| 36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); | 36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); | 
| 37 | Observable<JsonObject>unBinnding(int parentId,int studentId); | 37 | Observable<JsonObject>unBinnding(int parentId,int studentId); | 
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
| @@ -11,6 +11,7 @@ import com.shunzhi.parent.bean.UserInfo; | @@ -11,6 +11,7 @@ import com.shunzhi.parent.bean.UserInfo; | ||
| 11 | import com.shunzhi.parent.contract.mine.MyChildContract; | 11 | import com.shunzhi.parent.contract.mine.MyChildContract; | 
| 12 | 12 | ||
| 13 | import io.reactivex.Observable; | 13 | import io.reactivex.Observable; | 
| 14 | +import retrofit2.http.Field; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** | 
| 16 | * Created by Administrator on 2018/3/8 0008. | 17 | * Created by Administrator on 2018/3/8 0008. | 
| @@ -30,9 +31,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | @@ -30,9 +31,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | @Override | 33 | @Override | 
| 33 | - public Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | 34 | + public Observable<JsonObject> addChildResult( int sex , String studentName,int parentId, boolean mobileFlag,boolean cooperateFlag | 
| 34 | , int schoolId,int classId,int studentId,String studentUserId) { | 35 | , int schoolId,int classId,int studentId,String studentUserId) { | 
| 35 | - return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(parentId,mobileFlag,cooperateFlag,schoolId | 36 | + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(sex ,studentName,parentId,mobileFlag,cooperateFlag,schoolId | 
| 36 | ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 37 | ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 
| 37 | } | 38 | } | 
| 38 | 39 | 
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
| @@ -47,6 +47,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -47,6 +47,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
| 47 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 47 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 
| 48 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); | 48 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); | 
| 49 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); | 49 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); | 
| 50 | + AppConfig.ISLOGIN = true; | ||
| 50 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); | 51 | RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); | 
| 51 | getUserInfo(loginName, 0, ""); | 52 | getUserInfo(loginName, 0, ""); | 
| 52 | } else { | 53 | } else { | 
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
| @@ -64,8 +64,8 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -64,8 +64,8 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
| 64 | } | 64 | } | 
| 65 | 65 | ||
| 66 | @Override | 66 | @Override | 
| 67 | - public void addChild(int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | ||
| 68 | - mRxManager.register(mIModel.addChildResult(parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | 67 | + public void addChild( int sex , String studentName,int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | 
| 68 | + mRxManager.register(mIModel.addChildResult(sex,studentName,parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | ||
| 69 | @Override | 69 | @Override | 
| 70 | public void accept(JsonObject jsonObject) throws Exception { | 70 | public void accept(JsonObject jsonObject) throws Exception { | 
| 71 | ToastUtils.showToast("绑定孩子成功"); | 71 | ToastUtils.showToast("绑定孩子成功"); | 
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
| @@ -82,9 +82,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -82,9 +82,9 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
| 82 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(child_sex.getText()) | 82 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(child_sex.getText()) | 
| 83 | && !TextUtils.isEmpty(child_grade.getText()) && !TextUtils.isEmpty(child_class.getText())) { | 83 | && !TextUtils.isEmpty(child_grade.getText()) && !TextUtils.isEmpty(child_class.getText())) { | 
| 84 | if (isNew == 0) { | 84 | if (isNew == 0) { | 
| 85 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), true, true, 0, 0, studentId,""); | 85 | + mPresenter.addChild(0,"",Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), true, true, 0, 0, studentId,""); | 
| 86 | } else { | 86 | } else { | 
| 87 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), false, true, 0, classId, studentId, ""); | 87 | + mPresenter.addChild(0,"",Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)), false, true, 0, classId, studentId, ""); | 
| 88 | } | 88 | } | 
| 89 | } else { | 89 | } else { | 
| 90 | final PopupWindow popupWindow = new PopupWindow(); | 90 | final PopupWindow popupWindow = new PopupWindow(); | 
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
| @@ -5,6 +5,7 @@ import android.os.Bundle; | @@ -5,6 +5,7 @@ import android.os.Bundle; | ||
| 5 | import android.support.annotation.NonNull; | 5 | import android.support.annotation.NonNull; | 
| 6 | import android.support.v4.util.ArrayMap; | 6 | import android.support.v4.util.ArrayMap; | 
| 7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; | 
| 8 | +import android.util.Log; | ||
| 8 | import android.view.ContextMenu; | 9 | import android.view.ContextMenu; | 
| 9 | import android.view.MenuItem; | 10 | import android.view.MenuItem; | 
| 10 | import android.view.View; | 11 | import android.view.View; | 
| @@ -62,6 +63,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -62,6 +63,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 62 | } | 63 | } | 
| 63 | }); | 64 | }); | 
| 64 | add_child = findViewById(R.id.add_child); | 65 | add_child = findViewById(R.id.add_child); | 
| 66 | + add_child.setOnClickListener(this); | ||
| 65 | child_name = findViewById(R.id.child_name); | 67 | child_name = findViewById(R.id.child_name); | 
| 66 | select_sex = findViewById(R.id.select_sex); | 68 | select_sex = findViewById(R.id.select_sex); | 
| 67 | select_grade = findViewById(R.id.select_grade); | 69 | select_grade = findViewById(R.id.select_grade); | 
| @@ -70,6 +72,8 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -70,6 +72,8 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 70 | select_grade.setOnClickListener(this); | 72 | select_grade.setOnClickListener(this); | 
| 71 | select_class.setOnClickListener(this); | 73 | select_class.setOnClickListener(this); | 
| 72 | registerForContextMenu(select_sex); | 74 | registerForContextMenu(select_sex); | 
| 75 | + registerForContextMenu(select_grade); | ||
| 76 | + registerForContextMenu(select_class); | ||
| 73 | sexList.add("男"); | 77 | sexList.add("男"); | 
| 74 | sexList.add("女"); | 78 | sexList.add("女"); | 
| 75 | 79 | ||
| @@ -90,7 +94,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -90,7 +94,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 90 | if (v == add_child) { | 94 | if (v == add_child) { | 
| 91 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(select_sex.getText()) | 95 | if (!TextUtils.isEmpty(child_name.getText()) && !TextUtils.isEmpty(select_sex.getText()) | 
| 92 | && !TextUtils.isEmpty(select_grade.getText()) && !TextUtils.isEmpty(select_class.getText())) { | 96 | && !TextUtils.isEmpty(select_grade.getText()) && !TextUtils.isEmpty(select_class.getText())) { | 
| 93 | - mPresenter.addChild(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)) | 97 | + mPresenter.addChild(sexId,child_name.getText().toString(),Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)) | 
| 94 | , true, false, school_id, classId, 0, ""); | 98 | , true, false, school_id, classId, 0, ""); | 
| 95 | } else { | 99 | } else { | 
| 96 | ToastUtils.showToast("请填写完整的孩子信息"); | 100 | ToastUtils.showToast("请填写完整的孩子信息"); | 
| @@ -128,19 +132,22 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -128,19 +132,22 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 128 | 132 | ||
| 129 | @Override | 133 | @Override | 
| 130 | public void addChildSuccess() { | 134 | public void addChildSuccess() { | 
| 131 | - startActivity(new Intent().setClass(CreateChildInfoActivity.this, MyChildActivity.class)); | 135 | + startActivity(new Intent().setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).setClass(CreateChildInfoActivity.this, MyChildActivity.class)); | 
| 132 | finish(); | 136 | finish(); | 
| 133 | } | 137 | } | 
| 134 | 138 | ||
| 135 | @Override | 139 | @Override | 
| 136 | public void showClass(List<ChildClass> list) { | 140 | public void showClass(List<ChildClass> list) { | 
| 137 | if (list.size() > 0 && list != null) { | 141 | if (list.size() > 0 && list != null) { | 
| 142 | + Log.e("111-===",list.get(0).getGradeName()); | ||
| 138 | if (list.get(0).getGradeId() == 0) { | 143 | if (list.get(0).getGradeId() == 0) { | 
| 139 | //班级列表 | 144 | //班级列表 | 
| 140 | - classList = list; | 145 | + classList.clear(); | 
| 146 | + classList.addAll(list); | ||
| 141 | } else { | 147 | } else { | 
| 142 | //年级列表 | 148 | //年级列表 | 
| 143 | - gradeList = list; | 149 | + gradeList.clear(); | 
| 150 | + gradeList.addAll(list); | ||
| 144 | } | 151 | } | 
| 145 | 152 | ||
| 146 | } | 153 | } | 
| @@ -175,7 +182,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -175,7 +182,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 175 | } else if (type == 1) { | 182 | } else if (type == 1) { | 
| 176 | for (int i = 0; i < gradeList.size(); i++) { | 183 | for (int i = 0; i < gradeList.size(); i++) { | 
| 177 | try { | 184 | try { | 
| 178 | - final String title = gradeList.get(i).getClassName(); | 185 | + final String title = gradeList.get(i).getGradeName(); | 
| 179 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 186 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 
| 180 | @Override | 187 | @Override | 
| 181 | public boolean onMenuItemClick(MenuItem item) { | 188 | public boolean onMenuItemClick(MenuItem item) { | 
| @@ -192,7 +199,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -192,7 +199,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
| 192 | } else if (type == 2) { | 199 | } else if (type == 2) { | 
| 193 | for (int i = 0; i < classList.size(); i++) { | 200 | for (int i = 0; i < classList.size(); i++) { | 
| 194 | try { | 201 | try { | 
| 195 | - final String title = classList.get(i).getGradeName(); | 202 | + final String title = classList.get(i).getClassName(); | 
| 196 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 203 | menu.add(0, i, 0, title).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { | 
| 197 | @Override | 204 | @Override | 
| 198 | public boolean onMenuItemClick(MenuItem item) { | 205 | public boolean onMenuItemClick(MenuItem item) { | 
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
| @@ -20,14 +20,15 @@ import com.shunzhi.parent.R; | @@ -20,14 +20,15 @@ import com.shunzhi.parent.R; | ||
| 20 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | 20 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | 
| 21 | import com.shunzhi.parent.contract.mine.MineContract; | 21 | import com.shunzhi.parent.contract.mine.MineContract; | 
| 22 | import com.shunzhi.parent.presenter.mine.MinePresenter; | 22 | import com.shunzhi.parent.presenter.mine.MinePresenter; | 
| 23 | +import com.shunzhi.parent.ui.activity.LoginAndRegistActivity; | ||
| 23 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 24 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 
| 24 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 25 | import com.shunzhi.parent.ui.activity.PersonInfoActivity; | 
| 25 | -import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | ||
| 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 26 | import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | 
| 27 | +import com.shunzhi.parent.ui.activity.orderdetail.OrderDetailActivity; | ||
| 27 | 28 | ||
| 28 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 29 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 
| 29 | implements MineContract.IMineView, View.OnClickListener { | 30 | implements MineContract.IMineView, View.OnClickListener { | 
| 30 | - LinearLayout childlayout, personinfo,layout_orderDetail,layout_order; | 31 | + LinearLayout childlayout, personinfo, layout_orderDetail, layout_order; | 
| 31 | RoundedImageView user_photo; | 32 | RoundedImageView user_photo; | 
| 32 | TextView user_name, user_mobile; | 33 | TextView user_name, user_mobile; | 
| 33 | 34 | ||
| @@ -46,8 +47,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -46,8 +47,8 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 46 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 47 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 
| 47 | childlayout = view.findViewById(R.id.childlayout); | 48 | childlayout = view.findViewById(R.id.childlayout); | 
| 48 | personinfo = view.findViewById(R.id.personinfo); | 49 | personinfo = view.findViewById(R.id.personinfo); | 
| 49 | - layout_order=view.findViewById(R.id.layout_order); | ||
| 50 | - layout_orderDetail=view.findViewById(R.id.layout_orderDetail); | 50 | + layout_order = view.findViewById(R.id.layout_order); | 
| 51 | + layout_orderDetail = view.findViewById(R.id.layout_orderDetail); | ||
| 51 | childlayout.setOnClickListener(this); | 52 | childlayout.setOnClickListener(this); | 
| 52 | personinfo.setOnClickListener(this); | 53 | personinfo.setOnClickListener(this); | 
| 53 | layout_order.setOnClickListener(this); | 54 | layout_order.setOnClickListener(this); | 
| @@ -59,19 +60,21 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -59,19 +60,21 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 59 | } | 60 | } | 
| 60 | 61 | ||
| 61 | private void setPersonInfo() { | 62 | private void setPersonInfo() { | 
| 62 | - String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | ||
| 63 | - ToastUtils.showToast(url); | ||
| 64 | - if (!TextUtils.isEmpty(url)) { | ||
| 65 | - Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | ||
| 66 | - } else { | ||
| 67 | - Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | 63 | + if (AppConfig.ISLOGIN) { | 
| 64 | + String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE); | ||
| 65 | + ToastUtils.showToast(url); | ||
| 66 | + if (!TextUtils.isEmpty(url)) { | ||
| 67 | + Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo); | ||
| 68 | + } else { | ||
| 69 | + Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo); | ||
| 70 | + user_photo.setCornerRadius(20); | ||
| 71 | + } | ||
| 68 | user_photo.setCornerRadius(20); | 72 | user_photo.setCornerRadius(20); | 
| 73 | + user_photo.setOval(true); | ||
| 74 | + user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | ||
| 75 | + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | ||
| 76 | + user_mobile.setVisibility(View.VISIBLE); | ||
| 69 | } | 77 | } | 
| 70 | - user_photo.setCornerRadius(20); | ||
| 71 | - user_photo.setOval(true); | ||
| 72 | - user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME)); | ||
| 73 | - user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | ||
| 74 | - | ||
| 75 | } | 78 | } | 
| 76 | 79 | ||
| 77 | 80 | ||
| @@ -82,16 +85,19 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -82,16 +85,19 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
| 82 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | 85 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | 
| 83 | break; | 86 | break; | 
| 84 | case R.id.personinfo: | 87 | case R.id.personinfo: | 
| 85 | - startActivity(new Intent().setClass(getActivity(), PersonInfoActivity.class)); | 88 | + if (AppConfig.ISLOGIN) | 
| 89 | + startActivity(new Intent().setClass(getActivity(), PersonInfoActivity.class)); | ||
| 90 | + else | ||
| 91 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
| 86 | break; | 92 | break; | 
| 87 | case R.id.layout_orderDetail: | 93 | case R.id.layout_orderDetail: | 
| 88 | startNewActivity(OrderDetailActivity.class); | 94 | startNewActivity(OrderDetailActivity.class); | 
| 89 | break; | 95 | break; | 
| 90 | case R.id.layout_order: | 96 | case R.id.layout_order: | 
| 91 | - Bundle bundle=new Bundle(); | ||
| 92 | - bundle.putString("url",AppConfig.BASE_URL_ORDER+"ParentOrderCenter.aspx?userid="+ | ||
| 93 | - AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); | ||
| 94 | - startNewActivity(WebViewActivity.class,bundle); | 97 | + Bundle bundle = new Bundle(); | 
| 98 | + bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" + | ||
| 99 | + AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID)); | ||
| 100 | + startNewActivity(WebViewActivity.class, bundle); | ||
| 95 | break; | 101 | break; | 
| 96 | default: | 102 | default: | 
| 97 | break; | 103 | break; | 
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| @@ -23,7 +23,6 @@ import com.share.mvpsdk.utils.DisplayUtils; | @@ -23,7 +23,6 @@ import com.share.mvpsdk.utils.DisplayUtils; | ||
| 23 | import com.shunzhi.parent.AppConfig; | 23 | import com.shunzhi.parent.AppConfig; | 
| 24 | import com.shunzhi.parent.R; | 24 | import com.shunzhi.parent.R; | 
| 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 25 | import com.shunzhi.parent.adapter.MyConsultAdapter; | 
| 26 | -import com.shunzhi.parent.bean.GrallyBean; | ||
| 27 | import com.shunzhi.parent.bean.GuangGaoBean; | 26 | import com.shunzhi.parent.bean.GuangGaoBean; | 
| 28 | import com.shunzhi.parent.bean.MyConsultBean; | 27 | import com.shunzhi.parent.bean.MyConsultBean; | 
| 29 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 28 | import com.shunzhi.parent.contract.consult.consultone.ConsultOneContract; | 
| @@ -126,6 +125,11 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -126,6 +125,11 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 126 | initRecyclerView(guangGaoBeanList); | 125 | initRecyclerView(guangGaoBeanList); | 
| 127 | } | 126 | } | 
| 128 | 127 | ||
| 128 | + @Override | ||
| 129 | + public void showConsultContent() { | ||
| 130 | + | ||
| 131 | + } | ||
| 132 | + | ||
| 129 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { | 133 | private class MyGrallyAdapter extends BaseRecyclerViewAdapter<GuangGaoBean> { | 
| 130 | @Override | 134 | @Override | 
| 131 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { | 135 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { | 
| @@ -162,7 +166,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -162,7 +166,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
| 162 | public void onBindViewHolder(GuangGaoBean object, int position) { | 166 | public void onBindViewHolder(GuangGaoBean object, int position) { | 
| 163 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 167 | Glide.with(getActivity()).load(AppConfig.BASE_URL_IMG+object.fileSrc).error(R.drawable.ic_launcher_foreground).into(iv_grally); | 
| 164 | // iv_grally.setImageResource(R.drawable.ic_launcher_background); | 168 | // iv_grally.setImageResource(R.drawable.ic_launcher_background); | 
| 165 | - tv_grally_title.setText(object.describe); | 169 | + tv_grally_title.setText(object.describe+""); | 
| 166 | } | 170 | } | 
| 167 | } | 171 | } | 
| 168 | } | 172 | } | 
4.53 KB
app/src/main/res/layout/fragment_consult_two_level.xml
app/src/main/res/layout/fragment_mine.xml
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | android:layout_width="60dp" | 40 | android:layout_width="60dp" | 
| 41 | android:layout_height="60dp" | 41 | android:layout_height="60dp" | 
| 42 | android:layout_margin="20dp" | 42 | android:layout_margin="20dp" | 
| 43 | - android:src="@color/white" | 43 | + android:src="@drawable/user_imge_defult" | 
| 44 | app:riv_corner_radius="10dp" /> | 44 | app:riv_corner_radius="10dp" /> | 
| 45 | 45 | ||
| 46 | <LinearLayout | 46 | <LinearLayout | 
| @@ -48,13 +48,14 @@ | @@ -48,13 +48,14 @@ | ||
| 48 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" | 
| 49 | android:layout_marginTop="25dp" | 49 | android:layout_marginTop="25dp" | 
| 50 | android:layout_weight="1" | 50 | android:layout_weight="1" | 
| 51 | + android:gravity="center_vertical" | ||
| 51 | android:orientation="vertical"> | 52 | android:orientation="vertical"> | 
| 52 | 53 | ||
| 53 | <TextView | 54 | <TextView | 
| 54 | android:id="@+id/user_name" | 55 | android:id="@+id/user_name" | 
| 55 | android:layout_width="wrap_content" | 56 | android:layout_width="wrap_content" | 
| 56 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" | 
| 57 | - android:text="马铂賽" | 58 | + android:text="登录/注册" | 
| 58 | android:textColor="@color/white" | 59 | android:textColor="@color/white" | 
| 59 | android:textSize="@dimen/txtsize_headline" /> | 60 | android:textSize="@dimen/txtsize_headline" /> | 
| 60 | 61 | ||
| @@ -65,6 +66,7 @@ | @@ -65,6 +66,7 @@ | ||
| 65 | android:text="账号:12345678991" | 66 | android:text="账号:12345678991" | 
| 66 | android:textColor="@color/white" | 67 | android:textColor="@color/white" | 
| 67 | android:textSize="@dimen/txtsize_title" | 68 | android:textSize="@dimen/txtsize_title" | 
| 69 | + android:visibility="gone" | ||
| 68 | 70 | ||
| 69 | /> | 71 | /> | 
| 70 | 72 |