合并支付User.getBaseInfos 新增返回pay_type //支付方式展示:1、三方支付,2:官方支付,3:无响应 且根据PDL修改不同界面

This commit is contained in:
ningwenqiang 2024-10-14 14:07:03 +08:00
parent 2ee9e9c726
commit e8c8456e14
3 changed files with 132 additions and 27 deletions

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

@ -1,5 +1,7 @@
package com.yunbao.main.activity;
import static com.yunbao.common.utils.GoogleUtils.googleUtils;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
@ -32,6 +34,7 @@ import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent;
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;
@ -68,14 +71,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));
@ -92,6 +102,7 @@ public class MyWalletActivity extends AbsActivity {
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 -> {
@ -114,8 +125,55 @@ public class MyWalletActivity extends AbsActivity {
payHandler.post(runnable1);
payHandler.postDelayed(runnable2, 2000);
} else {
payHandler.post(runnable1);
payHandler.postDelayed(runnable2, 1000);
if(payConfig==1){
payHandler.post(runnable1);
payHandler.postDelayed(runnable2, 1000);
}else{
googleUtils.setQueryPurchaseListener(mContext, new GoogleUtils.QueryPurchasesListener() {
@Override
public void onResult(JSONObject obj) {
try {
int code = obj.getInt("querySize");
if (code == 0) {
payHandler.post(runnable1);
payHandler.postDelayed(runnable2, 1000);
} else {
JSONArray tokenList = obj.getJSONArray("tokenList");
JSONArray orderList = obj.getJSONArray("orderList");
String tradeNo = obj.getString("tradeNo");
for (int i = 0; i < tokenList.length(); i++) {
int finalI = i;
payHandler.post(new Runnable() {
@Override
public void run() {
//谷歌掉单处理
try {
CommonHttpUtil.Google_sec_pay(tokenList.getString(finalI), orderList.getString(finalI), tradeNo, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (finalI == tokenList.length() - 1) {
loadingDialog.setShowText(getString(R.string.order_query_success));
loadingDialog.dismiss();
}
ToastUtil.show("充值已到账");
finish();
}
});
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
googleUtils.queryPurchasesAsync();
}
}
});
@ -185,20 +243,38 @@ public class MyWalletActivity extends AbsActivity {
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
samsungFragment2.setArguments(bundle2);
} else {
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
if (payConfig==1){
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment2 = new GoogleFragment();
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=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
googleFragment2 = new GoogleFragment();
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=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}else {
rView.setVisibility(View.VISIBLE);
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment2 = new GoogleFragment();
Bundle bundle2 = new Bundle();
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}
}
} else {
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
@ -254,21 +330,40 @@ public class MyWalletActivity extends AbsActivity {
} else {
Log.i("tss", "不是首充");
//链接版本
if (payConfig==1){
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment2 = new GoogleFragment();
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=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}else {
rView.setVisibility(View.VISIBLE);
walletFragment = new WalletFragment();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment1 = new GoogleFragment();
Bundle bundle1 = new Bundle();
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment1.setArguments(bundle1);
googleFragment2 = new GoogleFragment();
Bundle bundle2 = new Bundle();
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}
googleFragment2 = new GoogleFragment();
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=panduo" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}
}

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" />