Переглянути джерело

配置极光推送的各种页面跳转

zengjiebin 8 роки тому
батько
коміт
7764a53596

+ 9 - 0
app/src/main/AndroidManifest.xml

@@ -306,6 +306,13 @@
 
         <!--极光推送-->
 
+        <!-- For test only 测试状态通知栏,需要打开的Activity -->
+        <activity android:name="com.sheep.gamegroup.view.activity.MiddleAct" android:exported="false">
+            <intent-filter>
+                <action android:name="jpush.testAction" />
+                <category android:name="jpush.testCategory" />
+            </intent-filter>
+        </activity>
         <!-- Rich push 核心功能 since 2.0.6-->
         <activity
             android:name="cn.jpush.android.ui.PopWinActivity"
@@ -440,6 +447,8 @@
 
         <!-- alipay 支付宝 sdk end -->
 
+        <activity android:name="com.sheep.gamegroup.view.activity.ActNotice"
+            android:screenOrientation="portrait"/>
     </application>
 
 

+ 1 - 1
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java

@@ -66,7 +66,7 @@ public class FgtCreditCardTaskList extends BaseFragment {
     private void onItemClickTask(TaskReleaseEty taskReleaseEty) {
         taskReleaseEty.getTask().setBonus(taskReleaseEty.getBonus());
         taskReleaseEty.getTask().setName(taskReleaseEty.getName());
-        Jump2View.getInstance().goCreditCardTaskDetail(getActivity(), taskReleaseEty);
+        Jump2View.getInstance().goCreditCardTaskDetail(getActivity(), taskReleaseEty.getId());
     }
 
     private void initData() {

+ 0 - 2
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -87,11 +87,9 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                 break;
             case R.id.account_safe_layout:
                 Jump2View.getInstance().goAccountAndSecurit(getActivity(), null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.USER_ACCOUNT_SAFE);
                 break;
             case R.id.account_task_layout://任务记录
                 Jump2View.getInstance().goTaskList2View(getActivity(), null);
-                UMConfigUtils.onEvent(UMConfigUtils.Event.USER_TASK_RECORD);
                 break;
             case R.id.proxy_service_layout://代理
                 break;

+ 3 - 66
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -342,32 +342,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         tryMakeMoneyPresenter.releaseTask(parameEty);
     }
 
-    private Boolean wechatIsOpen = null;
-
     /**
      * 获取微信挂机是否开启状态
      */
     private void initWechatIsOpen() {
-        SheepApp.getInstance().getNetComponent().getApiService().getWebchatIsOpen()
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
-                        if (baseMessage.getData() instanceof Boolean)
-                            wechatIsOpen = (Boolean) baseMessage.getData();
-                        else
-                            wechatIsOpen = false;
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
-                    }
-                });
     }
 
     @OnClick({R.id.recharge, R.id.user_layout, R.id.withdrawal, R.id.try_play_layout,
@@ -424,9 +402,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                         });
                 break;
             case R.id.homepage_wxfz://微信辅助任务
-                goWxfz();
+                Jump2View.getInstance().tryGoWxfz(activity,null);
                 break;
-            case R.id.icon_layout://我的资产
+            case R.id.icon_layout://
             case R.id.info_layout://其它信息
                 Jump2View.getInstance().goPersonnalCenterView(activity, null);
                 break;
@@ -440,52 +418,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             case R.id.lying_iv://躺着赚钱
             case R.id.lying_dec_tv:
             case R.id.lying_name_tv:
-                if (wechatIsOpen == null) {
-                    G.showToast("网络异常,请稍候重试");
-                } else if (wechatIsOpen) {
-                    Jump2View.getInstance().goLyingView(activity, null);
-                    UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_LIE);
-                } else {
-                    G.showToast(R.string.coming_soon);
-                }
-
+                Jump2View.getInstance().tryGoLyingView(activity, null);
                 break;
         }
     }
 
-    /**
-     * 微信辅助任务
-     */
-    private void goWxfz() {
-        if(getActivity() instanceof BaseActivity){
-            ((BaseActivity) getActivity()).showProgress();
-        }
-        SheepApp.getInstance().getNetComponent().getApiService().wxfzGetUrl()
-                        .subscribeOn(Schedulers.io())
-                        .observeOn(AndroidSchedulers.mainThread())
-                        .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
-                            @Override
-                            public void onNext(BaseMessage baseMessage) {
-                                if(getActivity() instanceof BaseActivity){
-                                    ((BaseActivity) getActivity()).hideProgress();
-                                }
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
-                                Jump2View.getInstance().goWeb(activity, baseMessage.getData().toString(), "微信二维码辅助好友注册任务");
-                            }
-
-                            @Override
-                            public void onError(BaseMessage baseMessage) {
-                                if(getActivity() instanceof BaseActivity){
-                                    ((BaseActivity) getActivity()).hideProgress();
-                                }
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-                                G.showToast(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
-                            }
-                        });
-    }
-
     private NewbieTaskRecord newbie_task_record;
 
     @Override

