liujiangyao лет назад: 7
Родитель
Сommit
02fd1d4943
25 измененных файлов с 1190 добавлено и 196 удалено
  1. 1 0
      app/src/main/java/com/kfzs/duanduan/event/EventTypes.java
  2. 3 0
      app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java
  3. 5 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  4. 11 1
      app/src/main/java/com/sheep/gamegroup/model/entity/GameAgencyRechargePlatformEntity.java
  5. 33 0
      app/src/main/java/com/sheep/gamegroup/model/entity/GamePayList.java
  6. 118 0
      app/src/main/java/com/sheep/gamegroup/model/entity/PayEntity.java
  7. 2 2
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  8. 51 0
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  9. 4 2
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  10. 19 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAccount.java
  11. 54 13
      app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java
  12. 31 0
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAccount.java
  13. 1 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGameAgencyRecharge.java
  14. 83 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  15. 147 118
      app/src/main/java/com/sheep/gamegroup/view/dialog/DialogAddAccount.java
  16. 130 0
      app/src/main/java/com/sheep/gamegroup/view/dialog/DialogModifyAccount.java
  17. 152 3
      app/src/main/java/com/sheep/gamegroup/view/dialog/DialogPayAccount.java
  18. 88 10
      app/src/main/java/com/sheep/gamegroup/view/dialog/DialogPayGame.java
  19. 38 25
      app/src/main/java/com/sheep/gamegroup/view/dialog/SelfPopupWindow.java
  20. 0 1
      app/src/main/res/layout/adp_level_gridview_item.xml
  21. 15 15
      app/src/main/res/layout/dialog_add_account.xml
  22. 2 1
      app/src/main/res/layout/dialog_item_game_list.xml
  23. 90 0
      app/src/main/res/layout/dialog_modify_account.xml
  24. 38 2
      app/src/main/res/layout/dialog_pa_game_center.xml
  25. 74 1
      app/src/main/res/layout/dialog_pay_account.xml

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

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

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

@@ -913,6 +913,9 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
                     case 12://闲玩任务
                     case 12://闲玩任务
                         Jump2View.getInstance().goXianwanWeb(activity,null, null);
                         Jump2View.getInstance().goXianwanWeb(activity,null, null);
                         break;
                         break;
+                    case 13://游戏代充
+                        Jump2View.getInstance().goGameRecharge(activity,null);
+                        break;
                     default:
                     default:
                         G.showToast(R.string.coming_soon);
                         G.showToast(R.string.coming_soon);
                         break;
                         break;

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

@@ -688,4 +688,9 @@ public interface ApiService {
      */
      */
     @GET("app/game_account/all/list")
     @GET("app/game_account/all/list")
     Observable<BaseMessage> getGameAccountAllList();
     Observable<BaseMessage> getGameAccountAllList();
+    /**
+     *获取计算可用定向消费券的数据
+     */
+    @GET("app/game_consumption/voucher_and_ratio")
+    Observable<BaseMessage> getVoucherAndRatio(@Query("game_id") String game_id);
 }
 }

+ 11 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/GameAgencyRechargePlatformEntity.java

@@ -11,11 +11,21 @@ public class GameAgencyRechargePlatformEntity implements Serializable {
     private int icon;
     private int icon;
     private String name;
     private String name;
     private String desc;
     private String desc;
+    private int task_type;
 
 
-    public GameAgencyRechargePlatformEntity(int icon, String name, String desc) {
+    public GameAgencyRechargePlatformEntity(int icon, String name, String desc, int task_type) {
         this.icon = icon;
         this.icon = icon;
         this.name = name;
         this.name = name;
         this.desc = desc;
         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() {
     public int getIcon() {

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

@@ -0,0 +1,33 @@
+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;
+
+    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;
+    }
+}

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

@@ -0,0 +1,118 @@
+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;
+
+    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 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;
+    }
+}

+ 2 - 2
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 remarks;//private String string",
     private String task_name;//private String string",
     private String task_name;//private String string",
     private String screenshots;//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 update_time;// 0
     private String icon;
     private String icon;
     private String package_size;
     private String package_size;
@@ -389,7 +389,7 @@ public class TaskEty implements Serializable, IDownload {
      * @return
      * @return
      */
      */
     public boolean isGameTask() {
     public boolean isGameTask() {
-        return task_type == 1002 || task_type == 1003;
+        return task_type == 1002 || task_type == 1003 || task_type ==1004;
     }
     }
 
 
 
 

+ 51 - 0
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -424,6 +424,9 @@ public class CommonUtil {
             case 12://闲玩任务
             case 12://闲玩任务
                 Jump2View.getInstance().goXianwanWeb(context,null, null);
                 Jump2View.getInstance().goXianwanWeb(context,null, null);
                 break;
                 break;
+            case 13://游戏代充
+                Jump2View.getInstance().goGameRecharge((Activity) context,null);
+                break;
             default:
             default:
                 G.showToast(R.string.coming_soon);
                 G.showToast(R.string.coming_soon);
                 break;
                 break;
@@ -1119,4 +1122,52 @@ public class CommonUtil {
         }
         }
         return value;
         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);
+                    }
+                });
+    }
 }
 }

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

@@ -29,6 +29,7 @@ import com.bumptech.glide.request.RequestOptions;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 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.activity.SplashAct;
 import com.sheep.gamegroup.view.dialog.DialogAddAccount;
 import com.sheep.gamegroup.view.dialog.DialogAddAccount;
 import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
 import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
@@ -608,10 +609,11 @@ public class ViewUtil {
     public static void showGamePayAccount(Activity activity,String gameId){
     public static void showGamePayAccount(Activity activity,String gameId){
         new DialogPayAccount(activity,gameId).showPayaccount();
         new DialogPayAccount(activity,gameId).showPayaccount();
     }
     }
-    public static void showGamePay(Activity activity, String game_account_etStr, String game_pay_etStr,String gameId){
-        new DialogPayGame(activity, game_account_etStr, game_pay_etStr,gameId).showPayGame();
+    public static void showGamePay(Activity activity, PayEntity payEntity){
+        new DialogPayGame(activity, payEntity).showPayGame();
     }
     }
 
 
+
     /**
     /**
      * 分享
      * 分享
      * @param activity
      * @param activity

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

@@ -8,6 +8,7 @@ import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
 import android.view.View;
 
 
+import com.kfzs.duanduan.event.BigEvent;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
@@ -26,6 +27,9 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
@@ -60,6 +64,7 @@ public class ActGameAccount extends BaseActivity {
 
 
     @Override
     @Override
     public void initView() {
     public void initView() {
+        EventBus.getDefault().register(this);
         activity = this;
         activity = this;
         TitleBarUtils.getInstance()
         TitleBarUtils.getInstance()
                 .setTitleFinish(activity)
                 .setTitleFinish(activity)
@@ -178,4 +183,18 @@ public class ActGameAccount extends BaseActivity {
         }
         }
         refresh.setRefreshing(false);
         refresh.setRefreshing(false);
     }
     }
+
+    @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;
+        }
+    }
 }
 }

+ 54 - 13
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java

@@ -5,6 +5,7 @@ import android.os.Bundle;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
 import android.util.Log;
 import android.util.Log;
 import android.view.View;
 import android.view.View;
 import android.widget.AdapterView;
 import android.widget.AdapterView;
@@ -68,6 +69,8 @@ public class ActGameAgencyRecharge extends BaseActivity {
     private List<GameAgencyRechargePlatformEntity> platformList = ListUtil.emptyList();//平台充值
     private List<GameAgencyRechargePlatformEntity> platformList = ListUtil.emptyList();//平台充值
     private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();//游戏代充
     private List<TaskReleaseEty> releaseEtyLists = new ArrayList<>();//游戏代充
 
 
+    private String task_type;
+
     @Override
     @Override
     protected int getLayoutId() {
     protected int getLayoutId() {
         return R.layout.act_game_agency_recharge_layout;
         return R.layout.act_game_agency_recharge_layout;
@@ -148,6 +151,7 @@ public class ActGameAgencyRecharge extends BaseActivity {
                     return;
                     return;
                 }
                 }
                 gridViewEntity = (GridViewEntity) gridviewList.get(position);
                 gridViewEntity = (GridViewEntity) gridviewList.get(position);
+                task_type = gridViewEntity.getTask_type();
                 for(int i=0;i<gridviewList.size();i++){
                 for(int i=0;i<gridviewList.size();i++){
                     if(position == i){
                     if(position == i){
                         ((GridViewEntity) gridviewList.get(i)).setSelectState(true);
                         ((GridViewEntity) gridviewList.get(i)).setSelectState(true);
@@ -244,7 +248,7 @@ public class ActGameAgencyRecharge extends BaseActivity {
      */
      */
     private void setValue(){
     private void setValue(){
         gridviewList.clear();
         gridviewList.clear();
-        gridviewList.add(new GridViewEntity(false, "全 部", "1002"+",1003"+",1004"));
+        gridviewList.add(new GridViewEntity(true, "全 部", "1002"+",1003"+",1004"));
         gridviewList.add(new GridViewEntity(false, "平台游戏", 1002+""));
         gridviewList.add(new GridViewEntity(false, "平台游戏", 1002+""));
         gridviewList.add(new GridViewEntity(false, "小米游戏", 1004+""));
         gridviewList.add(new GridViewEntity(false, "小米游戏", 1004+""));
         gridviewList.add(new GridViewEntity(false, "腾讯游戏", 1003+""));
         gridviewList.add(new GridViewEntity(false, "腾讯游戏", 1003+""));
@@ -252,18 +256,55 @@ public class ActGameAgencyRecharge extends BaseActivity {
 
 
         //平台游戏
         //平台游戏
         platformList.clear();
         platformList.clear();
-        platformList.add(new GameAgencyRechargePlatformEntity(
-                R.mipmap.game_platform_sheep_icon,
-                "平台游戏代充",
-                "充值有福利"));
-        platformList.add(new GameAgencyRechargePlatformEntity(
-                R.mipmap.game_xiaomi_icon,
-                "小米游戏代充",
-                "充值有福利"));
-        platformList.add(new GameAgencyRechargePlatformEntity(
-                R.mipmap.game_platform_sheep_icon,
-                "腾讯游戏代充",
-                "充值有福利"));
+        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_xiaomi_icon,
+                        "小米游戏代充",
+                        "充值有福利",
+                        1004));
+                break;
+            case "1004":
+
+                platformList.add(new GameAgencyRechargePlatformEntity(
+                        R.mipmap.game_platform_sheep_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,
+                        "腾讯游戏代充",
+                        "充值有福利",
+                        1004));
+                break;
+
+        }
+
         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT_PLATFORM, platformList),0);
         tryMakeMoneyAdp.add(RecyleObj.make(RecyleType.GAME_AGENCY_PAYMENT_PLATFORM, platformList),0);
         notifyDataSetChanged();
         notifyDataSetChanged();
 
 

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

