1.删除采集用户开启时长定时接口
 2.更改支付界面提示词
 3.更改支付弹窗UI样式
 4.新增蓝海支付支持
This commit is contained in:
level 2025-08-25 17:36:28 +08:00
parent cc9166e893
commit 9c92506343
16 changed files with 153 additions and 113 deletions

View File

@ -169,7 +169,6 @@
android:process=":background"
android:screenOrientation="portrait"
/>
<service android:name=".service.ConnectionService"/>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"

View File

@ -364,7 +364,7 @@ class ChangeNodeActivity : BaseActivity(), View.OnClickListener {
}
testRuning = false
runOnUiThread { updateMoreBar("线路测速") }
var newDatas = mutableListOf<ClashNodebBean>();
var newDatas = mutableListOf<ClashNodebBean>()
group?.proxies?.forEach { proxy ->
Log.d("node==>${proxy}")
if (currentNode?.isNotEmpty() == true) {

View File

@ -14,6 +14,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.net.toUri
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
@ -64,6 +65,7 @@ import com.yingmao.clash.view.dialog.SplashDialog
import com.yingmao.clash.vm.MainAtyVM
import com.yingmao.clash.webview.BZYWebViewKeFu
import com.yingmao.clash.webview.CustomerServiceWebView
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
@ -225,7 +227,41 @@ class MemberRechargeActivity : BaseActivity() {
RxToast.error(if (rsp.message.isNullOrBlank()) resources.getString(R.string.OrderGenerationFailed)+"${rsp.code}" else "${rsp.code}:${rsp.message}")
} else {
if (rsp.data != null) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(rsp.data.payUrl)))
when (rsp.data.payModel) {
1000 -> {
val orderInfo = rsp.data.appFormat
CoroutineScope(Dispatchers.IO).launch {
val alipay = PayTask(this@MemberRechargeActivity)
val result = alipay.payV2(orderInfo, true)
android.util.Log.i("payResult", "result::$result")
launch(Dispatchers.Main) {
val resultStatus = result["resultStatus"]
val memo = result["memo"]
if (resultStatus == "9000") {
MaterialDialog(this@MemberRechargeActivity).show {
this.cancelable(true)
cornerRadius(res = R.dimen.dp_15)
customView(
R.layout.pay_sure_dialog_layout,
scrollable = false,
noVerticalPadding = true,
horizontalPadding = false
)
val tvSure = findViewById<TextView>(R.id.tvSure)
tvSure.setOnClickListener {
dismiss()
}
}
} else {
RxToast.info(resources.getString(R.string.PayError)+memo)
}
}
}
}
0->{
startActivity(Intent(Intent.ACTION_VIEW, rsp.data.payUrl?.toUri()))
}
}
}
}
}
@ -518,6 +554,7 @@ class MemberRechargeActivity : BaseActivity() {
val payType = rcEntity?.payType ?: 0
val payParam = rcEntity?.payParam ?: ""
viewModel.orderPayment(data, payModel, payType, payParam)
dismiss()
}
}

View File

