Kaynağa Gözat

Merge remote-tracking branch 'origin/2.8' into sheep2.0

# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java
#	app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java
#	build.gradle
zengjiebin 7 yıl önce
ebeveyn
işleme
5a9d664c73
100 değiştirilmiş dosya ile 3237 ekleme ve 1135 silme
  1. 6 0
      app/build.gradle
  2. 6 0
      app/proguard-rules.pro
  3. 8 4
      app/src/main/AndroidManifest.xml
  4. 3 0
      app/src/main/java/com/kfzs/duanduan/event/EventTypes.java
  5. 0 6
      app/src/main/java/com/kfzs/duanduan/fragment/AbsFgtMyMoney.java
  6. 0 5
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java
  7. 0 5
      app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardTaskList.java
  8. 0 2
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFind.java
  9. 1 7
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFindChild.java
  10. 12 4
      app/src/main/java/com/kfzs/duanduan/fragment/FgtFriendExtractPage.java
  11. 24 49
      app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java
  12. 15 57
      app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java
  13. 1 1
      app/src/main/java/com/kfzs/duanduan/services/DownloadTaskService.java
  14. 1 1
      app/src/main/java/com/kfzs/duanduan/utils/ApkUtils.java
  15. 1 1
      app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java
  16. 0 16
      app/src/main/java/com/sheep/gamegroup/di/components/BindDataComponent.java
  17. 0 22
      app/src/main/java/com/sheep/gamegroup/di/modules/BindDataModule.java
  18. 0 19
      app/src/main/java/com/sheep/gamegroup/exception/ApiException.java
  19. 0 26
      app/src/main/java/com/sheep/gamegroup/exception/ERROR.java
  20. 0 75
      app/src/main/java/com/sheep/gamegroup/exception/ExceptionEngine.java
  21. 0 12
      app/src/main/java/com/sheep/gamegroup/exception/ServerException.java
  22. 0 2
      app/src/main/java/com/sheep/gamegroup/heler/FindAppHelper.java
  23. 1 9
      app/src/main/java/com/sheep/gamegroup/heler/TaskHelper.java
  24. 76 25
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  25. 4 2
      app/src/main/java/com/sheep/gamegroup/model/api/BaseMessageConverter.java
  26. 124 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAccountEntity.java
  27. 39 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAccountSuper.java
  28. 54 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAgencyRechargePlatformEntity.java
  29. 73 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GamePayList.java
  30. 24 5
      app/src/main/java/com/sheep/gamegroup/model/entity/GameTaskOrderEnty.java
  31. 18 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GridViewEntity.java
  32. 62 3
      app/src/main/java/com/sheep/gamegroup/model/entity/OrienteeringDetail.java
  33. 153 0
      app/src/main/java/com/sheep/gamegroup/model/entity/PayEntity.java
  34. 7 0
      app/src/main/java/com/sheep/gamegroup/model/entity/RecyleType.java
  35. 38 0
      app/src/main/java/com/sheep/gamegroup/model/entity/SearchGameRecord.java
  36. 103 3
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  37. 11 2
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java
  38. 26 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java
  39. 2 1
      app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java
  40. 1 7
      app/src/main/java/com/sheep/gamegroup/model/util/AutoTaskListUtil.java
  41. 4 2
      app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java
  42. 0 20
      app/src/main/java/com/sheep/gamegroup/presenter/BindDataContract.java
  43. 0 92
      app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java
  44. 2 0
      app/src/main/java/com/sheep/gamegroup/statistics/AppStatistics.java
  45. 11 1
      app/src/main/java/com/sheep/gamegroup/util/AppUtil.java
  46. 337 6
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  47. 0 25
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  48. 48 7
      app/src/main/java/com/sheep/gamegroup/util/GlideImageLoader.java
  49. 6 1
      app/src/main/java/com/sheep/gamegroup/util/ImageGlarryDrawable.java
  50. 119 62
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  51. 10 0
      app/src/main/java/com/sheep/gamegroup/util/MyDbManager.java
  52. 1 1
      app/src/main/java/com/sheep/gamegroup/util/SelfCountDownTimer.java
  53. 7 4
      app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java
  54. 30 5
      app/src/main/java/com/sheep/gamegroup/util/TestUtil.java
  55. 234 163
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  56. 53 8
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  57. 1 1
      app/src/main/java/com/sheep/gamegroup/util/WebviewJs.java
  58. 6 0
      app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java
  59. 0 8
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindGame.java
  60. 0 4
      app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java
  61. 199 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAccount.java
  62. 366 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java
  63. 1 5
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java
  64. 0 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActNewAboutUs.java
  65. 0 4
      app/src/main/java/com/sheep/gamegroup/view/activity/ActNewbieTaskList.java
  66. 0 6
      app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java
  67. 372 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java
  68. 0 4
      app/src/main/java/com/sheep/gamegroup/view/activity/ActUnderstandSheep.java
  69. 0 4
      app/src/main/java/com/sheep/gamegroup/view/activity/ActUserLabelList.java
  70. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActWeb.java
  71. 36 7
      app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java
  72. 0 160
      app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java
  73. 91 23
      app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java
  74. 4 13
      app/src/main/java/com/sheep/gamegroup/view/activity/DialogActivity.java
  75. 3 0
      app/src/main/java/com/sheep/gamegroup/view/activity/FeedbackAct.java
  76. 8 1
      app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java
  77. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/MiddleAct.java
  78. 7 2
      app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java
  79. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java
  80. 3 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ReNameActivity.java
  81. 3 0
      app/src/main/java/com/sheep/gamegroup/view/activity/RechargeAct.java
  82. 12 10
      app/src/main/java/com/sheep/gamegroup/view/activity/RechargeQAct.java
  83. 9 3
      app/src/main/java/com/sheep/gamegroup/view/activity/SignCardAct.java
  84. 3 2
      app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java
  85. 44 7
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  86. 1 13
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAddQQAct.java
  87. 0 8
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java
  88. 3 37
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java
  89. 148 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAccount.java
  90. 74 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAgencyRecharge.java
  91. 47 9
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameTaskOrderList.java
  92. 3 3
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpHomeListGrideview.java
  93. 3 3
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpHomeListListview.java
  94. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTaskDetailChildListview.java
  95. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTrymakemoneyTabGridview.java
  96. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/RechargeAdapter.java
  97. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskListItemAdp.java
  98. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskStateAdapter.java
  99. 5 4
      app/src/main/java/com/sheep/gamegroup/view/adapter/TaskdetailSonListviewAdp.java
  100. 0 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java

+ 6 - 0
app/build.gradle

@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
 apply plugin: 'com.jakewharton.butterknife'
 // 依赖插件脚本
 apply from: 'tinker-support.gradle'
+//apply plugin: 'com.appsee.appsee-plugin'
 android {
     compileSdkVersion androidConfigs.compileSdkVersion
     buildToolsVersion androidConfigs.buildToolsVersion
@@ -71,6 +72,7 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheeptest",
                                     DUANDUAN_DATASHARE : "sheeptest",
                                     jpush_appkey       : "4fea09bdbf9661a9689ee306",
+                                    appsee_app_key       : "1fd86378cdcf4bef8ff97ce63cdb86fb",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptest"'
@@ -85,6 +87,7 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheeptestjiguang",
                                     DUANDUAN_DATASHARE : "sheeptestjiguang",
                                     jpush_appkey       : "4fea09bdbf9661a9689ee306",
+                                    appsee_app_key       : "1fd86378cdcf4bef8ff97ce63cdb86fb",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
@@ -99,6 +102,7 @@ android {
             manifestPlaceholders = [DUANDUAN_GRAPH     : "sheep",
                                     DUANDUAN_DATASHARE : "sheep",
                                     jpush_appkey       : "28b74d520261c6f78e3e0921",
+                                    appsee_app_key       : "55ec0910667246d48c4c1dbdf266ff68",
                                     umeng_app_key       : "5ab0a1da8f4a9d742900035f"
             ]
             buildConfigField "String", "DUANDUAN_DATASHARE", '"sheep"'
@@ -254,6 +258,8 @@ dependencies {
     compile files('libs/jcore-android-1.2.0.jar')
     compile files('libs/jpush-android-3.1.2.jar')
 
+    compile 'com.appsee:appsee-android:+'
+
 }
 static def releaseTime() {
     return new Date().format("MMddHHmm", TimeZone.getDefault())

+ 6 - 0
app/proguard-rules.pro

@@ -451,3 +451,9 @@
 -dontwarn com.google.**
 -keep class com.google.gson.** {*;}
 -keep class com.google.protobuf.** {*;}
+#==================appsee && protobuf==========================
+-keep class com.appsee.** { *; }
+-dontwarn com.appsee.**
+-keep class android.support.** { *; }
+-keep interface android.support.** { *; }
+-keepattributes SourceFile,LineNumberTable

+ 8 - 4
app/src/main/AndroidManifest.xml

@@ -163,8 +163,6 @@
             android:launchMode="singleTask"/>
         <activity android:name="com.sheep.gamegroup.view.activity.HomePageAct"
             android:screenOrientation="portrait"/>
-        <activity android:name="com.sheep.gamegroup.view.activity.BindDataAct"
-            android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.DialogActivity"
             android:theme="@style/MyDialogActivityTheme"
             />
@@ -317,8 +315,8 @@
         <activity android:name="com.sheep.gamegroup.view.activity.SignRechargeAct" android:screenOrientation="portrait"/>
 
 
-        <!--友盟start-->
-
+        <!--appsee start-->
+        <meta-data android:name="com.appsee.ApiKey" android:value="${appsee_app_key}" />
 
         <!--友盟start-->
         <meta-data
@@ -488,6 +486,12 @@
             android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActReservation"
             android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGameAgencyRecharge"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGameAccount"
+            android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.ActSearchGame"
+            android:screenOrientation="portrait"/>
     </application>
 
 

+ 3 - 0
app/src/main/java/com/kfzs/duanduan/event/EventTypes.java

@@ -30,4 +30,7 @@ public enum EventTypes {
     REFRESH_DATA_SIGN,//签到对话框
 
     GUIDE_NEXT,//引导页面下一步操作
+    DELETE_GAME_ACCOUNT_REFRESH,//游戏删除账号,刷新界面
+    GENERATION_ACCOUNT_REFRESH,//游戏代充,刷新界面
+    GENERATION_ACCOUNT_REFRESH_ADAPTER,//游戏代充,刷新界面(下载)
 }

+ 0 - 6
app/src/main/java/com/kfzs/duanduan/fragment/AbsFgtMyMoney.java

@@ -155,17 +155,11 @@ public abstract class AbsFgtMyMoney extends BaseFragment {
                                 list.clear();
                             ListUtil.addAll(list, newList);
                             notifyDataSetChanged();
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         }
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         notifyDataSetChanged();
                     }
                 });

+ 0 - 5
app/src/main/java/com/kfzs/duanduan/fragment/FgtCreditCardProgressQuery.java

@@ -71,15 +71,10 @@ public class FgtCreditCardProgressQuery extends BaseFragment {
                         List<CreditCardProgressQuery> newList = baseMessage.getDatas(CreditCardProgressQuery.class);
                         list.addAll(newList);
                         notifyDataSetChanged();
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-//                        G.showToast(baseMessage);
                         notifyDataSetChanged();
                     }
                 });

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

@@ -90,15 +90,10 @@ public class FgtCreditCardTaskList extends BaseFragment {
                                 List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
                                 list.addAll(newList);
                                 notifyDataSetChanged();
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                             }
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-//                                G.showToast(baseMessage);
                                 notifyDataSetChanged();
                             }
                         });

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

@@ -54,7 +54,6 @@ public class FgtFind extends BaseCompatFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         List<FindTag> newList = baseMessage.getDatas(FindTag.class);
                         if(!ListUtil.isEmpty(newList)){
                             list.clear();
@@ -65,7 +64,6 @@ public class FgtFind extends BaseCompatFragment {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+ JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });

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

@@ -214,12 +214,10 @@ public class FgtFindChild extends BaseCompatFragment {
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                             }
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                             }
                         });
         }
@@ -236,18 +234,16 @@ public class FgtFindChild extends BaseCompatFragment {
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                 HomeListEntity homeListEntity = baseMessage.getData(HomeListEntity.class);
                                 if(homeListEntity == null){
                                     G.showToast(R.string.error_data);
                                     return;
                                 }
-                                CommonUtil.getInstance().goWhere(activity, homeListEntity);
+                                CommonUtil.getInstance().goWhere(activity, homeListEntity, "发现");
                             }
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 G.showToast(baseMessage);
                             }
                         });
@@ -292,7 +288,6 @@ public class FgtFindChild extends BaseCompatFragment {
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                                 List<FindItem> newList = baseMessage.getDatas(FindItem.class);
                                 if(!ListUtil.isEmpty(newList)){
                                     list.clear();
@@ -305,7 +300,6 @@ public class FgtFindChild extends BaseCompatFragment {
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 notifyDataSetChanged();
                             }
                         });

+ 12 - 4
app/src/main/java/com/kfzs/duanduan/fragment/FgtFriendExtractPage.java

@@ -33,6 +33,8 @@ import rx.schedulers.Schedulers;
 public class FgtFriendExtractPage extends BaseFragment {
     @BindView(R.id.friend_list_ll)
     LinearLayout friend_list_ll;
+    @BindView(R.id.download_mgr_empty_view)
+    View download_mgr_empty_view;
     @Override
     public int getLayoutId() {
         return R.layout.friend_list;
@@ -73,6 +75,11 @@ public class FgtFriendExtractPage extends BaseFragment {
                 view.setVisibility(View.INVISIBLE);
             }
         }
+        if(list.isEmpty()){
+            download_mgr_empty_view.setVisibility(View.VISIBLE);
+        } else {
+            download_mgr_empty_view.setVisibility(View.GONE);
+        }
     }
     private boolean isLoadding = false;
     private void initData(){
@@ -97,17 +104,18 @@ public class FgtFriendExtractPage extends BaseFragment {
                             }
                             list.addAll(friendList);
                             notifyDataSetChanged();
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                             isLoadding = false;
                         }
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
+                        if(list.isEmpty()){
+                            download_mgr_empty_view.setVisibility(View.VISIBLE);
+                        } else {
+                            download_mgr_empty_view.setVisibility(View.GONE);
+                        }
                         isLoadding = false;
                     }
                 });

+ 24 - 49
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -9,7 +9,6 @@ import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.RequestOptions;
@@ -19,21 +18,16 @@ import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.AgentEntity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
-import com.sheep.gamegroup.model.entity.Ext;
-import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
-import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 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.afinal.simplecache.ACache;
 
@@ -45,6 +39,13 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_AGENT;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FAQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_SHARE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_UPGRADE;
+
 /**
  * 个人中心
  * Created by ljy on 2018/5/8.
@@ -107,20 +108,17 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                 .subscribe(new SheepSubscriber<BaseMessage>(getContext()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         updateData(baseMessage);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                     }
                 });
 
         String appVersonName = ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance());
         version_item_tv.setText("小绵羊V");
         version_item_tv.append(appVersonName);
-        getShardData();
         initCacheSize();
 
     }
@@ -170,7 +168,8 @@ public class FgtPersonalCenter extends BaseCompatFragment {
     @OnClick({R.id.icon_img_iv, R.id.account_detail_layout, R.id.personalcenter_price_layout, R.id.account_safe_layout,
             R.id.account_task_layout, R.id.proxy_service_layout, R.id.abourt_us_layout, R.id.feedbook_layout,
             R.id.recommend_friend_layout, R.id.tv_submit, R.id.faq_layout, R.id.reservation_layout,
-            R.id.version_layout, R.id.clear_layout, R.id.change_layout, R.id.order_layout})
+            R.id.version_layout, R.id.clear_layout, R.id.change_layout, R.id.order_layout, R.id.proxy_game_account_layout
+    })
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.icon_img_iv://图片
@@ -195,6 +194,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                     else
                         G.showToast(R.string.loading_data);
                 }
+                USER_AGENT.onEvent();
                 break;
             case R.id.faq_layout://FAQ帮助
                 Object url_config1 = ACache.get(activity).getAsObject("url_config");
@@ -205,6 +205,7 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                     else
                         Jump2View.getInstance().goWeb(activity, "http://smallstation.kfzs.com/h5_faq/#/faq", "FAQ帮助");
                 }
+                USER_FAQ.onEvent();
                 break;
             case R.id.reservation_layout://游戏预约
                 Jump2View.getInstance().goActReservation(activity);
@@ -213,24 +214,24 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                 Jump2View.getInstance().goNewAboutUs(activity);
                 break;
             case R.id.feedbook_layout://意见反馈
-                Jump2View.getInstance()
-                        .goFeedbackAct(
-                                activity);
+                Jump2View.getInstance().goFeedbackAct(activity);
                 break;
             case R.id.recommend_friend_layout://推荐给好友
-                if (Ety != null) {
-                    ViewUtil.shareLink(activity, Ety.getShare_link());
+                if (userEntitys != null) {
+                    ViewUtil.shareLink(activity, userEntitys.getShareLink());
                 }
+                USER_SHARE.onEvent();
                 break;
             case R.id.version_layout://版本更新
-                SpUtils.saveIgnoreMd5(null);
                 SysAppUtil.showVersionInfo(activity, null);
+                USER_UPGRADE.onEvent();
                 break;
             case R.id.clear_layout://清除缓存
                 ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("清除缓存").setMsg("所有本地的缓存都会被清理").setBtnRightText("取消")
                 .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
                             @Override
                             public void onClick(View view) {
+                                USER_CLEAN_SURE.onEvent();
                                 SysAppUtil.clearCache(new Action1<Object>() {
                                     @Override
                                     public void call(Object o) {
@@ -240,50 +241,24 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                                 });
                             }
                         }));
+                USER_CLEAN.onEvent();
                 break;
             case R.id.change_layout://新功能介绍
                 Jump2View.getInstance().goVersionChange(activity, ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance()));
                 break;
-            case R.id.tv_submit://注销
-                CommonUtil.getInstance()
-                        .loginOut((BaseActivity) activity);
+            case R.id.tv_submit://退出登录
+                CommonUtil.getInstance().loginOut((BaseActivity) activity);
                 break;
             case R.id.order_layout://订单管理
-                Jump2View.getInstance()
-                        .goGameTaskOrderList(activity);
+                Jump2View.getInstance().goGameTaskOrderList(activity);
+                break;
+            case R.id.proxy_game_account_layout://游戏账号
+                Jump2View.getInstance().goGameAccount(activity, null);
                 break;
         }
     }
 
 
-    FriendAndAwardEntity Ety;
-
-    /**
-     * 获取分享数据
-     */
-    private void getShardData() {
-        SheepApp.getInstance().getNetComponent().getApiService().FriendCountAndAward()
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        showToast(baseMessage.getMsg());
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        if (baseMessage != null) {
-                            Ety = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), FriendAndAwardEntity.class);
-                        } else {
-                            showToast("数据解析出错");
-                        }
-
-                    }
-                });
-
-    }
-
     @Override
     public void onResume() {
         super.onResume();

+ 15 - 57
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -7,6 +7,7 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
+import android.support.v4.widget.NestedScrollView;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.LinearLayoutManager;
@@ -22,20 +23,17 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RadioGroup;
 import android.widget.RelativeLayout;
-import android.widget.ScrollView;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
-import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.react.ReactUtil;
 import com.kfzs.duanduan.react.SharedPreferences;
-import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerSmallSheepComponent;
 import com.sheep.gamegroup.di.modules.SmallSheepModule;
 import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
@@ -47,7 +45,6 @@ import com.sheep.gamegroup.model.entity.BulletinEnty;
 import com.sheep.gamegroup.model.entity.Ext;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.MoreDataEntity;
-import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RequestParameEty;
@@ -57,12 +54,10 @@ import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 import com.sheep.gamegroup.model.util.EntityUtils;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.SmallSheepContract;
 import com.sheep.gamegroup.presenter.SmallSheepPresenter;
 import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
-import com.sheep.gamegroup.util.AppUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Conversion2;
 import com.sheep.gamegroup.util.GlideImageLoader;
@@ -103,9 +98,7 @@ import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
 import butterknife.Unbinder;
-import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
-import rx.schedulers.Schedulers;
 
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.NEWBIE_TASK;
 
@@ -150,7 +143,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     @BindView(R.id.group_banner)
     RadioGroup group_banner;
     @BindView(R.id.scrollView)
-    ScrollView scrollView;
+    NestedScrollView scrollView;
     @BindView(R.id.newbie_task)
     View newbie_task;
     @BindView(R.id.refresh)
@@ -207,8 +200,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     }
                     tryMakeMoneyAdp.notifyDataSetChanged();
                     checkAndInitView();
-                    recyclerview.setFocusable(false);
-                    scrollView.scrollTo(0,0);
                     break;
             }
 
@@ -313,8 +304,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             }
         });
 
-        //recyclerView 禁止滑动
-//        recyclerview.setNestedScrollingEnabled(false);
     }
 
     public void initData() {
@@ -364,8 +353,10 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
      * recyclerview
      */
     private void recyclerInitView() {
-
         recyclerview.setLayoutManager(new LinearLayoutManager(activity));
+        //recyclerView 解决滑动不流畅问题
+        recyclerview.setHasFixedSize(true);
+        recyclerview.setNestedScrollingEnabled(false);
         tryMakeMoneyAdp = new TryMakeMoneyAdp(activity);
         for (int i = 0; i < 2; i++) {
             tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
@@ -388,7 +379,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
         for (int i = 0; i < 2; i++) {
             tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
         }
-        tryMakeMoneyAdp.setTaskAcceptedEty(null);
 
         RequestParameEty parameEty = new RequestParameEty();
         parameEty.setHashMap(
@@ -411,39 +401,19 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     private void initWechatIsOpen() {
     }
 
-    @OnClick({R.id.recharge, R.id.user_layout, R.id.withdrawal, R.id.try_play_layout,
-            R.id.invitation_layout, R.id.lying_layout, R.id.newbie_task,
-            R.id.card_layout, R.id.icon_layout, R.id.info_layout,
-            R.id.q_iv, R.id.q_name_tv, R.id.q_dec_tv,
-            R.id.lying_iv, R.id.lying_dec_tv, R.id.lying_name_tv})
+    @OnClick({R.id.recharge, R.id.withdrawal,
+            R.id.newbie_task, R.id.icon_layout, R.id.info_layout
+    })
     public void onViewClicked(View view) {
-        G.showToast("test 热更新");
         switch (view.getId()) {
-            case R.id.user_layout:
-                break;
-            case R.id.withdrawal:
+            case R.id.withdrawal://提现
                 Jump2View.getInstance().tryGoWithdrawal(activity, userEntity);
                 break;
-            case R.id.try_play_layout://试玩赚钱
-                Jump2View.getInstance().goTryplayView(activity, null);
-                break;
-            case R.id.invitation_layout://邀请赚钱
-                Jump2View.getInstance().goAskGetMoney(activity, null);
-                break;
-            case R.id.card_layout://办卡赚钱
-                Jump2View.getInstance().goCreditCardTaskList(activity, null);
-                break;
-            case R.id.lying_layout://跳转到游戏页面
-                Jump2View.getInstance()
-                        .goMainGame(activity);
-
-                break;
             case R.id.newbie_task://新手任务
                 DialogNewbieTaskList.tryShowDialog(activity);
                 NEWBIE_TASK.onEvent();
                 break;
-            case R.id.icon_layout://
-                TestUtil.test(activity);
+            case R.id.icon_layout://头像
                 if(TestUtil.isTest()) {
                     TestUtil.test(activity);
                 }else
@@ -453,18 +423,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                 Jump2View.getInstance().goPersonnalCenterView(activity, null);
                 break;
             case R.id.recharge://充值
-                Jump2View.getInstance().goRechargeAct(activity,null);
-                break;
-            case R.id.q_iv://Q币充值
-            case R.id.q_name_tv:
-            case R.id.q_dec_tv:
-//                G.showToast("Q币充值");
-                Jump2View.getInstance().goRechargeQAct(activity,null);
-                break;
-            case R.id.lying_iv://躺着赚钱
-            case R.id.lying_dec_tv:
-            case R.id.lying_name_tv:
-                Jump2View.getInstance().tryGoLyingView(activity, null);
+                Jump2View.getInstance().goRechargeAct(activity,"首页");
                 break;
         }
     }
@@ -491,11 +450,6 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             e.printStackTrace();
         }
         mHanderl.sendEmptyMessage(0);
-        //PersionInfoAct.java与AskGetMoneyAct.java中分享二维码时的图片预下载
-        Glide.with(this)
-                .load(AppUtil.getQRLink(userEntity.getShare_link(), 800))
-                .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
-                .preload(800, 800);
         Jump2View.getInstance().tryShowNewbieTask(activity, userEntity, newbie_task);
     }
 
@@ -577,6 +531,7 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             BaseMessage baseMessage = (BaseMessage) o;
             List<TaskReleaseEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskReleaseEty.class);
             if (releaseEtyList != null) {
+                releaseEtyLists.clear();
                 releaseEtyLists.addAll(releaseEtyList);
             }
 
@@ -950,6 +905,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     case 12://闲玩任务
                         Jump2View.getInstance().goXianwanWeb(activity,null, null);
                         break;
+                    case 13://游戏代充
+                        Jump2View.getInstance().goGameRecharge(activity,null);
+                        break;
                     default:
                         G.showToast(R.string.coming_soon);
                         break;

+ 1 - 1
app/src/main/java/com/kfzs/duanduan/services/DownloadTaskService.java

@@ -166,7 +166,7 @@ public class DownloadTaskService {
         if(downLoadInfo == null){
             downLoadInfo = CommonUtil.getInstance()
                     .addNewDownloadTask(taskEty.getName(), taskEty.getDownload_url(), taskEty.getPackage_name(),
-                            Build.VERSION.SDK_INT, taskEty.getIcon(), 10+"", taskEty.getGame_id(), 1);
+                            Build.VERSION.SDK_INT, taskEty.getIcon(), 10+"", taskEty.getGame_id().hashCode(), 1);
         }
         return downLoadInfo;
     }

+ 1 - 1
app/src/main/java/com/kfzs/duanduan/utils/ApkUtils.java

@@ -83,7 +83,7 @@ public class ApkUtils {
      */
     public static final void installApk(Context context, String apkPath) {
         if(TextUtils.isEmpty(apkPath)){
-            G.showToast(R.string.unknown_error);
+//            G.showToast(R.string.unknown_error);
             return;
         }
 

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java

@@ -162,7 +162,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
             }
         }
         UploadResult uploadResult = JSON.parseObject(json, UploadResult.class);