@@ -1,5 +1,6 @@
 package com.sheep.gamegroup.view.adapter;
 package com.sheep.gamegroup.view.adapter;
 
 
+import android.app.Activity;
 import android.content.Context;
 import android.content.Context;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
@@ -10,14 +11,26 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import com.kfzs.duanduan.adp.AdpCommonRecy;
 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.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.SysAppUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import org.greenrobot.eventbus.EventBus;
 
 
 import java.util.List;
 import java.util.List;
 
 
+import rx.functions.Action1;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CLEAN_SURE;
+
 /**
 /**
  * Created by ljy on 2018/7/10.
  * Created by ljy on 2018/7/10.
  */
  */
@@ -106,6 +119,24 @@ public class AdpGameAccount extends AdpCommonRecy<RecyleObj> {
                     @Override
                     @Override
                     public void onClick(View v) {
                     public void onClick(View v) {
 
 
+                        ViewUtil.showMsgDialog((Activity)context, new DialogConfig().setTitle("删除确认").setMsg("确定删除吗?").setBtnRightText("取消")
+                                .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
+                                    @Override
+                                    public void onClick(View view) {
+//                                        USER_CLEAN_SURE.onEvent();
+                                        CommonUtil.getInstance().deleteGameAccount(context, 0, 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("删除失败!");
+                                                }
+                                            }
+                                        });
+                                    }
+                                }));
                     }
                     }
                 });
                 });
             }
             }

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

@@ -60,7 +60,7 @@ public class AdpGameAgencyRecharge extends BaseAdapter {
             holder.line_view.setVisibility(View.VISIBLE);
             holder.line_view.setVisibility(View.VISIBLE);
         }else{
         }else{
             holder.name_tv.setTextColor(context.getResources().getColor(R.color.txt_black_818181));
             holder.name_tv.setTextColor(context.getResources().getColor(R.color.txt_black_818181));
-            holder.line_view.setVisibility(View.GONE);
+            holder.line_view.setVisibility(View.INVISIBLE);
         }
         }
         holder.name_tv.setText(getItem(position).getName()+"");
         holder.name_tv.setText(getItem(position).getName()+"");
         return convertView;
         return convertView;

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

@@ -23,7 +23,9 @@ import com.kfzs.duanduan.event.BigEvent;
 import com.kfzs.duanduan.event.EventTypes;
 import com.kfzs.duanduan.event.EventTypes;
 import com.kfzs.duanduan.services.DownloadTaskService;
 import com.kfzs.duanduan.services.DownloadTaskService;
 import com.kfzs.duanduan.utils.ApkUtils;
 import com.kfzs.duanduan.utils.ApkUtils;
+import com.sheep.gamegroup.model.entity.GameAgencyRechargePlatformEntity;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
+import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleObj;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.RecyleType;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
@@ -89,6 +91,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
             case RUN_TASK:
             case RUN_TASK:
             case GAME_TASK:
             case GAME_TASK:
             case GAME_AGENCY_PAYMENT:
             case GAME_AGENCY_PAYMENT:
+            case GAME_AGENCY_PAYMENT_PLATFORM:
                 resId = R.layout.try_mkmy_release_task_list;
                 resId = R.layout.try_mkmy_release_task_list;
                 break;
                 break;
         }
         }
@@ -111,6 +114,9 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
             case GAME_TASK://我的游戏
             case GAME_TASK://我的游戏
                 bindGameTask(holder, (List<OrienteeringDetail>) recyleObj.getDataObj());
                 bindGameTask(holder, (List<OrienteeringDetail>) recyleObj.getDataObj());
                 break;
                 break;
+            case GAME_AGENCY_PAYMENT_PLATFORM://游戏代充平台
+                bindGamePlotForm(holder, (List<GameAgencyRechargePlatformEntity>) recyleObj.getDataObj());
+                break;
         }
         }
 
 
     }
     }
@@ -342,6 +348,82 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
             }
             }
         });
         });
     }
     }