@ -21,7 +21,7 @@ import java.util.ArrayList
open class PublicViewMode : BaseViewMode() {
fun getHost(callback: AsyncCallback) {
val rt =
NetService.instances.createFreeBaseUrl("https://yingmao.oss-cn-hongkong.aliyuncs.com/")
NetService.instances.createFreeBaseUrl("https://pubtofile.oss-cn-hongkong.aliyuncs.com/")
doAsyncNoNeedReturn(HttpReqType.GET_HOST) {
try { //TODO bug 会引起崩溃
val host = when {

View File

@ -43,7 +43,6 @@ import com.yingmao.clash.net.http.HttpReqType
import com.yingmao.clash.net.http.HttpStatus
import com.yingmao.clash.net.http.entity.AppStartupStatus
import com.yingmao.clash.net.http.entity.ExpensesRecordRsp
import com.yingmao.clash.service.ConnectionService
import com.yingmao.clash.util.ActivityResultLifecycle
import com.yingmao.clash.util.UiStore
import com.yingmao.clash.util.Utils
@ -650,16 +649,6 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
}
}
}
private val resultReceiver: ResultReceiver = object : ResultReceiver(null) {
override fun onReceiveResult(resultCode: Int, resultData: Bundle) {
val data = resultData.getString("data")
Log.d("ping to from Service: $data")
if(connectId!=-1){
Log.d("activity connectId: $connectId")
accelerateViewModel.appUpStatus(connectId)
}
}
}
override fun httpLoading(httpStatus: HttpStatus.Loading) {
}
@ -671,23 +660,11 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
if(dataInfo.data!=null){
if(dataInfo.data.id!=null){
connectId= dataInfo.data.id
val serviceIntent= Intent(requireContext(), ConnectionService::class.java)
serviceIntent.putExtra("receiver",resultReceiver)
val serviceRunning =
Utils.isServiceRunning(requireContext(), ConnectionService::class.java)
android.util.Log.i("AppStartupStatus","data::"+serviceRunning)
if(!serviceRunning){
requireContext().startService(serviceIntent)
}
}
}
}
HttpReqType.AppStopStatus ->{
Log.d("AppStopStatus is Success ${httpStatus.rsp}")
val serviceIntent= Intent(requireContext(), ConnectionService::class.java)
requireContext().stopService(serviceIntent)
}
HttpReqType.EXPENSES_RECORD->{
if(httpStatus.rsp is ExpensesRecordRsp){
@ -727,16 +704,6 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
}
}
}
override fun onDestroy() {
super.onDestroy()
val serviceRunning =
Utils.isServiceRunning(requireContext(), ConnectionService::class.java)
if(serviceRunning){
val serviceIntent= Intent(requireContext(), ConnectionService::class.java)
requireContext().stopService(serviceIntent)
}
}
fun showLoading(str: String, context: Context) {
val message = if (TextUtils.isEmpty(str)) "进行中..." else str
if (baseLoading == null) {

View File

@ -36,7 +36,11 @@ data class Trade(
val rechargeDays: String? = null,
@field:SerializedName("userId")
val userId: String? = null
val userId: String? = null,
@field:SerializedName("app_format")
val appFormat: String? = null,
@field:SerializedName("payModel")
val payModel: Int=0
){
override fun toString(): String {
return "Trade(totalFee=$totalFee, outTradeNo=$outTradeNo, rechargeDays=$rechargeDays, userId=$userId,payUrl=$payUrl)"

View File

@ -1,61 +0,0 @@
package com.yingmao.clash.service;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.ResultReceiver;
import android.util.Log;
import com.yingmao.clash.fragment.AccelerateViewModel;
public class ConnectionService extends Service {
private static final String TAG = "TimerService";
private static final long INTERVAL_MILLIS = 60000; // 60
private Handler handler = new Handler();
private Intent intent;
private Runnable runnable = new Runnable() {
@Override
public void run() {
if(intent!=null){
ResultReceiver receiver = intent.getParcelableExtra("receiver");
if (receiver != null) {
Bundle resultData = new Bundle();
resultData.putString("ping", "ping to Service!");
receiver.send(1, resultData); // 1 是结果码
}
}
handler.postDelayed(this, INTERVAL_MILLIS);
}
};
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "Service onCreate");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, "Service onStartCommand");
this.intent=intent;
handler.post(runnable); // 启动定时器
return START_STICKY; // 服务被杀死后会自动重启
}
@Override
public void onDestroy() {
super.onDestroy();
handler.removeCallbacks(runnable); // 停止定时器
Log.d(TAG, "Service onDestroy");
}
@Override
public IBinder onBind(Intent intent) {
Log.d(TAG, "Service onBind");
return null; // 如果不支持绑定服务返回 null
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#BFD5D5D5">
<item android:id="@android:id/mask"
android:drawable="@color/white">
<!-- mask 的 drawable 如果不设置 会报错哦!-->
</item>
<item >
<shape android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<stroke android:color="@color/blue_4072FE" android:width="1dp"/>
<corners android:radius="24dp"/>
</shape>
</item>
</ripple>

View File

@ -5,6 +5,6 @@
android:drawable="@color/translate"/>
<item
android:state_pressed="true"
android:drawable="@color/black_262c46">
android:drawable="@color/click_bg">
</item>
</selector>

View File

@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:background="@drawable/press_effect_back"
android:background="@drawable/press_effect"
app:srcCompat="@drawable/ic_mode_black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -10,49 +10,55 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:background="@drawable/oc_language_bg"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/oc_language_bg"
>
<TextView
android:id="@+id/KJPay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:paddingTop="10dp"
android:textColor="#FF8A04"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="@color/black"
android:textStyle="bold"
android:text="@string/quickPayment" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:paddingBottom="20dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:gravity="center"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivQuickPayment"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="@drawable/press_effect"
android:layout_marginStart="20dp"
android:padding="5dp"
android:visibility="gone"
app:srcCompat="@drawable/alipay" />
app:srcCompat="@drawable/alipay"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivQPWechatPay"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_weight="1"
android:background="@drawable/press_effect"
android:padding="5dp"
android:visibility="gone"
android:layout_marginStart="20dp"
app:srcCompat="@drawable/wechat" />
</LinearLayout>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/translate"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@drawable/activity_bg"
>
<TextView
android:id="@+id/tvShowContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/payDelayStr"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="20dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:textSize="15sp"
android:textColor="@color/black"
android:textStyle="normal"
/>
<TextView
android:id="@+id/tvSure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tvShowContent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/AlreadyKnown"
android:paddingStart="40dp"
android:paddingEnd="40dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="@drawable/pay_sure_click_effect"
android:textColor="@color/blue_4072FE"
android:textSize="16sp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -401,5 +401,8 @@ Service Description\n
<string name="LoginOut">It is detected that the current account is logged in on other devices. If it is not your own operation, please change the password immediately and log out of the unfamiliar device.</string>
<string name="tooFast">The application is initializing. Please wait for 1~2 seconds and try again.</string>
<string name="Starting">Starting</string>
<string name="PaySuccessful">PaySuccessful</string>
<string name="PayError">PayError:</string>
<string name="payDelayStr">\u3000\u3000Your payment order has been successfully completed and is currently being processed by the platform. There is typically a delay of several seconds before your funds arrive, so please wait. If you returned to the app homepage, we recommend waiting a moment and then manually refreshing the page to update the status. If your funds still have not arrived after a few minutes, please contact customer service. Thank you for your support and trust</string>
<string name="AlreadyKnown">Already Known</string>
</resources>

View File

@ -391,4 +391,8 @@
<string name="LoginOut">檢測到當前賬號在其他設備登錄,如非本人操作,請立即修改密碼並退出陌生設備。</string>
<string name="tooFast">應用初始化中,請等待1~2秒後重試</string>
<string name="Starting">啟動中</string>
<string name="PaySuccessful">支付成功</string>
<string name="PayError">支付失敗:</string>
<string name="payDelayStr">\u3000\u3000您的支付訂單已成功完成目前平台正在處理中。通常情況下到帳會有幾秒鐘的延遲請您稍作等待。如您已返回應用程式首頁建議等待片刻後手動刷新頁面以便更新狀態。若幾分鐘後仍未到賬請及時聯絡客服人員為您處理。感謝您的支持與信任</string>
<string name="AlreadyKnown">已知晓</string>
</resources>

View File

@ -389,4 +389,8 @@
<string name="LoginOut">檢測到當前賬號在其他設備登錄,如非本人操作,請立即修改密碼並退出陌生設備。</string>
<string name="tooFast">應用初始化中,請等待1~2秒後重試</string>
<string name="Starting">啟動中</string>
<string name="PaySuccessful">支付成功</string>
<string name="PayError">支付失敗:</string>
<string name="payDelayStr">\u3000\u3000您的支付訂單已成功完成目前平台正在處理中。通常情況下到帳會有幾秒鐘的延遲請您稍作等待。如您已返回應用程式首頁建議等待片刻後手動刷新頁面以便更新狀態。若幾分鐘後仍未到賬請及時聯絡客服人員為您處理。感謝您的支持與信任</string>
<string name="AlreadyKnown">已知晓</string>
</resources>

View File

@ -417,4 +417,8 @@
<string name="tooFast">应用初始化中,请等待1~2秒后重试</string>
<string name="Starting">启动中</string>
<string name="yijianlian">一键连</string>
<string name="PaySuccessful">支付成功</string>
<string name="PayError">支付失败:</string>
<string name="payDelayStr">\u3000\u3000您的支付订单已成功完成目前平台正在处理中。通常情况下到账会有几秒钟的延迟请您稍作等待。如您已返回应用首页建议等待片刻后手动刷新页面以便更新状态。若几分钟后仍未到账请及时联系客服人员为您处理。感谢您的支持与信任</string>
<string name="AlreadyKnown">已知晓</string>
</resources>