-        if (uploadResult != null) {
+        if (uploadResult != null && uploadResult.getData() != null) {
             return uploadResult.getData().getUrl();
         }
         return null;

+ 0 - 16
app/src/main/java/com/sheep/gamegroup/di/components/BindDataComponent.java

@@ -1,16 +0,0 @@
-package com.sheep.gamegroup.di.components;
-
-import com.sheep.gamegroup.di.modules.BindDataModule;
-import com.sheep.gamegroup.di.scopes.UserScope;
-import com.sheep.gamegroup.view.activity.BindDataAct;
-
-import dagger.Component;
-
-/**
- * Created by ljy on 2018/3/19.
- */
-@UserScope
-@Component(modules = BindDataModule.class, dependencies = NetComponent.class)
-public interface BindDataComponent {
-    void inject(BindDataAct bindDataAct);
-}

+ 0 - 22
app/src/main/java/com/sheep/gamegroup/di/modules/BindDataModule.java

@@ -1,22 +0,0 @@
-package com.sheep.gamegroup.di.modules;
-
-import com.sheep.gamegroup.presenter.BindDataContract;
-
-import dagger.Module;
-import dagger.Provides;
-
-/**
- * Created by ljy on 2018/3/19.
- */
-@Module
-public class BindDataModule {
-    private BindDataContract.View view;
-
-    public BindDataModule(BindDataContract.View view) {
-        this.view = view;
-    }
-    @Provides
-    public BindDataContract.View provideView(){
-        return view;
-    }
-}

+ 0 - 19
app/src/main/java/com/sheep/gamegroup/exception/ApiException.java

@@ -1,19 +0,0 @@
-package com.sheep.gamegroup.exception;
-
-/**
- * Created by Administrator on 2018/3/22.
- */
-
-public class ApiException  extends  Exception{
-
-
-    public int code;
-    public String message;
-
-    public ApiException(Throwable throwable, int code) {
-        super(throwable);
-        this.code = code;
-
-    }
-}
-

+ 0 - 26
app/src/main/java/com/sheep/gamegroup/exception/ERROR.java

@@ -1,26 +0,0 @@
-package com.sheep.gamegroup.exception;
-
-/**
- * Created by Administrator on 2018/3/22.
- */
-
-public class ERROR {
-    /**
-     * 未知错误
-     */
-    public static final int UNKNOWN = 1000;
-    /**
-     * 解析错误
-     */
-    public static final int PARSE_ERROR = 1001;
-    /**
-     * 网络错误
-     */
-    public static final int NETWORD_ERROR = 1002;
-    /**
-     * 协议出错
-     */
-    public static final int HTTP_ERROR = 1003;
-
-
-}

+ 0 - 75
app/src/main/java/com/sheep/gamegroup/exception/ExceptionEngine.java

@@ -1,75 +0,0 @@
-package com.sheep.gamegroup.exception;
-
-import com.alibaba.fastjson.JSONException;
-import com.google.gson.JsonParseException;
-
-
-
-import java.net.ConnectException;
-import java.text.ParseException;
-
-import retrofit2.adapter.rxjava.HttpException;
-
-/**
- * Created by Administrator on 2018/3/22.
- */
-
-public class ExceptionEngine {
-
-    //对应HTTP的状态码
-    private static final int UNAUTHORIZED = 401;
-    private static final int FORBIDDEN = 403;
-    private static final int NOT_FOUND = 404;
-    private static final int REQUEST_TIMEOUT = 408;
-    private static final int INTERNAL_SERVER_ERROR = 500;
-    private static final int BAD_GATEWAY = 502;
-    private static final int SERVICE_UNAVAILABLE = 503;
-    private static final int GATEWAY_TIMEOUT = 504;
-    private static final int SMS_ERROR = 422;
-
-    public static ApiException handleException(Throwable e){
-        ApiException ex;
-        if (e instanceof HttpException){             //HTTP错误
-            HttpException httpException = (HttpException) e;
-            ex = new ApiException(e, httpException.code());
-            switch(httpException.code()){
-                case UNAUTHORIZED:
-                case FORBIDDEN:
-                case NOT_FOUND:
-                case REQUEST_TIMEOUT:
-                case GATEWAY_TIMEOUT:
-                case INTERNAL_SERVER_ERROR:
-                case BAD_GATEWAY:
-                case SERVICE_UNAVAILABLE:
-                    ex.message = "网络错误";  //均视为网络错误
-                    break;
-                case  SMS_ERROR:
-                    ex.message = "验证码错误";  //均视为网络错误
-                    break;
-
-
-            }
-            return ex;
-        } else if (e instanceof ServerException){    //服务器返回的错误
-            ServerException resultException = (ServerException) e;
-            ex = new ApiException(resultException, resultException.code);
-            ex.message = resultException.message;
-            return ex;
-        } else if (e instanceof JsonParseException
-                || e instanceof JSONException
-                || e instanceof ParseException){
-            ex = new ApiException(e, ERROR.PARSE_ERROR);
-            ex.message = "解析错误";            //均视为解析错误
-            return ex;
-        }else if(e instanceof ConnectException){
-            ex = new ApiException(e, ERROR.NETWORD_ERROR);
-            ex.message = "连接失败";  //均视为网络错误
-            return ex;
-        }else {
-            ex = new ApiException(e, ERROR.UNKNOWN);
-            ex.message = "未知错误";          //未知错误
-            return ex;
-        }
-    }
-
-}

+ 0 - 12
app/src/main/java/com/sheep/gamegroup/exception/ServerException.java

@@ -1,12 +0,0 @@
-package com.sheep.gamegroup.exception;
-
-/**
- * Created by Administrator on 2018/3/22.
- */
-
-public class ServerException extends RuntimeException {
-    public int code;
-    public String message;
-
-
-}

+ 0 - 2
app/src/main/java/com/sheep/gamegroup/heler/FindAppHelper.java

@@ -87,7 +87,6 @@ public class FindAppHelper{
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                         findApp.setRecord(2);//设置为不可记录
                         if(findApp.isCanDonload()){
                             //提交下载成功
@@ -103,7 +102,6 @@ public class FindAppHelper{
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         if(!findApp.isCanDonload()){
                             G.showToast("预约失败");
                         }

+ 1 - 9
app/src/main/java/com/sheep/gamegroup/heler/TaskHelper.java

@@ -57,14 +57,12 @@ public class TaskHelper {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                         taskAcceptedEty = baseMessage.getData(TaskAcceptedEty.class);
                         initTask(release_task_id);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         initTask(release_task_id);
                     }
                 });
@@ -77,7 +75,6 @@ public class TaskHelper {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         taskReleaseEty = baseMessage.getData(TaskReleaseEty.class);
                         if(action1 != null)
                             action1.call(1);//刷新界面
@@ -86,7 +83,6 @@ public class TaskHelper {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                     }
                 });
     }
@@ -98,7 +94,6 @@ public class TaskHelper {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         orienteeringDetail = baseMessage.getData(OrienteeringDetail.class);
                         loadTask(itemView);
 
@@ -106,7 +101,6 @@ public class TaskHelper {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                     }
                 });
     }
