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

1.我的页面样式

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