+ /**
+     * 游戏代充平台
+     * @param holder
+     * @param etyList
+     */
+    private void bindGamePlotForm(ViewHolder holder, final List<GameAgencyRechargePlatformEntity> etyList) {
+        RecyclerView recyclerView = holder.getView(R.id.release_task_listview, RecyclerView.class);
+        recyclerView.setHasFixedSize(true);
+        recyclerView.setLayoutManager(new LinearLayoutManager(context));
+        recyclerView.setAdapter(new RecyclerView.Adapter() {
+            @NonNull
+            @Override
+            public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+                LinearLayout view = (LinearLayout) LayoutInflater.from(context)
+                        .inflate(R.layout.try_makemoney_item_recommend, viewGroup, false);
+                RecyclerView.ViewHolder viewHolder = new RecyclerView.ViewHolder(view) {
+                    @Override
+                    public String toString() {
+                        return super.toString();
+                    }
+                };
+                return viewHolder;
+            }
+
+            @Override
+            public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, final int i) {
+                final GameAgencyRechargePlatformEntity item = ListUtil.getIndex(etyList, i);
+                if(item == null){
+                    return;
+                }
+                TextView detail_task_tv = viewHolder.itemView.findViewById(R.id.detail_task_tv);
+                viewHolder.itemView.findViewById(R.id.item_title_tv).setVisibility(View.GONE);
+                viewHolder.itemView.findViewById(R.id.item_title_iv).setVisibility(View.GONE);
+
+                if(i == getItemCount()-1){
+                    viewHolder.itemView.findViewById(R.id.line_tv).setVisibility(View.GONE);
+                }else {
+                    viewHolder.itemView.findViewById(R.id.line_tv).setVisibility(View.VISIBLE);
+                }
+                detail_task_tv.setText("充值");
+                ((TextView)viewHolder.itemView.findViewById(R.id.item_date_tv)).setVisibility(View.INVISIBLE);
+                viewHolder.itemView.findViewById(R.id.item_date_question_img).setVisibility(View.INVISIBLE);
+                viewHolder.itemView.findViewById(R.id.cancel_task_tv).setVisibility(View.GONE);
+
+                //name
+                ((TextView)viewHolder.itemView.findViewById(R.id.item_anem_tv)).setText(item.getName()+"");
+
+                final TextView task_type_tv = viewHolder.itemView.findViewById(R.id.task_type_tv);
+                task_type_tv.setVisibility(View.GONE);
+                viewHolder.itemView.findViewById(R.id.item_money).setVisibility(View.GONE);
+
+                Glide.with(context)
+                        .load(item.getIcon()+"")
+                        .apply(new RequestOptions().placeholder(R.mipmap.x_ic_def_head))
+                        .into((ImageView) viewHolder.itemView.findViewById(R.id.item_icon_iv));
+
+
+                //去充值
+                detail_task_tv.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        PayEntity payEntity = new PayEntity();
+                        payEntity.setTask_type(item.getTask_type()+"");
+                        ViewUtil.newInstance().showGamePay((Activity) context, payEntity);
+
+//                        ViewUtil.showGamePayAccount((Activity) context, item.getTask_type());
+                    }
+                });
+            }
+
+            @Override
+            public int getItemCount() {
+                return etyList.size();
+            }
+        });
+    }
 
 
     /**
     /**
      * 获取已发布的
      * 获取已发布的
@@ -408,7 +490,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                                 titleStr = "可接取";
                                 titleStr = "可接取";
                                 break;
                                 break;
                             case 1:
                             case 1:
-                                titleStr = "热门任务";
+                                titleStr = "每日必做";
                                 viewHolder.itemView.findViewById(R.id.item_title_iv).setVisibility(View.VISIBLE);
                                 viewHolder.itemView.findViewById(R.id.item_title_iv).setVisibility(View.VISIBLE);
                                 Glide.with(context)
                                 Glide.with(context)
                                         .load(resourceId)
                                         .load(resourceId)

+ 147 - 118
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogAddAccount.java

@@ -50,8 +50,6 @@ import rx.schedulers.Schedulers;
 public class DialogAddAccount {
 public class DialogAddAccount {
     private Activity activity;
     private Activity activity;
 
 
-    private com.sheep.gamegroup.view.adapter.ArrayAdapter baseAdapter;
-    private com.sheep.gamegroup.view.adapter.ArrayAdapter accountAdapter;
     private List<GameAccountEntity> gameAccountEntity = new ArrayList<>();
     private List<GameAccountEntity> gameAccountEntity = new ArrayList<>();
     private ArrayList<Object> gamePlatorEntity = new ArrayList<>();
     private ArrayList<Object> gamePlatorEntity = new ArrayList<>();
     private ArrayList<Object> gameAccountListEntity = new ArrayList<>();
     private ArrayList<Object> gameAccountListEntity = new ArrayList<>();
@@ -61,33 +59,35 @@ public class DialogAddAccount {
     private String account;
     private String account;
     private String password;
     private String password;
     private int task_type;
     private int task_type;
-    Spinner game_account_game_list_spinner;
+    private TextView game_account_game_list_tv_spinner;
+    private EditText game_account_et;
+    private TextView game_account_plator_spinner_tv;
 
 
     public DialogAddAccount(Activity activity) {
     public DialogAddAccount(Activity activity) {
         this.activity = activity;
         this.activity = activity;
     }
     }
 
 
-    Handler mHandler = new Handler(){
+    Handler mHandler = new Handler() {
         @Override
         @Override
         public void handleMessage(Message msg) {
         public void handleMessage(Message msg) {
             super.handleMessage(msg);
             super.handleMessage(msg);
             try {
             try {
-                switch (msg.what){
+                switch (msg.what) {
                     case 0:
                     case 0:
-                        if(game_account_game_list_spinner == null)
+                        if (game_account_game_list_tv_spinner == null)
                             return;
                             return;
 
 
-                        game_account_game_list_spinner.setVisibility((Integer) msg.obj);
+                        game_account_game_list_tv_spinner.setVisibility((Integer) msg.obj);
                         break;
                         break;
                 }
                 }
-            }catch (Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
         }
         }
     };
     };
 
 
-    public void showAddAccount(){
-        if(activity == null)
+    public void showAddAccount() {
+        if (activity == null)
             return;
             return;
         platformData();
         platformData();
         View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
         View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
@@ -101,27 +101,8 @@ public class DialogAddAccount {
         dialog_title.setText("添加账号");
         dialog_title.setText("添加账号");
 
 
         TextView sureTv = view.findViewById(R.id.add_sure_tv);
         TextView sureTv = view.findViewById(R.id.add_sure_tv);
-        final EditText game_account_et = view.findViewById(R.id.game_account_et);
+        game_account_et = view.findViewById(R.id.game_account_et);
         final EditText game_pwd_et = view.findViewById(R.id.game_pwd_et);
         final EditText game_pwd_et = view.findViewById(R.id.game_pwd_et);
-        final MyListview game_account_listview = view.findViewById(R.id.game_account_listview);
-
-        accountAdapter = new com.sheep.gamegroup.view.adapter.ArrayAdapter<Object>(activity, R.layout.dialog_item_game_list, gameAccountListEntity){
-            @Override
-            public boolean convert(int position, View convertView, ViewGroup parent, Object item) {
-                final GameAccountEntity gameAccountEntity = (GameAccountEntity) item;
-                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
-                name_tv.setText(gameAccountEntity.getTask_name()+"");
-                convertView.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        game_account_et.setText(gameAccountEntity.getTask_name()+"");
-                        game_account_listview.setVisibility(View.GONE);
-                    }
-                });
-                return true;
-            }
-        };
-        game_account_listview.setAdapter(accountAdapter);
 
 
         game_account_et.addTextChangedListener(new TextWatcher() {
         game_account_et.addTextChangedListener(new TextWatcher() {
             @Override
             @Override
@@ -131,8 +112,7 @@ public class DialogAddAccount {
 
 
             @Override
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if(!TextUtils.isEmpty(s) && s.length() > 4){
-                    game_account_listview.setVisibility(View.VISIBLE);
+                if (!TextUtils.isEmpty(s) && s.length() > 4) {
                     intitDataAccountList(s.toString());
                     intitDataAccountList(s.toString());
                 }
                 }
             }
             }
@@ -143,20 +123,40 @@ public class DialogAddAccount {
             }
             }
         });
         });
 
 
-        final TextView game_account_plator_spinner_tv = view.findViewById(R.id.game_account_plator_spinner_tv);
+        /**
+         * 平台列表
+         * gamePlatorEntity
+         * R.layout.dialog_item_game_list
+         */
+        game_account_plator_spinner_tv = view.findViewById(R.id.game_account_plator_spinner_tv);
         game_account_plator_spinner_tv.setOnClickListener(new View.OnClickListener() {
         game_account_plator_spinner_tv.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {
-                new SelfPopupWindow(activity, game_account_plator_spinner_tv).showPopup();
+                showPlotFormList();
             }
             }
         });
         });
 
 
-        Spinner game_account_plator_spinner = view.findViewById(R.id.game_account_plator_spinner);
-        game_account_game_list_spinner = view.findViewById(R.id.game_account_game_list_spinner);
+
+        /**
+         * 游戏列表
+         * gameAccountEntity
+         * if(game_type < 1) {
+         G.showToast("请选择游戏平台!");
+         return;
+         }
+         intitDataGameList(game_type);
+         */
+        game_account_game_list_tv_spinner = view.findViewById(R.id.game_account_game_list_tv_spinner);
+        game_account_game_list_tv_spinner.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                intitDataGameList(game_type);
+            }
+        });
 
 
         final RadioButton conmon_id = view.findViewById(R.id.conmon_id);
         final RadioButton conmon_id = view.findViewById(R.id.conmon_id);
         final RadioButton fixation_id = view.findViewById(R.id.fixation_id);
         final RadioButton fixation_id = view.findViewById(R.id.fixation_id);
-        RadioGroup radio_group= view.findViewById(R.id.radio_group);
+        RadioGroup radio_group = view.findViewById(R.id.radio_group);
         radio_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
         radio_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
             @Override
             @Override
             public void onCheckedChanged(RadioGroup group, int checkedId) {
             public void onCheckedChanged(RadioGroup group, int checkedId) {
@@ -167,72 +167,16 @@ public class DialogAddAccount {
 
 
                 Message message = new Message();
                 Message message = new Message();
                 message.what = 0;
                 message.what = 0;
-                if(id == R.id.conmon_id){
+                if (id == R.id.conmon_id) {
                     message.obj = View.GONE;
                     message.obj = View.GONE;
-                    game_account_game_list_spinner.setVisibility(View.GONE);
                 }
                 }
-                if(id == R.id.fixation_id){
+                if (id == R.id.fixation_id) {
                     message.obj = View.VISIBLE;
                     message.obj = View.VISIBLE;
-                    game_account_game_list_spinner.setVisibility(View.VISIBLE);
                 }
                 }
                 mHandler.sendMessage(message);
                 mHandler.sendMessage(message);
             }
             }
         });
         });
-        /**
-         * 平台列表
-         */
-        game_account_plator_spinner.setAdapter(new com.sheep.gamegroup.view.adapter.ArrayAdapter<Object>(activity, R.layout.dialog_item_game_list, gamePlatorEntity){
-            @Override
-            public boolean convert(int position, View convertView, ViewGroup parent, final Object item) {
-                final GridViewEntity gridViewEntity = (GridViewEntity) item;
-                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
-                name_tv.setText(gridViewEntity.getName()+"");
-                convertView.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        task_type = Integer.parseInt(gridViewEntity.getTask_type());
-                    }
-                });
-                return true;
-            }
-        });
-
-        /**
-         * 游戏列表
-         */
-        baseAdapter = new com.sheep.gamegroup.view.adapter.ArrayAdapter<GameAccountEntity>(activity, R.layout.dialog_item_game_list, gameAccountEntity){
-            @Override
-            public boolean convert(int position, View convertView, ViewGroup parent, final GameAccountEntity item) {
-                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
-                name_tv.setText(item.getTask_name()+"");
-//                convertView.setOnClickListener(new View.OnClickListener() {
-//                    @Override
-//                    public void onClick(View view) {
-//                        task_id = item.getTask_id();
-//                        task_type = item.getTask_type();
-//                    }
-//                });
-                return true;
-            }
-        };
-
-        game_account_game_list_spinner.setAdapter(baseAdapter);
-        game_account_game_list_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
-            @Override
-            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
 
 
-                if(game_type < 1) {
-                    G.showToast("请选择游戏平台!");
-                    return;
-                }
-                intitDataGameList(game_type);
-            }
-
-            @Override
-            public void onNothingSelected(AdapterView<?> parent) {
-
-            }
-        });
 
 
         /**
         /**
          * 添加账号提交
          * 添加账号提交
@@ -243,20 +187,20 @@ public class DialogAddAccount {
 
 
                 account = game_account_et.getText().toString().trim();
                 account = game_account_et.getText().toString().trim();
                 password = game_pwd_et.getText().toString().trim();
                 password = game_pwd_et.getText().toString().trim();
-                if(TextUtils.isEmpty(account)){
+                if (TextUtils.isEmpty(account)) {
                     G.showToast("请选择或输入游戏账号");
                     G.showToast("请选择或输入游戏账号");
                     return;
                     return;
                 }
                 }
-                if(task_type < 1){
+                if (game_type < 1) {
                     G.showToast("请选择游戏平台");
                     G.showToast("请选择游戏平台");
                     return;
                     return;
                 }
                 }
 
 
                 JSONObject jsonObject = new JSONObject();
                 JSONObject jsonObject = new JSONObject();
-                jsonObject.put("account",account);
-                jsonObject.put("password",password);
-                jsonObject.put("task_id",task_id);
-                jsonObject.put("task_type",task_type);
+                jsonObject.put("account", account);
+                jsonObject.put("password", password);
+                jsonObject.put("task_id", task_id);
+                jsonObject.put("game_type", game_type);
 
 
                 ViewUtil.newInstance().showProgress(activity);
                 ViewUtil.newInstance().showProgress(activity);
                 SheepApp.getInstance()
                 SheepApp.getInstance()
@@ -270,13 +214,13 @@ public class DialogAddAccount {
                             public void onError(BaseMessage baseMessage) {
                             public void onError(BaseMessage baseMessage) {
 
 
                                 ViewUtil.newInstance().hideProgress(activity);
                                 ViewUtil.newInstance().hideProgress(activity);
-                                G.showToast(baseMessage.getMsg()+"");
+                                G.showToast(baseMessage.getMsg() + "");
                             }
                             }
 
 
                             @Override
                             @Override
                             public void onNext(BaseMessage baseMessage) {
                             public void onNext(BaseMessage baseMessage) {
                                 ViewUtil.newInstance().hideProgress(activity);
                                 ViewUtil.newInstance().hideProgress(activity);
-                                G.showToast(baseMessage.getMsg()+"");
+                                G.showToast(baseMessage.getMsg() + "");
 
 
                                 dialog.dismiss();
                                 dialog.dismiss();
                             }
                             }
@@ -303,21 +247,23 @@ public class DialogAddAccount {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
     }
     }
+
     /**
     /**
      * 平台数据
      * 平台数据
      */
      */
-    private void platformData(){
+    private void platformData() {
         gamePlatorEntity.clear();
         gamePlatorEntity.clear();
-        gamePlatorEntity.add(new GridViewEntity(false, "平台游戏", 1002+""));
-        gamePlatorEntity.add(new GridViewEntity(false, "小米游戏", 1004+""));
-        gamePlatorEntity.add(new GridViewEntity(false, "腾讯游戏", 1003+""));
+        gamePlatorEntity.add(new GridViewEntity(false, "平台游戏", 1002 + ""));
+        gamePlatorEntity.add(new GridViewEntity(false, "小米游戏", 1004 + ""));
+        gamePlatorEntity.add(new GridViewEntity(false, "腾讯游戏", 1003 + ""));
     }
     }
 
 
     /**
     /**
      * 游戏任务列表
      * 游戏任务列表
+     *
      * @param game_type
      * @param game_type
      */
      */
-    private void intitDataGameList(int game_type){
+    private void intitDataGameList(int game_type) {
 
 
         ViewUtil.newInstance().showProgress(activity);
         ViewUtil.newInstance().showProgress(activity);
         SheepApp.getInstance()
         SheepApp.getInstance()
@@ -331,25 +277,25 @@ public class DialogAddAccount {
                     public void onError(BaseMessage baseMessage) {
                     public void onError(BaseMessage baseMessage) {
 
 
                         ViewUtil.newInstance().hideProgress(activity);
                         ViewUtil.newInstance().hideProgress(activity);
-                        G.showToast(baseMessage.getMsg()+"");
+                        G.showToast(baseMessage.getMsg() + "");
                     }
                     }
 
 
                     @Override
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                     public void onNext(BaseMessage baseMessage) {
                         ViewUtil.newInstance().hideProgress(activity);
                         ViewUtil.newInstance().hideProgress(activity);
                         List<GameAccountEntity> gameAccountEntitys = baseMessage.getDatas(GameAccountEntity.class);
                         List<GameAccountEntity> gameAccountEntitys = baseMessage.getDatas(GameAccountEntity.class);
-                        if(!ListUtil.isEmpty(gameAccountEntitys)){
+                        if (!ListUtil.isEmpty(gameAccountEntitys)) {
                             gameAccountEntity.clear();
                             gameAccountEntity.clear();
                             gameAccountEntity.addAll(gameAccountEntitys);
                             gameAccountEntity.addAll(gameAccountEntitys);
-                            if(baseAdapter != null)
-                                baseAdapter.notifyDataSetChanged();
+                            showListGame();
                         }
                         }
                     }
                     }
                 });
                 });
     }
     }
-    private void intitDataAccountList(String account){
 
 
-        if(game_type < 1) {
+    private void intitDataAccountList(String account) {
+
+        if (game_type < 1) {
             G.showToast("请选择游戏平台!");
             G.showToast("请选择游戏平台!");
             return;
             return;
         }
         }
@@ -365,20 +311,103 @@ public class DialogAddAccount {
                     public void onError(BaseMessage baseMessage) {
                     public void onError(BaseMessage baseMessage) {
 
 
                         ViewUtil.newInstance().hideProgress(activity);
                         ViewUtil.newInstance().hideProgress(activity);
-                        G.showToast(baseMessage.getMsg()+"");
+                        G.showToast(baseMessage.getMsg() + "");
                     }
                     }
 
 
                     @Override
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                     public void onNext(BaseMessage baseMessage) {
                         ViewUtil.newInstance().hideProgress(activity);
                         ViewUtil.newInstance().hideProgress(activity);
                         List<GameAccountEntity> gameAccountEntitys = baseMessage.getDatas(GameAccountEntity.class);
                         List<GameAccountEntity> gameAccountEntitys = baseMessage.getDatas(GameAccountEntity.class);
-                        if(!ListUtil.isEmpty(gameAccountEntitys)){
+                        if (!ListUtil.isEmpty(gameAccountEntitys)) {
                             gameAccountListEntity.clear();
                             gameAccountListEntity.clear();
                             gameAccountListEntity.addAll(gameAccountEntitys);
                             gameAccountListEntity.addAll(gameAccountEntitys);
-                            if(accountAdapter != null)
-                                accountAdapter.notifyDataSetChanged();
+                            showListAccount();
                         }
                         }
                     }
                     }
                 });
                 });
     }
     }
+
+    /**
+     * 游戏列表显示
+     */
+    private void showListGame(){
+        SelfPopupWindow.newInstance()
+                .SelfPopupWindow(activity, game_account_game_list_tv_spinner, new AdapterView.OnItemClickListener() {
+                            @Override
+                            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                                GameAccountEntity entity = gameAccountEntity.get(position);
+                                G.showToast(entity.getTask_name() + "");
+                                game_account_game_list_tv_spinner.setText(gameAccountEntity.get(position).getTask_name() + "");
+                                task_id = entity.getTask_id();
+                                SelfPopupWindow.newInstance().hidePop();
+                            }
+                        },
+                        new com.sheep.gamegroup.view.adapter.ArrayAdapter<GameAccountEntity>(activity, R.layout.dialog_item_game_list, gameAccountEntity) {
+                            @Override
+                            public boolean convert(int position, View convertView, ViewGroup parent, GameAccountEntity item) {
+                                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
+                                name_tv.setText(item + "");
+                                return true;
+                            }
+                        })
+                .initPopup()
+                .showPop();
+    }
+    /**
+     * 游戏列表显示
+     */
+    private void showListAccount(){
+        SelfPopupWindow.newInstance()
+                .SelfPopupWindow(activity, game_account_et, new AdapterView.OnItemClickListener() {
+                            @Override
+                            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                                GameAccountEntity entity = (GameAccountEntity) gameAccountListEntity.get(position);
+                                G.showToast(entity.getTask_name() + "");
+                                game_account_et.setText(gameAccountEntity.get(position).getTask_name() + "");
+//                                task_id = entity.getTask_id();
+                                SelfPopupWindow.newInstance().hidePop();
+                            }
+                        },
+                        new com.sheep.gamegroup.view.adapter.ArrayAdapter<Object>(activity, R.layout.dialog_item_game_list, gameAccountListEntity) {
+                            @Override
+                            public boolean convert(int position, View convertView, ViewGroup parent, Object item) {
+                                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
+                                name_tv.setText(item + "");
+                                return true;
+                            }
+                        })
+                .initPopup()
+                .showPop();
+    }
+    /**
+     * 平台显示
+     */
+    private void showPlotFormList() {
+        SelfPopupWindow.newInstance()
+                .SelfPopupWindow(activity, game_account_plator_spinner_tv, new AdapterView.OnItemClickListener() {
+                            @Override
+                            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                                GridViewEntity gridViewEntity = (GridViewEntity) gamePlatorEntity.get(position);
+                                G.showToast(gridViewEntity.getName() + "");
+                                game_account_plator_spinner_tv.setText(gridViewEntity.getName() + "");
+                                try {
+                                    game_type = Integer.parseInt(gridViewEntity.getTask_type());
+                                } catch (NumberFormatException e) {
+                                    e.printStackTrace();
+                                    task_type = 0;
+                                }
+                                SelfPopupWindow.newInstance().hidePop();
+                            }
+                        },
+                        new com.sheep.gamegroup.view.adapter.ArrayAdapter<Object>(activity, R.layout.dialog_item_game_list, gamePlatorEntity) {
+                            @Override
+                            public boolean convert(int position, View convertView, ViewGroup parent, Object item) {
+                                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
+                                name_tv.setText(item + "");
+                                return true;
+                            }
+                        })
+                .initPopup()
+                .showPop();
+    }
 }
 }

+ 130 - 0
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogModifyAccount.java

@@ -0,0 +1,130 @@
+package com.sheep.gamegroup.view.dialog;
+
+import android.app.Activity;
+import android.content.DialogInterface;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.app.AlertDialog;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import rx.functions.Action1;
+
+
+/**
+ * 修改游戏账号密码
+ * Created by ljy on 2018/7/11.
+ */
+
+public class DialogModifyAccount {
+    private Activity activity;
+    private EditText game_new_pwd_et;
+    public DialogModifyAccount(Activity activity) {
+        this.activity = activity;
+    }
+
+    Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            super.handleMessage(msg);
+            try {
+                switch (msg.what) {
+                    case 0:
+                        if (game_new_pwd_et == null)
+                            return;
+
+                        game_new_pwd_et.setVisibility((Integer) msg.obj);
+                        break;
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    };
+    public void showAddAccount() {
+        if (activity == null)
+            return;
+
+        View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
+        final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
+                .setView(dialog_parent)
+                .create();
+        TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
+        final View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
+        LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
+        View view = LayoutInflater.from(activity).inflate(R.layout.dialog_modify_account, dialog_center_ll, true);
+        dialog_title.setText("修改密码");
+
+        final TextView sureTv = view.findViewById(R.id.sure_tv);
+        TextView modify_pwd_tv = view.findViewById(R.id.modify_pwd_tv);
+        TextView game_title_et = view.findViewById(R.id.game_title_et);
+        TextView game_account_et = view.findViewById(R.id.game_account_et);
+        TextView game_old_pwd_et = view.findViewById(R.id.game_old_pwd_et);
+        game_new_pwd_et = view.findViewById(R.id.game_new_pwd_et);
+
+        //立即修改,我知道了
+        sureTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                switch (sureTv.getText().toString()){
+                    case "我知道了":
+                    default:
+
+                        break;
+                    case "立即修改":
+                        String game_new_pwd_ets = game_new_pwd_et.getText().toString().trim() + "";
+                        if(TextUtils.isEmpty(game_new_pwd_ets)){
+                            G.showToast("请输入新密码");
+                            return;
+                        }
+
+                        JSONObject jsonObject = new JSONObject();
+                        jsonObject.put("id", 0);
+                        jsonObject.put("password", game_new_pwd_ets);
+                        CommonUtil.getInstance()
+                                .modifyGameAccount(activity, jsonObject, new Action1<Integer>() {
+                                    @Override
+                                    public void call(Integer integer) {
+
+                                    }
+                                });
+                        break;
+                }
+            }
+        });
+        modify_pwd_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                game_new_pwd_et.setVisibility(View.VISIBLE);
+                sureTv.setText("立即修改");
+            }
+        });
+
+        dialog_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+        dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+            @Override
+            public void onDismiss(DialogInterface dialogInterface) {
+            }
+        });
+        try {
+            dialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 152 - 3
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogPayAccount.java

@@ -3,23 +3,34 @@ package com.sheep.gamegroup.view.dialog;
 import android.app.Activity;
 import android.app.Activity;
 import android.content.DialogInterface;
 import android.content.DialogInterface;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AlertDialog;
+import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextUtils;
+import android.text.TextWatcher;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
 import android.widget.EditText;
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GameAccountEntity;
+import com.sheep.gamegroup.model.entity.GamePayList;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
 import com.sheep.gamegroup.model.entity.OrienteeringDetail;
+import com.sheep.gamegroup.model.entity.PayEntity;
+import com.sheep.gamegroup.model.entity.TaskReleaseEty;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 import rx.android.schedulers.AndroidSchedulers;
 import rx.android.schedulers.AndroidSchedulers;
@@ -33,6 +44,15 @@ import rx.schedulers.Schedulers;
 public class DialogPayAccount {
 public class DialogPayAccount {
     private Activity activity;
     private Activity activity;
     private String gameId;
     private String gameId;
+    private PayEntity payEntity;
+
+    private List<GamePayList> gamePayLists= new ArrayList<>();
+    private EditText game_et;
+
+    public DialogPayAccount(Activity activity, PayEntity payEntity) {
+        this.activity = activity;
+        this.payEntity = payEntity;
+    }
 
 
     public DialogPayAccount(Activity activity, String gameId) {
     public DialogPayAccount(Activity activity, String gameId) {
         this.activity = activity;
         this.activity = activity;
@@ -61,21 +81,58 @@ public class DialogPayAccount {
         final EditText game_account_et = view.findViewById(R.id.game_account_et);
         final EditText game_account_et = view.findViewById(R.id.game_account_et);
         final EditText game_pay_et = view.findViewById(R.id.game_pay_et);
         final EditText game_pay_et = view.findViewById(R.id.game_pay_et);
 
 
+        final EditText game_pwd_et = view.findViewById(R.id.game_pwd_et);
+        game_et = view.findViewById(R.id.game_et);
+        final EditText game_area_et = view.findViewById(R.id.game_area_et);
+        final EditText game_role_et = view.findViewById(R.id.game_role_et);
+        final EditText game_role_id_et = view.findViewById(R.id.game_role_id_et);
+        final EditText game_goods_et = view.findViewById(R.id.game_goods_et);
+
+        /**
+         * 游戏列表
+         */
+
+        game_et.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                if (!TextUtils.isEmpty(s) && s.length() > 4 && payEntity != null) {
+                    intitDataAccountList(s.toString(), payEntity);
+                }
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
 
 
         sureTv.setOnClickListener(new View.OnClickListener() {
         sureTv.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {
                 String game_account_etStr = game_account_et.getText().toString().trim()+"";
                 String game_account_etStr = game_account_et.getText().toString().trim()+"";
                 String game_pay_etStr = game_pay_et.getText().toString().trim()+"";
                 String game_pay_etStr = game_pay_et.getText().toString().trim()+"";
+
                 if(TextUtils.isEmpty(game_account_etStr)){
                 if(TextUtils.isEmpty(game_account_etStr)){
                     G.showToast("游戏账号不能为空!");
                     G.showToast("游戏账号不能为空!");
                     return;
                     return;
                 }
                 }
-                if(TextUtils.isEmpty(game_pay_etStr) || Double.valueOf(game_pay_etStr)<=0){
-                    G.showToast("充值金额不能为空!");
+                if(payEntity == null || TextUtils.isEmpty(payEntity.getGame_id())) {
+                    G.showToast("请选择游戏!");
                     return;
                     return;
                 }
                 }
-                ViewUtil.showGamePay(activity, game_account_etStr, game_pay_etStr,gameId);
+                payEntity.setAccount(game_account_etStr);
+                payEntity.setPwd(game_pwd_et.getText().toString().trim());
+                payEntity.setService(game_area_et.getText().toString().trim());
+                payEntity.setRole_name(game_role_et.getText().toString().trim());
+                payEntity.setRole_id(game_role_id_et.getText().toString().trim());
+                payEntity.setGoods(game_goods_et.getText().toString().trim());
+
+                ViewUtil.showGamePay(activity, payEntity);
 
 
                 dialog.dismiss();
                 dialog.dismiss();
             }
             }
@@ -117,4 +174,96 @@ public class DialogPayAccount {
                     }
                     }
                 });
                 });
     }
     }
+
+
+    /**
+     * 游戏列表显示
+     */
+    private void intitDataAccountList(String name, PayEntity payEntity) {
+
+        ViewUtil.newInstance().showProgress(activity);
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .rechargeGameList(Integer.parseInt(payEntity.getTaskType()), name)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                        ViewUtil.newInstance().hideProgress(activity);
+                        G.showToast(baseMessage.getMsg() + "");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress(activity);
+                        List<GamePayList> taskReleaseEtyList = baseMessage.getDatas(GamePayList.class);
+                        if (!ListUtil.isEmpty(taskReleaseEtyList)) {
+                            gamePayLists.clear();
+                            gamePayLists.addAll(taskReleaseEtyList);
+                            showListAccount(game_et);
+                        }
+                    }
+                });
+    }
+    private void showListAccount(final EditText game_account_et){
+        SelfPopupWindow.newInstance()
+                .SelfPopupWindow(activity, game_account_et, new AdapterView.OnItemClickListener() {
+                            @Override
+                            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                                GamePayList entity = (GamePayList) gamePayLists.get(position);
+                                game_account_et.setText(entity.getName() + "");
+                                if(payEntity == null)
+                                    return;
+                                payEntity.setGame_id(entity.getGame_id());
+                                SelfPopupWindow.newInstance().hidePop();
+                            }
+                        },
+                        new com.sheep.gamegroup.view.adapter.ArrayAdapter<GamePayList>(activity, R.layout.dialog_item_game_list, gamePayLists) {
+                            @Override
+                            public boolean convert(int position, View convertView, ViewGroup parent, GamePayList item) {
+                                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
+                                name_tv.setText(item + "");
+                                return true;
+                            }
+                        })
+                .initPopup()
+                .showPop();
+    }
+
+    /**
+     * 获取可用金额和比率
+     */
+    private void getVoucherAndRatio(){
+
+        ViewUtil.newInstance().showProgress(activity);
+        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);
+                        G.showToast(baseMessage.getMsg() + "");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        ViewUtil.newInstance().hideProgress(activity);
+                        List<GamePayList> taskReleaseEtyList = baseMessage.getDatas(GamePayList.class);
+                        if (!ListUtil.isEmpty(taskReleaseEtyList)) {
+                            gamePayLists.clear();
+                            gamePayLists.addAll(taskReleaseEtyList);
+                            showListAccount(game_et);
+                        }
+                    }
+                });
+    }
+
 }
 }

+ 88 - 10
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogPayGame.java

@@ -7,21 +7,27 @@ import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.widget.AdapterView;
 import android.widget.AdapterView;
+import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.TextView;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RechargeEntity;
 import com.sheep.gamegroup.model.entity.RechargeEntity;
+import com.sheep.gamegroup.model.entity.WithdrawalList;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.MathUtil;
 import com.sheep.gamegroup.util.MathUtil;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.MyDbManager;
+import com.sheep.gamegroup.util.MyGridview;
 import com.sheep.gamegroup.util.MyListview;
 import com.sheep.gamegroup.util.MyListview;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.gamegroup.view.adapter.WithdrawalAdapter;
 import com.sheep.gamegroup.view.adapter.expandadapter.AdpPayGameDialog;
 import com.sheep.gamegroup.view.adapter.expandadapter.AdpPayGameDialog;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
 import com.sheep.gamegroup.view.customview.RefreshLayout;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.R;
@@ -46,6 +52,7 @@ public class DialogPayGame {
     private int maxShowCount;
     private int maxShowCount;
     private RefreshLayout swipe_container;
     private RefreshLayout swipe_container;
     private MyListview pay_listview;
     private MyListview pay_listview;
+    private EditText money_et;
     private AdpPayGameDialog adpPayGameDialog;
     private AdpPayGameDialog adpPayGameDialog;
     private List<RechargeEntity> list = new ArrayList<>();
     private List<RechargeEntity> list = new ArrayList<>();
 
 
@@ -60,11 +67,20 @@ public class DialogPayGame {
     private String gameId;
     private String gameId;
     private AlertDialog dialog;
     private AlertDialog dialog;
 
 
-    public DialogPayGame(Activity activity, String game_account_etStr, String game_pay_etStr,String gameId) {
+    private PayEntity payEntity;
+
+    private MyGridview myGridview;
+    private List<WithdrawalList> wlLists = new ArrayList<>();
+    private WithdrawalAdapter adapter;
+    private int select;
+    private String amount;
+
+    public DialogPayGame(Activity activity, PayEntity payEntity) {
         this.activity = activity;
         this.activity = activity;
         this.game_account_etStr = game_account_etStr;
         this.game_account_etStr = game_account_etStr;
         this.game_pay_etStr = game_pay_etStr;
         this.game_pay_etStr = game_pay_etStr;
         this.gameId = gameId;
         this.gameId = gameId;
+        this.payEntity = payEntity;
         gao = SheepApp.getInstance().getResources().getDimensionPixelSize(R.dimen.content_padding_10)*5;
         gao = SheepApp.getInstance().getResources().getDimensionPixelSize(R.dimen.content_padding_10)*5;
         maxShowCount = Math.max(6, G.HEIGHT*3/4/gao);
         maxShowCount = Math.max(6, G.HEIGHT*3/4/gao);
         balance = "";
         balance = "";
@@ -88,6 +104,7 @@ public class DialogPayGame {
         //你需要支付1110元
         //你需要支付1110元
         TextView pay_game_show_price_tv = view.findViewById(R.id.pay_game_show_price_tv);
         TextView pay_game_show_price_tv = view.findViewById(R.id.pay_game_show_price_tv);
         pay_game_show_price_tv.setText("你需要支付"+ game_pay_etStr +"元");
         pay_game_show_price_tv.setText("你需要支付"+ game_pay_etStr +"元");
+        money_et = view.findViewById(R.id.money_et);
         pay_listview = view.findViewById(R.id.pay_listview);
         pay_listview = view.findViewById(R.id.pay_listview);
         adpPayGameDialog = new AdpPayGameDialog(list ,activity);
         adpPayGameDialog = new AdpPayGameDialog(list ,activity);
         pay_listview.setAdapter(adpPayGameDialog);
         pay_listview.setAdapter(adpPayGameDialog);
@@ -100,6 +117,8 @@ public class DialogPayGame {
                 adpPayGameDialog.notifyDataSetChanged();
                 adpPayGameDialog.notifyDataSetChanged();
             }
             }
         });
         });
+        makeGridview(view);
+
         sureTv.setOnClickListener(new View.OnClickListener() {
         sureTv.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {
@@ -131,6 +150,7 @@ public class DialogPayGame {
         balance = "";
         balance = "";
         ViewUtil.newInstance()
         ViewUtil.newInstance()
                 .showProgress(activity, false);
                 .showProgress(activity, false);
+        gameId = payEntity.getGame_id();
         SheepApp.getInstance().getNetComponent().getApiService().can_user_sheep_amount(Integer.valueOf(game_pay_etStr), gameId)
         SheepApp.getInstance().getNetComponent().getApiService().can_user_sheep_amount(Integer.valueOf(game_pay_etStr), gameId)
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -142,8 +162,6 @@ public class DialogPayGame {
                         try{
                         try{
                             String balances = baseMessage.getData() +"";
                             String balances = baseMessage.getData() +"";
                             balance = TextUtils.isEmpty(balances) ? "0" : balances;
                             balance = TextUtils.isEmpty(balances) ? "0" : balances;
-//                            balance = MathUtil.add(TextUtils.isEmpty(balances) ? "0" : balances,
-//                                    TextUtils.isEmpty(MyDbManager.getInstance().dbFindValueBalance()) ? "0" : MyDbManager.getInstance().dbFindValueBalance());
 
 
 
 
                         }catch (Exception e){
                         }catch (Exception e){
@@ -273,17 +291,17 @@ public class DialogPayGame {
         ViewUtil.newInstance()
         ViewUtil.newInstance()
                 .showProgress(activity, false);
                 .showProgress(activity, false);
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("account", game_account_etStr);
+        jsonObject.put("account", payEntity.getAccount());
         jsonObject.put("amount", Float.valueOf(game_pay_etStr));
         jsonObject.put("amount", Float.valueOf(game_pay_etStr));
-        jsonObject.put("game_id", gameId+"");
+        jsonObject.put("game_id", payEntity.getGame_id()+"");
         jsonObject.put("pay_type", pay_type);
         jsonObject.put("pay_type", pay_type);
         jsonObject.put("use_voucher", use_voucher);
         jsonObject.put("use_voucher", use_voucher);
 
 
-        jsonObject.put("goods", goods);
-        jsonObject.put("pwd", pwd);
-        jsonObject.put("role_id", role_id);
-        jsonObject.put("role_name", role_name);
-        jsonObject.put("service", service);
+        jsonObject.put("goods", payEntity.getGoods());
+        jsonObject.put("pwd", payEntity.getPwd());
+        jsonObject.put("role_id", payEntity.getRole_id());
+        jsonObject.put("role_name", payEntity.getRole_name());
+        jsonObject.put("service", payEntity.getService());
         final int finalPay_type = pay_type;
         final int finalPay_type = pay_type;
         SheepApp.getInstance().getNetComponent().getApiService().game_consumption(jsonObject)
         SheepApp.getInstance().getNetComponent().getApiService().game_consumption(jsonObject)
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
@@ -314,4 +332,64 @@ public class DialogPayGame {
                     }
                     }
                 });
                 });
     }
     }
+
+    /**
+     * gridview
+     */
+    private void makeGridview(View view){
+
+        wlLists.clear();
+        for(int i=0;i<3;i++){
+            WithdrawalList withdrawalList = new WithdrawalList();
+            GridViewEntity g;
+            switch (i){
+                case 0:
+                default:
+                    g = new GridViewEntity(false, "10");
+                    break;
+                case 1:
+                    g = new GridViewEntity(false, "50");
+
+                    break;
+                case 2:
+                    g = new GridViewEntity(false, "100");
+
+                    break;
+            }
+            withdrawalList.setGridViewEntity(g);
+            wlLists.add(withdrawalList);
+        }
+
+        myGridview = view.findViewById(R.id.withdrawal_greidview);
+        adapter = new WithdrawalAdapter(activity, wlLists);
+        myGridview.setVerticalSpacing(25);
+        myGridview.setAdapter(adapter);
+        adapter.notifyDataSetChanged();
+        myGridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                select = position;
+                for(int i=0;i<wlLists.size();i++){
+                    if(position == i){
+                        wlLists.get(i).getGridViewEntity().setSelectState(true);
+                    }else {
+                        wlLists.get(i).getGridViewEntity().setSelectState(false);
+
+                    }
+                    adapter.notifyDataSetChanged();
+                }
+            }
+        });
+        if(ListUtil.hasIndex(wlLists, select)) {
+            amount = wlLists.get(select).getGridViewEntity().getValue();
+            if (TextUtils.isEmpty(amount)) {
+                G.showToast("请选择金额");
+                return;
+            }
+
+        }
+        if(!TextUtils.isEmpty(money_et.getText()) && !TextUtils.isEmpty(money_et.getText().toString().trim())){
+            amount = money_et.getText().toString().trim();
+        }
+    }
 }
 }

+ 38 - 25
app/src/main/java/com/sheep/gamegroup/view/dialog/SelfPopupWindow.java

@@ -23,15 +23,26 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
+ * popup 弹框列表
  * Created by ljy on 2018/7/11.
  * Created by ljy on 2018/7/11.
  */
  */
 
 
 public class SelfPopupWindow {
 public class SelfPopupWindow {
     private Activity activity;
     private Activity activity;
 
 
+    private static SelfPopupWindow selfPopupWindow;
+
+    public static SelfPopupWindow newInstance(){
+        if(selfPopupWindow == null)
+            selfPopupWindow = new SelfPopupWindow();
+        return selfPopupWindow;
+    }
+
+    public SelfPopupWindow() {
+    }
 
 
     /** TextView选择框 */
     /** TextView选择框 */
-    private TextView mSelectTv;
+    private View mSelectTv;
 
 
     /** popup窗口里的ListView */
     /** popup窗口里的ListView */
     private MyListview myListview;
     private MyListview myListview;
@@ -43,37 +54,28 @@ public class SelfPopupWindow {
     private List<String> testData;
     private List<String> testData;
 
 
     /** 数据适配器 */
     /** 数据适配器 */
-    private ArrayAdapter<String> testDataAdapter;
+    private ArrayAdapter<Object> testDataAdapter;
+
+    private AdapterView.OnItemClickListener  onItemClickListener;
+
 
 
-    public SelfPopupWindow(Activity activity, View view) {
-        this.mSelectTv = (TextView) view;
+    public SelfPopupWindow SelfPopupWindow(Activity activity, View view, AdapterView.OnItemClickListener  onItemClickListener, ArrayAdapter testDataAdapter) {
+        this.mSelectTv = view;
         this.activity = activity;
         this.activity = activity;
+        this.onItemClickListener = onItemClickListener;
+        this.testDataAdapter = testDataAdapter;
+        return selfPopupWindow;
     }
     }
 
 
-    public void showPopup(){
+    public SelfPopupWindow initPopup(){
         myListview = new MyListview(activity);
         myListview = new MyListview(activity);
         TestData();
         TestData();
-        testDataAdapter = new ArrayAdapter<String>(activity, R.layout.dialog_item_game_list,testData){
-            @Override
-            public boolean convert(int position, View convertView, ViewGroup parent, String item) {
-                final TextView name_tv = ViewFindUtils.find(convertView, R.id.name_tv);
-                name_tv.setText(item+"");
-                return true;
-            }
-        };
         myListview.setAdapter(testDataAdapter);
         myListview.setAdapter(testDataAdapter);
-        myListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-                G.showToast(testData.get(position)+"");
-                mSelectTv.setText(testData.get(position)+"");
-                typeSelectPopup.dismiss();
-            }
-        });
+        myListview.setOnItemClickListener(onItemClickListener);
 
 
         typeSelectPopup = new PopupWindow(myListview, mSelectTv.getWidth(), ActionBar.LayoutParams.WRAP_CONTENT, true);
         typeSelectPopup = new PopupWindow(myListview, mSelectTv.getWidth(), ActionBar.LayoutParams.WRAP_CONTENT, true);
         // 取得popup窗口的背景图片
         // 取得popup窗口的背景图片
-        Drawable drawable = ContextCompat.getDrawable(activity, R.drawable.bg_tag_normal);
+        Drawable drawable = ContextCompat.getDrawable(activity, R.drawable.x_shap_shadow_bg_rectgangle_white);
         typeSelectPopup.setBackgroundDrawable(drawable);
         typeSelectPopup.setBackgroundDrawable(drawable);
         typeSelectPopup.setFocusable(true);
         typeSelectPopup.setFocusable(true);
         typeSelectPopup.setOutsideTouchable(true);
         typeSelectPopup.setOutsideTouchable(true);
@@ -84,9 +86,7 @@ public class SelfPopupWindow {
                 typeSelectPopup.dismiss();
                 typeSelectPopup.dismiss();
             }
             }
         });
         });
-        if (typeSelectPopup != null && !typeSelectPopup.isShowing()) {
-            typeSelectPopup.showAsDropDown(mSelectTv, 0, 10);
-        }
+        return selfPopupWindow;
     }
     }
 
 
 
 
@@ -100,4 +100,17 @@ public class SelfPopupWindow {
             testData.add(str);
             testData.add(str);
         }
         }
     }
     }
+
+    public void showPop(){
+
+        if (typeSelectPopup != null && !typeSelectPopup.isShowing()) {
+            typeSelectPopup.showAsDropDown(mSelectTv, 0, 2);
+        }
+    }
+
+    public void hidePop(){
+        if (typeSelectPopup != null && typeSelectPopup.isShowing()) {
+            typeSelectPopup.dismiss();
+        }
+    }
 }
 }

