This commit is contained in:
18142669586 2022-09-27 14:53:01 +08:00
parent f52e10b96f
commit 2490c6bdd1
3 changed files with 102 additions and 4 deletions

View File

@ -40,5 +40,17 @@
android:tint="@color/textColor"
android:visibility="gone" />
<TextView
android:id="@+id/rView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="13sp"
android:layout_marginRight="25dp"
android:text="充值未到账?"
android:visibility="gone"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>

View File

@ -15,6 +15,7 @@ import android.view.animation.DecelerateInterpolator;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

View File

@ -3,23 +3,34 @@ package com.yunbao.main.activity;
import android.content.Context;
import android.graphics.Color;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.TextView;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.SkuDetails;
import com.facebook.appevents.AppEventsConstants;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.GoogleBillingUtil;
import com.yunbao.common.utils.OnGoogleBillingListener;
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.utils.HXLinePagerIndicator;
@ -37,16 +48,80 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorT
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import java.util.List;
import java.util.Locale;
@Route(path = RouteUtil.PATH_COIN)
public class MyWalletActivity extends AbsActivity {
ViewPager vp_content;
static MyWalletActivity mw;
Fragment[] fragments = null;
String TAG = "GooglePay";
@Override
protected int getLayoutId() {
return R.layout.activity_my_wallet;
}
private GoogleBillingUtil googleBillingUtil;
private OnGoogleBillingListener mOnMyGoogleBillingListener=new OnGoogleBillingListener(){
@Override
public void onSetupSuccess(boolean isSelf) {
super.onSetupSuccess(isSelf);
Log.d(TAG,"内购服务初始化完成");
}
@Override
public void onQuerySuccess(@NonNull String skuType, @NonNull List<SkuDetails> list, boolean isSelf) {
}
@Override
public boolean onPurchaseSuccess(@NonNull Purchase purchase, boolean isSelf) {
StringBuffer tempBuffer =new StringBuffer();
return true ;//自动消耗(只有当isSelf为true,并且支付状态为PURCHASED时该值才会生效)
}
@Override
public boolean onRecheck(@NonNull String skuType, @NonNull Purchase purchase, boolean isSelf) {
StringBuffer tempBuffer =new StringBuffer();
tempBuffer.append("检测到未处理的订单($skuType):${purchase.sku}()");
Log.d(TAG,tempBuffer.toString());
return true;
}
@Override
public void onBillingServiceDisconnected() {
super.onBillingServiceDisconnected();
}
@Override
public void onConsumeSuccess(@NonNull String purchaseToken, boolean isSelf) {
Log.d(TAG,"消耗商品成功:$purchaseToken");
}
@Override
public void onAcknowledgePurchaseSuccess(boolean isSelf) {
Log.d(TAG,"确认购买商品成功");
}
@Override
public void onFail(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, int responseCode, boolean isSelf) {
Log.d(TAG,"操作失败:tag=${" + tag.name() + "responseCode=" + responseCode);
}
@Override
public void onError(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, boolean isSelf) {
Log.d(TAG,"发生错误:tag="+tag.name());
}
};
@Override
protected void main() {
@ -59,6 +134,14 @@ public class MyWalletActivity extends AbsActivity {
logger.logEvent("FB_initiated_checkout");
vp_content = (ViewPager)findViewById(R.id.vp_content);
TextView rView = (TextView) findViewById(R.id.rView);
rView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
final String[] titles = {WordUtil.getString(R.string.diamond), WordUtil.getString(R.string.coins),WordUtil.getString(R.string.golden_beans)};
if(getIntent().getStringExtra("tag")!=null) {
Log.i("tss","首充");
@ -67,8 +150,9 @@ public class MyWalletActivity extends AbsActivity {
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
// fragments = new Fragment[]{new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
}else{
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()),
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()),
rView.setVisibility(View.VISIBLE);
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
}
}else{
@ -77,8 +161,9 @@ public class MyWalletActivity extends AbsActivity {
//链接版本
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
}else{
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()),
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()),
rView.setVisibility(View.VISIBLE);
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
}
}