Преглед на файлове

Merge branch 'sheep_develop' of 10.8.230.114:xmy_android/small_sheep_android into sheep_develop

hanjing преди 7 години
родител
ревизия
3e176f53d5
променени са 29 файла, в които са добавени 378 реда и са изтрити 51 реда
  1. 2 0
      app/src/main/java/com/sheep/gamegroup/model/entity/ILog.java
  2. 5 0
      app/src/main/java/com/sheep/gamegroup/model/entity/RechargeBalanceLog.java
  3. 29 0
      app/src/main/java/com/sheep/gamegroup/model/entity/RechargeLog.java
  4. 5 0
      app/src/main/java/com/sheep/gamegroup/model/entity/RechargeQQLog.java
  5. 17 0
      app/src/main/java/com/sheep/gamegroup/model/entity/Release_task.java
  6. 12 0
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java
  7. 8 1
      app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java
  8. 9 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserAssets.java
  9. 5 0
      app/src/main/java/com/sheep/gamegroup/model/entity/WithdrawalEty.java
  10. 35 0
      app/src/main/java/com/sheep/gamegroup/model/util/ShowRedDot.java
  11. 22 0
      app/src/main/java/com/sheep/gamegroup/module/personal/adapter/AdpILog.java
  12. 4 2
      app/src/main/java/com/sheep/gamegroup/module/personal/fragment/FgtRechargeLog.java
  13. 7 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  14. 9 0
      app/src/main/java/com/sheep/gamegroup/util/ListUtil.java
  15. 10 0
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  16. 18 3
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java
  17. 15 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java
  18. 16 1
      app/src/main/java/com/sheep/gamegroup/view/activity/NewYearActMyMoney.java
  19. 47 35
      app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailAct.java
  20. 11 8
      app/src/main/java/com/sheep/gamegroup/view/adapter/TryMakeMoneyAdp.java
  21. 7 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java
  22. 5 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java
  23. 4 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java
  24. 16 0
      app/src/main/res/layout/act_my_money.xml
  25. 7 0
      app/src/main/res/layout/fgt_personacenter_item_top.xml
  26. 22 0
      app/src/main/res/layout/include_mm_at.xml
  27. 17 0
      app/src/main/res/layout/new_year_act_my_money.xml
  28. 13 0
      app/src/main/res/layout/x_my_money_act_layout_item.xml
  29. 1 0
      app/src/main/res/values/strings.xml

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/ILog.java

