|
@@ -15,9 +15,11 @@ import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
+import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
import gorden.rxbus2.RxBus
|
|
|
import gorden.rxbus2.Subscribe
|
|
|
import gorden.rxbus2.ThreadMode
|
|
|
+import io.reactivex.disposables.Disposable
|
|
|
|
|
|
/**
|
|
|
* 服务套餐
|
|
@@ -39,6 +41,10 @@ class ServicePackageActivity :
|
|
|
private var servicePackageList = mutableListOf<PackageInfoBean>()
|
|
|
private val servicePackageListAdapter by lazy { ServicePackageListAdapter() }
|
|
|
|
|
|
+ private val PERIOD: Long = 10 * 1000
|
|
|
+ private val DELAY = 100
|
|
|
+ private var mDisposable: Disposable? = null
|
|
|
+
|
|
|
override fun initViews() {
|
|
|
binding {
|
|
|
rvTrainingPackage.layoutManager = GridLayoutManager(this@ServicePackageActivity, 3)
|
|
@@ -124,4 +130,18 @@ class ServicePackageActivity :
|
|
|
servicePackageListAdapter.setData(servicePackageList)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询支付状态
|
|
|
+ */
|
|
|
+ @Subscribe(code = RxBusCodes.QueryPaymentStatus, threadMode = ThreadMode.MAIN)
|
|
|
+ fun queryPaymentStatus(orderNo: String) {
|
|
|
+ if (orderNo.isNullOrEmpty().not()) {
|
|
|
+ viewModel.getSelectPayResult(orderNo, fail = {
|
|
|
+ it.toast()
|
|
|
+ }, success = {
|
|
|
+ RxBus.get().send(RxBusCodes.OrderPaymentSuccess)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|