Commit e6050513 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 478c7a21
...@@ -104,7 +104,7 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -104,7 +104,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
if (!UserManager.getInstance().alipaySet) { if (!UserManager.getInstance().alipaySet) {
// 去授权 // 去授权
showToast("发起支付宝授权..") showToast("支付宝拉起授权")
AlipayAuthManager.authV2(this@NineActivity, AlipayAuthManager.authV2(this@NineActivity,
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
...@@ -266,7 +266,7 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -266,7 +266,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
if (!UserManager.getInstance().alipaySet) { if (!UserManager.getInstance().alipaySet) {
// 去授权 // 去授权
showToast("发起支付宝授权..") showToast("支付宝拉起授权")
AlipayAuthManager.authV2(this@NineActivity, AlipayAuthManager.authV2(this@NineActivity,
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
......
...@@ -180,9 +180,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -180,9 +180,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
private fun adCloseNext(carrierType: String) { private fun adCloseNext(carrierType: String) {
when (carrierType) { when (carrierType) {
Constant.CARRIERTYPE_REWARD_FIRST -> { Constant.CARRIERTYPE_REWARD_FIRST -> {
val tempCoin = userInfo?.rewardCoin ?: 0
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
tv_cash.text = "18.88元" if (tempCoin == 0) {
ConsumerToastUtil.showAwardText(requireContext(), userInfo?.rewardCoin ?: 0, 0) tv_cash.text = "18.88元"
}
ConsumerToastUtil.showAwardText(requireContext(), tempCoin, 0)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
addAnimation(iv_main_tempanim, iv_cash, R.mipmap.ic_redpkg) addAnimation(iv_main_tempanim, iv_cash, R.mipmap.ic_redpkg)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
...@@ -196,7 +199,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -196,7 +199,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}, 300) }, 300)
}, 1400) }, 1400)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
tv_cash.text = "18.88元" if (tempCoin == 0) {
tv_cash.text = "18.88元"
}
showSignDialog() showSignDialog()
}, 2000) }, 2000)
}, 300) }, 300)
...@@ -516,13 +521,30 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -516,13 +521,30 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
R.id.tv_sign_withdraw -> { R.id.tv_sign_withdraw -> {
userInfo?.let { userInfo?.let {
if (!it.isAlipaySet) { if (!it.isAlipaySet) {
showToast("发起支付宝授权..") showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(), AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
showToast("支付宝授权成功") 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) { override fun authFail(resultStatus: String) {
......
...@@ -111,7 +111,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -111,7 +111,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
// ) // )
if (!UserManager.getInstance().alipaySet) { if (!UserManager.getInstance().alipaySet) {
// 去授权 // 去授权
showToast("发起支付宝授权..") showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(), AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
......
...@@ -200,7 +200,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), DrawCashView, DrawCashAdapter.O ...@@ -200,7 +200,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), DrawCashView, DrawCashAdapter.O
// 2、授权支付宝 // 2、授权支付宝
if (!alipayStatus) { if (!alipayStatus) {
// 去授权 // 去授权
showToast("发起支付宝授权..") showToast("支付宝拉起授权")
AlipayAuthManager.authV2(requireActivity(), AlipayAuthManager.authV2(requireActivity(),
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:textStyle="bold"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="14sp" /> android:textSize="14sp" />
...@@ -87,6 +88,7 @@ ...@@ -87,6 +88,7 @@
android:layout_alignEnd="@id/pb" android:layout_alignEnd="@id/pb"
android:gravity="center" android:gravity="center"
android:text="10/100" android:text="10/100"
android:textStyle="bold"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> 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