@@ -10,6 +10,8 @@ public interface ILog {
 
     String getEventText();
 
+    String getEventBtnText();
+
     boolean isEventSuccess();
 
     long getEventTime();

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/RechargeBalanceLog.java

@@ -106,6 +106,11 @@ public class RechargeBalanceLog implements ILog{
     }
 
     @Override
+    public String getEventBtnText() {
+        return null;
+    }
+
+    @Override
     public boolean isEventSuccess() {
         return true;
     }

+ 29 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/RechargeLog.java

@@ -37,6 +37,19 @@ public class RechargeLog implements ILog {
 
     private String wx_account;//string微信账
     private boolean isSelect;
+    private int exchange_status;//integer ($int64) 兑换状态 0:不需兑换,1:未完成 2:待处理(显示兑换按钮) 3:处理中(显示查看按钮) 4:已完成(显示查看按钮)
+    public static final int STATUS_NOT = 0;
+    public static final int STATUS_NOT_FINISHED = 1;
+    public static final int STATUS_CAN_EXCHANGE = 2;
+    public static final int STATUS_HANDLING = 3;
+    public static final int STATUS_FINISHED = 4;
+    public void setExchange_status(int exchange_status) {
+        this.exchange_status = exchange_status;
+    }
+
+    public int getExchange_status() {
+        return exchange_status;
+    }
 
     public boolean isSelect() {
         return isSelect;
@@ -168,6 +181,22 @@ public class RechargeLog implements ILog {
         return detail_desc;
     }
 
+
+    @Override
+    public String getEventBtnText() {
+        switch (exchange_status){
+            case STATUS_NOT:
+            case STATUS_NOT_FINISHED:
+            default:
+                return null;
+            case STATUS_CAN_EXCHANGE:
+                return "兑换";
+            case STATUS_HANDLING:
+            case STATUS_FINISHED:
+                return "查看";
+        }
+    }
+
     @Override
     public boolean isEventSuccess() {
         return type== 1;

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/RechargeQQLog.java

@@ -124,6 +124,11 @@ public class RechargeQQLog implements ILog{
     }
 
     @Override
+    public String getEventBtnText() {
+        return null;
+    }
+
+    @Override
     public boolean isEventSuccess() {
         return status == 2;
     }

+ 17 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/Release_task.java

@@ -88,6 +88,8 @@ public class Release_task implements Serializable {
     private int gift_ratio;//赠送比例,取值0-100
     private int user_task_status;//备注:和任务记录状态一样
 
+    private int is_appoint;// int(11) NOT NULL DEFAULT '0' COMMENT '是否指定任务 1:是 0:不指定'
+
     public int getDemo_time() {
         return demo_time;
     }
@@ -331,6 +333,14 @@ public class Release_task implements Serializable {
         this.consume_amount = consume_amount;
     }
 
+    public void setIs_appoint(int is_appoint) {
+        this.is_appoint = is_appoint;
+    }
+
+    public int getIs_appoint() {
+        return is_appoint;
+    }
+
     @Override
     public boolean equals(Object obj) {
         return obj instanceof Release_task && ((Release_task) obj).getId() == id;
@@ -429,4 +439,11 @@ public class Release_task implements Serializable {
     public String getFuliContent() {
         return  String.format(Locale.CHINA, "恭喜您已获得%s元奖励,需最低消费%d,可抵奖励%s。羊羊给的奖励,赶紧前往购买吧!", getBonusText(), consume_amount, NumberFormatUtils.retainMost2(gift_ratio * consume_amount / 100));
     }
+
+    /**
+     * 是否是定向任务
+     */
+    public boolean isAppointTask() {
+        return is_appoint == 1;
+    }
 }

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/TaskAcceptedEty.java

@@ -191,6 +191,18 @@ public class TaskAcceptedEty implements Serializable{
     public boolean isIs_running() {
         return status == 1 || status == 2;
     }
+    //任务已经有结果
+    public boolean hasResult() {
+        return isFinish() || isAuditFailure();
+    }
+    //任务已经完成
+    public boolean isFinish() {
+        return status == STATUS_FINISHED;
+    }
+    //任务审核失败
+    public boolean isAuditFailure() {
+        return status == STATUS_AUDIT_FAILURE;
+    }
 
     public static final int IS_SUCCESSION_ALL = 3;//所有
     public static final int SHOW_GAME_TASK_NO = 0;//不获取游戏任务

+ 8 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/TaskEty.java

@@ -24,7 +24,7 @@ public class TaskEty implements Serializable, IDownload {
     private String create_time;// 0,
     private String download_link;//private String string",
     private int id;// 0,
-    private int inspect_type = INSPECT_TYPE_PERSION;// 1自动审核 2手动审核 3,应用自动审核
+    private int inspect_type = INSPECT_TYPE_PERSION;// 1游戏自动审核 2手动审核 3,应用自动审核
     private String package_names;//private String string",
     private String remarks;//private String string",
     private String task_name;//private String string",
@@ -364,6 +364,13 @@ public class TaskEty implements Serializable, IDownload {
     public boolean isAppAutoCommitTask(){
         return inspect_type == INSPECT_TYPE_SHEEP;
     }
+    /**
+     * 是否是sdk自动审核任务
+     * @return
+     */
+    public boolean isSdkAutoCommitTask(){
+        return inspect_type == INSPECT_TYPE_SDK;
+    }
 
     //判断任务是否需要下载app
     public boolean needDownloadApp() {

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserAssets.java

@@ -25,6 +25,7 @@ public class UserAssets {
     private float cash_withdrawal;
     private String extension_extract;//推广提成
     private float directional_currency;//定向消费货币
+    private float appoint_task_amount;//定向奖励
     private float game_golden_dan =0f;
 
     public void setSheep_bi_total(String sheep_bi_total){
@@ -85,4 +86,12 @@ public class UserAssets {
     public void setDirectional_currency(float directional_currency) {
         this.directional_currency = directional_currency;
     }
+
+    public void setAppoint_task_amount(float appoint_task_amount) {
+        this.appoint_task_amount = appoint_task_amount;
+    }
+
+    public float getAppoint_task_amount() {
+        return appoint_task_amount;
+    }
 }

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/WithdrawalEty.java

@@ -171,6 +171,11 @@ public class WithdrawalEty implements ILog{
     }
 
     @Override
+    public String getEventBtnText() {
+        return null;
+    }
+
+    @Override
     public boolean isEventSuccess() {
         return pay_status == 2;
     }

+ 35 - 0
app/src/main/java/com/sheep/gamegroup/model/util/ShowRedDot.java

@@ -0,0 +1,35 @@
+package com.sheep.gamegroup.model.util;
+
+/**
+ * Created by realicing on 2019/3/15.
+ * realicing@sina.com
+ * 是否显示红点 数据类型
+ */
+public class ShowRedDot {
+    public static final String WHERE_PERSONAL_CENTER = "personal_center";//个人中心
+
+    private String where;//在哪里显示
+    private boolean isShow;//是否显示
+
+    public ShowRedDot(String where) {
+        this.where = where;
+    }
+
+    public String getWhere() {
+        return where;
+    }
+
+    public ShowRedDot setWhere(String where) {
+        this.where = where;
+        return this;
+    }
+
+    public boolean isShow() {
+        return isShow;
+    }
+
+    public ShowRedDot setShow(boolean show) {
+        isShow = show;
+        return this;
+    }
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/module/personal/adapter/AdpILog.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.module.personal.adapter;
 
 import android.support.annotation.Nullable;
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -10,11 +11,14 @@ import com.chad.library.adapter.base.BaseViewHolder;
 import com.sheep.gamegroup.model.entity.ILog;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.TimeUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import java.util.List;
 
+import rx.functions.Action1;
+
 /**
  * Created by realicing on 2018/12/21.
  * realicing@sina.com
@@ -25,6 +29,13 @@ public class AdpILog extends BaseQuickAdapter<ILog, BaseViewHolder> {
         super(R.layout.x_my_money_act_layout_item, data);
     }
 
+    private Action1<ILog> callBack;
+
+    public AdpILog setCallBack(Action1<ILog> callBack) {
+        this.callBack = callBack;
+        return this;
+    }
+
     @Override
     protected void convert(BaseViewHolder helper, ILog item) {
         View convertView = helper.itemView;
@@ -33,6 +44,17 @@ public class AdpILog extends BaseQuickAdapter<ILog, BaseViewHolder> {
         View my_money_item_top = convertView.findViewById(R.id.my_money_item_top);
         View my_money_item_center = convertView.findViewById(R.id.my_money_item_center);
         View my_money_item_bottom = convertView.findViewById(R.id.my_money_item_bottom);
+        TextView btn_exchange_tv = convertView.findViewById(R.id.btn_exchange_tv);
+
+        //显示按钮
+        ViewUtil.setText(btn_exchange_tv, item.getEventBtnText());
+        ViewUtil.setVisibility(btn_exchange_tv, !TextUtils.isEmpty(item.getEventBtnText()));
+        btn_exchange_tv.setOnClickListener(view -> {
+            if(callBack != null){
+                callBack.call(item);
+            }
+        });
+
         final TextView my_money_item_recharge_amount = convertView.findViewById(R.id.my_money_item_recharge_amount);
         TextView my_money_item_recharge_status = convertView.findViewById(R.id.my_money_item_recharge_status);
         TextView my_money_item_recharge_time = convertView.findViewById(R.id.my_money_item_recharge_time);

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/module/personal/fragment/FgtRechargeLog.java

@@ -7,6 +7,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.ILog;
 import com.sheep.gamegroup.model.entity.RechargeLog;
 import com.sheep.gamegroup.module.personal.adapter.AdpILog;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.view.fragment.BaseListFragment3;
 
@@ -16,9 +17,10 @@ import java.util.ArrayList;
 import java.util.List;
 
 import io.reactivex.Observable;
+import rx.functions.Action1;
 
 /**
- * 我的资产 --> 收明细
+ * 我的资产 --> 收明细
  * Created by realicing on 2018/12/21.
  * realicing@sina.com
  */
@@ -33,7 +35,7 @@ public class FgtRechargeLog extends BaseListFragment3<RechargeLog> {
 
     @Override
     protected RecyclerView.Adapter getAdapter() {
-        return new AdpILog(logList);
+        return new AdpILog(logList).setCallBack(item -> Jump2View.getInstance().goAppointTaskList());
     }
 
     @Override

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2937,4 +2937,11 @@ public class Jump2View {
         WebParams webParams = new WebParams(Config.getUrlByPath(Config.PATH_NEW_SPRING_ACTIVITIES), "新春活动");
         Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), webParams);
     }
+    /**
+     * 小绵羊3.5.2新增 -- 跳转 定向奖励 界面
+     */
+    public void goAppointTaskList() {
+        WebParams webParams = new WebParams(Config.getUrlByPath(Config.PATH_APPOINT_TASK_LIST), "定向奖励");
+        Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), webParams);
+    }
 }

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/util/ListUtil.java

@@ -28,6 +28,15 @@ public class ListUtil {
                 action1.call(t);
             }
     }
+    public static <T> T findItem(List<T> list, CallBack<T, Boolean> action1) {
+        if(list != null)
+            for (T t : list) {
+                if(action1.call(t)){
+                    return t;
+                }
+            }
+        return null;
+    }
 
     public static <T> T getItem(List<T> list, int index) {
         return hasIndex(list, index) ? list.get(index) : null;

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

@@ -2084,6 +2084,16 @@ public class ViewUtil {
             textView.setText(TextUtils.isEmpty(msg) ? "" : msg);
         }
     }
+    public static void setTextId(TextView textView, int msg) {
+        if (textView != null) {
+            textView.setText(SheepApp.getInstance().getString(msg));
+        }
+    }
+    public static void setOnClickListener(View view, View.OnClickListener onClickListener) {
+        if (view != null && onClickListener != null) {
+            view.setOnClickListener(onClickListener);
+        }
+    }
 
     public static void setText(TextView textView, @StringRes int stringId, Object... objects) {
         if (textView != null) {

+ 18 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java

@@ -1,7 +1,6 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.content.Intent;
-import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
@@ -23,6 +22,7 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.util.ActionUtil;
 import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -52,7 +52,6 @@ import java.util.Locale;
 import java.util.concurrent.TimeUnit;
 
 import butterknife.BindView;
-import butterknife.OnClick;
 import io.reactivex.Observable;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
@@ -442,6 +441,22 @@ public class ActMain extends BaseActYmPermissionCheck {
         }
     }
 
+    public static final String KEY_HAS_APPOINT_TASK = "hasAppointTask";
+    @Subscribe
+    public void onEventMainThread(ShowRedDot showRedDot) {
+        switch (showRedDot.getWhere()) {
+            case ShowRedDot.WHERE_PERSONAL_CENTER://个人中心是否显示红点
+                DataUtil.putAsBoolean(KEY_HAS_APPOINT_TASK, showRedDot.isShow());
+                ViewUtil.setVisibility(person_center_red_dot, showRedDot.isShow() || SpUtils.isVoucherFirst());
+                Fragment fragment = getSupportFragmentManager().findFragmentByTag("fragment_" + MainTab.FgtPersonnalCenter.ordinal());
+                if (fragment instanceof FgtPersonalCenter)
+                    ((FgtPersonalCenter) fragment).setPcMmRedDotVisible(showRedDot.isShow());
+                else if (TestUtil.isTest())
+                    G.showToast("测试:程序出错,设置个人中心我的资产小红点失败");
+                break;
+        }
+    }
+
     @Subscribe
     public void onEventMainThread(Intent intent) {
         if (intent != null && intent.getAction() != null && intent.getDataString() != null && intent.getDataString().contains("package:")) {
@@ -482,7 +497,7 @@ public class ActMain extends BaseActYmPermissionCheck {
 
     @Subscribe
     public void whenPersonVoucherClick(FgtPersonalCenter.PersonVoucherClickEvent ev) {
-        ViewUtil.setVisibility(person_center_red_dot, false);
+        ViewUtil.setVisibility(person_center_red_dot, DataUtil.getAsBoolean(KEY_HAS_APPOINT_TASK, false));
     }
 
 }

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

@@ -87,6 +87,10 @@ public class ActMyMoney extends BaseActivity {
     TextView my_money_dingxiang_amount;
     @BindView(R.id.my_money_dingxiang_amount_iv)
     ImageView my_money_dingxiang_amount_iv;
+    @BindView(R.id.my_money_appoint_task_amount)
+    TextView my_money_appoint_task_amount;
+    @BindView(R.id.mm_at_red_dot_v)
+    View mm_at_red_dot_v;
 
     private TitleFragmentListAdapter mAdapter;
 
@@ -108,6 +112,7 @@ public class ActMyMoney extends BaseActivity {
         TitleBarUtils.getInstance()
                 .setTitle(this, "我的资产")
                 .setTitleFinish(this);
+        ViewUtil.setVisibility(mm_at_red_dot_v, DataUtil.getAsBoolean(ActMain.KEY_HAS_APPOINT_TASK, false));
         //顶部背景添加弧度
         GlideImageLoader.setImage(act_my_money_bg_iv, ViewUtil.getNetImgByName("home_blue_bg_hb"), R.mipmap.home_blue_bg);
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
@@ -235,7 +240,10 @@ public class ActMyMoney extends BaseActivity {
             R.id.my_money_recharge_tv,
             R.id.my_money_dingxiang_amount_iv,
             R.id.my_money_dingxiang_amount,
-            R.id.my_money_dingxiang_tag})
+            R.id.my_money_dingxiang_tag,
+            R.id.my_money_appoint_task_amount,
+            R.id.my_money_appoint_task_tag,
+    })
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.my_money_withdraw_tv://提现
@@ -244,6 +252,10 @@ public class ActMyMoney extends BaseActivity {
             case R.id.my_money_recharge_tv://充值
                 Jump2View.getInstance().goRechargeAct(ActMyMoney.this, "我的资产");
                 break;
+            case R.id.my_money_appoint_task_amount://定向奖励
+            case R.id.my_money_appoint_task_tag://定向奖励
+                Jump2View.getInstance().goAppointTaskList();
+                break;
             case R.id.my_money_dingxiang_amount_iv://定向货币详情
             case R.id.my_money_dingxiang_amount://定向货币详情
             case R.id.my_money_dingxiang_tag://定向货币详情
@@ -302,6 +314,7 @@ public class ActMyMoney extends BaseActivity {
         my_money_agent_extract.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getExtension_extract())));
         my_money_recharge_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getUse_balance())));
         my_money_available_amount.setText(getString(R.string.available_amount, NumberFormatUtils.retainMost2W(userAssets.getCash_withdrawal())));
+        my_money_appoint_task_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getDirectional_currency())));
         my_money_dingxiang_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getDirectional_currency())));
     }
 
