提交 1182eaf1 authored 作者: lgd's avatar lgd

1.我的页面样式

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 5d81ede7
package com.wd.workoffice.ui.activity.user; package com.wd.workoffice.ui.activity.user;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -39,13 +40,20 @@ public class UserInfoActivity extends WorkToolBarActivity { ...@@ -39,13 +40,20 @@ public class UserInfoActivity extends WorkToolBarActivity {
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
String userInfo = UserKeeper.getInstance().getUserInfo(); if (!TextUtils.isEmpty(UserKeeper.getInstance().getLoginInfo())) {
if (!TextUtils.isEmpty(userInfo)) { String userInfo = UserKeeper.getInstance().getUserInfo();
UserInfoBean userInfoBean = JSON.parseObject(userInfo, UserInfoBean.class); if (!TextUtils.isEmpty(userInfo)) {
tvName.setText(userInfoBean.getUserName()); UserInfoBean userInfoBean = JSON.parseObject(userInfo, UserInfoBean.class);
tvPhone.setText(userInfoBean.getPhone()); tvName.setText(userInfoBean.getUserName());
tvNo.setText(userInfoBean.getErpId()); tvPhone.setText(userInfoBean.getPhone());
tvDep.setText(userInfoBean.getOfDept().getName() ); tvNo.setText(userInfoBean.getErpId());
tvDep.setText(userInfoBean.getOfDept().getName());
}
} else {
tvName.setText(UserKeeper.getInstance().getMesNickName());
tvPhone.setText(UserKeeper.getInstance().getMesMobile());
tvNo.setText(UserKeeper.getInstance().getMesUserCode());
tvDep.setText(UserKeeper.getInstance().getMesDep());
} }
} }
......
...@@ -57,11 +57,17 @@ public class UserSettingActivity extends WorkToolBarActivity { ...@@ -57,11 +57,17 @@ public class UserSettingActivity extends WorkToolBarActivity {
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
String userInfo = UserKeeper.getInstance().getUserInfo(); if (!TextUtils.isEmpty(UserKeeper.getInstance().getLoginInfo())) {
if (!TextUtils.isEmpty(userInfo)) { String userInfo = UserKeeper.getInstance().getUserInfo();
UserInfoBean userInfoBean = JSON.parseObject(userInfo, UserInfoBean.class); if (!TextUtils.isEmpty(userInfo)) {
tvName.setText(userInfoBean.getUserName()); UserInfoBean userInfoBean = JSON.parseObject(userInfo, UserInfoBean.class);
tvPhone.setText(userInfoBean.getPhone()); tvName.setText(userInfoBean.getUserName());
tvPhone.setText(userInfoBean.getPhone());
}
} else {
rlPwd.setVisibility(View.GONE);
tvName.setText(UserKeeper.getInstance().getMesNickName());
tvPhone.setText(UserKeeper.getInstance().getMesMobile());
} }
} }
......
package com.wd.workoffice.ui.fg; package com.wd.workoffice.ui.fg;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -36,13 +37,29 @@ public class MyFragment extends WorkBaseFg { ...@@ -36,13 +37,29 @@ public class MyFragment extends WorkBaseFg {
LinearLayout llSetting; LinearLayout llSetting;
@BindView(R.id.tv_dep) @BindView(R.id.tv_dep)
TextView tvDep; TextView tvDep;
@BindView(R.id.ll_money)
LinearLayout llMoney;
@BindView(R.id.ll_mes_setting)
LinearLayout llMesSetting;
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this, getContentView()); ButterKnife.bind(this, getContentView());
tvNo.setText("员工编号:" + UserKeeper.getInstance().getUserErpId()); if (!TextUtils.isEmpty(UserKeeper.getInstance().getLoginInfo())) {
tvName.setText(UserKeeper.getInstance().getUserNickName()); tvNo.setText("员工编号:" + UserKeeper.getInstance().getUserErpId());
tvDep.setText(UserKeeper.getInstance().getUserDepName()); tvName.setText(UserKeeper.getInstance().getUserNickName());
tvDep.setText(UserKeeper.getInstance().getUserDepName());
if (!UserKeeper.getInstance().getMesLogin()) {
llMesSetting.setVisibility(View.GONE);
}
} else {
tvNo.setText("员工编号:" + UserKeeper.getInstance().getMesUserCode());
tvName.setText(UserKeeper.getInstance().getMesNickName());
tvDep.setText(UserKeeper.getInstance().getMesDep());
llSetting.setVisibility(View.GONE);
llRole.setVisibility(View.GONE);
llMoney.setVisibility(View.GONE);
}
} }
...@@ -61,7 +78,7 @@ public class MyFragment extends WorkBaseFg { ...@@ -61,7 +78,7 @@ public class MyFragment extends WorkBaseFg {
} }
@OnClick({R.id.ll_role,R.id.ll_money, R.id.ll_info, R.id.ll_setting}) @OnClick({R.id.ll_mes_setting, R.id.ll_role, R.id.ll_money, R.id.ll_info, R.id.ll_setting})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.ll_role: case R.id.ll_role:
...@@ -73,6 +90,9 @@ public class MyFragment extends WorkBaseFg { ...@@ -73,6 +90,9 @@ public class MyFragment extends WorkBaseFg {
case R.id.ll_setting: case R.id.ll_setting:
startActivity(UserSettingActivity.class); startActivity(UserSettingActivity.class);
break; break;
case R.id.ll_mes_setting:
startActivity(UserSettingActivity.class);
break;
case R.id.ll_money: case R.id.ll_money:
startActivity(UserMoneyActivity.class); startActivity(UserMoneyActivity.class);
break; break;
......
...@@ -93,6 +93,17 @@ public class UserKeeper { ...@@ -93,6 +93,17 @@ public class UserKeeper {
/** /**
* mes的用户信息 * mes的用户信息
* {
* "userId": "91c7f1d7722d11ea8334fa163e1166bd",
* "name": "吴同得",
* "cardid": "91c7f1d7722d11ea8334fa163e1166bd",
* "roleid": "",
* "rolename": "",
* "userCode": "wtd",
* "departmentId": "1c37c889ffa211e98334fa163e1166bd",
* "departmentName": "铝碳厂",
* "mobile": "1"
* },
* *
* @param info * @param info
*/ */
...@@ -107,6 +118,7 @@ public class UserKeeper { ...@@ -107,6 +118,7 @@ public class UserKeeper {
public void clearMesLoginInfo() { public void clearMesLoginInfo() {
sp.put(MES_LOGIN_INFO, ""); sp.put(MES_LOGIN_INFO, "");
} }
/** /**
* mes的用户id * mes的用户id
* *
...@@ -115,14 +127,15 @@ public class UserKeeper { ...@@ -115,14 +127,15 @@ public class UserKeeper {
public String getMesUid() { public String getMesUid() {
JSONObject mesInfo = JSON.parseObject(getMesLoginInfo()); JSONObject mesInfo = JSON.parseObject(getMesLoginInfo());
if (!TextUtils.isEmpty(getMesLoginInfo())){ if (!TextUtils.isEmpty(getMesLoginInfo())) {
return mesInfo.getString("userId"); return mesInfo.getString("userId");
} }
return ""; return "";
} }
public String getMesErpId() { public String getMesErpId() {
JSONObject mesInfo = JSON.parseObject(getMesLoginInfo()); JSONObject mesInfo = JSON.parseObject(getMesLoginInfo());
if (!TextUtils.isEmpty(getMesLoginInfo())){ if (!TextUtils.isEmpty(getMesLoginInfo())) {
return mesInfo.getString("userCode"); return mesInfo.getString("userCode");
} }
return ""; return "";
...@@ -130,6 +143,7 @@ public class UserKeeper { ...@@ -130,6 +143,7 @@ public class UserKeeper {
/** /**
* bat 用户信息 * bat 用户信息
*
* @param info * @param info
*/ */
public void keepLoginInfo(String info) { public void keepLoginInfo(String info) {
...@@ -206,7 +220,7 @@ public class UserKeeper { ...@@ -206,7 +220,7 @@ public class UserKeeper {
return ""; return "";
} }
UserInfoBean infoBean = JSON.parseObject(sp.getString(USER_INFO), UserInfoBean.class); UserInfoBean infoBean = JSON.parseObject(sp.getString(USER_INFO), UserInfoBean.class);
if (infoBean == null ) { if (infoBean == null) {
return ""; return "";
} }
return infoBean.getOfDeptRuler(); return infoBean.getOfDeptRuler();
...@@ -256,6 +270,50 @@ public class UserKeeper { ...@@ -256,6 +270,50 @@ public class UserKeeper {
return infoBean.getNickName(); return infoBean.getNickName();
} }
public String getMesNickName() {
if (TextUtils.isEmpty(sp.getString(MES_LOGIN_INFO))) {
return "";
}
JSONObject infoBean = JSON.parseObject(sp.getString(MES_LOGIN_INFO));
if (infoBean == null) {
return "";
}
return infoBean.getString("name");
}
public String getMesDep() {
if (TextUtils.isEmpty(sp.getString(MES_LOGIN_INFO))) {
return "";
}
JSONObject infoBean = JSON.parseObject(sp.getString(MES_LOGIN_INFO));
if (infoBean == null) {
return "";
}
return infoBean.getString("departmentName");
}
public String getMesUserCode() {
if (TextUtils.isEmpty(sp.getString(MES_LOGIN_INFO))) {
return "";
}
JSONObject infoBean = JSON.parseObject(sp.getString(MES_LOGIN_INFO));
if (infoBean == null) {
return "";
}
return infoBean.getString("userCode");
}
public String getMesMobile() {
if (TextUtils.isEmpty(sp.getString(MES_LOGIN_INFO))) {
return "";
}
JSONObject infoBean = JSON.parseObject(sp.getString(MES_LOGIN_INFO));
if (infoBean == null) {
return "";
}
return infoBean.getString("mobile");
}
public void clearAll() { public void clearAll() {
clearLoginInfo(); clearLoginInfo();
clearUserInfo(); clearUserInfo();
......
...@@ -178,7 +178,39 @@ ...@@ -178,7 +178,39 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:layout_weight="1" android:layout_weight="1"
android:text="系统设置" android:text="BAT系统设置"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View
style="@style/dividerX"
android:layout_marginHorizontal="26mm" />
<LinearLayout
android:id="@+id/ll_mes_setting"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24mm"
android:layout_height="24mm"
android:background="@mipmap/my_setting" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10mm"
android:layout_weight="1"
android:text="MES系统设置"
android:textSize="16sp" /> android:textSize="16sp" />
<ImageView <ImageView
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论