Commit bb076c6230a99dfcf026893b4359564bf81a4d32

Authored by xiongwei
1 parent 8906c92400
Exists in master

用户反馈接口和头像上传接口调试

Showing 27 changed files with 468 additions and 466 deletions   Show diff stats
PersonalCenter/app/src/androidTest/java/com/hjx/personalcenter/ExampleInstrumentedTest.java
1 1 package com.hjx.personalcenter;
2 2  
3   -import android.os.Handler;
4   -import android.os.Message;
5   -
6 3 /**
7 4 * Instrumentation test, which will execute on an Android device.
8 5 *
... ... @@ -10,34 +7,4 @@ import android.os.Message;
10 7 */
11 8 public class ExampleInstrumentedTest {
12 9  
13   - // handler类接收数据
14   - Handler handler = new Handler() {
15   - public void handleMessage(Message msg) {
16   - if (msg.what == 1) {
17   - System.out.println("receive....");
18   - }
19   - };
20   - };
21   -
22   - // 线程类
23   - class ThreadShow implements Runnable {
24   -
25   - @Override
26   - public void run() {
27   - // TODO Auto-generated method stub
28   - while (true) {
29   - try {
30   - Thread.sleep(1000);
31   - Message msg = new Message();
32   - msg.what = 1;
33   - handler.sendMessage(msg);
34   - System.out.println("send...");
35   - } catch (Exception e) {
36   - // TODO Auto-generated catch block
37   - e.printStackTrace();
38   - System.out.println("thread error...");
39   - }
40   - }
41   - }
42   - }
43 10 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
... ... @@ -27,55 +27,76 @@ import com.hjx.personalcenter.util.GetDevicesUtil;
27 27 import java.util.ArrayList;
28 28 import java.util.List;
29 29  
30   -/**账户管理 熊巍
  30 +/**
  31 + * 账户管理 熊巍
31 32 * Created by h on 2017/8/12.
32 33 */
33 34  
34 35 public class AccountManagementActivity extends AppCompatActivity implements View.OnClickListener {
35   - private TextView changbangding,changpassword,usernames,
36   - tv_username,tv_grade,tv_school,tv_adress,tv_changzhu;
37   - private ImageView iv_useing,cancel;
  36 + private TextView changbangding, changpassword, usernames,
  37 + tv_username, tv_grade, tv_school, tv_adress, tv_changzhu;
  38 + private ImageView iv_useing, cancel;
38 39 private SimpleDraweeView mSimpleDraweeView;
39 40 private RecyclerView listview;
40   - private LinearLayout add_accunt,ll_zhu_backgrangd;
  41 + private LinearLayout add_accunt, ll_zhu_backgrangd;
41 42 private AccountChildsAdapter childsAdapter;
42 43 private ArrayList<ChildsInfo.DataBean> data = new ArrayList<>();
43   - Handler handler = new Handler(){
  44 + Handler handler = new Handler() {
44 45 @Override
45 46 public void handleMessage(Message msg) {
46 47 super.handleMessage(msg);
47   - switch (msg.what){
  48 + switch (msg.what) {
48 49 case HttpCode.CHILDS_SUCESS:
49   - String name = null;
50   - String grade = null;
51   - String school = null;
52   - String addr = null;
53   - String phote = null;
54   - List<ChildsInfo.DataBean> childList = new ArrayList<>() ;
55   - List<ChildsInfo.DataBean> list = (List<ChildsInfo.DataBean>)msg.obj ;
56   - for (int i = 0; i < list.size(); i++) {
57   - int type = list.get(i).getType();
58   - if(type == 1){
59   - name = list.get(i).getName();
60   - grade = list.get(i).getGrade();
61   - school = list.get(i).getSchool();
62   - addr = list.get(i).getRegion();
63   - phote = list.get(i).getImage();
64   - }else if (type == 2){
65   - childList.add(list.get(i));
  50 + ChildsInfo childsInfo = new ChildsInfo();
  51 + if (childsInfo.getStatus()==1000) {
  52 + String names =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.USERNAME);
  53 + String adress =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.ADRESS);
  54 + String grades =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.GRADES);
  55 + String schools =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.SCHOOL);
  56 + tv_username.setText(names);
  57 + tv_grade.setText(grades);
  58 + tv_school.setText(schools);
  59 + tv_adress.setText(adress);
  60 + tv_changzhu.setText("使用中");
  61 + tv_changzhu.setEnabled(false);
  62 + iv_useing.setVisibility(View.VISIBLE);
  63 + ll_zhu_backgrangd.setBackgroundResource(R.drawable.corcle_blue_bg);
  64 + //mSimpleDraweeView.setImageURI(phote);
  65 +
  66 + } else {
  67 + String name = null;
  68 + String grade = null;
  69 + String school = null;
  70 + String addr = null;
  71 + String phote = null;
  72 + List<ChildsInfo.DataBean> childList = new ArrayList<>();
  73 + List<ChildsInfo.DataBean> list = (List<ChildsInfo.DataBean>) msg.obj;
  74 + for (int i = 0; i < list.size(); i++) {
  75 + int type = list.get(i).getType();
  76 + if (type == 1) {
  77 + name = list.get(i).getName();
  78 + grade = list.get(i).getGrade();
  79 + school = list.get(i).getSchool();
  80 + addr = list.get(i).getRegion();
  81 + phote = list.get(i).getImage();
  82 + } else if (type == 2) {
  83 + childList.add(list.get(i));
  84 + }
66 85 }
  86 + tv_username.setText(name);
  87 + tv_grade.setText(grade);
  88 + tv_school.setText(school);
  89 + tv_adress.setText(addr);
  90 + mSimpleDraweeView.setImageURI(phote);
  91 + data.clear();
  92 + data.addAll(childList);
  93 + childsAdapter.notifyDataSetChanged();
67 94 }
68   - tv_username.setText(name);
69   - tv_grade.setText(grade);
70   - tv_school.setText(school);
71   - tv_adress.setText(addr);
72   - data.clear();
73   - data.addAll(childList);
74   - childsAdapter.notifyDataSetChanged();
75 95 break;
76 96 }
77 97 }
78 98 };
  99 +
79 100 @Override
80 101 protected void onCreate(Bundle savedInstanceState) {
81 102 super.onCreate(savedInstanceState);
... ... @@ -96,28 +117,24 @@ public class AccountManagementActivity extends AppCompatActivity implements View
96 117 tv_adress = (TextView) findViewById(R.id.tv_account_adress);
97 118 mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.tv_account_head);
98 119 iv_useing = (ImageView) findViewById(R.id.iv_shiyongzhong);
99   - cancel = (ImageView) findViewById(R.id.cancel);
100   - add_accunt = (LinearLayout) findViewById(R.id.add_account);
  120 + cancel = (ImageView) findViewById(R.id.cancel);
  121 + add_accunt = (LinearLayout) findViewById(R.id.add_account);
101 122 ll_zhu_backgrangd = (LinearLayout) findViewById(R.id.ll_zhu_backgrangd);
102 123 tv_changzhu = (TextView) findViewById(R.id.change_zhu_account);
103 124 listview = (RecyclerView) findViewById(R.id.id_recyclerview_horizontal);
104 125 }
105 126  
106 127 private void initData() {
107   - String cunt_username = SaveParam.getInstance().getLoginParam(this,"username");
108   - String tv_usernames = SaveParam.getInstance().getLoginParam(this,SaveParam.USERNAME);
109   - String tv_grades = SaveParam.getInstance().getLoginParam(this,SaveParam.GRADES);
110   - String tv_schools = SaveParam.getInstance().getLoginParam(this,SaveParam.SCHOOL);
111   - String tv_adresss = SaveParam.getInstance().getLoginParam(this,SaveParam.ADRESS);
112   - String account = SaveParam.getInstance().getLoginParam(this,SaveParam.ACCOUNT);
  128 + String cunt_username = SaveParam.getInstance().getLoginParam(this, "username");
  129 + String account = SaveParam.getInstance().getCustomizeParam(this, SaveParam.ACCOUNT);
113 130 usernames.setText(cunt_username);
114 131  
115   - if (account.equals("1")){
  132 + if (account.equals("1")) {
116 133 tv_changzhu.setText("使用中");
117 134 tv_changzhu.setEnabled(false);
118 135 iv_useing.setVisibility(View.VISIBLE);
119 136 ll_zhu_backgrangd.setBackgroundResource(R.drawable.corcle_blue_bg);
120   - }else {
  137 + } else {
121 138  
122 139 tv_changzhu.setText("切换主账户");
123 140 tv_changzhu.setEnabled(true);
... ... @@ -129,14 +146,14 @@ public class AccountManagementActivity extends AppCompatActivity implements View
129 146 LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
130 147 linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
131 148 listview.setLayoutManager(linearLayoutManager);
132   - childsAdapter = new AccountChildsAdapter(data,this);
  149 + childsAdapter = new AccountChildsAdapter(data, this);
133 150 listview.addItemDecoration(new RecyclerViewSpaceItem(10));
134 151 listview.setAdapter(childsAdapter);
135 152 childsAdapter.setOnItemClickListener(new AccountChildsAdapter.OnItemClickListener() {
136 153 @Override
137 154 public void onItemClick(View view, int position) {
138 155  
139   - AlertUtils.showToast(AccountManagementActivity.this,"你点击了"+data.get(position));
  156 + AlertUtils.showToast(AccountManagementActivity.this, "你点击了" + data.get(position));
140 157 }
141 158 });
142 159  
... ... @@ -151,42 +168,41 @@ public class AccountManagementActivity extends AppCompatActivity implements View
151 168 tv_changzhu.setOnClickListener(this);
152 169  
153 170  
154   -
155 171 }
156 172  
157 173 @Override
158 174 public void onClick(View v) {
159   - switch (v.getId()){
  175 + switch (v.getId()) {
160 176 case R.id.changBangding:
161 177 Intent changebangding = new Intent();
162   - changebangding.setClass(AccountManagementActivity.this,ChangeBangDingActivity.class);
  178 + changebangding.setClass(AccountManagementActivity.this, ChangeBangDingActivity.class);
163 179 startActivity(changebangding);
164 180 overridePendingTransition(R.anim.rightin, R.anim.rightout);
165 181 break;
166 182 case R.id.changpassword:
167 183 Content.authcodeflag = 1;
168 184 Intent changpwd = new Intent();
169   - changpwd.setClass(AccountManagementActivity.this,ChangePasswordActivity.class);
  185 + changpwd.setClass(AccountManagementActivity.this, ChangePasswordActivity.class);
170 186 startActivity(changpwd);
171 187 overridePendingTransition(R.anim.rightin, R.anim.rightout);
172 188 break;
173 189 case R.id.add_account:
174 190 Content.accountflag = 2;
175 191 Intent account = new Intent();
176   - account.setClass(AccountManagementActivity.this,RegisterInfoActivity.class);
  192 + account.setClass(AccountManagementActivity.this, RegisterInfoActivity.class);
177 193 startActivity(account);
178 194 overridePendingTransition(R.anim.rightin, R.anim.rightout);
179 195  
180 196 break;
181 197 case R.id.change_zhu_account:
182   - Content.changgeaccountflag =1;
183   - String userID = SaveParam.getInstance().getLoginParam(this,"userId");
184   - SaveParam.getInstance().saveLoginParam(this,SaveParam.ACCOUNT,"1");
  198 + Content.changgeaccountflag = 1;
  199 + String userID = SaveParam.getInstance().getLoginParam(this, "userId");
  200 + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.ACCOUNT, "1");
185 201 String devicenumber = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber();
186 202 try {
187 203 long auserID = Long.parseLong(userID);
188   - HttpManager.getInstance().Accountinfo(AccountManagementActivity.this,auserID,
189   - devicenumber,1);
  204 + HttpManager.getInstance().Accountinfo(AccountManagementActivity.this, auserID,
  205 + devicenumber, 1);
190 206  
191 207 } catch (NumberFormatException e) {
192 208 e.printStackTrace();
... ... @@ -205,11 +221,11 @@ public class AccountManagementActivity extends AppCompatActivity implements View
205 221 @Override
206 222 protected void onResume() {
207 223 super.onResume();
208   - String userID = SaveParam.getInstance().getLoginParam(this,"userId");
  224 + String userID = SaveParam.getInstance().getLoginParam(this, "userId");
209 225 String devicenumber = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber();
210 226 try {
211 227 long auserID = Long.parseLong(userID);
212   - HttpManager.getInstance().getchildAccountinfo(this,auserID,devicenumber,handler);
  228 + HttpManager.getInstance().getchildAccountinfo(this, auserID, devicenumber, handler);
213 229  
214 230 } catch (NumberFormatException e) {
215 231 e.printStackTrace();
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java
... ... @@ -29,6 +29,7 @@ import com.hjx.personalcenter.util.PhoneNumCheckUtils;
29 29 import org.json.JSONObject;
30 30  
31 31 import java.util.ArrayList;
  32 +import java.util.TimerTask;
32 33  
33 34 /**
34 35 * Created by h on 2017/8/9.
... ... @@ -42,8 +43,8 @@ public class ChangeElectronicCardAdressInfoActivity extends AppCompatActivity im
42 43 private TextView adress;
43 44 private Button forot_pwd_sub,forot_pwd_getanthcode;
44 45 private String typeStr = "register";
45   - private int i = 0;
46   - private Thread thread;
  46 + private int delayTime=60;
  47 + private java.util.Timer Delaytimer;
47 48 Handler handler = new Handler() {
48 49 @Override
49 50 public void handleMessage(Message msg) {
... ... @@ -63,15 +64,19 @@ public class ChangeElectronicCardAdressInfoActivity extends AppCompatActivity im
63 64 jsonObject = (JSONObject) msg.obj;
64 65 AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, jsonObject.optString("验证码发送失败,请检查网络"));
65 66 break;
66   - case 1:
67   - forot_pwd_getanthcode.setEnabled(false);
68   - forot_pwd_getanthcode.setClickable(false);
69   - forot_pwd_getanthcode.setText(Integer.toString(i--)+" s");
70   - if (i<=0){
  67 + case 21:
  68 + if(delayTime<=0){
  69 + if(Delaytimer!=null){
  70 + Delaytimer.cancel();
  71 + }
71 72 forot_pwd_getanthcode.setEnabled(true);
72 73 forot_pwd_getanthcode.setClickable(true);
73 74 forot_pwd_getanthcode.setText("获取验证码");
74   -
  75 + delayTime=60;
  76 + }else{
  77 + forot_pwd_getanthcode.setEnabled(false);
  78 + forot_pwd_getanthcode.setClickable(false);
  79 + forot_pwd_getanthcode.setText(delayTime + " s");
75 80 }
76 81 break;
77 82 }
... ... @@ -89,11 +94,7 @@ public class ChangeElectronicCardAdressInfoActivity extends AppCompatActivity im
89 94 forot_pwd_anthcode.requestFocus();
90 95 String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim();
91 96 HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this);
92   - i = 60;
93   - if(thread == null){
94   - thread = new Thread( new ThreadShow());
95   - thread.start();
96   - }
  97 + valiDelay();
97 98  
98 99 }
99 100 private void initView() {
... ... @@ -188,29 +189,27 @@ public class ChangeElectronicCardAdressInfoActivity extends AppCompatActivity im
188 189 String regionName = data.get(position).getRegionName();
189 190 SaveParam.getInstance().saveLoginParam(this,"sheng",regionName);
190 191 CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog");
191   -
  192 + adress.setText("");
  193 + adress.setText(regionName);
192 194 }
193 195  
194 196 // 线程类 定时器
195   - class ThreadShow implements Runnable {
  197 + public void valiDelay() {
  198 +
  199 + Delaytimer = new java.util.Timer(true);
  200 +
  201 +
  202 + TimerTask task = new TimerTask() {
  203 + public void run() {
  204 + //每次需要执行的代码放到这里面。
  205 + delayTime--;
  206 + handler.sendEmptyMessage(21);
  207 +
  208 +
196 209  
197   - @Override
198   - public void run() {
199   - // TODO Auto-generated method stub
200   - while (true) {
201   - try {
202   - Thread.sleep(1000);
203   - Message msg = new Message();
204   - msg.what = 1;
205   - handler.sendMessage(msg);
206   - System.out.println("send...");
207   - } catch (Exception e) {
208   - // TODO Auto-generated catch block
209   - e.printStackTrace();
210   - System.out.println("thread error...");
211   - }
212 210 }
213   - }
  211 + };
  212 + Delaytimer.schedule(task, 1000,1000);
214 213 }
215 214  
216 215 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChoiseTextBookActivity.java
... ... @@ -16,6 +16,7 @@ import com.hjx.personalcenter.customdialog.ElectronicCardDialog;
16 16 import com.hjx.personalcenter.db.SaveParam;
17 17 import com.hjx.personalcenter.http.HttpCode;
18 18 import com.hjx.personalcenter.http.HttpManager;
  19 +import com.hjx.personalcenter.util.AlertUtils;
19 20  
20 21 import org.json.JSONException;
21 22 import org.json.JSONObject;
... ... @@ -25,7 +26,8 @@ import java.util.HashMap;
25 26 import java.util.List;
26 27 import java.util.Map;
27 28  
28   -/**选择教材
  29 +/**
  30 + * 选择教材
29 31 * Created by h on 2017/8/10.
30 32 */
31 33  
... ... @@ -36,35 +38,35 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On
36 38 private List<Map<String, Object>> data_list;
37 39 private SimpleAdapter sim_adapter;
38 40 // 图片封装为一个数组
39   - private int[] icon = { R.mipmap.ic_launcher, R.mipmap.ic_launcher,
  41 + private int[] icon = {R.mipmap.ic_launcher, R.mipmap.ic_launcher,
40 42 R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
41 43 R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
42 44 R.mipmap.ic_launcher};
43   - private String[] subject = { "语文", "数学", "英语", "物理", "化学", "生物", "政治",
44   - "历史", "地理" };
45   - private String[] publish = { "人民教育出版社", "人民教育出版社", "人民教育出版社",
  45 + private String[] subject = {"语文", "数学", "英语", "物理", "化学", "生物", "政治",
  46 + "历史", "地理"};
  47 + private String[] publish = {"人民教育出版社", "人民教育出版社", "人民教育出版社",
46 48 "人民教育出版社", "人民教育出版社", "人民教育出版社", "人民教育出版社",
47   - "人民教育出版社", "人民教育出版社" };
  49 + "人民教育出版社", "人民教育出版社"};
48 50  
49 51  
50   - Handler handler = new Handler(){
  52 + Handler handler = new Handler() {
51 53 @Override
52 54 public void handleMessage(Message msg) {
53 55 super.handleMessage(msg);
54 56 JSONObject jsonObject;
55 57 String status;
56   - switch (msg.what){
  58 + switch (msg.what) {
57 59 case HttpCode.CHECKCARD:
58 60 try {
59   - jsonObject = new JSONObject( (String) msg.obj);
  61 + jsonObject = new JSONObject((String) msg.obj);
60 62 status = jsonObject.optString("status");
61   - if (status.equals("1")){
  63 + if (status.equals("1")) {
62 64 Intent intent = new Intent();
63 65 intent.setClass(ChoiseTextBookActivity.this, TheStartPageActivity.class);
64 66 ChoiseTextBookActivity.this.startActivity(intent);
65 67 overridePendingTransition(R.anim.rightin, R.anim.rightout);
66 68 finish();
67   - }else if(status.equals("2001")){
  69 + } else if (status.equals("2001")) {
68 70 ElectronicCardDialog.getInstance().show(getSupportFragmentManager(), "ElectronicCardDialog");
69 71 }
70 72  
... ... @@ -97,8 +99,8 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On
97 99 private void initData() {
98 100 data_list = new ArrayList<Map<String, Object>>();
99 101 getData();
100   - String [] from ={"image","text","text1"};
101   - int [] to = {R.id.image,R.id.text};
  102 + String[] from = {"image", "text", "text1"};
  103 + int[] to = {R.id.image, R.id.text};
102 104 sim_adapter = new SimpleAdapter(this, data_list, R.layout.activity_choisetextbook_items, from, to);
103 105 //配置适配器
104 106 gridView.setAdapter(sim_adapter);
... ... @@ -110,9 +112,10 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On
110 112 cancel.setOnClickListener(this);
111 113  
112 114 }
113   - public List<Map<String, Object>> getData(){
  115 +
  116 + public List<Map<String, Object>> getData() {
114 117 //cion和iconName的长度是相同的,这里任选其一都可以
115   - for(int i=0;i<icon.length;i++){
  118 + for (int i = 0; i < icon.length; i++) {
116 119 Map<String, Object> map = new HashMap<String, Object>();
117 120 map.put("image", icon[i]);
118 121 map.put("text", subject[i]);
... ... @@ -125,17 +128,23 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On
125 128  
126 129 @Override
127 130 public void onClick(View v) {
128   - switch (v.getId()){
  131 + switch (v.getId()) {
129 132 case R.id.btn_ok:
130   - String userID = SaveParam.getInstance().getLoginParam(this,"userId");
  133 + String userID = SaveParam.getInstance().getLoginParam(this, "userId");
131 134 try {
132   - long auserID = Long.parseLong(userID);
133   - HttpManager.getInstance().cardinfocheck(this,auserID,handler);
  135 + if (userID == null) {
  136 + AlertUtils.showToast(ChoiseTextBookActivity.this, "连接超时请重新登录!");
  137 +
  138 + } else {
  139 + long auserID = Long.parseLong(userID);
  140 + HttpManager.getInstance().cardinfocheck(this, auserID, handler);
  141 + }
  142 +
134 143 } catch (NumberFormatException e) {
135 144 e.printStackTrace();
136 145 }
137 146  
138   - break;
  147 + break;
139 148 case R.id.cancel:
140 149 finish();
141 150 break;
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
1 1 package com.hjx.personalcenter.activity;
2 2  
3 3 import android.content.Intent;
4   -import android.graphics.Color;
5 4 import android.os.Bundle;
6 5 import android.support.v7.app.AppCompatActivity;
7 6 import android.text.TextUtils;
... ... @@ -26,9 +25,7 @@ import com.hjx.personalcenter.model.ProvinceInfo;
26 25 import com.hjx.personalcenter.util.AlertUtils;
27 26 import com.hjx.personalcenter.util.GetDate;
28 27  
29   -import java.text.SimpleDateFormat;
30 28 import java.util.ArrayList;
31   -import java.util.Date;
32 29  
33 30 /**填写保卡信息 熊巍
34 31 * Created by h on 2017/8/11.
... ... @@ -51,7 +48,6 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements
51 48 initView();
52 49 initData();
53 50 initLister();
54   - initTimePicker();
55 51 }
56 52  
57 53 private void initView() {
... ... @@ -74,61 +70,15 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements
74 70 }
75 71  
76 72 private void initLister() {
77   - lineL_buy_time.setOnClickListener(this);
78 73 adress_shop.setOnClickListener(this);
79 74 adress_custem.setOnClickListener(this);
80 75 btn_change_info.setOnClickListener(this);
81 76  
82 77 }
83   - //自定义时间选择器
84   - private void initTimePicker() {
85   - //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释)
86   - //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
87   -// Calendar selectedDate = Calendar.getInstance();
88   -// Calendar startDate = Calendar.getInstance();
89   -// startDate.set(1900, 1, 1);
90   -// Calendar endDate = Calendar.getInstance();
91   -// endDate.set(2100, 1, 1);
92   - //时间选择器
93   - pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
94   - @Override
95   - public void onTimeSelect(Date date, View v) {//选中事件回调
96   - // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null
97   - /*btn_Time.setText(getTime(date));*/
98   - TextView btn = (TextView) v;
99   - btn.setText(getTime(date));
100   - }
101   - })
102   - //年月日时分秒 的显示与否,不设置则默认全部显示
103   - .setType(new boolean[]{true, true, true, false, false, false})
104   - .setLabel("", "", "", "", "", "")
105   - .isCenterLabel(false)
106   - .setDividerColor(Color.DKGRAY)
107   - .setContentSize(21)
108   -// .setDate(selectedDate)
109   -// .setRangDate(startDate, endDate)
110   - .setBackgroundId(0x80000000) //设置外部遮罩颜色
111   - .setDecorView(null)
112   - .setTitleText("购买日期")
113   - .setTitleSize(22)
114   - .setCancelColor(Color.GRAY)
115   - .setSubCalSize(22)
116   - .setDividerColor(Color.GRAY)
117   - .setSubmitColor(Color.GRAY)
118   - .build();
119   - }
120   - private String getTime(Date date) {//可根据需要自行截取数据显示
121   - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
122   - return format.format(date);
123   - }
124 78  
125 79 @Override
126 80 public void onClick(View v) {
127 81 switch (v.getId()){
128   - case R.id.lineL_buy_time:
129   -
130   - //pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view
131   - break;
132 82 case R.id.btn_change_info:
133 83 String info1 =username.getText().toString().trim();
134 84 String info2 =adress_custem.getText().toString().trim();
... ... @@ -218,7 +168,8 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements
218 168 String regionName = data.get(position).getRegionName();
219 169 SaveParam.getInstance().saveLoginParam(this,"sheng",regionName);
220 170 CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog");
221   -
  171 + adress_custem.setText("");
  172 + adress_custem.setText(regionName);
222 173  
223 174 }
224 175 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
... ... @@ -22,6 +22,8 @@ import com.hjx.personalcenter.util.PhoneNumCheckUtils;
22 22  
23 23 import org.json.JSONObject;
24 24  
  25 +import java.util.TimerTask;
  26 +
25 27 /**
26 28 * Created by h on 2017/8/9.
27 29 */
... ... @@ -31,8 +33,8 @@ public class ElectronicCardValidationActivity extends AppCompatActivity implemen
31 33 private EditText phonenumber,anth_6num;//;//密码
32 34 private TextView menu_title;
33 35 private ImageView cancel;
34   - private int i = 0;
35   - private Thread thread;
  36 + private int delayTime=60;
  37 + private java.util.Timer Delaytimer;
36 38 private String sourceStr ="android";
37 39 private String typeStr = "register";
38 40 String authcode = "";
... ... @@ -55,14 +57,19 @@ public class ElectronicCardValidationActivity extends AppCompatActivity implemen
55 57 case HttpCode.AUTHCODE_FAIL:
56 58 AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送失败");
57 59 break;
58   - case 1:
59   - get_authcode.setEnabled(false);
60   - get_authcode.setClickable(false);
61   - get_authcode.setText(Integer.toString(i--)+" s");
62   - if (i<=0){
  60 + case 21:
  61 + if(delayTime<=0){
  62 + if(Delaytimer!=null){
  63 + Delaytimer.cancel();
  64 + }
63 65 get_authcode.setEnabled(true);
64 66 get_authcode.setClickable(true);
65 67 get_authcode.setText("获取验证码");
  68 + delayTime=60;
  69 + }else{
  70 + get_authcode.setEnabled(false);
  71 + get_authcode.setClickable(false);
  72 + get_authcode.setText(delayTime + " s");
66 73 }
67 74 break;
68 75 }
... ... @@ -166,11 +173,7 @@ public class ElectronicCardValidationActivity extends AppCompatActivity implemen
166 173 }else {
167 174 anth_6num.requestFocus();
168 175 HttpManager.getInstance().authCode(typeStr, usernameStr1, handler, ElectronicCardValidationActivity.this);
169   - i = 60;
170   - if(thread == null){
171   - thread = new Thread( new ThreadShow());
172   - thread.start();
173   - }
  176 + valiDelay();
174 177  
175 178 }
176 179  
... ... @@ -181,24 +184,18 @@ public class ElectronicCardValidationActivity extends AppCompatActivity implemen
181 184 }
182 185 }
183 186 // 线程类 定时器
184   - class ThreadShow implements Runnable {
  187 + public void valiDelay() {
185 188  
186   - @Override
187   - public void run() {
188   - // TODO Auto-generated method stub
189   - while (true) {
190   - try {
191   - Thread.sleep(1000);
192   - Message msg = new Message();
193   - msg.what = 1;
194   - handler.sendMessage(msg);
195   - System.out.println("send...");
196   - } catch (Exception e) {
197   - // TODO Auto-generated catch block
198   - e.printStackTrace();
199   - System.out.println("thread error...");
200   - }
  189 + Delaytimer = new java.util.Timer(true);
  190 +
  191 +
  192 + TimerTask task = new TimerTask() {
  193 + public void run() {
  194 + //每次需要执行的代码放到这里面。
  195 + delayTime--;
  196 + handler.sendEmptyMessage(21);
201 197 }
202   - }
  198 + };
  199 + Delaytimer.schedule(task, 1000,1000);
203 200 }
204 201 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/FeedBackActivity.java
... ... @@ -11,7 +11,6 @@ import android.support.annotation.NonNull;
11 11 import android.support.v4.content.FileProvider;
12 12 import android.support.v7.app.AppCompatActivity;
13 13 import android.text.TextUtils;
14   -import android.util.Log;
15 14 import android.view.Gravity;
16 15 import android.view.View;
17 16 import android.widget.AdapterView;
... ... @@ -29,12 +28,10 @@ import com.facebook.drawee.view.SimpleDraweeView;
29 28 import com.hjx.personalcenter.R;
30 29 import com.hjx.personalcenter.db.SaveParam;
31 30 import com.hjx.personalcenter.http.HttpManager;
32   -import com.hjx.personalcenter.model.FeedBackInfo;
33 31 import com.hjx.personalcenter.util.AlertUtils;
34 32 import com.hjx.personalcenter.util.CropUtils;
35 33 import com.hjx.personalcenter.util.DialogPermission;
36 34 import com.hjx.personalcenter.util.FileUtil;
37   -import com.hjx.personalcenter.util.GetDate;
38 35 import com.hjx.personalcenter.util.PermissionUtil;
39 36 import com.hjx.personalcenter.util.SharedPreferenceMark;
40 37 import com.mylhyl.circledialog.CircleDialog;
... ... @@ -44,8 +41,6 @@ import com.mylhyl.circledialog.params.ButtonParams;
44 41 import com.mylhyl.circledialog.params.DialogParams;
45 42  
46 43 import java.io.File;
47   -import java.util.ArrayList;
48   -import java.util.List;
49 44  
50 45 /**
51 46 * Created by h on 2017/8/11.
... ... @@ -59,6 +54,7 @@ public class FeedBackActivity extends AppCompatActivity implements View.OnClickL
59 54 private static final int REQUEST_CODE_ALBUM = 2;
60 55 private static final int REQUEST_CODE_CROUP_PHOTO = 3;
61 56 SimpleDraweeView mSimpleDraweeView;
  57 + String type = "个人中心";
62 58 private File file;
63 59 private Uri uri;
64 60  
... ... @@ -83,7 +79,7 @@ public class FeedBackActivity extends AppCompatActivity implements View.OnClickL
83 79 }
84 80  
85 81 private void initData() {
86   - file = new File(FileUtil.getCachePath(this), "user-avatar.jpg");
  82 + file = new File(FileUtil.getCachePath(this), "user-feedback.jpg");
87 83 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
88 84 uri = Uri.fromFile(file);
89 85 } else {
... ... @@ -118,25 +114,10 @@ public class FeedBackActivity extends AppCompatActivity implements View.OnClickL
118 114 AlertUtils.showToast(FeedBackActivity.this, "请将必填项填写完整");
119 115 return;
120 116 }
121   - long auserID = 0;
122   - GetDate date = new GetDate();
123 117 String userID = SaveParam.getInstance().getLoginParam(this, "userId");
124 118 try {
125   - auserID = Long.parseLong(userID);
126   -
127   - FeedBackInfo feedBackInfo = new FeedBackInfo();
128   - feedBackInfo.setUserId(auserID);
129   - feedBackInfo.setContact(contants);
130   - feedBackInfo.setContent(contents);
131   - feedBackInfo.setFeedBackDate(date.getYMD().toString());
132   - feedBackInfo.setFeedtype("个人中心");
133   - List<FeedBackInfo.ImgUrlBean> feedbackBean = new ArrayList<>();
134   - FeedBackInfo.ImgUrlBean imgurl = new FeedBackInfo.ImgUrlBean();
135   - imgurl.setImgUrl(file.getPath());
136   - feedbackBean.add(imgurl);
137   - feedBackInfo.setImgUrl(feedbackBean);
138   - Log.e("test", feedBackInfo.toString());
139   - HttpManager.getInstance().feedback(FeedBackActivity.this, feedBackInfo);
  119 + HttpManager.getInstance().feedback(FeedBackActivity.this, userID,
  120 + contents,contants,file.getPath(),type);
140 121 } catch (Exception e) {
141 122 e.printStackTrace();
142 123 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ForgotPasswordActivity.java
... ... @@ -23,7 +23,6 @@ import com.hjx.personalcenter.util.PhoneNumCheckUtils;
23 23 import org.json.JSONException;
24 24 import org.json.JSONObject;
25 25  
26   -import java.util.Timer;
27 26 import java.util.TimerTask;
28 27  
29 28 /**
... ... @@ -40,8 +39,8 @@ public class ForgotPasswordActivity extends AppCompatActivity implements View.On
40 39 private String forot_pwd_pwd3;
41 40 private String forot_pwd_pwd4;
42 41 private String typeStr = "login";
43   - private int i = 0;
44   - private Thread thread;
  42 + private int delayTime=60;
  43 + private java.util.Timer Delaytimer;
45 44 public static Boolean showPassword = false;
46 45  
47 46 Handler handler = new Handler() {
... ... @@ -88,14 +87,19 @@ public class ForgotPasswordActivity extends AppCompatActivity implements View.On
88 87 }
89 88 break;
90 89 case 21:
91   - forot_pwd_getanthcode.setEnabled(false);
92   - forot_pwd_getanthcode.setClickable(false);
93   - forot_pwd_getanthcode.setText(Integer.toString(i--) + " s");
94   - if (i <= 0) {
  90 +
  91 + if(delayTime<=0){
  92 + if(Delaytimer!=null){
  93 + Delaytimer.cancel();
  94 + }
95 95 forot_pwd_getanthcode.setEnabled(true);
96 96 forot_pwd_getanthcode.setClickable(true);
97 97 forot_pwd_getanthcode.setText("获取验证码");
98   -
  98 + delayTime=60;
  99 + }else{
  100 + forot_pwd_getanthcode.setEnabled(false);
  101 + forot_pwd_getanthcode.setClickable(false);
  102 + forot_pwd_getanthcode.setText(delayTime + " s");
99 103 }
100 104 break;
101 105 }
... ... @@ -117,12 +121,7 @@ public class ForgotPasswordActivity extends AppCompatActivity implements View.On
117 121 private void getauthcode() {
118 122 forot_pwd_anthcode.requestFocus();
119 123 HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this);
120   - i = 60;
121   - if (thread == null) {
122   - thread = new Thread(new ThreadShow());
123   - thread.start();
124   -
125   - }
  124 + valiDelay();
126 125  
127 126 }
128 127  
... ... @@ -211,25 +210,18 @@ public class ForgotPasswordActivity extends AppCompatActivity implements View.On
211 210 }
212 211  
213 212 // 线程类 定时器
214   - class ThreadShow implements Runnable {
  213 + public void valiDelay() {
215 214  
216   - @Override
217   - public void run() {
218   - // TODO Auto-generated method stub
219   - while (true) {
220   - try {
221   - Thread.sleep(1000);
222   - // thread.interrupt();
223   - Message msg = new Message();
224   - msg.what = 21;
225   - handler.sendMessage(msg);
226   - System.out.println("内存泄露...");
227   - } catch (Exception e) {
228   - // TODO Auto-generated catch block
229   - e.printStackTrace();
230   - System.out.println("thread error...");
231   - }
  215 + Delaytimer = new java.util.Timer(true);
  216 +
  217 +
  218 + TimerTask task = new TimerTask() {
  219 + public void run() {
  220 + //每次需要执行的代码放到这里面。
  221 + delayTime--;
  222 + handler.sendEmptyMessage(21);
232 223 }
233   - }
  224 + };
  225 + Delaytimer.schedule(task, 1000,1000);
234 226 }
235 227 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/LoginAndRegisterActivity.java
... ... @@ -34,6 +34,10 @@ public class LoginAndRegisterActivity extends AppCompatActivity {
34 34 protected void onCreate(@Nullable Bundle savedInstanceState) {
35 35 super.onCreate(savedInstanceState);
36 36 String islogin =SaveParam.getInstance().getLoginParam(this,"login");
  37 + String type =SaveParam.getInstance().getCustomizeParam(LoginAndRegisterActivity.this,SaveParam.ACCOUNT);
  38 + if (type==null){
  39 + SaveParam.getInstance().saveCustomizeParam(LoginAndRegisterActivity.this, SaveParam.ACCOUNT,"1");
  40 + }
37 41 if ("true".equals(islogin)){
38 42 Intent intent = new Intent();
39 43 intent.setClass(this,MainActivity.class);
... ... @@ -77,6 +81,7 @@ public class LoginAndRegisterActivity extends AppCompatActivity {
77 81 }
78 82  
79 83 private void setLister() {
  84 +
80 85 }
81 86  
82 87  
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
... ... @@ -51,6 +51,7 @@ import com.zaaach.toprightmenu.MenuItem;
51 51 import com.zaaach.toprightmenu.TopRightMenu;
52 52  
53 53 import java.io.File;
  54 +import java.io.UnsupportedEncodingException;
54 55 import java.util.ArrayList;
55 56 import java.util.Arrays;
56 57 import java.util.List;
... ... @@ -98,6 +99,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
98 99 tv_sex.setText("女");
99 100 iv_sex.setImageResource(R.mipmap.women);
100 101 }
  102 + String imageurl = SaveParam.getInstance().getLoginParam(MainActivity.this,SaveParam.HEADURL);
  103 + mSimpleDraweeView.setImageURI(imageurl);
101 104 break;
102 105 case HttpCode.SIGN:
103 106 SignInfo.DataBean dataBean = (SignInfo.DataBean)msg.obj;
... ... @@ -185,7 +188,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
185 188  
186 189 //获取个性签名
187 190 String userID = SaveParam.getInstance().getLoginParam(this,"userId");
188   - String typeaccount = SaveParam.getInstance().getLoginParam(this,SaveParam.ACCOUNT);
  191 + String typeaccount = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT);
189 192 try {
190 193 long auserID = Long.parseLong(userID);
191 194 int typeaccount1=Integer.parseInt(typeaccount);
... ... @@ -304,7 +307,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
304 307 AlertUtils.showToast(MainActivity.this, "请输入个性签名");
305 308 } else {
306 309 try {
307   - String typeaccount = SaveParam.getInstance().getLoginParam(MainActivity.this,SaveParam.ACCOUNT);
  310 + String typeaccount = SaveParam.getInstance().getCustomizeParam(MainActivity.this,SaveParam.ACCOUNT);
308 311 String userID = SaveParam.getInstance().getLoginParam(MainActivity.this,"userId");
309 312 long auserID = Long.parseLong(userID);
310 313 int typeaccount1=Integer.parseInt(typeaccount);
... ... @@ -340,7 +343,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
340 343 protected void onResume() {
341 344 super.onResume();
342 345 String userID = SaveParam.getInstance().getLoginParam(this,"userId");
343   - String typeaccount = SaveParam.getInstance().getLoginParam(this,SaveParam.ACCOUNT);
  346 + String typeaccount = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT);
344 347 try {
345 348 long auserID = Long.parseLong(userID);
346 349 int typeaccount1=Integer.parseInt(typeaccount);
... ... @@ -452,7 +455,17 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
452 455 String mimeType = "image/*";
453 456 //requestBody = RequestBody.create(MediaType.parse(mimeType), file);
454 457 //String fileName = cover.getName();
455   - //HttpManager.getInstance().header(this, fileSrc);
  458 + String userID = SaveParam.getInstance().getLoginParam(this,"userId");
  459 + String typeaccount = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT);
  460 +
  461 + //上传头像
  462 +
  463 + try {
  464 + HttpManager.getInstance().header(this, userID,typeaccount,file.getPath());
  465 + } catch (UnsupportedEncodingException e) {
  466 + e.printStackTrace();
  467 + }
  468 +
456 469 //photo = MultipartBody.Part.createFormData("portrait", fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length()), requestBody);
457 470 //Fresco设置圆形头像
458 471 GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java
... ... @@ -194,7 +194,8 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl
194 194 String regionName = data.get(position).getRegionName();
195 195 SaveParam.getInstance().saveLoginParam(this, "sheng", regionName);
196 196 CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog");
197   -
  197 + et_region.setText("");
  198 + et_region.setText(regionName);
198 199  
199 200 }
200 201  
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/AccountChildsAdapter.java
... ... @@ -124,7 +124,7 @@ public class AccountChildsAdapter extends RecyclerView.Adapter&lt;AccountChildsAdap
124 124 @Override
125 125 public void onClick(View v) {
126 126 Content.changgeaccountflag =2;
127   - SaveParam.getInstance().saveLoginParam(mContext,SaveParam.ACCOUNT,"2");
  127 + SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ACCOUNT,"2");
128 128 String devicenumber = GetDevicesUtil.getDevicesInfo(mContext).getDeviceNumber();
129 129 HttpManager.getInstance().changechildAccountinfo(mContext,bean.getSubAccountId(),bean.getParentId(),
130 130 devicenumber,2);
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java
... ... @@ -43,7 +43,6 @@ public class ElectronicCardDialog extends BaseCircleDialog {
43 43 intent.setClass(getActivity(),ElectronicCardValidationActivity.class);
44 44 startActivity(intent);
45 45 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout);
46   - getActivity().finish();
47 46  
48 47 }
49 48 });
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/db/SaveParam.java
... ... @@ -22,6 +22,7 @@ public class SaveParam {
22 22 public static String GRADES = "gadens";//年级
23 23 public static String SCHOOL = "school";//学校
24 24 public static String CONSTELLATION = "constellations";//星座
  25 + public static String HEADURL = "headurl";//星座
25 26  
26 27 //电子保卡信息
27 28 public static String CARDPHONE = "cardphone";//保卡手机号
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/LoginFragment.java
... ... @@ -19,7 +19,6 @@ import com.hjx.personalcenter.R;
19 19 import com.hjx.personalcenter.activity.ForgotPasswordActivity;
20 20 import com.hjx.personalcenter.activity.MainActivity;
21 21 import com.hjx.personalcenter.customdialog.ElectronicCardDialog;
22   -import com.hjx.personalcenter.db.SaveParam;
23 22 import com.hjx.personalcenter.http.HttpCode;
24 23 import com.hjx.personalcenter.http.HttpManager;
25 24 import com.hjx.personalcenter.util.AlertUtils;
... ... @@ -73,7 +72,6 @@ public class LoginFragment extends Fragment implements View.OnClickListener {
73 72 HttpManager.getInstance().cardinfocheck(getActivity(),auserID,handler);
74 73 //登录成功,保存登录数据并且获取个人信息
75 74 HttpManager.getInstance().saveLoginInfo(getActivity(), name, pwd, access_token, "true", userId);
76   - SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.ACCOUNT,"1");
77 75 } catch (NumberFormatException e) {
78 76 e.printStackTrace();
79 77 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
... ... @@ -165,14 +165,15 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener
165 165 case R.id.presonal_sub:
166 166 if (TextUtils.isEmpty(presonal1) ||
167 167 TextUtils.isEmpty(presonal2) || TextUtils.isEmpty(presonal3) || TextUtils.isEmpty(presonal4) ||
168   - TextUtils.isEmpty(presonal5) || TextUtils.isEmpty(presonal7) ||
  168 + TextUtils.isEmpty(presonal5) || TextUtils.isEmpty(presonal7) ||
169 169 TextUtils.isEmpty(presonal8)) {
170 170 AlertUtils.showToast(getActivity(), "请将信息填写完整!");
171 171 return;
172 172 } else {
173 173  
174 174 int a = 0, b = 0;
175   - int d =1;
  175 + int d = 1;
  176 + Object schoolids;
176 177 Long f = null;
177 178 //保存星座
178 179 BrithdayStar brithdayStar = new BrithdayStar();
... ... @@ -186,30 +187,28 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener
186 187 }
187 188 String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS);
188 189 String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.SCHOOOlID);
189   - String type = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.ACCOUNT);
  190 + String type = SaveParam.getInstance().getCustomizeParam(getActivity(), SaveParam.ACCOUNT);
190 191 String userID = SaveParam.getInstance().getLoginParam(getActivity(), "userId");
191 192 String devicenumber = GetDevicesUtil.getDevicesInfo(getActivity()).getDeviceNumber();
192 193 String changeinfo = null;
193 194 if ("男".equals(presonal3)) {
194   - changeinfo="male";
  195 + changeinfo = "male";
195 196 } else {
196   - changeinfo=("female");
  197 + changeinfo = "female";
197 198 }
198 199 try {
199   - Object c ;
200 200 a = Integer.parseInt(regionId);
201 201 b = Integer.parseInt(grade);
202   -
203   - if (TextUtils.isEmpty(presonal6)){
204   - c = null;
205   - }else {
206   - c = Long.parseLong(schoolid);
  202 + if (TextUtils.isEmpty(presonal6)) {
  203 + schoolids = null;
  204 + } else {
  205 + schoolids = Long.parseLong(schoolid);
207 206 }
208 207 d = Integer.parseInt(type);
209 208 f = Long.parseLong(userID);
210 209 //提交个人信息
211 210 HttpManager.getInstance().changepresonalinfo(getActivity(),
212   - f,d,presonal1,presonal5,b, a,c,presonal8,changeinfo,presonal4 + presonal2,devicenumber);
  211 + f, d, presonal1, presonal5, b, a, schoolids, presonal8, changeinfo, presonal4 + presonal2, devicenumber);
213 212  
214 213 } catch (Exception e) {
215 214 e.printStackTrace();
... ... @@ -304,7 +303,8 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener
304 303 String regionName = data.get(position).getRegionName();
305 304 SaveParam.getInstance().saveLoginParam(getActivity(), "sheng", regionName);
306 305 CitysListDialog.getInstance((DialogCallBack.CitysCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "CitysListDialog");
307   -
  306 + tv_useinfo_adress.setText("");
  307 + tv_useinfo_adress.setText(regionName);
308 308 }
309 309  
310 310 @Override
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java
... ... @@ -28,6 +28,8 @@ import com.hjx.personalcenter.util.PhoneNumCheckUtils;
28 28 import org.json.JSONException;
29 29 import org.json.JSONObject;
30 30  
  31 +import java.util.TimerTask;
  32 +
31 33 /**
32 34 * 注册
33 35 * Created by Administrator on 2016/11/7.
... ... @@ -41,8 +43,8 @@ public class RegisterFragment extends Fragment implements View.OnClickListener {
41 43 private ImageView openeyes;
42 44 private String sourceStr ="android";
43 45 private String typeStr = "register";
44   - private int i = 0;
45   - private Thread thread;
  46 + private int delayTime=60;
  47 + private java.util.Timer Delaytimer;
46 48 private int type;
47 49 public static Boolean showPassword = false;
48 50 public static String TABLAYOUT_FRAGMENT = "tab_fragment";
... ... @@ -72,7 +74,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener {
72 74 if (status.equals("100")) {
73 75 String usernameStr = phonenumber.getText().toString().trim();
74 76 String passwordStr = password.getText().toString().trim();
75   - //HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId);
  77 + HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId);
76 78 AlertUtils.showToast(getActivity(), "注册成功!");
77 79 Content.accountflag =1;
78 80 //检查信息是否填写完整
... ... @@ -108,14 +110,19 @@ public class RegisterFragment extends Fragment implements View.OnClickListener {
108 110 AlertUtils.showToast(getActivity(), "该手机号已经注册过了");
109 111 }
110 112 break;
111   - case 1:
112   - get_authcode.setEnabled(false);
113   - get_authcode.setClickable(false);
114   - get_authcode.setText(Integer.toString(i--)+" s");
115   - if (i<=0){
  113 + case 21:
  114 + if(delayTime<=0){
  115 + if(Delaytimer!=null){
  116 + Delaytimer.cancel();
  117 + }
116 118 get_authcode.setEnabled(true);
117 119 get_authcode.setClickable(true);
118 120 get_authcode.setText("获取验证码");
  121 + delayTime=60;
  122 + }else{
  123 + get_authcode.setEnabled(false);
  124 + get_authcode.setClickable(false);
  125 + get_authcode.setText(delayTime + " s");
119 126 }
120 127 break;
121 128 }
... ... @@ -210,11 +217,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener {
210 217 private void getauthcode() {
211 218 String usernameStr = phonenumber.getText().toString().trim();
212 219 HttpManager.getInstance().authCode(typeStr, usernameStr, handler, getActivity());
213   - i = 60;
214   - if(thread == null){
215   - thread = new Thread( new ThreadShow());
216   - thread.start();
217   - }
  220 + valiDelay();
218 221 }
219 222  
220 223 private void ifregister() {
... ... @@ -229,24 +232,18 @@ public class RegisterFragment extends Fragment implements View.OnClickListener {
229 232 HttpManager.getInstance().register(getActivity(), usernameStr, passwordStr, authcodeStr, sourceStr,handler);
230 233 }
231 234 // 线程类 定时器
232   - class ThreadShow implements Runnable {
  235 + public void valiDelay() {
233 236  
234   - @Override
235   - public void run() {
236   - // TODO Auto-generated method stub
237   - while (true) {
238   - try {
239   - Thread.sleep(1000);
240   - Message msg = new Message();
241   - msg.what = 1;
242   - handler.sendMessage(msg);
243   - System.out.println("send...");
244   - } catch (Exception e) {
245   - // TODO Auto-generated catch block
246   - e.printStackTrace();
247   - System.out.println("thread error...");
248   - }
  237 + Delaytimer = new java.util.Timer(true);
  238 +
  239 +
  240 + TimerTask task = new TimerTask() {
  241 + public void run() {
  242 + //每次需要执行的代码放到这里面。
  243 + delayTime--;
  244 + handler.sendEmptyMessage(21);
249 245 }
250   - }
  246 + };
  247 + Delaytimer.schedule(task, 1000,1000);
251 248 }
252 249 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... ... @@ -45,6 +45,8 @@ import org.apache.http.protocol.HTTP;
45 45 import org.json.JSONException;
46 46 import org.json.JSONObject;
47 47  
  48 +import java.io.File;
  49 +import java.io.FileNotFoundException;
48 50 import java.io.UnsupportedEncodingException;
49 51 import java.util.ArrayList;
50 52 import java.util.List;
... ... @@ -874,9 +876,9 @@ public class HttpManager {
874 876  
875 877 //修改个人信息
876 878 public void changepresonalinfo(final Context mContext, Long id, int type
877   - ,String name,String birthday,int gradeId,long regionId,
878   - Object schoolId,String qq,String gender
879   - ,String regionName,String devicenumber) throws UnsupportedEncodingException {
  879 + , String name, String birthday, int gradeId, long regionId,
  880 + Object schoolId, String qq, String gender
  881 + , String regionName, String devicenumber) throws UnsupportedEncodingException {
880 882 mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...",
881 883 false, true, null);
882 884 RequestParams params = new RequestParams();
... ... @@ -1016,9 +1018,11 @@ public class HttpManager {
1016 1018 handler.sendMessage(message);
1017 1019  
1018 1020  
  1021 + } else if (status == 1000) {
  1022 + AlertUtils.showToast(mContext, "您还没有签名哦");
  1023 +
1019 1024 } else {
1020 1025 AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试!");
1021   -
1022 1026 }
1023 1027 } catch (JSONException e) {
1024 1028 e.printStackTrace();
... ... @@ -1039,65 +1043,80 @@ public class HttpManager {
1039 1043 * 用户反馈
1040 1044 *
1041 1045 * @param mContext
1042   - * @param object
  1046 + * @param userId
  1047 + * @param content
  1048 + * @param contact
  1049 + * @param imgs
  1050 + * @param feedtype
1043 1051 * @throws UnsupportedEncodingException
1044 1052 */
1045   - public void feedback(final Context mContext, Object object) throws UnsupportedEncodingException {
1046   - Gson gson = new Gson();
1047   - String jsonObject = gson.toJson(object);
1048   - Log.e("test", "onSuccess" + jsonObject);
  1053 + public void feedback(final Context mContext, String userId, String content,
  1054 + String contact, String imgs, String feedtype) throws UnsupportedEncodingException {
1049 1055 mProgress = DialogPermission.showProgress(mContext, null, "正在提交反馈内容...",
1050 1056 false, true, null);
1051   - ByteArrayEntity entity = null;
1052   - entity = new ByteArrayEntity(jsonObject.getBytes("UTF-8"));
1053   - entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
1054   -
1055   - HttpClient.getInstance().addHeader("Accept", "*/*");
1056   - HttpClient.getInstance().post(mContext, HttpUrl.feedbackURL, entity, "application/json", new JsonHttpResponseHandler() {
1057   - @Override
1058   - public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
1059   - super.onSuccess(statusCode, headers, response);
1060   - closeProgress();
1061   - String status = response.optString("status");
1062   - if (status.equals("1")) {
1063   - Toast.makeText(mContext, "反馈成功,我们会尽快处理", Toast.LENGTH_LONG).show();
1064   - ((Activity) mContext).finish();
1065   - } else {
1066   - AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试");
1067   - }
1068   - Log.e("test", "onSuccess" + response);
1069   -
  1057 + File file = new File(imgs);
  1058 + if (file.exists() && file.length() > 0) {
  1059 + RequestParams params = new RequestParams();
  1060 + try {
  1061 + params.put("userId", userId);
  1062 + params.put("content", content);
  1063 + params.put("contact", contact);
  1064 + params.put("imgs", file);
  1065 + params.put("feedtype", feedtype);
  1066 + } catch (FileNotFoundException e) {
  1067 + e.printStackTrace();
1070 1068 }
  1069 + Log.e("test", "onSuccess" + params);
  1070 + HttpClient.getInstance().post(HttpUrl.feedbackURL, params, new AsyncHttpResponseHandler() {
  1071 + @Override
  1072 + public void onSuccess(int i, Header[] headers, byte[] bytes) {
  1073 + closeProgress();
  1074 + Log.e("test", "onSuccess" + new String(bytes));
  1075 + try {
  1076 + JSONObject jsonObject = new JSONObject(new String(bytes));
  1077 + String status = jsonObject.optString("status");
  1078 + if (status.equals("1")) {
  1079 + Toast.makeText(mContext, "您的宝贵意见已经提交成功。", Toast.LENGTH_LONG).show();
  1080 + ((Activity) mContext).finish();
  1081 + } else {
  1082 + AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试");
  1083 + }
  1084 + } catch (JSONException e) {
  1085 + e.printStackTrace();
  1086 + }
  1087 + }
1071 1088  
1072   - @Override
1073   - public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
1074   - super.onFailure(statusCode, headers, throwable, errorResponse);
1075   - closeProgress();
1076   - Log.e("test", "onFailure" + errorResponse);
1077   - new CircleDialog.Builder((FragmentActivity) mContext)
1078   - .setCanceledOnTouchOutside(false)
1079   - .setCancelable(false)
1080   - .setWidth(0.5f)
1081   - .configText(new ConfigText() {
1082   - @Override
1083   - public void onConfig(TextParams params) {
1084   - params.gravity = Gravity.CENTER;
1085   - params.padding = new int[]{50, 50, 50, 50};
1086   - }
1087   - })
1088   - .setText("当前无网络,请检查网络设置")
1089   - .setNegative("继续使用", null)
1090   - .setPositive("设置网络", new View.OnClickListener() {
1091   - @Override
1092   - public void onClick(View v) {
1093   - Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面
1094   - mContext.startActivity(intent);
1095   - }
1096   - })
1097   - .show();
1098   - }
  1089 + @Override
  1090 + public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) {
  1091 + closeProgress();
  1092 + Log.e("test", "错误信息" + new String(bytes));
  1093 + new CircleDialog.Builder((FragmentActivity) mContext)
  1094 + .setCanceledOnTouchOutside(false)
  1095 + .setCancelable(false)
  1096 + .setWidth(0.5f)
  1097 + .configText(new ConfigText() {
  1098 + @Override
  1099 + public void onConfig(TextParams params) {
  1100 + params.gravity = Gravity.CENTER;
  1101 + params.padding = new int[]{50, 50, 50, 50};
  1102 + }
  1103 + })
  1104 + .setText("当前无网络,请检查网络设置")
  1105 + .setNegative("继续使用", null)
  1106 + .setPositive("设置网络", new View.OnClickListener() {
  1107 + @Override
  1108 + public void onClick(View v) {
  1109 + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面
  1110 + mContext.startActivity(intent);
  1111 + }
  1112 + })
  1113 + .show();
1099 1114  
1100   - });
  1115 + }
  1116 + });
  1117 + } else {
  1118 + Toast.makeText(mContext, "文件不存在", Toast.LENGTH_LONG).show();
  1119 + }
1101 1120 }
1102 1121  
1103 1122 /**
... ... @@ -1107,14 +1126,14 @@ public class HttpManager {
1107 1126 * @param userId
1108 1127 * @param handler
1109 1128 */
1110   - public void getchildAccountinfo(final Context mContext, long userId,String deviceNumber ,final Handler handler) {
  1129 + public void getchildAccountinfo(final Context mContext, long userId, String deviceNumber, final Handler handler) {
1111 1130 mProgress = DialogPermission.showProgress(mContext, null, "正在获取信息...",
1112 1131 false, true, null);
1113 1132  
1114   - Log.e("test", "ID" + userId);
  1133 + Log.e("test", "ID" + userId + "deviceNumber" + deviceNumber);
1115 1134 HttpClient.getInstance().setTimeout(5 * 1000);
1116 1135 HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
1117   - HttpClient.getInstance().get(HttpUrl.childUserURL + "?userId=" + userId+"&deviceNumber="+deviceNumber, new AsyncHttpResponseHandler() {
  1136 + HttpClient.getInstance().get(HttpUrl.childUserURL + "?userId=" + userId + "&deviceNumber=" + deviceNumber, new AsyncHttpResponseHandler() {
1118 1137 @Override
1119 1138 public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
1120 1139 closeProgress();
... ... @@ -1124,9 +1143,9 @@ public class HttpManager {
1124 1143 int status = jsonObject.optInt("status");
1125 1144 if (status == 0) {
1126 1145 AlertUtils.showToast(mContext, "你好,服务器异常,请稍后再试!");
1127   - } else if (status == 1000) {
1128   - AlertUtils.showToast(mContext, "你好,你还未添加子账号,子账号为空!");
1129   - } else {
  1146 + } else if(status == 1000){
  1147 + AlertUtils.showToast(mContext, "您还没有子账户哦");
  1148 + }else {
1130 1149 ChildsInfo childsInfo = GsonTool.getPerson(new String(arg2), ChildsInfo.class);//解析json数据
1131 1150 Log.e("test", "子账户信息" + childsInfo);
1132 1151 List<ChildsInfo.DataBean> schoolInfoBeanList = childsInfo.getData();
... ... @@ -1139,6 +1158,7 @@ public class HttpManager {
1139 1158 }
1140 1159 } catch (JSONException e) {
1141 1160 e.printStackTrace();
  1161 +
1142 1162 }
1143 1163  
1144 1164 }
... ... @@ -1317,13 +1337,13 @@ public class HttpManager {
1317 1337 * @param subAccountId
1318 1338 */
1319 1339 public void changechildAccountinfo(final Context mContext, String subAccountId, long userId
1320   - ,String deviceNumber,int type) {
  1340 + , String deviceNumber, int type) {
1321 1341 mProgress = DialogPermission.showProgress(mContext, null, "正在切换子账户...",
1322 1342 false, true, null);
1323 1343 HttpClient.getInstance().setTimeout(5 * 1000);
1324 1344 HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
1325 1345 HttpClient.getInstance().get(HttpUrl.changechildUserURL + "?subAccountId=" + subAccountId + "&userId=" + userId
1326   - + "&deviceNumber=" + deviceNumber+ "&type=" + type, new AsyncHttpResponseHandler() {
  1346 + + "&deviceNumber=" + deviceNumber + "&type=" + type, new AsyncHttpResponseHandler() {
1327 1347 @Override
1328 1348 public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
1329 1349 closeProgress();
... ... @@ -1374,6 +1394,7 @@ public class HttpManager {
1374 1394 });
1375 1395  
1376 1396 }
  1397 +
1377 1398 /**
1378 1399 * 切换主账户信息
1379 1400 *
... ... @@ -1381,7 +1402,7 @@ public class HttpManager {
1381 1402 * @param type
1382 1403 */
1383 1404 public void Accountinfo(final Context mContext, long userId
1384   - ,String deviceNumber,int type) {
  1405 + , String deviceNumber, int type) {
1385 1406 mProgress = DialogPermission.showProgress(mContext, null, "正在切换主账户...",
1386 1407 false, true, null);
1387 1408 HttpClient.getInstance().setTimeout(5 * 1000);
... ... @@ -1440,6 +1461,83 @@ public class HttpManager {
1440 1461 }
1441 1462  
1442 1463 /**
  1464 + * 头像
  1465 + *
  1466 + * @param mContext
  1467 + * @param userId
  1468 + * @param img
  1469 + * @throws UnsupportedEncodingException
  1470 + */
  1471 + public void header(final Context mContext, String userId, String type, String img) throws UnsupportedEncodingException {
  1472 +// mProgress = DialogPermission.showProgress(mContext, null, "正在上传头像...",
  1473 +// false, true, null);
  1474 + File file = new File(img);
  1475 + if (file.exists() && file.length() > 0) {
  1476 + RequestParams params = new RequestParams();
  1477 + try {
  1478 + params.put("userId", userId);
  1479 + params.put("type", type);
  1480 + params.put("img", file);
  1481 + } catch (FileNotFoundException e) {
  1482 + e.printStackTrace();
  1483 + }
  1484 + Log.e("test", "onSuccess" + params);
  1485 + HttpClient.getInstance().post(HttpUrl.headerURL, params, new AsyncHttpResponseHandler() {
  1486 + @Override
  1487 + public void onSuccess(int i, Header[] headers, byte[] bytes) {
  1488 + closeProgress();
  1489 + Log.e("test", "onSuccess" + new String(bytes));
  1490 + try {
  1491 + JSONObject jsonObject = new JSONObject(new String(bytes));
  1492 + String status = jsonObject.optString("status");
  1493 + JSONObject jsonObject1 =jsonObject.getJSONObject("data");
  1494 + String imagUrl = jsonObject1.optString("imgUrl");
  1495 + SaveParam.getInstance().saveLoginParam(mContext,SaveParam.HEADURL,imagUrl);
  1496 + if (status.equals("1")) {
  1497 + Toast.makeText(mContext, "头像上传成功。", Toast.LENGTH_LONG).show();
  1498 + } else {
  1499 + AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试");
  1500 + }
  1501 + } catch (JSONException e) {
  1502 + e.printStackTrace();
  1503 + }
  1504 + }
  1505 +
  1506 + @Override
  1507 + public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) {
  1508 + closeProgress();
  1509 + Log.e("test", "错误信息" + new String(bytes));
  1510 + new CircleDialog.Builder((FragmentActivity) mContext)
  1511 + .setCanceledOnTouchOutside(false)
  1512 + .setCancelable(false)
  1513 + .setWidth(0.5f)
  1514 + .configText(new ConfigText() {
  1515 + @Override
  1516 + public void onConfig(TextParams params) {
  1517 + params.gravity = Gravity.CENTER;
  1518 + params.padding = new int[]{50, 50, 50, 50};
  1519 + }
  1520 + })
  1521 + .setText("当前无网络,请检查网络设置")
  1522 + .setNegative("继续使用", null)
  1523 + .setPositive("设置网络", new View.OnClickListener() {
  1524 + @Override
  1525 + public void onClick(View v) {
  1526 + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面
  1527 + mContext.startActivity(intent);
  1528 + }
  1529 + })
  1530 + .show();
  1531 +
  1532 + }
  1533 + });
  1534 + } else {
  1535 + Toast.makeText(mContext, "文件不存在", Toast.LENGTH_LONG).show();
  1536 + }
  1537 + }
  1538 +
  1539 +
  1540 + /**
1443 1541 * 系统升级
1444 1542 *
1445 1543 * @param mContext
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpUrl.java
... ... @@ -36,6 +36,7 @@ public class HttpUrl {
36 36 public static String addchildUserURL=GetDomain()+"/childUser/addChildUser";//添加子账户
37 37 public static String changechildUserURL=GetDomain()+"/childUser/update";//切换子账户
38 38 public static String updateappURL=GetDomain()+"/general/release/version";//系统升级
  39 + public static String headerURL=GetDomain()+"/profile/picture/update";//头像上传
39 40  
40 41  
41 42  
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/PesonalInfo.java
... ... @@ -76,11 +76,19 @@ public class PesonalInfo implements Serializable{
76 76 private RegionBean region;
77 77 private String nickName;
78 78 private String gender;
  79 +
  80 + private String portrait;
79 81 private SchoolBean school;
80 82 private GradeBean grade;
81 83 private String birthday;
82 84 private String qq;
  85 + public String getPortrait() {
  86 + return portrait;
  87 + }
83 88  
  89 + public void setPortrait(String portrait) {
  90 + this.portrait = portrait;
  91 + }
84 92 public RegionBean getRegion() {
85 93 return region;
86 94 }
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/MachineUtil.java
... ... @@ -14,10 +14,16 @@ public class MachineUtil {
14 14 public static String getMachineCode(Context context) {
15 15 String cpuAddress = null;
16 16 try{
17   -// PmpsManager pmps = new PmpsManager();
18   -// cpuAddress = pmps.getDeviceId(context);
  17 + TelephonyManager mTelephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
  18 + if (mTelephony.getDeviceId() != null) {
  19 + cpuAddress = mTelephony.getDeviceId();
  20 + } else {
  21 + //android.provider.Settings;
  22 + cpuAddress = Settings.Secure.getString(context.getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
  23 + }
  24 + //cpuAddress = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
19 25 }catch(Exception e){
20   - com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("mac地址获取失败");
  26 + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("=========.MACHINE.=========function 4 get device id error");
21 27 }catch(NoClassDefFoundError e){
22 28 com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("设备不是好记星");
23 29 }
... ... @@ -67,18 +73,6 @@ public class MachineUtil {
67 73 return cpuAddress;
68 74 }
69 75  
70   - try{
71   - TelephonyManager mTelephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
72   - if (mTelephony.getDeviceId() != null) {
73   - cpuAddress = mTelephony.getDeviceId();
74   - } else {
75   - //android.provider.Settings;
76   - cpuAddress = Settings.Secure.getString(context.getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
77   - }
78   - //cpuAddress = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
79   - }catch(Exception e){
80   - com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("=========.MACHINE.=========function 4 get device id error");
81   - }
82 76 if(!TextUtils.isEmpty(cpuAddress)){
83 77 //Log.e("=========.MACHINE.=========", "function 4 get device id:"+cpuAddress);
84 78 return cpuAddress;
... ...
PersonalCenter/app/src/main/res/layout/activity_account_management.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:fresco="http://schemas.android.com/apk/res-auto"
3 4 android:layout_width="match_parent"
4 5 android:layout_height="match_parent"
5   - xmlns:fresco="http://schemas.android.com/apk/res-auto"
6 6 android:orientation="vertical">
7 7  
8 8 <RelativeLayout
... ... @@ -191,14 +191,15 @@
191 191 android:layout_width="match_parent"
192 192 android:layout_height="wrap_content"
193 193 android:orientation="horizontal">
  194 +
194 195 <com.facebook.drawee.view.SimpleDraweeView
195 196 android:id="@+id/tv_account_head"
196 197 android:layout_width="60dp"
197 198 android:layout_height="60dp"
198 199 android:layout_margin="10dp"
199 200 fresco:placeholderImage="@mipmap/header_default"
200   - fresco:roundAsCircle="true"
201   - fresco:placeholderImageScaleType="fitCenter" />
  201 + fresco:placeholderImageScaleType="fitCenter"
  202 + fresco:roundAsCircle="true" />
202 203  
203 204 <LinearLayout
204 205 android:layout_width="0dp"
... ... @@ -245,8 +246,8 @@
245 246 android:layout_height="wrap_content"
246 247 android:layout_gravity="right"
247 248 android:layout_marginLeft="60dp"
248   - android:visibility="gone"
249   - android:src="@mipmap/shiyongzhong" />
  249 + android:src="@mipmap/shiyongzhong"
  250 + android:visibility="gone" />
250 251  
251 252 </LinearLayout>
252 253  
... ... @@ -301,33 +302,33 @@
301 302 android:layout_height="wrap_content"
302 303 android:layout_marginTop="20dp"
303 304 android:orientation="horizontal">
  305 +
304 306 <android.support.v7.widget.RecyclerView
305 307 android:id="@+id/id_recyclerview_horizontal"
306 308 android:layout_width="wrap_content"
307   - android:layout_toLeftOf="@+id/add_account"
308 309 android:layout_height="wrap_content"
309 310 android:layout_centerVertical="true"
310   - android:scrollbars="none"
311   - >
312   - </android.support.v7.widget.RecyclerView>
  311 + android:layout_toLeftOf="@+id/add_account"
  312 + android:scrollbars="none"></android.support.v7.widget.RecyclerView>
  313 +
313 314 <LinearLayout
314 315 android:id="@+id/add_account"
315 316 android:layout_width="415dp"
316 317 android:layout_height="165dp"
317   - android:layout_marginLeft="10dp"
318 318 android:layout_alignParentRight="true"
  319 + android:layout_marginLeft="10dp"
  320 + android:layout_marginRight="20dp"
319 321 android:background="@drawable/corcle_black_bg"
320 322 android:gravity="center">
  323 +
321 324 <ImageView
322 325 android:layout_width="wrap_content"
323 326 android:layout_height="wrap_content"
324   - android:src="@mipmap/jia"/>
  327 + android:src="@mipmap/jia" />
325 328  
326 329 </LinearLayout>
327 330  
328 331  
329   -
330   -
331 332 </RelativeLayout>
332 333  
333 334 </LinearLayout>
... ...
PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml
... ... @@ -79,7 +79,6 @@
79 79 android:layout_width="wrap_content"
80 80 android:layout_height="wrap_content"
81 81 android:text="客户姓名"
82   - android:textColor="@color/btn_text_color"
83 82 android:textSize="22sp" />
84 83  
85 84 <TextView
... ... @@ -88,7 +87,6 @@
88 87 android:layout_height="wrap_content"
89 88 android:layout_marginLeft="60dp"
90 89 android:text=""
91   - android:textColor="@color/btn_text_color"
92 90 android:textSize="22sp" />
93 91  
94 92 </LinearLayout>
... ... @@ -112,7 +110,6 @@
112 110 android:layout_width="wrap_content"
113 111 android:layout_height="wrap_content"
114 112 android:text="产品型号"
115   - android:textColor="@color/btn_text_color"
116 113 android:textSize="22sp" />
117 114  
118 115 <TextView
... ... @@ -136,7 +133,6 @@
136 133 <TextView
137 134 android:layout_width="wrap_content"
138 135 android:layout_height="wrap_content"
139   - android:textColor="@color/btn_text_color"
140 136 android:text="客户地址"
141 137 android:textSize="22sp" />
142 138  
... ... @@ -152,7 +148,7 @@
152 148 android:layout_width="wrap_content"
153 149 android:layout_height="wrap_content"
154 150 android:layout_marginLeft="18dp"
155   - android:background="@drawable/corcle_black_bg"
  151 + android:background="@drawable/corcle_blue_bg"
156 152 android:text="修改"
157 153 android:paddingLeft="5dp"
158 154 android:paddingRight="5dp"
... ... @@ -180,7 +176,6 @@
180 176 <TextView
181 177 android:layout_width="wrap_content"
182 178 android:layout_height="wrap_content"
183   - android:textColor="@color/btn_text_color"
184 179 android:text="MAC地址"
185 180 android:textSize="22sp" />
186 181  
... ... @@ -189,7 +184,6 @@
189 184 android:layout_width="wrap_content"
190 185 android:layout_height="wrap_content"
191 186 android:layout_marginLeft="50dp"
192   - android:background="@null"
193 187 android:text=""
194 188 android:textSize="22sp" />
195 189  
... ... @@ -206,7 +200,6 @@
206 200 android:layout_width="wrap_content"
207 201 android:layout_height="wrap_content"
208 202 android:text="购买时间"
209   - android:textColor="@color/btn_text_color"
210 203 android:textSize="22sp" />
211 204  
212 205 <TextView
... ... @@ -214,9 +207,7 @@
214 207 android:layout_width="wrap_content"
215 208 android:layout_height="wrap_content"
216 209 android:layout_marginLeft="60dp"
217   - android:background="@null"
218 210 android:text=""
219   - android:textColor="@color/btn_text_color"
220 211 android:textSize="22sp" />
221 212 </LinearLayout>
222 213  
... ... @@ -239,7 +230,6 @@
239 230 android:layout_width="wrap_content"
240 231 android:layout_height="wrap_content"
241 232 android:text="机身编码"
242   - android:textColor="@color/btn_text_color"
243 233 android:textSize="22sp" />
244 234  
245 235 <TextView
... ... @@ -263,7 +253,6 @@
263 253 android:layout_width="wrap_content"
264 254 android:layout_height="wrap_content"
265 255 android:text="购买地址"
266   - android:textColor="@color/btn_text_color"
267 256 android:textSize="22sp" />
268 257  
269 258 <TextView
... ... @@ -272,7 +261,6 @@
272 261 android:layout_height="wrap_content"
273 262 android:layout_marginLeft="60dp"
274 263 android:text=""
275   - android:textColor="@color/btn_text_color"
276 264 android:textSize="22sp" />
277 265 </LinearLayout>
278 266  
... ... @@ -296,7 +284,6 @@
296 284 android:layout_width="wrap_content"
297 285 android:layout_height="wrap_content"
298 286 android:text="手机号码"
299   - android:textColor="@color/btn_text_color"
300 287 android:textSize="22sp" />
301 288  
302 289 <TextView
... ... @@ -311,7 +298,7 @@
311 298 android:layout_width="wrap_content"
312 299 android:layout_height="wrap_content"
313 300 android:layout_marginLeft="18dp"
314   - android:background="@drawable/corcle_black_bg"
  301 + android:background="@drawable/corcle_blue_bg"
315 302 android:text="修改"
316 303 android:paddingLeft="5dp"
317 304 android:paddingRight="5dp"
... ... @@ -331,7 +318,6 @@
331 318 <TextView
332 319 android:layout_width="wrap_content"
333 320 android:layout_height="wrap_content"
334   - android:textColor="@color/btn_text_color"
335 321 android:text="本地售后电话"
336 322 android:textSize="22sp" />
337 323  
... ... @@ -340,7 +326,6 @@
340 326 android:layout_width="wrap_content"
341 327 android:layout_height="wrap_content"
342 328 android:layout_marginLeft="60dp"
343   - android:background="@null"
344 329 android:text=""
345 330 android:textSize="22sp" />
346 331  
... ...
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
... ... @@ -88,6 +88,7 @@
88 88 android:layout_height="wrap_content"
89 89 android:layout_marginLeft="50dp"
90 90 android:background="@null"
  91 + android:textColor="@color/electronic_text"
91 92 android:hint="请输入"
92 93 android:textSize="22sp" />
93 94  
... ... @@ -110,6 +111,7 @@
110 111 android:layout_width="wrap_content"
111 112 android:layout_height="wrap_content"
112 113 android:layout_marginLeft="20dp"
  114 + android:textColor="@color/electronic_text"
113 115 android:hint="请选择地区"
114 116 android:textSize="22sp" />
115 117  
... ... @@ -172,6 +174,7 @@
172 174 android:layout_width="wrap_content"
173 175 android:layout_height="wrap_content"
174 176 android:layout_marginLeft="50dp"
  177 + android:textColor="@color/electronic_text"
175 178 android:hint="请选择地区"
176 179 android:textSize="22sp" />
177 180  
... ... @@ -205,6 +208,7 @@
205 208 android:layout_height="wrap_content"
206 209 android:layout_marginLeft="20dp"
207 210 android:background="@null"
  211 + android:textColor="@color/electronic_text"
208 212 android:hint="请输入商店名称"
209 213 android:textSize="22sp" />
210 214  
... ... @@ -263,6 +267,7 @@
263 267 android:layout_height="wrap_content"
264 268 android:layout_marginLeft="100dp"
265 269 android:background="@null"
  270 + android:textColor="@color/electronic_text"
266 271 android:hint="请输入详细地址"
267 272 android:textSize="22sp" />
268 273  
... ... @@ -286,6 +291,7 @@
286 291 android:layout_height="wrap_content"
287 292 android:layout_marginLeft="20dp"
288 293 android:background="@null"
  294 + android:textColor="@color/electronic_text"
289 295 android:hint="请输入"
290 296 android:textSize="22sp" />
291 297 </LinearLayout>
... ... @@ -345,14 +351,6 @@
345 351 android:hint="请选择时间"
346 352 android:textSize="22sp" />
347 353  
348   - <ImageView
349   - android:layout_width="wrap_content"
350   - android:layout_height="wrap_content"
351   - android:layout_marginLeft="60dp"
352   - android:src="@mipmap/xiajiantou">
353   -
354   - </ImageView>
355   -
356 354 </LinearLayout>
357 355  
358 356 </LinearLayout>
... ...
PersonalCenter/app/src/main/res/layout/activity_ok_cardinfo.xml
... ... @@ -82,7 +82,6 @@
82 82 android:layout_width="wrap_content"
83 83 android:layout_height="wrap_content"
84 84 android:text="客户姓名"
85   - android:textColor="@color/btn_text_color"
86 85 android:textSize="22sp" />
87 86  
88 87 <TextView
... ... @@ -90,8 +89,7 @@
90 89 android:layout_width="wrap_content"
91 90 android:layout_height="wrap_content"
92 91 android:layout_marginLeft="80dp"
93   - android:text="王小明"
94   - android:textColor="@color/btn_text_color"
  92 + android:text=""
95 93 android:textSize="22sp" />
96 94  
97 95 </LinearLayout>
... ... @@ -115,7 +113,6 @@
115 113 android:layout_width="wrap_content"
116 114 android:layout_height="wrap_content"
117 115 android:text="产品型号"
118   - android:textColor="@color/btn_text_color"
119 116 android:textSize="22sp" />
120 117  
121 118 <TextView
... ... @@ -123,7 +120,7 @@
123 120 android:layout_width="wrap_content"
124 121 android:layout_height="wrap_content"
125 122 android:layout_marginLeft="50dp"
126   - android:text="IPone888"
  123 + android:text=""
127 124 android:textSize="22sp" />
128 125  
129 126  
... ... @@ -148,7 +145,7 @@
148 145 android:layout_height="wrap_content"
149 146 android:layout_marginLeft="80dp"
150 147 android:background="@null"
151   - android:text="北京市昭阳区三里屯"
  148 + android:text=""
152 149 android:textSize="22sp" />
153 150  
154 151 </LinearLayout>
... ... @@ -180,7 +177,7 @@
180 177 android:layout_height="wrap_content"
181 178 android:layout_marginLeft="50dp"
182 179 android:background="@null"
183   - android:text="237462873463278"
  180 + android:text=""
184 181 android:textSize="22sp" />
185 182  
186 183 </LinearLayout>
... ... @@ -196,7 +193,6 @@
196 193 android:layout_width="wrap_content"
197 194 android:layout_height="wrap_content"
198 195 android:text="购买时间"
199   - android:textColor="@color/btn_text_color"
200 196 android:textSize="22sp" />
201 197  
202 198 <TextView
... ... @@ -205,8 +201,7 @@
205 201 android:layout_height="wrap_content"
206 202 android:layout_marginLeft="80dp"
207 203 android:background="@null"
208   - android:text="4433322-334--34"
209   - android:textColor="@color/btn_text_color"
  204 + android:text=""
210 205 android:textSize="22sp" />
211 206 </LinearLayout>
212 207  
... ... @@ -229,7 +224,6 @@
229 224 android:layout_width="wrap_content"
230 225 android:layout_height="wrap_content"
231 226 android:text="机身编码"
232   - android:textColor="@color/btn_text_color"
233 227 android:textSize="22sp" />
234 228  
235 229 <TextView
... ... @@ -237,7 +231,7 @@
237 231 android:layout_width="wrap_content"
238 232 android:layout_height="wrap_content"
239 233 android:layout_marginLeft="50dp"
240   - android:hint="473463746343"
  234 + android:hint=""
241 235 android:textSize="22sp" />
242 236  
243 237 </LinearLayout>
... ... @@ -253,7 +247,6 @@
253 247 android:layout_width="wrap_content"
254 248 android:layout_height="wrap_content"
255 249 android:text="购买地址"
256   - android:textColor="@color/btn_text_color"
257 250 android:textSize="22sp" />
258 251  
259 252 <TextView
... ... @@ -261,8 +254,7 @@
261 254 android:layout_width="wrap_content"
262 255 android:layout_height="wrap_content"
263 256 android:layout_marginLeft="80dp"
264   - android:text="啥啥啥 专卖店"
265   - android:textColor="@color/btn_text_color"
  257 + android:text=""
266 258 android:textSize="22sp" />
267 259 </LinearLayout>
268 260  
... ... @@ -286,7 +278,6 @@
286 278 android:layout_width="wrap_content"
287 279 android:layout_height="wrap_content"
288 280 android:text="手机号码"
289   - android:textColor="@color/btn_text_color"
290 281 android:textSize="22sp" />
291 282  
292 283 <TextView
... ... @@ -294,7 +285,7 @@
294 285 android:layout_width="wrap_content"
295 286 android:layout_height="wrap_content"
296 287 android:layout_marginLeft="50dp"
297   - android:text="IPone888"
  288 + android:text=""
298 289 android:textSize="22sp" />
299 290  
300 291  
... ... @@ -319,7 +310,7 @@
319 310 android:layout_height="wrap_content"
320 311 android:layout_marginLeft="40dp"
321 312 android:background="@null"
322   - android:text="1111111"
  313 + android:text=""
323 314 android:textSize="22sp" />
324 315  
325 316 </LinearLayout>
... ...
PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml
... ... @@ -55,9 +55,9 @@
55 55 android:layout_width="wrap_content"
56 56 android:layout_height="wrap_content"
57 57 android:layout_marginLeft="50dp"
  58 + android:textColor="@color/electronic_text"
58 59 android:background="@null"
59 60 android:hint="请输入12个以内的中文或英文字符"
60   - android:textColor="@color/electronic_text"
61 61 android:textSize="22sp" />
62 62  
63 63 </LinearLayout>
... ... @@ -80,7 +80,6 @@
80 80 android:layout_height="wrap_content"
81 81 android:layout_marginLeft="50dp"
82 82 android:hint="请选择"
83   - android:textColor="@color/btn_text_color"
84 83 android:textSize="22sp" />
85 84  
86 85 <ImageView
... ... @@ -174,6 +173,7 @@
174 173 android:layout_width="wrap_content"
175 174 android:layout_height="wrap_content"
176 175 android:layout_marginLeft="50dp"
  176 + android:textColor="@color/electronic_text"
177 177 android:background="@null"
178 178 android:hint="请输入详细地址"
179 179 android:textSize="22sp" />
... ... @@ -321,6 +321,7 @@
321 321 android:layout_height="wrap_content"
322 322 android:layout_marginLeft="50dp"
323 323 android:background="@null"
  324 + android:textColor="@color/electronic_text"
324 325 android:hint="请输入"
325 326 android:textSize="22sp" />
326 327  
... ... @@ -345,7 +346,6 @@
345 346 android:layout_height="wrap_content"
346 347 android:layout_marginLeft="50dp"
347 348 android:hint="请选择"
348   - android:textColor="@color/btn_text_color"
349 349 android:textSize="22sp" />
350 350  
351 351 <ImageView
... ...
PersonalCenter/app/src/test/java/com/hjx/personalcenter/ExampleUnitTest.java
... ... @@ -15,7 +15,7 @@ import static org.junit.Assert.*;
15 15 public class ExampleUnitTest {
16 16 @Test
17 17 public void addition_isCorrect() throws Exception {
18   -// assertEquals(4, 2 + 2);
  18 + assertEquals(4, 2 + 2);
19 19 Timer timer = new Timer();
20 20 timer.schedule(new TimerTask() {
21 21 @Override
... ...