@@ -314,6 +327,7 @@ public class ActMyMoney extends BaseActivity {
         my_money_agent_extract.setText(getString(R.string.total_money, "0.00"));
         my_money_recharge_amount.setText(getString(R.string.total_money, "0.00"));
         my_money_available_amount.setText(getString(R.string.available_amount, "0.00"));
+        my_money_appoint_task_amount.setText(getString(R.string.total_money, "0.00"));
         my_money_dingxiang_amount.setText(getString(R.string.total_money, "0.00"));
     }
 

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

@@ -31,6 +31,7 @@ import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.RefreshUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
 import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
@@ -77,6 +78,10 @@ public class NewYearActMyMoney extends BaseActivity {
     TextView my_money_available_amount;
     @BindView(R.id.my_money_dingxiang_amount)
     TextView my_money_dingxiang_amount;
+    @BindView(R.id.my_money_appoint_task_amount)
+    TextView my_money_appoint_task_amount;
+    @BindView(R.id.mm_at_red_dot_v)
+    View mm_at_red_dot_v;
 
     private TitleFragmentListAdapter mAdapter;
 
@@ -98,6 +103,7 @@ public class NewYearActMyMoney extends BaseActivity {
         TitleBarUtils.getInstance()
                 .setTitle(this, "我的资产")
                 .setTitleFinish(this);
+        ViewUtil.setVisibility(mm_at_red_dot_v, DataUtil.getAsBoolean(ActMain.KEY_HAS_APPOINT_TASK, false));
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
         mAdapter.add(new FgtRechargeBalanceLog(), tabNames[0]);
         mAdapter.add(new FgtWithdraw(), tabNames[1]);
@@ -225,7 +231,10 @@ public class NewYearActMyMoney extends BaseActivity {
             R.id.my_money_recharge_tv,
             R.id.my_money_dingxiang_amount_iv,
             R.id.my_money_dingxiang_amount,
-            R.id.my_money_dingxiang_tag})
+            R.id.my_money_dingxiang_tag,
+            R.id.my_money_appoint_task_amount,
+            R.id.my_money_appoint_task_tag,
+    })
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.my_money_withdraw_tv://提现
@@ -234,6 +243,10 @@ public class NewYearActMyMoney extends BaseActivity {
             case R.id.my_money_recharge_tv://充值
                 Jump2View.getInstance().goRechargeAct(NewYearActMyMoney.this, "我的资产");
                 break;
+            case R.id.my_money_appoint_task_amount://定向奖励
+            case R.id.my_money_appoint_task_tag://定向奖励
+                Jump2View.getInstance().goAppointTaskList();
+                break;
             case R.id.my_money_dingxiang_amount_iv://定向货币详情
             case R.id.my_money_dingxiang_amount://定向货币详情
             case R.id.my_money_dingxiang_tag://定向货币详情
@@ -292,6 +305,7 @@ public class NewYearActMyMoney extends BaseActivity {
         my_money_agent_extract.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getExtension_extract())));
         my_money_recharge_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getUse_balance())));
         my_money_available_amount.setText(getString(R.string.available_amount, NumberFormatUtils.retainMost2W(userAssets.getCash_withdrawal())));
