Browse Source

更新代码

小狼 5 years ago
parent
commit
436652fb4e

+ 1 - 2
app/src/main/java/com/smileflowpig/money/moneyplatfrom/activities/CaseurlActivity.java

@@ -152,7 +152,7 @@ public class CaseurlActivity extends PresenterActivity implements View.OnClickLi
152 152
         //资讯h5
153 153
         //https://m.henhaojie.com/xiaohuazhu/information.html?id=3&view_num=1&sessionid=fdhof410su74rraob9matto0r4
154 154
         //如果datta不为空,说明是华为推送过来的数据,从url里面获取数据
155
-        if(strurl.equals("")){
155
+        if(strurl==null||strurl.equals("")){
156 156
             if (data != null) {
157 157
                 String pushId = data.getQueryParameter("isPush");
158 158
                 isPush = pushId.equals("1") ? true : false;
@@ -165,7 +165,6 @@ public class CaseurlActivity extends PresenterActivity implements View.OnClickLi
165 165
                 } else {
166 166
                     strurl = ONLINE_URL + "id=" + urlid + "&view_num=" + urlname + "&sessionid=" + sessionid;
167 167
                 }
168
-
169 168
             }
170 169
             wv.loadUrl(strurl);
171 170
         }else {

+ 4 - 3
app/src/main/java/com/smileflowpig/money/moneyplatfrom/activities/MySetActivity.java

@@ -384,9 +384,10 @@ public class MySetActivity extends PresenterActivity<ExistContract.Presenter>
384 384
     @Override
385 385
     public void ExistSuccess() {
386 386
 
387
-        SPUtil.clear(this);
388
-        com.smileflowpig.money.factory.util.SPUtil.clear(this);
389
-        com.smileflowpig.money.factory.util.SPUtil.putAndApply(this, Constant.UserInfo.ISEXITE, true);
387
+//        SPUtil.clear(this);
388
+//        com.smileflowpig.money.factory.util.SPUtil.clear(this);
389
+     SPUtil.putAndApply(this, Constant.UserInfo.ISEXITE, true);
390
+        SPUtil.putAndApply(this, Constant.UserInfo.SESSIONID, "");
390 391
         finish();
391 392
     }
392 393
 

+ 9 - 3
app/src/main/java/com/smileflowpig/money/moneyplatfrom/activities/MySetTwoActivity.java

@@ -13,6 +13,7 @@ import android.os.Environment;
13 13
 import android.provider.MediaStore;
14 14
 import android.support.annotation.NonNull;
15 15
 import android.support.v4.content.FileProvider;
16
+import android.text.TextUtils;
16 17
 import android.util.Log;
17 18
 import android.view.Gravity;
18 19
 import android.view.LayoutInflater;
@@ -132,11 +133,16 @@ public class MySetTwoActivity extends PresenterActivity implements View.OnClickL
132 133
         String loginsex = intent.getStringExtra("loginsex");
133 134
         String loginindent = intent.getStringExtra("loginindent");
134 135
 
135
-
136
-        Glide.with(MySetTwoActivity.this).load(loginicon).error(R.mipmap.loginicon).into(icon);
137
-
136
+        if(loginicon==null||loginicon.equals("")){
137
+            icon.setImageResource(R.mipmap.loginicon);
138
+        }else {
139
+            Glide.with(MySetTwoActivity.this).load(loginicon).error(R.mipmap.loginicon).into(icon);
140
+        }
141
+        if(!TextUtils.isEmpty(loginname))
138 142
         name.setText(loginname);
143
+        if(!TextUtils.isEmpty(loginsex))
139 144
         sex.setText(loginsex);
145
+        if(!TextUtils.isEmpty(loginindent))
140 146
         typetext.setText(loginindent);
141 147
 
142 148
     }

+ 4 - 3
app/src/main/java/com/smileflowpig/money/moneyplatfrom/activities/SetActivity.java

@@ -73,9 +73,10 @@ public class SetActivity extends PresenterActivity<ExistContract.Presenter>
73 73
     @Override
74 74
     public void ExistSuccess() {
75 75
         EventBus.getDefault().post(new SecondEvent("登录/注册"));
76
-        SPUtil.clear(this);
77
-        com.smileflowpig.money.factory.util.SPUtil.clear(this);
78
-        com.smileflowpig.money.factory.util.SPUtil.putAndApply(this, Constant.UserInfo.ISEXITE, true);
76
+//        SPUtil.clear(this);
77
+//        com.smileflowpig.money.factory.util.SPUtil.clear(this);`
78
+       SPUtil.putAndApply(this, Constant.UserInfo.ISEXITE, true);
79
+      SPUtil.putAndApply(this, Constant.UserInfo.SESSIONID, "");
79 80
         finish();
80 81
 
81 82
     }

