99 lines
5.5 KiB
Java
99 lines
5.5 KiB
Java
package com.shayu.onetoone.utils;
|
|
|
|
import android.content.Context;
|
|
import android.util.Log;
|
|
import android.view.View;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import com.yunbao.common.CommonAppConfig;
|
|
import com.yunbao.common.manager.IMLoginManager;
|
|
import com.yunbao.common.utils.WordUtil;
|
|
|
|
import java.util.Locale;
|
|
|
|
public class HtmlUrlUtils {
|
|
public static final int URL_PAY_COIN = 0;
|
|
public static final int URL_PAY_GOLD = 1;
|
|
public static final int URL_PAY_BEAN = 2;
|
|
|
|
/**
|
|
* 获取支付链接
|
|
*
|
|
* @param isFirst 是否为首充
|
|
* @param type 类型 URL_PAY_COIN/URL_PAY_GOLD/URL_PAY_BEAN
|
|
*/
|
|
public static String getPayUrl(Context mContext, boolean isFirst, int type) {
|
|
if (isFirst) {
|
|
Log.i("tss", "首充");
|
|
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
|
switch (type) {
|
|
case URL_PAY_COIN:
|
|
return 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=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_GOLD:
|
|
return 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=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_BEAN:
|
|
return 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=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
}
|
|
} else {
|
|
switch (type) {
|
|
case URL_PAY_COIN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_GOLD:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_BEAN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
}
|
|
}
|
|
} else {
|
|
if (!CommonAppConfig.IS_GOOGLE_PLAY) {
|
|
Log.i("tss", "不是首充");
|
|
//链接版本
|
|
switch (type) {
|
|
case URL_PAY_COIN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_GOLD:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_BEAN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
}
|
|
} else {
|
|
switch (type) {
|
|
case URL_PAY_COIN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_GOLD:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
case URL_PAY_BEAN:
|
|
return CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static String getQAUrl() {
|
|
return CommonAppConfig.HOST + "/h5/FAQ/index.html?t=1";
|
|
}
|
|
|
|
/**
|
|
* 用户协议
|
|
*/
|
|
public static String getUserAgreement() {
|
|
return CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=674";
|
|
}
|
|
|
|
/**
|
|
* 服务协议
|
|
*/
|
|
public static String getServerAgreement() {
|
|
return CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=675";
|
|
}
|
|
|
|
/**
|
|
* 收益说明
|
|
*/
|
|
public static String getArnInfo() {
|
|
return CommonAppConfig.HOST + "/index.php?g=portal&m=page&a=index&id=676";
|
|
}
|
|
}
|