增加链接包显示支付判断

This commit is contained in:
老皮 2024-10-14 13:56:23 +08:00
parent e50fbefdc1
commit 20b3c421e7
12 changed files with 132 additions and 47 deletions

View File

@ -141,6 +141,15 @@ 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

@ -76,6 +76,17 @@ public class UserBean implements Parcelable {
private boolean isRequest = false; private boolean isRequest = false;
// 支付方式 1三方支付2官方支付3无响应
private int pay_type;
public int getPay_type() {
return pay_type;
}
public void setPay_type(int pay_type) {
this.pay_type = pay_type;
}
public boolean isRequest() { public boolean isRequest() {
return isRequest; return isRequest;
} }

View File

@ -521,6 +521,7 @@ public class IMLoginManager extends BaseCacheManager {
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
.params("uid", uid) .params("uid", uid)
.params("token", token) .params("token", token)
.params("key1","6tnym1br6lhu7")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -661,6 +661,7 @@ public class JavascriptInterfaceUtils {
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
.params("key1","6tnym1br6lhu7")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -1564,4 +1564,5 @@
<string name="game_dialog_activity_achievements_5">5連桿</string> <string name="game_dialog_activity_achievements_5">5連桿</string>
<string name="game_dialog_activity_achievements_6">6連桿</string> <string name="game_dialog_activity_achievements_6">6連桿</string>
<string name="game_dialog_activity_achievements_7">7連桿</string> <string name="game_dialog_activity_achievements_7">7連桿</string>
<string name="pay_type">充值維護中,請稍後再試</string>
</resources> </resources>

View File

@ -1572,4 +1572,5 @@
<string name="game_dialog_activity_achievements_5">5 Combo</string> <string name="game_dialog_activity_achievements_5">5 Combo</string>
<string name="game_dialog_activity_achievements_6">6 Combo</string> <string name="game_dialog_activity_achievements_6">6 Combo</string>
<string name="game_dialog_activity_achievements_7">7 Combo</string> <string name="game_dialog_activity_achievements_7">7 Combo</string>
<string name="pay_type">Recharge is under maintenance. Please try again later.</string>
</resources> </resources>

View File

@ -413,6 +413,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
.params("key1","6tnym1br6lhu7")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -516,6 +516,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
.params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("uid", IMLoginManager.get(mContext).getUserInfo().getId())
.params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken())
.params("key1","6tnym1br6lhu7")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -168,26 +168,27 @@ public class LoginActivity extends AbsActivity {
public void loginClick(View v) { public void loginClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() { // 去掉防抖
/* ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
int i = v.getId();
if (i == R.id.btn_login) {
//Intent intent = new Intent(LoginActivity.this, NewLiveActivity.class);
//startActivity(intent);
login();
} else if (i == R.id.btn_register) {
register();
} else if (i == R.id.btn_forget_pwd) {
forgetPwd();
} else if (i == R.id.btn_tip) {
forwardTip();
}
} }
}); });*/
int i = v.getId();
if (i == R.id.btn_login) {
//Intent intent = new Intent(LoginActivity.this, NewLiveActivity.class);
//startActivity(intent);
login();
} else if (i == R.id.btn_register) {
register();
} else if (i == R.id.btn_forget_pwd) {
forgetPwd();
} else if (i == R.id.btn_tip) {
forwardTip();
}
} }
//注册 //注册

View File

@ -228,20 +228,42 @@ 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
samsungFragment2.setArguments(bundle2); samsungFragment2.setArguments(bundle2);
} else { } 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment1 = new GoogleFragment(); // 链接包
Bundle bundle1 = new Bundle(); if (CommonAppConfig.getInstance().getPay_type() == 1) {
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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); // 三方支付
googleFragment1.setArguments(bundle1); 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
googleFragment2 = new GoogleFragment(); googleFragment1 = new GoogleFragment();
Bundle bundle2 = new Bundle(); Bundle bundle1 = 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")); 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2); 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
} else if (CommonAppConfig.getInstance().getPay_type()== 2) {
// Google支付
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=pd" + "&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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}
} }
} else { } else {
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) { if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
@ -297,21 +319,41 @@ public class MyWalletActivity extends AbsActivity {
} else { } else {
Log.i("tss", "不是首充"); Log.i("tss", "不是首充");
//链接版本 //链接版本
if (CommonAppConfig.getInstance().getPay_type() == 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle);
walletFragment = new WalletFragment(); googleFragment1 = new GoogleFragment();
Bundle bundle = new Bundle(); Bundle bundle1 = 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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
walletFragment.setArguments(bundle); googleFragment1.setArguments(bundle1);
googleFragment1 = new GoogleFragment(); googleFragment2 = new GoogleFragment();
Bundle bundle1 = new Bundle(); Bundle bundle2 = 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=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"));
googleFragment1.setArguments(bundle1); googleFragment2.setArguments(bundle2);
} else if (CommonAppConfig.getInstance().getPay_type()== 2) {
// Google支付
rView.setVisibility(View.VISIBLE);
googleFragment2 = new GoogleFragment(); walletFragment = new WalletFragment();
Bundle bundle2 = new Bundle(); Bundle bundle = 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")); 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"));
googleFragment2.setArguments(bundle2); 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=pd" + "&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=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
googleFragment2.setArguments(bundle2);
}
} }
} }

