Commit e6050513 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 478c7a21
......@@ -104,7 +104,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
if (!UserManager.getInstance().alipaySet) {
// 去授权
showToast("发起支付宝授权..")
showToast("支付宝拉起授权")
AlipayAuthManager.authV2(this@NineActivity,
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
......@@ -266,7 +266,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
if (!UserManager.getInstance().alipaySet) {
// 去授权
showToast("发起支付宝授权..")
showToast("支付宝拉起授权")
AlipayAuthManager.authV2(this@NineActivity,
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
......
......@@ -180,9 +180,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
private fun adCloseNext(carrierType: String) {
when (carrierType) {
Constant.CARRIERTYPE_REWARD_FIRST -> {
val tempCoin = userInfo?.rewardCoin ?: 0
Handler(Looper.getMainLooper()).postDelayed({
if (tempCoin == 0) {
tv_cash.text = "18.88元"
ConsumerToastUtil.showAwardText(requireContext(), userInfo?.rewardCoin ?: 0, 0)
}
ConsumerToastUtil.showAwardText(requireContext(), tempCoin, 0)
Handler(Looper.getMainLooper()).postDelayed({
addAnimation(iv_main_tempanim, iv_cash, R.mipmap.ic_redpkg)
Handler(Looper.getMainLooper()).postDelayed({
......@@ -196,7 +199,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}, 300)
}, 1400)
Handler(Looper.getMainLooper()).postDelayed({
if (tempCoin == 0) {
tv_cash.text = "18.88元"
}
showSignDialog()
}, 2000)
}, 300)
......@@ -516,13 +521,30 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
R.id.tv_sign_withdraw -> {
userInfo?.let {
if (!it.isAlipaySet) {
showToast("发起支付宝授权..")
showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
showToast("支付宝授权成功")
Handler(Looper.getMainLooper()).postDelayed({
dialog?.dismiss()
val bundle = Bundle()
if (signMsg != null) {
val signWeekCashArr = signMsg!!.signWeekCashArr
val cash =
signWeekCashArr[signMsg!!.signDay - 1]
bundle.putString(
LoadingActivity.TEXT,
"${cash}元现金马上到账"
)
}
readyGo(LoadingActivity::class.java, bundle)
Handler(Looper.getMainLooper()).postDelayed({
showAd(Constant.CARRIERTYPE_SIGN)
}, 2500)
}, 500)
}
override fun authFail(resultStatus: String) {
......
......@@ -111,7 +111,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
// )
if (!UserManager.getInstance().alipaySet) {
// 去授权
showToast("发起支付宝授权..")
showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
......
......@@ -200,7 +200,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), DrawCashView, DrawCashAdapter.O
// 2、授权支付宝
if (!alipayStatus) {
// 去授权
showToast("发起支付宝授权..")
showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener {
override fun authSuccess() {
......
......@@ -61,6 +61,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="14sp" />
......@@ -87,6 +88,7 @@
android:layout_alignEnd="@id/pb"
android:gravity="center"
android:text="10/100"
android:textStyle="bold"
android:textColor="@color/white"
android:textSize="12sp" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment