同步何春辉代码,更改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 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)) {

View File

@ -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;

View File

@ -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);

View File

@ -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]);

View File

@ -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 {

View File

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