+ 2 - 0
app/src/main/java/com/smileflowpig/money/moneyplatfrom/activities/TableActivity.java

@@ -13,6 +13,7 @@ import android.widget.LinearLayout;
13 13
 import android.widget.PopupWindow;
14 14
 import android.widget.TextView;
15 15
 
16
+import com.android.tu.loadingdialog.LoadingDialog;
16 17
 import com.asm.base.android.ui.launcher.BaseApplication;
17 18
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
18 19
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
@@ -103,6 +104,7 @@ public class TableActivity extends PresenterActivity implements View.OnClickList
103 104
             //其他类型
104 105
             showOnlyDialogLoadding();
105 106
             getdatalist();
107
+
106 108
         }
107 109
 
108 110
     }

+ 8 - 2
app/src/main/java/com/smileflowpig/money/moneyplatfrom/frags/account/RegisterFragment.java

@@ -17,6 +17,8 @@ import android.widget.ImageView;
17 17
 import android.widget.TextView;
18 18
 import android.widget.Toast;
19 19
 
20
+import com.smileflowpig.money.factory.Constant;
21
+import com.smileflowpig.money.factory.util.SPUtil;
20 22
 import com.smileflowpig.money.moneyplatfrom.activities.Webview_protocol;
21 23
 
22 24
 import net.qiujuer.genius.ui.widget.Button;
@@ -26,6 +28,7 @@ import org.greenrobot.eventbus.EventBus;
26 28
 
27 29
 import butterknife.BindView;
28 30
 import butterknife.OnClick;
31
+
29 32
 import com.smileflowpig.money.BuildConfig;
30 33
 import com.smileflowpig.money.R;
31 34
 import com.smileflowpig.money.common.SecondEvent;
@@ -80,9 +83,9 @@ public class RegisterFragment extends PresenterFragment<RegisterContract.Present
80 83
     }
81 84
 
82 85
 
83
-
84 86
     @BindView(R.id.fragment_register_delete_pwdimg)
85 87
     ImageView register_check_imge;
88
+
86 89
     @Override
