|
@@ -4,10 +4,14 @@ import android.app.Activity;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
|
|
+import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.kfzs.duanduan.ActMain;
|
|
import com.kfzs.duanduan.ActMain;
|
|
|
import com.kfzs.duanduan.bean.KFIntentKeys;
|
|
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.CreditCard;
|
|
|
import com.sheep.gamegroup.model.entity.DialogEntity;
|
|
import com.sheep.gamegroup.model.entity.DialogEntity;
|
|
|
import com.sheep.gamegroup.model.entity.NewbieTask;
|
|
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.TaskReleaseEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.entity.WXOnHookAccount;
|
|
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.AccountAndSecurityAct;
|
|
|
import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
|
|
import com.sheep.gamegroup.view.activity.ActCreditCardTaskList;
|
|
|
import com.sheep.gamegroup.view.activity.ActCreditCardWeb;
|
|
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.ActGuideOnHook;
|
|
|
import com.sheep.gamegroup.view.activity.ActMyMoney;
|
|
import com.sheep.gamegroup.view.activity.ActMyMoney;
|
|
|
import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
|
|
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.ActUnderstandSheep;
|
|
|
import com.sheep.gamegroup.view.activity.ActWeb;
|
|
import com.sheep.gamegroup.view.activity.ActWeb;
|
|
|
import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
|
|
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.DialogToastAct;
|
|
|
import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
|
|
import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
|
|
|
import com.sheep.gamegroup.view.activity.LoginAct;
|
|
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.PersionInfoAct;
|
|
|
import com.sheep.gamegroup.view.activity.PersonalCenterAct;
|
|
import com.sheep.gamegroup.view.activity.PersonalCenterAct;
|
|
|
import com.sheep.gamegroup.view.activity.PhoneAct;
|
|
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.WithdrawalAct;
|
|
|
import com.sheep.gamegroup.view.activity.WithdrawalListAct;
|
|
import com.sheep.gamegroup.view.activity.WithdrawalListAct;
|
|
|
import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
|
|
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.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
|
|
|
|
|
import org.xutils.ex.DbException;
|
|
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.
|
|
* Created by ljy on 2018/3/18.
|
|
|
*/
|
|
*/
|
|
@@ -109,6 +126,7 @@ public class Jump2View {
|
|
|
* @param o
|
|
* @param o
|
|
|
*/
|
|
*/
|
|
|
public void goAccountAndSecurit(Context context, Object o){
|
|
public void goAccountAndSecurit(Context context, Object o){
|
|
|
|
|
+ UMConfigUtils.onEvent(UMConfigUtils.Event.USER_ACCOUNT_SAFE);
|
|
|
Intent intent = new Intent(context, AccountAndSecurityAct.class);
|
|
Intent intent = new Intent(context, AccountAndSecurityAct.class);
|
|
|
context.startActivity(intent);
|
|
context.startActivity(intent);
|
|
|
}
|
|
}
|
|
@@ -127,7 +145,7 @@ public class Jump2View {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 跳到登录页面
|
|
|
|
|
|
|
+ * 跳到邀请赚钱页面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param o
|
|
* @param o
|
|
|
*/
|
|
*/
|
|
@@ -164,7 +182,7 @@ public class Jump2View {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 跳到个人中兴页面
|
|
|
|
|
|
|
+ * 跳到个人中心页面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param o
|
|
* @param o
|
|
|
*/
|
|
*/
|
|
@@ -186,7 +204,7 @@ public class Jump2View {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 跳到绑定微信果页面
|
|
|
|
|
|
|
+ * 跳到绑定微信页面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param o false:绑定 true:切换
|
|
* @param o false:绑定 true:切换
|
|
|
*/
|
|
*/
|
|
@@ -212,34 +230,104 @@ public class Jump2View {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 跳到分享界面
|
|
|
|
|
|
|
+ * 跳到躺着界面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param o
|
|
* @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);
|
|
context.startActivity(intent);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 跳到躺着界面
|
|
|
|
|
|
|
+ * 先判断服务器是否打开躺着赚钱功能,再跳到躺着界面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param o
|
|
* @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 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 intent = new Intent(context, CommitWxCodeAct.class);
|
|
|
intent.putExtra("type", type);
|
|
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);
|
|
context.startActivity(intent);
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
@@ -305,11 +393,11 @@ public class Jump2View {
|
|
|
/**
|
|
/**
|
|
|
* 跳转到信用卡任务详情界面
|
|
* 跳转到信用卡任务详情界面
|
|
|
* @param context
|
|
* @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 intent = new Intent(context, TaskDetailCreditCardAct.class);
|
|
|
- intent.putExtra("task_entity", curTask);
|
|
|
|
|
|
|
+ intent.putExtra("id", id);
|
|
|
context.startActivity(intent);
|
|
context.startActivity(intent);
|
|
|
UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL);
|
|
UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL);
|
|
|
}
|
|
}
|
|
@@ -339,6 +427,7 @@ public class Jump2View {
|
|
|
* @param o
|
|
* @param o
|
|
|
*/
|
|
*/
|
|
|
public void goTaskList2View(Context context, TaskEty o){
|
|
public void goTaskList2View(Context context, TaskEty o){
|
|
|
|
|
+ UMConfigUtils.onEvent(UMConfigUtils.Event.USER_TASK_RECORD);
|
|
|
Intent intent = new Intent(context, TaskListAct.class);
|
|
Intent intent = new Intent(context, TaskListAct.class);
|
|
|
intent.putExtra("task_entity", o);
|
|
intent.putExtra("task_entity", o);
|
|
|
context.startActivity(intent);}
|
|
context.startActivity(intent);}
|
|
@@ -479,6 +568,35 @@ public class Jump2View {
|
|
|
UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_CREDIT_CARD_DETAIL_WEB);
|
|
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页面
|
|
* 浏览器打开web页面
|
|
|
* @param context
|
|
* @param context
|
|
|
* @param url
|
|
* @param url
|
|
@@ -552,4 +670,31 @@ public class Jump2View {
|
|
|
Intent intent = new Intent(context, RechargeQAct.class);
|
|
Intent intent = new Intent(context, RechargeQAct.class);
|
|
|
context.startActivity(intent);
|
|
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);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|