| | |
| | | import com.tejia.lijin.app.BasicTextHttpResponseHandler; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.ShoppingApi; |
| | | import com.tejia.lijin.app.ShoppingApplication; |
| | | import com.tejia.lijin.app.entity.EntityFather; |
| | | import com.tejia.lijin.app.entity.FirstCategory; |
| | | import com.tejia.lijin.app.entity.TrendsType; |
| | |
| | | |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | if (isLogin) { |
| | | String uid = sp.getString("uid", "0"); |
| | | if (!uid.equalsIgnoreCase("0")) { |
| | | getUserInfo(uid); |
| | | } |
| | | getUserInfo(UserUtil.getUid(ShoppingApplication.application)); |
| | | if (accountLogin && floatImgDetail != null) {//弹框需要登陆 |
| | | accountLogin = false; |
| | | final String showTime = floatImgDetail.optString("showTime"); // everyday-每天显示 always-每次进来都显示 |
| | |
| | | |
| | | |
| | | private void getHomeConfig() { |
| | | String uid = getContext().getSharedPreferences("user", Context.MODE_PRIVATE).getString("uid", ""); |
| | | if (!StringUtils.isEmpty(uid) && !uid.equalsIgnoreCase("0")) |
| | | lastRquestHomeConfigUid = Long.parseLong(uid); |
| | | Long uid = UserUtil.getUid(ShoppingApplication.application); |
| | | if (uid != null) |
| | | lastRquestHomeConfigUid = uid; |
| | | ShoppingApi.getHomeConfig(ll_recommend_content.getContext(), uid, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | |
| | | } |
| | | if (mList.size() == 0) |
| | | pd.show(); |
| | | String uid = ll_recommend_content.getContext().getSharedPreferences("user", |
| | | MODE_PRIVATE).getString("uid", ""); |
| | | ShoppingApi.getHomeNavbar(ll_recommend_content.getContext(), uid, |
| | | |
| | | ShoppingApi.getHomeNavbar(ll_recommend_content.getContext(), UserUtil.getUid(ShoppingApplication.application), |
| | | new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | |
| | | |
| | | String openid; |
| | | |
| | | private void getUserInfo(final String uid) { |
| | | private void getUserInfo(final Long uid) { |
| | | ShoppingApi.getUserInfo2(ll_no_data.getContext(), uid, new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | |
| | | }.getType()); |
| | | openid = info.getOpenid(); |
| | | String inviteCode = data.optString("invitCode"); |
| | | UserUtil.setInviteCode(getContext(), uid, inviteCode); |
| | | UserUtil.setInviteCode(getContext(), inviteCode); |
| | | } |
| | | } |
| | | |
| | |
| | | private void getShopList(String id) { |
| | | //精选 |
| | | SharedPreferences sp = getActivity().getSharedPreferences("user", MODE_PRIVATE); |
| | | ShoppingApi.getShopList(ll_recommend_content.getContext(), 1 + "", id, (sp.getBoolean("isLogin", false) ? sp.getString("uid", "0") : null), new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getShopList(ll_recommend_content.getContext(), 1 + "", id, UserUtil.getUid(ShoppingApplication.application), new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | |
| | | //精选 |
| | | if (id.equals("0")) { |
| | | SharedPreferences sp = getActivity().getSharedPreferences("user", MODE_PRIVATE); |
| | | ShoppingApi.getHistory(ll_recommend_content.getContext(), "1", (sp.getBoolean("isLogin", false) ? sp.getString("uid", "0") : null), "1", new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getHistory(ll_recommend_content.getContext(), "1", UserUtil.getUid(ShoppingApplication.application), "1", new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | if (jsonObject.optString("code").equalsIgnoreCase("0")) { |
| | |
| | | */ |
| | | private void getMessage() { |
| | | SharedPreferences sp = ll_recommend_content.getContext().getSharedPreferences("user", MODE_PRIVATE); |
| | | String uid = sp.getString("uid", ""); |
| | | ShoppingApi.getHomeMsgList(ll_recommend_content.getContext(), uid, 1 + "", new BasicTextHttpResponseHandler() { |
| | | ShoppingApi.getHomeMsgList(ll_recommend_content.getContext(), UserUtil.getUid(ShoppingApplication.application), 1 + "", new BasicTextHttpResponseHandler() { |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | DiskLruCache.Editor editor = cache |