Compare View

switch
from
...
to
 
Commits (4)
... ... @@ -17,5 +17,6 @@
17 17 <option name="resolveExternalAnnotations" value="false" />
18 18 </GradleProjectSettings>
19 19 </option>
  20 + <option name="offlineMode" value="true" />
20 21 </component>
21 22 </project>
22 23 \ No newline at end of file
... ...
app/src/main/java/com/hjx/parent/AccountActivity.java
... ... @@ -97,7 +97,7 @@ public class AccountActivity extends BaseActivity {
97 97 @Override
98 98 protected void initListener() {
99 99 findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed());
100   - findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class));
  100 + //findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class));
101 101 }
102 102  
103 103 @Override
... ...
app/src/main/java/com/hjx/parent/ChooseActivity.java
... ... @@ -128,9 +128,6 @@ public class ChooseActivity extends BaseActivity {
128 128 }
129 129  
130 130 public void loadList() {
131   - StudentBean sb = new StudentBean();
132   - sb.setNickName("添加学生");
133   - alist.add(sb);
134 131 String student = (String) SharedPreferencesUtil.getData("student", "");
135 132 try {
136 133 StudentBean studentBean = new Gson().fromJson(student, StudentBean.class);
... ... @@ -154,13 +151,7 @@ public class ChooseActivity extends BaseActivity {
154 151 StudentBean studentBean = alist.get(item.getAdapterPosition());
155 152 item.setText(R.id.tv_name, studentBean.getNickName());
156 153 if (TextUtils.isEmpty(studentBean.getStuId())) {
157   - item.setVisible(R.id.rl_add, true);
158   - item.getConvertView().setOnClickListener(new View.OnClickListener() {
159   - @Override
160   - public void onClick(View view) {
161   - startActivity(new Intent(ChooseActivity.this, AddStudentActivity.class));
162   - }
163   - });
  154 + // do nothing
164 155 } else {
165 156 item.setBackgroundRes(R.id.rl_child, select == item.getAdapterPosition() ? R.drawable.bg_solid_white_10_or : R.drawable.bg_solid_white_10);
166 157 item.setImageResource(R.id.iv_select, select == item.getAdapterPosition() ? R.mipmap.gx : R.mipmap.wsyq);
... ...
app/src/main/java/com/hjx/parent/EditStudentActivity.java
... ... @@ -70,8 +70,6 @@ public class EditStudentActivity extends BaseActivity {
70 70 ImageView iv_teacher;
71 71 @BindView(R.id.rl_teacher)
72 72 RelativeLayout rl_teacher;
73   - @BindView(R.id.tv_bind)
74   - TextView tv_bind;
75 73 @BindView(R.id.view_6)
76 74 LinearLayout view_6;
77 75 private static int CAMERA_REQUEST_CODE = 343;
... ... @@ -152,7 +150,6 @@ public class EditStudentActivity extends BaseActivity {
152 150 }
153 151 if (studentBean.getIsIntention() == 1) {
154 152 rl_teacher.setVisibility(View.VISIBLE);
155   - tv_bind.setText("重新绑定");
156 153 tv_teacher.setText(studentBean.getTeacherName());
157 154 if (!TextUtils.isEmpty(studentBean.getTeacherAvatar())) {
158 155 RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 25));
... ... @@ -164,8 +161,6 @@ public class EditStudentActivity extends BaseActivity {
164 161 } else {
165 162 rl_teacher.setVisibility(View.GONE);
166 163 if ((studentBean.getState() != null && studentBean.getState() == 0)) {
167   - tv_bind.setText("待通过");
168   - tv_bind.setTextColor(Color.parseColor("#FF3737"));
169 164 view_6.setEnabled(false);
170 165 }
171 166 }
... ... @@ -180,37 +175,10 @@ public class EditStudentActivity extends BaseActivity {
180 175 view_5.setOnClickListener(view -> startActivity(ShenActivity.class));
181 176 findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed());
182 177 btn_next.setOnClickListener(view -> {
183   - if (teacher != null || studentBean.getIsIntention() == 1 || (studentBean.getState() != null && studentBean.getState() == 0)) {
184   - editStudent();
185   - } else {
186   - showDialog("温馨提示", "您还未绑定老师,是否绑定?", "去绑定", "暂不绑定", new DialogInterface.OnClickListener() {
187   - @Override
188   - public void onClick(DialogInterface dialogInterface, int i) {
189   - dialogInterface.dismiss();
190   - showDialog("温馨提示", "您暂未绑定老师,如需绑定老师\n" + "请联系400-800-3813", "确定", "", null, new DialogInterface.OnClickListener() {
191   - @Override
192   - public void onClick(DialogInterface dialogInterface, int i) {
193   - editStudent();
194   - }
195   - });
196   - }
197   - }, new DialogInterface.OnClickListener() {
198   - @Override
199   - public void onClick(DialogInterface dialogInterface, int i) {
200   - Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class);
201   - startActivityForResult(intent, BIND_TEACHER_CODE);
202   - }
203   - });
204   - }
  178 + editStudent();
205 179 });
206 180 }
207 181  
208   - @OnClick(R.id.view_6)
209   - public void toAddTeacher(View view) {
210   - Intent intent = new Intent(EditStudentActivity.this, AddTeacherActivity.class);
211   - startActivityForResult(intent, BIND_TEACHER_CODE);
212   - }
213   -
214 182 public void editStudent() {
215 183 Map<String, Object> map = new HashMap<>();
216 184 map.put("nickName", studentBean.getNickName());
... ... @@ -323,7 +291,6 @@ public class EditStudentActivity extends BaseActivity {
323 291 String t = intent.getStringExtra("teacher");
324 292 teacher = new Gson().fromJson(t, Teacher.class);
325 293 rl_teacher.setVisibility(View.VISIBLE);
326   - tv_bind.setText("重新绑定");
327 294 tv_teacher.setText(teacher.getUserName());
328 295 if (!TextUtils.isEmpty(teacher.getPhoto())) {
329 296 RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 20));
... ...
app/src/main/java/com/hjx/parent/SmsLoginActivity.java
... ... @@ -10,11 +10,13 @@ import android.widget.Toast;
10 10  
11 11 import com.hjx.parent.databinding.ActivitySmsLoginBinding;
12 12 import com.hjx.parent.rx.BaseRxActivity;
  13 +import com.prws.common.bean.Student;
13 14 import com.prws.common.net.NetWorks;
14 15 import com.prws.common.utils.LogUtil;
15 16 import com.prws.common.utils.SharedPreferencesUtil;
16 17  
17 18 import java.util.HashMap;
  19 +import java.util.List;
18 20 import java.util.Map;
19 21 import java.util.concurrent.TimeUnit;
20 22  
... ... @@ -90,6 +92,11 @@ public class SmsLoginActivity extends BaseRxActivity&lt;ActivitySmsLoginBinding&gt; {
90 92 .subscribe((response, th) -> {
91 93 binding.btnLogin.setEnabled(true);
92 94 if (handleResponseData(response, th)) {
  95 + List<Student> list = response.getData().parentInfoList;
  96 + if (list == null || list.isEmpty()) {
  97 + showToast("未注册学生, 无法登录");
  98 + return;
  99 + }
93 100 SharedPreferencesUtil.putData("phone", phone);
94 101 SharedPreferencesUtil.putData("role", "parent");
95 102 SharedPreferencesUtil.putData("userId", response.getData().id);
... ...
app/src/main/java/com/hjx/parent/fragment/MeFragment.java
... ... @@ -145,9 +145,6 @@ public class MeFragment extends BaseFragment {
145 145 // }
146 146  
147 147 public void loadList() {
148   - StudentBean sb = new StudentBean();
149   - sb.setNickName("添加学生");
150   - alist.add(0, sb);
151 148 BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) {
152 149 @Override
153 150 public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
... ... @@ -159,14 +156,7 @@ public class MeFragment extends BaseFragment {
159 156 StudentBean studentBean = alist.get(item.getAdapterPosition());
160 157 item.setText(R.id.tv_name, studentBean.getNickName());
161 158 if (TextUtils.isEmpty(studentBean.getStuId())) {
162   - item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss);
163   - item.setVisible(R.id.iv_vip, false);
164   - item.getConvertView().setOnClickListener(new View.OnClickListener() {
165   - @Override
166   - public void onClick(View view) {
167   - startActivity(new Intent(getActivity(), AddStudentActivity.class));
168   - }
169   - });
  159 + // do nothing
170 160 } else {
171 161 if (TextUtils.isEmpty(studentBean.getPhoto())) {
172 162 item.setImageResource(R.id.iv_avatar, "男".equals(studentBean.getGender()) ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female);
... ...
app/src/main/res/layout/activity_edit_stu.xml
... ... @@ -258,25 +258,6 @@
258 258 android:layout_width="match_parent"
259 259 android:layout_height="50dp">
260 260  
261   - <ImageView
262   - android:layout_width="15dp"
263   - android:layout_height="15dp"
264   - android:layout_centerVertical="true"
265   - android:layout_marginRight="5dp"
266   - android:layout_toLeftOf="@+id/tv_bind"
267   - android:src="@mipmap/ic_bind_teacher" />
268   -
269   - <TextView
270   - android:id="@+id/tv_bind"
271   - android:layout_width="wrap_content"
272   - android:layout_height="wrap_content"
273   - android:layout_alignParentRight="true"
274   - android:layout_centerVertical="true"
275   - android:layout_marginRight="15dp"
276   - android:text="去绑定"
277   - android:textColor="#333333"
278   - android:textSize="16dp" />
279   -
280 261 <TextView
281 262 android:layout_width="wrap_content"
282 263 android:layout_height="wrap_content"
... ...
app/src/main/res/layout/activity_setac.xml
... ... @@ -85,7 +85,7 @@
85 85 <View
86 86 android:id="@+id/view_4"
87 87 android:layout_width="match_parent"
88   - android:layout_height="90dp"
  88 + android:layout_height="52dp"
89 89 android:layout_marginLeft="15dp"
90 90 android:layout_marginTop="185dp"
91 91 android:layout_marginRight="15dp"
... ... @@ -107,6 +107,7 @@
107 107 app:layout_constraintTop_toTopOf="@id/view_4" />
108 108  
109 109 <TextView
  110 + android:visibility="invisible"
110 111 android:id="@+id/tv_5"
111 112 android:layout_width="wrap_content"
112 113 android:layout_height="wrap_content"
... ... @@ -131,6 +132,7 @@
131 132 app:layout_constraintTop_toTopOf="@id/view_4" />
132 133  
133 134 <ImageView
  135 + android:visibility="invisible"
134 136 android:layout_width="5.5dp"
135 137 android:layout_height="9.5dp"
136 138 android:layout_marginRight="15dp"
... ... @@ -140,6 +142,7 @@
140 142 app:layout_constraintTop_toTopOf="@id/tv_7" />
141 143  
142 144 <TextView
  145 + android:visibility="invisible"
143 146 android:id="@+id/tv_7"
144 147 android:layout_width="wrap_content"
145 148 android:layout_height="wrap_content"
... ...
libs/common/src/main/java/com/prws/common/bean/User.java
1 1 package com.prws.common.bean;
2 2  
  3 +import java.util.ArrayList;
  4 +
3 5 public class User {
4 6  
5 7 public String id;
... ... @@ -11,5 +13,6 @@ public class User {
11 13 public String identityName; //用户身份(普通用户、管理员、内部员工)
12 14 public String gender; //性别
13 15 public String registration; //注册方式(用户创建、员工创建)
  16 + public ArrayList<Student> parentInfoList;
14 17 public String token;
15 18 }
... ...
libs/common/src/main/java/com/prws/common/net/NetWorks.java
... ... @@ -58,7 +58,7 @@ import retrofit2.http.Url;
58 58 */
59 59 public class NetWorks extends RetrofitUtils {
60 60 //服务器路径
61   - public static final NetService service_url = getMachineRetrofit(BuildConfig.SERVER_URL).create(NetService.class);
  61 + public static final NetService service_url = getMachineRetrofit("https://mgr.hjx.com").create(NetService.class);
62 62  
63 63 //设缓存有效期为1天
64 64 protected static final long CACHE_STALE_SEC = 60 * 60 * 24 * 1;
... ... @@ -103,7 +103,7 @@ public class NetWorks extends RetrofitUtils {
103 103 @GET("/api/v1/manager/generalQrCode")
104 104 Observable<ResponseBody> generalQrCode();
105 105  
106   - @GET("/api/v1/parent/scanAndLogin?")
  106 + @GET("/api/v1/parent/scanAndLogin")
107 107 Observable<ResponseBody> scanAndLogin(@Header("Authorization") String token, @Query("code") String code, @Query("stuId") String stuId);
108 108  
109 109 @GET("/api/v1/parent/getChildrenList")
... ...