Bläddra i källkod

directational pay

hanjing 7 år sedan
förälder
incheckning
792bf80900

+ 15 - 15
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -21,26 +21,26 @@ public class DaoMaster extends AbstractDaoMaster {
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
-        AcceptTaskRecordDao.createTable(db, ifNotExists);
-        AccountDao.createTable(db, ifNotExists);
-        AppdownloadBeanDao.createTable(db, ifNotExists);
-        DownLoadInfoDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
-        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AppdownloadBeanDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
+        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AcceptTaskRecordDao.createTable(db, ifNotExists);
+        AccountDao.createTable(db, ifNotExists);
         SearchRecordDao.createTable(db, ifNotExists);
+        DownLoadInfoDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
-        AcceptTaskRecordDao.dropTable(db, ifExists);
-        AccountDao.dropTable(db, ifExists);
-        AppdownloadBeanDao.dropTable(db, ifExists);
-        DownLoadInfoDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
-        ScreenShotRecordDao.dropTable(db, ifExists);
+        AppdownloadBeanDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
+        ScreenShotRecordDao.dropTable(db, ifExists);
+        AcceptTaskRecordDao.dropTable(db, ifExists);
+        AccountDao.dropTable(db, ifExists);
         SearchRecordDao.dropTable(db, ifExists);
+        DownLoadInfoDao.dropTable(db, ifExists);
     }
 
     /**
@@ -59,14 +59,14 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
-        registerDaoClass(AcceptTaskRecordDao.class);
-        registerDaoClass(AccountDao.class);
-        registerDaoClass(AppdownloadBeanDao.class);
-        registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AcceptTaskRecordDao.class);
+        registerDaoClass(AccountDao.class);
         registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(DownLoadInfoDao.class);
     }
 
     public DaoSession newSession() {

+ 61 - 61
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,23 +8,23 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
-import com.sheep.gamegroup.greendao.download.Account;
-import com.sheep.gamegroup.greendao.download.AppdownloadBean;
-import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
+import com.sheep.gamegroup.greendao.download.Account;
 import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
-import com.sheep.gamegroup.greendao.download.AccountDao;
-import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
-import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
+import com.sheep.gamegroup.greendao.download.AccountDao;
 import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -35,112 +35,112 @@ import com.sheep.gamegroup.greendao.download.SearchRecordDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
-    private final DaoConfig acceptTaskRecordDaoConfig;
-    private final DaoConfig accountDaoConfig;
-    private final DaoConfig appdownloadBeanDaoConfig;
-    private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig acceptTaskRecordDaoConfig;
+    private final DaoConfig accountDaoConfig;
     private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig downLoadInfoDaoConfig;
 
-    private final AcceptTaskRecordDao acceptTaskRecordDao;
-    private final AccountDao accountDao;
-    private final AppdownloadBeanDao appdownloadBeanDao;
-    private final DownLoadInfoDao downLoadInfoDao;
     private final ProcessRecordDao processRecordDao;
-    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AppdownloadBeanDao appdownloadBeanDao;
     private final SdkLoginUserDao sdkLoginUserDao;
+    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AcceptTaskRecordDao acceptTaskRecordDao;
+    private final AccountDao accountDao;
     private final SearchRecordDao searchRecordDao;
+    private final DownLoadInfoDao downLoadInfoDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
-        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
-        acceptTaskRecordDaoConfig.initIdentityScope(type);
-
-        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
-        accountDaoConfig.initIdentityScope(type);
+        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
+        processRecordDaoConfig.initIdentityScope(type);
 
         appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
         appdownloadBeanDaoConfig.initIdentityScope(type);
 
-        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
-        downLoadInfoDaoConfig.initIdentityScope(type);
-
-        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
-        processRecordDaoConfig.initIdentityScope(type);
+        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
+        sdkLoginUserDaoConfig.initIdentityScope(type);
 
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
-        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
-        sdkLoginUserDaoConfig.initIdentityScope(type);
+        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
+        acceptTaskRecordDaoConfig.initIdentityScope(type);
+
+        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
+        accountDaoConfig.initIdentityScope(type);
 
         searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
         searchRecordDaoConfig.initIdentityScope(type);
 
-        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
-        accountDao = new AccountDao(accountDaoConfig, this);
-        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
-        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
+        downLoadInfoDaoConfig.initIdentityScope(type);
+
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
+        accountDao = new AccountDao(accountDaoConfig, this);
         searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
 
-        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
-        registerDao(Account.class, accountDao);
-        registerDao(AppdownloadBean.class, appdownloadBeanDao);
-        registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
+        registerDao(Account.class, accountDao);
         registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(DownLoadInfo.class, downLoadInfoDao);
     }
     
     public void clear() {
-        acceptTaskRecordDaoConfig.clearIdentityScope();
-        accountDaoConfig.clearIdentityScope();
-        appdownloadBeanDaoConfig.clearIdentityScope();
-        downLoadInfoDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
-        screenShotRecordDaoConfig.clearIdentityScope();
+        appdownloadBeanDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
+        screenShotRecordDaoConfig.clearIdentityScope();
+        acceptTaskRecordDaoConfig.clearIdentityScope();
+        accountDaoConfig.clearIdentityScope();
         searchRecordDaoConfig.clearIdentityScope();
+        downLoadInfoDaoConfig.clearIdentityScope();
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
-    }
-
-    public AccountDao getAccountDao() {
-        return accountDao;
+    public ProcessRecordDao getProcessRecordDao() {
+        return processRecordDao;
     }
 
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
 
-    public DownLoadInfoDao getDownLoadInfoDao() {
-        return downLoadInfoDao;
-    }
-
-    public ProcessRecordDao getProcessRecordDao() {
-        return processRecordDao;
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
     }
 
     public ScreenShotRecordDao getScreenShotRecordDao() {
         return screenShotRecordDao;
     }
 
-    public SdkLoginUserDao getSdkLoginUserDao() {
-        return sdkLoginUserDao;
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
+    }
+
+    public AccountDao getAccountDao() {
+        return accountDao;
     }
 
     public SearchRecordDao getSearchRecordDao() {
         return searchRecordDao;
     }
 
+    public DownLoadInfoDao getDownLoadInfoDao() {
+        return downLoadInfoDao;
+    }
+
 }

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

@@ -80,6 +80,16 @@ public class Applications implements IDownload, Serializable {
     //总评论数
     private int comment_num;
 
+    private int game_discount_id = 0;
+
+    public int getGame_discount_id() {
+        return game_discount_id;
+    }
+
+    public void setGame_discount_id(int game_discount_id) {
+        this.game_discount_id = game_discount_id;
+    }
+
     public int getAvailable_receive() {
         return available_receive;
     }

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

@@ -131,6 +131,16 @@ public class KFZSJs {
         activity.finish();
     }
 
+    @JavascriptInterface
+    public void jumpGame(){
+        Jump2View.getInstance().goMainGame(activity);
+    }
+
+    @JavascriptInterface
+    public void jumpShop(){
+        Jump2View.getInstance().gotoYfShop(activity);
+    }
+
     //h5调用分享 window.kfzsjs.shareLink(link, iconUrl, title, des);
     @JavascriptInterface
     public void shareLink(String link, String iconUrl, String title, String des) {

+ 43 - 17
app/src/main/java/com/sheep/gamegroup/view/activity/ActGcGameAppDetail.java

@@ -27,6 +27,7 @@ import com.sheep.gamegroup.helper.DownloadHelper;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.GameEntity;
 import com.sheep.gamegroup.model.entity.GameListTag;
+import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ApiUtil;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -41,6 +42,7 @@ import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter2;
 import com.sheep.gamegroup.view.fragment.FgtGcGameAppComment;
 import com.sheep.gamegroup.view.fragment.FgtGcGameAppDetail;
 import com.sheep.gamegroup.view.fragment.FgtGcGameAppWelfare;
+import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -53,6 +55,7 @@ import java.util.List;
 import java.util.Locale;
 
 import butterknife.BindView;
+import butterknife.OnClick;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 
@@ -71,6 +74,7 @@ public class ActGcGameAppDetail extends BaseActivity {
         StatusBarUtils.setTranslucent(this);
         super.onCreate(savedInstanceState);
     }
+
     @Override
     protected int getLayoutId() {
         return R.layout.act_gc_game_app_detail;
@@ -100,6 +104,8 @@ public class ActGcGameAppDetail extends BaseActivity {
     TextView gc_game_app_detail_fl_tv;
     @BindView(R.id.gc_game_app_detail_bt2)
     TextView gc_game_app_detail_bt2;
+    @BindView(R.id.gc_game_app_detail_bt3)
+    TextView gc_game_app_detail_bt3;
     @BindView(R.id.gc_game_app_detail_tag_list)
     RecyclerView recyclerView;
 
@@ -108,6 +114,7 @@ public class ActGcGameAppDetail extends BaseActivity {
     private FgtGcGameAppComment fgtGcGameAppComment;
 
     private int id;
+
     @Override
     public void initView() {
         id = getIntent().getIntExtra("id", 0);
@@ -167,9 +174,10 @@ public class ActGcGameAppDetail extends BaseActivity {
 
     //更新关注状态
     private void updateFocusTv() {
-        if(gc_game_app_detail_bt1 != null && gameEntity != null)
+        if (gc_game_app_detail_bt1 != null && gameEntity != null)
             gc_game_app_detail_bt1.setText(gameEntity.isIs_focus_game() ? R.string.has_focus : R.string.focus);
     }
+
     //加载游戏数据
     private void loadData(final GameEntity gameEntity) {
         this.gameEntity = gameEntity;
@@ -177,14 +185,14 @@ public class ActGcGameAppDetail extends BaseActivity {
         updateFocusTv();
         tryInitWelfare();
         //更新评价数量
-        if(gameEntity.getApp().getComment_num() > 0) {
+        if (gameEntity.getApp().getComment_num() > 0) {
             TabLayout.Tab tab = tabLayout.getTabAt(1);
             if (tab != null)
                 tab.setText(String.format(Locale.CHINA, "评价(%d)", gameEntity.getApp().getComment_num()));
             CommonUtil.getInstance().reflex(tabLayout, this, true);
         }
         //加载游戏背景
-        if(TextUtils.isEmpty(gameEntity.getApp().getMain_publicize())){
+        if (TextUtils.isEmpty(gameEntity.getApp().getMain_publicize())) {
             ViewUtil.setImage(gc_game_app_detail_iv, gameEntity.getApp().getPictures());
             ViewUtil.setVisibility(gc_game_app_detail_iv, true);
             ViewUtil.setVisibility(gc_game_app_detail_iv2, false);
@@ -192,7 +200,7 @@ public class ActGcGameAppDetail extends BaseActivity {
             ViewUtil.setImage(gc_game_app_detail_iv2, gameEntity.getApp().getMain_publicize());
             ViewUtil.setVisibility(gc_game_app_detail_iv, false);
             ViewUtil.setVisibility(gc_game_app_detail_iv2, true);
-            if(gameEntity.getApp().getMain_publicize().endsWith(".mp4")) {
+            if (gameEntity.getApp().getMain_publicize().endsWith(".mp4")) {
                 gc_game_app_detail_play_iv.setVisibility(View.VISIBLE);
                 gc_game_app_detail_play_iv.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -207,26 +215,32 @@ public class ActGcGameAppDetail extends BaseActivity {
         //加载游戏名字
         ViewUtil.setText(gc_game_app_detail_name, gameEntity.getApp().getName());
         //加载游戏 福利
-        if(gameEntity.getRelease_task() != null)
-            ViewUtil.setText(gc_game_app_detail_fl_tv,"+\u0020\u0020"+NumberFormatUtils.retainMost2W(gameEntity.getRelease_task().getBonus())+ "元");
+        if (gameEntity.getRelease_task() != null)
+            ViewUtil.setText(gc_game_app_detail_fl_tv, "+\u0020\u0020" + NumberFormatUtils.retainMost2W(gameEntity.getRelease_task().getBonus()) + "元");
         else
             ViewUtil.setText(gc_game_app_detail_fl_tv);
         //加载游戏标签
-        if(gameEntity.getApp().getTags() != null) {
+        if (gameEntity.getApp().getTags() != null) {
             tagList.addAll(gameEntity.getApp().getTags());
             ListUtil.removeNull(tagList);
-            if(recyclerView.getAdapter() != null)
+            if (recyclerView.getAdapter() != null)
                 recyclerView.getAdapter().notifyDataSetChanged();
         }
         //下载按钮
         CommonUtil.getInstance().palyGameDetailBtnValue(this, gameEntity, gc_game_app_detail_bt2, 0);
         fgtGcPlayGameDetail.loadData(gameEntity);
+        if (gameEntity.getApp().getGame_discount_id() == 0) {
+            gc_game_app_detail_bt3.setVisibility(View.GONE);
+        } else {
+            gc_game_app_detail_bt3.setVisibility(View.VISIBLE);
+        }
     }
 
     private FgtGcGameAppWelfare fgtGcGameAppWelfare;
+
     //重新初始化viewPager的数据
     private void tryInitWelfare() {
-        if(fgtGcGameAppWelfare != null || !gameEntity.isGift()){
+        if (fgtGcGameAppWelfare != null || !gameEntity.isGift()) {
             return;
         }
         fgtGcGameAppWelfare = FgtGcGameAppWelfare.newInstance(id);
@@ -249,7 +263,7 @@ public class ActGcGameAppDetail extends BaseActivity {
                         if (isNewData) {
                             GameEntity gameEntity = baseMessage.getData(GameEntity.class);
                             checkData(gameEntity);
-                        } else if(gameEntity != null){
+                        } else if (gameEntity != null) {
                             //更新下载按钮
                             CommonUtil.getInstance().palyGameDetailBtnValue(ActGcGameAppDetail.this, gameEntity, gc_game_app_detail_bt2, 0);
                         }
@@ -271,12 +285,14 @@ public class ActGcGameAppDetail extends BaseActivity {
     }
 
     private int refreshDataCount = 0;
+
     //刷新数据
-    public void refreshData(){
+    public void refreshData() {
         refreshData(viewPager.getCurrentItem());
     }
+
     //刷新数据
-    public void refreshData(int position){
+    public void refreshData(int position) {
         initDetailFromNet();
         boolean isRefresh = false;
         if (refreshDataCount != 0) {
@@ -287,9 +303,10 @@ public class ActGcGameAppDetail extends BaseActivity {
             }
         }
         refreshDataCount++;
-        if(!isRefresh)
+        if (!isRefresh)
             notifyDataSetChanged();
     }
+
     //加载更多数据
     private void loadMoreData() {
         Fragment item = mAdapter.getItem(viewPager.getCurrentItem());
@@ -315,7 +332,7 @@ public class ActGcGameAppDetail extends BaseActivity {
     //点击分享
     public void onClickShareImg(View view) {
         FIND_SHARE.onEvent("application_id", id);
-        if(gameEntity == null || gameEntity.getApp() == null || TextUtils.isEmpty(gameEntity.getApp().getName())){
+        if (gameEntity == null || gameEntity.getApp() == null || TextUtils.isEmpty(gameEntity.getApp().getName())) {
             Jump2View.getInstance().tryShare(this, "find_share_url", "application_id", id);
             return;
         }
@@ -329,7 +346,7 @@ public class ActGcGameAppDetail extends BaseActivity {
 
     //点击关注
     public void onClickFollowTv(final View view) {
-        if(gameEntity == null){
+        if (gameEntity == null) {
             G.showToast(R.string.loading_data);
             return;
         }
@@ -351,6 +368,15 @@ public class ActGcGameAppDetail extends BaseActivity {
         });
     }
 
+    @OnClick(R.id.gc_game_app_detail_bt3)
+    public void onGoDirectionalPay(View v) {
+        CommonUtil.getInstance().initUrlConfigByNet(Config.KEY_DIRECTIONAL_RECHARGE_URL, url -> {
+            url = url + "/" + gameEntity.getApp().getGame_discount_id() + "?authorization=";
+            WebParams webParams = new WebParams(url, "抢购优惠").setShowTitle(false);
+            Jump2View.getInstance().goWeb(this, webParams);
+        });
+    }
+
     private AbsGetDownloadListener absGetDownloadListener = new AbsGetDownloadListener(true) {
         @Override
         public String getDownloadUrl(String packageName) {
@@ -386,9 +412,9 @@ public class ActGcGameAppDetail extends BaseActivity {
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
-        switch (requestCode){
+        switch (requestCode) {
             case RequestCodeConstants.REQUEST_CODE_REFRESH:
-                if(resultCode == RESULT_OK)//发表评论成功
+                if (resultCode == RESULT_OK)//发表评论成功
                     refreshData(1);//需要刷新第二页的评论
                 break;
         }

+ 5 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/ActMyMoney.java

@@ -264,9 +264,11 @@ public class ActMyMoney extends BaseActivity {
             case R.id.my_money_dingxiang_amount_iv://定向货币详情
             case R.id.my_money_dingxiang_amount://定向货币详情
             case R.id.my_money_dingxiang_tag://定向货币详情
-                String url = Config.URL_DIRECTIONAL_LIST + "?authorization=" + SpUtils.getToken(this);
-                WebParams webParams = new WebParams(url, "定向消费").setShowTitle(false);
-                Jump2View.getInstance().goWeb(this, webParams);
+                CommonUtil.getInstance().initUrlConfigByNet(Config.KEY_DIRECTIONAL_LIST_URL, url -> {
+                    url = url + "?authorization=" + SpUtils.getToken(this);
+                    WebParams webParams = new WebParams(url, "定向消费").setShowTitle(false);
+                    Jump2View.getInstance().goWeb(this, webParams);
+                });
                 break;
         }
     }

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

@@ -14,6 +14,7 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.PayOrder;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -202,9 +203,11 @@ public class ActPay extends BaseActivity {
     }
 
     public void onDirectionalPayClicked(View v) {
-        String url = Config.URL_DIRECTIONAL_PAY + "?authorization=" + token + "&order=" + payOrder.getOrderNo();
-        WebParams webParams = new WebParams(url, "定向优惠").setShowTitle(false).setForResult(true).setAction(ACTION_FOR_H5_PAY);
-        Jump2View.getInstance().goWeb(this, webParams);
+        CommonUtil.getInstance().initUrlConfigByNet(Config.KEY_DIRECTIONAL_LIST_URL, url -> {
+            url = url + "?authorization=" + token + "&order=" + payOrder.getOrderNo();
+            WebParams webParams = new WebParams(url, "定向优惠").setShowTitle(false).setForResult(true).setAction(ACTION_FOR_H5_PAY);
+            Jump2View.getInstance().goWeb(this, webParams);
+        });
     }
 
     public void onActivityResult(int requestCode, int resultCode, Intent in) {

+ 11 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -21,6 +21,7 @@ import com.sheep.gamegroup.model.entity.AgentEntity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.UserTaskExistsNew;
+import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
@@ -39,6 +40,7 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 import com.sheep.jiuyan.samllsheep.bean.UserCenterModule;
 import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import org.afinal.simplecache.ACache;
 import org.afinal.simplecache.ApiKey;
@@ -413,7 +415,8 @@ public class FgtPersonalCenter extends BaseFragment {
             R.id.recommend_friend_layout, R.id.faq_layout, R.id.reservation_layout,
             R.id.version_layout, R.id.order_layout, R.id.proxy_game_account_layout,
             R.id.audit_activity_cl, R.id.audit_success_cl, R.id.audit_failed_cl,
-            R.id.iv_redpackage, R.id.fgt_person_center_my_focus, R.id.fgt_pc_item_vip_ll
+            R.id.iv_redpackage, R.id.fgt_person_center_my_focus, R.id.fgt_pc_item_vip_ll,
+            R.id.voucher_layout
     })
     public void onViewClicked(View view) {
         switch (view.getId()) {
@@ -498,6 +501,13 @@ public class FgtPersonalCenter extends BaseFragment {
             case R.id.fgt_person_center_my_focus://我的关注
                 Jump2View.getInstance().goActMyFocus();
                 break;
+            case R.id.voucher_layout:
+                CommonUtil.getInstance().initUrlConfigByNet(Config.KEY_VOUCHER_LIST_URL, url -> {
+                    url = url + "?authorization=" + SpUtils.getToken(getActivity());
+                    WebParams webParams = new WebParams(url, "我的代金券").setShowTitle(false);
+                    Jump2View.getInstance().goWeb(getActivity(), webParams);
+                });
+                break;
         }
     }
 

+ 8 - 3
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -38,8 +38,13 @@ public class Config {
     public static final String KEY_BUY_VIP_URL = "buy_vip_url";
     //用户收货地址的 key
     public static final String KEY_USER_ADDRESS_URL = "user_address_url";
-
-    public static final String URL_DIRECTIONAL_LIST = "http://10.8.220.229:8080/#/game-list";
-    public static final String URL_DIRECTIONAL_PAY = "http://10.8.220.229:8080/#/payment";
+    //定向优惠列表地址 key
+    public static final String KEY_DIRECTIONAL_LIST_URL = "directional_list_url";
+    //定向优惠支付地址 key
+    public static final String KEY_DIRECTIONAL_PAY_URL = "directional_pay_url";
+    //代金券列表地址 key
+    public static final String KEY_VOUCHER_LIST_URL = "voucher_list_url";
+    //代金券列表地址 key
+    public static final String KEY_DIRECTIONAL_RECHARGE_URL = "directional_recharge_url";
 
 }

+ 9 - 0
app/src/main/res/drawable/button_full_normal_red_click.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="30dp" />
+
+    <gradient
+        android:startColor="@color/theme_app_tv_warning"
+        android:endColor="@color/theme_app_tv_warning"/>
+</shape>

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

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+  <item android:state_enabled="false" android:drawable="@drawable/button_full_normal_gray" />
+  <item android:state_focused="true" android:drawable="@drawable/button_full_normal_red_click" />
+  <item android:state_checked="true" android:drawable="@drawable/button_full_normal_red_click"/>
+  <item android:state_selected="true" android:drawable="@drawable/button_full_normal_red_click"/>
+  <item android:state_pressed="true" android:drawable="@drawable/button_full_normal_red_click"/>
+  <item android:drawable="@drawable/sp_bg_gradient_rectangle_blue"/>
+</selector>

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

@@ -137,6 +137,19 @@
                         app:layout_constraintStart_toEndOf="@id/gc_game_app_detail_bt1" />
 
                     <TextView
+                        android:id="@+id/gc_game_app_detail_bt3"
+                        android:layout_width="60dp"
+                        android:layout_height="26dp"
+                        android:layout_marginStart="25dp"
+                        android:background="@drawable/selector_button_full_red"
+                        android:gravity="center"
+                        android:text="抢购福利"
+                        android:textColor="@color/white"
+                        android:textSize="13sp"
+                        app:layout_constraintBottom_toBottomOf="@id/gc_game_app_detail_icon"
+                        app:layout_constraintStart_toEndOf="@id/gc_game_app_detail_bt2" />
+
+                    <TextView
                         android:id="@+id/gc_game_app_detail_fl_tv"
                         android:layout_width="0dp"
                         android:gravity="center"

+ 21 - 0
app/src/main/res/layout/fgt_personalcenter_item_center_one.xml

@@ -83,6 +83,27 @@
 
     </LinearLayout>
 
+    <View style="@style/style_item_line_new"/>
+
+    <LinearLayout
+        android:id="@+id/voucher_layout"
+        style="@style/style_item_container"
+        android:visibility="visible">
+
+        <ImageView
+            style="@style/style_item_img"
+            android:src="@mipmap/order_manager" />
+
+        <TextView
+            style="@style/style_item_label"
+            android:text="我的代金券" />
+
+        <TextView
+            style="@style/style_item_end_next"
+            android:visibility="visible" />
+
+    </LinearLayout>
+
     <View
         android:id="@+id/fgt_person_center_my_focus_line"
         style="@style/style_item_line_new"/>