+ 53 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/JPushMessage.java

@@ -0,0 +1,53 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/4/26.
+ * realicing@sina.com
+ */
+public class JPushMessage {
+    private int id;//各种id,包括任务详情id
+    private String url;
+    private String msg;
+    private String title;
+    private int type;// 在MiddleAct中查看
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+}

+ 5 - 7
app/src/main/java/com/sheep/gamegroup/receiver/SheepJpushReceiver.java

@@ -8,6 +8,9 @@ import android.text.TextUtils;
 import android.util.Log;
 
 
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.view.activity.MiddleAct;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -49,13 +52,8 @@ public class SheepJpushReceiver extends BroadcastReceiver {
 
             } else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {
                 Log.d(TAG, "[SheepJpushReceiver] 用户点击打开了通知");
-
-//                //打开自定义的Activity
-//                Intent i = new Intent(context, TestActivity.class);
-//                i.putExtras(bundle);
-//                //i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-//                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
-//                context.startActivity(i);
+                //打开自定义的Activity
+                Jump2View.getInstance().newTaskTopStartAct(context, MiddleAct.class, bundle);
 
             } else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(intent.getAction())) {
                 Log.d(TAG, "[SheepJpushReceiver] 用户收到到RICH PUSH CALLBACK: " + bundle.getString(JPushInterface.EXTRA_EXTRA));

+ 163 - 18
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -4,10 +4,14 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
+import android.os.Bundle;
 import android.text.TextUtils;
 
+import com.alibaba.fastjson.JSON;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.bean.KFIntentKeys;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.CreditCard;
 import com.sheep.gamegroup.model.entity.DialogEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
@@ -17,6 +21,8 @@ import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WXOnHookAccount;
+import com.sheep.gamegroup.model.util.EntityUtils;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.view.activity.AccountAndSecurityAct;
 import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
 import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
@@ -24,6 +30,7 @@ import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
 import com.sheep.gamegroup.view.activity.ActMyMoney;
 import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
+import com.sheep.gamegroup.view.activity.ActNotice;
 import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
@@ -37,6 +44,7 @@ import com.sheep.gamegroup.view.activity.DialogActivity;
 import com.sheep.gamegroup.view.activity.DialogToastAct;
 import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
 import com.sheep.gamegroup.view.activity.LoginAct;
+import com.sheep.gamegroup.view.activity.MiddleAct;
 import com.sheep.gamegroup.view.activity.PersionInfoAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.activity.PhoneAct;
@@ -53,11 +61,20 @@ import com.sheep.gamegroup.view.activity.WebviewAct;
 import com.sheep.gamegroup.view.activity.WithdrawalAct;
 import com.sheep.gamegroup.view.activity.WithdrawalListAct;
 import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import org.xutils.ex.DbException;
 
+import okhttp3.Callback;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
 /**
  * Created by ljy on 2018/3/18.
  */
@@ -109,6 +126,7 @@ public class Jump2View {
      * @param o
      */
     public void goAccountAndSecurit(Context context, Object o){
+        UMConfigUtils.onEvent(UMConfigUtils.Event.USER_ACCOUNT_SAFE);
         Intent intent = new Intent(context, AccountAndSecurityAct.class);
         context.startActivity(intent);
     }
@@ -127,7 +145,7 @@ public class Jump2View {
 
 
     /**
-     * 跳到登录页面
+     * 跳到邀请赚钱页面
      * @param context
      * @param o
      */
@@ -164,7 +182,7 @@ public class Jump2View {
     }
 
     /**
-     * 跳到个人中页面
+     * 跳到个人中页面
      * @param context
      * @param o
      */
@@ -186,7 +204,7 @@ public class Jump2View {
     }
 
     /**
-     * 跳到绑定微信页面
+     * 跳到绑定微信页面
      * @param context
      * @param o false:绑定   true:切换
      */
@@ -212,34 +230,104 @@ public class Jump2View {
     }
 
     /**
-     * 跳到分享界面
+     * 跳到躺着界面
      * @param context
      * @param o
      */
-    public void goInvitationView(Context context, Object o){
-        Intent intent = new Intent(context, BindOrChangeWeixinAct.class);
+    public void goLyingView(Context context, Object o){
+        UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TASK_LIE);
+        Intent intent = new Intent(context, LieMakeMoneyAct.class);
         context.startActivity(intent);
     }
-
     /**
-     * 跳到躺着界面
+     * 先判断服务器是否打开躺着赚钱功能,再跳到躺着界面
      * @param context
      * @param o
      */
-    public void goLyingView(Context context, Object o){
-        Intent intent = new Intent(context, LieMakeMoneyAct.class);
-        context.startActivity(intent);
+    public void tryGoLyingView(final Context context, final Object o){
+        if(context instanceof BaseActivity){
+            ((BaseActivity) context).showProgress();
+        }
+        SheepApp.getInstance().getNetComponent().getApiService().getWebchatIsOpen()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(context) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(context instanceof BaseActivity){
+                            ((BaseActivity) context).hideProgress();
+                        }
+                        if (BuildConfig.DEBUG)
+                            System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
+                        Boolean wechatIsOpen;
+                        if (baseMessage.getData() instanceof Boolean)
+                            wechatIsOpen = (Boolean) baseMessage.getData();
+                        else
+                            wechatIsOpen = false;
+                        if(wechatIsOpen){
+                            goLoginView(context, o);
+                        } else {
+                            G.showToast(R.string.coming_soon);
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(context instanceof BaseActivity){
+                            ((BaseActivity) context).hideProgress();
+                        }
+                        if (BuildConfig.DEBUG)
+                            System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
+                        G.showToast(R.string.coming_soon);
+                    }
+                });
+    }
+    /**
+     * 先获取服务器配置的微信辅助功能的地址,再跳到微信辅助功能界面
+     * @param context
+     * @param o
+     */
+    public void tryGoWxfz(final Context context, final Object o){
+        if(context instanceof BaseActivity){
+            ((BaseActivity) context).showProgress();
+        }
+        SheepApp.getInstance().getNetComponent().getApiService().wxfzGetUrl()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(context) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(context instanceof BaseActivity){
+                            ((BaseActivity) context).hideProgress();
+                        }
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
+                        Jump2View.getInstance().goWeb(context, baseMessage.getData().toString(), "微信二维码辅助好友注册任务");
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(context instanceof BaseActivity){
+                            ((BaseActivity) context).hideProgress();
+                        }
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+                        G.showToast(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
+                    }
+                });
     }
     /**
      * 跳到提交挂机微信验证码界面
      * @param context
-     * @param wxOnHookAccount
+     * @param id
+     * @param account
+     * @param type
      */
