| | |
| | | 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; |
| | |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.ui.mine.ShoppingTrolleyActivity; |
| | | import com.tejia.lijin.app.ui.recommend.RecommendCategoryFragment; |
| | | import com.tejia.lijin.app.ui.recommend.RecommendFragment; |
| | | import com.tejia.lijin.app.ui.recommend.SearchActivity; |
| | | import com.tejia.lijin.app.updateApp.UpdateApp; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.ToolUtil; |
| | | import com.tejia.lijin.app.util.ui.HomeUIUtil; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.CategoryCustomEvent; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.MainCustomEvent; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.SearchCustomEvent; |
| | |
| | | import com.wpc.library.util.cache.DiskLruCache; |
| | | import com.wpc.library.util.common.StorageUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.tejia.lijin.app.ui.recommend.RecommendFragment; |
| | | |
| | | import net.lucode.hackware.magicindicator.MagicIndicator; |
| | | import net.lucode.hackware.magicindicator.ViewPagerHelper; |
| | |
| | | contentView.findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | recommend_top_img = contentView.findViewById(R.id.recommend_top_img);//热门功能 |
| | | fl_search_content = contentView.findViewById(R.id.fl_search_content); |
| | | fl_search_content.setOnClickListener(this); |
| | |
| | | } |
| | | }, false);//强制检测更新-否. |
| | | |
| | | //设置背景色 |
| | | contentView.findViewById(R.id.apl_search).setBackground(HomeUIUtil.getHomeTopBg("#FF227B", "#FF2A3E")); |
| | | magic_indicator.setBackground(HomeUIUtil.getHomeTopBg("#FF227B", "#FF2A3E")); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | }, 1000); |
| | | |
| | | boolean isLogin = sp.getBoolean("isLogin", false); |
| | | boolean isLogin =UserUtil.isLogin(getContext()); |
| | | 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 { |
| | |
| | | builder.setPositiveButton(new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | final boolean isLogin = getContext().getSharedPreferences("user", |
| | | MODE_PRIVATE).getBoolean("isLogin", false); |
| | | final boolean isLogin = UserUtil.isLogin(getContext()); |
| | | if (accountLogin && !isLogin) { |
| | | clickState = 3; |
| | | UserUtil.jumpLogin(getContext()); |
| | |
| | | builder.setPositiveButton(new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | final boolean isLogin = getContext().getSharedPreferences("user", |
| | | MODE_PRIVATE).getBoolean("isLogin", false); |
| | | final boolean isLogin = UserUtil.isLogin(getContext()); |
| | | if (accountLogin && !isLogin) { |
| | | clickState = 4; |
| | | UserUtil.jumpLogin(getContext()); |
| | |
| | | } |
| | | 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 |