feat:完成mycard支付结果回调处理

This commit is contained in:
Max
2024-02-01 14:54:32 +08:00
parent 4475d622fd
commit 3e4d9654c9
2 changed files with 73 additions and 0 deletions

View File

@@ -355,6 +355,24 @@
android:name=".ui.webview.CommonWebViewActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.wallet.PaymentResultActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/transparent_activity"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="payment"
android:path="/result"
android:scheme="pekoapp" />
</intent-filter>
</activity>
<activity
android:name=".ui.webview.SimpleWebViewActivity"
android:screenOrientation="portrait" />

View File

@@ -0,0 +1,55 @@
package com.yizhuan.erban.ui.wallet
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.chuhai.utils.log.ILog
import com.yizhuan.erban.application.XChatApplication
import com.yizhuan.erban.other.activity.SplashActivity
import com.yizhuan.xchat_android_core.auth.AuthModel
import com.yizhuan.xchat_android_core.pay.PayModel
/**
* Created by Max on 2024/1/31 10:50
* Desc:
**/
class PaymentResultActivity : Activity(), ILog {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
logD("onCreate()")
handler(intent)
}
private fun handler(intent: Intent?) {
val uri = intent?.data
logD("handler() uri:${uri}")
if (XChatApplication.gStack.activityNum == 1) {
logD("handler() open->splash")
SplashActivity.start(this)
finish()
} else {
val status = uri?.getQueryParameter("status")?.toIntOrNull()
logD("handler() status:$status")
if (status == 1) {
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
}
}
finish()
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
logD("onNewIntent()")
handler(intent)
}
override fun onDestroy() {
super.onDestroy()
logD("onDestroy()")
}
override fun getLogTag(): String {
return super.getLogTag()
}
}