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/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 23b380294..3428bce7c 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -536,6 +536,7 @@ public class IMLoginManager extends BaseCacheManager { HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") .params("uid", uid) .params("token", token) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 4660abed4..50327bbf3 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -38,6 +38,7 @@ import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import org.greenrobot.eventbus.EventBus; @@ -659,6 +660,7 @@ public class JavascriptInterfaceUtils { HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index 12783029f..5877aba25 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -60,6 +60,7 @@ import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DebugUtils; @@ -413,6 +414,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 7e639ca0f..3b14ec683 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -44,6 +44,7 @@ import com.opensource.svgaplayer.SVGADrawable; import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; +import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.utils.DebugUtils; import com.yunbao.common.utils.L; import com.yunbao.common.utils.MobclickAgent; @@ -513,6 +514,7 @@ public class LiveGiftPopup extends AbsDialogFragment { HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") .params("uid", IMLoginManager.get(mContext).getUserInfo().getId()) .params("token", IMLoginManager.get(mContext).getUserInfo().getToken()) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java index 1ad1c7c07..1885bc327 100644 --- a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java @@ -167,26 +167,39 @@ public class LoginActivity extends AbsActivity { } + //去掉防止抖动 public void loginClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() { - @Override - public void onViewClicks() { - int i = v.getId(); - if (i == R.id.btn_login) { - //Intent intent = new Intent(LoginActivity.this, NewLiveActivity.class); - //startActivity(intent); - login(); + 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_register) { - register(); - } else if (i == R.id.btn_forget_pwd) { - forgetPwd(); - - } else if (i == R.id.btn_tip) { - forwardTip(); - } - } - }); + } else if (i == R.id.btn_tip) { + forwardTip(); + } +// ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() { +// @Override +// 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(); +// } +// } +// }); } 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 d13018967..ae8c2df5e 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -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); } } 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 7c8498cb3..db790f0d5 100644 --- a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java +++ b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java @@ -15,6 +15,7 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.VersionUtil; @@ -49,6 +50,7 @@ public class MainHttpUtil { .params("user_login", phoneNum) .params("user_pass", pwd) .params("pushid", "") + .params("key1", RongcloudIMManager.RONG_IM_KEY) .params("app_from", "PDL") .params("lastlogindevice", "Android") .params("uuid_Device", uuid) @@ -256,6 +258,7 @@ public class MainHttpUtil { */ public static void getBaseInfo(String uid, String token, final CommonCallback commonCallback) { HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -290,6 +293,7 @@ public class MainHttpUtil { public static void getBaseInfos(String uid, String token, HttpCallback callback) { HttpClient.getInstance().get("User.getBaseInfos", MainHttpConsts.GET_BASE_INFO) + .params("key1", RongcloudIMManager.RONG_IM_KEY) .execute(callback); } 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 @@