| | |
| | | import com.nostra13.universalimageloader.core.ImageLoader; |
| | | import com.nostra13.universalimageloader.core.assist.ImageScaleType; |
| | | import com.nostra13.universalimageloader.core.display.CircleBitmapDisplayer; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.ui.message.UserMessageActivity; |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | | import com.umeng.analytics.MobclickAgent; |
| | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | mineFunctionsManager = new MineFunctionsManager(getContext()); |
| | | String inviteCode = UserUtil.getInviteCode(getContext(), null); |
| | | String inviteCode = UserUtil.getInviteCode(getContext()); |
| | | init(contentView); |
| | | listener(contentView); |
| | | app = new UpdateApp(getActivity(), getResources().getString(R.string.update_key)); |
| | |
| | | public void onResume() { |
| | | super.onResume(); |
| | | getUserConfig(); |
| | | getUnReadMsgCount(UserUtil.getUid(getContext()) + ""); |
| | | getUnReadMsgCount(UserUtil.getUid(getContext())); |
| | | MobclickAgent.onPageStart("我的"); |
| | | SharedPreferences sp = tv_nickName.getContext().getSharedPreferences("user", MODE_PRIVATE); |
| | | if (sp.getBoolean("isLogin", false)) { |
| | |
| | | tv_user_num.setVisibility(View.VISIBLE); |
| | | ll_nick_name_vip.setVisibility(View.VISIBLE); |
| | | tv_nickName.setVisibility(View.VISIBLE); |
| | | String uid = sp.getString("uid", "0"); |
| | | Long uid = UserUtil.getUid(ShoppingApplication.application); |
| | | if (lastTime > 0 && (System.currentTimeMillis() - lastTime > 30 * 1000)) { |
| | | clickState = 0; |
| | | } |
| | | if (!uid.equalsIgnoreCase("0")) { |
| | | if (uid != null) { |
| | | String userInfo = sp.getString("userinfo", ""); |
| | | if (!StringUtils.isEmpty(userInfo)) { |
| | | try { |
| | |
| | | break; |
| | | |
| | | case R.id.fl_msg: |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()), true)) |
| | | return; |
| | | startActivity(new Intent(getContext(), UserMessageActivity.class)); |
| | | break; |
| | | |
| | | case R.id.tv_nickname: |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()), true)) |
| | | return; |
| | | if (!isLogin) {//登录淘宝 |
| | | UserUtil.jumpLogin(tv_nickName.getContext()); |
| | |
| | | |
| | | //头像 |
| | | case R.id.iv_portrait: |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()), true)) |
| | | return; |
| | | UserCustomEvent.userMyInfo(ll_notice.getContext()); |
| | | if (!isLogin) {//登录 |
| | |
| | | break; |
| | | //账户余额 |
| | | case R.id.ll_balance: |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()), true)) |
| | | return; |
| | | UserCustomEvent.userBalance(tv_user_num.getContext()); |
| | | if (isLogin) { |
| | |
| | | }, 200); |
| | | |
| | | |
| | | ShoppingApi.getUserMoneyInfo(getContext(), getContext().getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", ""), new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getUserMoneyInfo(getContext(), UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | ll_balance.setEnabled(true); |
| | |
| | | |
| | | |
| | | case R.id.iv_vip: |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()) + "", true)) |
| | | if (!LoginAndInviteStatusUtil.acessNext(getContext(), UserUtil.getUid(getContext()), true)) |
| | | return; |
| | | //跳转到vip |
| | | if (userInviteLevel != null && !StringUtils.isEmpty(userInviteLevel.getLink())) |
| | |
| | | private UserInviteLevel userInviteLevel;//用户邀请等级 |
| | | |
| | | /****用户信息*/ |
| | | private void getUserInfo(final String uid) { |
| | | private void getUserInfo(final Long uid) { |
| | | ShoppingApi.getUserInfo2(tv_nickName.getContext(), uid, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |
| | | JSONObject data = jsonObject.optJSONObject("data"); |
| | | String inviteCode = data.optString("invitCode"); |
| | | UserUtil.setInviteCode(getContext(), uid, inviteCode); |
| | | UserUtil.setInviteCode(getContext(), inviteCode); |
| | | vipLink = data.optString("vipLink"); |
| | | moduleState = data.optJSONObject("moduleState"); |
| | | if (mineFunctionsManager != null) |
| | |
| | | * |
| | | * @param uid |
| | | */ |
| | | private void user_recordBind(String uid) { |
| | | private void user_recordBind(Long uid) { |
| | | ShoppingApi.setRecordBind(tv_nickName.getContext(), uid, null); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param uid |
| | | */ |
| | | private void getUnReadMsgCount(String uid) { |
| | | private void getUnReadMsgCount(Long uid) { |
| | | ShoppingApi.getUnReadMsgCount(getContext(), uid, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |