liujiangyao лет назад: 7
Родитель
Сommit
a1ffbe76b4

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

@@ -139,7 +139,7 @@ public class TaskHelper {
             find_information_game_task.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View view) {
-                    ViewUtil.showGamePayAccount(activity, orienteeringDetail.getGame_id());
+                    ViewUtil.showGamePayAccount(activity, orienteeringDetail.getGame_id(),orienteeringDetail.getName());
                 }
             });
             itemView.setOnClickListener(new View.OnClickListener() {

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

@@ -693,4 +693,9 @@ public interface ApiService {
      */
     @GET("app/game_consumption/voucher_and_ratio")
     Observable<BaseMessage> getVoucherAndRatio(@Query("game_id") String game_id);
+    /**
+     *获取任务
+     */
+    @GET("app/release_task/game_task")
+    Observable<BaseMessage> releaseGameTask(@Query("page") int page, @Query("per_page") int per_page,@Query("is_hot") int is_hot, @Query("task_type") String task_type, @Query("name") String name);
 }

+ 13 - 3
app/src/main/java/com/sheep/gamegroup/model/entity/PayEntity.java

@@ -24,6 +24,16 @@ public class PayEntity implements Serializable {
 
     private boolean use_voucher;
 
+    private String game_name;
+
+    public String getGame_name() {
+        return TextUtils.isEmpty(game_name)?"游戏":game_name;
+    }
+
+    public void setGame_name(String game_name) {
+        this.game_name = game_name;
+    }
+
     public String getAccount() {
         return account;
     }
@@ -123,11 +133,11 @@ public class PayEntity implements Serializable {
         switch (task_type){
             case "1002":
             default:
-                return "平台游戏";
+                return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"平台游戏代充" :getGame_name()+"游戏";
             case "1003":
-                return "腾讯游戏";
+            return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"腾讯游戏代充" :getGame_name()+"游戏";
             case "1004":
-                return "小米游戏";
+            return (TextUtils.isEmpty(game_id) || game_id.equals("0"))?"小米游戏代充" :getGame_name()+"游戏";
         }
     }
 }

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

@@ -62,6 +62,7 @@ import java.lang.reflect.Field;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.security.MessageDigest;
+import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Locale;
@@ -78,6 +79,10 @@ import rx.schedulers.Schedulers;
  */
 
 public class CommonUtil {
+    //多次点击预防
+    public static final int MIN_CLICK_DELAY_TIME = 1000;
+    private long lastClickTime = 0;
+
     public static String START_TASK = "开始任务";
     public static String GET_TASK = "领取任务";
     public static String START_PLAY = "开始试玩";
@@ -1267,4 +1272,16 @@ public class CommonUtil {
     public void showView(int goneOrShow, View view){
         view.setVisibility(goneOrShow);
     }
+
+    /**
+     * 点击时间
+     */
+    public boolean clickTime(int intevalTime){
+        long currentTime = Calendar.getInstance().getTimeInMillis();
+        if (currentTime - lastClickTime > intevalTime) {
+            lastClickTime = currentTime;
+            return true;
+        }
+        return false;
+    }
 }

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

@@ -607,8 +607,11 @@ public class ViewUtil {
     /**
      * game 充值
      */
-    public static void showGamePayAccount(Activity activity,String gameId){
-        new DialogPayAccount(activity,gameId).showPayaccount();
+    public static void showGamePayAccount(Activity activity,String gameId, String gameName){
+        PayEntity payEntity = new PayEntity();
+        payEntity.setGame_id(gameId);
+        payEntity.setGame_name(gameName);
+        showGamePayAccount(activity,payEntity);
     }
     public static void showGamePayAccount(Activity activity,PayEntity payEntity){
         new DialogPayAccount(activity,payEntity).showPayaccount();

+ 3 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/ActGameAgencyRecharge.java

@@ -245,15 +245,12 @@ public class ActGameAgencyRecharge extends BaseActivity {
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()
-                .releaseTask(
+                .releaseGameTask(
                 1,
                 100,
-                SheepApp.getInstance().getConnectAddress().getPlatForm(),
                 0,
-                0,
-                0,
-                        task_type,
-                0)
+                 task_type,
+                "")
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {

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

@@ -133,7 +133,7 @@ public class ActSearchGame extends BaseActivity {
                 find_information_game_task.setOnClickListener(new View.OnClickListener() {
                     @Override
                     public void onClick(View view) {
-                        ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id());
+                        ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id(), item.getName());
                     }
                 });
                 itemView.setOnClickListener(new View.OnClickListener() {

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

@@ -578,7 +578,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                 case R.id.btn_up_imag:
                     if(game_type == 1){
                         if(game_id != null){
-                            ViewUtil.showGamePayAccount(activity, game_id);
+                            ViewUtil.showGamePayAccount(activity, game_id, taskReleaseEty.getName());
                             return;
                         }
                     }else if(taskEty.getTask_type() == 1002 ||taskEty.getTask_type() == 1003){

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

@@ -333,7 +333,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                     @Override
                     public void onClick(View v) {
 
-                        ViewUtil.showGamePayAccount((Activity) context, item.getGame_id());
+                        ViewUtil.showGamePayAccount((Activity) context, item.getGame_id(), item.getName());
                     }
                 });
                 viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@@ -516,6 +516,7 @@ public class TryMakeMoneyAdp extends AdpCommonRecy<RecyleObj> {
                         PayEntity payEntity = new PayEntity();
                         payEntity.setTask_type(taskEty.getTask_type()+"");
                         payEntity.setGame_id(taskReleaseEty.getTask().getThird_task_id());
+                        payEntity.setGame_name(taskReleaseEty.getName());
                         ViewUtil.newInstance().showGamePayAccount((Activity) context, payEntity);
                     }
                 });

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogAddAccount.java

@@ -26,6 +26,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GridViewEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
@@ -109,7 +110,7 @@ public class DialogAddAccount {
 
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if (!TextUtils.isEmpty(s) && s.length() > 4) {
+                if (!TextUtils.isEmpty(s) && s.length() > 0&& CommonUtil.getInstance().clickTime(500)) {
                     intitDataAccountList(s.toString());
                 }
             }

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

@@ -77,7 +77,7 @@ public class DialogPayAccount {
         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_pay_account, dialog_center_ll, true);
-        dialog_title.setText("游戏中心");
+        dialog_title.setText(payEntity.getDetailShow());
 
         TextView sureTv = view.findViewById(R.id.pay_sure_tv);
         game_account_et = view.findViewById(R.id.game_account_et);
@@ -102,7 +102,7 @@ public class DialogPayAccount {
 
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if (!TextUtils.isEmpty(s) && s.length() > 4 && payEntity != null) {
+                if (!TextUtils.isEmpty(s) && s.length() > 0 && payEntity != null && CommonUtil.getInstance().clickTime(500)) {
                     intitDataAccountList(s.toString(), payEntity);
                 }
             }
@@ -207,7 +207,12 @@ public class DialogPayAccount {
         SheepApp.getInstance()
                 .getNetComponent()
                 .getApiService()
-                .rechargeGameList(Integer.parseInt(payEntity.getTaskType()), name)
+                .releaseGameTask(
+                        1,
+                        100,
+                        0,
+                        TextUtils.isEmpty(payEntity.getTask_type())?"1002,1003,1004":payEntity.getTask_type(),
+                        name)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {

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

@@ -414,7 +414,7 @@ public class DialogPayGame {
 
             @Override
             public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if (!TextUtils.isEmpty(s) && s.length() > 0) {
+                if (!TextUtils.isEmpty(s) && s.length() > 0 && CommonUtil.getInstance().clickTime(500)) {
                     makePriceShow(s.toString());
                 }
             }

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

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_height="wrap_content"
     android:orientation="vertical"
     android:paddingTop="@dimen/content_padding_13"
     android:background="@color/white">

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

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/item_layout"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"