作者 朱振飞

add

... ... @@ -50,13 +50,15 @@ public class ChildrenListEntity {
public static class DataBean {
/**
* "id": 207,
* "id": 2661,
* "gender": "女",
* "name": "张馨予",
* "photo": "http://tusmartedu.w.brotop.cn/assets/img/woman_icon.png",
* "class_name": "六年级(4班)",
* "grade_name": 6,
* "week_score": 0
* "name": "易楚笑",
* "photo": "http://class.ynsdfx.com/uploads/20200329/459394ccdf652cf31717d813c71f60c7.jpg",
* "class_name": "四年级(3班)",
* "grade_name": 4,
* "week_score": 0,
* "score_level": 1,
* "score_level_color": "#FF5E5E"
*/
private int id;
... ... @@ -66,6 +68,24 @@ public class ChildrenListEntity {
private String class_name;
private int grade_name;
private int week_score;
private String score_level;
private String score_level_color;
public String getScore_level() {
return score_level;
}
public void setScore_level(String score_level) {
this.score_level = score_level;
}
public String getScore_level_color() {
return score_level_color;
}
public void setScore_level_color(String score_level_color) {
this.score_level_color = score_level_color;
}
public int getId() {
return id;
... ...
... ... @@ -205,7 +205,22 @@ public class LoginEntity {
private String classId;
private String className;
private String photo;
private String score_level_color;
private String score_level;
public String getScore_level_color() {
return score_level_color;
}
public void setScore_level_color(String score_level_color) {
this.score_level_color = score_level_color;
}
public String getScore_level() {
return score_level;
}
public void setScore_level(String score_level) {
this.score_level = score_level;
}
public String getClassId() {
return classId;
... ...
... ... @@ -81,6 +81,8 @@ public class M {
public final static String Type = "Type";
public final static String ClassId = "ClassId";
public final static String StudentId = "StudentId";
public final static String SCORE_LEVEL = "SCORE_LEVEL";
public final static String SCORE_LEVEL_COLOR = "SCORE_LEVEL_COLOR";
public final static String StudentName = "StudentName";
public final static String UserJson = "UserJson";
public final static String IDENTITY = "identity";
... ...
... ... @@ -224,6 +224,10 @@ public class LoginActivity extends BaseActivity {
Config.StudentPhoto=entity.getData().getUser().getStudentInfoList().get(0).getPhoto();
SharedPreferenceUtil.put(LoginActivity.this,M.STUDENTPHOTO,Config.StudentPhoto);
}
SharedPreferenceUtil.put(LoginActivity.this,M.SCORE_LEVEL,entity.getData().getUser().getStudentInfoList().get(0).getScore_level());
SharedPreferenceUtil.put(LoginActivity.this,M.SCORE_LEVEL_COLOR,entity.getData().getUser().getStudentInfoList().get(0).getScore_level_color());
SharedPreferenceUtil.put(LoginActivity.this,M.StudentId,entity.getData().getUser().getStudentInfoList().get(0).getId());
SharedPreferenceUtil.put(LoginActivity.this,M.StudentName,entity.getData().getUser().getStudentInfoList().get(0).getStudentName());
}
... ...
... ... @@ -23,6 +23,7 @@ import com.yinhebairong.clasmanage.entity.ChildrenListEntity;
import com.yinhebairong.clasmanage.entity.LoginEntity;
import com.yinhebairong.clasmanage.m.M;
import com.yinhebairong.clasmanage.ui.MainActivity;
import com.yinhebairong.clasmanage.ui.login.LoginActivity;
import com.yinhebairong.clasmanage.utils.SharedPreferenceUtil;
import com.yinhebairong.clasmanage.widget.CircleImageView;
... ... @@ -115,9 +116,13 @@ public class Select_StudentActivity extends BaseActivity {
// SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentId,loginEntity.getData().getUser().getStudentInfoList().get(position).getId());
// SharedPreferenceUtil.put(Select_StudentActivity.this,M.ClassId,loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());
// SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentName,loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.SCORE_LEVEL, baseStudentSelectAdapter.getData().get(position).getScore_level());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.SCORE_LEVEL_COLOR, baseStudentSelectAdapter.getData().get(position).getScore_level_color());
Intent intent = new Intent(Select_StudentActivity.this, StudentHeadImgActivity.class);
intent.putExtra("student_id",baseStudentSelectAdapter.getData().get(position).getId());
intent.putExtra("student_img",baseStudentSelectAdapter.getData().get(position).getPhoto());
intent.putExtra("student_id", baseStudentSelectAdapter.getData().get(position).getId());
intent.putExtra("student_img", baseStudentSelectAdapter.getData().get(position).getPhoto());
startActivity(intent);
finish();
}
... ... @@ -126,17 +131,17 @@ public class Select_StudentActivity extends BaseActivity {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
Config.id = baseStudentSelectAdapter.getData().get(position).getId();
Config.Student_name=baseStudentSelectAdapter.getData().get(position).getName();
Config.StudentPhoto=baseStudentSelectAdapter.getData().get(position).getPhoto();
for(LoginEntity.DataBean.UserBean.StudentInfoListBean bean:loginEntity.getData().getUser().getStudentInfoList()){
if(bean.getId()==Config.id){
Config.ClassId=bean.getClassId();
Config.Student_name = baseStudentSelectAdapter.getData().get(position).getName();
Config.StudentPhoto = baseStudentSelectAdapter.getData().get(position).getPhoto();
for (LoginEntity.DataBean.UserBean.StudentInfoListBean bean : loginEntity.getData().getUser().getStudentInfoList()) {
if (bean.getId() == Config.id) {
Config.ClassId = bean.getClassId();
}
}
SharedPreferenceUtil.put(Select_StudentActivity.this,M.STUDENTPHOTO,baseStudentSelectAdapter.getData().get(position).getPhoto());
SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentId,loginEntity.getData().getUser().getStudentInfoList().get(position).getId());
SharedPreferenceUtil.put(Select_StudentActivity.this,M.ClassId,loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());
SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentName,loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.STUDENTPHOTO, baseStudentSelectAdapter.getData().get(position).getPhoto());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.StudentId, loginEntity.getData().getUser().getStudentInfoList().get(position).getId());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.ClassId, loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());
SharedPreferenceUtil.put(Select_StudentActivity.this, M.StudentName, loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName());
Intent intent = new Intent(Select_StudentActivity.this, MainActivity.class);
startActivity(intent);
setResult(RESULT_OK);
... ... @@ -155,6 +160,7 @@ public class Select_StudentActivity extends BaseActivity {
class BaseStudentSelectAdapter extends BaseQuickAdapter<ChildrenListEntity.DataBean, BaseViewHolder> {
private Context mContext;
public BaseStudentSelectAdapter(int layoutResId, @Nullable List<ChildrenListEntity.DataBean> data, Context context) {
super(layoutResId, data);
this.mContext = context;
... ...