Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
cyh 2024-08-28 19:29:27 +08:00
commit 8400ecebc9
8 changed files with 120 additions and 8 deletions

View File

@ -10,6 +10,7 @@ import android.content.pm.PackageManager
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
@ -44,7 +45,6 @@ import com.yingmao.clash.entity.CheckLoginRsp
import com.yingmao.clash.fragment.NewAccFragment import com.yingmao.clash.fragment.NewAccFragment
import com.yingmao.clash.fragment.mine.MineFragment import com.yingmao.clash.fragment.mine.MineFragment
import com.yingmao.clash.fragment.recharge.BackupRechargeActivity import com.yingmao.clash.fragment.recharge.BackupRechargeActivity
import com.yingmao.clash.fragment.recharge.RechargeFragment
import com.yingmao.clash.listener.DownLoadListener import com.yingmao.clash.listener.DownLoadListener
import com.yingmao.clash.net.http.HttpApi import com.yingmao.clash.net.http.HttpApi
import com.yingmao.clash.net.http.HttpReqType import com.yingmao.clash.net.http.HttpReqType
@ -84,7 +84,8 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody import okhttp3.RequestBody
import java.io.File import java.io.File
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.Date
import java.util.UUID
class NewMainActivity : BaseActivity() { class NewMainActivity : BaseActivity() {
@ -220,8 +221,28 @@ class NewMainActivity : BaseActivity() {
startLog() startLog()
// showBindAccount() // showBindAccount()
firstEntry()
}
private fun firstEntry() {
val decodeBool =
MMKV.defaultMMKV().decodeBool(BZYConstants.INITIALIZATION, true)
if ((decodeBool)) {
MaterialDialog(this).show {
cornerRadius(res = R.dimen.dp_10)
customView(
R.layout.first_entry_layout,
scrollable = false,
noVerticalPadding = true,
horizontalPadding = false
)
getCustomView().findViewById<TextView>(R.id.determine).setOnClickListener {
MMKV.defaultMMKV().encode(BZYConstants.INITIALIZATION, false)
dismiss()
}
} }
}
}
private fun startLog() { private fun startLog() {
launch(Dispatchers.IO) { launch(Dispatchers.IO) {

View File

@ -376,6 +376,11 @@ class SplashActivity : BaseActivity() {
val encryPsw = AESUtil.byteArrayToHexStr( val encryPsw = AESUtil.byteArrayToHexStr(
AESUtil.encrypt(BZYConstants.defaultPassword) AESUtil.encrypt(BZYConstants.defaultPassword)
) )
val decodeBool =
MMKV.defaultMMKV().decodeBool(BZYConstants.INITIALIZATION, false)
if (decodeBool) {
MMKV.defaultMMKV().encode(BZYConstants.INITIALIZATION, true)
}
splashAtyVM.login(encryName, encryPsw) splashAtyVM.login(encryName, encryPsw)
} else if (code == "20062") { } else if (code == "20062") {
message?.let { message?.let {

View File

@ -102,5 +102,6 @@ class BZYConstants {
const val GoSeaShareUrl = "https://reg.cannmaxllc.com/page/register.html?userId=" const val GoSeaShareUrl = "https://reg.cannmaxllc.com/page/register.html?userId="
const val BackHomeShareUrl = "https://38.180.8.92:8080/page/register.html?userId=" const val BackHomeShareUrl = "https://38.180.8.92:8080/page/register.html?userId="
// const val shareTextHost = "嗨,一个稳定好用的加速器,打开链接注册免费体验吧=> https://38.180.8.92:8080/page/register.html?userId=" // const val shareTextHost = "嗨,一个稳定好用的加速器,打开链接注册免费体验吧=> https://38.180.8.92:8080/page/register.html?userId="
const val INITIALIZATION = "is_initialization"
} }
} }

View File

@ -547,6 +547,8 @@ class RechargeFragment : BaseFragment() {
} }
private fun orderPayment(data: Trade) { private fun orderPayment(data: Trade) {
val jhPay = data.payType?.get(0)?.payChannel
val kjPay = data.payType?.get(2)?.payChannel
activity?.let { activity?.let {
MaterialDialog(it).show { MaterialDialog(it).show {
this.cancelable(true) this.cancelable(true)
@ -557,17 +559,45 @@ class RechargeFragment : BaseFragment() {
noVerticalPadding = true, noVerticalPadding = true,
horizontalPadding = false horizontalPadding = false
) )
if (jhPay != null) {
findViewById<TextView>(R.id.JUhePay).text = jhPay
}
if (kjPay != null) {
findViewById<TextView>(R.id.KJPay).text = kjPay
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivAlipay).setOnClickListener { getCustomView().findViewById<AppCompatImageView>(R.id.ivAlipay).setOnClickListener {
val payModel = data.payType?.get(0)?.payModel
val payType = data.payType?.get(0)?.payType
val payParam = data.payType?.get(0)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 10, 1, "ip@影猫充值") viewModel.orderPayment(data, 10, 1, "ip@影猫充值")
} }
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivWechatPay) getCustomView().findViewById<AppCompatImageView>(R.id.ivWechatPay)
.setOnClickListener { .setOnClickListener {
val payModel = data.payType?.get(1)?.payModel
val payType = data.payType?.get(1)?.payType
val payParam = data.payType?.get(1)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 10, 2, "ip@影猫充值") viewModel.orderPayment(data, 10, 2, "ip@影猫充值")
} }
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivQuickPayment) getCustomView().findViewById<AppCompatImageView>(R.id.ivQuickPayment)
.setOnClickListener { .setOnClickListener {
val payModel = data.payType?.get(2)?.payModel
val payType = data.payType?.get(2)?.payType
val payParam = data.payType?.get(2)?.payParam
if (payModel != null && payType != null && payParam != null) {
viewModel.orderPayment(data, payModel, payType, payParam)
} else {
viewModel.orderPayment(data, 11, 1, "ip@影猫充值") viewModel.orderPayment(data, 11, 1, "ip@影猫充值")
} }
}
getCustomView().findViewById<AppCompatImageView>(R.id.ivBack).setOnClickListener { getCustomView().findViewById<AppCompatImageView>(R.id.ivBack).setOnClickListener {
dismiss() dismiss()
} }

View File

@ -24,7 +24,8 @@ data class PayRsp(
data class Trade( data class Trade(
@field:SerializedName("payUrl") @field:SerializedName("payUrl")
var payUrl: String? = null, var payUrl: String? = null,
@field:SerializedName("payType")
var payType: List<PayType>? = null,
@field:SerializedName("totalFee") @field:SerializedName("totalFee")
val totalFee: String? = null, val totalFee: String? = null,
@ -42,6 +43,22 @@ data class Trade(
} }
} }
data class PayType(
@field:SerializedName("id")
var id: Int? = null,
@field:SerializedName("templateId")
var templateId: Int? = null,
@field:SerializedName("payModel")
var payModel: Int? = null,
@field:SerializedName("payChannel")
var payChannel: String? = null,
@field:SerializedName("payType")
var payType: Int? = null,
@field:SerializedName("payParam")
var payParam: String? = null,
@field:SerializedName("payOrder")
var payOrder: Int? = null,
)
//汇旺财 //汇旺财
data class QRPayRsp(@field:SerializedName("msg") data class QRPayRsp(@field:SerializedName("msg")
val msg: String? = null, val msg: String? = null,

View File

@ -26,7 +26,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
> >
<TextView <TextView
android:id="@+id/textView" android:id="@+id/JUhePay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp" android:textSize="17sp"
@ -73,7 +73,7 @@
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
> >
<TextView <TextView
android:id="@+id/textView2" android:id="@+id/KJPay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="17sp" android:textSize="17sp"

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/recharge_user_info_bg"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvFirstEntry"
android:textStyle="bold"
android:gravity="center"
android:textSize="18sp"
android:textColor="@color/white"
android:text="@string/firstEntry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp" />
<TextView
android:id="@+id/determine"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_marginStart="50dp"
android:layout_marginBottom="20dp"
android:background="@drawable/cancel_btn_bg_selector"
android:gravity="center"
android:paddingLeft="20dp"
android:paddingTop="@dimen/dp_10"
android:paddingRight="20dp"
android:paddingBottom="@dimen/dp_10"
android:text="@string/determine"
android:textColor="@color/white" />
</LinearLayout>

View File

@ -392,4 +392,6 @@
<string name="vertify_failed">验证失败,还剩%d次机会</string> <string name="vertify_failed">验证失败,还剩%d次机会</string>
<string name="aggregatePayment">聚合支付(推荐)</string> <string name="aggregatePayment">聚合支付(推荐)</string>
<string name="quickPayment">快捷支付</string> <string name="quickPayment">快捷支付</string>
<string name="firstEntry">免费时长已赠送,如果出现初始化,请等待一分钟后关闭app重新打开</string>
<string name="determine">确定</string>
</resources> </resources>