hanjing 7 роки тому
батько
коміт
7edcd3462b
25 змінених файлів з 530 додано та 110 видалено
  1. 0 4
      app/src/main/AndroidManifest.xml
  2. 1 0
      app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java
  3. 39 5
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  4. 30 0
      app/src/main/java/com/sheep/gamegroup/model/entity/Applications.java
  5. 37 0
      app/src/main/java/com/sheep/gamegroup/model/entity/Article.java
  6. 7 0
      app/src/main/java/com/sheep/gamegroup/model/entity/ArticleTag.java
  7. 22 1
      app/src/main/java/com/sheep/gamegroup/module/find/activity/ActFind.java
  8. 37 33
      app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameGroupOrGameDetail.java
  9. 22 6
      app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGitBagList.java
  10. 3 2
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java
  11. 23 6
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtPlayGame.java
  12. 26 14
      app/src/main/java/com/sheep/gamegroup/module/game/util/FocusGameHelper.java
  13. 89 0
      app/src/main/java/com/sheep/gamegroup/module/game/util/GameNewsRecommendHelper.java
  14. 22 14
      app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java
  15. 20 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  16. 47 8
      app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java
  17. 10 3
      app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment5.java
  18. 13 6
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java
  19. 1 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java
  20. 9 0
      app/src/main/res/drawable/shape_blue_stroke_rectangle_3_radius.xml
  21. 1 1
      app/src/main/res/drawable/shape_red_stroke_rectangle_3_radius.xml
  22. 0 1
      app/src/main/res/layout/find_item_game_news.xml
  23. 41 0
      app/src/main/res/layout/game_recommend_article_item_tile.xml
  24. 30 6
      app/src/main/res/layout/item_game_news.xml
  25. BIN
      app/src/main/res/mipmap-xhdpi/recommend_italic.png

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

@@ -798,10 +798,6 @@
             android:process=":remote" />
         <!-- 百度定位 sdk end -->
 
-
-        <!-- <activity -->
-        <!-- android:name="com.sheep.gamegroup.view.activity.ActFindGame" -->
-        <!-- android:screenOrientation="portrait" /> -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActArticle"
             android:configChanges="orientation|screenSize|keyboardHidden" />

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/NetModule.java

@@ -50,6 +50,7 @@ public class NetModule {
         Retrofit retrofit = new Retrofit.Builder()
                 .client(okhttpClient)
                 .baseUrl(SheepApp.getInstance().getConnectAddress().getAppUrl()+"v1/")
+//                .baseUrl("http://10.8.220.239:8080/v1/")
 //                .baseUrl("http://10.8.240.155:8080/v1/")
 //                .baseUrl("http://ss.17xmy.com/v1/")
                 .addConverterFactory(StringConverterFactory.create())

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

@@ -126,6 +126,7 @@ public interface ApiService {
      */
     @GET("app/release_task/commend_task/")
     Observable<BaseMessage> getNewTask(@Query("order") int order);
+
     /**
      * 主页刷新福利
      */
@@ -137,6 +138,7 @@ public interface ApiService {
      */
     @GET("app/user/get_info/")
     Observable<BaseMessage> getInfo();
+
     /**
      * 用户设备信息记录
      */
@@ -264,16 +266,19 @@ public interface ApiService {
      */
     @GET(ApiKey.GET_ALL_WELFARE)
     Observable<BaseMessage> getAllWelfare(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 获取游戏对应的福利
      */
     @GET(ApiKey.GET_ALL_WELFARE)
     Observable<BaseMessage> getAppWelfare(@Query("page") int page, @Query("per_page") int per_page, @Query("app_id") int app_id);
+
     /**
      * 获取游戏对应的福利与赏金福利
      */
     @GET(ApiKey.GET_ALL_WELFARE_AND_MONEY_REWARD)
     Observable<BaseMessage> getAppWelfareAndMoneyReward(@Query("page") int page, @Query("per_page") int per_page, @Query("app_id") int app_id);
+
     /**
      * 获取游戏福利专区中的全部福利
      */
@@ -834,6 +839,14 @@ public interface ApiService {
     @GET("app/find/articles/list")
     Observable<BaseMessage> getFindList(@Query("page") int page, @Query("per_page") int per_page, @Query("tag_id") int id);
 
+    @GET("app/find/articles/list")
+    Observable<BaseMessage> getFindListv2(
+            @Query("page") int page,
+            @Query("per_page") int per_page,
+            @Query("game_article_type") int gameArticleType,
+            @Query("is_recommend") int isRecommend,
+            @Query("display_menu") int displayMenu);
+
     /**
      * 发现内容详情
      */
@@ -856,6 +869,7 @@ public interface ApiService {
      */
     @GET("app/find/applications")
     Observable<BaseMessage> getAppDetail(@Query("id") int id);
+
     /**
      * 获取app_id
      */
@@ -1048,11 +1062,13 @@ public interface ApiService {
      */
     @GET("app/gift_bag")
     Observable<BaseMessage> getGiftBagList(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 游戏礼包
      */
     @GET("app/gift_bag")
     Observable<BaseMessage> getGiftBagListByAppId(@Query("page") int page, @Query("per_page") int per_page, @Query("app_id") int app_id);
+
     /**
      * 游戏礼包
      */
@@ -1070,6 +1086,7 @@ public interface ApiService {
      */
     @PUT("app/gift_bag/receive/{id}")
     Observable<BaseMessage> receiveGiftBag(@Path("id") int id);
+
     /**
      * 礼包中心-分类标签列表
      */
@@ -1083,8 +1100,6 @@ public interface ApiService {
     Observable<BaseMessage> getGiftBagGameGroup();
 
 
-
-
     /**
      * 获取热门福利
      */
@@ -1143,6 +1158,7 @@ public interface ApiService {
      */
     @GET(ApiKey.FIND)
     Observable<BaseMessage> getPlayGameList(@Query("page") int page, @Query("per_page") int per_page, @QueryMap Map<String, Object> map);
+
     /**
      * 玩转游戏——每日必玩
      * 玩转游戏——近期最热
@@ -1385,7 +1401,7 @@ public interface ApiService {
      * @return
      */
     @GET("app/game_banner")
-    Observable<BaseMessage> gameBanner(@Query("platform") int platform);
+    Observable<BaseMessage> gameBanner(@Query("platform") int platform, @Query("position") int position);
 
     /**
      * platform 平台 1:andriod 2:ios
@@ -1403,6 +1419,14 @@ public interface ApiService {
     Observable<BaseMessage> playGameDetail(@Path("id") int id);
 
     /**
+     * 获取每日焦点应用
+     *
+     * @return
+     */
+    @GET("app/find/applications/focus")
+    Observable<BaseMessage> getDailyFocusApp();
+
+    /**
      * 判断是否是第一次运行的设备
      *
      * @return
@@ -1623,6 +1647,7 @@ public interface ApiService {
      */
     @POST("app/video")
     Observable<BaseMessage> postVideo(@Body JSONObject jsonObject);
+
     /**
      * 小绵羊3.4.9新增 -- 用户视频更新
      * UpdateUserVideoReq{
@@ -1649,7 +1674,8 @@ public interface ApiService {
 
     /**
      * 小绵羊3.4.5新增 -- 查询视频列表
-     *  @Param   sort        query   int true       "排序 1:最热 2:最新"
+     *
+     * @Param sort        query   int true       "排序 1:最热 2:最新"
      */
     @GET(ApiKey.getVideoList)
     Observable<BaseMessage> getVideoList(@Query("page_no") int page, @Query("page_size") int per_page, @Query("sort") int sort);
@@ -1711,11 +1737,12 @@ public interface ApiService {
      */
     @GET("app/yf_shop/receive_coupons/check")
     Observable<BaseMessage> getYfShopReceiveCouponsCheck(@Query("type") int type);
+
     /**
      * 获取商城抢购商品信息
      */
     @GET(ApiKey.PROMOTE_GOODS)
-    Observable<BaseMessage> getYfShopPromoteGoods( @Query("page") int page, @Query("per_page") int per_page);
+    Observable<BaseMessage> getYfShopPromoteGoods(@Query("page") int page, @Query("per_page") int per_page);
 //---------------------------end 商城相关-------------------------------------
 //---------------------------start 小绵羊3.4.7新增 -- vip相关-------------------------------------
 
@@ -1770,6 +1797,7 @@ public interface ApiService {
      */
     @GET(ApiKey.getGameGroupSearch)
     Observable<BaseMessage> getGameGroupSearch(@Query("name") String name);
+
     /**
      * 获取游戏组列表
      * page * integer (query) 页码
@@ -1779,6 +1807,7 @@ public interface ApiService {
      */
     @GET(ApiKey.getGameGroup)
     Observable<BaseMessage> getGameGroupByTag(@Query("tag") int tag, @Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 获取游戏组详情
      * id * integer (path) 游戏组ID
@@ -1786,24 +1815,28 @@ public interface ApiService {
      */
     @GET("app/game_group/{id}")
     Observable<BaseMessage> getGameGroupById(@Path("id") int id);
+
     /**
      * 获取下游(出包类型)列表
      * 返回 PackageTypes 列表
      */
     @GET("app/find/package_type/list")
     Observable<BaseMessage> getFindPackageTypeList();
+
     /**
      * 获取上游列表
      * 返回 GamePortType 列表
      */
     @GET("app/game_port_type")
     Observable<BaseMessage> getGamePortType();
+
     /**
      * 获取游戏排行
      * 返回 GameEntity 列表
      */
     @GET(ApiKey.getFindRank)
     Observable<BaseMessage> getFindRank();
+
     /**
      * 根据用户喜好推荐
      * 返回 GameEntity 列表
@@ -1819,6 +1852,7 @@ public interface ApiService {
      */
     @POST("app/mission/newspring/execute")
     Observable<BaseMessage> missionExecute(@Body JSONObject jsonObject);
+
     /**
      * 执行活动任务
      * act 任务标识

+ 30 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/Applications.java

@@ -93,6 +93,12 @@ public class Applications implements IDownload, IGameGroup, Serializable {
     private String package_type_name;
     //上游类型
     private String port_type_name;
+    //礼包数量
+    private int gift_num = 0;
+    //道具数量
+    private int welfare_num = 0;
+    //赏金数量
+    private double reward_num = 0;
 
     public int getGame_discount_id() {
         return game_discount_id;
@@ -519,4 +525,28 @@ public class Applications implements IDownload, IGameGroup, Serializable {
     public boolean mainPublicizeIsVideo() {
         return main_publicize.endsWith(".mp4") || main_publicize.startsWith("http://cdn.video.17xmy.com");//如:http://cdn.video.17xmy.com/ljok9RZZvXc5qwvoCxEGudchO6Ti;
     }
+
+    public int getGiftNum() {
+        return gift_num;
+    }
+
+    public void setGiftNum(int gift_num) {
+        this.gift_num = gift_num;
+    }
+
+    public int getWelfareNum() {
+        return welfare_num;
+    }
+
+    public void setWelfareNum(int welfare_num) {
+        this.welfare_num = welfare_num;
+    }
+
+    public double getRewardNum() {
+        return reward_num;
+    }
+
+    public void setRewardNum(double reward_num) {
+        this.reward_num = reward_num;
+    }
 }

+ 37 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/Article.java

@@ -54,6 +54,11 @@ public class Article {
 
     private Applications application;
 
+    private int is_placement;
+    private int is_recommend;
+    private int display_menu;
+    private int game_articles_type;
+
     public void setUpdated_at(int updated_at){
         this.updated_at = updated_at;
     }
@@ -198,4 +203,36 @@ public class Article {
             }
         });
     }
+
+    public int getIs_placement() {
+        return is_placement;
+    }
+
+    public void setIs_placement(int is_placement) {
+        this.is_placement = is_placement;
+    }
+
+    public int getIs_recommend() {
+        return is_recommend;
+    }
+
+    public void setIs_recommend(int is_recommend) {
+        this.is_recommend = is_recommend;
+    }
+
+    public int getDisplay_menu() {
+        return display_menu;
+    }
+
+    public void setDisplay_menu(int display_menu) {
+        this.display_menu = display_menu;
+    }
+
+    public int getGame_articles_type() {
+        return game_articles_type;
+    }
+
+    public void setGame_articles_type(int game_articles_type) {
+        this.game_articles_type = game_articles_type;
+    }
 }

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

@@ -18,6 +18,8 @@ public class ArticleTag {
 
     private int created_at;
 
+    private int subType;
+
     public ArticleTag() {
     }
 
@@ -26,6 +28,11 @@ public class ArticleTag {
         this.name = name;
     }
 
+    public ArticleTag(int id, int subType) {
+        this.id = id;
+        this.name = name;
+    }
+
     public void setUpdated_at(int updated_at){
         this.updated_at = updated_at;
     }

+ 22 - 1
app/src/main/java/com/sheep/gamegroup/module/find/activity/ActFind.java

@@ -3,14 +3,23 @@ package com.sheep.gamegroup.module.find.activity;
 import android.support.v4.app.Fragment;
 
 import com.sheep.gamegroup.absBase.BaseContainerActivity;
+import com.sheep.gamegroup.model.entity.ArticleTag;
 import com.sheep.gamegroup.module.find.fragment.FgtFind2;
+import com.sheep.gamegroup.view.fragment.BaseListFragment5;
+import com.sheep.gamegroup.view.fragment.FgtFindChild;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 /**
  * Created by realicing on 2019/1/28.
  * realicing@sina.com
  */
 public class ActFind extends BaseContainerActivity {
+
+    public final static int FOR_DEFAULT = 0;
+
+    public final static int FOR_GAME = 1;
+
     @Override
     protected int getLayoutId() {
         return R.layout.common_container_nofit;
@@ -18,6 +27,18 @@ public class ActFind extends BaseContainerActivity {
 
     @Override
     protected Fragment initFragment() {
-        return new FgtFind2();
+        int forWhat = getIntent().getIntExtra("for_what", 0);
+        if (forWhat == FOR_GAME) {
+            int forType = getIntent().getIntExtra("for_type", 0);
+            TitleBarUtils.getInstance()
+                    .setShowOrHide(this, true)
+                    .setTitle(this, forType == 1 ? "游戏资讯" : "游戏活动")
+                    .setTitleFinish(this);
+            FgtFindChild fgt = FgtFindChild.newInstance(new ArticleTag(-1, forType));
+            fgt.setRefreshOnType(BaseListFragment5.REFRESH_ON_CREATE);
+            return fgt;
+        } else {
+            return new FgtFind2();
+        }
     }
 }

+ 37 - 33
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGameGroupOrGameDetail.java

@@ -49,7 +49,6 @@ import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.RequestCodeConstants;
-import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.TagListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
@@ -161,35 +160,20 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
     private boolean isAutoDownload;
     private GameGroup gameGroup;
 
+    boolean hasWelfare;
+
     @Override
     public void initView() {
         Intent intent = getIntent();
         id = intent.getIntExtra("id", 0);
         isAutoDownload = intent.getBooleanExtra(AUTO_DOWNLOAD, false);
-        boolean hasWelfare = intent.getBooleanExtra(KEY_HAS_WELFARE, false);//有没有福利
+        hasWelfare = intent.getBooleanExtra(KEY_HAS_WELFARE, false);//有没有福利
         gameGroup = DataUtil.getObject(intent, GameGroup.class);
         EventBus.getDefault().register(this);
         //tagList
         TagListUtil.setTagList(recyclerView, tagList);
         //viewPager
         mAdapter = new TitleFragmentListAdapter2(getSupportFragmentManager());
-        fgtGameDetail = FgtGameDetail.newInstance(id);
-        fgtGameComment = FgtGameComment.newInstance(id);
-        fgtGameDetail.setSmartRefreshLayout(refresh);
-        fgtGameComment.setSmartRefreshLayout(refresh);
-        fgtGameComment.setListAction1(fgtGameDetail);
-        mAdapter.add(fgtGameDetail, "详情");
-
-        if(hasWelfare){
-            FgtGameWelfare fgtGameWelfare = FgtGameWelfare.newInstance(id);
-            fgtGameWelfare.setSmartRefreshLayout(refresh);
-            mAdapter.add(fgtGameWelfare, "福利");
-            pingJiaIndex = 2;//评价的位置为2;
-        } else {
-            pingJiaIndex = 1;//评价的位置可能为1;
-        }
-
-        mAdapter.add(fgtGameComment, "评价");
         viewPager.setOffscreenPageLimit(mAdapter.getCount());
         viewPager.setAdapter(mAdapter);
         tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
@@ -269,12 +253,13 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
     }
 
     private int pingJiaIndex = 1;
+
     //加载游戏数据
     private void loadData(final GameEntity gameEntity) {
         this.gameEntity = gameEntity;
         //更新关注状态
         updateFocusTv();
-        tryInitGift();
+        tryInitFragment();
         //更新评价数量
         if (gameEntity.getApp().getComment_num() > 0) {
             TabLayout.Tab tab = tabLayout.getTabAt(pingJiaIndex);
@@ -350,15 +335,32 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
     }
 
     private FgtGameGift fgtGameGift;
+
     //重新初始化viewPager的数据
-    private void tryInitGift() {
+    private void tryInitFragment() {
+        mAdapter.clearData();
+        fgtGameDetail = FgtGameDetail.newInstance(id);
+        fgtGameComment = FgtGameComment.newInstance(id);
+        fgtGameDetail.setSmartRefreshLayout(refresh);
+        fgtGameComment.setSmartRefreshLayout(refresh);
+        fgtGameComment.setListAction1(fgtGameDetail);
+        mAdapter.add(fgtGameDetail, "详情");
+
+        if (hasWelfare) {
+            FgtGameWelfare fgtGameWelfare = FgtGameWelfare.newInstance(id);
+            fgtGameWelfare.setSmartRefreshLayout(refresh);
+            mAdapter.add(fgtGameWelfare, "福利");
+        }
         if (fgtGameGift != null || !gameEntity.isGift()) {
-            return;
+
+        } else {
+            fgtGameGift = FgtGameGift.newInstance(id);
+            fgtGameGift.setSmartRefreshLayout(refresh);
+            fgtGameGift.loadData(gameEntity);
+            mAdapter.add(fgtGameGift, "礼包");
         }
-        fgtGameGift = FgtGameGift.newInstance(id);
-        fgtGameGift.setSmartRefreshLayout(refresh);
-        fgtGameGift.loadData(gameEntity);
-        mAdapter.add(fgtGameGift, "礼包");
+        mAdapter.add(fgtGameComment, "评价");
+        pingJiaIndex = mAdapter.getCount() - 1;
         mAdapter.notifyDataSetChanged();
         viewPager.setOffscreenPageLimit(mAdapter.getCount());
     }
@@ -626,32 +628,33 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
                             super.onAutoComplete(url, objects);
                             LogUtil.println("initPlay", "onAutoComplete", url, objects);
                             File file = new File(video_url);
-                            if(file.exists()) {
+                            if (file.exists()) {
                                 long totalSpace = file.getTotalSpace();
                                 LogUtil.println("initPlay", "exists file", totalSpace);
                             }
                             if (videoPlayer != null)
                                 videoPlayer.startPlayLogic();
                         }
+
                         @Override
                         public void onPlayError(String url, Object... objects) {
                             super.onPlayError(url, objects);
                             File file = new File(video_url);
                             long curPosition = GSYVideoManager.instance().getCurPlayerManager().getCurrentPosition();
                             LogUtil.println("initPlay", "onPlayError", url, curPosition);
-                            if(file.exists()){
+                            if (file.exists()) {
                                 LogUtil.println("initPlay", "retry play");
                                 if (videoPlayer != null) {
-                                    if(curPosition > 0) {
+                                    if (curPosition > 0) {
                                         videoPlayer.setSeekOnStart(curPosition);
                                         videoPlayer.startPlayLogic();
                                     } else {
-                                        ViewUtil.delay(new AbsObserver<Integer>(){
+                                        ViewUtil.delay(new AbsObserver<Integer>() {
                                             @Override
                                             public void onNext(Integer integer) {
                                                 super.onNext(integer);
                                                 try {
-                                                    if(videoPlayer != null)
+                                                    if (videoPlayer != null)
                                                         videoPlayer.startPlayLogic();
                                                 } catch (Exception e) {
                                                     e.printStackTrace();
@@ -684,14 +687,15 @@ public class ActGameGroupOrGameDetail extends BaseActivity {
             videoPlayer.onVideoResume();
         super.onResume();
         isPlay = true;
-        if(onResumeCount > 0){
-            if(gameEntity != null && gc_game_app_detail_bt2 != null) {
+        if (onResumeCount > 0) {
+            if (gameEntity != null && gc_game_app_detail_bt2 != null) {
                 //强制更新下载按钮
                 CommonUtil.getInstance().palyGameDetailBtnValue(false, gameEntity, gc_game_app_detail_bt2, 0);
             }
         }
         onResumeCount++;
     }
+
     private int onResumeCount = 0;
 
     @Override

+ 22 - 6
app/src/main/java/com/sheep/gamegroup/module/game/activity/ActGitBagList.java

@@ -16,18 +16,34 @@ public class ActGitBagList extends BaseContainerActivity {
 
     private GiftTags data;
 
+    private int appId;
+    private String appName;
+
     @Override
     public void initView() {
-        data = DataUtil.getObject(getIntent(), GiftTags.class);
-        super.initView();
-        TitleBarUtils.getInstance().setShowOrHide(this, true)
-                .setTitle(this, data != null ? data.getName() : "礼包列表")
-                .setTitleFinish(this);
+        if (getIntent().hasExtra("appid") && getIntent().hasExtra("appname")) {
+            appId = getIntent().getIntExtra("appid", 0);
+            appName = getIntent().getStringExtra("appname");
+            super.initView();
+            TitleBarUtils.getInstance().setShowOrHide(this, true)
+                    .setTitle(this, appName)
+                    .setTitleFinish(this);
+        } else {
+            data = DataUtil.getObject(getIntent(), GiftTags.class);
+            super.initView();
+            TitleBarUtils.getInstance().setShowOrHide(this, true)
+                    .setTitle(this, data != null ? data.getName() : "礼包列表")
+                    .setTitleFinish(this);
+        }
     }
+
     @Override
     protected Fragment initFragment() {
-        if(data != null)
+        if (appId > 0) {
+            return FgtGiftBagList.newInstanceByAppId(appId);
+        } else if (data != null) {
             return FgtGiftBagList.newInstanceByTagId(data.getId());
+        }
         return new FgtGiftBagList();
     }
 }

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.webview.fragment.FgtWebX5;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
@@ -74,8 +75,8 @@ public class FgtGameCenter extends BaseFragment {
         backBtn.setVisibility((getActivity() instanceof ActMain) ? View.GONE : View.VISIBLE);
         TitleFragmentListAdapter mAdapter = new TitleFragmentListAdapter(getChildFragmentManager());
         mAdapter.add(new FgtPlayGame(), "玩转游戏");
-        mAdapter.add(new FgtWelfareCenter(), "福利中心");
-        mAdapter.add(FgtFindChild.newInstance(new ArticleTag(3, "游戏资讯")), "游戏资讯");
+        mAdapter.add(FgtWebX5.newInstance(new WebParams(Config.getUrlByPath(Config.PATH_WELFARE_HOME))), "福利中心");
+        mAdapter.add(FgtFindChild.newInstance(new ArticleTag(-1, 1)), "游戏资讯");
         mAdapter.add(new FgtGameMall(), "福利商城");
         pager.setAdapter(mAdapter);
         indicator.setupWithViewPager(pager);

+ 23 - 6
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtPlayGame.java

@@ -23,6 +23,7 @@ import com.sheep.gamegroup.module.game.adapter.AdpGameCenterType;
 import com.sheep.gamegroup.module.game.model.GameCenterType;
 import com.sheep.gamegroup.module.game.model.GamePortTypes;
 import com.sheep.gamegroup.module.game.util.FocusGameHelper;
+import com.sheep.gamegroup.module.game.util.GameNewsRecommendHelper;
 import com.sheep.gamegroup.module.game.util.HpRefreshWelfareHelper;
 import com.sheep.gamegroup.module.game.util.OneTaskHelper;
 import com.sheep.gamegroup.module.game.util.PromoteGoodsHelper;
@@ -98,11 +99,17 @@ public class FgtPlayGame extends BaseFragment {
     View play_game_task;
     @BindView(R.id.play_game_focus)
     View play_game_focus;
+    @BindView(R.id.play_game_news)
+    View play_game_news;
     private OneTaskHelper mOneTaskHelper;//的帮助类
     //商品限时抢购入口与刷新商品
     @BindView(R.id.play_game_promote_goods)
     View play_game_promote_goods;
     private PromoteGoodsHelper mPromoteGoodsHelper;//的帮助类
+
+    private FocusGameHelper mFocusGameHelper;
+    private GameNewsRecommendHelper mGameNewsRecommendHelper;
+
     @Override
     public void onViewCreated() {
         //banner
@@ -114,7 +121,8 @@ public class FgtPlayGame extends BaseFragment {
         mHpRefreshWelfareHelper = new HpRefreshWelfareHelper(hp_refresh_welfare_box);
         //玩转游戏  商城限时抢购入口
         mOneTaskHelper = new OneTaskHelper(play_game_task);
-        new FocusGameHelper(play_game_focus).config();
+        mFocusGameHelper = new FocusGameHelper(play_game_focus).config();
+        mGameNewsRecommendHelper = new GameNewsRecommendHelper(play_game_news).config();
         //玩转游戏  商城限时抢购入口
         mPromoteGoodsHelper = new PromoteGoodsHelper(play_game_promote_goods);
 
@@ -157,14 +165,21 @@ public class FgtPlayGame extends BaseFragment {
     }
 
 
-
     private void refreshData() {
         initBanner();
         initGameTagList();
-        if(mHpRefreshWelfareHelper != null)
+        if (mHpRefreshWelfareHelper != null) {
             mHpRefreshWelfareHelper.refreshData();
-        if(mPromoteGoodsHelper != null)
+        }
+        if (mPromoteGoodsHelper != null) {
             mPromoteGoodsHelper.refreshData();
+        }
+        if (mGameNewsRecommendHelper != null) {
+            mGameNewsRecommendHelper.refresh();
+        }
+        if (mFocusGameHelper != null) {
+            mFocusGameHelper.refresh();
+        }
     }
 
     //获取出包类型列表 的tagList
@@ -191,7 +206,7 @@ public class FgtPlayGame extends BaseFragment {
                         for (int i = 0; i < size; i++) {
                             GamePortTypes item = gamePortTypeList.get(i);
                             int index = i % 3;
-                            switch (index){
+                            switch (index) {
                                 case 0:
                                     initGameList(play_game_list_2_rv, gameEntityList2, item);
                                     break;
@@ -223,7 +238,7 @@ public class FgtPlayGame extends BaseFragment {
             bindBanner();
         }
 
-        SheepApp.getInstance().getNetComponent().getApiService().gameBanner(1)
+        SheepApp.getInstance().getNetComponent().getApiService().gameBanner(1, 1)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
@@ -295,8 +310,10 @@ public class FgtPlayGame extends BaseFragment {
         //结束轮播
         banner.stopAutoPlay();
     }
+
     private Comparator<ListTypeList<GameEntity, GameListType>> comparator = (item1, item2) -> item2.getSort() - item1.getSort();
     private Comparator<GamePortTypes> comparator2 = (item1, item2) -> item2.getSort() - item1.getSort();
+
     private void initGameList(final RecyclerView playGameListRv, final List<ListTypeList<GameEntity, GameListType>> gameEntityListList, GamePortTypes packageTypes) {
         GameListType gameListType = packageTypes.toGameListType();
         if (gameListType == null) {

+ 26 - 14
app/src/main/java/com/sheep/gamegroup/module/game/util/FocusGameHelper.java

@@ -5,10 +5,12 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
+import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -27,7 +29,7 @@ public class FocusGameHelper {
 
     private View rootView;
 
-    private GameEntity gameEntity;
+    private Applications apps;
 
     @BindView(R.id.item_focus_icon_iv)
     public ImageView iconView;
@@ -46,37 +48,47 @@ public class FocusGameHelper {
         this.rootView = rootView;
     }
 
-    public void config() {
+    public FocusGameHelper config() {
         ButterKnife.bind(this, rootView);
-        loadData();
+        refresh();
+        return this;
     }
 
-    private void loadData() {
-        SheepApp.getInstance().getNetComponent().getApiService().playGameDetail(178)
+    public void refresh() {
+        SheepApp.getInstance().getNetComponent().getApiService().getDailyFocusApp()
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
-                        gameEntity = baseMessage.getData(GameEntity.class);
-                        bindData();
+                        apps = baseMessage.getData(Applications.class);
+                        if (apps!=null) {
+                            bindData();
+                            rootView.setVisibility(View.VISIBLE);
+                        } else{
+                            rootView.setVisibility(View.GONE);
+                        }
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         G.showToast(baseMessage);
+                        rootView.setVisibility(View.GONE);
                     }
                 });
     }
 
     private void bindData() {
-        ViewUtil.setText(titleView, gameEntity.getApp().getName());
-        ViewUtil.setText(sizeView, gameEntity.getApp().getPackage_size());
-        TextView[] tagViews = {tagView1, tagView2, tagView3};
-        for (int i = 0; i < tagViews.length && i < gameEntity.getApp().getTags().size(); i++) {
-            ViewUtil.setText(tagViews[i], gameEntity.getApp().getTags().get(i).getName());
-        }
-        ViewUtil.setGameImage(iconView, gameEntity.getApp().getIcon());
+        ViewUtil.setText(titleView, apps.getName());
+        ViewUtil.setText(sizeView, apps.getPackage_size() + "M");
+        tagView1.setText("赏金¥" + apps.getRewardNum());
+        tagView2.setText("福利" + apps.getWelfareNum());
+        tagView3.setText("礼包" + apps.getGiftNum());
+
+        ViewUtil.setGameImage(iconView, apps.getIcon());
+        rootView.setOnClickListener(v -> {
+            Jump2View.getInstance().goPlayGameDetail(apps.getId());
+        });
     }
 
     @OnClick(R.id.item_focus_btn_tv)

+ 89 - 0
app/src/main/java/com/sheep/gamegroup/module/game/util/GameNewsRecommendHelper.java

@@ -0,0 +1,89 @@
+package com.sheep.gamegroup.module.game.util;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.dateview.DateUtil;
+import com.sheep.gamegroup.model.entity.Applications;
+import com.sheep.gamegroup.model.entity.Article;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+public class GameNewsRecommendHelper {
+
+    private View rootView;
+
+    @BindView(R.id.recommend_news_layout)
+    public LinearLayout recommendNewLayout;
+
+    public GameNewsRecommendHelper(View rootView) {
+        this.rootView = rootView;
+    }
+
+    public GameNewsRecommendHelper config() {
+        ButterKnife.bind(this, rootView);
+        refresh();
+        return this;
+    }
+
+    public void refresh() {
+        SheepApp.getInstance().getNetComponent().getApiService().getFindListv2(0, 3, 0, 1, 1)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        List<Article> list = baseMessage.getDataList(Article.class);
+                        bindData(list);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                        rootView.setVisibility(View.GONE);
+                    }
+                });
+    }
+
+    private void bindData(List<Article> list) {
+        if (list != null && list.size() > 0) {
+            rootView.setVisibility(View.VISIBLE);
+            recommendNewLayout.removeAllViews();
+            for (Article article : list) {
+                View itemView = LayoutInflater.from(rootView.getContext()).inflate(R.layout.game_recommend_article_item_tile, recommendNewLayout, false);
+                TextView typeView = itemView.findViewById(R.id.type_view);
+                TextView titleView = itemView.findViewById(R.id.title_view);
+                TextView dateView = itemView.findViewById(R.id.date_view);
+                titleView.setText(article.getTitle());
+                dateView.setText(DateUtil.getTime(article.getCreated_at() * 1000, "MM-dd"));
+                if (article.getGame_articles_type() == 1) {
+                    typeView.setText("资讯");
+                    typeView.setTextColor(typeView.getContext().getResources().getColor(R.color.blue_end));
+                    typeView.setBackgroundResource(R.drawable.shape_blue_stroke_rectangle_3_radius);
+                } else {
+                    typeView.setText("活动");
+                    typeView.setTextColor(typeView.getContext().getResources().getColor(R.color.red_FD2D54));
+                    typeView.setBackgroundResource(R.drawable.shape_red_stroke_rectangle_3_radius);
+                }
+                recommendNewLayout.addView(itemView);
+                itemView.setOnClickListener(v -> Jump2View.getInstance().goFindItem(itemView.getContext(), article));
+            }
+        } else {
+            rootView.setVisibility(View.GONE);
+        }
+    }
+
+}

+ 22 - 14
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -1100,6 +1100,7 @@ public class CommonUtil {
                 action1.call(url);
         }
     }
+
     /**
      * ACache.get(context).put("url_config", (JSONObject) urlConfig);
      * JSONObject url_config = (JSONObject)ACache.get(context).get("url_config");
@@ -1124,7 +1125,8 @@ public class CommonUtil {
                         JSONObject urlConfig = baseMessage.getData(JSONObject.class);
                         loadConfig(urlConfig);
                     }
-                    private void loadConfig(JSONObject urlConfig){
+
+                    private void loadConfig(JSONObject urlConfig) {
                         if (urlConfig != null) {
                             String url = urlConfig.getString(Config.KEY_SMALL_STATION_URL);
                             if (TextUtils.isEmpty(url))
@@ -2257,6 +2259,7 @@ public class CommonUtil {
         UMConfigUtils.IdEvent.BANNER.commit(item.getId());
         clickBanner(activity, ListUtil.getItem(slideshowEtyLists, position));
     }
+
     //游戏轮播图
     public void clickGameBanner(Activity activity, int position, List<SlideshowEty> slideshowEtyLists) {
         SlideshowEty item = ListUtil.getItem(slideshowEtyLists, position);
@@ -2272,15 +2275,19 @@ public class CommonUtil {
         if (item == null) {
             return;
         }
+        clickBanner(activity, item.getId(), item.getType(), item.getExt());
+    }
+
+    public void clickBanner(Activity activity, int id, int type, String extString) {
         UMConfigUtils.onEvent(UMConfigUtils.Event.BANNER_CLICK_HORIZONTAL);
-        UMConfigUtils.IdEvent.BANNER.commit(item.getId());
+        UMConfigUtils.IdEvent.BANNER.commit(id);
         Ext ext;
-        switch (item.getType()) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
+        switch (type) {// 0,类型 1跳转试玩赚钱、2单个任务详情、3信用卡办理、4 H5页面、5 微信二维码任务
             case 1:
                 Jump2View.getInstance().goTryplayView(activity, null);
                 break;
             case 2:
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2292,7 +2299,7 @@ public class CommonUtil {
                         .goCreditCardTaskList(activity, 3);
                 break;
             case 4:
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2303,7 +2310,7 @@ public class CommonUtil {
                     Jump2View.getInstance().goWeb(activity, ext.getUrl(), ext.getTitle());
                 break;
             case 5:
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null || ext.getUrl() == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2336,7 +2343,7 @@ public class CommonUtil {
                 Jump2View.getInstance().goXiaomiGameList(activity, null);
                 break;
             case JUMP_GMAE://游戏详情
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2347,7 +2354,7 @@ public class CommonUtil {
             case JUMP_FIND_ACT://发现--活动
             case JUMP_FIND_INFORMATION://webView资讯
             case JUMP_FIND_GMAE://发现中的游戏详情
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2355,7 +2362,7 @@ public class CommonUtil {
                 Jump2View.getInstance().goFindItem(activity, ext.getId());
                 break;
             case JUMP_WATCH_FOCUS://看点
-                ext = EntityUtils.getExtInfo(item.getExt());
+                ext = EntityUtils.getExtInfo(extString);
                 if (ext == null) {
                     G.showToast(R.string.error_data);
                     return;
@@ -2537,6 +2544,7 @@ public class CommonUtil {
                     }
                 });
     }
+
     /**
      * 刷新福利
      */
@@ -2797,10 +2805,10 @@ public class CommonUtil {
         int x = 35;
         int y = -50;
 
-        if(TestUtil.isDev()){//测试部分
+        if (TestUtil.isDev()) {//测试部分
             CharSequence copyText = StringUtils.getCopyText();
             String copy;
-            if(copyText == null){
+            if (copyText == null) {
                 copy = "1;0;100;35;-50";
             } else {
                 copy = copyText.toString();
@@ -2813,13 +2821,13 @@ public class CommonUtil {
                 w = Integer.parseInt(items[i++]);
                 x = Integer.parseInt(items[i++]);
                 y = Integer.parseInt(items[i++]);
-                while (n != child_list.size()){
-                    if(n > child_list.size())
+                while (n != child_list.size()) {
+                    if (n > child_list.size())
                         child_list.add(child_list.get(0));
                     else
                         child_list.remove(0);
                 }
-            }catch (Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }

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

@@ -53,6 +53,7 @@ import com.sheep.gamegroup.model.entity.WebviewEntity;
 import com.sheep.gamegroup.model.entity.XianWanEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.ShowRedDot;
+import com.sheep.gamegroup.module.find.activity.ActFind;
 import com.sheep.gamegroup.module.find.activity.ActMediaChoose;
 import com.sheep.gamegroup.module.game.activity.ActDownloadManager;
 import com.sheep.gamegroup.module.game.activity.ActGameCenterType;
@@ -2454,6 +2455,13 @@ public class Jump2View {
         activity.startActivity(DataUtil.putObject(new Intent(activity, ActArticleComment.class), article_id));
     }
 
+    public void goActFind4Game(Activity activity, int type) {
+        Intent in = new Intent(activity, ActFind.class);
+        in.putExtra("for_what", 1);
+        in.putExtra("for_type", type);
+        activity.startActivity(in);
+    }
+
     /**
      * 签到 小绵羊
      *
@@ -3017,4 +3025,16 @@ public class Jump2View {
         DataUtil.putObject(intent, item);
         activity.startActivity(intent);
     }
+
+    public void goGameGiftBag(int appId, String appName) {
+        if(appId == 0){
+            G.showToast(R.string.please_contact_customer_service);
+            return;
+        }
+        Activity activity = SheepApp.getInstance().getCurrentActivity();
+        Intent intent = new Intent(activity, ActGitBagList.class);
+        intent.putExtra("appid", appId);
+        intent.putExtra("appname", appName);
+        activity.startActivity(intent);
+    }
 }

+ 47 - 8
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.AbsObserver;
 import com.sheep.gamegroup.model.api.IWeb;
+import com.sheep.gamegroup.model.entity.Article;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -61,11 +62,12 @@ public class KFZSJs {
 
     public KFZSJs(BaseActWeb activity) {
         this.activity = activity;
-        this.iWeb =  activity;
+        this.iWeb = activity;
     }
+
     public KFZSJs(Activity activity, IWeb iWeb) {
         this.activity = activity;
-        this.iWeb =  iWeb;
+        this.iWeb = iWeb;
     }
 
     @JavascriptInterface
@@ -108,7 +110,7 @@ public class KFZSJs {
     @JavascriptInterface
     public void gotoMain(int tab) {
         Class willClass = ActMain.class;
-        if(tab == MainTab.Fgt_Find.ordinal()){
+        if (tab == MainTab.Fgt_Find.ordinal()) {
             willClass = ActFind.class;
         }
         Intent mainIntent = new Intent(activity, willClass);
@@ -117,7 +119,7 @@ public class KFZSJs {
     }
 
     @JavascriptInterface
-    public void gotoPublicVideo(){
+    public void gotoPublicVideo() {
         Jump2View.getInstance().gotoActPublishArticle(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO);
     }
 
@@ -310,11 +312,12 @@ public class KFZSJs {
             }
         });
     }
+
     @JavascriptInterface
     public void wxpay(String payInfo) {
         JSONObject jsonObject = JSONObject.parseObject(payInfo);
         LogUtil.println("KFZSJs", "wxpay", payInfo);
-        if(jsonObject == null){
+        if (jsonObject == null) {
             G.showToast(R.string.please_contact_customer_service);
             return;
         }
@@ -349,6 +352,7 @@ public class KFZSJs {
     public void buyVip(int level, int pay_type) {
         buyVip(activity, new BuyVipReq());
     }
+
     @JavascriptInterface
     public void checkError(Object error, Object data, String errorMsg) {
         String title = "提示";
@@ -356,13 +360,13 @@ public class KFZSJs {
         String msg = errorMsg;
         // 部分余额需绑定手机号,  部分余额需先实名认证 ,部分余额需先绑定提现微信号
         View.OnClickListener btnRightOnClickListener = null;
-        switch (errorMsg){
+        switch (errorMsg) {
             case "部分余额需绑定手机号":
             case "请先绑定手机号":
                 btnRightOnClickListener = view -> Jump2View.getInstance().goBindPhone(activity, null);
                 break;
             case "部分余额需先实名认证":
-                btnRightOnClickListener = view -> Jump2View.getInstance().goRealNameAuther(activity, DataUtil.getInstance().getUserEntity(),  RealNameAuthenAct.ONLY_FINISH);
+                btnRightOnClickListener = view -> Jump2View.getInstance().goRealNameAuther(activity, DataUtil.getInstance().getUserEntity(), RealNameAuthenAct.ONLY_FINISH);
                 break;
             case "部分余额需先绑定提现微信号":
                 btnRightOnClickListener = view -> Jump2View.getInstance().goNoBindWx(activity, ChangeWxOrTelAct.TYPE_NORMAL);
@@ -373,7 +377,7 @@ public class KFZSJs {
                 btnRightOnClickListener = view -> Jump2View.getInstance().gotoVip(activity);
                 break;
         }
-        if(btnRightOnClickListener != null)
+        if (btnRightOnClickListener != null)
             ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle(title).setMsg(msg).setBtnLeftText("取消").setBtnRightText(btnRightText).setBtnRightOnClickListener(btnRightOnClickListener));
     }
 
@@ -431,24 +435,59 @@ public class KFZSJs {
     public void getAllContact() {
         ContactUtil.getAllContactList(result -> iWeb.loadJs(String.format(Locale.CHINA, "onGetAllContact('%s')", result)));
     }
+
     @JavascriptInterface
     public void getAllCallLog() {
         SMSUtil.getCallLog(result -> iWeb.loadJs(String.format(Locale.CHINA, "onGetAllCallLog('%s')", result)));
     }
+
     @JavascriptInterface
     public void setTaskEty(String taskJson) {
         iWeb.setTaskEty(JSON.parseObject(taskJson, TaskEty.class));
     }
+
     @JavascriptInterface
     public void updateDownloadBtn() {
         new Thread(() -> iWeb.updateDownloadBtn()).start();
     }
+
     @JavascriptInterface
     public void downloadApk() {
         new Thread(() -> iWeb.onClickDownloadBtn()).start();
     }
+
     @JavascriptInterface
     public void showTip(String msg) {
         activity.runOnUiThread(() -> G.showToast(msg));
     }
+
+    @JavascriptInterface
+    public void bannerClick(int id, int type, String ext) {
+        CommonUtil.getInstance().clickBanner(activity, id, type, ext);
+    }
+
+    @JavascriptInterface
+    public void gotoGiftCenter() {
+        Jump2View.getInstance().goGiftCenter(activity);
+    }
+
+    @JavascriptInterface
+    public void gotoFind4Game(int type) {
+        Jump2View.getInstance().goActFind4Game(activity, type);
+    }
+
+    @JavascriptInterface
+    public void gotoArticle(int id){
+        Jump2View.getInstance().goFindItem(activity, id);
+    }
+
+    @JavascriptInterface
+    public void gotoGameGroupDetail(int id){
+        Jump2View.getInstance().goActGameGroupDetail(id);
+    }
+
+    @JavascriptInterface
+    public void gotoGiftBagById(int id, String name){
+        Jump2View.getInstance().goGameGiftBag(id, name);
+    }
 }

+ 10 - 3
app/src/main/java/com/sheep/gamegroup/view/fragment/BaseListFragment5.java

@@ -44,6 +44,8 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
 
     protected Activity activity;
 
+    private int refreshOnType = REFRESH_ON_NONE;
+
     @Override
     public void onViewCreated() {
         activity = getActivity();
@@ -51,7 +53,7 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
         initListener();
         switch (refreshDataType()) {
             case REFRESH_ON_CREATE:
-//                ViewUtil.refreshXrv(view_list);
+                ViewUtil.refreshXrv(view_list);
                 break;
             case REFRESH_ON_RESUME:
                 break;
@@ -65,6 +67,7 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
     public static final int REFRESH_ON_CREATE = 0;
     public static final int REFRESH_ON_RESUME = 1;
     public static final int REFRESH_ON_YOURSELF = -1;
+    public static final int REFRESH_ON_NONE = -2;
     @BindView(R.id.empty_view)
     protected View empty_view;
     @BindView(R.id.check_net_ll)
@@ -194,7 +197,7 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
     public void onResume() {
         super.onResume();
         if (refreshDataType() == REFRESH_ON_RESUME) {
-//            ViewUtil.refreshXrv(view_list);
+            ViewUtil.refreshXrv(view_list);
         }
     }
 
@@ -211,7 +214,11 @@ public abstract class BaseListFragment5<T> extends BaseFragment implements IRefr
      * @return
      */
     public int refreshDataType() {
-        return REFRESH_ON_CREATE;
+        return refreshOnType;
+    }
+
+    public void setRefreshOnType(int type){
+        refreshOnType = type;
     }
 
     public void clear() {

+ 13 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFindChild.java

@@ -57,6 +57,7 @@ import static android.content.Intent.ACTION_PACKAGE_REMOVED;
 public class FgtFindChild extends BaseListFragment5<Article> {
 
     private int type;
+    private int subType;
 
     @Override
     public void initView() {
@@ -76,7 +77,11 @@ public class FgtFindChild extends BaseListFragment5<Article> {
 
     @Override
     protected Observable<BaseMessage> getApi(ApiService apiService) {
-        return apiService.getFindList(page, per_page, type);
+        if (type > 0) {
+            return apiService.getFindList(page, per_page, type);
+        } else {
+            return apiService.getFindListv2(page, per_page, subType, 0, -type);
+        }
     }
 
     @Override
@@ -311,12 +316,14 @@ public class FgtFindChild extends BaseListFragment5<Article> {
 
         @Override
         public int getViewIdByType(int type) {//type来源于 getItemViewType 返回的值
-            if (type == 2 && newsConverter != null) {
-//                return R.layout.find_item_game_news;
-                //todo
-                return R.layout.find_item_news;
+            if (FgtFindChild.this.type == -1) {
+                return R.layout.find_item_game_news;
+            } else {
+                if (type == 2 && newsConverter != null) {
+                    return R.layout.find_item_news;
+                }
+                return R.layout.find_item;
             }
-            return R.layout.find_item;
         }
 
         @Override

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

@@ -81,6 +81,7 @@ public class Config {
     //随便打首页
     public static final String PATH_SBD_HOME = STATION_SUI_BIAN_DA + "/";
     //福利
+    public static final String PATH_WELFARE_HOME = STATION_WELFARE + "/home";
     public static final String PATH_WELFARE_DETAIL = STATION_WELFARE + "/detail";
     //赏金福利
     public static final String PATH_MONEY_REWARD_DETAIL = STATION_WELFARE + "/money-reward-detail";

+ 9 - 0
app/src/main/res/drawable/shape_blue_stroke_rectangle_3_radius.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:radius="3dp"/>
+    <stroke
+        android:width="1dp"
+        android:color="@color/blue_end" />
+</shape>

+ 1 - 1
app/src/main/res/drawable/shape_red_stroke_rectangle_3_radius.xml

@@ -5,5 +5,5 @@
         android:radius="3dp"/>
     <stroke
         android:width="1dp"
-        android:color="#FD2D54" />
+        android:color="@color/red_FD2D54" />
 </shape>

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

@@ -38,7 +38,6 @@
         android:adjustViewBounds="true"
         android:layout_marginTop="4dp"
         android:scaleType="centerCrop"
-        android:src="@mipmap/icon"
         app:riv_corner_radius="5dp"/>
 
     <TextView

+ 41 - 0
app/src/main/res/layout/game_recommend_article_item_tile.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:padding="4dp"
+    android:gravity="center_vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <TextView
+        android:id="@+id/type_view"
+        android:text=""
+        android:textSize="12sp"
+        android:textColor="@color/red_FD2D54"
+        android:padding="2dp"
+        android:background="@drawable/shape_red_stroke_rectangle_3_radius"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+    <TextView
+        android:id="@+id/title_view"
+        android:text=""
+        android:textSize="12sp"
+        android:layout_marginLeft="8dp"
+        android:textColor="#666666"
+        android:lines="1"
+        android:ellipsize="end"
+        android:padding="2dp"
+        android:layout_weight="1"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <TextView
+        android:id="@+id/date_view"
+        android:text=""
+        android:textSize="11sp"
+        android:textColor="#cdcdcd"
+        android:padding="2dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>

+ 30 - 6
app/src/main/res/layout/item_game_news.xml

@@ -1,13 +1,37 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:orientation="vertical">
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
     <View
         android:layout_width="match_parent"
         android:layout_height="10dp"
-        android:background="@color/bg_home_color"/>
+        android:background="@color/bg_home_color" />
+
+    <View
+        android:background="@mipmap/recommend_italic"
+        android:layout_marginTop="10dp"
+        android:layout_alignParentRight="true"
+        android:layout_width="50dp"
+        android:layout_height="40dp"/>
 
+    <LinearLayout
+        android:id="@+id/recommend_news_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:layout_marginRight="20dp"
+        android:layout_marginLeft="10dp"
+        android:paddingTop="10dp"
+        android:paddingLeft="8dp"
+        android:orientation="vertical">
+    </LinearLayout>
+
+    <View
+        android:layout_below="@+id/recommend_news_layout"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="@color/bg_home_color" />
 
-</LinearLayout>
+</RelativeLayout>

BIN
app/src/main/res/mipmap-xhdpi/recommend_italic.png