admin
2021-05-14 1b4b3fed2569ac21ad6feb0a3a2c051175e7c36e
app/src/main/java/com/tejia/lijin/app/ui/main/RecommendTopFragment.java
@@ -35,6 +35,7 @@
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;
@@ -481,10 +482,7 @@
        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-每次进来都显示
@@ -756,9 +754,9 @@
    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 {
@@ -1023,9 +1021,8 @@
        }
        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
@@ -1207,7 +1204,7 @@
    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 {
@@ -1218,7 +1215,7 @@
                    }.getType());
                    openid = info.getOpenid();
                    String inviteCode = data.optString("invitCode");
                    UserUtil.setInviteCode(getContext(), uid, inviteCode);
                    UserUtil.setInviteCode(getContext(), inviteCode);
                }
            }
@@ -1342,7 +1339,7 @@
    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 {
@@ -1365,7 +1362,7 @@
        //精选
        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")) {
@@ -1385,8 +1382,7 @@
     */
    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