我的修改完成
This commit is contained in:
@@ -23,6 +23,7 @@ import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -133,6 +134,7 @@ public class CommonAppConfig {
|
||||
private boolean mLaunched;//App是否启动了
|
||||
private String mJPushAppKey;//极光推送的AppKey
|
||||
private List<UserItemBean> mUserItemList;//个人中心功能列表
|
||||
private List<List<UserItemBean>> mYolaUserItemList;//个人中心功能列表
|
||||
private SparseArray<FansMedalBean> mAnchorFansMedalMap;
|
||||
private String mGiftListJson;
|
||||
private String mWrapListJson;
|
||||
@@ -550,6 +552,42 @@ public class CommonAppConfig {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人中心功能列表
|
||||
*/
|
||||
public List<List<UserItemBean>> geYolatUserItemList() {
|
||||
if (mYolaUserItemList == null || mYolaUserItemList.size() == 0) {
|
||||
String userBeanJson = SpUtil.getInstance().getStringValue(SpUtil.USER_INFO);
|
||||
if (!TextUtils.isEmpty(userBeanJson)) {
|
||||
JSONObject obj = JSON.parseObject(userBeanJson);
|
||||
if (obj != null) {
|
||||
setYolatUserItemList(obj.getString("yola_list"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return mYolaUserItemList;
|
||||
}
|
||||
|
||||
public void setYolatUserItemList(String yola_list) {
|
||||
if (yola_list == null || yola_list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mYolaUserItemList.clear();
|
||||
JSONObject obj = JSON.parseObject(yola_list);
|
||||
|
||||
if (obj != null) {
|
||||
List<UserItemBean> list1 = JSON.parseArray(obj.getString("user_rights"), UserItemBean.class);
|
||||
List<UserItemBean> list2 = JSON.parseArray(obj.getString("creation_center"), UserItemBean.class);
|
||||
List<UserItemBean> list3 = JSON.parseArray(obj.getString("other_functions"), UserItemBean.class);
|
||||
|
||||
mYolaUserItemList.add(list1);
|
||||
mYolaUserItemList.add(list2);
|
||||
mYolaUserItemList.add(list3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setUserItemList(String listString) {
|
||||
UserItemBean[][] arr = JSON.parseObject(listString, UserItemBean[][].class);
|
||||
if (arr != null && arr.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user