+        my_money_appoint_task_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getDirectional_currency())));
         my_money_dingxiang_amount.setText(getString(R.string.total_money, NumberFormatUtils.retainMost2W(userAssets.getDirectional_currency())));
     }
 
@@ -304,6 +318,7 @@ public class NewYearActMyMoney extends BaseActivity {
         my_money_agent_extract.setText(getString(R.string.total_money, "0.00"));
         my_money_recharge_amount.setText(getString(R.string.total_money, "0.00"));
         my_money_available_amount.setText(getString(R.string.available_amount, "0.00"));
+        my_money_appoint_task_amount.setText(getString(R.string.total_money, "0.00"));
         my_money_dingxiang_amount.setText(getString(R.string.total_money, "0.00"));
     }
 

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

@@ -45,6 +45,7 @@ import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.TaskDetailContract;
 import com.sheep.gamegroup.presenter.TaskDetailPresenter;
 import com.sheep.gamegroup.usage.AppUsageManager;
+import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DeviceUtil;
@@ -628,8 +629,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
     private void setOtherTaskBtnState() {
         switch (taskEty.getInspect_type()) {// 1自动审核 2手动审核 3,应用自动审核
             case INSPECT_TYPE_SDK:
-                btnUpImag.setText("无需截图");//第二按钮不可点击且显示状态(sdk自动审核暂不支持)
-                btnUpImag.setEnabled(false);
+                btnUpImag.setText("确认完成");//第二按钮不可点击且显示状态(sdk自动审核直接领取奖励)
                 break;
             case INSPECT_TYPE_PERSION:
                 switch (type) {
@@ -924,11 +924,11 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
      * 点击第二按钮
      */
     private void onClickSecondBtn() {
-        if (gettaskAcceptedEty != null && gettaskAcceptedEty.getStatus() == 3 && taskEty.isGameTask()) {
+        if (gettaskAcceptedEty != null && gettaskAcceptedEty.getStatus() == 3 && taskEty.isGameTask()) {//已经完成的游戏任务
             if (taskEty.getThird_task_id() != null) {
                 ViewUtil.showGamePayAccount(activity, taskEty.getThird_task_id(), taskReleaseEty.getName());
             }
-        } else if (taskEty.isGameTask()) {
+        } else if (taskEty.isGameTask()) {//游戏任务
             if (taskEty.isGameReservationCantDownload()) {
                 CommonUtil.getInstance().reservationGameTask(taskReleaseEty, new Action1<Integer>() {
                     @Override
@@ -940,6 +940,13 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
             } else {
                 accepteReceiveAward();
             }
+        } else if (taskEty.isSdkAutoCommitTask()) {//sdk自动审核任务
+            try {
+                commitAutoTask(new JSONObject());
+            } catch (Exception e) {
+                e.printStackTrace();
+                G.showToast(e.getMessage());
+            }
         } else if (taskEty.isAppAutoCommitTask()) {//应用自动审核任务
             try {
                 checkAndCommitTask();
@@ -1099,9 +1106,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                 G.showToast(R.string.error_package_link);
                 return;
             }
-            String gps = LocationUtils.getInstance().getLongitudeLatitude();
             JSONObject object = new JSONObject();
-            object.put("gps", gps);
             if (AutoCheckService.IS_USE_THIS_SERVICE) {
                 ProcessRecord processRecord = DDProviderHelper.getInstance().getProcessRecord(taskEty.getPackage_names());
                 object.put("task_time", processRecord.getRunTime());
@@ -1134,41 +1139,48 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
                 }
             }
 
-            object.put("release_task_id", taskReleaseEty.getId());
-            object.put("create_time", System.currentTimeMillis() / 1000L);//这里添加时间戳,防止用户抓包后重复使用
             addCanCommitTaskChildId(object, taskEty);
-            SheepApp.getInstance().getNetComponent().getApiService().commitAutoTask(object)
-                    .subscribeOn(Schedulers.io())
-                    .observeOn(AndroidSchedulers.mainThread())
-                    .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
-                        @Override
-                        public void onNext(BaseMessage baseMessage) {
-                            CommonUtil.getInstance().updateAutoCheck(null);
-                            //这里领取了奖励,要刷新用户信息
-                            CommonUtil.getInstance().updateUserInfo(null);
-                            String amount = taskReleaseEty.getBonusText();
-                            try {
-                                Map h = JSON.parseObject(baseMessage.getData() + "");
-
-                                amount = h.get("amount") + "";
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            }
-
-                            G.showToast(String.format(Locale.CHINA, "恭喜你,奖励已完成,获得奖励%s元", TextUtils.isEmpty(amount) ? taskReleaseEty.getBonusText() : amount));
-                            finish();
-                        }
-
-                        @Override
-                        public void onError(BaseMessage baseMessage) {
-                            G.showToast(baseMessage);
-                        }
-                    });
+            commitAutoTask(object);
         } else {
             G.showToast(R.string.unknown_error);
         }
     }
 
+    //提交自动审核任务
+    private void commitAutoTask(JSONObject object) {
+        String gps = LocationUtils.getInstance().getLongitudeLatitude();
+        object.put("gps", gps);
+        object.put("release_task_id", taskReleaseEty.getId());
+        object.put("create_time", System.currentTimeMillis() / 1000L);//这里添加时间戳,防止用户抓包后重复使用
+        SheepApp.getInstance().getNetComponent().getApiService().commitAutoTask(object)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(getApplicationContext()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        CommonUtil.getInstance().updateAutoCheck(null);
+                        //这里领取了奖励,要刷新用户信息
+                        CommonUtil.getInstance().updateUserInfo(null);
+                        String amount = taskReleaseEty.getBonusText();
+                        try {
+                            Map h = JSON.parseObject(baseMessage.getData() + "");
+
+                            amount = h.get("amount") + "";
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
+                        G.showToast(String.format(Locale.CHINA, "恭喜你,奖励已完成,获得奖励%s元", TextUtils.isEmpty(amount) ? taskReleaseEty.getBonusText() : amount));
+                        finish();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
     /**
      * 连续任务在自动审核任务领取任务时添加子任务id参数
      *

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

@@ -719,8 +719,6 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
                             "截止时间:" + taskReleaseEty.getDeadline());
                 }
 
-                ((TextView) viewHolder.itemView.findViewById(R.id.detail_task_tv)).setText(R.string.cancel);
-
                 if ((is_succession == 1 || is_succession == 3)
                         && (taskAcceptedEty.getChild_task_id() > 1
                         || (taskAcceptedEty.getChild_task_id() == 1
@@ -747,16 +745,21 @@ public class TryMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
 //                }else {
 //                    task_type_tv.setVisibility(View.INVISIBLE);
 //                }
-                viewHolder.itemView.findViewById(R.id.detail_task_tv).setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
 
+                TextView detail_task_tv = viewHolder.itemView.findViewById(R.id.detail_task_tv);
+                if(taskReleaseEty.isAppointTask() && taskAcceptedEty.isFinish()){//定向任务已经有结果
+                    ViewUtil.setText(detail_task_tv, "去兑换");
+                    ViewUtil.setOnClickListener(detail_task_tv, v -> {
+                        Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), "", "");
+                    });
+                } else {
+                    ViewUtil.setTextId(detail_task_tv, R.string.cancel);
+                    ViewUtil.setOnClickListener(detail_task_tv, v -> {
                         presenter.giveUpTask(taskAcceptedEty.getId());
                         //暂停下载
                         CommonUtil.getInstance().stopDownloadTask(context, taskEty.getDownload_link());
-
-                    }
-                });
+                    });
+                }
                 GlideImageLoader.setGameImage((ImageView) viewHolder.itemView.findViewById(R.id.item_icon_iv), taskEty.getIcon());
                 viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
                     @Override

+ 7 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -74,6 +74,8 @@ public class FgtPersonalCenter extends BaseFragment {
     TextView nameTv;
     @BindView(R.id.sheep_num_tv)
     TextView sheepNumTv;
+    @BindView(R.id.pc_mm_red_dot_v)
+    View pc_mm_red_dot_v;
     @BindView(R.id.personalcenter_item_price_tv)
     TextView personalcenter_item_price_tv;
     @BindView(R.id.proxy_service_layout)
@@ -552,6 +554,11 @@ public class FgtPersonalCenter extends BaseFragment {
         }
     }
 
+    //设置我的资产中是否显示小红点
+    public void setPcMmRedDotVisible(boolean isShow) {
+        ViewUtil.setVisibility(pc_mm_red_dot_v, isShow);
+    }
+
     @Override
     public void initDataOnVisibleToUser() {
         try {

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -66,6 +66,7 @@ import com.sheep.gamegroup.model.entity.SlideshowEty;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
 import com.sheep.gamegroup.module.plugin.model.Plugin;
 import com.sheep.gamegroup.module.skin.util.SkinUtil;
@@ -1038,6 +1039,10 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
             BaseMessage baseMessage = (BaseMessage) object;
             allTaskAcceptedTaskList = baseMessage.getDataList(TaskAcceptedEty.class);
             CommonUtil.getInstance().reloadAutoTaskList(allTaskAcceptedTaskList);
+            TaskAcceptedEty findItem = ListUtil.findItem(allTaskAcceptedTaskList, taskAcceptedEty -> taskAcceptedEty != null && taskAcceptedEty.getRelease_task() != null && taskAcceptedEty.getRelease_task().isAppointTask());
+            if(findItem != null){
+                EventBus.getDefault().post(new ShowRedDot(ShowRedDot.WHERE_PERSONAL_CENTER).setShow(true));
+            }
         } else {
             allTaskAcceptedTaskList.clear();
         }

+ 4 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -38,6 +38,8 @@ public class Config {
     private static final String STATION_SPRING_FESTIVAL_ACTIVITIES = "/spring_festival_activities/#";
     //游戏金币
     private static final String STATION_SMALL_SHEEP_GAME_COINS = "/small_sheep_game_coins/#";
+    //定向奖励
+    private static final String STATION_APPOINT_TASK = "/appoint_task/#";
 
     //path
     //有范商城地址的 key
@@ -66,6 +68,8 @@ public class Config {
     public static final String PATH_DIRECTIONAL_LOTTERY = STATION_TURNTABLE + "/invincible-big-turntable";
     //注册大转盘
     public static final String PATH_REGISTER_BIG_TURNTABLE = STATION_H5_REGISTER_TURNTABLE + "/register-big-turntable";
+    //跳转定向奖励兑换列表
+    public static final String PATH_APPOINT_TASK_LIST = STATION_APPOINT_TASK + "/appoint-task-list";
     //small_station地址 key
     public static final String KEY_SMALL_STATION_URL = "small_station_url";
     //small_station地址

+ 16 - 0
app/src/main/res/layout/act_my_money.xml

@@ -178,6 +178,16 @@
                         </LinearLayout>
 
                         <TextView
+                            android:id="@+id/my_money_appoint_task_amount"
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1"
+                            android:gravity="center"
+                            android:text="@string/total_money"
+                            android:textColor="@color/white"
+                            android:textSize="12sp" />
+
+                        <TextView
                             android:id="@+id/my_money_recharge_amount"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
@@ -225,6 +235,12 @@
                             android:textColor="@color/white"
                             android:textSize="12sp" />
 
+                        <RelativeLayout
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1">
+                            <include layout="@layout/include_mm_at"/>
+                        </RelativeLayout>
                         <TextView
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"

+ 7 - 0
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -146,6 +146,13 @@
             style="@style/style_item_label"
             android:text="我的资产" />
 
+        <View
+            android:id="@+id/pc_mm_red_dot_v"
+            android:layout_width="8dp"
+            android:layout_height="8dp"
+            android:layout_marginEnd="2dp"
+            android:background="@drawable/shape_oval_red"
+            android:visibility="gone" />
         <TextView
             android:id="@+id/personalcenter_item_price_tv"
             style="@style/style_item_end_next" />

+ 22 - 0
app/src/main/res/layout/include_mm_at.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <TextView
+        android:id="@+id/my_money_appoint_task_tag"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:gravity="center"
+        android:text="@string/appoint_task"
+        android:textColor="@color/white"
+        android:textSize="12sp" />
+    <View
+        android:id="@+id/mm_at_red_dot_v"
+        android:layout_width="8dp"
+        android:layout_height="8dp"
+        android:layout_marginStart="-1dp"
+        android:background="@drawable/shape_oval_red"
+        android:visibility="gone"
+        android:layout_alignTop="@+id/my_money_appoint_task_tag"
+        android:layout_toEndOf="@+id/my_money_appoint_task_tag"/>
+</merge>

+ 17 - 0
app/src/main/res/layout/new_year_act_my_money.xml

@@ -211,6 +211,16 @@
                         </LinearLayout>
 
                         <TextView
+                            android:id="@+id/my_money_appoint_task_amount"
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1"
+                            android:gravity="center"
+                            android:text="@string/total_money"
+                            android:textColor="@color/white"
+                            android:textSize="12sp" />
+
+                        <TextView
                             android:id="@+id/my_money_recharge_amount"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
@@ -258,6 +268,13 @@
                             android:textColor="@color/white"
                             android:textSize="12sp" />
 
+                        <RelativeLayout
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1">
+                            <include layout="@layout/include_mm_at"/>
+                        </RelativeLayout>
+
                         <TextView
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"

+ 13 - 0
app/src/main/res/layout/x_my_money_act_layout_item.xml

@@ -43,6 +43,19 @@
                 android:src="@mipmap/myprice_on"
                 android:layout_marginLeft="@dimen/content_padding_1"
                 android:visibility="invisible"/>
+            <TextView
+                android:id="@+id/btn_exchange_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="6dp"
+                android:paddingTop="3dp"
+                android:paddingBottom="3dp"
+                android:paddingStart="6dp"
+                android:paddingEnd="6dp"
+                android:textColor="@android:color/white"
+                android:textSize="10sp"
+                android:text="兑换"
+                android:background="@drawable/selector_button_full_main"/>
         </LinearLayout>
 
         <TextView

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -18,6 +18,7 @@
     <string name="recharge_amount">可用余额</string>
     <string name="available_amount">可提现金额:%s元</string>
     <string name="dingxiang_amount">定向福利</string>
+    <string name="appoint_task">定向奖励</string>
 
     <string name="rechargeq_amount">当前绵羊币余额:%s元</string>