-    public void goCommitWxCodeOnHookView(Context context, WXOnHookAccount wxOnHookAccount, int type){
+    public void goCommitWxCodeOnHookView(Context context, int id, String account, int type){
         Intent intent = new Intent(context, CommitWxCodeAct.class);
         intent.putExtra("type", type);
-        intent.putExtra("id", wxOnHookAccount.getId());
-        intent.putExtra("account", wxOnHookAccount.getAccount());
+        intent.putExtra("id", id);
+        intent.putExtra("account", account);
         context.startActivity(intent);
     }
     /**
@@ -305,11 +393,11 @@ public class Jump2View {
     /**
      * 跳转到信用卡任务详情界面
      * @param context
-     * @param curTask
+     * @param id
      */
-    public synchronized void goCreditCardTaskDetail(Context context, TaskReleaseEty curTask){
+    public synchronized void goCreditCardTaskDetail(Context context, int id){
         Intent intent = new Intent(context, TaskDetailCreditCardAct.class);
-        intent.putExtra("task_entity", curTask);
+        intent.putExtra("id", id);
         context.startActivity(intent);
         UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL);
     }
@@ -339,6 +427,7 @@ public class Jump2View {
      * @param o
      */
     public void goTaskList2View(Context context, TaskEty o){
+        UMConfigUtils.onEvent(UMConfigUtils.Event.USER_TASK_RECORD);
         Intent intent = new Intent(context, TaskListAct.class);
         intent.putExtra("task_entity", o);
         context.startActivity(intent);}
@@ -479,6 +568,35 @@ public class Jump2View {
         UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL_WEB);
     }
     /**
+     * 尝试跳到银行web页面
+     * @param context
+     * @param id
+     */
+    public void tryGoCreditCardWeb(final Context context, int id, final Action1<String> action1){
+        SheepApp.getInstance().getNetComponent().getApiService().getCredit(id)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(context) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        final CreditCard creditCard = baseMessage.getData(CreditCard.class);
+                        Jump2View.getInstance().goCreditCardWeb(context, creditCard);
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
+                        if(action1 != null)
+                            action1.call(null);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(BuildConfig.DEBUG)
+                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
+                        if(action1 != null)
+                            action1.call(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
+                    }
+                });
+    }
+    /**
      * 浏览器打开web页面
      * @param context
      * @param url
@@ -552,4 +670,31 @@ public class Jump2View {
         Intent intent = new Intent(context, RechargeQAct.class);
         context.startActivity(intent);
     }
+
+    /**
+     * 添加flags Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP启动一个Activity
+     * @param context
+     * @param actClass
+     * @param bundle
+     */
+    public void newTaskTopStartAct(Context context, Class<? extends Activity> actClass, Bundle bundle) {
+        Intent i = new Intent(context, actClass);
+        if(bundle != null)
+            i.putExtras(bundle);
+        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
+        context.startActivity(i);
+    }
+
+    /**
+     * 展示公告
+     * @param context
+     * @param title
+     * @param content
+     */
+    public void goNotice(Context context, String title, String content) {
+        Intent intent = new Intent(context, ActNotice.class);
+        intent.putExtra("title", title);
+        intent.putExtra("content", content);
+        context.startActivity(intent);
+    }
 }

