| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.wpc.library.content.ConnectivityChangeHelper; |
| | | import com.wpc.library.recyclerviewhelper.DividerItemDecoration; |
| | | import com.wpc.library.util.NetUtils; |
| | |
| | | adapter = new MainMessageAdapter(rv_message.getContext(), mList, new IDeleteMessageListener() { |
| | | @Override |
| | | public void delete(final UserMessage msg) { |
| | | if (LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) { |
| | | ShoppingApi.deleteMsg(getContext(), UserUtil.getUid(getContext()) + "", msg.getType(), msg.getId(), new BasicTextHttpResponseHandler() { |
| | | if (LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) { |
| | | ShoppingApi.deleteMsg(getContext(), UserUtil.getUid(getContext()) , msg.getType(), msg.getId(), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | super.onSuccessPerfect(statusCode, headers, jsonObject); |
| | |
| | | * 获取消息未读数量 |
| | | */ |
| | | private void getUnReadMsgCount() { |
| | | mPresenter.getUnReadMsgCount(mPresenter.getUID()); |
| | | mPresenter.getUnReadMsgCount(UserUtil.getUid(ShoppingApplication.application)); |
| | | } |
| | | |
| | | /** |
| | | * 一键清空未读消息 |
| | | */ |
| | | private void setAllMsgRead() { |
| | | mPresenter.setAllMsgRead(mPresenter.getUID()); |
| | | mPresenter.setAllMsgRead(UserUtil.getUid(ShoppingApplication.application)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | switch (v.getId()) { |
| | | case R.id.fl_order_notice: { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | |
| | | if (!isLogin) {//判断登陆 |
| | |
| | | break; |
| | | } |
| | | case R.id.fl_capital_notice: { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | if (!isLogin) {//判断登陆 |
| | | isChoice = true;//代表点击 |
| | |
| | | break; |
| | | } |
| | | case R.id.fl_account_notice: { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | if (!isLogin) {//判断登陆 |
| | | isChoice = true;//代表点击 |
| | |
| | | break; |
| | | } |
| | | case R.id.fl_invite_notice: { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | if (!isLogin) {//判断登陆 |
| | | isChoice = true;//代表点击 |
| | |
| | | break; |
| | | } |
| | | case R.id.fl_other_msg: { |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | if (!isLogin) {//判断登陆 |
| | | isChoice = true;//代表点击 |
| | |
| | | break; |
| | | } |
| | | case R.id.ll_critical_notice://系统消息 |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) , true)) |
| | | return; |
| | | if (!isLogin) {//判断登陆 |
| | | UserUtil.jumpLogin(fl_order_notice.getContext()); |
| | |
| | | * 消息中心红包 |
| | | */ |
| | | private void getMSGConfig() { |
| | | mPresenter.getMSGConfig(mPresenter.getUID()); |
| | | mPresenter.getMSGConfig(UserUtil.getUid(ShoppingApplication.application)); |
| | | } |
| | | |
| | | /** |