87 90
     public void onAttach(Context context) {
88 91
         super.onAttach(context);
@@ -96,8 +99,9 @@ public class RegisterFragment extends PresenterFragment<RegisterContract.Present
96 99
      * 显示隐藏密码
97 100
      */
98 101
     boolean isCheck;
102
+
99 103
     @OnClick(R.id.fragment_register_delete_pwdimg)
100
-    void onCheck(){
104
+    void onCheck() {
101 105
         if (!isCheck) {
102 106
             mPassword.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
103 107
             isCheck = true;
@@ -162,6 +166,8 @@ public class RegisterFragment extends PresenterFragment<RegisterContract.Present
162 166
 
163 167
 //        MainActivity.show(getActivity());
164 168
         EventBus.getDefault().post(new SecondEvent(user.phone));
169
+        //注册时候登录成功
170
+        SPUtil.putAndApply(getActivity(), Constant.UserInfo.ISEXITE, false);
165 171
         listener.onRegistSuccess(false);
166 172
     }
167 173
 

+ 18 - 11
app/src/main/java/com/smileflowpig/money/moneyplatfrom/frags/main/state/NewMineFragment.java

@@ -58,6 +58,7 @@ import com.smileflowpig.money.moneyplatfrom.util.DialogPermission;
58 58
 import com.smileflowpig.money.moneyplatfrom.util.FileUtil;
59 59
 import com.smileflowpig.money.moneyplatfrom.util.PermissionUtil;
60 60
 import com.smileflowpig.money.moneyplatfrom.util.SharedPreferenceMark;
61
+import com.smileflowpig.money.moneyplatfrom.util.ToastUtil;
61 62
 import com.umeng.analytics.MobclickAgent;
62 63
 
63 64
 import java.io.File;
@@ -151,27 +152,34 @@ public class NewMineFragment extends PresenterFragment<StateContract.Presenter>
151 152
     @Override
152 153
     protected void initWidget(View root) {
153 154
         super.initWidget(root);
154
-        mPresenter.start();
155
+        if (LoginStatusUtil.isLogin()) {
156
+            //登录先显示缓存的
157
+            String nick = (String) SPUtil.get(getActivity(), com.smileflowpig.money.factory.Constant.UserInfo.NICK, "");
158
+            String icon_url = (String) SPUtil.get(getActivity(), com.smileflowpig.money.factory.Constant.UserInfo.ICONURL, "");
159
+            login.setText(nick);
160
+            Glide.with(getActivity()).load(icon_url).into(loginicon);
161
+            mPresenter.start();
162
+        }
163
+
155 164
     }
156 165
 
157 166
     @Override
158 167
     public void onStart() {
159 168
         super.onStart();
160
-        mPresenter.start();
169
+
161 170
 
162 171
     }
163 172
 
164 173
     @Override
165 174
     public void stateLogin(User user) {
166
-
167 175
 //
176
+        if (user == null) {
177
+            return;
178
+        }
179
+        SPUtil.putAndApply(getActivity(), com.smileflowpig.money.factory.Constant.UserInfo.NICK, user.nick);
180
+        SPUtil.putAndApply(getActivity(), com.smileflowpig.money.factory.Constant.UserInfo.ICONURL, user.avatar_url);
168 181
         login.setText(user.nick);
169
-        System.out.println(user.avatar_url + "图片地址");
170
-//        if (user.avatar_url.equals("")) {
171
-//            loginicon.setImageResource(R.mipmap.loginicon);
172
-//        } else {
173
-            Glide.with(getActivity()).load(user.avatar_url).into(loginicon);
174
-//        }
182
+        Glide.with(getActivity()).load(user.avatar_url).into(loginicon);
175 183
 
176 184
         sharedPreferences.edit().putString("myphonecode", user.phone).commit();
177 185
         myiconurl = user.avatar_url;
@@ -305,7 +313,7 @@ public class NewMineFragment extends PresenterFragment<StateContract.Presenter>
305 313
                 MobclickAgent.onEvent(getActivity(), "mineSetting");
306 314
                 break;
307 315
             case R.id.fragment_mine_message_img:
308
-                Intent intent3=new Intent(getActivity(), MessContextActivity.class);
316
+                Intent intent3 = new Intent(getActivity(), MessContextActivity.class);
309 317
                 startActivity(intent3);
310 318
                 message_img.setImageResource(R.mipmap.icon_message_mine);
311 319
                 MobclickAgent.onEvent(getActivity(), "mineNews");
@@ -354,7 +362,6 @@ public class NewMineFragment extends PresenterFragment<StateContract.Presenter>
354 362
     public void onResume() {
355 363
         super.onResume();
356 364
 
357
-        mPresenter.start();
358 365
 
359 366
     }
360 367
 

+ 4 - 1
app/src/main/java/com/smileflowpig/money/moneyplatfrom/frags/main/state/PigHomeFragment.java

@@ -14,6 +14,7 @@ import android.support.v7.widget.RecyclerView;
14 14
 import android.text.TextUtils;
15 15
 import android.view.MotionEvent;
16 16
 import android.view.View;
17
+import android.view.ViewGroup;
17 18
 import android.view.ViewTreeObserver;
18 19
 import android.widget.ImageView;
19 20
 import android.widget.LinearLayout;
@@ -155,8 +156,10 @@ public class PigHomeFragment extends PresenterFragment implements View.OnClickLi
155 156
         }
156 157
 
157 158
         //vivo渠道控制信用卡开关
158
-        if (!TextUtils.isEmpty(BuildConfig.CHANNLE) && BuildConfig.CHANNLE.equals("1003"))
159
+        if (!TextUtils.isEmpty(BuildConfig.CHANNLE) && BuildConfig.CHANNLE.equals("1003")){
160
+            fourdata.setVisibility(View.GONE);
159 161
             cardvisible();
162
+        }
160 163
         //滚动文字
161 164
         getlapview();
162 165
 //        //banner

+ 2 - 1
app/src/main/java/com/smileflowpig/money/moneyplatfrom/guoshen/activity/MineActivity.java

@@ -178,8 +178,9 @@ public class MineActivity extends PresenterActivity<MineConreact.Presenter> impl
178 178
     @Override
179 179
     public void ExistSuccess() {
180 180
         EventBus.getDefault().post(new SecondEvent("登录/注册"));
181
-        SPUtil.clear(this);
181
+//        SPUtil.clear(this);
182 182
         SPUtil.putAndApply(this, Constant.UserInfo.ISEXITE, true);
183
+        SPUtil.putAndApply(this, Constant.UserInfo.SESSIONID, "");
183 184
         finish();
184 185
     }
185 186
 

+ 1 - 1
app/src/main/java/com/smileflowpig/money/moneyplatfrom/push/PhoneUtil.java

@@ -29,7 +29,7 @@ public class PhoneUtil {
29 29
      */
30 30
     public static int getPhoneModel(Context context) {
31 31
         String phoneMessage = getPhoneMessage();
32
-        if (phoneMessage.equals("HUAWEI")) {
32
+        if (phoneMessage.equals("HUAWEI")||phoneMessage.equals("HONOR")) {
33 33
             return HUAWEI;
34 34
         } else if (phoneMessage.equals("XIAOMI")) {
35 35
             return XIAOMI;

+ 2 - 2
app/src/main/java/com/smileflowpig/money/moneyplatfrom/push/PushManager.java

@@ -156,7 +156,7 @@ public class PushManager {
156 156
      */
157 157
     public static void huaweiConnect(final Activity activity) {
158 158
         int phoneModel = PhoneUtil.getPhoneModel(activity);
159
-//        if (phoneModel == PhoneUtil.HUAWEI) {
159
+        if (phoneModel == PhoneUtil.HUAWEI) {
160 160
             HMSAgent.connect(activity, new ConnectHandler() {
161 161
                 @Override
162 162
                 public void onConnect(int rst) {
@@ -164,7 +164,7 @@ public class PushManager {
164 164
 getHuaweiToken(activity);
165 165
                 }
166 166
             });
167
-//        }
167
+        }
168 168
     }
169 169
 
170 170
     /**

+ 2 - 2
app/src/main/res/layout/newmine_layout.xml

@@ -24,8 +24,8 @@
24 24
             />
25 25
         <ImageView
26 26
             android:id="@+id/fragment_mine_message_img"
27
-            android:layout_width="24px"
28
-            android:layout_height="24px"
27
+            android:layout_width="25px"
28
+            android:layout_height="25px"
29 29
             android:layout_marginTop="35px"
30 30
             android:layout_marginRight="24px"
31 31
             android:layout_alignParentRight="true"

+ 1 - 1
app/src/main/res/layout/pighome_layout.xml

@@ -183,7 +183,7 @@
183 183
                         android:layout_weight="1"
184 184
                         android:gravity="center"
185 185
                         android:orientation="vertical"
186
-                        android:visibility="gone">
186
+                        android:visibility="visible">
187 187
 
188 188
                         <ImageView
189 189
                             android:layout_width="40dp"

+ 1 - 1
common/src/main/java/com/smileflowpig/money/common/Common.java

@@ -43,7 +43,7 @@ public class Common {
43 43
         String API_URL = "https://xiaohuazhu.tthbw.com/user/";
44 44
         //测试接口
45 45
       //String API_URL = "http://bw.quyaqu.com/user/";
46
-     //String API_URL = "http://182.92.118.1:5220/user/";
46
+//     String API_URL = "http://182.92.118.1:5220/user/";
47 47
 
48 48
         // 最大的上传图片大小860kb
49 49
         long MAX_UPLOAD_IMAGE_LENGTH = 860 * 1024;

+ 2 - 0
factory/src/main/java/com/smileflowpig/money/factory/Constant.java

@@ -15,6 +15,8 @@ public class Constant {
15 15
         public static final String PASSWORD = "password";
16 16
         public static final String CODETOKEN = "codetoken";
17 17
         public static final String ISEXITE = "isexite";
18
+        public static final String NICK = "nick";
19
+        public static final String ICONURL = "icon_url";
18 20
     }
19 21
     public static class Code {
20 22
         public static final int RESULT_LOGINSUC_CODE = 10000;

+ 1 - 5
factory/src/main/java/com/smileflowpig/money/factory/data/helper/AccountHelper.java

@@ -330,12 +330,11 @@ public class AccountHelper {
330 330
             // 请求成功返回
331 331
             // 从返回中得到我们的全局Model,内部是使用的Gson进行解析
332 332
             RspModel<AccountRspModel> rspModel = response.body();
333
-            if (rspModel.success()) {
333
+            if (rspModel!=null&&rspModel.success()) {
334 334
                 // 拿到实体
335 335
                 AccountRspModel accountRspModel = rspModel.getRst();
336 336
                 User user = accountRspModel.getUser();
337 337
                 callback.onDataLoaded(user);
338
-
339 338
             } else {
340 339
                 // 错误解析
341 340
                 Factory.decodeRspCode(rspModel, callback);
@@ -351,7 +350,4 @@ public class AccountHelper {
351 350
     }
352 351
 
353 352
 
354
-
355
-
356
-
357 353
 }