Просмотр исходного кода

移动积分兑换界面与接口调试;
banner添加新的类型;
修复消息详情界面内容展示不全问题

zengjiebin лет назад: 7
Родитель
Сommit
62ba2fd201
43 измененных файлов с 1085 добавлено и 201 удалено
  1. 3 0
      app/src/main/AndroidManifest.xml
  2. 6 3
      app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java
  3. 0 16
      app/src/main/java/com/sheep/gamegroup/di/components/AskGetMoneyComponent.java
  4. 0 22
      app/src/main/java/com/sheep/gamegroup/di/modules/AskGetMoneyModule.java
  5. 30 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  6. 36 0
      app/src/main/java/com/sheep/gamegroup/model/entity/CMCCExchange.java
  7. 14 0
      app/src/main/java/com/sheep/gamegroup/model/entity/DialogConfig.java
  8. 0 23
      app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyContract.java
  9. 0 59
      app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java
  10. 68 32
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  11. 11 0
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  12. 10 0
      app/src/main/java/com/sheep/gamegroup/util/DataUtil.java
  13. 69 9
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  14. 11 0
      app/src/main/java/com/sheep/gamegroup/util/RefreshUtil.java
  15. 4 1
      app/src/main/java/com/sheep/gamegroup/util/TestUtil.java
  16. 1 0
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  17. 17 2
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  18. 45 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ActExchangeCMCC.java
  19. 22 9
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSysNfDetail.java
  20. 0 16
      app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java
  21. 0 1
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAudit.java
  22. 369 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtExchangeCMCC.java
  23. 5 4
      app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java
  24. BIN
      app/src/main/res/drawable-xxhdpi/bg_cmcc_exchange.webp
  25. BIN
      app/src/main/res/drawable-xxhdpi/bg_exchnage_item.webp
  26. BIN
      app/src/main/res/drawable-xxhdpi/bg_exchnage_item_choose.webp
  27. BIN
      app/src/main/res/drawable-xxhdpi/btn_azure_h.webp
  28. BIN
      app/src/main/res/drawable-xxhdpi/btn_azure_hh.webp
  29. BIN
      app/src/main/res/drawable-xxhdpi/btn_orange_h.webp
  30. BIN
      app/src/main/res/drawable-xxhdpi/btn_orange_w.webp
  31. BIN
      app/src/main/res/drawable-xxhdpi/btn_orange_ww.webp
  32. BIN
      app/src/main/res/drawable/orange_background_frame.9.png
  33. 6 0
      app/src/main/res/drawable/shape_f7dd9e_solid_rectangle_17.xml
  34. 6 0
      app/src/main/res/drawable/shape_rectangle_red_8.xml
  35. 6 0
      app/src/main/res/drawable/shape_white_solid_rectangle_12.xml
  36. 2 1
      app/src/main/res/layout/act_sys_nf_detail.xml
  37. 43 0
      app/src/main/res/layout/dialog_parent_cmcc.xml
  38. 112 0
      app/src/main/res/layout/fgt_exchange_cmcc.xml
  39. 46 0
      app/src/main/res/layout/item_exchange_cmcc.xml
  40. 1 3
      app/src/main/res/layout/x_ask_getmoney_act_layout.xml
  41. 48 0
      app/src/main/res/layout/x_msg_dialog_cmcc.xml
  42. 91 0
      app/src/main/res/layout/x_msg_dialog_cmcc_look.xml
  43. 3 0
      app/src/main/res/values/strings.xml

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -270,6 +270,9 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.AskGetMoneyAct"
             android:screenOrientation="portrait" />
+        <activity
+            android:name="com.sheep.gamegroup.view.activity.ActExchangeCMCC"
+            android:screenOrientation="portrait" />
 
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActDownloadMgr"

+ 6 - 3
app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java

@@ -24,12 +24,15 @@ public abstract class BaseActivity extends AppCompatActivity {
 
     protected DialogLoading dialogLoading;
     public Unbinder unbinder;
-
+    protected boolean needButterKnife(){
+        return true;
+    }
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(getLayoutId());
-        unbinder = ButterKnife.bind(this);
+        if(needButterKnife())
+            unbinder = ButterKnife.bind(this);
         initView();
         initListener();
         initData();
@@ -97,7 +100,7 @@ public abstract class BaseActivity extends AppCompatActivity {
     protected void onDestroy() {
         try {
             super.onDestroy();
-            if (this.unbinder != null) {
+            if (needButterKnife() && this.unbinder != null) {
                 this.unbinder.unbind();
             }
         } catch (Exception e) {

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

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

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

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

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

@@ -1022,4 +1022,34 @@ public interface ApiService {
      */
     @GET("app/common_config/need_shot_screen")
     Observable<BaseMessage> needShotScreen();
+    //移动积分兑换
+//    http://10.8.220.237:8010/v1/app/mobile_point/goods    获取商品列表  get
+//    http://10.8.220.237:8010/v1/app/mobile_point/score    获取用户积分 post
+//    http://10.8.220.237:8010/v1/app/mobile_point/sms      获取短信验证码 post
+//    http://10.8.220.237:8010/v1/app/mobile_point/recharge 兑换积分 post
+    /**
+     * 获取商品列表
+     * @return
+     */
+    @GET("app/mobile_point/goods")
+    Observable<BaseMessage> getCMCCGoods();
+    /**
+     * 获取用户积分
+     * @return
+     */
+    @POST("app/mobile_point/score")
+    Observable<BaseMessage> getCMCCScore(@Body JSONObject jsonObject);
+    /**
+     * 获取短信验证码
+     * @return
+     */
+    @POST("app/mobile_point/sms")
+    Observable<BaseMessage> smsCMCC(@Body JSONObject jsonObject);
+    /**
+     * 兑换积分
+     * @return
+     */
+    @POST("app/mobile_point/recharge")
+    Observable<BaseMessage> rechargeCMCC(@Body JSONObject jsonObject);
+
 }

+ 36 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/CMCCExchange.java

@@ -0,0 +1,36 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/10/15.
+ * realicing@sina.com
+ * 移动积分兑换对象
+ */
+public class CMCCExchange {
+    private int id;
+    private int score;
+    private float amount;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getScore() {
+        return score;
+    }
+
+    public void setScore(int score) {
+        this.score = score;
+    }
+
+    public float getAmount() {
+        return amount;
+    }
+
+    public void setAmount(float amount) {
+        this.amount = amount;
+    }
+}

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/DialogConfig.java

@@ -2,10 +2,12 @@ package com.sheep.gamegroup.model.entity;
 
 import android.support.annotation.IntDef;
 import android.support.annotation.LayoutRes;
+import android.support.annotation.StringRes;
 import android.view.Gravity;
 import android.view.View;
 
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -52,6 +54,10 @@ public class DialogConfig {
         this.msg = msg;
         return this;
     }
+    public DialogConfig setMsg(@StringRes int msgRes) {
+        this.msg = SheepApp.getInstance().getString(msgRes);
+        return this;
+    }
     public DialogConfig setMsgColor(String colorMsg, String color) {
         colorMsgMap.put(colorMsg, color);
         return this;
@@ -206,4 +212,12 @@ public class DialogConfig {
         this.layoutId = layoutId;
         return this;
     }
+    private int parentLayoutId = R.layout.dialog_parent;
+    public int getParentLayoutId() {
+        return parentLayoutId;
+    }
+    public DialogConfig setParentLayoutId(@LayoutRes int parentLayoutId) {
+        this.parentLayoutId = parentLayoutId;
+        return this;
+    }
 }

+ 0 - 23
app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyContract.java

@@ -1,23 +0,0 @@
-package com.sheep.gamegroup.presenter;
-
-import com.sheep.gamegroup.IBase.IBasePresenter;
-import com.sheep.gamegroup.IBase.IBaseView;
-import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
-
-/**
- * Created by Administrator on 2018/3/10.
- */
-
-public interface AskGetMoneyContract {
-
-    interface Presenter extends IBasePresenter{
-
-    }
-
-    interface View extends IBaseView{
-       void   showTask(FriendAndAwardEntity entity);
-
-
-
-    }
-}

+ 0 - 59
app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java

@@ -1,59 +0,0 @@
-package com.sheep.gamegroup.presenter;
-
-import com.alibaba.fastjson.JSONObject;
-import com.sheep.gamegroup.model.api.ApiService;
-import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.FriendAndAwardEntity;
-import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.util.FastJsonUtils;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-
-import java.util.HashMap;
-
-import javax.inject.Inject;
-
-import rx.android.schedulers.AndroidSchedulers;
-import rx.schedulers.Schedulers;
-
-/**
- * Created by Administrator on 2018/3/10.
- */
-
-public class AskGetMoneyPresenter implements AskGetMoneyContract.Presenter {
-    private AskGetMoneyContract.View view;
-    private ApiService apiService;
-
-    @Inject
-    public AskGetMoneyPresenter(AskGetMoneyContract.View view, ApiService apiService) {
-        this.view = view;
-        this.apiService = apiService;
-    }
-
-
-    @Override
-    public void getTask(HashMap<String, String> map) {
-
-        apiService.FriendCountAndAward()
-                .subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
-                    @Override
-                    public void onError(BaseMessage baseMessage) {
-                        view.NetError(-1, baseMessage.getMsg());
-                    }
-
-                    @Override
-                    public void onNext(BaseMessage baseMessage) {
-                        if(baseMessage!=null){
-                            FriendAndAwardEntity Ety = baseMessage.getData(FriendAndAwardEntity.class);
-                            view.showTask(Ety);
-                        }else{
-                            view.NetError(-1,"数据解析出错");
-                        }
-
-                    }
-                });
-
-
-    }
-}

+ 68 - 32
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -436,74 +436,110 @@ public class CommonUtil {
             e.printStackTrace();
         }
     }
-
-    /**
-     *
+    public static final int JUMP_NEW_USER_TASK = -1;//新手任务
+    public static final int JUMP_TRY_PLAY = 1;//试玩赚钱
+    public static final int JUMP_ASK_FRIEND = 2;//邀请赚钱
+    public static final int JUMP_LIE_MAKE = 3;//躺着赚钱
+    public static final int JUMP_CREDIT_CARD = 4;//办卡赚钱
+    public static final int JUMP_GAME_CENTER = 5;//游戏中心
+    public static final int JUMP_RECHARGE_Q = 6;//充值q币
+    public static final int JUMP_WX_ASSIST = 7;//微信辅助
+    public static final int JUMP_SUCCESSION_TASK = 8;//连续任务
+    public static final int JUMP_SIGN_CARD = 9;//打卡赚钱
+    public static final int JUMP_H5_INNER = 98;//内部WebView加载H5
+    public static final int JUMP_H5_OUTER = 99;//外部浏览器加载H5
+    public static final int JUMP_GAME_TASK = 11;//游戏任务
+    public static final int JUMP_XIAN_WAN = 12;//闲玩任务
+    public static final int JUMP_GAME_RECHARGE = 13;//游戏代充(游戏充值)
+    public static final int JUMP_MI_DONG = 14;//幂动科技(简单任务)
+    public static final int JUMP_XIAO_MI = 15;//小米游戏列表
+    //TODO 这里移动积分兑换的id需要替换
+    public static final int JUMP_EXCHANGE_CMCC = 1000025;//移动积分兑换
+    public static final int JUMP_GMAE = 1000026;//游戏
+    public static final int JUMP_FIND_GMAE = 1000029;//游戏
+    public static final int JUMP_WATCH_FOCUS = 1000027;//资讯
+    public static final int JUMP_INFORMATION = 1000028;//看点
+    public static final int JUMP_H5_INNER_FIND = 198;//发现--内部WebView加载H5
+    public static final int JUMP_H5_OUTER_FIND = 199;//发现---外部浏览器加载H5
+    /**
+     * 点击主页HomeList跳转
      */
     public void goNative(Context context, HomeListEntity entity, String from) {
 
         switch (Integer.valueOf(entity.getJump())) {
-            case -1://新手任务
-
+            case JUMP_NEW_USER_TASK://新手任务
                 DialogNewbieTaskList.tryShowDialog((Activity) context);
                 NEWBIE_TASK.onEvent();
                 break;
-            case 1://试玩赚钱
-
+            case JUMP_TRY_PLAY://试玩赚钱
                 Jump2View.getInstance().goTryplayView(context, null);
                 break;
-            case 2://2邀请赚钱,
+            case JUMP_ASK_FRIEND://邀请赚钱
                 Jump2View.getInstance().goAskGetMoney(context, null);
                 break;
-            case 3://3躺着赚钱,
+            case JUMP_LIE_MAKE://躺着赚钱
                 Jump2View.getInstance().tryGoLyingView(context, null);
-
                 break;
-            case 4://4办卡赚钱
+            case JUMP_CREDIT_CARD://办卡赚钱
                 Jump2View.getInstance().goCreditCardTaskList(context, null);
                 break;
-            case 5://5玩转游戏
-                Jump2View.getInstance()
-                        .goMainGame(context);
+            case JUMP_GAME_CENTER://玩转游戏
+                Jump2View.getInstance().goMainGame(context);
                 break;
-            case 6://6充值q币
-//                G.showToast("敬请期待!");
+            case JUMP_RECHARGE_Q://充值q币
                 Jump2View.getInstance().goRechargeQAct(context, from);
                 break;
-            case 7://微信辅助
-//                G.showToast("敬请期待!");
-
-                Jump2View.getInstance().goWeb(context,
-                        entity.getUrl(), "微信二维码辅助好友注册任务");
+            case JUMP_WX_ASSIST://微信辅助
+                Jump2View.getInstance().goWeb(context, entity.getUrl(), "微信二维码辅助好友注册任务");
                 break;
-            case 8://连续任务
+            case JUMP_SUCCESSION_TASK://连续任务
                 Jump2View.getInstance().goSequentialTaskView(context);
                 break;
-            case 9://打卡赚钱
+            case JUMP_SIGN_CARD://打卡赚钱
                 Jump2View.getInstance().goSignCardAct(context, null);
                 break;
-            case 98://内部WebView加载H5
+            case JUMP_H5_INNER://内部WebView加载H5
                 Jump2View.getInstance().goWeb(context, entity.getUrl(), entity.getTitle());
                 break;
-            case 99://外部浏览器加载H5
+            case JUMP_H5_OUTER://外部浏览器加载H5
                 Jump2View.getInstance().goWeb(context, entity.getUrl());
                 break;
-            case 11://游戏任务
-                Jump2View.getInstance()
-                        .goGameMakeMoney(context, 0);
+            case JUMP_GAME_TASK://游戏任务
+                Jump2View.getInstance().goGameMakeMoney(context, 0);
                 break;
-            case 12://闲玩任务
+            case JUMP_XIAN_WAN://闲玩任务
                 Jump2View.getInstance().goXianwanWeb(context, null, null);
                 break;
-            case 13://游戏代充(游戏充值)
+            case JUMP_GAME_RECHARGE://游戏代充(游戏充值)
                 Jump2View.getInstance().goGameRecharge((Activity) context, null);
                 break;
-            case 14://幂动科技(简单任务)
+            case JUMP_MI_DONG://幂动科技(简单任务)
                 Jump2View.getInstance().goMiDong((Activity) context, null);
                 break;
-            case 15://小米游戏列表
+            case JUMP_XIAO_MI://小米游戏列表
                 Jump2View.getInstance().goXiaomiGameList((Activity) context, null);
                 break;
+            case JUMP_EXCHANGE_CMCC://移动积分兑换
+                Jump2View.getInstance().goActExchangeCMCC(context);
+                break;
+            case JUMP_GMAE://游戏详情
+                Jump2View.getInstance().goPlayGameDetail((Activity) context, 0);//TODO 这里差游戏id
+                break;
+            case JUMP_FIND_GMAE://发现中的游戏详情
+                Jump2View.getInstance().goFindGame((Activity) context, 0);//TODO 这里差游戏id
+                break;
+            case JUMP_INFORMATION://webView资讯
+                Jump2View.getInstance().goFindInformation((Activity) context, "标题", 0);//TODO 这里差标题和资讯的id
+                break;
+            case JUMP_H5_INNER_FIND://发现--内部WebView加载H5
+                Jump2View.getInstance().goWeb(context, entity.getUrl(), entity.getTitle());
+                break;
+            case JUMP_H5_OUTER_FIND://发现--外部浏览器加载H5
+                Jump2View.getInstance().goWeb(context, entity.getUrl());
+                break;
+            case JUMP_WATCH_FOCUS://看点
+                Jump2View.getInstance().goWatchFocus((Activity) context, new RouserArticlesEntity());//TODO 这里差看点的id,type, packageName, deepLink, appName
+                break;
             default:
                 String url = entity.getUrl();
                 if (TextUtils.isEmpty(url))

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

@@ -10,6 +10,17 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
  */
 
 public enum ConnectAddress {
+    dangyongfeng {
+
+        @Override
+        public String getAppUrl() {
+            return "http://10.8.220.237:8010/";
+        }
+        @Override
+        public String getName() {
+            return "党勇锋";
+        }
+    },
     ruanlang {
 
         @Override

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

@@ -501,6 +501,16 @@ public class DataUtil {
     public static <T> void putObject(Intent intent, T t) {
         intent.putExtra(t.getClass().getSimpleName(), JSONObject.toJSONString(t));
     }
+    /**
+     * 设置数据到bundle中
+     * @param intent
+     * @param t
+     * @param <T>
+     * @param key
+     */
+    public static <T> void putObject(Intent intent, T t, String key) {
+        intent.putExtra(key, JSONObject.toJSONString(t));
+    }
 
 
     //-----------------------------------------数据转换部分-----------------------------------------------------结束

+ 69 - 9
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -26,6 +26,7 @@ import com.sheep.gamegroup.model.entity.FindItem;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
+import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
 import com.sheep.gamegroup.model.entity.SystemNotification;
 import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -73,6 +74,7 @@ import com.sheep.gamegroup.view.activity.ActUserLabelList;
 import com.sheep.gamegroup.view.activity.ActWeb;
 import com.sheep.gamegroup.view.activity.ActXiaomiGame;
 import com.sheep.gamegroup.view.activity.ActXinwanWeb;
+import com.sheep.gamegroup.view.activity.ActExchangeCMCC;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
 import com.sheep.gamegroup.view.activity.ChangeTelAct;
@@ -1510,16 +1512,30 @@ public class Jump2View {
      * @param activity
      * @param item
      */
-    public void goFindGame(Activity activity, Object item) {
+    public void goFindGame(Activity activity, FindItem item) {
+        Intent intent = new Intent(activity, ActFindGame.class);
+        intent.putExtra("id", item.getApplication_id());
+        activity.startActivity(intent);
+    }
+    /**
+     * 发现模块--游戏详情界面
+     *
+     * @param activity
+     * @param findApp
+     */
+    public void goFindGame(Activity activity, FindApp findApp) {
+        Intent intent = new Intent(activity, ActFindGame.class);
+        intent.putExtra("id", findApp.getId());
+        activity.startActivity(intent);
+    }
+    /**
+     * 发现模块--游戏详情界面
+     *
+     * @param activity
+     * @param applicationId
+     */
+    public void goFindGame(Activity activity, int applicationId) {
         Intent intent = new Intent(activity, ActFindGame.class);
-        int applicationId = 0;
-        if (item instanceof FindItem) {
-            applicationId = ((FindItem) item).getApplication_id();
-        } else if (item instanceof FindApp) {
-            applicationId = ((FindApp) item).getId();
-        } else if (item instanceof Integer) {
-            applicationId = (int) item;
-        }
         intent.putExtra("id", applicationId);
         activity.startActivity(intent);
     }
@@ -1537,6 +1553,20 @@ public class Jump2View {
         activity.startActivity(intent);
         USER_FIND_APP_ORDER.onEvent();
     }
+    /**
+     * 发现模块--资讯详情界面
+     *
+     * @param activity
+     * @param title
+     * @param id
+     */
+    public void goFindInformation(Activity activity, String title, int id) {
+        Intent intent = new Intent(activity, ActFindInformation.class);
+        intent.putExtra("id", id);
+        intent.putExtra("title", title);
+        activity.startActivity(intent);
+        USER_FIND_APP_ORDER.onEvent();
+    }
 
     /**
      * 进入游戏预约列表界面
@@ -1751,4 +1781,34 @@ public class Jump2View {
         ASK_MAKE_MONEY_INVITATION.onEvent();
         activity.startActivity(new Intent(activity, ActInvitation.class));
     }
+    /**
+     * 跳到积分兑换界面
+     *
+     * @param context
+     */
+    public void goActExchangeCMCC(Context context) {
+        Intent intent = new Intent(context, ActExchangeCMCC.class);
+        context.startActivity(intent);
+        UMConfigUtils.Event.EXCHANGE_CMCC.onEvent();
+    }
+    /**
+     * 点击看点
+     *
+     * @param activity
+     */
+    public void goWatchFocus(Activity activity, RouserArticlesEntity entity) {
+        try {
+            String deepLink = entity.getDeeplink().trim();
+            Intent intent = Intent.parseUri(deepLink, Intent.URI_INTENT_SCHEME);
+            intent.setComponent(null);
+            activity.startActivity(intent);
+            CommonUtil.getInstance().awakenDetail(entity);
+        } catch (Exception e) {
+            e.printStackTrace();
+            if(TestUtil.isTest())
+                G.showToast(e.getMessage());
+            else
+                G.showToast(activity.getString(R.string.not_install, entity.getApp_name()));
+        }
+    }
 }

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/util/RefreshUtil.java

@@ -48,4 +48,15 @@ public class RefreshUtil {
         refreshLayout.setRefreshFooter(new ClassicsFooter(context).setDrawableSize(20));
         refreshLayout.setEnableAutoLoadMore(true);
     }
+    public void publicParameter(SmartRefreshLayout refreshLayout, Context context){
+
+        refreshLayout.autoRefresh();
+        refreshLayout.setEnableRefresh(true);//是否启用下拉刷新功能
+        refreshLayout.setEnableLoadMore(false);//是否启用上拉加载功能
+        //设置 Header 为 贝塞尔雷达 样式
+        refreshLayout.setRefreshHeader(new ClassicsHeader(context));
+        //设置 Footer 为 球脉冲 样式
+        refreshLayout.setRefreshFooter(new ClassicsFooter(context).setDrawableSize(20));
+        refreshLayout.setEnableAutoLoadMore(false);
+    }
 }

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

@@ -199,7 +199,7 @@ public class TestUtil {
      * @param activity
      */
     public static void test(final Activity activity) {
-        final String[] items = {"复制token","复制打点数据","从jenkins下载小绵羊安装包","审核中心","检查正版","crc32","loading","progress","查看截图",
+        final String[] items = {"复制token","复制打点数据","从jenkins下载小绵羊安装包","移动积分兑换","审核中心","检查正版","crc32","loading","progress","查看截图",
                 "复制imsi","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
                 "游戏帐号","游戏代充","尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况",
                 "开启第三方应用使用情况","h5跳转","新手对话框","md5","空间不足提示框",
@@ -212,6 +212,9 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "移动积分兑换":
+                                Jump2View.getInstance().goActExchangeCMCC(activity);
+                                break;
                             case "从jenkins下载小绵羊安装包":
                                 downloadApkFromJenkins();
                                 break;

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

@@ -176,6 +176,7 @@ public class UMConfigUtils {
         SHARE_SYS_SEND("通过系统分享文件"),
         SHARE_TO_QZONE("分享到QQ空间"),
         TASK_SAVE_QR("二维码小程序 -> 保存二维码"),
+        EXCHANGE_CMCC("移动积分兑换界面"),
         ;
         private String tag;
 

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

@@ -49,6 +49,7 @@ import com.bumptech.glide.request.RequestOptions;
 import com.google.gson.Gson;
 import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.mdad.sdk.mdsdk.common.AdData;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
@@ -947,7 +948,6 @@ public class ViewUtil {
         return showMsgDialog(context, new DialogConfig().setMsg(msg).setTitle(title).setFinish(isFinish).setBtnLeftText("知道了"));
     }
 
-
     public static AlertDialog showMsgDialog(Context context, final DialogConfig dialogConfig) {
         final Context mContext = context == null ? ActivityManager.getInstance().currentActivity() : context;
         String title = dialogConfig.getTitle();
@@ -959,7 +959,7 @@ public class ViewUtil {
         String btnRightText = dialogConfig.getBtnRightText();
         final View.OnClickListener btnRightOnClickListener = dialogConfig.getBtnRightOnClickListener();
         final View.OnClickListener btnCloseOnClickListener = dialogConfig.getBtnCloseOnClickListener();
-        View dialog_parent = View.inflate(mContext, R.layout.dialog_parent, null);
+        View dialog_parent = View.inflate(mContext, dialogConfig.getParentLayoutId(), null);
         final AlertDialog dialog = new AlertDialog.Builder(mContext, mContext instanceof Activity ? R.style.MyDialogActivityTheme : R.style.AppTheme_Dialog_Alert).setView(dialog_parent).create();
         TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
         switch (dialogConfig.getTheme()) {//设置按钮风格
@@ -1446,6 +1446,21 @@ public class ViewUtil {
         }
 
     }
+    public static void setText(TextView textView, int integer) {
+        if (textView != null) {
+            textView.setText(String.valueOf(integer));
+        }
+    }
+    public static void setText(TextView textView, float f) {
+        if (textView != null) {
+            textView.setText(String.valueOf(f));
+        }
+    }
+    public static void setTextRetainMost2(TextView textView, float f) {
+        if (textView != null) {
+            textView.setText(NumberFormatUtils.retainMost2(f));
+        }
+    }
 
     public static void setVisibility(View view, boolean isVisible) {
         if (view != null) {

+ 45 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActExchangeCMCC.java

@@ -0,0 +1,45 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+
+import com.sheep.gamegroup.absBase.BaseUMActivity;
+import com.sheep.gamegroup.view.fragment.FgtAskGetMoney;
+import com.sheep.gamegroup.view.fragment.FgtExchangeCMCC;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+/**
+ * Created by realicing on 2018/10/12.
+ * realicing@sina.com
+ * 移动积分兑换
+ */
+public class ActExchangeCMCC extends BaseUMActivity{
+
+
+    Activity activity;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.common_container_act;
+    }
+
+    @Override
+    public void initView() {
+        activity = this;
+        TitleBarUtils.getInstance()
+                .setTitle(this, "兑换绵羊币")
+                .setTitleFinish(activity);
+        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+        Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
+        if(fragment == null){
+            fragment = new FgtExchangeCMCC();
+            transaction.add(R.id.frame_container, fragment, "tag");
+            transaction.commitAllowingStateLoss();
+        }else {
+            transaction.replace(R.id.frame_container, fragment);
+            transaction.commitAllowingStateLoss();
+        }
+    }
+}

+ 22 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/ActSysNfDetail.java

@@ -1,6 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.content.Intent;
+import android.text.method.ScrollingMovementMethod;
 import android.view.View;
 import android.widget.TextView;
 
@@ -13,8 +14,6 @@ import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
-import butterknife.BindView;
-import butterknife.OnClick;
 import rx.android.schedulers.AndroidSchedulers;
 import rx.schedulers.Schedulers;
 
@@ -23,13 +22,16 @@ import rx.schedulers.Schedulers;
  * created by: YSL
  * 描述:
  */
-public class ActSysNfDetail extends BaseActivity {
-    @BindView(R.id.tv_content)
+public class ActSysNfDetail extends BaseActivity implements View.OnClickListener {
     TextView tvContent;
-    @BindView(R.id.tv_title)
     TextView tvTitle;
-    @BindView(R.id.txt_baseactivity_title)
     TextView tvBaseTitle;
+    View img_baseactivity_title;
+
+    @Override
+    protected boolean needButterKnife() {
+        return false;
+    }
 
     @Override
     protected int getLayoutId() {
@@ -38,9 +40,18 @@ public class ActSysNfDetail extends BaseActivity {
 
     @Override
     public void initView() {
-        tvBaseTitle.setText("消息详情");
+        tvBaseTitle = findViewById(R.id.txt_baseactivity_title);
+        tvContent = findViewById(R.id.tv_content);
+        tvTitle = findViewById(R.id.tv_title);
+        img_baseactivity_title = findViewById(R.id.img_baseactivity_title);
     }
 
+    @Override
+    public void initListener() {
+        tvBaseTitle.setText("消息详情");
+        tvTitle.setMovementMethod(new ScrollingMovementMethod());
+        img_baseactivity_title.setOnClickListener(this);
+    }
     private void loadData(SystemNotification systemNotification) {
         if (systemNotification != null) {
             ViewUtil.setText(tvContent, systemNotification.getContent());
@@ -48,8 +59,10 @@ public class ActSysNfDetail extends BaseActivity {
         }
     }
 
-    @OnClick({R.id.img_baseactivity_title})
-    public void initClick(View view) {
+
+
+    @Override
+    public void onClick(View view) {
         switch (view.getId()) {
             case R.id.img_baseactivity_title:
                 ActSysNfDetail.this.finish();

+ 0 - 16
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -27,34 +27,18 @@ public class AskGetMoneyAct extends BaseUMActivity{
     @Override
     public void initView() {
         activity = this;
-
         TitleBarUtils.getInstance()
                 .setTitle(this, "邀请赚钱")
                 .setTitleFinish(activity);
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
-        Bundle bundle = new Bundle();
         Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
         if(fragment == null){
             fragment = new FgtAskGetMoney();
-            fragment.setArguments(bundle);
             transaction.add(R.id.frame_container, fragment, "tag");
             transaction.commitAllowingStateLoss();
         }else {
-            fragment.setArguments(bundle);
             transaction.replace(R.id.frame_container, fragment);
             transaction.commitAllowingStateLoss();
         }
-
-
-    }
-
-    @Override
-    public void initListener() {
-
-    }
-
-    @Override
-    public void initData() {
-
     }
 }

+ 0 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtAudit.java

@@ -136,7 +136,6 @@ public class FgtAudit extends BaseFragment {
         });
     }
     private void refreshData() {
-        LogUtil.println("FgtAudit", "refreshData", type);
         etyList.clear();
         adp.notifyDataSetChanged();
         page = 1;

+ 369 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtExchangeCMCC.java

@@ -0,0 +1,369 @@
+package com.sheep.gamegroup.view.fragment;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Paint;
+import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
+import com.kfzs.duanduan.utils.NumberFormatUtils;
+import com.scwang.smartrefresh.layout.SmartRefreshLayout;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.CMCCExchange;
+import com.sheep.gamegroup.model.entity.DialogConfig;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.RefreshUtil;
+import com.sheep.gamegroup.util.SelfCountDownTimer;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.util.Locale;
+
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by realicing on 2018/10/12.
+ * realicing@sina.com
+ * 移动积分兑换页面
+ */
+public class FgtExchangeCMCC extends BaseFragment implements View.OnClickListener {
+    private SmartRefreshLayout refresh;
+    private View mSpace1;
+    /**
+     * 7880
+     */
+    private TextView mExchangeCmccNum;
+    /**
+     * 查询积分
+     */
+    private TextView mExchangeCmccLook;
+    private View mSpace2;
+    /**
+     * 积分兑换的商品列表
+     */
+    private RecyclerView exchange_cmcc_list;
+    private View mSpace3;
+    /**
+     * 兑换
+     */
+    private TextView mExchangeCmccCommit;
+    private View mSpace4;
+    /**
+     * 兑换说明?
+     */
+    private TextView mExchangeCmccTip;
+
+    @Override
+    public boolean userButterKnife() {
+        return false;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fgt_exchange_cmcc;
+    }
+
+    private Activity activity;
+    @Override
+    public void onViewCreated() {
+        activity = getActivity();
+        initView(mView);
+        initListener();
+    }
+
+    private void initData() {
+        SheepApp.getInstance().getNetComponent().getApiService().getCMCCGoods()
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                List<CMCCExchange> newList = baseMessage.getDataList(CMCCExchange.class);
+                                list.clear();
+                                ListUtil.addAllItem(list, newList);
+                                exchange_cmcc_list.getAdapter().notifyDataSetChanged();
+                                refresh.finishRefresh();
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                                refresh.finishRefresh();
+                            }
+                        });
+    }
+    private List<CMCCExchange> list = ListUtil.emptyList();
+    private int curPosition;
+    private void initListener() {
+        setLayoutParamsHeight(mSpace1, 140 / 375.0F);
+        setLayoutParamsHeight(mSpace2, 29 / 375.0F);
+//        setLayoutParamsHeight(exchange_cmcc_list, 290 / 375.0F);
+        setLayoutParamsHeight(mSpace3, 32 / 375.0F);
+        setLayoutParams(mExchangeCmccCommit, 267 / 375.0F, 55 / 375.0F);
+        setLayoutParamsHeight(mSpace4, 10 / 375.0F);
+        mExchangeCmccLook.setOnClickListener(this);
+        mExchangeCmccCommit.setOnClickListener(this);
+        mExchangeCmccTip.setOnClickListener(this);
+        mExchangeCmccTip.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
+        GridLayoutManager layoutManager = new GridLayoutManager(activity, 2);
+        exchange_cmcc_list.setLayoutManager(layoutManager);
+        exchange_cmcc_list.setNestedScrollingEnabled(false);
+        exchange_cmcc_list.setAdapter(new RecyclerViewAdapter<CMCCExchange>(activity, R.layout.item_exchange_cmcc, list) {
+            @Override
+            public void convert(ViewHolder viewHolder, CMCCExchange item, final int position) {
+                ImageView item_exchange_cmcc_iv = viewHolder.itemView.findViewById(R.id.item_exchange_cmcc_iv);
+                TextView item_exchange_cmcc_score = viewHolder.itemView.findViewById(R.id.item_exchange_cmcc_score);
+                TextView item_exchange_cmcc_amout = viewHolder.itemView.findViewById(R.id.item_exchange_cmcc_amout);
+                if(item == null){
+                    ViewUtil.setDefaultText(item_exchange_cmcc_score);
+                    ViewUtil.setDefaultText(item_exchange_cmcc_amout);
+                } else {
+                    ViewUtil.setText(item_exchange_cmcc_score, String.format(Locale.CHINA, "%d积分兑换", item.getScore()));
+                    ViewUtil.setText(item_exchange_cmcc_score, String.format(Locale.CHINA, "%s绵羊币", NumberFormatUtils.retainMost2(item.getAmount())));
+                    item_exchange_cmcc_iv.setImageResource(position == curPosition ? R.drawable.bg_exchnage_item_choose : R.drawable.bg_exchnage_item );
+                }
+                viewHolder.itemView.setOnClickListener(new View.OnClickListener(){
+                    @Override
+                    public void onClick(View view) {
+                        curPosition = position;
+                        notifyDataSetChanged();
+                    }
+                });
+            }
+        });
+        refresh.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
+                initData();
+            }
+        });
+        RefreshUtil.newInstance().publicParameter(refresh, activity);
+    }
+
+    private void setLayoutParams(View view, float wRatio, float hRatio) {
+        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
+        layoutParams.width = (int) (G.WIDTH * wRatio);
+        layoutParams.height = (int) (G.WIDTH * hRatio);
+        view.setLayoutParams(layoutParams);
+    }
+    private void setLayoutParamsHeight(View view, float ratio) {
+        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
+        layoutParams.height = (int) (G.WIDTH * ratio);
+        view.setLayoutParams(layoutParams);
+    }
+
+    public void initView(View view) {
+        refresh = view.findViewById(R.id.refresh);
+        mSpace1 = (View) view.findViewById(R.id.space_1);
+        mExchangeCmccNum = (TextView) view.findViewById(R.id.exchange_cmcc_num);
+        mExchangeCmccLook = (TextView) view.findViewById(R.id.exchange_cmcc_look);
+        mSpace2 = (View) view.findViewById(R.id.space_2);
+        exchange_cmcc_list = view.findViewById(R.id.exchange_cmcc_list);
+        mSpace3 = (View) view.findViewById(R.id.space_3);
+        mExchangeCmccCommit = (TextView) view.findViewById(R.id.exchange_cmcc_commit);
+        mSpace4 = (View) view.findViewById(R.id.space_4);
+        mExchangeCmccTip = (TextView) view.findViewById(R.id.exchange_cmcc_tip);
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            default:
+                break;
+            case R.id.exchange_cmcc_look:
+                showCMCCLookDialog(activity, new DialogConfig().setParentLayoutId(R.layout.dialog_parent_cmcc).setLayoutId(R.layout.x_msg_dialog_cmcc_look)
+                        .setTitle("查询积分"));
+                break;
+            case R.id.exchange_cmcc_commit:
+                break;
+            case R.id.exchange_cmcc_tip:
+                ViewUtil.showMsgDialog(activity, new DialogConfig().setParentLayoutId(R.layout.dialog_parent_cmcc).setLayoutId(R.layout.x_msg_dialog_cmcc)
+                        .setTitle("兑换说明").setMsg(R.string.exchange_cmcc_tip).setMsgGravity(Gravity.START));
+                break;
+        }
+    }
+
+    private SelfCountDownTimer selfCountDownTimer;
+    public AlertDialog showCMCCLookDialog(Context context, final DialogConfig dialogConfig) {
+        final Context mContext = context == null ? ActivityManager.getInstance().currentActivity() : context;
+        String title = dialogConfig.getTitle();
+        final View.OnClickListener btnCloseOnClickListener = dialogConfig.getBtnCloseOnClickListener();
+        View dialog_parent = View.inflate(mContext, dialogConfig.getParentLayoutId(), null);
+        final AlertDialog dialog = new AlertDialog.Builder(mContext, mContext instanceof Activity ? R.style.MyDialogActivityTheme : R.style.AppTheme_Dialog_Alert).setView(dialog_parent).create();
+        TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
+        switch (dialogConfig.getTheme()) {//设置按钮风格
+            case DialogConfig.THEME_PURPLE:
+                dialog_title.setBackgroundResource(R.drawable.shape_purple_solid_rectangle_top);
+                break;
+        }
+        View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
+        LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
+        final View view = LayoutInflater.from(mContext).inflate(dialogConfig.getLayoutId(), dialog_center_ll, true);
+        if (!TextUtils.isEmpty(title))
+            dialog_title.setText(title);
+
+        final EditText dialog_cmcc_look_phone = (EditText) view.findViewById(R.id.dialog_cmcc_look_phone);
+        final EditText dialog_cmcc_look_code = (EditText) view.findViewById(R.id.dialog_cmcc_look_code);
+        final TextView dialog_cmcc_look_code_send = (TextView) view.findViewById(R.id.dialog_cmcc_look_code_send);
+        TextView dialog_cmcc_look_commit = (TextView) view.findViewById(R.id.dialog_cmcc_look_commit);
+        if(selfCountDownTimer == null) {
+            selfCountDownTimer = new SelfCountDownTimer(60 * 1000, 1000, SelfCountDownTimer.FULL_SECOND) {
+                @Override
+                public void onTimerRest() {
+                    dialog_cmcc_look_code_send.setEnabled(true);
+                    dialog_cmcc_look_code_send.setText(getString(R.string.send_sms));
+                }
+
+                @Override
+                public void onTimerTick(long millisUntilFinished, int countTime) {
+                    dialog_cmcc_look_code_send.setText(String.format(Locale.CHINA, "%d s", countTime));
+                }
+
+                @Override
+                public void onTimerFinish() {
+                    dialog_cmcc_look_code_send.setEnabled(true);
+                    dialog_cmcc_look_code_send.setText(getString(R.string.send_sms));
+                }
+            };
+        }
+        String mobile = DataUtil.getInstance().getUserMobile();
+        if(StringUtils.isMobile(mobile)) {
+            dialog_cmcc_look_phone.setEnabled(false);
+            dialog_cmcc_look_phone.setText(mobile);
+        }
+        dialog_cmcc_look_code_send.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                sendSms(dialog_cmcc_look_phone.getText().toString(), dialog_cmcc_look_code_send);
+            }
+        });
+        dialog_cmcc_look_commit.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                lookScore(dialog_cmcc_look_phone.getText().toString(), dialog_cmcc_look_code.getText().toString());
+            }
+        });
+
+        if (dialog_close != null) {
+            if (dialogConfig.isCancelable())//
+                dialog_close.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        if (btnCloseOnClickListener != null) {
+                            btnCloseOnClickListener.onClick(v);
+                        }
+                        dialog.dismiss();
+                    }
+                });
+            else
+                dialog_close.setVisibility(View.GONE);
+        }
+        dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+            @Override
+            public void onDismiss(DialogInterface dialog) {
+                try {
+                    if (dialogConfig.isFinish()) {
+                        if (mContext instanceof Activity) {
+                            ((Activity) mContext).finish();
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+
+        if (!(mContext instanceof Activity) && dialog.getWindow() != null) {
+            dialog.getWindow().setType(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? WindowManager.LayoutParams.TYPE_PHONE : WindowManager.LayoutParams.TYPE_TOAST);
+        }
+        if (!dialogConfig.isCancelable())
+            dialog.setCancelable(false);
+        try {
+            dialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dialog;
+    }
+    private String phone;
+    //查询积分前发送手机验证码
+    private void sendSms(String phone, final View send) {
+        selfCountDownTimer.reset(SelfCountDownTimer.FULL_SECOND);
+        if(StringUtils.isMobile(phone)){
+            send.setEnabled(false);
+            this.phone = phone;
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("mobile", phone);
+            SheepApp.getInstance().getNetComponent().getApiService().smsCMCC(jsonObject)
+                            .subscribeOn(Schedulers.io())
+                            .observeOn(AndroidSchedulers.mainThread())
+                            .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                @Override
+                                public void onNext(BaseMessage baseMessage) {
+                                    selfCountDownTimer.start();
+                                    G.showToast("发送验证码成功");
+                                }
+
+                                @Override
+                                public void onError(BaseMessage baseMessage) {
+                                    send.setEnabled(true);
+                                    G.showToast(baseMessage);
+                                }
+                            });
+        } else {
+            G.showToast("请填写正确的手机号!");
+        }
+    }
+    //查询积分
+    private void lookScore(String phone, String code) {
+        if(TextUtils.isEmpty(code)){
+            G.showToast("验证码不能为空!");
+        } else {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("mobile", this.phone);
+            jsonObject.put("code", code);
+            SheepApp.getInstance().getNetComponent().getApiService().getCMCCScore(jsonObject)
+                            .subscribeOn(Schedulers.io())
+                            .observeOn(AndroidSchedulers.mainThread())
+                            .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                                @Override
+                                public void onNext(BaseMessage baseMessage) {
+                                }
+
+                                @Override
+                                public void onError(BaseMessage baseMessage) {
+                                    G.showToast(baseMessage);
+                                }
+                            });
+        }
+    }
+}

+ 5 - 4
app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java

@@ -88,7 +88,8 @@ public abstract class BaseFragment extends Fragment {
         } else {
             mIsFirstInit = false;
         }
-        unbinder = ButterKnife.bind(this, mView);
+        if(userButterKnife())
+            unbinder = ButterKnife.bind(this, mView);
         return mView;
     }
 
@@ -153,10 +154,10 @@ public abstract class BaseFragment extends Fragment {
     @Override
     public void onDestroyView() {
         super.onDestroyView();
-        if(needUnbindOnDestroy())
+        if(userButterKnife())
             unbinder.unbind();
     }
-    public boolean needUnbindOnDestroy(){
-        return false;
+    public boolean userButterKnife(){
+        return true;
     }
 }

BIN
app/src/main/res/drawable-xxhdpi/bg_cmcc_exchange.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_exchnage_item.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_exchnage_item_choose.webp


BIN
app/src/main/res/drawable-xxhdpi/btn_azure_h.webp


BIN
app/src/main/res/drawable-xxhdpi/btn_azure_hh.webp


BIN
app/src/main/res/drawable-xxhdpi/btn_orange_h.webp


BIN
app/src/main/res/drawable-xxhdpi/btn_orange_w.webp


BIN
app/src/main/res/drawable-xxhdpi/btn_orange_ww.webp


BIN
app/src/main/res/drawable/orange_background_frame.9.png


+ 6 - 0
app/src/main/res/drawable/shape_f7dd9e_solid_rectangle_17.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="17dp" />
+    <solid android:color="#f7dd9e" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/shape_rectangle_red_8.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#ffdb3439" />
+    <corners android:radius="8dp" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/shape_white_solid_rectangle_12.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="12dp" />
+    <solid android:color="#ffffff" />
+</shape>

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

@@ -24,10 +24,11 @@
     <TextView
         android:id="@+id/tv_content"
         android:layout_width="match_parent"
-        android:layout_height="48dp"
+        android:layout_height="match_parent"
         android:layout_marginEnd="16dp"
         android:layout_marginStart="16dp"
         android:layout_marginTop="20dp"
+        android:scrollbars="vertical"
         android:text="x  x任务上线,限量1000分,任务奖励1元,赶紧去领取吧~!xx任务上线,限量1000分,任务奖励1元,赶紧去领取吧~!"
         android:textColor="#666666"
         android:textSize="13sp" />

+ 43 - 0
app/src/main/res/layout/dialog_parent_cmcc.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_margin="@dimen/dp_10">
+
+        <LinearLayout
+            android:id="@+id/dialog_center_ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/orange_background_frame"
+            android:gravity="center"
+            android:orientation="vertical"
+            android:paddingStart="@dimen/dp_10"
+            android:paddingTop="40dp"
+            android:paddingEnd="@dimen/dp_10"
+            android:paddingBottom="@dimen/dp_10" />
+
+        <TextView
+            android:id="@+id/dialog_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:paddingTop="22dp"
+            android:text="提示"
+            android:textColor="#333333"
+            android:textSize="15sp" />
+
+        <ImageView
+            android:id="@+id/dialog_close"
+            android:layout_width="40dp"
+            android:layout_height="40dp"
+            android:layout_below="@+id/dialog_center_ll"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="@dimen/content_padding_30"
+            android:src="@mipmap/close" />
+    </RelativeLayout>
+</FrameLayout>

+ 112 - 0
app/src/main/res/layout/fgt_exchange_cmcc.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/refresh"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/white">
+
+    <android.support.v4.widget.NestedScrollView
+        android:id="@+id/scrollView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_gravity="fill_vertical"
+        android:fillViewport="true"
+        android:scrollbars="none"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <ImageView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:adjustViewBounds="true"
+                android:scaleType="fitXY"
+                android:src="@drawable/bg_cmcc_exchange" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+                <View
+                    android:id="@+id/space_1"
+                    android:layout_width="match_parent"
+                    android:layout_height="130dp" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="我的积分"
+                    android:textColor="@color/white"
+                    android:textSize="12sp" />
+
+                <TextView
+                    android:id="@+id/exchange_cmcc_num"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="未查询"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+                <TextView
+                    android:id="@+id/exchange_cmcc_look"
+                    android:layout_width="wrap_content"
+                    android:layout_height="16dp"
+                    android:background="@drawable/shape_rectangle_red_8"
+                    android:paddingStart="9dp"
+                    android:paddingEnd="9dp"
+                    android:text="查询积分"
+                    android:textColor="#ffffffff"
+                    android:textSize="11sp" />
+
+                <View
+                    android:id="@+id/space_2"
+                    android:layout_width="match_parent"
+                    android:layout_height="50dp" />
+
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/exchange_cmcc_list"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingStart="20dp"
+                    android:paddingEnd="20dp"
+                    android:minHeight="50dp" />
+
+                <View
+                    android:id="@+id/space_3"
+                    android:layout_width="match_parent"
+                    android:layout_height="10dp" />
+
+                <TextView
+                    android:id="@+id/exchange_cmcc_commit"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/btn_orange_ww"
+                    android:gravity="center"
+                    android:text="兑换"
+                    android:textColor="#ffffffff"
+                    android:textSize="18sp" />
+
+                <View
+                    android:id="@+id/space_4"
+                    android:layout_width="match_parent"
+                    android:layout_height="10dp" />
+
+                <TextView
+                    android:id="@+id/exchange_cmcc_tip"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="兑换说明?"
+                    android:textColor="#ffd38b0e"
+                    android:textSize="12sp" />
+            </LinearLayout>
+        </RelativeLayout>
+    </android.support.v4.widget.NestedScrollView>
+</com.scwang.smartrefresh.layout.SmartRefreshLayout>
+

+ 46 - 0
app/src/main/res/layout/item_exchange_cmcc.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingStart="13dp"
+    android:paddingTop="10dp"
+    android:paddingEnd="13dp"
+    android:paddingBottom="10dp">
+
+    <ImageView
+        android:id="@+id/item_exchange_cmcc_iv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:src="@drawable/bg_exchnage_item_choose" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <TextView
+            android:id="@+id/item_exchange_cmcc_score"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="316积分兑换"
+            android:textColor="#ffffffff"
+            android:textSize="13sp" />
+
+        <TextView
+            android:id="@+id/item_exchange_cmcc_amout"
+            android:layout_width="wrap_content"
+            android:layout_height="24dp"
+            android:layout_marginTop="5dp"
+            android:background="@drawable/shape_white_solid_rectangle_12"
+            android:gravity="center"
+            android:paddingStart="12dp"
+            android:paddingEnd="12dp"
+            android:text="1绵羊币"
+            android:textColor="#fffd5948"
+            android:textSize="13sp" />
+    </LinearLayout>
+
+</RelativeLayout>
+

+ 1 - 3
app/src/main/res/layout/x_ask_getmoney_act_layout.xml

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <com.sheep.gamegroup.util.SheepSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/refresh"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.sheep.gamegroup.view.activity.AskGetMoneyAct">
+    android:layout_height="match_parent">
 
     <android.support.v4.widget.NestedScrollView
         android:id="@+id/ask_scroll_view"

+ 48 - 0
app/src/main/res/layout/x_msg_dialog_cmcc.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/dialog_msg"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:layout_marginTop="@dimen/dp_10"
+        android:layout_marginBottom="@dimen/dp_10"
+        android:layout_gravity="center_horizontal"
+        android:lineSpacingExtra="4dp"
+        android:text="内容"
+        android:gravity="center"
+        android:textColor="@color/black_666666"
+        android:textSize="12sp" />
+    <TextView
+        android:id="@+id/dialog_msg_more"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:layout_marginTop="@dimen/dp_10"
+        android:layout_marginBottom="@dimen/dp_10"
+        android:lineSpacingExtra="4dp"
+        android:text="内容"
+        android:gravity="center_horizontal"
+        android:textColor="@color/red"
+        android:visibility="gone"
+        android:textSize="14sp" />
+    <include layout="@layout/x_msg_dialog_btn"/>
+    <TextView
+        android:id="@+id/dialog_tip"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:layout_marginTop="@dimen/content_padding_20"
+        android:layout_marginBottom="@dimen/content_padding_20"
+        android:lineSpacingExtra="4dp"
+        android:gravity="center_horizontal"
+        android:textColor="@color/black_text_deep"
+        android:visibility="gone"
+        android:textSize="14sp" />
+</merge>

+ 91 - 0
app/src/main/res/layout/x_msg_dialog_cmcc_look.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="34dp"
+        android:layout_marginStart="30dp"
+        android:layout_marginTop="20dp"
+        android:layout_marginEnd="30dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="9dp"
+            android:text="手机号"
+            android:textColor="#ff666666"
+            android:textSize="12sp" />
+
+        <EditText
+            android:id="@+id/dialog_cmcc_look_phone"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:paddingStart="10dp"
+            android:paddingEnd="10dp"
+            android:textSize="12sp"
+            android:background="@drawable/shape_f7dd9e_solid_rectangle_17"
+            android:inputType="phone"
+            android:maxLength="11" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="34dp"
+        android:layout_marginStart="30dp"
+        android:layout_marginTop="18dp"
+        android:layout_marginEnd="30dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="9dp"
+            android:text="验证码"
+            android:textColor="#ff666666"
+            android:textSize="12sp" />
+
+        <EditText
+            android:id="@+id/dialog_cmcc_look_code"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginEnd="9dp"
+            android:layout_weight="1"
+            android:paddingStart="10dp"
+            android:paddingEnd="10dp"
+            android:textSize="12sp"
+            android:background="@drawable/shape_f7dd9e_solid_rectangle_17"
+            android:inputType="number"
+            android:maxLength="6" />
+
+        <TextView
+            android:id="@+id/dialog_cmcc_look_code_send"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/btn_azure_hh"
+            android:gravity="center"
+            android:text="@string/send_sms"
+            android:textColor="#ffffffff"
+            android:textSize="11sp" />
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/dialog_cmcc_look_commit"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="30dp"
+        android:layout_marginTop="18dp"
+        android:layout_marginEnd="30dp"
+        android:layout_marginBottom="18dp"
+        android:background="@drawable/btn_orange_w"
+        android:gravity="center"
+        android:text="兑换"
+        android:textColor="#ffffffff"
+        android:textSize="18sp" />
+</merge>

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
app/src/main/res/values/strings.xml