Commit 8c991655c498c97fe217b993f30c112960fad3ec
1 parent
26d3505e
Exists in
yxb_dev
and in
2 other branches
no message
Showing
13 changed files
with
282 additions
and
68 deletions
 
Show diff stats
app/src/main/AndroidManifest.xml
| ... | ... | @@ -101,9 +101,7 @@ | 
| 101 | 101 | android:screenOrientation="portrait" | 
| 102 | 102 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 
| 103 | 103 | <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity"></activity> | 
| 104 | - <activity android:name=".ui.MainActivity" | |
| 105 | - android:screenOrientation="portrait" | |
| 106 | - /> | |
| 104 | + | |
| 107 | 105 | </application> | 
| 108 | 106 | |
| 109 | 107 | </manifest> | 
| 110 | 108 | \ No newline at end of file | ... | ... | 
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
| ... | ... | @@ -32,17 +32,20 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean>{ | 
| 32 | 32 | |
| 33 | 33 | private class MyViewHolder extends BaseRecyclerViewHolder<ChildBean>{ | 
| 34 | 34 | |
| 35 | - TextView textView; | |
| 35 | + TextView txt_childname,txt_childclass; | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public MyViewHolder(View view) { | 
| 39 | 39 | super(view); | 
| 40 | - textView=view.findViewById(R.id.txt_childname); | |
| 40 | + txt_childname=view.findViewById(R.id.txt_childname); | |
| 41 | + txt_childclass=view.findViewById(R.id.txt_childclass); | |
| 41 | 42 | } | 
| 42 | 43 | |
| 43 | 44 | @Override | 
| 44 | 45 | public void onBindViewHolder(ChildBean object, int position) { | 
| 45 | - textView.setText("1234"); | |
| 46 | + txt_childname.setText(object.getStudentName()); | |
| 47 | + txt_childclass.setText(object.getSchoolName()+" "+object.getClassName()); | |
| 48 | + | |
| 46 | 49 | } | 
| 47 | 50 | |
| 48 | 51 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/api/MineApi.java
| ... | ... | @@ -12,17 +12,24 @@ import retrofit2.http.POST; | 
| 12 | 12 | */ | 
| 13 | 13 | |
| 14 | 14 | public interface MineApi { | 
| 15 | -// String url="http://campus.myjxt.com/"; | |
| 16 | - String url="http://60.190.202.57:1000/"; | |
| 15 | + // String url="http://campus.myjxt.com/"; | |
| 16 | + String url = "http://60.190.202.57:1000/"; | |
| 17 | 17 | |
| 18 | -@FormUrlEncoded | |
| 18 | + @FormUrlEncoded | |
| 19 | 19 | @POST("/api/ParentHelper/GetAreaSchool") | 
| 20 | 20 | Observable<JsonObject> getSchoolListResult( | 
| 21 | - @Field("areaName") String areaName, @Field("Keyword") String Keyword); | |
| 21 | + @Field("areaName") String areaName, @Field("Keyword") String Keyword); | |
| 22 | 22 | |
| 23 | -@FormUrlEncoded | |
| 24 | -@POST("/api/ParentHelper/UpdateParentInfo") | |
| 23 | + @FormUrlEncoded | |
| 24 | + @POST("/api/ParentHelper/UpdateParentInfo") | |
| 25 | 25 | Observable<JsonObject> getChangeInfoResult( | 
| 26 | - @Field("parentName") String parentName, @Field("sex") int sex,@Field("mobile")String mobile); | |
| 26 | + @Field("parentName") String parentName, @Field("sex") int sex, @Field("mobile") String mobile); | |
| 27 | + | |
| 28 | + @FormUrlEncoded | |
| 29 | + @POST("/api/ParentHelper/BindlingChildren") | |
| 30 | + Observable<JsonObject> addChildResult( | |
| 31 | + @Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag | |
| 32 | + , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId); | |
| 27 | 33 | |
| 28 | 34 | } | 
| 35 | + | ... | ... | 
app/src/main/java/com/shunzhi/parent/bean/ChildBean.java
| 1 | 1 | package com.shunzhi.parent.bean; | 
| 2 | 2 | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 3 | 5 | /** | 
| 4 | 6 | * Created by Administrator on 2018/3/9 0009. | 
| 5 | 7 | */ | 
| 6 | 8 | |
| 7 | -public class ChildBean { | |
| 8 | - private int parentMobile; | |
| 9 | - private int parentId; | |
| 9 | +public class ChildBean implements Serializable{ | |
| 10 | + private String studentUserId; | |
| 11 | + private int parentMobile; | |
| 12 | + private int parentId; | |
| 10 | 13 | private boolean mobileFlag; | 
| 11 | 14 | private boolean bindingState; | 
| 12 | 15 | private boolean cooperateFlag; | 
| ... | ... | @@ -17,10 +20,18 @@ public class ChildBean { | 
| 17 | 20 | private int classId; | 
| 18 | 21 | private String className; | 
| 19 | 22 | private int studentId; | 
| 20 | - private int studentUserId; | |
| 23 | + private String studentName; | |
| 21 | 24 | private String photo; | 
| 22 | 25 | private int sex; | 
| 23 | 26 | |
| 27 | + public String getStudentName() { | |
| 28 | + return studentName; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setStudentName(String studentName) { | |
| 32 | + this.studentName = studentName; | |
| 33 | + } | |
| 34 | + | |
| 24 | 35 | public int getParentMobile() { | 
| 25 | 36 | return parentMobile; | 
| 26 | 37 | } | 
| ... | ... | @@ -117,11 +128,11 @@ public class ChildBean { | 
| 117 | 128 | this.studentId = studentId; | 
| 118 | 129 | } | 
| 119 | 130 | |
| 120 | - public int getStudentUserId() { | |
| 131 | + public String getStudentUserId() { | |
| 121 | 132 | return studentUserId; | 
| 122 | 133 | } | 
| 123 | 134 | |
| 124 | - public void setStudentUserId(int studentUserId) { | |
| 135 | + public void setStudentUserId(String studentUserId) { | |
| 125 | 136 | this.studentUserId = studentUserId; | 
| 126 | 137 | } | 
| 127 | 138 | |
| ... | ... | @@ -145,19 +156,20 @@ public class ChildBean { | 
| 145 | 156 | public String toString() { | 
| 146 | 157 | return "ChildBean{" + | 
| 147 | 158 | "parentMobile='" + parentMobile + '\'' + | 
| 148 | - "parentId='" + parentId + '\'' + | |
| 149 | - "mobileFlag='" + mobileFlag + '\'' + | |
| 150 | - "bindingState='" + bindingState + '\'' + | |
| 151 | - "cooperateFlag='" + cooperateFlag + '\'' + | |
| 152 | - "schoolId='" + schoolId + '\'' + | |
| 153 | - "schoolName='" + schoolName + '\'' + | |
| 154 | - "grade='" + grade + '\'' + | |
| 155 | - "gradename='" + gradename + '\'' + | |
| 156 | - "classId='" + classId + '\'' + | |
| 157 | - "className='" + className + '\'' + | |
| 158 | - "studentId='" + studentId + '\'' + | |
| 159 | - "studentUserId='" + studentUserId + '\'' + | |
| 160 | - "photo='" + photo + '\'' + | |
| 159 | + ",parentId='" + parentId + '\'' + | |
| 160 | + ",mobileFlag='" + mobileFlag + '\'' + | |
| 161 | + ",bindingState='" + bindingState + '\'' + | |
| 162 | + ",cooperateFlag='" + cooperateFlag + '\'' + | |
| 163 | + ",schoolId='" + schoolId + '\'' + | |
| 164 | + ",schoolName='" + schoolName + '\'' + | |
| 165 | + ",grade='" + grade + '\'' + | |
| 166 | + ",gradename='" + gradename + '\'' + | |
| 167 | + ",classId='" + classId + '\'' + | |
| 168 | + ",className='" + className + '\'' + | |
| 169 | + ",studentId='" + studentId + '\'' + | |
| 170 | + ",studentName='" + studentName + '\'' + | |
| 171 | + ",studentUserId='" + studentUserId + '\'' + | |
| 172 | + ",photo='" + photo + '\'' + | |
| 161 | 173 | ", sex=" + sex + | 
| 162 | 174 | "}"; | 
| 163 | 175 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/bean/CurrentBean.java
| ... | ... | @@ -14,8 +14,18 @@ public class CurrentBean implements Serializable{ | 
| 14 | 14 | private String mobile; | 
| 15 | 15 | private boolean bindSchoolFlag; | 
| 16 | 16 | private boolean bindingChildrenFlag; | 
| 17 | + private int parentId; | |
| 17 | 18 | private int sex; | 
| 18 | - private List<ChildBean> data; | |
| 19 | + private List<ChildBean> studentClass; | |
| 20 | + | |
| 21 | + | |
| 22 | + public int getParentId() { | |
| 23 | + return parentId; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setParentId(int parentId) { | |
| 27 | + this.parentId = parentId; | |
| 28 | + } | |
| 19 | 29 | |
| 20 | 30 | public int getSex() { | 
| 21 | 31 | return sex; | 
| ... | ... | @@ -73,25 +83,26 @@ public class CurrentBean implements Serializable{ | 
| 73 | 83 | this.bindingChildrenFlag = bindingChildrenFlag; | 
| 74 | 84 | } | 
| 75 | 85 | |
| 76 | - public List<ChildBean> getData() { | |
| 77 | - return data; | |
| 86 | + public List<ChildBean> getStudentClass() { | |
| 87 | + return studentClass; | |
| 78 | 88 | } | 
| 79 | 89 | |
| 80 | - public void setData(List<ChildBean> data) { | |
| 81 | - this.data = data; | |
| 90 | + public void setStudentClass(List<ChildBean> studentClass) { | |
| 91 | + this.studentClass = studentClass; | |
| 82 | 92 | } | 
| 83 | 93 | |
| 84 | 94 | @Override | 
| 85 | 95 | public String toString() { | 
| 86 | 96 | return "CurrentBean{" + | 
| 87 | - "userid='" + userid + '\'' + | |
| 88 | - "name='" + name + '\'' + | |
| 89 | - "image='" + image + '\'' + | |
| 90 | - "mobile='" + mobile + '\'' + | |
| 91 | - "bindSchoolFlag='" + bindSchoolFlag + '\'' + | |
| 92 | - "bindingChildrenFlag='" + bindingChildrenFlag + '\'' + | |
| 93 | - "sex='" + sex + '\'' + | |
| 94 | - ", data=" + data + | |
| 95 | - '}'; | |
| 97 | + ", userid='" + userid + '\'' + | |
| 98 | + ", name='" + name + '\'' + | |
| 99 | + ", image='" + image + '\'' + | |
| 100 | + ", mobile='" + mobile + '\'' + | |
| 101 | + ", parentId='" + parentId + '\'' + | |
| 102 | + ", bindSchoolFlag='" + bindSchoolFlag + '\'' + | |
| 103 | + ", bindingChildrenFlag='" + bindingChildrenFlag + '\'' + | |
| 104 | + ", sex='" + sex + '\'' + | |
| 105 | + ", studentClass='" + studentClass + | |
| 106 | + "}"; | |
| 96 | 107 | } | 
| 97 | 108 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
| 1 | 1 | package com.shunzhi.parent.contract.mine; | 
| 2 | 2 | |
| 3 | +import com.google.gson.JsonObject; | |
| 3 | 4 | import com.share.mvpsdk.base.BasePresenter; | 
| 4 | 5 | import com.share.mvpsdk.base.IBaseActivity; | 
| 5 | 6 | import com.share.mvpsdk.base.IBaseModel; | 
| 6 | 7 | import com.shunzhi.parent.bean.ChildBean; | 
| 8 | +import com.shunzhi.parent.bean.UserInfo; | |
| 7 | 9 | |
| 8 | 10 | import java.util.List; | 
| 9 | 11 | |
| 12 | +import io.reactivex.Observable; | |
| 13 | + | |
| 10 | 14 | /** | 
| 11 | 15 | * Created by Administrator on 2018/3/9 0009. | 
| 12 | 16 | */ | 
| 13 | 17 | |
| 14 | 18 | public interface MyChildContract { | 
| 15 | 19 | |
| 16 | - abstract class MyChildPresenter extends BasePresenter<IMyChildModel,IMyChildView> { | |
| 17 | - public abstract void loadChildList(); | |
| 20 | + abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> { | |
| 21 | + public abstract void loadChildList(String mobile, int school_id, String captcha); | |
| 22 | + public abstract void addChild(int parentId, boolean mobileFlag,boolean cooperateFlag | |
| 23 | + , int schoolId,int classId,int studentId,String studentUserId); | |
| 18 | 24 | |
| 19 | 25 | } | 
| 20 | 26 | |
| 21 | - interface IMyChildModel extends IBaseModel{ | |
| 27 | + interface IMyChildModel extends IBaseModel { | |
| 28 | + Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha); | |
| 29 | + Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | |
| 30 | + , int schoolId,int classId,int studentId,String studentUserId); | |
| 31 | + | |
| 22 | 32 | |
| 23 | 33 | } | 
| 24 | - interface IMyChildView extends IBaseActivity{ | |
| 34 | + | |
| 35 | + interface IMyChildView extends IBaseActivity { | |
| 25 | 36 | void updateChilsList(List<ChildBean> list); | 
| 26 | 37 | |
| 27 | 38 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
| 1 | 1 | package com.shunzhi.parent.model.mine; | 
| 2 | 2 | |
| 3 | +import com.google.gson.JsonObject; | |
| 3 | 4 | import com.share.mvpsdk.base.BaseModel; | 
| 5 | +import com.share.mvpsdk.helper.RetrofitCreateHelper; | |
| 6 | +import com.share.mvpsdk.helper.RxHelper; | |
| 7 | +import com.shunzhi.parent.api.LoginRegisterApi; | |
| 8 | +import com.shunzhi.parent.api.MineApi; | |
| 9 | +import com.shunzhi.parent.bean.UserInfo; | |
| 4 | 10 | import com.shunzhi.parent.contract.mine.MyChildContract; | 
| 5 | 11 | |
| 12 | +import io.reactivex.Observable; | |
| 13 | + | |
| 6 | 14 | /** | 
| 7 | 15 | * Created by Administrator on 2018/3/8 0008. | 
| 8 | 16 | */ | 
| ... | ... | @@ -11,4 +19,19 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | 
| 11 | 19 | public static MyChildModel newInstance() { | 
| 12 | 20 | return new MyChildModel(); | 
| 13 | 21 | } | 
| 22 | + | |
| 23 | + @Override | |
| 24 | + public Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha) { | |
| 25 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getUserInfo(mobile,school_id,captcha) | |
| 26 | + .compose(RxHelper.<UserInfo>rxSchedulerHelper()); | |
| 27 | + } | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | |
| 33 | + , int schoolId,int classId,int studentId,String studentUserId) { | |
| 34 | + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(parentId,mobileFlag,cooperateFlag,schoolId | |
| 35 | + ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | |
| 36 | + } | |
| 14 | 37 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
| 1 | 1 | package com.shunzhi.parent.presenter.mine; | 
| 2 | 2 | |
| 3 | +import android.util.Log; | |
| 4 | + | |
| 5 | +import com.google.gson.JsonObject; | |
| 6 | +import com.share.mvpsdk.utils.OkHttpExceptionUtil; | |
| 7 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 3 | 8 | import com.shunzhi.parent.bean.ChildBean; | 
| 9 | +import com.shunzhi.parent.bean.CurrentBean; | |
| 10 | +import com.shunzhi.parent.bean.UserInfo; | |
| 4 | 11 | import com.shunzhi.parent.contract.mine.MyChildContract; | 
| 5 | 12 | import com.shunzhi.parent.model.mine.MyChildModel; | 
| 6 | 13 | |
| 7 | -import java.util.ArrayList; | |
| 8 | 14 | import java.util.List; | 
| 9 | 15 | |
| 16 | +import io.reactivex.functions.Consumer; | |
| 17 | +import retrofit2.HttpException; | |
| 18 | + | |
| 10 | 19 | /** | 
| 11 | 20 | * Created by Administrator on 2018/3/8 0008. | 
| 12 | 21 | */ | 
| ... | ... | @@ -24,14 +33,38 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | 
| 24 | 33 | } | 
| 25 | 34 | |
| 26 | 35 | @Override | 
| 27 | - public void loadChildList() { | |
| 28 | - ChildBean c=new ChildBean(); | |
| 29 | - List<ChildBean> l=new ArrayList<>(); | |
| 30 | - l.add(c); | |
| 31 | - l.add(c); | |
| 32 | - l.add(c); | |
| 33 | - l.add(c); | |
| 34 | - l.add(c); | |
| 35 | - mIView.updateChilsList(l); | |
| 36 | + public void loadChildList(String mobile, int school_id, String captcha) { | |
| 37 | + mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() { | |
| 38 | + @Override | |
| 39 | + public void accept(UserInfo userInfo) throws Exception { | |
| 40 | + CurrentBean currentBean = userInfo.getData(); | |
| 41 | + List<ChildBean> list = currentBean.getStudentClass(); | |
| 42 | + mIView.updateChilsList(list); | |
| 43 | + } | |
| 44 | + }, new Consumer<Throwable>() { | |
| 45 | + @Override | |
| 46 | + public void accept(Throwable throwable) throws Exception { | |
| 47 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 48 | + } | |
| 49 | + })); | |
| 50 | + | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public void addChild(int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | |
| 55 | + mRxManager.register(mIModel.addChildResult(parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | |
| 56 | + @Override | |
| 57 | + public void accept(JsonObject jsonObject) throws Exception { | |
| 58 | + ToastUtils.showToast(jsonObject.toString()); | |
| 59 | + } | |
| 60 | + }, new Consumer<Throwable>() { | |
| 61 | + @Override | |
| 62 | + public void accept(Throwable throwable) throws Exception { | |
| 63 | + | |
| 64 | + } | |
| 65 | + })); | |
| 66 | + | |
| 67 | + | |
| 36 | 68 | } | 
| 69 | + | |
| 37 | 70 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
| ... | ... | @@ -16,6 +16,8 @@ import android.widget.TextView; | 
| 16 | 16 | |
| 17 | 17 | import com.share.mvpsdk.base.BasePresenter; | 
| 18 | 18 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | 
| 19 | +import com.shunzhi.parent.AppConfig; | |
| 20 | +import com.shunzhi.parent.AppContext; | |
| 19 | 21 | import com.shunzhi.parent.R; | 
| 20 | 22 | import com.shunzhi.parent.adapter.ChildAdapter; | 
| 21 | 23 | import com.shunzhi.parent.bean.ChildBean; | 
| ... | ... | @@ -95,7 +97,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | 
| 95 | 97 | |
| 96 | 98 | } | 
| 97 | 99 | }); | 
| 98 | - mPresenter.loadChildList(); | |
| 100 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME),0,""); | |
| 99 | 101 | } | 
| 100 | 102 | |
| 101 | 103 | @Override | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
| ... | ... | @@ -2,29 +2,88 @@ package com.shunzhi.parent.ui.activity.binding; | 
| 2 | 2 | |
| 3 | 3 | import android.os.Bundle; | 
| 4 | 4 | import android.support.annotation.NonNull; | 
| 5 | +import android.util.Log; | |
| 6 | +import android.view.View; | |
| 7 | +import android.widget.LinearLayout; | |
| 8 | +import android.widget.TextView; | |
| 5 | 9 | |
| 6 | 10 | import com.share.mvpsdk.base.BasePresenter; | 
| 7 | 11 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | 
| 12 | +import com.share.mvpsdk.utils.ToastUtils; | |
| 13 | +import com.shunzhi.parent.AppConfig; | |
| 14 | +import com.shunzhi.parent.AppContext; | |
| 8 | 15 | import com.shunzhi.parent.R; | 
| 16 | +import com.shunzhi.parent.bean.ChildBean; | |
| 17 | +import com.shunzhi.parent.contract.mine.MyChildContract; | |
| 18 | +import com.shunzhi.parent.presenter.mine.MyChildPresenter; | |
| 19 | + | |
| 20 | +import java.util.List; | |
| 9 | 21 | |
| 10 | 22 | /** | 
| 11 | 23 | * Created by Administrator on 2018/3/12 0012. | 
| 12 | 24 | */ | 
| 13 | 25 | |
| 14 | -public class CheckInfoActivity extends BaseMVPCompatActivity{ | |
| 26 | +public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> | |
| 27 | + implements MyChildContract.IMyChildView, View.OnClickListener { | |
| 28 | + int school_id; | |
| 29 | + LinearLayout iphone_layout; | |
| 30 | + TextView child_name, child_sex, child_grade, child_class, add_child, user_mobile; | |
| 31 | + ChildBean childBean; | |
| 32 | + | |
| 15 | 33 | @NonNull | 
| 16 | 34 | @Override | 
| 17 | 35 | public BasePresenter initPresenter() { | 
| 18 | - return null; | |
| 36 | + return new MyChildPresenter(); | |
| 19 | 37 | } | 
| 20 | 38 | |
| 21 | 39 | @Override | 
| 22 | 40 | protected void initView(Bundle savedInstanceState) { | 
| 41 | + iphone_layout = findViewById(R.id.iphone_layout); | |
| 42 | + child_name = findViewById(R.id.child_name); | |
| 43 | + child_sex = findViewById(R.id.child_sex); | |
| 44 | + child_grade = findViewById(R.id.child_grade); | |
| 45 | + child_class = findViewById(R.id.child_class); | |
| 46 | + add_child = findViewById(R.id.add_child); | |
| 47 | + add_child.setOnClickListener(this); | |
| 48 | + user_mobile = findViewById(R.id.user_mobile); | |
| 23 | 49 | |
| 50 | +// school_id = getIntent().getIntExtra("school_id", 0); | |
| 51 | +// Log.e("aaaa--==",school_id+""); | |
| 52 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 1, ""); | |
| 24 | 53 | } | 
| 25 | 54 | |
| 26 | 55 | @Override | 
| 27 | 56 | protected int getLayoutId() { | 
| 28 | 57 | return R.layout.activity_check_info; | 
| 29 | 58 | } | 
| 59 | + | |
| 60 | + @Override | |
| 61 | + public void onClick(View v) { | |
| 62 | + Log.e("qqqq--==",childBean.getStudentUserId()); | |
| 63 | + mPresenter.addChild(0, true, true, 0, 0, 0, childBean.getStudentUserId()); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + public void updateChilsList(List<ChildBean> list) { | |
| 68 | + if (list != null&&list.size()>0) { | |
| 69 | + childBean = list.get(0); | |
| 70 | + iphone_layout.setVisibility(View.VISIBLE); | |
| 71 | + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | |
| 72 | + child_name.setText(childBean.getStudentName()); | |
| 73 | + int sex = childBean.getSex(); | |
| 74 | + String sexStr = "未知"; | |
| 75 | + if (sex == 1) { | |
| 76 | + sexStr = "男"; | |
| 77 | + } else if (sex == 2) { | |
| 78 | + | |
| 79 | + sexStr = "女"; | |
| 80 | + } | |
| 81 | + child_sex.setText(sexStr); | |
| 82 | + child_grade.setText(childBean.getGradename()); | |
| 83 | + child_class.setText(childBean.getClassName()); | |
| 84 | + } else { | |
| 85 | + | |
| 86 | + ToastUtils.showToast("1111111"); | |
| 87 | + } | |
| 88 | + } | |
| 30 | 89 | } | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/binding/InviteCodeActivity.java
0 → 100644
| ... | ... | @@ -0,0 +1,48 @@ | 
| 1 | +package com.shunzhi.parent.ui.activity.binding; | |
| 2 | + | |
| 3 | +import android.os.Bundle; | |
| 4 | +import android.support.annotation.NonNull; | |
| 5 | +import android.view.View; | |
| 6 | + | |
| 7 | +import com.share.mvpsdk.base.BasePresenter; | |
| 8 | +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | |
| 9 | +import com.shunzhi.parent.R; | |
| 10 | +import com.shunzhi.parent.bean.ChildBean; | |
| 11 | +import com.shunzhi.parent.contract.mine.MyChildContract; | |
| 12 | +import com.shunzhi.parent.presenter.mine.MyChildPresenter; | |
| 13 | + | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * Created by Administrator on 2018/3/14 0014. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +public class InviteCodeActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> | |
| 21 | + implements MyChildContract.IMyChildView, View.OnClickListener { | |
| 22 | + | |
| 23 | + @NonNull | |
| 24 | + @Override | |
| 25 | + public BasePresenter initPresenter() { | |
| 26 | + return new MyChildPresenter(); | |
| 27 | + } | |
| 28 | + | |
| 29 | + @Override | |
| 30 | + public void updateChilsList(List<ChildBean> list) { | |
| 31 | + | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + protected void initView(Bundle savedInstanceState) { | |
| 36 | + | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Override | |
| 40 | + protected int getLayoutId() { | |
| 41 | + return R.layout.activity_invitecode; | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void onClick(View v) { | |
| 46 | + | |
| 47 | + } | |
| 48 | +} | ... | ... | 
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
| ... | ... | @@ -5,6 +5,7 @@ import android.os.Bundle; | 
| 5 | 5 | import android.support.annotation.NonNull; | 
| 6 | 6 | import android.support.v7.widget.LinearLayoutManager; | 
| 7 | 7 | import android.support.v7.widget.RecyclerView; | 
| 8 | +import android.util.Log; | |
| 8 | 9 | import android.view.View; | 
| 9 | 10 | import android.widget.TextView; | 
| 10 | 11 | |
| ... | ... | @@ -149,7 +150,8 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | 
| 149 | 150 | SortBean currentSortBean = schoolListAdapter.getCurrentSortBean(); | 
| 150 | 151 | if (currentSortBean != null) { | 
| 151 | 152 | if (currentSortBean.getIsNew().equals("0")) { | 
| 152 | - startActivity(new Intent().setClass(SelectSchoolActivity.this, CheckInfoActivity.class)); | |
| 153 | + Log.e("1111-===",currentSortBean.getSchool_id()); | |
| 154 | + startActivity(new Intent().putExtra("school_id",currentSortBean.getSchool_id()).setClass(SelectSchoolActivity.this, CheckInfoActivity.class)); | |
| 153 | 155 | } else { | 
| 154 | 156 | startActivity(new Intent().setClass(SelectSchoolActivity.this,CreateChildInfoActivity.class)); | 
| 155 | 157 | } | ... | ... | 
app/src/main/res/layout/activity_check_info.xml
| ... | ... | @@ -28,6 +28,7 @@ | 
| 28 | 28 | android:textSize="@dimen/sp_18" /> | 
| 29 | 29 | |
| 30 | 30 | <TextView | 
| 31 | + android:id="@+id/user_mobile" | |
| 31 | 32 | android:layout_width="match_parent" | 
| 32 | 33 | android:layout_height="wrap_content" | 
| 33 | 34 | android:layout_marginTop="10dp" | 
| ... | ... | @@ -57,7 +58,8 @@ | 
| 57 | 58 | android:text="孩子姓名:" | 
| 58 | 59 | android:textSize="@dimen/sp_16" /> | 
| 59 | 60 | |
| 60 | - <EditText | |
| 61 | + <TextView | |
| 62 | + android:id="@+id/child_name" | |
| 61 | 63 | android:layout_width="wrap_content" | 
| 62 | 64 | android:layout_height="match_parent" | 
| 63 | 65 | android:layout_weight="1" | 
| ... | ... | @@ -81,7 +83,8 @@ | 
| 81 | 83 | android:text="性 别:" | 
| 82 | 84 | android:textSize="@dimen/sp_16" /> | 
| 83 | 85 | |
| 84 | - <EditText | |
| 86 | + <TextView | |
| 87 | + android:id="@+id/child_sex" | |
| 85 | 88 | android:layout_width="wrap_content" | 
| 86 | 89 | android:layout_height="match_parent" | 
| 87 | 90 | android:layout_weight="1" | 
| ... | ... | @@ -105,7 +108,8 @@ | 
| 105 | 108 | android:text="年 级:" | 
| 106 | 109 | android:textSize="@dimen/sp_16" /> | 
| 107 | 110 | |
| 108 | - <EditText | |
| 111 | + <TextView | |
| 112 | + android:id="@+id/child_grade" | |
| 109 | 113 | android:layout_width="wrap_content" | 
| 110 | 114 | android:layout_height="match_parent" | 
| 111 | 115 | android:layout_weight="1" | 
| ... | ... | @@ -129,7 +133,8 @@ | 
| 129 | 133 | android:text="班 级:" | 
| 130 | 134 | android:textSize="@dimen/sp_16" /> | 
| 131 | 135 | |
| 132 | - <EditText | |
| 136 | + <TextView | |
| 137 | + android:id="@+id/child_class" | |
| 133 | 138 | android:layout_width="wrap_content" | 
| 134 | 139 | android:layout_height="match_parent" | 
| 135 | 140 | android:layout_weight="1" | ... | ... |