+ 42 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActNotice.java

@@ -0,0 +1,42 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.widget.TextView;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+
+/**
+ * Created by realicing on 2018/5/10.
+ * realicing@sina.com
+ */
+public class ActNotice extends BaseActivity {
+    @BindView(R.id.act_notice_content_tv)
+    TextView act_notice_content_tv;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_notice;
+    }
+
+    @Override
+    public void initView() {
+        String title = getIntent().getStringExtra("title");
+        String content = getIntent().getStringExtra("content");
+        TitleBarUtils.getInstance()
+                .setTitle(this, title)
+                .setTitleFinish(this);
+        act_notice_content_tv.setText(content);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+}

+ 162 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/MiddleAct.java

@@ -0,0 +1,162 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.arialyy.aria.core.Aria;
+import com.kfzs.duanduan.react.MainTab;
+import com.sheep.gamegroup.model.entity.JPushMessage;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.util.Locale;
+
+import cn.jpush.android.api.JPushInterface;
+import rx.functions.Action1;
+
+import static com.sheep.gamegroup.view.activity.CommitWxCodeAct.ALTER_CODE;
+import static com.sheep.gamegroup.view.activity.CommitWxCodeAct.ALTER_INFO;
+import static com.sheep.gamegroup.view.activity.CommitWxCodeAct.HAS_DEBLOCKED;
+
+/**
+ * Created by realicing on 2018/5/10.
+ * realicing@sina.com
+ */
+public class MiddleAct extends Activity {
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        try {
+            doAction();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        this.finish();
+    }
+    private void doAction(){
+        Bundle bundle = getIntent().getExtras();
+        if (bundle != null) {
+            /**
+             *  key = app,value = com.sheep.jiuyan.samllsheep
+             *  key = cn.jpush.android.ALERT,value = 带有参数的通知
+             *  key = cn.jpush.android.EXTRA,value = {"id":"976873","name":"zjb"}
+             *  key = cn.jpush.android.NOTIFICATION_ID,value = 185860616
+             *  key = cn.jpush.android.ALERT_TYPE,value = 7
+             *  key = cn.jpush.android.NOTIFICATION_CONTENT_TITLE,value = 小绵羊
+             *  key = cn.jpush.android.MSG_ID,value = 2150932953
+             *  key = sdktype,value = JPUSH
+             */
+            for (String key : bundle.keySet()) {
+                if (BuildConfig.DEBUG)
+                    System.out.println(String.format(Locale.CHINA, "key = %s,value = %s", key, bundle.get(key)));
+                if (key.equals(JPushInterface.EXTRA_NOTIFICATION_ID)) {
+//                    sb.append("\nkey:" + key + ", value:" + bundle.getInt(key));
+                } else if (key.equals(JPushInterface.EXTRA_CONNECTION_CHANGE)) {
+//                    sb.append("\nkey:" + key + ", value:" + bundle.getBoolean(key));
+                } else if (key.equals(JPushInterface.EXTRA_EXTRA)) {
+                    String data;
+                    if (TextUtils.isEmpty((data = bundle.getString(JPushInterface.EXTRA_EXTRA)))) {
+                        continue;
+                    }
+                    JPushMessage msg = JSONObject.parseObject(data, JPushMessage.class);
+                    Activity activity = this;
+                    switch (msg.getType()) {
+                        case 11://试玩赚钱
+                            Jump2View.getInstance().goTryplayView(activity, null);
+                            break;
+                        case 12://任务详情: 任务的id
+                            Jump2View.getInstance().goTaskDetailView(activity, msg.getId());
+                            break;
+                        case 13://任务记录
+                            Jump2View.getInstance().goTaskList2View(activity, null);
+                            break;
+                        case 21://邀请赚钱
+                            Jump2View.getInstance().goAskGetMoney(activity, null);
+                            break;
+                        case 31://办卡赚钱
+                            Jump2View.getInstance().goCreditCardTaskList(activity, null);
+                            break;
+                        case 32://跳转到信息卡详情界面: id 信息卡任务的id
+                            Jump2View.getInstance().goCreditCardTaskDetail(activity, msg.getId());
+                            break;
+                        case 33://跳转到信息卡web申请界面; id 信用卡信息的id
+                            Jump2View.getInstance().tryGoCreditCardWeb(activity, msg.getId(), new Action1<String>() {
+                                @Override
+                                public void call(String msg) {
+                                    if(msg != null){
+                                        G.showToast(msg);
+                                    }
+                                }
+                            });
+                            break;
+                        case 41://躺着赚钱
+                            Jump2View.getInstance().tryGoLyingView(activity, null);
+                            break;
+                        case 42://跳转到修改 挂机微信账号密码 到服务器 界面
+                            Jump2View.getInstance().goCommitWxCodeOnHookView(activity, msg.getId(), msg.getMsg(), ALTER_INFO);
+                            break;
+                        case 43://跳转到提交 挂机微信验证码 到服务器 界面
+                            Jump2View.getInstance().goCommitWxCodeOnHookView(activity, msg.getId(), msg.getMsg(), ALTER_CODE);
+                            break;
+                        case 44://跳转到提交 挂机微信账号已经解封 到服务器 界面
+                            Jump2View.getInstance().goCommitWxCodeOnHookView(activity, msg.getId(), msg.getMsg(), HAS_DEBLOCKED);
+                            break;
+                        case 51://微信辅助任务
+                            Jump2View.getInstance().tryGoWxfz(activity, null);
+                            break;
+                        case 61://个人中心
+                            Jump2View.getInstance().goPersonnalCenterView(activity, null);
+                            break;
+                        case 62://提现
+                            Jump2View.getInstance().goWithdrawal(activity, null);
+                            break;
+                        case 621://提现结果页面
+                            Jump2View.getInstance().goWithdrawalResultview(activity, msg.getMsg());
+                            break;
+                        case 63://充值Q币
+                            Jump2View.getInstance().goRechargeQAct(activity,null);
+                            break;
+                        case 64://充值绵羊币
+                            Jump2View.getInstance().goRechargeAct(activity,null);
+                            break;
+                        case 65://我的资产
+                            Jump2View.getInstance().goMyMoney(activity,null);
+                            break;
+                        case 66://安全中心
+                            Jump2View.getInstance().goAccountAndSecurit(activity,null);
+                            break;
+                        case 71://浏览器打开web界面: url h5链接
+                            Jump2View.getInstance().goWeb(activity, msg.getUrl());
+                            break;
+                        case 72://App web界面: url h5链接  title 标题
+                            Jump2View.getInstance().goWeb(activity, msg.getUrl(), TextUtils.isEmpty(msg.getTitle()) ? bundle.getString(JPushInterface.EXTRA_ALERT) : msg.getTitle());
+                            break;
+
+                        case 1://跳转到首页: id 0,小绵羊 1,游戏 2,分类 (以后可能有3,借着玩,也有位置会变化)
+                            Jump2View.getInstance().goHomePageView(activity, msg.getId() % MainTab.values().length);
+                            break;
+                        case 2://公告: title 标题   msg 内容
+                            Jump2View.getInstance().goNotice(activity, TextUtils.isEmpty(msg.getTitle()) ? bundle.getString(JPushInterface.EXTRA_ALERT) : msg.getTitle(), msg.getMsg());
+                            break;
+                        case 3://下载: url 下载链接
+                            if(msg.getUrl().startsWith("http"))
+                                Aria.download(activity).load(msg.getUrl());
+                            else if(msg.getUrl().startsWith("ftp"))
+                                Aria.download(activity).loadFtp(msg.getUrl());
+                            break;
+                        case 0://直接启动或者重启app
+                        default:
+                            Jump2View.getInstance().newTaskTopStartAct(activity, SplashAct.class, bundle);
+                            break;
+                    }
+                } else {
+//                    sb.append("\nkey:" + key + ", value:" + bundle.getString(key));
+                }
+            }
+        }
+    }
+}