View File

@ -52,6 +52,7 @@ public class MainHttpUtil {
.params("lastlogindevice", "Android") .params("lastlogindevice", "Android")
.params("uuid_Device", uuid) .params("uuid_Device", uuid)
.params("langue", WordUtil.isNewZh()?"chinese":"english") .params("langue", WordUtil.isNewZh()?"chinese":"english")
.params("key1", "6tnym1br6lhu7")
.execute(callback); .execute(callback);
} }
@ -263,6 +264,7 @@ public class MainHttpUtil {
*/ */
public static void getBaseInfo(String uid, String token, final CommonCallback<UserBean> commonCallback) { public static void getBaseInfo(String uid, String token, final CommonCallback<UserBean> commonCallback) {
HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO)
.params("key1","6tnym1br6lhu7")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -273,6 +275,7 @@ 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]);
@ -298,6 +301,7 @@ public class MainHttpUtil {
public static void getBaseInfos(String uid, String token, HttpCallback callback) { public static void getBaseInfos(String uid, String token, HttpCallback callback) {
HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO)
.params("key1","6tnym1br6lhu7")
.execute(callback); .execute(callback);
} }

View File

@ -528,15 +528,27 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} else if (i == R.id.signature) { } else if (i == R.id.signature) {
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) {
Map<String, String> map_ekv = new HashMap<String, String>(); // 星币充值
map_ekv.put("from", "xb"); if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getPay_type() == 3) {
MobclickAgent.onEvent(mContext, "my_recharge", map_ekv); // 链接包并且设置不能点击跳转
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1)); ToastUtil.show(R.string.pay_type);
}else {
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("from", "xb");
MobclickAgent.onEvent(mContext, "my_recharge", map_ekv);
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1));
}
} else if (i == R.id.btn_coin) { } else if (i == R.id.btn_coin) {
Map<String, String> map_ekv = new HashMap<String, String>(); // 钻石充值
map_ekv.put("from", "zs"); if (CommonAppConfig.IS_GOOGLE_PLAY == 0 && CommonAppConfig.getInstance().getPay_type() == 3) {
MobclickAgent.onEvent(mContext, "my_recharge", map_ekv); // 链接包并且设置不能点击跳转
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0)); ToastUtil.show(R.string.pay_type);
}else {
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("from", "zs");
MobclickAgent.onEvent(mContext, "my_recharge", map_ekv);
mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0));
}
} else if (i == R.id.btn_gold) { } else if (i == R.id.btn_gold) {
MobclickAgent.onEvent(mContext, "my_receive", "充值旁边领取金豆的按钮"); MobclickAgent.onEvent(mContext, "my_receive", "充值旁边领取金豆的按钮");
// mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 2)); // mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 2));