+ 0 - 1
app/src/main/res/layout/adp_level_gridview_item.xml

@@ -18,7 +18,6 @@
         android:layout_marginLeft="@dimen/content_padding_15"
         android:layout_marginLeft="@dimen/content_padding_15"
         android:layout_marginRight="@dimen/content_padding_15"
         android:layout_marginRight="@dimen/content_padding_15"
         android:background="@color/blue_start"
         android:background="@color/blue_start"
-        android:layout_gravity="center_horizontal"
         android:layout_marginTop="@dimen/content_padding_15"/>
         android:layout_marginTop="@dimen/content_padding_15"/>
 
 
 </LinearLayout>
 </LinearLayout>

+ 15 - 15
app/src/main/res/layout/dialog_add_account.xml

@@ -5,16 +5,6 @@
     android:layout_margin="@dimen/content_padding"
     android:layout_margin="@dimen/content_padding"
     android:orientation="vertical">
     android:orientation="vertical">
 
 
-    <!--android:background="@drawable/sp_bg_blue_stroke"-->
-    <Spinner
-        android:id="@+id/game_account_plator_spinner"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginBottom="@dimen/common_margin_10"
-        android:paddingTop="@dimen/content_padding_5"
-        android:paddingBottom="@dimen/content_padding_5"
-        android:visibility="gone"/>
-
     <TextView
     <TextView
         android:id="@+id/game_account_plator_spinner_tv"
         android:id="@+id/game_account_plator_spinner_tv"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
@@ -24,7 +14,9 @@
         android:minWidth="@dimen/view_size_150"
         android:minWidth="@dimen/view_size_150"
         android:padding="@dimen/content_padding_small"
         android:padding="@dimen/content_padding_small"
         android:text=""
         android:text=""
-        android:textSize="@dimen/text_size_13"  />
+        android:textSize="@dimen/text_size_13"
+        android:drawableRight="@mipmap/arrow_down"
+        android:drawablePadding="@dimen/content_padding_3"/>
 
 
 
 
     <RadioGroup
     <RadioGroup
@@ -59,12 +51,20 @@
             android:paddingStart="@dimen/content_padding_15"/>
             android:paddingStart="@dimen/content_padding_15"/>
     </RadioGroup>
     </RadioGroup>
 
 
-
-    <Spinner
-        android:id="@+id/game_account_game_list_spinner"
+    <TextView
+        android:id="@+id/game_account_game_list_tv_spinner"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginBottom="@dimen/common_margin_10" />
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint=""
+        android:minWidth="@dimen/view_size_150"
+        android:padding="@dimen/content_padding_small"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:layout_marginBottom="@dimen/common_margin_10"
+        android:drawableRight="@mipmap/arrow_down"
+        android:drawablePadding="@dimen/content_padding_3"
+        android:visibility="gone"/>
 
 
     <EditText
     <EditText
         android:id="@+id/game_account_et"
         android:id="@+id/game_account_et"

+ 2 - 1
app/src/main/res/layout/dialog_item_game_list.xml

@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:padding="@dimen/content_padding_3">
 
 
     <TextView
     <TextView
         android:id="@+id/name_tv"
         android:id="@+id/name_tv"

+ 90 - 0
app/src/main/res/layout/dialog_modify_account.xml

@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_margin="@dimen/content_padding"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/game_title_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:minWidth="@dimen/view_size_150"
+        android:padding="@dimen/content_padding_small"
+        android:text="小米游戏--通用"
+        android:textSize="@dimen/text_size_13"
+        android:layout_marginBottom="@dimen/content_padding_15"/>
+
+    <TextView
+        android:id="@+id/game_account_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:minWidth="@dimen/view_size_150"
+        android:padding="@dimen/content_padding_small"
+        android:text="账号:123456"
+        android:textSize="@dimen/text_size_13"
+        android:layout_marginBottom="@dimen/content_padding_15"/>
+
+    <LinearLayout
+        android:id="@+id/game_old_pwd_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:layout_marginBottom="@dimen/content_padding_15">
+
+
+        <TextView
+            android:id="@+id/game_old_pwd_et"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:minWidth="@dimen/view_size_150"
+            android:padding="@dimen/content_padding_small"
+            android:text="原密码:123456"
+            android:textSize="@dimen/text_size_13"/>
+
+        <View
+            android:layout_width="1sp"
+            android:layout_height="15dp"
+            android:background="@color/gray"
+            android:layout_gravity="center_vertical"
+            android:layout_marginLeft="@dimen/content_padding_3"/>
+
+        <TextView
+            android:id="@+id/modify_pwd_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="修改"
+            android:textSize="@dimen/text_size_13"
+            android:textColor="@color/blue_34a6e7"
+            android:paddingRight="@dimen/content_padding_5"
+            android:paddingLeft="@dimen/content_padding_3"/>
+    </LinearLayout>
+
+    <EditText
+        android:id="@+id/game_new_pwd_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:minWidth="@dimen/view_size_150"
+        android:padding="@dimen/content_padding_small"
+        android:hint="请输入新密码"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:visibility="gone"/>
+
+    <TextView
+        android:id="@+id/sure_tv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/content_padding_20"
+        android:background="@drawable/sp_bg_gradient_rectangle_blue"
+        android:gravity="center"
+        android:minHeight="@dimen/view_size_30"
+        android:text="我知道了"
+        android:textColor="@color/white"
+        android:textSize="@dimen/text_size_15" />
+</LinearLayout>

+ 38 - 2
app/src/main/res/layout/dialog_pa_game_center.xml

@@ -11,13 +11,49 @@
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:text="你需要支付1110元"
         android:text="你需要支付1110元"
         android:layout_gravity="center_horizontal"
         android:layout_gravity="center_horizontal"
-        style="@style/txt_style_15"/>
+        style="@style/txt_style_15"
+        android:visibility="gone"/>
+
+    <com.sheep.gamegroup.util.MyGridview
+        android:id="@+id/withdrawal_greidview"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:gravity="center_horizontal"
+        android:scrollbars="none"
+        android:numColumns="3"
+        android:layout_marginTop="@dimen/content_padding_20"
+        android:layout_marginBottom="@dimen/content_padding_15"
+        android:horizontalSpacing="@dimen/content_padding_13"
+        android:visibility="visible"
+        android:background="@color/white"
+        android:listSelector="@color/transparent"/>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="其他金额:"
+        android:layout_marginBottom="@dimen/content_padding_8"/>
+
+    <EditText
+        android:id="@+id/money_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入其他金额"
+        android:text=""
+        android:inputType="number"
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
     <TextView
     <TextView
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:text="请选择你的支付方式:"
         android:text="请选择你的支付方式:"
         android:layout_gravity="center_horizontal"
         android:layout_gravity="center_horizontal"
-        style="@style/txt_style_15"/>
+        style="@style/txt_style_15"
+        android:visibility="visible"/>
 
 
     <com.sheep.gamegroup.util.MyListview
     <com.sheep.gamegroup.util.MyListview
         android:id="@+id/pay_listview"
         android:id="@+id/pay_listview"

+ 74 - 1
app/src/main/res/layout/dialog_pay_account.xml

@@ -16,6 +16,78 @@
         android:textSize="@dimen/text_size_13"
         android:textSize="@dimen/text_size_13"
         android:padding="@dimen/content_padding_small"
         android:padding="@dimen/content_padding_small"
         android:layout_marginBottom="@dimen/common_margin_10"/>
         android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_pwd_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入游戏帐号密码"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入游戏"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_area_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入区服"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_role_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入角色名字"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_role_id_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入角色ID"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
+
+    <EditText
+        android:id="@+id/game_goods_et"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minWidth="@dimen/view_size_150"
+        android:background="@drawable/sp_bg_blue_stroke"
+        android:hint="输入购买物品"
+        android:text=""
+        android:textSize="@dimen/text_size_13"
+        android:padding="@dimen/content_padding_small"
+        android:layout_marginBottom="@dimen/common_margin_10"/>
     <EditText
     <EditText
         android:id="@+id/game_pay_et"
         android:id="@+id/game_pay_et"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
@@ -25,7 +97,8 @@
         android:inputType="number"
         android:inputType="number"
         android:hint="输入充值金额"
         android:hint="输入充值金额"
         android:textSize="@dimen/text_size_13"
         android:textSize="@dimen/text_size_13"
-        android:padding="@dimen/content_padding_small"/>
+        android:padding="@dimen/content_padding_small"
+        android:visibility="gone"/>
 
 
     <TextView
     <TextView
         android:id="@+id/pay_sure_tv"
         android:id="@+id/pay_sure_tv"