+ 15 - 30
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java

@@ -42,6 +42,7 @@ import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
@@ -84,14 +85,13 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     @Override
     public void initView() {
         activity = this;
-        taskReleaseEty = (TaskReleaseEty) getIntent().getSerializableExtra("task_entity");
-        taskEty = taskReleaseEty.getTask();
+        id = getIntent().getIntExtra("id", 0);
         TitleBarUtils.getInstance()
                 .setTitle(activity, "任务详情")
                 .setTitleFinish(activity);
         btnUpImag.setVisibility(View.GONE);
     }
-
+    private int id;
     @Override
     public void initListener() {
 
@@ -99,11 +99,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
 
     @Override
     public void initData() {
-        if(taskEty == null){
-            G.showToast("网络异常,请稍候再试");
-//            finish();
-            return;
-        }
         netTaskSchedule();
         webText.setWebChromeClient(new WebChromeClient(){
 
@@ -172,7 +167,7 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     private void netTaskSchedule() {
         if(mPd == null || !mPd.isShowing())
             showProgress();
-        SheepApp.getInstance().getNetComponent().getApiService().getReleaseTaskCreditCardDesc(taskReleaseEty.getId())
+        SheepApp.getInstance().getNetComponent().getApiService().getReleaseTaskCreditCardDesc(id)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
@@ -263,27 +258,17 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     }
 
     private void goWeb() {
-        SheepApp.getInstance().getNetComponent().getApiService().getCredit(EntityUtils.getExtInfo(taskEty.getExt()).getId())
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(activity) {
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        final CreditCard creditCard = baseMessage.getData(CreditCard.class);
-                        Jump2View.getInstance().goCreditCardWeb(activity, creditCard);
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
-                        netTaskSchedule();
-                    }
-
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-                        G.showToast(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
-                        hideProgress();
-                    }
-                });
+        Jump2View.getInstance().tryGoCreditCardWeb(activity, EntityUtils.getExtInfo(taskEty.getExt()).getId(), new Action1<String>() {
+            @Override
+            public void call(String msg) {
+                if(msg == null){
+                    netTaskSchedule();
+                } else {
+                    G.showToast(msg);
+                    hideProgress();
+                }
+            }
+        });
     }
 
     /**

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/adapter/LieMakeMoneyAdp.java

@@ -173,10 +173,10 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                     case STATE_ON_HOOK_NEED_VC://需要用户验证码
                     case STATE_ON_HOOK_VC_OVERTIME://验证码超时请重新上传
                         //修改验证码
-                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT, ALTER_CODE);
+                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT.getId(), dataObjT.getAccount(), ALTER_CODE);
                         break;
                     case STATE_ON_HOOK_BLOCKED://被封
-                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT, HAS_DEBLOCKED);
+                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT.getId(), dataObjT.getAccount(), HAS_DEBLOCKED);
                         break;
                     case STATE_ON_HOOK_TOMORROW_RESET://用户已经修改账号密码等待服务器验证
                     case STATE_ON_HOOK_DEBLOCKED://用户已经解封等待服务器验证
@@ -191,7 +191,7 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                     case STATE_ON_HOOK_ABNORMAL://账号异常
                     default:
                         //修改用户信息
-                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT, ALTER_INFO);
+                        Jump2View.getInstance().goCommitWxCodeOnHookView(context, dataObjT.getId(), dataObjT.getAccount(), ALTER_INFO);
                         break;
                 }
             }

+ 19 - 0
app/src/main/res/layout/act_notice.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include layout="@layout/title" />
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <TextView
+            android:id="@+id/act_notice_content_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+    </ScrollView>
+
+</LinearLayout>

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

@@ -9,7 +9,7 @@
         android:id="@+id/rlRichpushTitleBar"
         android:layout_width="match_parent"
         android:layout_height="40.0dp"
-        android:background="#29313a">
+        android:background="@color/theme_app_main">
 
         <ImageButton
             android:id="@+id/imgRichpushBtnBack"