public void onClicks(ClickEvent event) { if (event.getView().getId() == R.id.tv_login || event.getView().getId() == R.id.tv_reg) { switch (event.getView().getId()) { case R.id.tv_login: mContext.startActivity(new Intent(mContext, LoginAct.class)); break; case R.id.tv_reg: mContext.startActivity(new Intent(mContext, RegAct.class)); break; } } else { if (DreamApplication.getApp().getUser() != null) { if (DreamApplication.getApp().getUser().isLogin()) { meFragmentView.setOnClickView(event.getView()); switch (event.getView().getId()) { case R.id.tv_pay: mContext.startActivity(new Intent(mContext, AccountPayAct.class)); break; case R.id.img_hand: // mContext.startActivity(new Intent(mContext, // UserInfoAct.class)); break; case R.id.layoutItem_address: mContext.startActivity(new Intent(mContext, AddressActivity.class)); break; case R.id.tv_my_dream_shoptv_my: mContext.startActivity(new Intent(mContext, MyDreamRecordAct.class)); break; case R.id.layoutItem_user: mContext.startActivity(new Intent(mContext, AccountAct.class)); break; case R.id.layoutItem_set: mContext.startActivity(new Intent(mContext, SetAct.class)); break; case R.id.tv_my_shop_buy: mContext.startActivity(new Intent(mContext, MyPrizeAct.class)); break; case R.id.tv_my_shop_card: mContext.startActivity(new Intent(mContext, ShopCartActivity.class)); break; case R.id.tv_my_shop_pub: mContext.startActivity(new Intent(mContext, ShowMeActivity.class)); break; } } else { ToastUtil.show("未登录"); } } else { ToastUtil.show("未登录"); } } }
public MEPM(Context context, MeFragmentView meView) { this.meFragmentView = meView; this.mContext = context; changeSupport = new PresentationModelChangeSupport(this); DreamApplication.getApp().eventBus().register(this); goLogin(); }
private void getDataPage() { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("page", page); map.put("size", size); DreamApplication.getApp() .getDreamNet() .netJsonPost(TAG_GET_MY_PRIZE, ProtocolUrl.USER_ORDER, map); }
private void setUserInfo(LoginResp resp) { if (RespCode.SUCCESS.equals(resp.getErrorCode())) { url = DreamApplication.getApp().getUser().getImg(); if (StringUtils.isEmpty(DreamApplication.getApp().getUser().getUsername())) { userName = DreamApplication.getApp().getUser().getMobile(); } else { userName = DreamApplication.getApp().getUser().getUsername(); } userTag = DreamApplication.getApp().getUser().getYungoudj(); if (DreamApplication.getApp().getUser().getMoney() != 0) { userMoey = mContext .getResources() .getString( R.string.tv_balance, String.valueOf(DreamApplication.getApp().getUser().getMoney())); } else { userMoey = "余额:0元"; } int score = DreamApplication.getApp().getUser().getScore() / DreamApplication.getApp().getLoginBean().getFufen_yuan(); if (mContext != null) { userScore = mContext.getResources().getString(R.string.tv_score, String.valueOf(score)); // 圆梦币计算结果 } refresh(); meFragmentView.onClickView(1); } else { ToastUtil.show(resp.getErrorMsg()); } }
/** * QQ登录后头像及信息 * * @param resp */ @Subcriber(tag = LoginTag.LOGIN_QQ, threadMode = ThreadMode.MainThread) public void loginRespHandlerQQ(LoginResp resp) { DreamApplication.getApp().getUser().setImg(LoginPM.QQ_HEAD_URL); setUserInfo(resp); }
MyPrizePM(MyPrizeView baseActViews) { this.view = baseActViews; DreamApplication.getApp().eventBus().register(this); }