同步何春辉代码,更改pay_type字段的来源接口

This commit is contained in:
老皮 2024-10-14 14:18:34 +08:00
parent 20b3c421e7
commit 2113bf7ce1
6 changed files with 26 additions and 18 deletions

View File

@ -141,15 +141,6 @@ public class CommonAppConfig {
private int mAppIconRes; private int mAppIconRes;
private String mAppName; private String mAppName;
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜 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() { public String getUid() {
if (TextUtils.isEmpty(mUid)) { if (TextUtils.isEmpty(mUid)) {

View File

@ -62,6 +62,7 @@ public class ConfigBean extends BaseModel {
private String google_isup; private String google_isup;
private String sud_game_speech; private String sud_game_speech;
private int pay_type = 0;
@SerializedName("is_return_user")//是否需要弹窗0否1是 @SerializedName("is_return_user")//是否需要弹窗0否1是
private String isReturnUser=""; private String isReturnUser="";
@ -72,6 +73,14 @@ public class ConfigBean extends BaseModel {
@SerializedName("jump_h5_url")//点击跳转H5页面地址 @SerializedName("jump_h5_url")//点击跳转H5页面地址
private String jumpH5Url=""; 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") @JSONField(name = "is_return_user")
public String getIsReturnUser() { public String getIsReturnUser() {
return isReturnUser; return isReturnUser;

View File

@ -31,6 +31,7 @@ import com.yunbao.common.utils.GoogleUtils;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.main.utils.HXLinePagerIndicator; import com.yunbao.main.utils.HXLinePagerIndicator;
@ -67,14 +68,21 @@ public class MyWalletActivity extends AbsActivity {
LoadingDialog loadingDialog; LoadingDialog loadingDialog;
SamsungUtil samsungUtil; SamsungUtil samsungUtil;
int payConfig = 0;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
return R.layout.activity_my_wallet; return R.layout.activity_my_wallet;
} }
protected void main() { protected void main() {
super.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; mw = MyWalletActivity.this;
setTitle(mContext.getString(R.string.wallet)); setTitle(mContext.getString(R.string.wallet));
@ -91,8 +99,8 @@ public class MyWalletActivity extends AbsActivity {
googleUtils.initGooglePay(); googleUtils.initGooglePay();
} }
vp_content = (ViewPager) findViewById(R.id.vp_content); vp_content = (ViewPager) findViewById(R.id.vp_content);
vp_content.setVisibility(View.VISIBLE);
TextView rView = (TextView) findViewById(R.id.rView); TextView rView = (TextView) findViewById(R.id.rView);
findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE); findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE);
findViewById(R.id.redPacketMain).setOnClickListener(v -> { findViewById(R.id.redPacketMain).setOnClickListener(v -> {
@ -230,7 +238,7 @@ public class MyWalletActivity extends AbsActivity {
} else { } else {
// 链接包 // 链接包
if (CommonAppConfig.getInstance().getPay_type() == 1) { if (CommonAppConfig.getInstance().getConfig().getPay_type() == 1) {
// 三方支付 // 三方支付
walletFragment = new WalletFragment(); walletFragment = new WalletFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -246,7 +254,7 @@ public class MyWalletActivity extends AbsActivity {
Bundle bundle2 = new Bundle(); 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")); 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); googleFragment2.setArguments(bundle2);
} else if (CommonAppConfig.getInstance().getPay_type()== 2) { } else {
// Google支付 // Google支付
rView.setVisibility(View.VISIBLE); rView.setVisibility(View.VISIBLE);
walletFragment = new WalletFragment(); walletFragment = new WalletFragment();
@ -319,7 +327,7 @@ public class MyWalletActivity extends AbsActivity {
} else { } else {
Log.i("tss", "不是首充"); Log.i("tss", "不是首充");
//链接版本 //链接版本
if (CommonAppConfig.getInstance().getPay_type() == 1) { if (CommonAppConfig.getInstance().getConfig().getPay_type() == 1) {
// 三方支付 // 三方支付
walletFragment = new WalletFragment(); walletFragment = new WalletFragment();
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -335,7 +343,7 @@ public class MyWalletActivity extends AbsActivity {
Bundle bundle2 = new Bundle(); 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")); 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); googleFragment2.setArguments(bundle2);
} else if (CommonAppConfig.getInstance().getPay_type()== 2) { } else {
// Google支付 // Google支付
rView.setVisibility(View.VISIBLE); rView.setVisibility(View.VISIBLE);

View File

@ -275,7 +275,6 @@ public class MainHttpUtil {
bean.setMedalName(obj.getString("medal_name")); bean.setMedalName(obj.getString("medal_name"));
bean.setMedalLevel(obj.getIntValue("medal_level")); bean.setMedalLevel(obj.getIntValue("medal_level"));
CommonAppConfig.getInstance().setUserBean(bean); CommonAppConfig.getInstance().setUserBean(bean);
CommonAppConfig.getInstance().setPay_type(bean.getPay_type());
CommonAppConfig.getInstance().setUserItemList(obj.getString("list")); CommonAppConfig.getInstance().setUserItemList(obj.getString("list"));
bean.seUserInfoComplete(obj.getIntValue("user_info_complete")); bean.seUserInfoComplete(obj.getIntValue("user_info_complete"));
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, info[0]); SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, info[0]);

View File

@ -529,7 +529,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
mContext.startActivity(new Intent(mContext, EditProfileActivity.class)); mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
} else if (i == R.id.lt_star_coin) { } 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); ToastUtil.show(R.string.pay_type);
}else { }else {
@ -540,7 +540,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} }
} else if (i == R.id.btn_coin) { } 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); ToastUtil.show(R.string.pay_type);
}else { }else {

View File

@ -17,6 +17,7 @@
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/vp_content" android:id="@+id/vp_content"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" /> android:layout_weight="1" />