From 2113bf7ce13066302ac1722db2ed129c4709a022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Mon, 14 Oct 2024 14:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BD=95=E6=98=A5=E8=BE=89?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=9B=B4=E6=94=B9pay=5Ftype?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E6=9D=A5=E6=BA=90=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/CommonAppConfig.java | 9 --------- .../com/yunbao/common/bean/ConfigBean.java | 9 +++++++++ .../main/activity/MyWalletActivity.java | 20 +++++++++++++------ .../com/yunbao/main/http/MainHttpUtil.java | 1 - .../yunbao/main/views/MainMeViewHolder.java | 4 ++-- .../main/res/layout/activity_my_wallet.xml | 1 + 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 2b1226828..708e04195 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -141,15 +141,6 @@ public class CommonAppConfig { private int mAppIconRes; private String mAppName; private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜 - private int pay_type; // 1、三方支付,2:官方支付,3:无响应 - - public int getPay_type() { - return pay_type; - } - - public void setPay_type(int pay_type) { - this.pay_type = pay_type; - } public String getUid() { if (TextUtils.isEmpty(mUid)) { diff --git a/common/src/main/java/com/yunbao/common/bean/ConfigBean.java b/common/src/main/java/com/yunbao/common/bean/ConfigBean.java index 497026ce5..75d9316ba 100644 --- a/common/src/main/java/com/yunbao/common/bean/ConfigBean.java +++ b/common/src/main/java/com/yunbao/common/bean/ConfigBean.java @@ -62,6 +62,7 @@ public class ConfigBean extends BaseModel { private String google_isup; private String sud_game_speech; + private int pay_type = 0; @SerializedName("is_return_user")//是否需要弹窗(0否,1是) private String isReturnUser=""; @@ -72,6 +73,14 @@ public class ConfigBean extends BaseModel { @SerializedName("jump_h5_url")//点击跳转H5页面地址 private String jumpH5Url=""; + public int getPay_type() { + return pay_type; + } + + public void setPay_type(int pay_type) { + this.pay_type = pay_type; + } + @JSONField(name = "is_return_user") public String getIsReturnUser() { return isReturnUser; diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index 297e04af1..35e435a48 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -31,6 +31,7 @@ import com.yunbao.common.utils.GoogleUtils; import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.main.R; import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.utils.HXLinePagerIndicator; @@ -67,14 +68,21 @@ public class MyWalletActivity extends AbsActivity { LoadingDialog loadingDialog; SamsungUtil samsungUtil; + int payConfig = 0; + @Override protected int getLayoutId() { return R.layout.activity_my_wallet; } protected void main() { - super.main(); + payConfig= CommonAppConfig.getInstance().getConfig().getPay_type(); + if(CommonAppConfig.IS_GOOGLE_PLAY==0&&payConfig==3){ + ToastUtil.show(WordUtil.isNewZh()?"充值維護中,請稍後再試":"Recharge is under maintenance. Please try again later."); + finish(); + } + mw = MyWalletActivity.this; setTitle(mContext.getString(R.string.wallet)); @@ -91,8 +99,8 @@ public class MyWalletActivity extends AbsActivity { googleUtils.initGooglePay(); } - vp_content = (ViewPager) findViewById(R.id.vp_content); + vp_content.setVisibility(View.VISIBLE); TextView rView = (TextView) findViewById(R.id.rView); findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE); findViewById(R.id.redPacketMain).setOnClickListener(v -> { @@ -230,7 +238,7 @@ public class MyWalletActivity extends AbsActivity { } else { // 链接包 - if (CommonAppConfig.getInstance().getPay_type() == 1) { + if (CommonAppConfig.getInstance().getConfig().getPay_type() == 1) { // 三方支付 walletFragment = new WalletFragment(); Bundle bundle = new Bundle(); @@ -246,7 +254,7 @@ public class MyWalletActivity extends AbsActivity { Bundle bundle2 = new Bundle(); bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); googleFragment2.setArguments(bundle2); - } else if (CommonAppConfig.getInstance().getPay_type()== 2) { + } else { // Google支付 rView.setVisibility(View.VISIBLE); walletFragment = new WalletFragment(); @@ -319,7 +327,7 @@ public class MyWalletActivity extends AbsActivity { } else { Log.i("tss", "不是首充"); //链接版本 - if (CommonAppConfig.getInstance().getPay_type() == 1) { + if (CommonAppConfig.getInstance().getConfig().getPay_type() == 1) { // 三方支付 walletFragment = new WalletFragment(); Bundle bundle = new Bundle(); @@ -335,7 +343,7 @@ public class MyWalletActivity extends AbsActivity { Bundle bundle2 = new Bundle(); bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); googleFragment2.setArguments(bundle2); - } else if (CommonAppConfig.getInstance().getPay_type()== 2) { + } else { // Google支付 rView.setVisibility(View.VISIBLE); diff --git a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java index b508860ae..5973c44b0 100644 --- a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java +++ b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java @@ -275,7 +275,6 @@ public class MainHttpUtil { bean.setMedalName(obj.getString("medal_name")); bean.setMedalLevel(obj.getIntValue("medal_level")); CommonAppConfig.getInstance().setUserBean(bean); - CommonAppConfig.getInstance().setPay_type(bean.getPay_type()); CommonAppConfig.getInstance().setUserItemList(obj.getString("list")); bean.seUserInfoComplete(obj.getIntValue("user_info_complete")); SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, info[0]); diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index 9c40f9d7d..84fe4290a 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -529,7 +529,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi mContext.startActivity(new Intent(mContext, EditProfileActivity.class)); } else if (i == R.id.lt_star_coin) { // 星币充值 - if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getPay_type() == 3) { + if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getConfig().getPay_type() == 3) { // 链接包并且设置不能点击跳转 ToastUtil.show(R.string.pay_type); }else { @@ -540,7 +540,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi } } else if (i == R.id.btn_coin) { // 钻石充值 - if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getPay_type() == 3) { + if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getConfig().getPay_type() == 3) { // 链接包并且设置不能点击跳转 ToastUtil.show(R.string.pay_type); }else { diff --git a/main/src/main/res/layout/activity_my_wallet.xml b/main/src/main/res/layout/activity_my_wallet.xml index 755794c4b..f6c2b20be 100644 --- a/main/src/main/res/layout/activity_my_wallet.xml +++ b/main/src/main/res/layout/activity_my_wallet.xml @@ -17,6 +17,7 @@