@@ -145,7 +139,7 @@ public class TaskHelper {
             find_information_game_task.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View view) {
-                    ViewUtil.showGamePayAccount(activity, orienteeringDetail.getGame_id());
+                    ViewUtil.showGamePayAccount(activity, orienteeringDetail.getGame_id(),orienteeringDetail.getName());
                 }
             });
             itemView.setOnClickListener(new View.OnClickListener() {
@@ -228,13 +222,11 @@ public class TaskHelper {
                                             .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                                                 @Override
                                                 public void onNext(BaseMessage baseMessage) {
-                                                    LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                                     refreshTask();
                                                 }
 
                                                 @Override
                                                 public void onError(BaseMessage baseMessage) {
-                                                    LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                                     G.showToast(baseMessage);
                                                 }
                                             });

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

@@ -69,28 +69,6 @@ public interface ApiService {
      */
     @GET("app/wechat/is_open")
     Observable<BaseMessage> getWebchatIsOpen();
-    /**
-     * 绑定手机号
-     */
-    @PUT("app/user/bind_mobile/")
-    Observable<BaseMessage> bindMobile(@Query("mobile") String mobile, @Query("sec_code") String sec_code);
-    /**
-     * 绑定真实姓名
-     */
-    @PUT("app/user/bind_real_name/")
-    Observable<BaseMessage> bindRealname(@Body JSONObject object);
-//    Observable<BaseMessage> bindRealname(@Query("real_name") String real_name);
-    /**
-     * 绑定身份证号
-     */
-    @PUT("app/user/bind_id_number/")
-//    Observable<BaseMessage> bindIdNumber(@Query("id_number") String id_number);
-    Observable<BaseMessage> bindIdNumber(@Body JSONObject objec);
-    /**
-     * 绑定银行卡
-     */
-    @PUT("app/user/bind_bank_card/")
-    Observable<BaseMessage> bindBankCard(@Body JSONObject objec);
 
     /**
      * 用户提现
@@ -142,6 +120,14 @@ public interface ApiService {
                                         @Query("platform") int platform, @Query("is_hot") int is_hot,
                                         @Query("is_recommend") int is_recommend, @Query("about_to_begin") int about_to_begin,
                                         @Query("task_type") String task_type, @Query("is_succession") int is_succession);
+    /**
+     * 搜索游戏
+     */
+    @GET("app/release_task")
+    Observable<BaseMessage> releaseTask(@Query("page") int page, @Query("per_page") int per_page,
+                                        @Query("platform") int platform, @Query("is_hot") int is_hot,
+                                        @Query("is_recommend") int is_recommend, @Query("about_to_begin") int about_to_begin,
+                                        @Query("task_type") String task_type, @Query("is_succession") int is_succession, @Query("name") String name);
 
 
 
@@ -159,7 +145,7 @@ public interface ApiService {
 
 
     /**
-     * 获取正在运行的任务
+     * 微信登录
      * @param jsonObject
      */
     @POST("app/auth/login_by_we_chat")
@@ -168,7 +154,7 @@ public interface ApiService {
 
 
     /**
-     * 获取正在运行的任务
+     * qq登录
      * @param jsonObject
      */
     @POST("app/auth/login_by_qq")
@@ -521,7 +507,7 @@ public interface ApiService {
      * 能用的绵羊币金额
      */
     @GET("app/game_consumption/can_user_sheep_amount")
-    Observable<BaseMessage> can_user_sheep_amount(@Query("amount") int amount, @Query("game_id") int game_id);
+    Observable<BaseMessage> can_user_sheep_amount(@Query("amount") int amount, @Query("game_id") String game_id);
     /**
      * url配置
      */
@@ -647,4 +633,69 @@ public interface ApiService {
      */
     @GET("app/home_list/{id}")
     Observable<BaseMessage> getHomeListItem(@Path("id") int id);
+
+    /**
+     *获取游戏任务下拉列表
+     */
+    @GET("app/release_task/recharge_game_List")
+    Observable<BaseMessage> rechargeGameList(@Query("task_type") int task_type, @Query("name") String name);
+
+    /**
+     *领取游戏账号
+     */
+    @PUT("app/game_account/{task_id}")
+    Observable<BaseMessage> gameAccountManager(@Path("task_id") int task_id);
+
+    /**
+     *
+     创建游戏账号
+     */
+    @POST("app/game_account/add")
+    Observable<BaseMessage> addGameAccount(@Body JSONObject jsonObject);
+
+    /**
+     *
+     删除游戏账号
+     */
+    @DELETE("app/game_account/del/{id}")
+    Observable<BaseMessage> delGameAccount(@Path("id") int id);
+
+    /**
+     *编辑游戏账号密码
+     */
+    @PUT("app/game_account/edit")
+    Observable<BaseMessage> editGameAccount(@Body JSONObject jsonObject);
+    /**
+     *查询游戏账号详情
+     */
+    @GET("app/game_account/detail/{id}")
+    Observable<BaseMessage> getGameAccountDetail(@Path("id") int id);
+    /**
+     *获取平台对应的游戏
+     * task_type:1002平台游戏,1003 腾讯游戏,1004 小米游戏
+     */
+    @GET("app/game_account/game/list")
+    Observable<BaseMessage> getGameList(@Query("game_type") int game_type);
+    /**
+     *查询游戏账号
+     * task_type:1002平台游戏,1003 腾讯游戏,1004 小米游戏
+     */
+    @GET("app/game_account/account/list")
+    Observable<BaseMessage> getGameAccountList(@Query("game_type") int game_type, @Query("account") String account, @Query("task_id") int task_id);
+    /**
+     *查询所有游戏账号
+     * task_type:1002平台游戏,1003 腾讯游戏,1004 小米游戏
+     */
+    @GET("app/game_account/all/list")
+    Observable<BaseMessage> getGameAccountAllList();
+    /**
+     *获取计算可用定向消费券的数据
+     */
+    @GET("app/game_consumption/voucher_and_ratio")
+    Observable<BaseMessage> getVoucherAndRatio(@Query("game_id") String game_id);
+    /**
+     *获取任务
+     */
+    @GET("app/release_task/game_task")
+    Observable<BaseMessage> releaseGameTask(@Query("page") int page, @Query("per_page") int per_page,@Query("is_hot") int is_hot, @Query("task_type") String task_type, @Query("name") String name);
 }

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/model/api/BaseMessageConverter.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.kfzs.appstore.utils.string.HexUtils;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.util.LogUtil;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -22,9 +23,10 @@ public class BaseMessageConverter implements Converter<ResponseBody, BaseMessage
 
     @Override
     public BaseMessage convert(ResponseBody value) throws IOException {
-        String json = decrypt(value.string());
-//        String json = value.string();
+        String string = value.string();
+        String json = decrypt(string);
         BaseMessage baseMessage = JSONObject.parseObject(json, BaseMessage.class);
+        LogUtil.println("sheepApi", "解密", string, baseMessage);
         return baseMessage;
     }
 

+ 124 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameAccountEntity.java

@@ -0,0 +1,124 @@
+package com.sheep.gamegroup.model.entity;
+
+import android.text.TextUtils;
+
+import java.io.Serializable;
+
+/**
+ * 游戏账户
+ * Created by ljy on 2018/7/10.
+ */
+
+public class GameAccountEntity implements Serializable {
+
+    private int task_id;//游戏id
+    private String task_name;//游戏名称
+    private int task_type;//游戏平台1002平台游戏,1003 腾讯游戏,1004 小米游戏
+
+    private String account;
+    private int game_type;
+    private int id;
+    private String password;
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public int getGame_type() {
+        return game_type;
+    }
+
+    public void setGame_type(int game_type) {
+        this.game_type = game_type;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public int getTask_id() {
+        return task_id;
+    }
+
+    public void setTask_id(int task_id) {
+        this.task_id = task_id;
+    }
+
+    public String getTask_name() {
+        return task_name;
+    }
+
+    public void setTask_name(String task_name) {
+        this.task_name = task_name;
+    }
+
+    public int getTask_type() {
+        return task_type;
+    }
+
+    public void setTask_type(int task_type) {
+        this.task_type = task_type;
+    }
+
+    public String getTypeName(){
+        switch (task_id){
+            case 0:
+                return "通用";
+            default:
+                return TextUtils.isEmpty(task_name)?"通用":task_name;
+        }
+    }
+
+    /**
+     * 游戏详情,title显示
+     */
+    public String getDetailShow(){
+        switch (task_type){
+            case 1002:
+            default:
+                return "平台游戏" + "--" + getTypeName();
+            case 1003:
+                return "腾讯游戏" + "--" + getTypeName();
+            case 1004:
+                return "小米游戏" + "--" + getTypeName();
+        }
+    }
+    public String getDetailShowForGameType(){
+        switch (game_type){
+            case 1002:
+            default:
+                return "平台游戏" + "--" + getTypeName();
+            case 1003:
+                return "腾讯游戏" + "--" + getTypeName();
+            case 1004:
+                return "小米游戏" + "--" + getTypeName();
+        }
+    }
+    public String getDetailShowName(){
+        switch (task_type){
+            case 1002:
+            default:
+                return "平台游戏";
+            case 1003:
+                return "腾讯游戏";
+            case 1004:
+                return "小米游戏";
+        }
+    }
+}

+ 39 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameAccountSuper.java

@@ -0,0 +1,39 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created by ljy on 2018/7/10.
+ */
+
+public class GameAccountSuper implements Serializable {
+
+    private List<GameAccountEntity> platform;
+    private List<GameAccountEntity> tengxun;
+    private List<GameAccountEntity> xiaomi;
+
+    public List<GameAccountEntity> getPlatform() {
+        return platform;
+    }
+
+    public void setPlatform(List<GameAccountEntity> platform) {
+        this.platform = platform;
+    }
+
+    public List<GameAccountEntity> getTengxun() {
+        return tengxun;
+    }
+
+    public void setTengxun(List<GameAccountEntity> tengxun) {
+        this.tengxun = tengxun;
+    }
+
+    public List<GameAccountEntity> getXiaomi() {
+        return xiaomi;
+    }
+
+    public void setXiaomi(List<GameAccountEntity> xiaomi) {
+        this.xiaomi = xiaomi;
+    }
+}

+ 54 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GameAgencyRechargePlatformEntity.java

@@ -0,0 +1,54 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.io.Serializable;
+
+/**
+ * 游戏代充--平台
+ * Created by ljy on 2018/7/10.
+ */
+
+public class GameAgencyRechargePlatformEntity implements Serializable {
+    private int icon;
+    private String name;
+    private String desc;
+    private int task_type;
+
+    public GameAgencyRechargePlatformEntity(int icon, String name, String desc, int task_type) {
+        this.icon = icon;
+        this.name = name;
+        this.desc = desc;
+        this.task_type = task_type;
+    }
+
+    public int getTask_type() {
+        return task_type;
+    }
+
+    public void setTask_type(int task_type) {
+        this.task_type = task_type;
+    }
+
+    public int getIcon() {
+        return icon;
+    }
+
+    public void setIcon(int icon) {
+        this.icon = icon;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

+ 73 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GamePayList.java

@@ -0,0 +1,73 @@
+package com.sheep.gamegroup.model.entity;
+
+import java.io.Serializable;
+
+/**
+ * Created by ljy on 2018/7/11.
+ */
+
+public class GamePayList implements Serializable {
+    private String name;
+    private String game_id;
+
+    private int gift_ratio;
+    private double voucher;
+    private double agent_balance;
+    private double user_balance;
+
+    public double getAgent_balance() {
+        return agent_balance;
+    }
+
+    public void setAgent_balance(double agent_balance) {
+        this.agent_balance = agent_balance;
+    }
+
+    public double getUser_balance() {
+        return user_balance;
+    }
+
+    public void setUser_balance(double user_balance) {
+        this.user_balance = user_balance;
+    }
+
+    public int getGift_ratio() {
+        return gift_ratio;
+    }
+
+    public void setGift_ratio(int gift_ratio) {
+        this.gift_ratio = gift_ratio;
+    }
+
+    public double getVoucher() {
+        return voucher;
+    }
+
+    public void setVoucher(double voucher) {
+        this.voucher = voucher;
+    }
+
+    public GamePayList() {
+    }
+
+    public GamePayList(String name, String game_id) {
+        this.name = name;
+        this.game_id = game_id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getGame_id() {
+        return game_id;
+    }
+
+    public void setGame_id(String game_id) {
+        this.game_id = game_id;
+    }
+}

+ 24 - 5
app/src/main/java/com/sheep/gamegroup/model/entity/GameTaskOrderEnty.java

@@ -13,18 +13,18 @@ public class GameTaskOrderEnty implements Serializable {
 
     private int create_time;//integer($int64) 创建消费时间
 
-    private int game_id;//integer($int64) 游戏id
+    private String game_id;//integer($int64) 游戏id
 
     private int id;//integer($int64)
     private String order_no;//string 游戏充值的order_no
 
     private int pay_type;//integer($int64) 充值方式
 
-    private int status;//integer($int64) 状态: 0下单 1订单取消 2第三方充值成功 3游戏充值中 4游戏充值失败 5游戏充值失败
+    private int status;//integer($int64) 状态: 0下单 1订单取消 2第三方充值成功 3游戏充值中 4游戏充值失败 5游戏充值支付成功 6:已退款
 
     private double third_amount;//number($double) 第三方充值金额
 
-    private int type;//integer($int32) 1:游戏充值 2Q币充值
+    private int type;//integer($int32) 1:游戏充值 2腾讯游戏  3小米游戏
 
     private int update_time;//integer($int64) 更新时间
 
@@ -32,6 +32,16 @@ public class GameTaskOrderEnty implements Serializable {
 
     private long user_id;//;//integer($int64)用户id
 
+    private String remark;//失败原因
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
     public String getAccount() {
         return account;
     }
@@ -56,11 +66,11 @@ public class GameTaskOrderEnty implements Serializable {
         this.create_time = create_time;
     }
 
-    public int getGame_id() {
+    public String getGame_id() {
         return game_id;
     }
 
-    public void setGame_id(int game_id) {
+    public void setGame_id(String game_id) {
         this.game_id = game_id;
     }
 
@@ -135,4 +145,13 @@ public class GameTaskOrderEnty implements Serializable {
     public void setUser_id(long user_id) {
         this.user_id = user_id;
     }
+
+
+    /**
+     * 是否支付成功
+     * @return
+     */
+    public boolean isSuccess(){
+        return status == 5;
+    }
 }

+ 18 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/GridViewEntity.java

@@ -1,5 +1,7 @@
 package com.sheep.gamegroup.model.entity;
 
+import android.text.TextUtils;
+
 /**
  * Created by ljy on 2018/3/18.
  */
@@ -17,6 +19,12 @@ public class GridViewEntity {
         this.name = name;
     }
 
+    public GridViewEntity(boolean selectState, String name, String task_type) {
+        this.selectState = selectState;
+        this.name = name;
+        this.task_type = task_type;
+    }
+
     public GridViewEntity() {
     }
 
@@ -26,6 +34,16 @@ public class GridViewEntity {
     private int id;// -1:全部
     private String name;
 
+    private String task_type;
+
+    public String getTask_type() {
+        return TextUtils.isEmpty(task_type)?("1002"+",1003"+",1004"):task_type;
+    }
+
+    public void setTask_type(String task_type) {
+        this.task_type = task_type;
+    }
+
     public int getId() {
         return id;
     }

+ 62 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/OrienteeringDetail.java

@@ -27,7 +27,7 @@ public class OrienteeringDetail implements Serializable{
 
     private float balance;//可定向消费金额
 
-    private int game_id;
+    private String game_id;
 
     private int min_amount;//最低消费金额
 
@@ -39,6 +39,10 @@ public class OrienteeringDetail implements Serializable{
     private int task_id;
     private int release_task_id;
 
+    private int is_reservation;//是否预约任务 0不是 1是
+    private boolean can_download;//是否可以下载
+    private int appointment_time;//预约时间
+
     public int getRelease_task_id() {
         return release_task_id;
     }
@@ -71,10 +75,10 @@ public class OrienteeringDetail implements Serializable{
     public float getBalance(){
         return this.balance;
     }
-    public void setGame_id(int game_id){
+    public void setGame_id(String game_id){
         this.game_id = game_id;
     }
-    public int getGame_id(){
+    public String getGame_id(){
         return this.game_id;
     }
     public void setMin_amount(int min_amount){
@@ -110,6 +114,36 @@ public class OrienteeringDetail implements Serializable{
         this.id = id;
     }
 
+    public int getIs_reservation() {
+        return is_reservation;
+    }
+
+    public void setIs_reservation(int is_reservation) {
+        this.is_reservation = is_reservation;
+    }
+
+    public boolean isCan_download() {
+        return can_download;
+    }
+
+    public void setCan_download(boolean can_download) {
+        this.can_download = can_download;
+    }
+
+    public int getAppointment_time() {
+        return appointment_time;
+    }
+
+    public void setAppointment_time(int appointment_time) {
+        this.appointment_time = appointment_time;
+    }
+
+
+
+
+
+
+
 
 
 
@@ -119,4 +153,29 @@ public class OrienteeringDetail implements Serializable{
     public boolean equals(Object obj) {
         return obj instanceof OrienteeringDetail && ((OrienteeringDetail) obj).id == id;
     }
+
+
+
+
+
+
+
+
+
+
+
+    /**
+     * 是否是游戏任务中的预约任务
+     * @return
+     */
+    public boolean isGameReservation() {
+        return is_reservation == 1;//是否预约任务 0不是 1是
+    }
+    /**
+     * 是否游戏任务中的预约任务还不可以下载
+     * @return
+     */
+    public boolean isGameReservationCantDownload() {
+        return isGameReservation() && !can_download;
+    }
 }

+ 153 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/PayEntity.java

@@ -0,0 +1,153 @@
+package com.sheep.gamegroup.model.entity;
+
+import android.text.TextUtils;
+
+import java.io.Serializable;
+
+/**
+ * Created by ljy on 2018/7/11.
+ */
+
+public class PayEntity implements Serializable {
+
+    private String account;//游戏账号
+    private String pwd;//密码
+    private String game_id;//;游戏
+    private String service;//区服
+    private String role_name;//角色
+    private String role_id;//角色ID
+    private String goods;//购买物品
+    private String task_type;//
+
+    private double amount;//充值金额
+    private int pay_type;//支付方式:1支付宝 2微信 3绵羊币
+
+    private boolean use_voucher;
+
+    private String game_name;
+
+    private int tencent_platform;//腾讯充值标识平台: 1是QQ 2是微信
+
+    public int getTencent_platform() {
+        return tencent_platform;
+    }
+
+    public void setTencent_platform(int tencent_platform) {
+        this.tencent_platform = tencent_platform;
+    }
+
+    public String getGame_name() {
+        return TextUtils.isEmpty(game_name)?"游戏":game_name;
+    }
+
+    public void setGame_name(String game_name) {
+        this.game_name = game_name;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getPwd() {
+        return pwd;
+    }
+
+    public void setPwd(String pwd) {
+        this.pwd = pwd;
+    }
+
+    public String getGame_id() {
+        return game_id;
+    }
+
+    public void setGame_id(String game_id) {
+        this.game_id = game_id;
+    }
+
+    public String getService() {
+        return service;
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public String getRole_name() {
+        return role_name;
+    }
+
+    public void setRole_name(String role_name) {
+        this.role_name = role_name;
+    }
+
+    public String getRole_id() {
+        return role_id;
+    }
+
+    public void setRole_id(String role_id) {
+        this.role_id = role_id;
+    }
+
+    public String getGoods() {
+        return goods;
+    }
+
+    public void setGoods(String goods) {
+        this.goods = goods;
+    }
+
+    public String getTask_type() {
+        return TextUtils.isEmpty(task_type)?"1002":task_type;
+    }
+
+    public void setTask_type(String task_type) {
+        this.task_type = task_type;
+    }
+
+    public double getAmount() {
+        return amount;
+    }
+
+    public void setAmount(double amount) {
+        this.amount = amount;
+    }
+
+    public int getPay_type() {
+        return pay_type;
+    }
+
+    public void setPay_type(int pay_type) {
+        this.pay_type = pay_type;
+    }
+
+    public boolean isUse_voucher() {
+        return use_voucher;
+    }
+
+    public void setUse_voucher(boolean use_voucher) {
+        this.use_voucher = use_voucher;
+    }
+
+    public String getTaskType(){
+        return TextUtils.isEmpty(task_type) ? "0":task_type;
+    }
+
+    /**
+     * 游戏详情,title显示
+     */
+    public String getDetailShow(){
+        switch (getTask_type()){
+            case "1002":
+            default:
+                return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"平台游戏代充" :getGame_name()+"游戏";
+            case "1003":
+            return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"腾讯游戏代充" :getGame_name()+"游戏";
+            case "1004":
+            return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"小米游戏代充" :getGame_name()+"游戏";
+        }
+    }
+}

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/RecyleType.java

@@ -18,4 +18,11 @@ public enum RecyleType  implements Serializable {
     NORMAL_ON_HOOK,//挂机正常
     PROCESS_ON_HOOK,//挂机进行中
     PROMPT_ON_HOOK,//挂机提示信息
+
+    GAME_AGENCY_PAYMENT,//游戏代充
+    GAME_AGENCY_PAYMENT_PLATFORM,//游戏代充平台
+
+    GAME_ACCOUNT_PLATFORM,//平台
+    GAME_ACCOUNT_TENCENT,//腾讯
+    GAME_ACCOUNT_XIAOMI,//小米
 }

+ 38 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/SearchGameRecord.java

@@ -0,0 +1,38 @@
+package com.sheep.gamegroup.model.entity;
+
+import org.xutils.db.annotation.Column;
+import org.xutils.db.annotation.Table;
+
+/**
+ * Created by realicing on 2018/7/11.
+ * realicing@sina.com
+ */
+@Table(name = "search_game_record")
+public class SearchGameRecord {
+    @Column(name = "input", isId = true)
+    private String input;
+    @Column(name = "time")
+    private long time;
+
+    public String getInput() {
+        return input;
+    }
+
+    public void setInput(String input) {
+        this.input = input;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public void setTime(long time) {
+        this.time = time;
+    }
+
+
+    @Override
+    public String toString() {
+        return input;
+    }
+}

+ 103 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -25,7 +25,7 @@ public class TaskEty implements Serializable, IDownload {
     private String remarks;//private String string",
     private String task_name;//private String string",
     private String screenshots;//private String string",
-    private int task_type = 1;// 1时间试玩任务 2 信用卡任务 3应用下载 4h5业务 1001畅思 1000连续任务, 1002 1003游戏任务
+    private int task_type = 1;// 1时间试玩任务 2 信用卡任务 3应用下载 4h5业务 1001畅思 1000连续任务, 1002 1003游戏任务 1002平台游戏,1003 腾讯游戏,1004 小米游戏
     private String update_time;// 0
     private String icon;
     private String package_size;
@@ -36,6 +36,8 @@ public class TaskEty implements Serializable, IDownload {
     private String desc;// 任务详情介绍
     private String ext;// 对应的信用卡配置的id
     private List<TaskChild> child;
+    private boolean can_download;//是否可以下载
+    private int appointment_time;//预约时间
 
     /**
      * desc 另外的可能情况
@@ -49,6 +51,23 @@ public class TaskEty implements Serializable, IDownload {
      */
     private List<ScreenshotsEntity> screenshotsList;
 
+    /**
+     * 能否领取了账号 true能领取了
+     */
+    private boolean can_receive_account;
+    /**
+     * 是否预约任务 0不是 1是
+     */
+    private int is_reservation;
+
+    public boolean isCan_receive_account() {
+        return can_receive_account;
+    }
+
+    public void setCan_receive_account(boolean can_receive_account) {
+        this.can_receive_account = can_receive_account;
+    }
+
     public String getScreenshots() {
         return screenshots;
     }
@@ -108,7 +127,7 @@ public class TaskEty implements Serializable, IDownload {
     }
 
     public String getBonus() {
-        return bonus;
+        return TextUtils.isEmpty(bonus)?"0":bonus;
     }
 
     public void setBonus(String bonus) {
@@ -256,6 +275,43 @@ public class TaskEty implements Serializable, IDownload {
         this.third_task_id = third_task_id;
     }
 
+    public int getIs_reservation() {
+        return is_reservation;
+    }
+
+    public void setIs_reservation(int is_reservation) {
+        this.is_reservation = is_reservation;
+    }
+
+    public int getAppointment_time() {
+        return appointment_time;
+    }
+
+    public void setAppointment_time(int appointment_time) {
+        this.appointment_time = appointment_time;
+    }
+
+    public boolean isCan_download() {
+        return can_download;
+    }
+
+    public void setCan_download(boolean can_download) {
+        this.can_download = can_download;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
     /**
      * 是否是应用自动审核完成的任务
      * @return
@@ -312,6 +368,10 @@ public class TaskEty implements Serializable, IDownload {
         }
     }
 
+    /**
+     * 是否是老任务--任务详情中显示不一样
+     * @return
+     */
     public boolean isOldTask(){
         if(task_type == 1000){
             if(!ListUtil.isEmpty(child)){
@@ -324,7 +384,47 @@ public class TaskEty implements Serializable, IDownload {
         return false;
     }
 
+    /**
+     * 是否是游戏任务
+     * @return
+     */
     public boolean isGameTask() {
-        return task_type == 1002 || task_type == 1003;
+        return task_type == 1002 || task_type == 1003 || task_type ==1004;
+    }
+
+
+
+
+
+    /**
+     * 是否是游戏任务中的预约任务
+     * @return
+     */
+    public boolean isGameReservation() {
+        return is_reservation == 1;//是否预约任务 0不是 1是
+    }
+    /**
+     * 是否游戏任务中的预约任务还不可以下载
+     * @return
+     */
+    public boolean isGameReservationCantDownload() {
+        return isGameTask() && isGameReservation() && !can_download;
     }
+
+
+    /**
+     * 游戏详情,title显示
+     */
+    public String getDetailShow(){
+        switch (task_type){
+            case 1002:
+            default:
+                return "平台游戏";
+            case 1003:
+                return "腾讯游戏";
+            case 1004:
+                return "小米游戏";
+        }
+    }
+
 }

+ 11 - 2
app/src/main/java/com/sheep/gamegroup/model/entity/TaskReleaseEty.java

@@ -2,6 +2,8 @@ package com.sheep.gamegroup.model.entity;
 
 import android.text.TextUtils;
 
+import com.sheep.gamegroup.heler.DownloadHelper;
+
 import java.io.Serializable;
 
 /**
@@ -105,7 +107,7 @@ public class TaskReleaseEty implements Serializable{
     }
 
     public String getBonus() {
-        return bonus;
+        return TextUtils.isEmpty(bonus)?"0":bonus;
     }
 
     public void setBonus(String bonus) {
@@ -209,7 +211,7 @@ public class TaskReleaseEty implements Serializable{
     }
 
     public String getTask_id() {
-        return task_id;
+        return TextUtils.isEmpty(task_id)?"0":task_id;
     }
 
     public void setTask_id(String task_id) {
@@ -249,4 +251,11 @@ public class TaskReleaseEty implements Serializable{
     public boolean isOffline() {
         return status == 3 || status == 4;
     }
+
+
+    private DownloadHelper downloadHelper = new DownloadHelper();
+
+    public DownloadHelper getDownloadHelper() {
+        return downloadHelper;
+    }
 }

+ 26 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -2,6 +2,9 @@ package com.sheep.gamegroup.model.entity;
 
 import android.text.TextUtils;
 
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+
 import org.xutils.db.annotation.Column;
 import org.xutils.db.annotation.Table;
 
@@ -67,6 +70,8 @@ public class UserEntity implements Serializable {
     private int is_agent;//0不是代理 1是代理
     @Column(name = "certification_count")
     private int certification_count;//实名认证次数
+    @Column(name = "must_bind_mobile")
+    private int must_bind_mobile;//是否必须绑定手机号 0不是 1是
 
     public String getWx_nickname() {
         return wx_nickname;
@@ -276,6 +281,15 @@ public class UserEntity implements Serializable {
         this.certification_count = certification_count;
     }
 
+    public int getMust_bind_mobile() {
+        return must_bind_mobile;
+    }
+
+    public void setMust_bind_mobile(int must_bind_mobile) {
+        this.must_bind_mobile = must_bind_mobile;
+    }
+
+
 
 
 
@@ -296,4 +310,16 @@ public class UserEntity implements Serializable {
     public boolean notCertification() {
         return TextUtils.isEmpty(getReal_name()) || TextUtils.isEmpty(getId_number()) || TextUtils.isEmpty(getBank_card_mobile()) || TextUtils.isEmpty(getBank_card());
     }
+
+    /**
+     * 老用户选择绑定手机号
+     * @return
+     */
+    public boolean canBindMobile(){
+        return must_bind_mobile == 0 && TextUtils.isEmpty(mobile);
+    }
+    //测试服用测试分享链接,正式服用正式的
+    public String getShareLink(){
+        return TestUtil.isTest() ? "http://10.8.210.230:8902/share.html?invitation_code="+getInvitation_code(): getShare_link();
+    }
 }

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java

@@ -49,6 +49,7 @@ public class AddPuplicParameIntercept implements Interceptor {
                 .newBuilder();
         String method = oldRequest.method();
         RequestBody body = oldRequest.body();
+        LogUtil.println("sheepApi", "request", oldRequest);
         if (BuildConfig.XXTEA_ENCRYPT && (method.equals("POST") || method.equals("PUT"))) {
             RequestBody requestBody = oldRequest.body();
             if (requestBody instanceof FormBody) {
@@ -62,7 +63,7 @@ public class AddPuplicParameIntercept implements Interceptor {
                 }
                 String oldParamsJson = buffer.readUtf8();
                 String newJsonParams = BaseMessageConverter.encrypt(oldParamsJson);
-                LogUtil.println("加密", oldRequest, oldParamsJson, newJsonParams);
+                LogUtil.println("sheepApi", "加密", oldRequest, oldParamsJson, newJsonParams);
                 if(!TextUtils.isEmpty(newJsonParams))
                     body = RequestBody.create(requestBody.contentType(), newJsonParams);
             }

+ 1 - 7
app/src/main/java/com/sheep/gamegroup/model/util/AutoTaskListUtil.java

@@ -68,23 +68,17 @@ public class AutoTaskListUtil {
         //下面的功能主要是初始化 正在运行的应用自动审核任务列表
         AutoTaskListUtil.getInstance().clear();
         SheepApp.getInstance().getNetComponent().getApiService()
-                .releaseTask(1,100,
-                        SheepApp.getInstance().getConnectAddress().getPlatForm(),1,
-                        0, 0,
-                        "-1", 3)
+                .returnTask(3)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+ JSON.toJSONString(baseMessage));
                         loadding = false;
                     }
 
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-
                         List<TaskAcceptedEty> list = baseMessage.getDatas(TaskAcceptedEty.class);
                         loadList(list);
                         loadding = false;

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.BaseMessageConverter;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.NetUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -73,14 +74,15 @@ public abstract class SheepSubscriber<T> extends Subscriber<T> {
                 }
                 //未绑定手机号
                 if(throwable.code == 302 && baseMessage.getCode() == 30001){
-//                    Jump2View.getInstance().goBindPhone(SheepApp.mContext,baseMessage.getCode());
-//                    return;
+                    Jump2View.getInstance().goBindPhone(SheepApp.mContext, baseMessage.getCode());
+                    return;
                 }else if(baseMessage.getCode() == 1002){
                     Jump2View.getInstance().gotoLoginAgain();
                 }
 
                 if(baseMessage.getCode() == 0)
                     baseMessage.setCode(throwable.code);
+                LogUtil.println("sheepApi", "onError", e.getMessage(), throwable.message, baseMessage);
                 onError(baseMessage);
             }else {
                 BaseMessage baseMessage = new BaseMessage();

+ 0 - 20
app/src/main/java/com/sheep/gamegroup/presenter/BindDataContract.java

@@ -1,20 +0,0 @@
-package com.sheep.gamegroup.presenter;
-
-/**
- * Created by ljy on 2018/3/19.
- */
-
-public interface BindDataContract {
-
-    interface Presenter{
-        void submitData(Object o);
-        void submitDataRealname(Object o);
-        void submitDataBankcard(Object o);
-        void submitDataIdnumber(Object o);
-    }
-
-    interface View{
-        void upView(Object o);
-        void failView(Object o);
-    }
-}

+ 0 - 92
app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java

@@ -1,92 +0,0 @@
-package com.sheep.gamegroup.presenter;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sheep.gamegroup.model.api.ApiService;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-
-import javax.inject.Inject;
-
-import rx.android.schedulers.AndroidSchedulers;
-import rx.schedulers.Schedulers;
-
-/**
- * Created by ljy on 2018/3/19.
- */
-
-public class BindDataPresenter implements BindDataContract.Presenter {
-    private BindDataContract.View view;
-    private ApiService apiService;
-
-    @Inject
-    public BindDataPresenter(BindDataContract.View view, ApiService apiService) {
-        this.view = view;
-        this.apiService = apiService;
-    }
-
-    @Override
-    public void submitData(Object o) {
-
-    }
-
-    @Override
-    public void submitDataRealname(Object o) {
-
-        apiService.bindRealname((JSONObject) o)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        view.failView(baseMessage);
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        view.upView(baseMessage);
-                    }
-                });
-
-    }
-
-    @Override
-    public void submitDataBankcard(Object o) {
-
-        apiService.bindBankCard((JSONObject) o)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        view.failView(baseMessage);
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        view.upView(baseMessage);
-                    }
-                });
-
-    }
-
-    @Override
-    public void submitDataIdnumber(Object o) {
-
-        apiService.bindIdNumber((JSONObject) o)
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        view.failView(baseMessage);
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        view.upView(baseMessage);
-                    }
-                });
-
-    }
-}

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/statistics/AppStatistics.java

@@ -6,7 +6,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.view.activity.ChangeTelAct;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 

+ 11 - 1
app/src/main/java/com/sheep/gamegroup/util/AppUtil.java

@@ -10,6 +10,8 @@ import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.view.WindowManager;
 
+import java.util.Locale;
+
 /**
  * Created by ljy on 2018/3/8.
  */
@@ -21,7 +23,15 @@ public class AppUtil {
     }
 
     public static String getQRLink(String share_link,int w) {
-        return BASE_QR + share_link +"&w="+w;
+//        String link = BASE_QR + share_link +"&w="+w;
+//        LogUtil.println("link", link);
+        return getQRLink(share_link, w, w);
+    }
+
+    private static final String BASE_QR_2 = "https://api.qrserver.com/v1/create-qr-code/";
+
+    public static String getQRLink(String share_link,int width, int height) {
+        return String.format(Locale.CHINA, "%s?size=%dx%d&data=%s", BASE_QR_2, width, height, share_link);
     }
     /**
      * 获取app版本名

+ 337 - 6
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1,5 +1,6 @@
 package com.sheep.gamegroup.util;
 
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Color;
@@ -16,6 +17,7 @@ import android.view.ViewTreeObserver;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.sdk.app.PayTask;
 import com.arialyy.aria.core.Aria;
@@ -27,11 +29,17 @@ import com.kfzs.duanduan.event.EventTypes;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.alipay.PayResult;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.GameAccountEntity;
+import com.sheep.gamegroup.model.entity.GamePayList;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
+import com.sheep.gamegroup.model.entity.RecyleObj;
+import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RequestParameEty;
 import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 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.WithdrawalEty;
 import com.sheep.gamegroup.model.util.AutoTaskListUtil;
@@ -59,8 +67,11 @@ import java.lang.reflect.Field;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.security.MessageDigest;
+import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -74,6 +85,10 @@ import rx.schedulers.Schedulers;
  */
 
 public class CommonUtil {
+    //多次点击预防
+    public static final int MIN_CLICK_DELAY_TIME = 1000;
+    private long lastClickTime = 0;
+
     public static String START_TASK = "开始任务";
     public static String GET_TASK = "领取任务";
     public static String START_PLAY = "开始试玩";
@@ -248,7 +263,8 @@ public class CommonUtil {
     }
     /**
      * 任务传送数据组装
-     * is_succession:0:不是连续  1:联系任务 3 全部显示
+     * is_succession:0:不是连续  1:连续任务 3 全部显示
+     * task_type:1002平台游戏,1003 腾讯游戏,1004 小米游戏
      */
     public HashMap<String, String> setHashMap(int page, int per_page,
                                               int platform, int is_hot,
@@ -357,12 +373,12 @@ public class CommonUtil {
     /**
      * 首页,homelist 跳转 逻辑
      */
-    public void goWhere(Context context, HomeListEntity entity){
+    public void goWhere(Context context, HomeListEntity entity, String from){
         if(entity == null){
             return;
         }
         try {
-            goNative(context, entity);
+            goNative(context, entity, from);
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -370,7 +386,7 @@ public class CommonUtil {
     /**
      *
      */
-    public void goNative(Context context, HomeListEntity entity){
+    public void goNative(Context context, HomeListEntity entity, String from){
 
         switch(Integer.valueOf(entity.getJump())){
             case 1://试玩赚钱
@@ -393,7 +409,7 @@ public class CommonUtil {
                 break;
             case 6://6充值q币
 //                G.showToast("敬请期待!");
-                Jump2View.getInstance().goRechargeQAct(context,null);
+                Jump2View.getInstance().goRechargeQAct(context, from);
                 break;
             case 7://微信辅助
 //                G.showToast("敬请期待!");
@@ -420,6 +436,9 @@ public class CommonUtil {
             case 12://闲玩任务
                 Jump2View.getInstance().goXianwanWeb(context,null, null);
                 break;
+            case 13://游戏代充
+                Jump2View.getInstance().goGameRecharge((Activity) context,null);
+                break;
             default:
                 G.showToast(R.string.coming_soon);
                 break;
@@ -1004,7 +1023,6 @@ public class CommonUtil {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        G.showToast(baseMessage.getMsg() + "");
                         if (action1 != null)
                             action1.call(null);
 
@@ -1039,4 +1057,317 @@ public class CommonUtil {
         }
         return false;
     }
+
+
+    //对---游戏任务中的预约任务----进行---预约操作
+    public void reservationGameTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("device_id", DeviceUtil.getDeviceId(context));
+        jsonObject.put("release_task_id", taskReleaseEty.getId());
+        SheepApp.getInstance().getNetComponent().getApiService().acceptedTask(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(baseMessage.getCode() == 200) {
+                            ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("预约成功")
+                                    .setMsg(String.format(Locale.CHINA, "恭喜您获得%s元绵羊币\n注意%s准时开放下载", taskReleaseEty.getBonus(),
+                                            TimeUtil.TimeStamp2Date(taskReleaseEty.getTask().getAppointment_time(), "yyyy-MM-dd\u0020HH:mm")))
+                                    .setBtnLeftText("收入钱包").setBtnLeftOnClickListener(new View.OnClickListener() {
+                                        @Override
+                                        public void onClick(View view) {
+                                            if(action1 != null)
+                                                action1.call(1);
+                                        }
+                                    }));
+                        } else {
+                            G.showToast(baseMessage);
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+    private void giveUpTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1){
+        SheepApp.getInstance().getNetComponent().getApiService().giveUpTask(taskReleaseEty.getAccepted_task_id())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(context) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        reservationGameTask(context, taskReleaseEty, action1);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+    public void tryGiveUpTask(final Context context, final TaskReleaseEty taskReleaseEty, final Action1<Integer> action1){
+        ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("提示")
+                .setMsg("是否放弃正在运行中的任务").setBtnRightText("否")
+                .setBtnLeftText("是").setBtnLeftOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        giveUpTask(context, taskReleaseEty, action1);
+                    }
+                }));
+    }
+
+    /**
+     * 中间显示**
+     */
+    public String returnStarData(String value,int middle, int starShowNum, int endShowNum){
+        if(TextUtils.isEmpty(value))
+            return "";
+        if(value.length()> (starShowNum + endShowNum)){
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.append(value.substring(0, starShowNum));
+            stringBuilder.append("****");
+            stringBuilder.append(value.substring(value.length() -endShowNum, value.length()));
+            return stringBuilder.toString();
+        }
+        return value;
+    }
+
+    /**
+     * 删除账号
+     */
+    public void deleteGameAccount(final Context context, final int id, final Action1<Integer> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+        SheepApp.getInstance().getNetComponent().getApiService().delGameAccount(id)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        if(action1 != null)
+                            action1.call(1);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
+    /**
+     * 修改游戏账号密码
+     */
+    public void modifyGameAccount(final Context context, final JSONObject jsonObject, final Action1<Integer> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+        SheepApp.getInstance().getNetComponent().getApiService().editGameAccount(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        if(action1 != null)
+                            action1.call(1);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+    /**
+     * 获取计算可用定向消费券的数据
+     */
+    public void getVoucherAndRatio(final Context context, final String gameId, final Action1<BaseMessage> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .getVoucherAndRatio(gameId)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage.getMsg() + "");
+                        if(action1 != null)
+                            action1.call(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+
+                        if(action1 != null)
+                            action1.call(baseMessage);
+                    }
+                });
+    }
+    /**
+     * 查询游戏账号详情
+     */
+    public void getGameAccountDetail(final Context context, final int gameId, final Action1<BaseMessage> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .getGameAccountDetail(gameId)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage.getMsg() + "");
+                        if(action1 != null)
+                            action1.call(null);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+
+                        if(action1 != null)
+                            action1.call(baseMessage);
+                    }
+                });
+    }
+    /**
+     * 领取游戏账号
+     */
+    public void gameAccountManager(final Context context, final int task_id, final Action1<BaseMessage> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .gameAccountManager(task_id)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage.getMsg() + "");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        try {
+                            GameAccountEntity gameAccountEntity = baseMessage.getData(GameAccountEntity.class);
+                            if(gameAccountEntity != null){
+                                String text = String.format(context.getResources().getString(R.string.get_game_task_success_dialog),gameAccountEntity.getDetailShowName(),gameAccountEntity.getAccount());
+                                ViewUtil.showMsgDialog(context,
+                                        text,
+                                        "恭喜你获得"+gameAccountEntity.getDetailShowName()+"福利号");
+                            }
+
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if(action1 != null)
+                            action1.call(baseMessage);
+                    }
+                });
+    }
+    /**
+     * 游戏任务
+     */
+    public void gameTask(final Context context, final String task_type,final String name, final Action1<BaseMessage> action1) {
+        ViewUtil.newInstance().showProgress((Activity) context);
+
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .releaseGameTask(
+                        1,
+                        100,
+                        0,
+                        task_type,
+                        name)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+                        G.showToast(baseMessage.getMsg());
+                        if (action1 != null)
+                            action1.call(null);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress((Activity) context);
+
+                        if (action1 != null)
+                            action1.call(baseMessage);
+
+                    }
+                });
+    }
+    /**
+     * 充值游戏游戏任务
+     */
+    public void gameTaskList(final Context context, final int task_type,final String name, final Action1<BaseMessage> action1) {
+
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .rechargeGameList(
+                        task_type,
+                        name)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage.getMsg());
+                        if (action1 != null)
+                            action1.call(null);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                        if (action1 != null)
+                            action1.call(baseMessage);
+
+                    }
+                });
+    }
+
+    /**
+     * show view
+     */
+    public void showView(int goneOrShow, View view){
+        view.setVisibility(goneOrShow);
+    }
+
+    /**
+     * 点击时间
+     */
+    public boolean clickTime(int intevalTime){
+        long currentTime = Calendar.getInstance().getTimeInMillis();
+        if (currentTime - lastClickTime > intevalTime) {
+            lastClickTime = currentTime;
+            return true;
+        }
+        return false;
+    }
 }

+ 0 - 25
app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java

@@ -51,26 +51,6 @@ public enum ConnectAddress {
         public String getName() {
             return "测试服";
         }
-    },sheeptestjiguang {
-
-        @Override
-        public String getAppUrl() {
-            return "http://test.sheep.kfzs.com/";
-        }
-        @Override
-        public String getName() {
-            return "测试服极光";
-        }
-    },sheepupdate {
-
-        @Override
-        public String getAppUrl() {
-            return "http://test.sheep.kfzs.com/";
-        }
-        @Override
-        public String getName() {
-            return "升级正式版本";
-        }
     },sheep {
 
         @Override
@@ -109,18 +89,13 @@ public enum ConnectAddress {
     public int getVersionType() {
         switch (this){
             case sheep:
-            case sheepupdate:
                 return 1;
-            case sheeptestjiguang:
-                return 2;
             default:
                 return 0;
         }
     }
     public String getPackageName() {
         switch (this){
-            case sheeptestjiguang:
-                return "com.sheep.jiuyan.samllsheep.test";
             default:
                 return "com.sheep.jiuyan.samllsheep";
         }

+ 48 - 7
app/src/main/java/com/sheep/gamegroup/util/GlideImageLoader.java

@@ -7,6 +7,14 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestOptions;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
+import com.zhy.http.okhttp.OkHttpUtils;
+import com.zhy.http.okhttp.callback.FileCallBack;
+
+import java.io.File;
+
+import okhttp3.Call;
+import rx.functions.Action1;
 
 /**
  * Created by realicing on 2018/3/26.
@@ -15,45 +23,78 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 
 public class GlideImageLoader {
 
-    public static void setImage(ImageView imageView, String url){
+    public static void setImage(ImageView imageView, String url) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .into(imageView);
     }
-    public static void centerImage(ImageView imageView, String url, int id){
+
+    public static void centerImage(ImageView imageView, String url, int id) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .apply(new RequestOptions().centerCrop().placeholder(id))
                 .into(imageView);
     }
-    public static void centerImage(ImageView imageView, String path){
+
+    public static void centerImage(ImageView imageView, String path) {
         Glide.with(SheepApp.getInstance())
                 .load(path)
                 .apply(new RequestOptions().centerCrop().placeholder(R.drawable.loading_01))
                 .into(imageView);
     }
-    public static void circleImage(ImageView imageView, String url, int id){
+
+    public static void circleImage(ImageView imageView, String url, int id) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .apply(new RequestOptions().circleCrop().placeholder(id))
                 .into(imageView);
     }
-    public static void circleImage(ImageView imageView, String url){
+
+    public static void circleImage(ImageView imageView, String url) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .apply(new RequestOptions().circleCrop().placeholder(R.drawable.loading_01))
                 .into(imageView);
     }
-    public static void roundedCornersImage(ImageView imageView, String url, int radius, int id){
+
+    public static void roundedCornersImage(ImageView imageView, String url, int radius, int id) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .apply(new RequestOptions().transform(new RoundedCorners(radius)).placeholder(id))
                 .into(imageView);
     }
-    public static void roundedCornersImage(ImageView imageView, String url, int radius){
+
+    public static void roundedCornersImage(ImageView imageView, String url, int radius) {
         Glide.with(SheepApp.getInstance())
                 .load(url)
                 .apply(new RequestOptions().transform(new RoundedCorners(radius)).placeholder(R.drawable.loading_01))
                 .into(imageView);
     }
+
+    public static void downLoadImage(String name, String link, final Action1<File> action1) {
+        String fileName = name + ".png";
+        final File file = new File(ClassFileHelper.DIR, fileName);
+        if(file.exists()){
+            if(action1 != null){
+                action1.call(file);
+            }
+            return;
+        }
+        OkHttpUtils.get().url(link).build().execute(new FileCallBack(ClassFileHelper.DIR, fileName) {
+            @Override
+            public void onError(Call call, Exception e, int id) {
+                if(action1 != null){
+                    action1.call(null);
+                }
+            }
+
+            @Override
+            public void onResponse(File response, int id) {
+                if(response.exists())
+                    if(action1 != null){
+                        action1.call(response);
+                    }
+            }
+        });
+    }
 }

+ 6 - 1
app/src/main/java/com/sheep/gamegroup/util/ImageGlarryDrawable.java

@@ -126,6 +126,7 @@ public class ImageGlarryDrawable<T> {
         }
 
         if (mList.size() > 1) {//有两张或以上图片,开始轮播
+            mRadioGroup.setVisibility(View.VISIBLE);
             if (!mIsMoved) {
                 mIsMoved = true;
                 handler.removeMessages(1);
@@ -173,7 +174,11 @@ public class ImageGlarryDrawable<T> {
                         return;
                     }
                     int lastIndex = (mViewPager.getCurrentItem() + 1) % ListUtil.size(mList);
-                    mViewPager.setCurrentItem(lastIndex, true);
+                    try {
+                        mViewPager.setCurrentItem(lastIndex, true);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
                     pagerAdapter.notifyDataSetChanged();
                     handler.removeMessages(1);
                     sendEmptyMessageDelayed(1, mIntDelayTime);

+ 119 - 62
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2,19 +2,18 @@ package com.sheep.gamegroup.util;
 
 import android.app.Activity;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Bundle;
-import android.provider.Settings;
-import android.support.v7.app.AlertDialog;
 import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.View;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.bean.KFIntentKeys;
 import com.sheep.gamegroup.absBase.BaseActivity;
@@ -36,13 +35,14 @@ import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.VersionInfo;
 import com.sheep.gamegroup.model.entity.WebviewEntity;
 import com.sheep.gamegroup.model.entity.XianWanEntity;
-import com.sheep.gamegroup.model.util.AutoTaskListUtil;
 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;
 import com.sheep.gamegroup.view.activity.ActFindGame;
 import com.sheep.gamegroup.view.activity.ActFindInformation;
+import com.sheep.gamegroup.view.activity.ActGameAccount;
+import com.sheep.gamegroup.view.activity.ActGameAgencyRecharge;
 import com.sheep.gamegroup.view.activity.ActGuide;
 import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
 import com.sheep.gamegroup.view.activity.ActGuideOnHook;
@@ -53,12 +53,12 @@ import com.sheep.gamegroup.view.activity.ActNewAboutUs;
 import com.sheep.gamegroup.view.activity.ActNewbieTaskList;
 import com.sheep.gamegroup.view.activity.ActNotice;
 import com.sheep.gamegroup.view.activity.ActReservation;
+import com.sheep.gamegroup.view.activity.ActSearchGame;
 import com.sheep.gamegroup.view.activity.ActUnderstandSheep;
 import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.ActXinwanWeb;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
-import com.sheep.gamegroup.view.activity.BindDataAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
 import com.sheep.gamegroup.view.activity.ChangeTelAct;
 import com.sheep.gamegroup.view.activity.ChangeWxOrTelAct;
@@ -97,7 +97,6 @@ import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.service.FloatService;
-import com.sheep.jiuyan.samllsheep.service.MonitorAppService;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
@@ -113,7 +112,19 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_ABOUT_US;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_ACCOUNT_SAFE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FEEDBACK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FIND_APP_ORDER;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_MY_MONEY;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_NEW_VERSION;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_TASK_RECORD;
 
 /**
  * Created by ljy on 2018/3/18.
@@ -177,9 +188,9 @@ 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);
+        USER_ACCOUNT_SAFE.onEvent();
     }
 
     /**
@@ -234,18 +245,66 @@ public class Jump2View {
      * 进入主页前需要检查协议或者用户标签
      * @param activity
      */
+    public void checkPhoneOrGoHomePage(final Activity activity) {
+        CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
+            @Override
+            public void call(UserEntity userEntity) {
+                if(userEntity != null && !TextUtils.isEmpty(userEntity.getShareLink())) {
+//                                GlideImageLoader.downLoadImage(userEntity.getShare_link().hashCode(), AppUtil.getQRLink(userEntity.getShare_link(), 800), null);
+//                                //PersionInfoAct.java与AskGetMoneyAct.java中分享二维码时的图片预下载
+                    Glide.with(activity)
+                            .load(AppUtil.getQRLink(userEntity.getShareLink(), 800))
+                            .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
+                            .preload(800, 800);
+                }
+
+                if(userEntity != null && userEntity.canBindMobile()
+                    //&& !BuildConfig.DEBUG
+                        ){//老用户没有绑定手机号
+                    Jump2View.getInstance().goBindPhone(activity, 2);
+                    return;
+                }
+                Intent intent = new Intent(activity, ActMain.class);
+                activity.startActivity(intent);
+                activity.finish();
+            }
+        });
+    }
+    /**
+     * 进入主页前需要检查是否需要绑定手机号、用户标签是否设置
+     * @param activity
+     */
     private void checkOrGoHomePage(final Activity activity) {
         //是否展示协议
 //        tryShowAgreement(activity, new Action1<String>() {
 //            @Override
 //            public void call(String msg) {
 //                if(msg == null || TextUtils.equals(msg, "404")) {
-                    checkLabel(activity, new Action1<BaseMessage>() {
+                    CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
                         @Override
-                        public void call(BaseMessage baseMessage) {
-                            final Intent intent = new Intent(activity, ActMain.class);
-                            activity.startActivity(intent);
-                            activity.finish();
+                        public void call(UserEntity userEntity) {
+                            if(userEntity != null && !TextUtils.isEmpty(userEntity.getShareLink())) {
+//                                GlideImageLoader.downLoadImage(userEntity.getShare_link().hashCode(), AppUtil.getQRLink(userEntity.getShare_link(), 800), null);
+//                                //PersionInfoAct.java与AskGetMoneyAct.java中分享二维码时的图片预下载
+                                Glide.with(activity)
+                                        .load(AppUtil.getQRLink(userEntity.getShareLink(), 800))
+                                        .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
+                                        .preload(800, 800);
+                            }
+
+                            if(userEntity != null && userEntity.canBindMobile()
+                                    //&& !BuildConfig.DEBUG
+                                    ){//老用户没有绑定手机号
+                                Jump2View.getInstance().goBindPhone(activity, 1);
+                                return;
+                            }
+                            checkLabel(activity, new Action1<BaseMessage>() {
+                                @Override
+                                public void call(BaseMessage baseMessage) {
+                                    goHomePageView(activity, null);
+                                    activity.finish();
+                                }
+                            });
                         }
                     });
 //                }else {
@@ -256,6 +315,7 @@ public class Jump2View {
 //        });
     }
 
+
     /**
      * 跳到手机登录页面
      * @param context
@@ -356,8 +416,6 @@ public class Jump2View {
                         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();
@@ -375,8 +433,6 @@ public class Jump2View {
                         if(context instanceof BaseActivity){
                             ((BaseActivity) context).hideProgress();
                         }
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         G.showToast(R.string.coming_soon);
                     }
                 });
@@ -399,8 +455,6 @@ public class Jump2View {
                         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(), "微信二维码辅助好友注册任务");
                     }
 
@@ -409,8 +463,6 @@ public class Jump2View {
                         if(context instanceof BaseActivity){
                             ((BaseActivity) context).hideProgress();
                         }
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });
@@ -466,17 +518,6 @@ public class Jump2View {
     }
 
     /**
-     * 跳到绑定数据页面
-     * @param context
-     * @param o
-     */
-    public void goBindDataView(Context context, Object o) {
-        Intent intent = new Intent(context, BindDataAct.class);
-        intent.putExtra("stype", Integer.valueOf(o.toString()));
-        ((Activity)context).startActivityForResult(intent, 0);
-    }
-
-    /**
      * 跳出弹框页面
      * @param context
      * @param curTask
@@ -526,13 +567,14 @@ public class Jump2View {
             intent.putExtra("is_from_task_list", true);
             activity.startActivityForResult(intent, ViewUtil.REQUEST_CODE_TASK_LIST);
     }
+
     public synchronized void goTaskDetailView(Context context, Object o, Object b){
         Intent intent = new Intent(context, TaskDetailAct.class);
         if(o instanceof Integer){
             intent.putExtra("task_id", (Integer) o);
         }
-        if(b instanceof Integer){
-            intent.putExtra("game_id", (Integer) b);
+        if(b instanceof String){
+            intent.putExtra("game_id", (String) b);
         }else
         if(b instanceof Boolean){
             intent.putExtra("btn_show", (Boolean) b);
@@ -546,8 +588,8 @@ public class Jump2View {
         if(o instanceof Integer){
             intent.putExtra("task_id", (Integer) o);
         }
-        if(b instanceof Integer){
-            intent.putExtra("game_id", (Integer) b);
+        if(b instanceof String){
+            intent.putExtra("game_id", (String) b);
         }else
         if(b instanceof Boolean){
             intent.putExtra("btn_show", (Boolean) b);
@@ -563,10 +605,11 @@ 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);}
+        context.startActivity(intent);
+        USER_TASK_RECORD.onEvent();
+    }
 
     /**
      * 跳到已提现的列表
@@ -611,6 +654,7 @@ public class Jump2View {
         Intent i = new Intent(context, PersionInfoAct.class);
         i.putExtra("info", o);
         context.startActivity(i);
+        USER_INFO.onEvent();
     }
 
 
@@ -747,16 +791,12 @@ public class Jump2View {
                         }
 
 
-                        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(baseMessage.getErrorMsg());
                     }
@@ -807,6 +847,7 @@ public class Jump2View {
     public void goMyMoney(Context context, Object o){
         Intent intent = new Intent(context, ActMyMoney.class);
         context.startActivity(intent);
+        USER_MY_MONEY.onEvent();
     }
 
     /**
@@ -823,24 +864,26 @@ public class Jump2View {
     /**
      * 跳到充值页面
      * @param context
-     * @param o
+     * @param from
      */
-    public void goRechargeAct(Context context, Object o){
+    public void goRechargeAct(Context context, String from){
         Intent intent = new Intent(context, RechargeAct.class);
         context.startActivity(intent);
+        RECHARGE.onEvent("from", from);
     }
 
     /**
      * 跳到绵羊币充值充值页面
      * @param context
-     * @param o
+     * @param from
      */
-    public void goRechargeQAct(Context context, Object o){
+    public void goRechargeQAct(Context context, String from){
         if(!SheepApp.getInstance().isShowQB()){
-            goRechargeAct(context, o);
+            goRechargeAct(context, from);
         }else {
             Intent intent = new Intent(context, RechargeQAct.class);
             context.startActivity(intent);
+            RECHARGE_QQ.onEvent("from", from);
         }
 
     }
@@ -893,6 +936,7 @@ public class Jump2View {
     public void goFeedbackAct(Context context) {
         Intent intent = new Intent(context, FeedbackAct.class);
         context.startActivity(intent);
+        USER_FEEDBACK.onEvent();
     }
 
     /**
@@ -956,7 +1000,6 @@ public class Jump2View {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                         List<Agreement> agreementList = baseMessage.getDatas(Agreement.class);
                         if(agreementList.isEmpty()){
                             if(action1 != null)
@@ -971,7 +1014,6 @@ public class Jump2View {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         if(action1 != null){
                             String msg = baseMessage.getCode() == 404 ? "404" : baseMessage.getErrorMsg();
                             action1.call(msg);
@@ -1050,7 +1092,6 @@ public class Jump2View {
                         @Override
                         public void onError(BaseMessage baseMessage) {
                             newbie_task.setVisibility(View.GONE);
-                            System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         }
                     });
         }
@@ -1150,14 +1191,12 @@ public class Jump2View {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         Advertising advertising = baseMessage.getData(Advertising.class);
                         ViewUtil.showHalfScreenAd(activity, advertising, container);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         tryShowReservation(activity);
                     }
                 });
@@ -1169,7 +1208,6 @@ public class Jump2View {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         if(baseMessage.getData() instanceof Integer){
                             if((int)baseMessage.getData() > 0){//该提示在弹窗广告后显示,且必须有可下载的游戏,弹出弹窗
                                 ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("预约下载提示")
@@ -1186,19 +1224,18 @@ public class Jump2View {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                     }
                 });
     }
 
     public void goVersionChange(final Activity activity, String currentPkgVersionName) {
+        USER_NEW_VERSION.onEvent();
         SheepApp.getInstance().getNetComponent().getApiService().getVersionInfo(currentPkgVersionName)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         VersionInfo newVersionInfo = baseMessage.getData(VersionInfo.class);
                         if(newVersionInfo != null && !TextUtils.isEmpty(newVersionInfo.getVersion_content())) {
                             goLoadH5(activity, "新功能介绍", newVersionInfo.getVersion_content());
@@ -1208,7 +1245,6 @@ public class Jump2View {
                     }
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });
@@ -1227,7 +1263,6 @@ public class Jump2View {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                         CheckUserLabel checkLabel = baseMessage.getData(CheckUserLabel.class);
                         if(
 //                                BuildConfig.DEBUG ||
@@ -1240,7 +1275,6 @@ public class Jump2View {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         if(action1 != null) {
                             action1.call(baseMessage);
                         }
@@ -1251,6 +1285,7 @@ public class Jump2View {
     public void goNewAboutUs(Activity activity) {
         Intent intent = new Intent(activity, ActNewAboutUs.class);
         activity.startActivity(intent);
+        USER_ABOUT_US.onEvent();
     }
 
     /**
@@ -1298,9 +1333,6 @@ public class Jump2View {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         final XianWanEntity xianWanEntity = baseMessage.getData(XianWanEntity.class);
-//                        Jump2View.getInstance().goXianwanWeb(context, xianWanEntity, null);
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         if(action1 != null)
                             action1.call(null);
 
@@ -1340,6 +1372,7 @@ public class Jump2View {
         intent.putExtra("id", item.getId());
         intent.putExtra("title", item.getTitle());
         activity.startActivity(intent);
+        USER_FIND_APP_ORDER.onEvent();
     }
 
     /**
@@ -1349,7 +1382,6 @@ public class Jump2View {
     public void goActReservation(Activity activity) {
         Intent intent = new Intent(activity, ActReservation.class);
         activity.startActivity(intent);
-        USER_FIND_APP_ORDER.onEvent();
     }
 
     public void tryShare(Activity activity, String shareUrlKey, String idName, int id) {
@@ -1364,4 +1396,29 @@ public class Jump2View {
             e.printStackTrace();
         }
     }
+
+    /**
+     * 游戏帐号
+     */
+    public void goGameAccount(Activity activity, Object o){
+        Intent intent = new Intent(activity, ActGameAccount.class);
+        activity.startActivity(intent);
+        USER_GAME_ACCOUNT.onEvent();
+    }
+    /**
+     * 游戏代充
+     */
+    public void goGameRecharge(Activity activity, Object o){
+        Intent intent = new Intent(activity, ActGameAgencyRecharge.class);
+        activity.startActivity(intent);
+        GAME_INSTEAD_OF_RECHARGE.onEvent();
+    }
+    /**
+     * 游戏搜索
+     */
+    public void goGameSearch(Activity activity, Object o){
+        Intent intent = new Intent(activity, ActSearchGame.class);
+        activity.startActivity(intent);
+        SEARCH_GAME.onEvent();
+    }
 }

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/util/MyDbManager.java

@@ -7,6 +7,7 @@ import com.sheep.gamegroup.model.entity.AppRecord;
 import com.sheep.gamegroup.model.entity.AppUsage;
 import com.sheep.gamegroup.model.entity.LoginUser;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
+import com.sheep.gamegroup.model.entity.SearchGameRecord;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
@@ -225,4 +226,13 @@ public class MyDbManager {
         }
         return null;
     }
+
+    public List<SearchGameRecord> getAllSearchGameRecord() {
+        try{
+            return db.selector(SearchGameRecord.class).findAll();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return ListUtil.emptyList();
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/SelfCountDownTimer.java

@@ -24,7 +24,7 @@ public abstract class SelfCountDownTimer extends CountDownTimer{
     public void reset(int full_second){
         this.cancel();
         countTime = full_second;
-
+        onTimerRest();
     }
 
     @Override

+ 7 - 4
app/src/main/java/com/sheep/gamegroup/util/SysAppUtil.java

@@ -59,6 +59,8 @@ import rx.functions.Action1;
 import rx.functions.Func1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.UPGRADE_DIALOG_BT;
+
 /**
  * Created by realicing on 2018/5/29.
  * realicing@sina.com
@@ -396,7 +398,6 @@ public class SysAppUtil {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         final Version version = baseMessage.getData(Version.class);
                         if(version == null){
                             if(ignoreMd5 == null)
@@ -458,7 +459,8 @@ public class SysAppUtil {
                                 }
                                 @Override
                                 public void onClick(final View view) {
-
+                                    if(view instanceof TextView)
+                                        UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
                                     if(file.exists()){//直接安装
                                         installApk(file);
                                     } else if(TextUtils.isEmpty(version.getAddress())){//地址错误
@@ -502,6 +504,8 @@ public class SysAppUtil {
                                     @Override
                                     public void onClick(View view) {
                                         SpUtils.saveIgnoreMd5(TestUtil.isSheep() ? version.getVersion_number()+"" : version.getMd5_address());
+                                        if(view instanceof TextView)
+                                            UPGRADE_DIALOG_BT.onEvent("action", ((TextView) view).getText());
                                     }
                                 });
                             }
@@ -511,9 +515,8 @@ public class SysAppUtil {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         if(ignoreMd5 == null)
-                            G.showToast(baseMessage);
+                            G.showToast("当前版本为最新版本,无需更新");
                         if(action1 != null)
                             action1.call(0);
                     }

+ 30 - 5
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -48,6 +48,7 @@ import java.util.List;
 import java.util.Locale;
 
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 import static com.sheep.jiuyan.samllsheep.utils.ClassFileHelper.DIR;
@@ -249,7 +250,6 @@ public class TestUtil {
                     .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                         @Override
                         public void onNext(BaseMessage baseMessage) {
-                            LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                             UserEntity userEntity = baseMessage.getData(UserEntity.class);
                             LoginEntity loginEntity = new LoginEntity();
                             loginEntity.setToken(token);
@@ -259,7 +259,6 @@ public class TestUtil {
 
                         @Override
                         public void onError(BaseMessage baseMessage) {
-                            LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                             G.showToast(baseMessage);
                         }
                     });
@@ -284,8 +283,9 @@ public class TestUtil {
      * @param activity
      */
     public static void test(final Activity activity) {
-        final String[] items = {"尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况","开启第三方应用使用情况","h5跳转","新手对话框","md5","空间不足提示框",
-                "显示已经安装应用列表","复制token","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试",
+        final String[] items = {"测试可用金额","复制token","复制打点数据","游戏搜索","游戏帐号","游戏代充","尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况",
+                "开启第三方应用使用情况","h5跳转","新手对话框","md5","空间不足提示框",
+                "显示已经安装应用列表","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试",
                 "浦发银行信用卡测试", "测试游戏模块","打卡成功提示","定向货币详情","进入绑定身份认证界面时的提示","提交身份认证时的提示", "检查标签",
                 "友盟分享", "了解小绵羊", "提现成功"};
         AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择测试项目")
@@ -294,8 +294,33 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "测试可用金额":
+                                CommonUtil.getInstance()
+                                        .getVoucherAndRatio(activity, 115+"", new Action1<BaseMessage>() {
+                                            @Override
+                                            public void call(BaseMessage baseMessage) {
+
+                                            }
+                                        });
+                                break;
+                            case "游戏帐号":
+                                Jump2View.getInstance().goGameAccount(activity, "http://10.8.210.172:8081/#/?authorization=123123");
+                                break;
+                            case "游戏代充":
+                                Jump2View.getInstance().goGameRecharge(activity, "http://10.8.210.172:8081/#/?authorization=123123");
+                                break;
+                            case "复制打点数据":
+                                UMConfigUtils.copyDaDianData();
+                                break;
+                            case "游戏搜索":
+                                Jump2View.getInstance().goGameSearch(activity, null);
+                                break;
                             case "测试代理页面":
-                                Jump2View.getInstance().goWeb(activity, "http://10.8.210.172:8081/#/?authorization=123123", "代理服务");
+                                Object url_config1 = ACache.get(SheepApp.getInstance()).getAsObject("url_config");
+                                if(url_config1 instanceof JSONObject) {
+                                    String url = ((JSONObject) url_config1).getString("agenturl");
+                                    Jump2View.getInstance().goWeb(activity, url, "代理服务");
+                                }
                                 break;
                             case "尝试开启第三方应用使用情况":
                                 AppUsageManager.getInstance().tryOpenLookAppUsageStatsPermisson(false);

+ 234 - 163
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -9,16 +9,18 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.statistics.AppStatistics;
 import com.sheep.gamegroup.statistics.AppStatisticsConfig;
-import com.sheep.jiuyan.samllsheep.BuildConfig;
+import com.sheep.gamegroup.view.activity.ChangeTelAct;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-//import com.umeng.analytics.MobclickAgent;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
+//import com.umeng.analytics.MobclickAgent;
+
 /**
  * Created by zhanghai on 2018/3/30.
  */
@@ -27,99 +29,152 @@ public class UMConfigUtils {
 
     public static final String LOGIN_TYPE = "sheep_login_type";
     public static final String LOGIN_OPENID = "sheep_login_openid";
+
     //统计点击次数需要的子subtype
-    public enum  Event{
-        GAME_DOWNLOAD                        ("GameDownload"),//游戏下载次数 5001
-        BANNER_CLICK_HORIZONTAL              ("BannerClickHorizontal"),//轮播图 广告点击次数 5002
-        TAB_GAME                             ,//主页tab中的游戏页签 5003 注:!!!!!界面已经没有显示了!!!!!
-        TAB_CATEGORY                         , //主页tab中的分类页签 5004 注:!!!!!界面已经没有显示了!!!!!
-        TAB_SHEEP                            ,//主页tab中的小绵羊页签 5005
-        TAB_JIEZHEWAN                        ,//主页tab中的借着玩页签 5006 注:!!!!!界面已经没有显示了!!!!!
-        TAB_CREDITCARD                       ,//信用卡页签 5007 注:!!!!!界面已经没有显示了!!!!!
-        SHEEP_TASK_TRY                       ,//试玩赚钱 5008
-        SHEEP_TASK_INVITE                    ,//邀请赚钱 5009
-        SHEEP_TASK_LIE                       ,//躺着赚钱 5010
-        SHEEP_TIXIAN                         ,//提现 5011
-        TASK_DETAIL                          ,//任务详情 5012
-        TASK_DOWNLOAD                        ,//任务详情中->下载游戏 5013
-        TASK_UPLOAD_PICTURE                  ,//任务详情中->上传截图 5014
-        USER_ACCOUNT_SAFE                    ,//个人中心 -> 账号安全 5015
-        USER_TASK_RECORD                     ,//个人中心 -> 任务记录 5016
-        USER_TIXIAN_DETAIL                   ,//个人中心 -> 提现明细 5017
-        USER_BIND_PHONE                      ,//账号安全 -> 绑定手机号(确定按钮)5018
-        USER_BIND_WEIXIN                     ,//账号安全 -> 绑定微信号(立即绑定按钮) 5019
-        USER_AUTHENTICATION                  ,//账号安全 -> 实名认证(提交按钮)5020
-        USER_LOGOUT                          ,//账号安全 -> 退出登录按钮 5021
-        GAME_SEARCH                          ,//搜索界面-> 搜索按钮 5022
-        GAME_DOWNLOAD_MANAGER                ,//主界面右上角 -> 下载管理按钮 5023
-        TASK_ACCEPT                          ,//接取任务 5024
-        SHEEP_NEWBIE_TASK_LIST               ,//新手任务列表界面,(界面已经修改为对话框了) 5025
-        SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP   ,//一分钟了解小绵羊界面 5026
-        SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG  ,//注册小绵羊成功对话框 5027
-        SHEEP_NEWBIE_TASK_LIST_DIALOG        ,//新手任务列表对话框 5028
-        SHEEP_NEWBIE_TASK_ADD_QQ             ,//加入官方QQ群任务 5029
-        SHEEP_CREDIT_CARD                    ,//信用卡任务列表界面 5030
-        SHEEP_CREDIT_CARD_ACCEPT_LIST        ,//信用卡任务列表界面 -> 信用卡任务接受列表 5031
-        SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST       ,//信用卡任务列表界面 ->信用卡任务进度查询列表 5032
-        SHEEP_CREDIT_CARD_DETAIL                    ,//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 5033
-        SHEEP_CREDIT_CARD_DETAIL_WEB                ,//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 -> 申请信用卡web界面 5034
-        SHEEP_CREDIT_CARD_PROGRESS_QUERY            ,//信用卡任务列表界面 ->信用卡任务进度查询列表 -> 信用卡任务进度查询 5035
-        TASK_START_APP            ,//打开任务应用或游戏 5036
-        TASK_INSTALL_APP            ,//安装应用 5037
-        SHEEP_START            ,//启动小绵羊 5038
-        SHEEP_RESUME            ,//小绵羊进入前台 5039
-        SHEEP_PAUSE            ,//小绵羊进入后台 5040
-        SHEEP_STOP            ,//退出小绵羊 5041
-        PUNCH            ,//点击打卡赚钱 5042
-        PUNCH_SIGN_UP            ,//点击报名 5043
-        PUNCH_PUNCH            ,//点击打卡 5044
-        PUNCH_RECORD            ,//点击战绩 5045
-        PUNCH_RANKING_LIST            ,//点击本月排行榜 5046
-        PUNCH_ACCUMULATIVE_LIST            ,//选择累计打卡 5047
-        PUNCH_CONTINUATION           ,//选择连续打卡 5048
-        SHEEP_TIXIAN_COMMIT           ,//点击 提现提交按钮 5049
-        SHEEP_SEQUENTIAL_TASK           ,//点击进入连续任务界面 5050
-        SHEEP_GAME_TASK           ,//点击进入游戏任务界面 5051
-        XIANWAN_WEBVIEW           ,//闲玩 5052
-        ORDER_MANAGER           ,//订单管理 5053
-        USER_AUTHENTICATION_ENTER           ,//进入实名认证界面 5054
-        TAB_USER           ,//点击主页tab中的个人中心模块 5055
-        TAB_FIND           ,//点击主页tab中的发现模块 5056
-        FIND_TAG           ,//点击发现模块上面的标签 5057 需要传标签id到substring中,如:{"find_tag_name": "全部}
-        FIND_ITEM           ,//点击发现模块中列表里面的一个单项 5058 需要传发现项的id到substring中,如:{"find_id": 1}
-        FIND_APP           ,//点击下载或者预约、取消预约等 发现模块中的一个游戏或者应用 5059 需要传发现App的id和操作到substring中,如:{"application_id": 1, "action", "开始下载"}
-        FIND_SHARE           ,//点击发现详情中的分享 5060 需要传发现项的id或者application_id到substring中,如:{"find_id": 1}或{"application_id": 1}
-        FIND_TASK           ,//领取任务或者取消任务 5061 需要传任务的id和操作到substring中,如:{"release_task_id":1,"action":"领取任务"}或{"release_task_id":1,"action":"取消任务"}
-        FIND_SCORE           ,//评分或者重新评分 5062 需要传发现app的id到substring中,如:{"application_id": 1}
-        USER_FIND_APP_ORDER           ,//点击个人中心中的游戏预约 5063
-        MY_MONEY_TAB           ,//点击我的资产中的tab 5064 需要传点击的tab对应的名字:充值记录、提现记录、收支明细,如:{"tab_name": "充值记录"}或{"tab_name": "提现记录"}或{"tab_name": "收支明细"}
-        NEWBIE_TASK           ,//点击新手任务图标 5065
+    public enum Event {
+        GAME_DOWNLOAD("游戏下载次数"),// 5001
+        BANNER_CLICK_HORIZONTAL("轮播图 广告点击次数"),// 5002
+        TAB_GAME("主页tab中的游戏页签  注:!!!!!界面已经没有显示了!!!!!"),//5003
+        TAB_CATEGORY("主页tab中的分类页签  注:!!!!!界面已经没有显示了!!!!!"),//5004
+        TAB_SHEEP("主页tab中的小绵羊页签 "),//5005
+        TAB_JIEZHEWAN("主页tab中的借着玩页签  注:!!!!!界面已经没有显示了!!!!!"),//5006
+        TAB_CREDITCARD("信用卡页签 注:!!!!!界面已经没有显示了!!!!!"),//5007
+        SHEEP_TASK_TRY("试玩赚钱"),//5008
+        SHEEP_TASK_INVITE("邀请赚钱"),//5009
+        SHEEP_TASK_LIE("躺着赚钱"),//5010
+        SHEEP_TIXIAN("提现"),//5011
+        TASK_DETAIL("任务详情"),//5012
+        TASK_DOWNLOAD("任务详情中->下载游戏"),//5013
+        TASK_UPLOAD_PICTURE("任务详情中->上传截图"),//5014
+        USER_ACCOUNT_SAFE("个人中心 -> 账号安全"),//5015
+        USER_TASK_RECORD("个人中心 -> 任务记录"),//5016
+        USER_TIXIAN_DETAIL("个人中心 -> 提现明细"),//5017
+        USER_BIND_PHONE("账号安全 -> 绑定手机号(确定按钮"),//5018
+        USER_BIND_WEIXIN("账号安全 -> 绑定微信号(立即绑定按钮)"),//5019
+        USER_AUTHENTICATION("账号安全 -> 实名认证(提交按钮)"),//5020
+        USER_LOGOUT("账号安全 -> 退出登录按钮"),//5021
+        GAME_SEARCH("游戏模块 -> 搜索界面-> 搜索按钮"),//5022
+        GAME_DOWNLOAD_MANAGER("主界面右上角 -> 下载管理按钮"),//5023
+        TASK_ACCEPT("接取任务"),//5024
+        SHEEP_NEWBIE_TASK_LIST("新手任务列表界面,(界面已经修改为对话框了)"),//5025
+        SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP("一分钟了解小绵羊界面"),//5026
+        SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG("注册小绵羊成功对话框"),//5027
+        SHEEP_NEWBIE_TASK_LIST_DIALOG("新手任务列表对话框"),//5028
+        SHEEP_NEWBIE_TASK_ADD_QQ("加入官方QQ群任务"),//5029
+        SHEEP_CREDIT_CARD("信用卡任务列表界面"),//5030
+        SHEEP_CREDIT_CARD_ACCEPT_LIST("信用卡任务列表界面 -> 信用卡任务接受列表"),//5031
+        SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST("信用卡任务列表界面 ->信用卡任务进度查询列表"),//5032
+        SHEEP_CREDIT_CARD_DETAIL("信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面"),//5033
+        SHEEP_CREDIT_CARD_DETAIL_WEB("信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 -> 申请信用卡web界面"),//5034
+        SHEEP_CREDIT_CARD_PROGRESS_QUERY("信用卡任务列表界面 ->信用卡任务进度查询列表 -> 信用卡任务进度查询"),//5035
+        TASK_START_APP("打开任务应用或游戏"),//5036
+        TASK_INSTALL_APP("安装应用"),//5037
+        SHEEP_START("启动小绵羊"),//5038
+        SHEEP_RESUME("小绵羊进入前台"),//5039
+        SHEEP_PAUSE("小绵羊进入后台"),//5040
+        SHEEP_STOP("退出小绵羊"),//5041
+        PUNCH("点击打卡赚钱"),//5042
+        PUNCH_SIGN_UP("点击报名"),//5043
+        PUNCH_PUNCH("点击打卡"),//5044
+        PUNCH_RECORD("点击战绩"),//5045
+        PUNCH_RANKING_LIST("点击本月排行榜"),//5046
+        PUNCH_ACCUMULATIVE_LIST("选择累计打卡"),//5047
+        PUNCH_CONTINUATION("选择连续打卡"),//5048
+        SHEEP_TIXIAN_COMMIT("点击 提现提交按钮"),//5049
+        SHEEP_SEQUENTIAL_TASK("点击进入连续任务界面"),//5050
+        SHEEP_GAME_TASK("点击进入游戏任务界面"),//5051
+        XIANWAN_WEBVIEW("闲玩"),//5052
+        ORDER_MANAGER("订单管理"),//5053
+        USER_AUTHENTICATION_ENTER("进入实名认证界面"),//5054
+        TAB_USER("点击主页tab中的个人中心模块"),//5055
+        TAB_FIND("点击主页tab中的发现模块"),//5056
+        FIND_TAG("点击发现模块上面的标签 需要传标签id到substring中,如:{\"find_tag_name\": \"全部\"}"),//5057
+        FIND_ITEM("点击发现模块中列表里面的一个单项 需要传发现项的id到substring中,如:{\"find_id\": 1}"),//5058
+        FIND_APP("点击下载或者预约、取消预约等 发现模块中的一个游戏或者应用  需要传发现App的id和操作到substring中,如:{\"application_id\": 1, \"action\", \"开始下载\"}"),//5059
+        FIND_SHARE("点击发现详情中的分享 需要传发现项的id或者application_id到substring中,如:{\"find_id\": 1}或{\"application_id\": 1}"),//5060
+        FIND_TASK("领取任务或者取消任务 需要传任务的id和操作到substring中,如:{\"release_task_id\":1,\"action\":\"领取任务\"}或{\"release_task_id\":1,\"action\":\"取消任务\"}"),//5061
+        FIND_SCORE("评分或者重新评分 需要传发现app的id到substring中,如:{\"application_id\": 1}"),//5062
+        USER_FIND_APP_ORDER("点击个人中心中的游戏预约"),//5063
+        MY_MONEY_TAB("点击我的资产中的tab 需要传点击的tab对应的名字:充值记录、提现记录、收支明细,如:{\"tab_name\": \"充值记录\"}或{\"tab_name\": \"提现记录\"}或{\"tab_name\": \"收支明细\"}"),//5064
+        NEWBIE_TASK("点击新手任务图标"),//5065
+        AD_SPLASH("点击开屏广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5066
+        AD_TOAST("点击弹窗广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5067
+        LOGIN_PHONE("点击登录界面中的手机号登录"),//5068
+        LOGIN_QQ("点击登录界面中的QQ登录"),//5069
+        LOGIN_WX("点击登录界面中的微信登录"),//5070
+        USER_INFO("个人中心 -> 个人资料"),//5071
+        USER_MY_MONEY("个人中心 -> 我的资产"),//5072
+        USER_AGENT("个人中心 -> 代理"),//5073
+        USER_FAQ("个人中心 -> FAQ帮助"),//5074
+        USER_ABOUT_US("个人中心 -> 关于我们"),//5075
+        USER_FEEDBACK("个人中心 -> 意见反馈"),//5076
+        USER_SHARE("个人中心 -> 推荐给好友"),//5077
+        USER_UPGRADE("个人中心 -> 版本更新"),//5078
+        USER_CLEAN("个人中心 -> 清除缓存"),//5079
+        USER_CLEAN_SURE("个人中心 -> 清除缓存 -> 确认"),//5080
+        USER_NEW_VERSION("个人中心 -> 新功能介绍"),//5081
+        USER_GAME_ACCOUNT("个人中心 -> 游戏账号"),//5082
+        GAME_INSTEAD_OF_RECHARGE("主页 -> 游戏代充"),//5083
+        UPGRADE_DIALOG_BT("升级对话框 -> 立即安装、立即更新、下次更新 需要传对应操作到substring中,如:{\"action\":\"立即安装\"}或者{\"action\":\"立即更新\"}或者{\"action\":\"下次更新\"}"),//5084
+        RECHARGE("充值 需要传来源到substring中,如:{\"from\":\"我的资产\"}或者{\"from\":\"首页\"}或者{\"from\":\"我的资产\"}或者{\"from\":\"内部H5\"}或者{\"from\":\"推送\"}或者{\"from\":\"充值Q币\"}"),//5085
+        RECHARGE_PAY("充值 -> 立即支付"),//5086
+        RECHARGE_QQ("充值Q币 需要传来源到substring中,如:{\"from\":\"发现\"}或者{\"from\":\"首页\"}或者{\"from\":\"推送\"}"),//5087
+        RECHARGE_QQ_PAY("充值Q币 -> 立即支付"),//5088
+        USER_INFO_AVATAR("个人中心 -> 个人资料 -> 头像"),//5089
+        USER_INFO_NAME("个人中心 -> 个人资料 -> 昵称"),//5090
+        USER_INFO_NAME_MODIFY("个人中心 -> 个人资料 -> 昵称 -> 确认修改"),//5091
+        QR_SHARE("我的二维码"),//5092
+        QR_SAVE("保存二维码至手机"),//5093
+        QR_COPY("复制二维码链接"),//5094
+        LINK_SHARE("分享链接"),//5095
+        BIND_WX("绑定微信"),//5096
+        BIND_PHONE("绑定手机号"),//5097
+        SHARE_TO_WX("分享到微信"),//5098
+        SHARE_TO_QQ("分享到QQ"),//5099
+        USER_FEEDBACK_COMMIT("个人中心 -> 意见反馈 -> 提交建议"),//5100
+        SEARCH_GAME("游戏代充模块 -> 搜索游戏"),//5101
+        SEARCH_GAME_COMMIT("游戏代充模块 -> 搜索游戏 -> 点击搜索按钮"),//5102
+        GAME_INSTEAD_OF_RECHARGE_HELP("游戏代充模块 -> 点击帮助图标"),//5103
+        GAME_INSTEAD_OF_RECHARGE_TAB("游戏代充模块 -> 点击上面的平台进行切换 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5104
+        GAME_INSTEAD_OF_RECHARGE_PLATFORM("游戏代充模块 -> 点击平台充值按钮 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5105
+        GAME_INSTEAD_OF_RECHARGE_GAME("游戏代充模块 -> 点击立即充值"),//5106
+        GAME_INSTEAD_OF_RECHARGE_PAY("游戏代充模块 -> 点击立即充值 -> 点击立即支付"),//5107
+        GAME_INSTEAD_OF_RECHARGE_GET("游戏代充模块 -> 点击领取游戏账号"),//5108
+        USER_GAME_ACCOUNT_ADD("个人中心 -> 游戏账号 -> 点击添加图标"),//5109
+        USER_GAME_ACCOUNT_ADD_COMMIT("个人中心 -> 游戏账号 -> 点击添加图标 -> 提交"),//5110
+        USER_GAME_ACCOUNT_LOOK("个人中心 -> 游戏账号 -> 点击游戏账号中的查看"),//5111
+        USER_GAME_ACCOUNT_LOOK_MODIFY("个人中心 -> 游戏账号 -> 点击游戏账号中的查看 -> 点击修改"),//5112
+        USER_GAME_ACCOUNT_LOOK_MODIFY_COMMIT("个人中心 -> 游戏账号 -> 点击游戏账号中的查看 -> 点击修改 -> 立即修改"),//5113
+        USER_GAME_ACCOUNT_DEL("个人中心 -> 游戏账号 -> 点击游戏账号中的删除"),//5114
+        USER_GAME_ACCOUNT_DEL_COMMIT("个人中心 -> 游戏账号 -> 点击游戏账号中的删除 -> 确认删除"),//5115
         ;
-        private String key;
-        Event(String key){
-            this.key = key;
-        }
-        Event(){
-            this.key = name().toLowerCase();
+        private String tag;
+
+        Event(String tag) {
+            this.tag = tag;
         }
 
-        public String getKey() {
-            return key;
+        public String getTag() {
+            return tag;
         }
 
-        public void setKey(String key) {
-            this.key = key;
+        public void setTag(String tag) {
+            this.tag = tag;
         }
-        public int getId(){
-            return ordinal()+5001;
+
+        public int getId() {
+            return ordinal() + 5001;
         }
-        public void onEvent(){
+
+        public void onEvent() {
             UMConfigUtils.onEvent(this);
         }
-        public void onEvent(Map<String, String> map){
+
+        public void onEvent(Map<String, String> map) {
             UMConfigUtils.onEvent(this, map);
         }
-        public void onEvent(Object...items){
+
+        public void onEvent(Object... items) {
             Map<String, String> map = new HashMap<>();
             for (int i = 0; i < items.length; ) {
                 map.put(items[i].toString(), items[i + 1].toString());
@@ -128,48 +183,58 @@ public class UMConfigUtils {
             UMConfigUtils.onEvent(this, map);
         }
 
-        public static void println() {
+        @Override
+        public String toString() {
+            return String.format(Locale.CHINA, "%d\t%s", getId(), getTag());
+        }
+
+        public static String allToString() {
+            StringBuilder stringBuilder = new StringBuilder("subtype\t说明\t\ttype为5000\n");
             Event[] items = Event.values();
             for (int i = 0; i < items.length; i++) {
                 Event event = items[i];
-                LogUtil.println("打点Event", i, event.getKey(), event.getId());
+                if(i != 0)
+                    stringBuilder.append("\n");
+                stringBuilder.append(event.toString());
             }
+            return stringBuilder.toString();
         }
     }
-    static {
-        if(BuildConfig.DEBUG)
-            Event.println();
+
+    public static void copyDaDianData() {
+        StringUtils.CopyText(SheepApp.getInstance(), Event.allToString());
     }
 
-    public enum IdEvent{
+    public enum IdEvent {
         HOME_LIST,//id 1 首页功能列表
         BANNER(),//id 2 首页轮播图
         TASK(),//id 3   任务列表
         ;
-        private int getType(){
-            return ordinal()+1;
+
+        private int getType() {
+            return ordinal() + 1;
         }
-        synchronized public void commit(int click_id){
+
+        synchronized public void commit(int click_id) {
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("click_id", click_id);
             jsonObject.put("type", getType());
             SheepApp.getInstance().getNetComponent().getApiService().commitIdEvent(jsonObject)
-                            .subscribeOn(Schedulers.io())
-                            .observeOn(AndroidSchedulers.mainThread())
-                            .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                                @Override
-                                public void onNext(BaseMessage baseMessage) {
-                                    LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
-                                }
-
-                                @Override
-                                public void onError(BaseMessage baseMessage) {
-                                    LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
-                                }
-                            });
+                    .subscribeOn(Schedulers.io())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                        }
+
+                        @Override
+                        public void onError(BaseMessage baseMessage) {
+                        }
+                    });
         }
     }
-    public static class Source{
+
+    public static class Source {
         public static final String QQ = "QQ";
         public static final String WECHAT = "wechat";
         public static final String SHEEP = "sheep";
@@ -179,56 +244,54 @@ public class UMConfigUtils {
      * 用户信息统计
      * 登录
      */
-    public static void onProfileSignIn(){
-        String source = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_TYPE,Source.SHEEP);
-        String openid = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_OPENID,"");
-
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onProfileSignIn(source,openid);
-
+    public static void onProfileSignIn() {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
         //自己的统计信息
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signIn,"");
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signIn, "");
     }
 
     /**
      * 登出
      */
-    public static void onProfileSignOff(){
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onProfileSignOff();
-
+    public static void onProfileSignOff() {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
         //自己的统计退出
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signOff,"");
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signOff, "");
     }
 
 
     /**
      * Umeng事件统计
+     *
      * @param event
      */
-    public static void onEvent(Event event){
-        LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
-        try{
-//            if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//                MobclickAgent.onEvent(SheepApp.mContext,event.getKey());
-
-            AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(),"");
-        }catch (Exception e){
+    public static void onEvent(Event event) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
+        try {
+            AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), "");
+        } catch (Exception e) {
             e.printStackTrace();
         }
     }
+
     /**
      * Umeng事件统计
+     *
      * @param event
      */
-    public static void onEvent(Event event, Map<String, String> map){
-        LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
-        try{
-//            if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//                MobclickAgent.onEvent(SheepApp.mContext,event.getKey(), map);
-
+    public static void onEvent(Event event, Map<String, String> map) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
+        try {
             AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), JSON.toJSONString(map));
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
     }
@@ -236,72 +299,80 @@ public class UMConfigUtils {
 
     /**
      * 页面开始
+     *
      * @param context
      */
-    public static void onPageStart(Context context){
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onResume(context);
-
+    public static void onPageStart(Context context) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
         String tag = context.getClass().getCanonicalName();
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START,0,tag);
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START, 0, tag);
     }
 
     /**
      * 页面开始
+     *
      * @param tag
      */
-    public static void onPageStart(String tag){
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onPageStart(tag);
-
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START,0,tag);
+    public static void onPageStart(String tag) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START, 0, tag);
     }
 
     /**
      * 页面结束
+     *
      * @param context
      */
-    public static void onPageEnd(Context context){
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onPause(context);
-
+    public static void onPageEnd(Context context) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
         String tag = context.getClass().getCanonicalName();
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END,0,tag);
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END, 0, tag);
     }
 
     /**
      * 页面结束
+     *
      * @param tag
      */
-    public static void onPageEnd(String tag){
-//        if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
-//            MobclickAgent.onPageEnd(tag);
-
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END,0,tag);
+    public static void onPageEnd(String tag) {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END, 0, tag);
     }
 
     /**
      * 任务完成时间统计
      */
-    public static void finishTask(){
-        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.TASK_FINISH,0,"");
+    public static void finishTask() {
+        if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
+            return;
+        }
+        AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.TASK_FINISH, 0, "");
     }
 
 
     /**
      * 当Fragment对用户的可见性发生了改变的时候就会回调此方法
-     * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
+     *
+     * @param isVisibleToUser                      true:用户能看见当前Fragment;false:用户看不见当前Fragment
      * @param isHappenedInSetUserVisibleHintMethod true:本次回调发生在setUserVisibleHintMethod方法里;false:发生在onResume或onPause方法里
-     * @param tag fragment 名字
+     * @param tag                                  fragment 名字
      */
-    public static void onVisibilityChangedToUser(boolean isVisibleToUser, boolean isHappenedInSetUserVisibleHintMethod,String tag){
-        if(isVisibleToUser){
-            if(tag != null){
+    public static void onVisibilityChangedToUser(boolean isVisibleToUser, boolean isHappenedInSetUserVisibleHintMethod, String tag) {
+        if (isVisibleToUser) {
+            if (tag != null) {
                 //umeng fragment
                 UMConfigUtils.onPageStart(tag);
             }
-        }else{
-            if(tag != null){
+        } else {
+            if (tag != null) {
                 UMConfigUtils.onPageEnd(tag);
             }
         }

+ 53 - 8
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -25,19 +25,20 @@ import android.widget.TextView;
 import android.widget.VideoView;
 
 import com.bumptech.glide.Glide;
-import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestOptions;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.view.activity.SplashAct;
+import com.sheep.gamegroup.view.dialog.DialogAddAccount;
+import com.sheep.gamegroup.view.dialog.DialogModifyAccount;
 import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
 import com.sheep.gamegroup.view.dialog.DialogPayAccount;
 import com.sheep.gamegroup.view.dialog.DialogPayGame;
 import com.sheep.gamegroup.view.dialog.DialogShare;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
@@ -50,6 +51,11 @@ import java.util.Map;
 
 import rx.functions.Action1;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.AD_TOAST;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_SAVE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_SHARE;
+
 /**
  * Created by realicing on 2018/5/11.
  * realicing@sina.com
@@ -66,6 +72,7 @@ public class ViewUtil {
     }
 
     public static void showQR(final Activity activity, String link) {
+        QR_SHARE.onEvent();
         View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
         final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
                 .setView(dialog_parent)
@@ -83,6 +90,13 @@ public class ViewUtil {
                 .load(AppUtil.getQRLink(link, 800))
                 .apply(new RequestOptions().override(800, 800))
                 .into(iv_qr);
+//        GlideImageLoader.downLoadImage(link.hashCode() + "", AppUtil.getQRLink(link, 800), new Action1<File>() {
+//            @Override
+//            public void call(File file) {
+//                if(file != null)
+//                    Glide.with(SheepApp.getInstance()).load(file).into(iv_qr);
+//            }
+//        });
         Glide.with(activity)
                 .load(R.drawable.icon)
                 .apply(new RequestOptions().override(G.WIDTH / 8))
@@ -97,7 +111,7 @@ public class ViewUtil {
         save_pic.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-
+                QR_SAVE.onEvent();
                 File file = ViewUtil.saveImage((View) iv_qr.getParent(), ClassFileHelper.DIR, System.currentTimeMillis() + ".jpg");
                 if (file != null) {
                     Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
@@ -157,6 +171,7 @@ public class ViewUtil {
         withdrawal.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
+                QR_COPY.onEvent();
                 StringUtils.CopyText(activity, link);
                 G.showToast("复制链接成功");
             }
@@ -165,7 +180,7 @@ public class ViewUtil {
         save_pic.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-
+                QR_SAVE.onEvent();
                 File file = ViewUtil.saveImage((View) iv_qr.getParent(), ClassFileHelper.DIR, System.currentTimeMillis() + ".jpg");
                 if (file != null) {
                     Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
@@ -559,6 +574,7 @@ public class ViewUtil {
                 @Override
                 public void onClick(View view) {
                     SplashAct.goAdLink(activity, advertising);
+                    AD_TOAST.onEvent("ad_id", advertising.getId());
                     dialog.dismiss();
                 }
             });
@@ -591,13 +607,27 @@ public class ViewUtil {
     /**
      * game 充值
      */
-    public static void showGamePayAccount(Activity activity,int gameId){
-        new DialogPayAccount(activity,gameId).showPayaccount();
+    public static void showGamePayAccount(Activity activity,String gameId, String gameName){
+        PayEntity payEntity = new PayEntity();
+        payEntity.setGame_id(gameId);
+        payEntity.setGame_name(gameName);
+        newInstance().showGamePayAccount(activity,payEntity);
+    }
+    public void showGamePayAccount(Activity activity,PayEntity payEntity){
+        new DialogPayAccount(activity,payEntity).showPayaccount();
+    }
+    public static void showGamePay(Activity activity, PayEntity payEntity){
+        new DialogPayGame(activity, payEntity).showPayGame();
     }
-    public static void showGamePay(Activity activity, String game_account_etStr, String game_pay_etStr,int gameId){
-        new DialogPayGame(activity, game_account_etStr, game_pay_etStr,gameId).showPayGame();
+
+    /**
+     * 用户详情
+     */
+    public void showGameAccountDetail(Activity activity, int id){
+        new DialogModifyAccount(activity, id).showAddAccount();
     }
 
+
     /**
      * 分享
      * @param activity
@@ -607,6 +637,14 @@ public class ViewUtil {
         new DialogShare(activity, url).showShare();
     }
 
+    public static void centerImage(ImageView imageView, String pictures) {
+        if(imageView != null && !TextUtils.isEmpty(pictures)){
+            if(pictures.contains(";")){
+                pictures = pictures.split(";")[0];
+            }
+            GlideImageLoader.centerImage(imageView, pictures);
+        }
+    }
     public static void setImage(ImageView imageView, String pictures) {
         if(imageView != null && !TextUtils.isEmpty(pictures)){
             if(pictures.contains(";")){
@@ -712,4 +750,11 @@ public class ViewUtil {
 
     }
 
+    /**
+     * 添加游戏账户
+     */
+    public void showAddAccount(Activity activity, Action1<Integer> action1){
+        new DialogAddAccount(activity).showAddAccount(action1);
+    }
+
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/WebviewJs.java

@@ -109,7 +109,7 @@ public class WebviewJs {
     }
     @JavascriptInterface
     public void gotoRecharge() {
-        Jump2View.getInstance().goRechargeAct(activity, null);//进入充值绵羊币界面
+        Jump2View.getInstance().goRechargeAct(activity, "内部H5");//进入充值绵羊币界面
     }
 
     @JavascriptInterface

+ 6 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java

@@ -38,6 +38,10 @@ import javax.inject.Inject;
 import butterknife.BindView;
 import butterknife.OnClick;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_PHONE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.BIND_WX;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO;
+
 /**
  * Created by Administrator on 2018/3/16.
  */
@@ -152,6 +156,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
         switch (view.getId()) {
             case R.id.rl_phone:   //跳转到绑定手机号
                 Jump2View.getInstance().goBindPhone(activity, null);
+                BIND_PHONE.onEvent();
                 break;
             case R.id.rl_wx:  ////跳转到微信
                 if(mEntity == null){
@@ -161,6 +166,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
                 } else {
                     G.showToast("您已经绑定微信");
                 }
+                BIND_WX.onEvent();
                 break;
             case R.id.rl_auther: ////跳转授权
                 Jump2View.getInstance().goRealNameAuther(AccountAndSecurityAct.this,mEntity, 0);

+ 0 - 8
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindGame.java

@@ -207,7 +207,6 @@ public class ActFindGame extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(this) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         FindApp findApp = baseMessage.getData(FindApp.class);
                         if (findApp != null) {
                             loadData(findApp);
@@ -221,7 +220,6 @@ public class ActFindGame extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                         resetData();
                         hideProgress();
@@ -246,7 +244,6 @@ public class ActFindGame extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         List<FindAppScore> findAppScoreList = baseMessage.getDataList(FindAppScore.class);
                         if (ListUtil.isEmpty(findAppScoreList))
                             resetAppScoreNum();
@@ -256,7 +253,6 @@ public class ActFindGame extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });
@@ -269,7 +265,6 @@ public class ActFindGame extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         MyFindAppCore myFindAppCore = baseMessage.getData(MyFindAppCore.class);
                         if (myFindAppCore == null)
                             resetMyAppScore();
@@ -279,7 +274,6 @@ public class ActFindGame extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                     }
                 });
     }
@@ -455,7 +449,6 @@ public class ActFindGame extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         find_game_user_commit_tv.setText("重新评分");
                         G.showToast(baseMessage);
                         //更新评分与我的评分
@@ -465,7 +458,6 @@ public class ActFindGame extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActFindInformation.java

@@ -218,7 +218,6 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                                 FindItem data = baseMessage.getData(FindItem.class);
                                 if(data != null && !TextUtils.equals(JSON.toJSONString(findItem), JSON.toJSONString(data))){
                                     taskHelper.clear();
@@ -240,7 +239,6 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 taskHelper.clear();
                                 notifyDataSetChanged();
                             }
@@ -255,14 +253,12 @@ public class ActFindInformation extends BaseActivity implements Action1<Integer>
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                 findApp = baseMessage.getData(FindApp.class);
                                 notifyDataSetChanged();
                             }
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 G.showToast(baseMessage);
                                 refresh.setRefreshing(false);
                             }

+ 199 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAccount.java

@@ -0,0 +1,199 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import com.kfzs.duanduan.event.BigEvent;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameAccountSuper;
+import com.sheep.gamegroup.model.entity.RecyleObj;
+import com.sheep.gamegroup.model.entity.RecyleType;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdpGameAccount;
+import com.sheep.gamegroup.view.customview.SheepmSwipeRefreshLayout;
+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.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT_ADD;
+
+/**
+ * 游戏账号
+ * Created by ljy on 2018/7/9.
+ */
+
+public class ActGameAccount extends BaseActivity {
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerview;
+    @BindView(R.id.refresh)
+    SheepmSwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    private Activity activity;
+
+    private AdpGameAccount adpGameAccount;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_game_account_layout;
+    }
+
+    @Override
+    public void initView() {
+        EventBus.getDefault().register(this);
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitleFinish(activity)
+                .setTitle(activity, "游戏账号")
+                .setRightImgBotton(activity,
+                        R.mipmap.add_black_img,
+                        new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                ViewUtil.newInstance().showAddAccount(activity, new Action1<Integer>() {
+                                    @Override
+                                    public void call(Integer integer) {
+                                        initData();
+                                    }
+                                });
+                                USER_GAME_ACCOUNT_ADD.onEvent();
+                            }
+                        });
+
+        recyclerview.setLayoutManager(new LinearLayoutManager(activity));
+        adpGameAccount = new AdpGameAccount(activity);
+        for (int i = 0; i < 3; i++) {
+            adpGameAccount.add(RecyleObj.make(RecyleType.NONE, null));
+        }
+        recyclerview.setAdapter(adpGameAccount);
+    }
+
+    @Override
+    public void initListener() {
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+            }
+        });
+        recyclerview.addOnScrollListener(new RecyclerView.OnScrollListener() {
+            @Override
+            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+                super.onScrollStateChanged(recyclerView, newState);
+            }
+
+            @Override
+            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+
+                int topRowVerticalPosition =
+                        (recyclerView == null || recyclerView.getChildCount() == 0) ? 0 : recyclerView.getChildAt(0).getTop();
+
+                refresh.setEnabled(topRowVerticalPosition >= 0);
+            }
+        });
+    }
+
+    @Override
+    public void initData() {
+        adpGameAccount.clear();
+        for (int i = 0; i < 3; i++) {
+            adpGameAccount.add(RecyleObj.make(RecyleType.NONE, null));
+        }
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .getGameAccountAllList()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                        G.showToast(baseMessage);
+                        notifyDataSetChanged(null);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        GameAccountSuper gameAccountSuper = baseMessage.getData(GameAccountSuper.class);
+                        if(gameAccountSuper != null){
+                            int position = 0;
+                            if(!ListUtil.isEmpty(gameAccountSuper.getPlatform())){
+                                adpGameAccount.add(RecyleObj.make(RecyleType.GAME_ACCOUNT_PLATFORM, gameAccountSuper.getPlatform()),position);
+                                position++;
+                            }
+                            if(!ListUtil.isEmpty(gameAccountSuper.getTengxun())){
+                                adpGameAccount.add(RecyleObj.make(RecyleType.GAME_ACCOUNT_TENCENT, gameAccountSuper.getTengxun()),position);
+                                position++;
+                            }
+                            if(!ListUtil.isEmpty(gameAccountSuper.getXiaomi())){
+                                adpGameAccount.add(RecyleObj.make(RecyleType.GAME_ACCOUNT_XIAOMI, gameAccountSuper.getXiaomi()),position);
+                            }
+
+                        }
+                        notifyDataSetChanged(gameAccountSuper);
+                    }
+                });
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    private void checkAndInitView() {
+        if(refresh == null)
+            refresh = findViewById(R.id.refresh);
+        if(empty_view == null)
+            empty_view = findViewById(R.id.empty_view);
+    }
+    private void notifyDataSetChanged(GameAccountSuper gameAccountSuper){
+        checkAndInitView();
+        adpGameAccount.notifyDataSetChanged();
+        refresh.setRefreshing(false);
+        if(gameAccountSuper == null){
+            empty_view.setVisibility(View.VISIBLE);
+            return;
+        }
+        if(ListUtil.isEmpty(gameAccountSuper.getPlatform()) && ListUtil.isEmpty(gameAccountSuper.getTengxun()) && ListUtil.isEmpty(gameAccountSuper.getXiaomi())){
+
+            empty_view.setVisibility(View.VISIBLE);
+        }else {
+            empty_view.setVisibility(View.GONE);
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        EventBus.getDefault().unregister(this);
+    }
+    @Subscribe
+    public void onEventMainThread(BigEvent event){
+        switch (event.getEventTypes()){
+            case DELETE_GAME_ACCOUNT_REFRESH:
+                initData();
+                break;
+        }
+    }
+}

+ 366 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java

@@ -0,0 +1,366 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONArray;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.bumptech.glide.Glide;
+import com.kfzs.duanduan.event.BigEvent;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
+import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.gamegroup.model.entity.OrienteeringDetail;
+import com.sheep.gamegroup.model.entity.RecyleObj;
+import com.sheep.gamegroup.model.entity.RecyleType;
+import com.sheep.gamegroup.model.entity.RequestParameEty;
+import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.AppUtil;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.MyGridview;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdpGameAgencyRecharge;
+import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
+import com.sheep.gamegroup.view.customview.SheepmSwipeRefreshLayout;
+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.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_HELP;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_TAB;
+
+/**
+ * 游戏代充
+ * Created by ljy on 2018/7/9.
+ */
+
+public class ActGameAgencyRecharge extends BaseActivity {
+    @BindView(R.id.gridview_game)
+    MyGridview gridviewGame;
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerview;
+    @BindView(R.id.refresh)
+    SheepmSwipeRefreshLayout refresh;
+    @BindView(R.id.empty_view)
+    View empty_view;
+    private Activity activity;
+    private AdpGameAgencyRecharge adpGameAgencyRecharge;
+    private ArrayList<Object> gridviewList = new ArrayList<>();
+    private GridViewEntity gridViewEntity;//选中的
+    private TryMakeMoneyAdp tryMakeMoneyAdp;
+    private List<GameAgencyRechargePlatformEntity> platformList = ListUtil.emptyList();//平台充值
+    private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();//游戏代充
+
+    private String task_type;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_game_agency_recharge_layout;
+    }
+
+    @Override
+    public void initView() {
+
+        EventBus.getDefault().register(this);
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitleFinish(activity)
+                .setTitle(activity, "游戏代充")
+                .setShowRightTwoBtn(activity,
+                        R.mipmap.question_black_img,
+                        R.mipmap.search_black_img,
+                        new View.OnClickListener() {//问号
+                            @Override
+                            public void onClick(View v) {
+                                GAME_INSTEAD_OF_RECHARGE_HELP.onEvent();
+                                ViewUtil.showMsgDialog(activity, "充值请填写正确的游戏充值账号,角色信息,其他充值问题请联系客服。","充值帮助");
+                            }
+                        },
+                        new View.OnClickListener() {//搜索
+                            @Override
+                            public void onClick(View v) {
+                                Jump2View.getInstance().goGameSearch(activity, null);
+                            }
+                        });
+        adpGameAgencyRecharge = new AdpGameAgencyRecharge(activity, gridviewList);
+        gridviewGame.setAdapter(adpGameAgencyRecharge);
+        changeGridview();
+        empty_view.setVisibility(View.GONE);
+        /**
+         * recycle view
+         */
+        recyclerview.setLayoutManager(new LinearLayoutManager(activity));
+        tryMakeMoneyAdp = new TryMakeMoneyAdp(activity);
+
+        for (int i = 0; i < 2; i++) {
+            tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
+        }
+        recyclerview.setAdapter(tryMakeMoneyAdp);
+        setValue();//gridview data
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initData();
+    }
+
+    @Override
+    public void initListener() {
+
+        refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
+            @Override
+            public void onRefresh() {
+                initData();
+            }
+        });
+        recyclerview.addOnScrollListener(new RecyclerView.OnScrollListener() {
+            @Override
+            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
+                super.onScrollStateChanged(recyclerView, newState);
+            }
+
+            @Override
+            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+
+                int topRowVerticalPosition =
+                        (recyclerView == null || recyclerView.getChildCount() == 0) ? 0 : recyclerView.getChildAt(0).getTop();
+
+                refresh.setEnabled(topRowVerticalPosition >= 0);
+            }
+        });
+        gridviewGame.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                GridViewEntity newItem = (GridViewEntity) ListUtil.getIndex(gridviewList, position);
+                if(newItem == null){
+                    return;
+                }
+                GAME_INSTEAD_OF_RECHARGE_TAB.onEvent("task_type", newItem.getTask_type(), "name", newItem.getName());
+                if(gridViewEntity == newItem){//无需切换
+                    return;
+                }
+                gridViewEntity = (GridViewEntity) gridviewList.get(position);
+                task_type = gridViewEntity.getTask_type();
+                for(int i=0;i<gridviewList.size();i++){
+                    if(position == i){
+                        ((GridViewEntity) gridviewList.get(i)).setSelectState(true);
+                    }else {
+                        ((GridViewEntity) gridviewList.get(i)).setSelectState(false);
+
+                    }
+                }
+                adpGameAgencyRecharge.notifyDataSetChanged();
+                try{
+                    //刷新界面
+                    initData();
+                }catch (Exception e){
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+    @Override
+    public void initData() {
+        refresh.setRefreshing(true);
+        tryMakeMoneyAdp.clear();
+        for (int i = 0; i < 2; i++) {
+            tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.NONE, null));
+        }
+
+        //平台游戏
+        platformList.clear();
+        if(TextUtils.isEmpty(task_type)){
+            task_type = "1002"+",1003"+",1004";
+        }
+        switch (task_type){
+            case "1002":
+
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_platform_sheep_icon,
+                        "平台游戏代充",
+                        "充值有福利",
+                        1002));
+                break;
+            case "1003":
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_platform_sheep_icon,
+                        "腾讯游戏代充",
+                        "充值有福利",
+                        1003));
+
+                break;
+            case "1004":
+
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_xiaomi_icon,
+                        "小米游戏代充",
+                        "充值有福利",
+                        1004));
+                break;
+            case "1002"+",1003"+",1004":
+            default:
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_platform_sheep_icon,
+                        "平台游戏代充",
+                        "充值有福利",
+                        1002));
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_xiaomi_icon,
+                        "小米游戏代充",
+                        "充值有福利",
+                        1004));
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_platform_sheep_icon,
+                        "腾讯游戏代充",
+                        "充值有福利",
+                        1003));
+                break;
+
+        }
+
+        tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT_PLATFORM, platformList),0);
+        notifyDataSetChanged();
+        if(gridViewEntity == null)
+            return;
+        CommonUtil.getInstance()
+                .gameTask(activity, task_type, "", new Action1<BaseMessage>() {
+                    @Override
+                    public void call(BaseMessage baseMessage) {
+                        try {
+                            List<TaskReleaseEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskReleaseEty.class);
+                            if(releaseEtyList != null){
+                                releaseEtyLists.clear();
+                                releaseEtyLists.addAll(releaseEtyList);
+                                tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT, releaseEtyLists),1);
+                                notifyDataSetChanged();
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    /**
+     * gridview 改成单行横向布局
+     */
+    private void changeGridview(){
+
+        int itemWidth = (G.WIDTH >G.HEIGHT?G.HEIGHT:G.WIDTH) / 4 -30;
+        int itemPaddingh = AppUtil.dp2px(activity, 1);
+
+        int size = 4;
+
+        int gridview = size * (itemWidth + itemPaddingh);
+
+        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(gridview, LinearLayout.LayoutParams.WRAP_CONTENT);
+        gridviewGame.setLayoutParams(params);
+        gridviewGame.setColumnWidth(itemWidth);
+        gridviewGame.setHorizontalSpacing(itemPaddingh);
+        gridviewGame.setStretchMode(MyGridview.NO_STRETCH);
+        gridviewGame.setNumColumns(size);
+    }
+
+    /**
+     * gridview 赋值
+     */
+    private void setValue(){
+        gridviewList.clear();
+        gridviewList.add(new GridViewEntity(true, "全 部", "1002"+",1003"+",1004"));
+        gridviewList.add(new GridViewEntity(false, "平台游戏", 1002+""));
+        gridviewList.add(new GridViewEntity(false, "小米游戏", 1004+""));
+        gridviewList.add(new GridViewEntity(false, "腾讯游戏", 1003+""));
+        gridViewEntity = (GridViewEntity) gridviewList.get(0);
+
+
+    }
+
+    private void checkAndInitView() {
+        if(refresh == null)
+            refresh = findViewById(R.id.refresh);
+        if(empty_view == null)
+            empty_view = findViewById(R.id.empty_view);
+    }
+    private void notifyDataSetChanged(){
+        checkAndInitView();
+        tryMakeMoneyAdp.refreshAdapter();
+        if(tryMakeMoneyAdp.isEmpty() && platformList.isEmpty() && releaseEtyLists.isEmpty()){
+
+            empty_view.setVisibility(View.VISIBLE);
+        }else {
+            empty_view.setVisibility(View.GONE);
+        }
+        refresh.setRefreshing(false);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+
+        EventBus.getDefault().unregister(this);
+    }
+    @Subscribe
+    public void onEventMainThread(BigEvent event){
+        switch (event.getEventTypes()){
+            case GENERATION_ACCOUNT_REFRESH:
+                initData();
+                break;
+            case GENERATION_ACCOUNT_REFRESH_ADAPTER:
+                if(event.getData() instanceof DownloadTask){
+                    DownloadTask task = (DownloadTask) event.getData();
+                    try {
+                        int p = task.getPercent();    //任务进度百分比
+                        String speed = task.getConvertSpeed();    //转换单位后的下载速度,单位转换需要在配置文件中打开
+                        System.out.println("Aria "+task.getKey()+",p " + p + ", speed = " + speed);
+                        String url = task.getKey();
+                        TextView tvProgress = recyclerview.findViewWithTag(TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST + url);
+                        if (tvProgress == null) {
+                            return;
+                        }
+                        tvProgress.setText(String.format(Locale.CHINA, "%d%%",Math.abs(p)));
+
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+                break;
+        }
+    }
+}

+ 1 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java

@@ -140,7 +140,7 @@ public class ActMyMoney extends BaseActivity {
                 Jump2View.getInstance().tryGoWithdrawal(ActMyMoney.this, null);
                 break;
             case R.id.my_money_recharge_tv://充值
-                Jump2View.getInstance().goRechargeAct(ActMyMoney.this, null);
+                Jump2View.getInstance().goRechargeAct(ActMyMoney.this, "我的资产");
                 break;
             case R.id.my_money_dingxiang_amount_iv://定向货币详情
                 ViewUtil.showOrienteeringDetails(ActMyMoney.this);
@@ -157,8 +157,6 @@ public class ActMyMoney extends BaseActivity {
                         .subscribe(new SheepSubscriber<BaseMessage>(this) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                                 UserAssets userAssets = baseMessage.getData(UserAssets.class);
                                 loadData(userAssets);
                                 hideProgress();
@@ -166,8 +164,6 @@ public class ActMyMoney extends BaseActivity {
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                if(BuildConfig.DEBUG)
-                                    System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 G.showToast(baseMessage);
                                 resetData();
                                 hideProgress();

+ 0 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActNewAboutUs.java

@@ -103,7 +103,6 @@ public class ActNewAboutUs extends BaseActivity {
                         .subscribe(new SheepSubscriber<BaseMessage>(this) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                 NewAboutUs newAboutUs = baseMessage.getData(NewAboutUs.class);
                                 if(newAboutUs != null){
                                     loadData(newAboutUs);
@@ -115,7 +114,6 @@ public class ActNewAboutUs extends BaseActivity {
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                 G.showToast(baseMessage);
                                 resetData();
                                 hideProgress();

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActNewbieTaskList.java

@@ -81,8 +81,6 @@ public class ActNewbieTaskList extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                         swipe_container.setRefreshing(false);
                         newbieTaskList = baseMessage.getDatas(NewbieTask.class);
                         etyList.addAll(newbieTaskList);
@@ -91,8 +89,6 @@ public class ActNewbieTaskList extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        if(BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         swipe_container.setRefreshing(false);
                         etyList.addAll(newbieTaskList);
                         adp.notifyDataSetChanged();

+ 0 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/ActReservation.java

@@ -179,7 +179,6 @@ public class ActReservation extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         find_information_game_bt2.setEnabled(true);
                         find_information_game_bt2.setText("取消预约");
                         item.setCancel(false);
@@ -188,7 +187,6 @@ public class ActReservation extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         G.showToast("预约失败");
                         find_information_game_bt2.setEnabled(true);
                     }
@@ -202,7 +200,6 @@ public class ActReservation extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                         find_information_game_bt2.setEnabled(true);
                         find_information_game_bt2.setText("立即预约");
                         item.setCancel(true);
@@ -211,7 +208,6 @@ public class ActReservation extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                         G.showToast("取消预约失败");
                         find_information_game_bt2.setEnabled(true);
                     }
@@ -245,7 +241,6 @@ public class ActReservation extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         List<FindAppReservation> newList = baseMessage.getDataList(FindAppReservation.class);
                         list.clear();
                         ListUtil.addAll(list, newList);
@@ -256,7 +251,6 @@ public class ActReservation extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         list.clear();
                         notifyDataSetChanged();
                     }

+ 372 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActSearchGame.java

@@ -0,0 +1,372 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.support.v7.widget.AppCompatAutoCompleteTextView;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONArray;
+import com.arialyy.aria.core.download.DownloadTask;
+import com.kfzs.duanduan.event.BigEvent;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.RecyleObj;
+import com.sheep.gamegroup.model.entity.RecyleType;
+import com.sheep.gamegroup.model.entity.SearchGameRecord;
+import com.sheep.gamegroup.model.entity.TaskEty;
+import com.sheep.gamegroup.model.entity.TaskReleaseEty;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.MyDbManager;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.AdbCommonRecycler;
+import com.sheep.gamegroup.view.adapter.ArrayAdapter;
+import com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp;
+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.TitleBarUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
+import rx.schedulers.Schedulers;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME_COMMIT;
+
+/**
+ * Created by realicing on 2018/04/.
+ * realicing@sina.com
+ */
+public class ActSearchGame extends BaseActivity {
+
+    @BindView(R.id.search_game_input)
+    AppCompatAutoCompleteTextView search_game_input;
+    @BindView(R.id.search_game_bt)
+    TextView search_game_bt;
+    @BindView(R.id.search_game_hot_list)
+    GridView search_game_hot_list;
+    @BindView(R.id.search_game_list)
+    RecyclerView search_game_list;
+    @BindView(R.id.search_game_hot)
+    View search_game_hot;
+    @BindView(R.id.download_mgr_empty_view)
+    View download_mgr_empty_view;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_search_game;
+    }
+
+    private ActSearchGame activity;
+
+    @Override
+    public void initView() {
+        EventBus.getDefault().register(this);
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "搜索游戏")
+                .setTitleFinish(this);
+        download_mgr_empty_view.setVisibility(View.GONE);
+        initHotList();
+        initList();
+        initInput();
+
+    }
+    private ArrayAdapter<SearchGameRecord> inputAdapter;
+    private void initInput() {
+        inputAdapter = new ArrayAdapter<>(activity, android.R.layout.simple_list_item_1, searchGameRecordList);
+        search_game_input.setAdapter(inputAdapter);
+        search_game_input.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+
+            @Override
+
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                Object obj = parent.getItemAtPosition(position);
+                if(obj instanceof SearchGameRecord){
+                    search_game_input.setText(((SearchGameRecord) obj).getInput());
+                }
+            }
+
+        });
+//        search_game_input.setThreshold(1);
+    }
+
+    private AdbCommonRecycler<TaskReleaseEty> adapter;
+    private void initList() {
+        search_game_list.setLayoutManager(new LinearLayoutManager(activity));
+        adapter = new AdbCommonRecycler<TaskReleaseEty>(activity, list) {
+
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.item_search_game;
+            }
+
+            @Override
+            public void convert(ViewHolder holder, final TaskReleaseEty item) {
+                View itemView = holder.itemView;
+                final TaskEty taskEty;
+                if (item == null || (taskEty = item.getTask()) == null) {
+                    return;
+                }
+                ImageView find_information_game_icon = (ImageView) itemView.findViewById(R.id.find_information_game_icon);
+                TextView find_information_game_name = (TextView) itemView.findViewById(R.id.find_information_game_name);
+                TextView find_information_game_surplus = (TextView) itemView.findViewById(R.id.find_information_game_surplus);
+                TextView find_information_game_time = (TextView) itemView.findViewById(R.id.find_information_game_time);
+                TextView find_information_game_yuan = (TextView) itemView.findViewById(R.id.find_information_game_yuan);
+                TextView find_information_game_task = (TextView) itemView.findViewById(R.id.find_information_game_task);
+                TextView find_information_game_task0 = (TextView) itemView.findViewById(R.id.find_information_game_task0);
+                ViewUtil.centerImage(find_information_game_icon, taskEty.getIcon());
+                ViewUtil.setText(find_information_game_name, item.getName());
+                ViewUtil.setText(find_information_game_surplus);
+                ViewUtil.setText(find_information_game_time, taskEty.getDetailShow());
+                find_information_game_yuan.setVisibility(View.INVISIBLE);//这里必须为INVISIBLE,因为要显示两个按钮,下面的按钮位置不动
+                find_information_game_task0.setVisibility(View.VISIBLE);
+                find_information_game_task0.setText("立即充值");
+                find_information_game_task0.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id(), item.getName());
+                    }
+                });
+                item.getDownloadHelper().updateDownloadTaskView(activity, taskEty, find_information_game_task);
+                find_information_game_task.setTag("PUBLIC_TAG_PREFIX_TEXTVIEW_LIST" + taskEty.getDownload_link());
+            }
+        };
+        search_game_list.setAdapter(adapter);
+    }
+
+    private ArrayAdapter<TaskReleaseEty> hotAdapter;
+    private void initHotList() {
+        hotAdapter = new ArrayAdapter<TaskReleaseEty>(activity, R.layout.item_search_game_hot, hotList) {
+            @Override
+            public boolean convert(int position, View convertView, ViewGroup parent, final TaskReleaseEty item) {
+                if (convertView instanceof TextView) {
+                    ((TextView) convertView).setText(item.getName());
+                }
+                convertView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        search_game_input.setText(item.getName());
+                    }
+                });
+                return true;
+            }
+        };
+        search_game_hot_list.setAdapter(hotAdapter);
+    }
+
+    private Runnable autoSearchRunnable = new Runnable() {
+        @Override
+        public void run() {
+            search_game_bt.performClick();
+        }
+    };
+    @Override
+    public void initListener() {
+        if(TestUtil.isTest()){
+            search_game_input.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
+        }
+        search_game_input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEARCH) {
+                    search_game_bt.performClick();
+                }
+                return false;
+            }
+        });
+        search_game_input.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+            }
+
+            @Override
+            public void afterTextChanged(Editable editable) {
+                if(editable.toString().startsWith("h") && TestUtil.isTest()){//测试用 http中的h开头
+                    return;
+                }
+                search_game_input.removeCallbacks(autoSearchRunnable);
+                search_game_input.postDelayed(autoSearchRunnable, 1000L);//1秒后自动搜索
+            }
+        });
+    }
+
+    List<SearchGameRecord> searchGameRecordList = new ArrayList<>();
+    List<TaskReleaseEty> hotList = new ArrayList<>();
+    List<TaskReleaseEty> list = new ArrayList<>();
+
+    @Override
+    public void initData() {
+        //初始化搜索历史
+        List<SearchGameRecord> newSgrList = MyDbManager.getInstance().getAllSearchGameRecord();
+        ListUtil.addAll(searchGameRecordList, newSgrList);
+        inputAdapter.notifyDataSetChanged();
+        //初始化热门列表
+        SheepApp.getInstance().getNetComponent().getApiService()
+                .releaseTask(1, 9,
+                        SheepApp.getInstance().getConnectAddress().getPlatForm(), 1,
+                        0, 0,
+                        "1002,1003,1004", 3)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        download_mgr_empty_view.setVisibility(View.VISIBLE);
+                        search_game_hot.setVisibility(View.GONE);
+                        search_game_list.setVisibility(View.GONE);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                        ListUtil.addAll(hotList, newList);
+                        hotAdapter.notifyDataSetChanged();
+                    }
+                });
+
+    }
+
+    @OnClick({R.id.search_game_bt})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
+            case R.id.search_game_bt:
+                SEARCH_GAME_COMMIT.onEvent();
+                toSearchGame();
+                break;
+        }
+    }
+
+    private void toSearchGame() {
+        String inputText = search_game_input.getText().toString();
+        if (TextUtils.isEmpty(inputText)) {
+            list.clear();
+            notifyDataSetChanged();
+            return;
+        }
+        //保存搜索到数据库
+        SearchGameRecord searchGameRecord = new SearchGameRecord();
+        searchGameRecord.setInput(inputText);
+        searchGameRecord.setTime(System.currentTimeMillis());
+        MyDbManager.getInstance().saveOrUpdate(searchGameRecord);
+        searchGameRecordList.add(searchGameRecord);
+//        initInput();
+
+        if(inputText.startsWith("http") && inputText.length() > 6 && TestUtil.isTest()){//测试用
+            Jump2View.getInstance().goWeb(activity, inputText, "测试内部H5");
+            return;
+        }
+
+        CommonUtil.getInstance()
+                .gameTask(activity, "1002,1003,1004", inputText, new Action1<BaseMessage>() {
+                    @Override
+                    public void call(BaseMessage baseMessage) {
+                        try {
+                            if(baseMessage == null){
+
+                                G.showToast("暂无游戏");
+                                list.clear();
+                                notifyDataSetChanged();
+                            }else {
+                                List<TaskReleaseEty> newList = baseMessage.getDatas(TaskReleaseEty.class);
+                                list.clear();
+                                ListUtil.addAll(list, newList);
+                                notifyDataSetChanged();
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+    }
+
+    private void notifyDataSetChanged() {
+        adapter.notifyDataSetChanged();
+        if (list.isEmpty()) {
+            if(hotList.isEmpty()) {
+                download_mgr_empty_view.setVisibility(View.VISIBLE);
+            } else {
+                search_game_hot.setVisibility(View.VISIBLE);
+            }
+            search_game_list.setVisibility(View.GONE);
+        } else {
+            search_game_list.setVisibility(View.VISIBLE);
+            if(hotList.isEmpty()) {
+                download_mgr_empty_view.setVisibility(View.GONE);
+            } else {
+                search_game_hot.setVisibility(View.GONE);
+            }
+        }
+    }
+
+    @Subscribe
+    public void onEventMainThread(BigEvent event){
+        switch (event.getEventTypes()){
+
+            case GENERATION_ACCOUNT_REFRESH_ADAPTER:
+                if(event.getData() instanceof DownloadTask){
+                    DownloadTask task = (DownloadTask) event.getData();
+                    try {
+                        int p = task.getPercent();    //任务进度百分比
+                        String speed = task.getConvertSpeed();    //转换单位后的下载速度,单位转换需要在配置文件中打开
+                        System.out.println("Aria "+task.getKey()+",p " + p + ", speed = " + speed);
+                        String url = task.getKey();
+                        TextView tvProgress = search_game_list.findViewWithTag(TryMakeMoneyAdp.PUBLIC_TAG_PREFIX_TEXTVIEW_LIST + url);
+                        if (tvProgress == null) {
+                            return;
+                        }
+                        tvProgress.setText(String.format(Locale.CHINA, "%d%%",Math.abs(p)));
+
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+                break;
+        }
+    }
+
+    @Override
+    public void onBackPressed() {
+        if(search_game_input.getText().toString().isEmpty()) {
+            super.onBackPressed();
+        } else {
+            search_game_input.setText("");
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+
+        EventBus.getDefault().unregister(this);
+    }
+}

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActUnderstandSheep.java

@@ -104,15 +104,11 @@ public class ActUnderstandSheep extends BaseActivity {
                                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                                     @Override
                                     public void onNext(BaseMessage baseMessage) {
-                                        if(BuildConfig.DEBUG)
-                                            System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                                         finish();
                                     }
 
                                     @Override
                                     public void onError(BaseMessage baseMessage) {
-                                        if(BuildConfig.DEBUG)
-                                            System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                         G.showToast(baseMessage);
                                     }
                                 });

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/ActUserLabelList.java

@@ -70,7 +70,6 @@ public class ActUserLabelList extends BaseActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         List<UserLabelList> checkLabelList = baseMessage.getDatas(UserLabelList.class);
                         if (!ListUtil.isEmpty(checkLabelList)) {
                             loadData(checkLabelList);
@@ -79,7 +78,6 @@ public class ActUserLabelList extends BaseActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         G.showToast(baseMessage);
                     }
                 });
@@ -161,14 +159,12 @@ public class ActUserLabelList extends BaseActivity {
                         .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                             @Override
                             public void onNext(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
                                 Jump2View.getInstance().goHomePageView(ActUserLabelList.this, null);
                                 finish();
                             }
 
                             @Override
                             public void onError(BaseMessage baseMessage) {
-                                LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                                 G.showToast(baseMessage);
                                 if(BuildConfig.DEBUG){
                                     Jump2View.getInstance().goHomePageView(ActUserLabelList.this, null);

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActWeb.java

@@ -340,7 +340,7 @@ public class ActWeb extends BaseCompatActivity {
         }
         @JavascriptInterface
         public void gotoRecharge() {
-            Jump2View.getInstance().goRechargeAct(ActWeb.this, null);//进入充值绵羊币界面
+            Jump2View.getInstance().goRechargeAct(ActWeb.this, "内部H5");//进入充值绵羊币界面
         }
 
         @JavascriptInterface

+ 36 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -1,10 +1,8 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.app.AlertDialog;
 import android.support.v4.view.ViewPager;
 import android.util.SparseArray;
 import android.view.View;
-import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
@@ -15,8 +13,10 @@ import com.sheep.gamegroup.di.components.DaggerAskGetMoneyComponent;
 import com.sheep.gamegroup.di.modules.AskGetMoneyModule;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.AskGetMoneyContract;
 import com.sheep.gamegroup.presenter.AskGetMoneyPresenter;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
@@ -34,6 +34,12 @@ import javax.inject.Inject;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import rx.functions.Action1;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LINK_SHARE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.QR_COPY;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SHARE_TO_QQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.SHARE_TO_WX;
 
 /**
  * Created by Administrator on 2018/3/19.
@@ -90,11 +96,18 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
     public void initListener() {
 
     }
-
+    private UserEntity userEntity;
     @Override
     public void initData() {
         showProgress();
         mPresenter.getTask(null);
+        CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
+            @Override
+            public void call(UserEntity result) {
+                if(result != null)
+                    userEntity = result;
+            }
+        });
     }
 
     private void shareToWX() {
@@ -106,8 +119,12 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
     }
 
     private void shareToOther(int code) {
+        if(userEntity == null){
+            G.showToast("数据正在加载中");
+            return;
+        }
         UMImage thumb = new UMImage(this, R.drawable.icon);
-        UMWeb web = new UMWeb(mEntity.getShare_link());
+        UMWeb web = new UMWeb(userEntity.getShareLink());
         web.setTitle(mEntity.getShare_title());//标题
         web.setThumb(thumb);  //缩略图
         web.setDescription(mEntity.getShare_desc());//描述
@@ -122,12 +139,18 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
 
 
     private void shareToLink() {
-        ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("分享链接").setMsg(mEntity.getShare_link())
+        if(userEntity == null){
+            G.showToast("数据正在加载中");
+            return;
+        }
+        LINK_SHARE.onEvent();
+        ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("分享链接").setMsg(userEntity.getShareLink())
             .setMsgMore("通过连接加入小绵羊即可成为你的好友").setMsgMoreColor(R.color.txt_black_9e9c9c)
             .setBtnLeftText("复制链接").setBtnLeftOnClickListener(new View.OnClickListener() {
                         @Override
                         public void onClick(View view) {
-                            StringUtils.CopyText(AskGetMoneyAct.this,mEntity.getShare_link());
+                            QR_COPY.onEvent();
+                            StringUtils.CopyText(AskGetMoneyAct.this, userEntity.getShareLink());
                             G.showToast("复制链接成功");
                         }
                     }));
@@ -189,12 +212,18 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
             switch (view.getId()) {
                 case R.id.rl_wx:
                     shareToWX();
+                    SHARE_TO_WX.onEvent();
                     break;
                 case R.id.rl_qq:
                     shareToQQ();
+                    SHARE_TO_QQ.onEvent();
                     break;
                 case R.id.rl_qr:
-                    ViewUtil.showQR(AskGetMoneyAct.this, mEntity.getShare_link());
+                    if(userEntity == null){
+                        G.showToast("数据正在加载中");
+                        break;
+                    }
+                    ViewUtil.showQR(AskGetMoneyAct.this, userEntity.getShareLink());
                     break;
                 case R.id.rl_link:
                     shareToLink();

+ 0 - 160
app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java

@@ -1,160 +0,0 @@
-package com.sheep.gamegroup.view.activity;
-
-import android.app.Activity;
-import android.support.v7.widget.AppCompatEditText;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sheep.gamegroup.di.components.DaggerBindDataComponent;
-import com.sheep.gamegroup.di.modules.BindDataModule;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.presenter.BindDataContract;
-import com.sheep.gamegroup.presenter.BindDataPresenter;
-import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.gamegroup.absBase.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
-
-import javax.inject.Inject;
-
-import butterknife.BindView;
-import butterknife.OnClick;
-
-/**
- * 绑定数据
- * Created by ljy on 2018/3/19.
- */
-
-public class BindDataAct extends BaseActivity implements BindDataContract.View {
-    @BindView(R.id.text_notice_tv)
-    TextView textNoticeTv;
-    @BindView(R.id.text_et)
-    AppCompatEditText textEt;
-    @BindView(R.id.text_layout)
-    LinearLayout textLayout;
-    @BindView(R.id.number_notice_tv)
-    TextView numberNoticeTv;
-    @BindView(R.id.number_et)
-    AppCompatEditText numberEt;
-    @BindView(R.id.number_layout)
-    LinearLayout numberLayout;
-    @BindView(R.id.sure_text)
-    TextView sureText;
-    @Inject
-    BindDataPresenter presenter;
-    @BindView(R.id.img_baseactivity_title)
-    ImageView imgBaseactivityTitle;
-    @BindView(R.id.txt_baseactivity_title)
-    TextView txtBaseactivityTitle;
-    private Activity activity;
-
-    private int type = 0;
-    private String key = "real_name";
-    private String value = "";
-    private String title = "绑定真实姓名";
-
-    @Override
-    public void upView(Object o) {
-        hideProgress();
-        G.showToast("绑定成功");
-        finish();
-
-    }
-
-    @Override
-    public void failView(Object o) {
-        G.showToast(((BaseMessage)o).getMsg()+"");
-        hideProgress();
-    }
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.bind_data_act_layout;
-    }
-
-    @Override
-    public void initView() {
-        activity = this;
-        DaggerBindDataComponent.builder()
-                .netComponent(SheepApp.get(this).getNetComponent())
-                .bindDataModule(new BindDataModule(this))
-                .build()
-                .inject(this);
-        type = getIntent().getIntExtra("stype", 0);
-        assemblyData(type);
-        txtBaseactivityTitle.setText(title);
-    }
-
-    @Override
-    public void initListener() {
-
-    }
-
-    @Override
-    public void initData() {
-    }
-
-    @OnClick({R.id.sure_text, R.id.img_baseactivity_title})
-    public void onViewClicked(View view) {
-        switch (view.getId()) {
-            case R.id.sure_text:
-                assemblyData(type);
-                submit();
-                break;
-            case R.id.img_baseactivity_title:
-                finish();
-                break;
-        }
-    }
-
-    private void submit() {
-        if(android.text.TextUtils.isEmpty(value)){
-            G.showToast("请填入数据");
-            return;
-        }
-        JSONObject j = new JSONObject();
-        j.put(key, value);
-        showProgress();
-        switch (type) {
-            case 40001:
-                presenter.submitDataRealname(j);
-                break;
-            case 40002:
-                presenter.submitDataIdnumber(j);
-                break;
-            case 40003:
-                presenter.submitDataBankcard(j);
-                break;
-        }
-    }
-
-    private String assemblyData(int type){
-        switch (type) {
-            case 40001:
-                key = "real_name";
-                title = "绑定真实姓名";
-                numberLayout.setVisibility(View.GONE);
-                textNoticeTv.setText("真实姓名");
-                value = textEt.getText().toString();
-                break;
-            case 40002:
-                key = "id_number";
-                title = "绑定身份证";
-                numberLayout.setVisibility(View.GONE);
-                textNoticeTv.setVisibility(View.GONE);
-                value = textEt.getText().toString();
-                break;
-            case 40003:
-                key = "bank_card";
-                title = "绑定银行卡";
-                textLayout.setVisibility(View.GONE);
-                numberNoticeTv.setText("卡号");
-                value = numberEt.getText().toString();
-                break;
-        }
-        return value;
-    }
-}

+ 91 - 23
app/src/main/java/com/sheep/gamegroup/view/activity/ChangeTelAct.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
+import android.content.Intent;
 import android.support.v7.widget.AppCompatEditText;
 import android.text.TextUtils;
 import android.util.Log;
@@ -10,6 +11,7 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
 import com.sheep.gamegroup.absBase.BaseActivity;
@@ -38,6 +40,7 @@ import javax.inject.Inject;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import rx.functions.Action1;
 
 /**
  * Created by ljy on 2018/3/27.
@@ -68,13 +71,15 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
     LinearLayout changePhoneLayout;
     @BindView(R.id.no_bind_tel_img)
     ImageView no_bind_tel_img;
+    @BindView(R.id.phone_icon_iv)
+    ImageView phone_icon_iv;
+    @BindView(R.id.code_icon_iv)
+    ImageView code_icon_iv;
 
     @Inject
     PhonePresenter presenter;
 
     private Activity activity;
-    private final int CHANGGE_CLICK = 0;//切换手机按钮点击后
-    private final int OLD_PHONE_CLICK = 1;//旧手机获取验证码后
 
     private int oldOrNew;   //1,绑定过   0,未绑定过
 
@@ -103,32 +108,59 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
     public void initView() {
         activity = this;
         GlideImageLoader.setImage(no_bind_tel_img, "http://cdngame.kuaifazs.com/no_bind_tel_img.png");
+        GlideImageLoader.setImage(phone_icon_iv, "http://cdngame.kuaifazs.com/phone_icon_iv.png");
+        GlideImageLoader.setImage(code_icon_iv, "http://cdngame.kuaifazs.com/code_icon_iv.png");
         DaggerChangePhoneComponent.builder()
                 .netComponent(SheepApp.get(activity).getNetComponent())
                 .phoneModule(new PhoneModule(this))
                 .build()
                 .inject(this);
         where_from = getIntent().getIntExtra("where_from", 0);
-        TitleBarUtils.getInstance()
+        TitleBarUtils titleBarUtils = TitleBarUtils.getInstance()
                 .setTitle(this, noticeStr)
                 .setTitleFinish(this, new View.OnClickListener() {
                     @Override
                     public void onClick(View v) {
-                        if(where_from > 0){
-                            Jump2View.getInstance()
-                                    .gotoLoginAgain();
-                        }
-                        finish();
+                        toFinish();
                     }
                 });
+        switch (where_from){
+            case FROM_SPLASH://非第一次登录(如:登录后直接重启),老用户需要绑定手机号
+                titleBarUtils.setRightBotton(this, "跳过", 0, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        Intent intent = new Intent(activity, ActMain.class);
+                        activity.startActivity(intent);
+                        activity.finish();
+                    }
+                });
+                break;
+            case FROM_LOGIN://用户可以跳过
+                titleBarUtils.setRightBotton(this, "跳过", 0, new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        Jump2View.getInstance().checkLabel(activity, new Action1<BaseMessage>() {
+                            @Override
+                            public void call(BaseMessage baseMessage) {
+                                Intent intent = new Intent(activity, ActMain.class);
+                                activity.startActivity(intent);
+                                activity.finish();
+                            }
+                        });
+                    }
+                });
+                break;
+            case 30001:
+                break;
+        }
         try {
             userEntity = MyDbManager.getInstance()
                     .dbFindUser();
         } catch (DbException e) {
             e.printStackTrace();
         }
-        mobiles = SpUtils.getPhone(activity);
-        if(mobiles != null && !TextUtils.isEmpty(mobiles)){//提示
+        mobiles = userEntity != null ? userEntity.getMobile() : SpUtils.getPhone(activity);
+        if(!TextUtils.isEmpty(mobiles)){//提示
             oldOrNew = 1;
             showChangeLayout.setVisibility(View.VISIBLE);
             changePhoneLayout.setVisibility(View.GONE);
@@ -138,6 +170,30 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
         refreshData();
     }
 
+    private void toFinish() {
+        switch (where_from){
+            case FROM_SPLASH://非第一次登录(如:登录后直接重启),老用户需要绑定手机号
+                Intent intent = new Intent(activity, ActMain.class);
+                startActivity(intent);
+                finish();
+                break;
+            case FROM_LOGIN://第一次登录,老用户需要绑定手机号
+                Jump2View.getInstance().checkLabel(activity, new Action1<BaseMessage>() {
+                    @Override
+                    public void call(BaseMessage baseMessage) {
+                        Intent intent = new Intent(activity, ActMain.class);
+                        activity.startActivity(intent);
+                        activity.finish();
+                    }
+                });
+                break;
+            case 30001://新用户必须绑定手机号,正常情况是会在登录成功后
+                Jump2View.getInstance().gotoLoginAgain();
+                finish();
+                break;
+        }
+    }
+
     @Override
     public void initListener() {
         selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
@@ -157,9 +213,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
 
             @Override
             public void onTimerFinish() {
-                canGetCaptchaPhone = true;
-                phoneBtnCode.setText(getString(R.string.get_captcha));
-                phone_btn_code_old.setText(getString(R.string.get_captcha));
+                onTimerRest();
             }
         };
     }
@@ -186,9 +240,7 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
             hitStr = "请输入手机号码";
             noticeStr = "绑定手机号";
             phoneEtAccount.setHint(hitStr+"");
-            TitleBarUtils.getInstance()
-                    .setTitle(this, noticeStr)
-                    .setTitleFinish(this);
+            TitleBarUtils.getInstance().setTitle(this, noticeStr);
         }
     }
 
@@ -359,12 +411,25 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
 
     @Override
     public void bindTelSuccess(BaseMessage o) {
-        G.showToast(o.getMsg()+"");
-        if(where_from > 0){
-            Jump2View.getInstance()
-                    .goLoginView(activity, o);
+        G.showToast(o);
+        switch (where_from){
+            case FROM_SPLASH://非第一次登录(如:登录后直接重启),老用户需要绑定手机号
+                Intent intent = new Intent(activity, ActMain.class);
+                startActivity(intent);
+                finish();
+                break;
+            case FROM_LOGIN:
+            case 30001:
+                Jump2View.getInstance().checkLabel(activity, new Action1<BaseMessage>() {
+                    @Override
+                    public void call(BaseMessage baseMessage) {
+                        Intent intent = new Intent(activity, ActMain.class);
+                        activity.startActivity(intent);
+                        activity.finish();
+                    }
+                });
+                break;
         }
-        finish();
     }
 
     @Override
@@ -374,12 +439,13 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
 
     @Override
     public void bindTelSmsSuccess(BaseMessage o) {
-
+        G.showToast("请查看手机验证码");
     }
 
     @Override
     public void bindTelSmsFail(BaseMessage o) {
-        G.showToast(o.getMsg() + "");
+        G.showToast(o);
+        selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
 
     }
 
@@ -414,4 +480,6 @@ public class ChangeTelAct extends BaseActivity implements PhoneContract.View{
             selfCountDownTimer.cancel();
         }
     }
+    public static final int FROM_LOGIN = 1;//第一次登录,老用户需要绑定手机号
+    public static final int FROM_SPLASH = 2;//非第一次登录(如:登录后直接重启),老用户需要绑定手机号
 }

+ 4 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/DialogActivity.java

@@ -269,12 +269,10 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
                         }
                     }
                     break;
-                case 4://信用卡
-                    Jump2View.getInstance()
-                            .goHomePageView(activity, 3);
-//                    finish();
+                case 4://信用卡----------应该不会用到了------因为信用卡不会在这里显示
+                    Jump2View.getInstance().goCreditCardTaskList(activity, null);
                     break;
-                case 10://信用卡
+                case 10://H5
                     Ext ext;
                     if(taskEty == null) {
                         G.showToast(R.string.service_data_error);
@@ -313,7 +311,7 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
         if(taskEty.getRunTask() == 0){//领取任务
             buttonStr = CommonUtil.GET_TASK;
             type = -1;
-        }else if(taskEty.getTask_type() == 2){//信用卡业务
+        }else if(taskEty.getTask_type() == 2){//信用卡业务----------应该不会用到了------因为信用卡不会在这里显示
             type = 4;
             buttonStr = CommonUtil.START_TASK;
             dialogItemSizeTv.setVisibility(View.INVISIBLE);
@@ -465,19 +463,12 @@ public class DialogActivity extends Activity implements TaskDialogContract.View
                     .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                         @Override
                         public void onNext(BaseMessage baseMessage) {
-
-                            //暂停下载---这么改就不能暂停了
-//                            CommonUtil.getInstance().stopDownloadTask(activity, task_accepted_entity.getRelease_task().getTask().getDownload_link());
-                            if(BuildConfig.DEBUG)
-                                System.out.println("baseMessage onNext "+ JSON.toJSONString(baseMessage));
                             acceptedTask();
                             CommonUtil.getInstance().setTAskEnty(null);
                         }
 
                         @Override
                         public void onError(BaseMessage baseMessage) {
-                            if(BuildConfig.DEBUG)
-                                System.out.println("baseMessage onError "+JSON.toJSONString(baseMessage));
                             G.showToast(baseMessage);
                         }
                     });

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/FeedbackAct.java

@@ -18,6 +18,8 @@ import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FEEDBACK_COMMIT;
+
 /**
  * 意见反馈
  * Created by ljy on 2018/5/10.
@@ -64,6 +66,7 @@ public class FeedbackAct extends BaseActivity {
 
     @OnClick(R.id.tv_submit)
     public void onViewClicked() {
+        USER_FEEDBACK_COMMIT.onEvent();
         Content = feedbookEt.getText() +"";
         Email = feedbookEmailEt.getText() +"";
         if(android.text.TextUtils.isEmpty(Content)){

+ 8 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -31,6 +31,10 @@ import butterknife.BindView;
 import butterknife.OnClick;
 import rx.functions.Action1;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_PHONE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_QQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_WX;
+
 /**
  * Created by ljy on 2018/3/8.
  */
@@ -107,9 +111,10 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
 
     private void goTelLogin() {
+        LOGIN_PHONE.onEvent();
         String openId = SpUtils.getOpenId(getApplicationContext());
         if (!TextUtils.isEmpty(openId)) {
-            Jump2View.getInstance().goHomePageView(this, null);
+            Jump2View.getInstance().checkPhoneOrGoHomePage(this);
             finish();
         } else {
             Jump2View.getInstance().goPhoneLoginView(LoginAct.this, 0);
@@ -118,6 +123,7 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
     }
 
     private void goWeixin() {
+        LOGIN_WX.onEvent();
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
             @Override
             public void onStart(SHARE_MEDIA platform) {
@@ -154,6 +160,7 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
 
 
     private void loginQQ() {
+        LOGIN_QQ.onEvent();
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.QQ, new UMAuthListener() {
             @Override
             public void onStart(SHARE_MEDIA platform) {

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

@@ -119,10 +119,10 @@ public class MiddleAct extends Activity {
                             Jump2View.getInstance().goWithdrawalResultview(activity, NumberFormatUtils.parseFloat(msg.getMsg()));
                             break;
                         case 63://充值Q币
-                            Jump2View.getInstance().goRechargeQAct(activity,null);
+                            Jump2View.getInstance().goRechargeQAct(activity,"推送");
                             break;
                         case 64://充值绵羊币
-                            Jump2View.getInstance().goRechargeAct(activity,null);
+                            Jump2View.getInstance().goRechargeAct(activity,"推送");
                             break;
                         case 65://我的资产
                             Jump2View.getInstance().goMyMoney(activity,null);

+ 7 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java

@@ -35,6 +35,9 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_AVATAR;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_NAME;
+
 
 /**
  * Created by Administrator on 2018/3/16.
@@ -100,7 +103,7 @@ public class PersionInfoAct extends AbsChooseImageActivity {
                 tvSheepId.setText(mEntity.getInvitation_code());
 
                 Glide.with(PersionInfoAct.this)
-                        .load(AppUtil.getQRLink(mEntity.getShare_link(), 90))
+                        .load(AppUtil.getQRLink(mEntity.getShareLink(), 90))
                         .into(tvQr);
                 Glide.with(PersionInfoAct.this)
                         .load("http://cdngame.kuaifazs.com/icon.png")
@@ -140,12 +143,14 @@ public class PersionInfoAct extends AbsChooseImageActivity {
                 Intent i = new Intent(PersionInfoAct.this, ReNameActivity.class);
                 i.putExtra("name", mEntity.getNickname());
                 startActivity(i);
+                USER_INFO_NAME.onEvent();
                 break;
             case R.id.rl_qr:
-                ViewUtil.showQR(PersionInfoAct.this, mEntity.getShare_link());
+                ViewUtil.showQR(PersionInfoAct.this, mEntity.getShareLink());
                 break;
             case R.id.rl_head:
                 showChooseDialog();
+                USER_INFO_AVATAR.onEvent();
                 break;
         }
     }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java

@@ -90,7 +90,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
                 .inject(this);
         if(TestUtil.isTest()){
             phoneEtAccount.setInputType(InputType.TYPE_CLASS_TEXT);
-            phoneEtAccount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(40)});
+            phoneEtAccount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
         }
         GlideImageLoader.centerImage( phone_iv, "http://cdngame.kuaifazs.com/icon_phone.png");
     }

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ReNameActivity.java

@@ -27,6 +27,8 @@ import javax.inject.Inject;
 import butterknife.BindView;
 import butterknife.OnClick;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_INFO_NAME_MODIFY;
+
 /**
  * Created by Administrator on 2018/3/24.
  */
@@ -124,6 +126,7 @@ public class ReNameActivity extends BaseActivity implements ReNameContract.View
 
     @OnClick(R.id.tv_submit)
     public void onClick() {
+        USER_INFO_NAME_MODIFY.onEvent();
         if(android.text.TextUtils.isEmpty(et.getText().toString())){
             G.showToast("请输入昵称");
             return;

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/RechargeAct.java

@@ -29,6 +29,8 @@ import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_PAY;
+
 /**
  * Created by Administrator on 2018/3/19.
  * 充值界面
@@ -205,6 +207,7 @@ public class RechargeAct extends BaseActivity {
         switch (view.getId()) {
 
             case R.id.tv_recharge_pay:
+                RECHARGE_PAY.onEvent();
                 if (mPayType == -1) {
                     G.showToast("请选择支付方式");
                     return;

+ 12 - 10
app/src/main/java/com/sheep/gamegroup/view/activity/RechargeQAct.java

@@ -46,6 +46,8 @@ import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.RECHARGE_QQ_PAY;
+
 /**
  * Q币充值
  */
@@ -217,27 +219,27 @@ public class RechargeQAct extends BaseActivity implements RechargeQContract.View
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.tv_myb_recharge:
-                Jump2View.getInstance().goRechargeAct(activity,null);
+                Jump2View.getInstance().goRechargeAct(activity, "充值Q币");
                 break;
             case R.id.rechargeq_sure:
-                if(TextUtils.isEmpty(text_QBNumber)){
+                RECHARGE_QQ_PAY.onEvent();
+                if (TextUtils.isEmpty(text_QBNumber)) {
                     text_QBNumber = etQbNumber.getText().toString().trim();
                 }
-                if(TextUtils.isEmpty(text_QBNumber)){
+                if (TextUtils.isEmpty(text_QBNumber)) {
                     G.showToast("请选择充值Q币数量");
                     return;
                 }
                 text_qq = etQq.getText().toString().trim();
-                if(TextUtils.isEmpty(text_qq)){
+                if (TextUtils.isEmpty(text_qq)) {
                     G.showToast("请输入QQ号");
                     return;
                 }
-
-         showProgress();
-         JSONObject jsonObject = new JSONObject();
-         jsonObject.put("amount", NumberFormatUtils.parseInteger(text_QBNumber));
-         jsonObject.put("qq",text_qq);
-         presenter.goRechargeQ(jsonObject);
+                showProgress();
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("amount", NumberFormatUtils.parseInteger(text_QBNumber));
+                jsonObject.put("qq", text_qq);
+                presenter.goRechargeQ(jsonObject);
                 break;
         }
     }

+ 9 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/SignCardAct.java

@@ -227,7 +227,13 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
     public void succPunchAndSignCount(BaseMessage o) {
         PunchAndSign punchAndSign = o.getData(PunchAndSign.class);
         signTvJrcyrs.setText(String.format(getString(R.string.sign_number), punchAndSign.getPunch_count()));
-        signTvJrbmrs.setText(String.format(getString(R.string.sign_number1), punchAndSign.getSign_up_count()));
+        signTvJrbmrs.setText(
+                String.format(
+                        getString(R.string.sign_number1
+                        ),
+                        punchAndSign.getSign_up_count()
+                )
+        );
 
         signTvKpf.setText(getSpannableString(punchAndSign.getTotal_award()));//今日可分
         signTvMrcyrs.setText(getSpannableString(punchAndSign.getSign_up_count()));//明日可分
@@ -256,6 +262,7 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
     private UserEntity userEntity;
 
     private void trySignUp() {
+        UMConfigUtils.Event.PUNCH_PUNCH.onEvent();
         if (userEntity == null) {
             try {
                 userEntity = MyDbManager.getInstance().dbFindUser();
@@ -266,7 +273,6 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
         if (userEntity == null || TextUtils.isEmpty(userEntity.getBalance())) {
             G.showToast(R.string.unknown_error);
         } else if (NumberFormatUtils.parseFloat(userEntity.getBalance()) >= 1) {
-            UMConfigUtils.Event.PUNCH_PUNCH.onEvent();
             presenter.goSignUp();
         } else {
             ViewUtil.showMsgDialog(activity, new DialogConfig().setMsg("抱歉,你的余额不足,请先去充值再来参与打卡哦!").setBtnRightText("好的").setBtnLeftText("去充值")
@@ -280,6 +286,7 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
     }
 
     private void tryPunch() {
+        UMConfigUtils.Event.PUNCH_SIGN_UP.onEvent();
         switch (punchType) {//1未报名 2已打卡 3可以打卡 4已经过了时间 5活动暂未开始
             case 1:
                 ViewUtil.showMsgDialog(activity, "您昨日未报名,无法获取今日打卡资格,先去报名吧!");//未报名
@@ -289,7 +296,6 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
                 break;
             case 3:
                 presenter.goSignPunch();
-                UMConfigUtils.Event.PUNCH_SIGN_UP.onEvent();
                 break;
             case 4:
                 ViewUtil.showMsgDialog(activity, "今日打卡活动已结束,请先去报名,明日再来哦!");

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -46,6 +46,8 @@ import pub.devrel.easypermissions.EasyPermissions;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.AD_SPLASH;
+
 /**
  * Created by ljy on 2018/3/9.
  */
@@ -162,7 +164,6 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         advertising = baseMessage.getData(Advertising.class);
                         isLoaddingData = false;
                         if(advertising == null || TextUtils.isEmpty(advertising.getDisplay_src())){
@@ -178,7 +179,6 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        LogUtil.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         isLoaddingData = false;
                         sendHandlerMessages();
                     }
@@ -319,6 +319,7 @@ public class SplashAct extends BaseActivity implements EasyPermissions.Permissio
             case R.id.splash_click_view:
                 if(advertising != null) {
                     goAdLink(activity, advertising);
+                    AD_SPLASH.onEvent("ad_id", advertising.getId());
                 }else {
                     gotoNext();
                 }

+ 44 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java

@@ -85,6 +85,8 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.GAME_INSTEAD_OF_RECHARGE_GET;
+
 /**
  * 任务详情页面
  * Created by ljy on 2018/4/2.
@@ -175,7 +177,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     private TaskAcceptedEty gettaskAcceptedEty;
 
     private int taskId = -1;
-    private int game_id = -1;
+    private String game_id;
     private int game_type = -1;
 
     private int type;//-1:开始任务 1:下载 2:安装 3:打开  10:打开H5,101:充值  100:领取奖励
@@ -202,7 +204,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         btn_show = getIntent().getBooleanExtra("btn_show", false);
         isFromTaskList = getIntent().getBooleanExtra("is_from_task_list", false);
         taskId = getIntent().getIntExtra("task_id", -1);
-        game_id = getIntent().getIntExtra("game_id", -1);
+        game_id = getIntent().getStringExtra("game_id");
         game_type = getIntent().getIntExtra("game_type", -1);
         LogUtil.println("TaskDetailAct", "btn_show =", btn_show, "isFromTaskList =", isFromTaskList, "taskId =", taskId, "game_id =", game_id, "game_type =", game_type);
         DaggerTaskDetailComponent.builder()
@@ -260,7 +262,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         bottom_btn_layout.setVisibility(View.VISIBLE);
         btnTaskItem.setVisibility(View.VISIBLE);
         btnUpImag.setVisibility(View.VISIBLE);
-        if (taskReleaseEty.isIs_running() || game_id > 0) {//已经领取任务
+        if (taskReleaseEty.isIs_running() || game_id != null) {//已经领取任务
             switch (taskEty.getTask_type()) {// 1时间试玩任务 2 信用卡任务 3应用下载 4h5业务 1001畅思 1000连续任务, 1002 1003游戏任务
                 case 4://h5业务
                     type = 10;
@@ -273,6 +275,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                     setBottomState();
                     break;
             }
+        } else if(taskEty.isGameReservationCantDownload()){//游戏任务中还不可以下载的预约任务
+            btnUpImag.setText("预约下载");
+            btnTaskItem.setVisibility(View.GONE);
+            btnUpImag.setVisibility(View.VISIBLE);
         } else {
             type = -1;
             btnTaskItem.setText(CommonUtil.GET_TASK);
@@ -333,6 +339,20 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                         break;
                     }
             }
+            if(taskEty.isGameReservationCantDownload()) {//游戏任务中还不可以下载的预约任务
+                btnUpImag.setText("即将开放");
+                btnUpImag.setEnabled(false);
+                btnUpImag.setVisibility(View.VISIBLE);
+                btnTaskItem.setVisibility(View.GONE);
+            }
+        }
+        /**
+         * detail_task_tv 游戏任务,显示
+         */
+        if(taskEty.isGameTask() &&taskEty.isCan_receive_account()){
+            detailTaskTv.setVisibility(View.VISIBLE);
+            detailTaskTv.setText("领取福利号");
+            detailTaskTv.setBackground(activity.getResources().getDrawable(R.drawable.selector_button_full_main));
         }
     }
     //设置底部按钮状态
@@ -495,6 +515,19 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         try {
             switch (view.getId()) {
                 case R.id.detail_task_tv://查看任务截图
+                    if(taskEty.isGameTask() &&taskEty.isCan_receive_account()){
+
+                        GAME_INSTEAD_OF_RECHARGE_GET.onEvent();
+                        CommonUtil.getInstance()
+                                .gameAccountManager(activity, Integer.parseInt(taskReleaseEty.getTask_id()), new Action1<BaseMessage>() {
+                                    @Override
+                                    public void call(BaseMessage baseMessage) {
+                                        G.showToast("领取成功");
+                                        initData();
+                                    }
+                                });
+                        return;
+                    }
                     if (gettaskAcceptedEty == null || TextUtils.isEmpty(gettaskAcceptedEty.getScreenshots())) {
                         G.showToast("任务截图为空");
                         return;
@@ -567,12 +600,16 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                     break;
                 case R.id.btn_up_imag:
                     if(game_type == 1){
-                        if(game_id > 0){
-                            ViewUtil.showGamePayAccount(activity, game_id);
+                        if(game_id != null){
+                            ViewUtil.showGamePayAccount(activity, game_id, taskReleaseEty.getName());
                             return;
                         }
                     }else if(taskEty.getTask_type() == 1002 ||taskEty.getTask_type() == 1003){
-                        accepteReceiveAward();
+                        if(taskEty.isGameReservationCantDownload()){
+                            CommonUtil.getInstance().reservationGameTask(activity, taskReleaseEty, null);
+                        } else {
+                            accepteReceiveAward();
+                        }
                     }else if(taskEty.getInspect_type() == 3) {//应用自动审核任务
                         try {
                             checkAndCommitTask();
@@ -807,7 +844,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
         showProgress(true);
         JSONObject object = new JSONObject();
         object.put("device_id", DeviceUtil.getDeviceId(activity));
-        object.put("release_task_id", Integer.valueOf(taskReleaseEty.getId() + ""));
+        object.put("release_task_id", taskReleaseEty.getId());
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()

+ 1 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAddQQAct.java

@@ -143,13 +143,9 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
         ButterKnife.bind(this);
     }
 
-    @OnClick({R.id.detail_task_tv, R.id.web_text, R.id.ll_infos, R.id.btn_task_item, R.id.btn_up_imag})
+    @OnClick({R.id.btn_up_imag})
     public void onViewClicked(View view) {
         switch (view.getId()) {
-            case R.id.web_text:
-                break;
-            case R.id.ll_infos:
-                break;
             case R.id.btn_up_imag:
                 showChooseDialog(false, true, DEFAULT_MAX_COUNT);
                 UMConfigUtils.onEvent(UMConfigUtils.Event.TASK_UPLOAD_PICTURE);
@@ -179,8 +175,6 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
                     .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
                         @Override
                         public void onNext(BaseMessage baseMessage) {
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                             setLoaddingText("完成");
                             onGetNetImageUrl(url);
                             G.showToast("提交成功,等待审核!");
@@ -190,8 +184,6 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
 
                         @Override
                         public void onError(BaseMessage baseMessage) {
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                             updateError(baseMessage.getErrorMsg());
                         }
                     });
@@ -203,8 +195,6 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
                     .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
                         @Override
                         public void onNext(BaseMessage baseMessage) {
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                             setLoaddingText("完成");
                             onGetNetImageUrl(url);
                             G.showToast("提交成功,等待审核!");
@@ -214,8 +204,6 @@ public class TaskDetailAddQQAct extends AbsChooseImageActivity {
 
                         @Override
                         public void onError(BaseMessage baseMessage) {
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                             updateError(TextUtils.isEmpty(baseMessage.getMsg()) ? "服务器错误,请稍候再试" : baseMessage.getMsg());
                         }
                     });

+ 0 - 8
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java

@@ -205,8 +205,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(activity) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         taskReleaseEty = baseMessage.getData(TaskReleaseEty.class);
                         if(taskReleaseEty == null){
                             baseMessage.setMsg("暂无数据");
@@ -221,8 +219,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                         hideProgress();
                         G.showToast(baseMessage.getMsg() + "");
                     }
@@ -277,8 +273,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
                 .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        if (BuildConfig.DEBUG)
-                            System.out.println("baseMessage onNext " + JSON.toJSONString(baseMessage));
                         goWeb();
                     }
 
@@ -287,8 +281,6 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
                         if (baseMessage.getCode() == 1001) {//已经接受过该任务
                             onNext(baseMessage);
                         } else {
-                            if (BuildConfig.DEBUG)
-                                System.out.println("baseMessage onError " + JSON.toJSONString(baseMessage));
                             G.showToast(baseMessage);
                             hideProgress();
                         }

+ 3 - 37
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -15,6 +15,7 @@ import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.kfzs.duanduan.utils.dlg.FormatAny;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerWithdrawalComponent;
 import com.sheep.gamegroup.di.modules.WithdrawalModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -31,7 +32,6 @@ import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.view.adapter.WithdrawalAdapter;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
@@ -153,7 +153,6 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     }
 
     private void doWithdrawal() {
-//        String price1 = ((GridViewEntity)withdrawalGreidview.getSelectedItem()).getValue();
         UMConfigUtils.Event.SHEEP_TIXIAN_COMMIT.onEvent();
         if(ListUtil.hasIndex(wlLists, select)) {
             amount = wlLists.get(select).getGridViewEntity().getValue();
@@ -172,45 +171,12 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
         }
     }
 
-    /**
-     * 组装 adapter 数据
-     */
-    private ArrayList<Object> assemblyData(){
-        listData.clear();
-        listData.add(new GridViewEntity(true,10+""));
-        listData.add(new GridViewEntity(false,30+""));
-        listData.add(new GridViewEntity(false,50+""));
-        listData.add(new GridViewEntity(false,100+""));
-        listData.add(new GridViewEntity(false,500+""));
-        listData.add(new GridViewEntity(false,1000+""));
-        return listData;
-    }
 
-    /**
-     *40001 //没有绑定真实姓名
-     *40002 //没有绑定真实省份证
-     *40003 //没有绑定真实银行卡
-     * @param o
-     */
     @Override
     public void failData(Object o) {
         hideProgress();
-        try {
-            BaseMessage baseMessage = (BaseMessage) o;
-            switch (baseMessage.getCode()){
-                case 40001:
-                case 40002:
-                case 40003:
-                    Jump2View.getInstance().goBindDataView(activity, baseMessage.getCode());
-                    break;
-                default:
-                    G.showToast(baseMessage.getMsg()+"");
-                    break;
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-            G.showToast(" 网络错误!");
-        }
+        if(o instanceof BaseMessage)
+            G.showToast((BaseMessage) o);
     }
 
     @Override

+ 148 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAccount.java

@@ -0,0 +1,148 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.kfzs.duanduan.adp.AdpCommonRecy;
+import com.kfzs.duanduan.event.BigEvent;
+import com.kfzs.duanduan.event.EventTypes;
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.entity.GameAccountEntity;
+import com.sheep.gamegroup.model.entity.RecyleObj;
+import com.sheep.gamegroup.model.entity.RecyleType;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.ViewHolder;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.util.List;
+
+import rx.functions.Action1;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT_DEL;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT_DEL_COMMIT;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT_LOOK;
+
+/**
+ * Created by ljy on 2018/7/10.
+ */
+
+public class AdpGameAccount extends AdpCommonRecy<RecyleObj> {
+
+    private Context context;
+    public AdpGameAccount(Context context) {
+        super(context);
+        this.context = context;
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return getmListDatas().get(position).getRecyleType().ordinal();
+    }
+    @Override
+    public int getViewIdByType(int type) {
+        int resId = R.layout.empty;
+        RecyleType recyleType = RecyleType.values()[type];
+        switch (recyleType){
+            case GAME_ACCOUNT_PLATFORM:
+            case GAME_ACCOUNT_TENCENT:
+            case GAME_ACCOUNT_XIAOMI:
+                resId = R.layout.try_mkmy_release_task_list;
+                break;
+        }
+        return resId;
+    }
+
+    @Override
+    public void convert(final com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder holder, RecyleObj recyleObj) {{
+        final List<GameAccountEntity> etyList = (List<GameAccountEntity>) recyleObj.getDataObj();
+        if(etyList == null)
+            return;
+        TextView item_title_tv = holder.itemView.findViewById(R.id.item_title_tv);
+        item_title_tv.setVisibility(View.VISIBLE);
+        item_title_tv.setTextColor(context.getResources().getColor(R.color.black_444444));
+        item_title_tv.setPadding(3,3,3,3);
+        switch (recyleObj.getRecyleType()){
+            case GAME_ACCOUNT_PLATFORM:
+                item_title_tv.setText("快发平台账号");
+                break;
+            case GAME_ACCOUNT_TENCENT:
+                item_title_tv.setText("腾讯游戏账号");
+                break;
+            case GAME_ACCOUNT_XIAOMI:
+                item_title_tv.setText("小米游戏账号");
+                break;
+        }
+        RecyclerView recyclerView = holder.getView(R.id.release_task_listview, RecyclerView.class);
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setLayoutManager(new LinearLayoutManager(context));
+
+        recyclerView.setAdapter(new AdbCommonRecycler<GameAccountEntity>(context, etyList){
+
+
+            @Override
+            public int getViewIdByType(int type) {
+                return R.layout.adp_game_account_item;
+            }
+
+            @Override
+            public void convert(ViewHolder holder, final GameAccountEntity item) {
+                if(item == null){
+                    return;
+                }
+                TextView account_tv = holder.itemView.findViewById(R.id.account_tv);
+                TextView state_tv = holder.itemView.findViewById(R.id.state_tv);
+                TextView look_tv = holder.itemView.findViewById(R.id.look_tv);
+                LinearLayout delete_layout = holder.itemView.findViewById(R.id.delete_layout);
+
+                account_tv.setText("账号:"+ CommonUtil.getInstance().returnStarData(item.getAccount(), 4, 2, 3));
+                state_tv.setText(item.getTypeName());
+                look_tv.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        USER_GAME_ACCOUNT_LOOK.onEvent();
+                        ViewUtil.newInstance().showGameAccountDetail((Activity) context, item.getId());
+                    }
+                });
+                delete_layout.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        USER_GAME_ACCOUNT_DEL.onEvent();
+                        ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("删除确认").setMsg("确定删除吗?").setBtnRightText("取消")
+                                .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
+                                    @Override
+                                    public void onClick(View view) {
+                                        USER_GAME_ACCOUNT_DEL_COMMIT.onEvent();
+                                        CommonUtil.getInstance().deleteGameAccount(context, item.getId(), new Action1<Integer>() {
+                                            @Override
+                                            public void call(Integer integer) {
+                                                if (integer == 1){
+                                                    G.showToast("删除成功!");
+                                                    EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.DELETE_GAME_ACCOUNT_REFRESH));
+                                                }else {
+                                                    G.showToast("删除失败!");
+                                                }
+                                            }
+                                        });
+                                    }
+                                }));
+                    }
+                });
+            }
+        });
+    }
+
+    }
+}

+ 74 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAgencyRecharge.java

@@ -0,0 +1,74 @@
+package com.sheep.gamegroup.view.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.List;
+
+/**
+ * 游戏代充 gridview
+ * Created by ljy on 2018/7/9.
+ */
+
+public class AdpGameAgencyRecharge extends BaseAdapter {
+    private Context context;
+    private List<Object> list;
+
+    public AdpGameAgencyRecharge(Context context, List<Object> list) {
+        this.context = context;
+        this.list = list;
+    }
+
+    @Override
+    public int getCount() {
+        return list.size();
+    }
+
+    @Override
+    public GridViewEntity getItem(int position) {
+        return (GridViewEntity) list.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
+            holder = new ViewHolder();
+            convertView = LayoutInflater.from(context).inflate(R.layout.adp_level_gridview_item, null);
+            holder.name_tv = convertView.findViewById(R.id.name_tv);
+            holder.line_view = convertView.findViewById(R.id.line_view);
+
+            convertView.setTag(holder);
+        }
+
+        if (getItem(position).isSelectState()){
+            holder.name_tv.setTextColor(context.getResources().getColor(R.color.blue_end));
+            holder.line_view.setVisibility(View.VISIBLE);
+        }else{
+            holder.name_tv.setTextColor(context.getResources().getColor(R.color.txt_black_818181));
+            holder.line_view.setVisibility(View.INVISIBLE);
+        }
+        holder.name_tv.setText(getItem(position).getName()+"");
+        return convertView;
+    }
+
+    class ViewHolder{
+        TextView name_tv;
+        View line_view;
+    }
+}

+ 47 - 9
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameTaskOrderList.java

@@ -7,12 +7,14 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.sheep.gamegroup.model.entity.GameTaskOrderEnty;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 
 import java.util.List;
@@ -46,8 +48,11 @@ public class AdpGameTaskOrderList extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.adp_gametask_order_layout, null);
             holder.pay_type_tv = convertView.findViewById(R.id.pay_type_tv);
@@ -59,9 +64,9 @@ public class AdpGameTaskOrderList extends BaseAdapter {
             holder.pay_tv = convertView.findViewById(R.id.pay_tv);
             holder.pay_tyoe_show_tv = convertView.findViewById(R.id.pay_tyoe_show_tv);
             holder.pay_layout = convertView.findViewById(R.id.pay_layout);
+            holder.question_img = convertView.findViewById(R.id.question_img);
+            holder.line_view = convertView.findViewById(R.id.line_view);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
         final GameTaskOrderEnty gameTaskOrderEnty = getItem(position);
 
@@ -93,12 +98,15 @@ public class AdpGameTaskOrderList extends BaseAdapter {
 
         holder.pay_layout.setVisibility(View.GONE);
         holder.pay_tyoe_show_tv.setVisibility(View.VISIBLE);
-        String stateStr = "";
+        holder.question_img.setVisibility(View.GONE);
+        holder.line_view.setVisibility(View.VISIBLE);
+        holder.pay_tyoe_show_tv.setTextColor(context.getResources().getColor(R.color.red_fd2d54));
         switch (gameTaskOrderEnty.getStatus()){
             case 0:
             default:
                 holder.order_type_tv.setText("订单状态:未完成");
                 holder.pay_layout.setVisibility(View.VISIBLE);
+                holder.line_view.setVisibility(View.GONE);
                 holder.pay_tyoe_show_tv.setVisibility(View.GONE);
                 break;
             case 1:
@@ -113,17 +121,21 @@ public class AdpGameTaskOrderList extends BaseAdapter {
                 holder.order_type_tv.setText("订单状态:未完成");
                 holder.pay_tyoe_show_tv.setText("充值中");
                 break;
-            case 4:
+            case 4://type 1:游戏充值 2腾讯游戏  3小米游戏
                 holder.order_type_tv.setText("订单状态:未完成");
-                holder.pay_tyoe_show_tv.setText("充值中");
+                holder.pay_tyoe_show_tv.setText("充值失败");
+                showQuestion(holder.question_img, gameTaskOrderEnty);
                 break;
             case 5:
                 holder.order_type_tv.setText("订单状态:已完成");
                 holder.pay_tyoe_show_tv.setText("支付成功");
+                holder.pay_tyoe_show_tv.setTextColor(context.getResources().getColor(R.color.green_btn_bg));
+                showQuestion(holder.question_img, gameTaskOrderEnty);
                 break;
-            case 6:
+            case 6://type 1:游戏充值 2腾讯游戏  3小米游戏
                 holder.order_type_tv.setText("订单状态:订单失败");
                 holder.pay_tyoe_show_tv.setText("已退款");
+                showQuestion(holder.question_img, gameTaskOrderEnty);
                 break;
 
         }
@@ -152,12 +164,38 @@ public class AdpGameTaskOrderList extends BaseAdapter {
                                 1);
             }
         });
-
         return convertView;
     }
 
     class ViewHolder{
         LinearLayout pay_layout;
         TextView date_tv, price_tv, pay_type_tv,order_type_tv, order_end_time_tv, pay_tyoe_show_tv, pay_tv,pay_cancel_tv;
+        ImageView question_img;
+        View line_view;
+    }
+
+    /**
+     * 是否显示?
+     */
+    private boolean showQuestion(View view, final GameTaskOrderEnty gameTaskOrderEnty ){
+
+        if(!TextUtils.isEmpty(gameTaskOrderEnty.getRemark())){
+            view.setVisibility(View.VISIBLE);
+
+            //失败提示
+            view.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    ViewUtil.showMsgDialog(context,
+                            gameTaskOrderEnty.getRemark(),
+                            gameTaskOrderEnty.isSuccess() ? "成功提示" : "失败原因",
+                            false);
+                }
+            });
+        }else {
+            view.setVisibility(View.GONE);
+        }
+
+        return false;
     }
 }

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

@@ -50,10 +50,10 @@ public class AdpHomeListGrideview extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        Object tag = convertView!= null ? convertView.getTag() : null;
+        Object tag = convertView == null ? null : convertView.getTag();
         ViewHolder holder;
         if(tag instanceof ViewHolder){
-            holder = (ViewHolder) convertView.getTag();
+            holder = (ViewHolder) tag;
         }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.adp_homelist_gridview, null);
@@ -83,7 +83,7 @@ public class AdpHomeListGrideview extends BaseAdapter {
             public void onClick(View v) {
                 UMConfigUtils.IdEvent.HOME_LIST.commit(entity.getId());
                 CommonUtil.getInstance()
-                        .goWhere(context, entity);
+                        .goWhere(context, entity, "首页");
             }
         });
         return convertView;

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

@@ -48,10 +48,10 @@ public class AdpHomeListListview extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        Object tag = convertView!= null ? convertView.getTag() : null;
+        Object tag = convertView == null ? null : convertView.getTag();
         ViewHolder holder;
         if(tag instanceof ViewHolder){
-            holder = (ViewHolder) convertView.getTag();
+            holder = (ViewHolder) tag;
         }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.adp_homelist_listview,null);
@@ -85,7 +85,7 @@ public class AdpHomeListListview extends BaseAdapter {
             public void onClick(View v) {
                 UMConfigUtils.IdEvent.HOME_LIST.commit(entity.getId());
                 CommonUtil.getInstance()
-                        .goWhere(context, entity);
+                        .goWhere(context, entity, "首页");
             }
         });
         return convertView;

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTaskDetailChildListview.java

@@ -43,16 +43,17 @@ public class AdpTaskDetailChildListview extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.adp_taskdetail_child_listview, null);
             holder.item_name_tv = convertView.findViewById(R.id.item_name_tv);
             holder.item_detail_tv = convertView.findViewById(R.id.item_detail_tv);
             holder.state_task_tv = convertView.findViewById(R.id.state_task_tv);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
         TaskChild taskChild = (TaskChild) getItem(position);
         if(taskChild == null){

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpTrymakemoneyTabGridview.java

@@ -42,15 +42,16 @@ public class AdpTrymakemoneyTabGridview extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.withdrawal_gridview_item, null);
             holder.item_tv = convertView.findViewById(R.id.item_tv);
 
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
 
         if (getItem(position).isSelectState()){

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/RechargeAdapter.java

@@ -54,14 +54,15 @@ public class RechargeAdapter extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if (holder == null) {
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.recharge_gridview_item, null);
             holder.tv_pay = convertView.findViewById(R.id.tv_pay);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
         RechargeEntity priceShow = getItem(position);
         if (position == select){

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/TaskListItemAdp.java

@@ -63,8 +63,11 @@ public class TaskListItemAdp extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.task_list_item, null);
             holder.name_tv = convertView.findViewById(R.id.name_tv);
@@ -73,8 +76,6 @@ public class TaskListItemAdp extends BaseAdapter {
             holder.icon_iv = convertView.findViewById(R.id.icon_iv);
             holder.detail_task_tv = convertView.findViewById(R.id.detail_task_tv);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
 
         final TaskAcceptedEty ety = (TaskAcceptedEty) getItem(position);

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/TaskStateAdapter.java

@@ -45,16 +45,17 @@ public class TaskStateAdapter extends BaseAdapter {
     @SuppressLint("ResourceAsColor")
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.task_state_item, null);
             holder.line_view = convertView.findViewById(R.id.line_view);
             holder.name_tv = convertView.findViewById(R.id.name_tv);
             holder.point_iv = convertView.findViewById(R.id.point_iv);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
         holder.name_tv.setText(getItem(position).getName()+"");
         if(getItem(position).getStatus() == 1){

+ 5 - 4
app/src/main/java/com/sheep/gamegroup/view/adapter/TaskdetailSonListviewAdp.java

@@ -61,8 +61,11 @@ public class TaskdetailSonListviewAdp extends BaseAdapter {
 
     @Override
     public View getView(final int position, View convertView, ViewGroup parent) {
-        ViewHolder holder = null;
-        if(holder == null){
+        Object tag = convertView == null ? null : convertView.getTag();
+        ViewHolder holder;
+        if(tag instanceof ViewHolder){
+            holder = (ViewHolder) tag;
+        }else {
             holder = new ViewHolder();
             convertView = LayoutInflater.from(context).inflate(R.layout.taskdetail_mylistview_item, null);
             holder.title_item_tv = convertView.findViewById(R.id.title_item_tv);
@@ -78,8 +81,6 @@ public class TaskdetailSonListviewAdp extends BaseAdapter {
             holder.title_item_price_tv = convertView.findViewById(R.id.title_item_price_tv);
             holder.item_detail_show_layout = convertView.findViewById(R.id.item_detail_show_layout);
             convertView.setTag(holder);
-        }else {
-            holder = (ViewHolder) convertView.getTag();
         }
         final TaskChild descEntity = descEntityArrayList.get(position);
         if(descEntity == null)

+ 0 - 0
app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor