Bläddra i källkod

微信绑定提交

liujiangyao 8 år sedan
förälder
incheckning
cebd0ce91b

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -62,7 +62,7 @@ public interface ApiService {
     /**
      * 提交用户的微信账号与密码
      */
-    @POST(V1+"app/wechat/")
+    @POST(V1+"/app/wechat/")
     Observable<BaseMessage> postWebchat(@Body JSONObject jsonObject);
     /**
      * 提交用户的微信账号与密码
@@ -176,7 +176,7 @@ public interface ApiService {
     /**
      * 获取任务显示状态
      */
-    @GET(V1 + "/app/task_log/node/")
-    Observable<BaseMessage> giveTaskStatue(@Body JSONObject object);
+    @GET(V1 + "/app/task_log/node/{id}")
+    Observable<BaseMessage> giveTaskStatue(@Path("id") int id);
 
 }

+ 27 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2,10 +2,12 @@ package com.sheep.gamegroup.util;
 
 import android.content.Context;
 import android.content.Intent;
+import android.text.TextUtils;
 
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.bean.KFIntentKeys;
 import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WXOnHookAccount;
 import com.sheep.gamegroup.view.activity.AccountAndSecurityAct;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
@@ -47,6 +49,10 @@ public class Jump2View {
      * @param o
      */
     public void goWithdrawal(Context context, Object o){
+        if(!isBindWeixin(context)){
+            goBindOrChangeWeixinView(context, o);
+            return;
+        }
         Intent intent = new Intent(context, WithdrawalAct.class);
         context.startActivity(intent);
     }
@@ -134,12 +140,13 @@ public class Jump2View {
     }
 
     /**
-     * 跳到提现结果页面
+     * 跳到绑定微信果页面
      * @param context
-     * @param o
+     * @param o false:绑定   true:切换
      */
     public void goBindOrChangeWeixinView(Context context, Object o){
         Intent intent = new Intent(context, BindOrChangeWeixinAct.class);
+        intent.putExtra("type",(boolean)o);
         context.startActivity(intent);
     }
 
@@ -262,4 +269,22 @@ public class Jump2View {
         context.startActivity(intent);
     }
 
+
+    /**
+     * 是否绑定微信号
+     */
+    public boolean isBindWeixin(Context context){
+        try{
+            UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
+            if(userEntity != null){
+                if(!TextUtils.isEmpty(userEntity.getWx_openid())){
+                    return true;
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return false;
+    }
+
 }