Commit 40dbb673 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 12ff6164
...@@ -172,6 +172,7 @@ class VipPresenter : BasePresenter<VipView>() { ...@@ -172,6 +172,7 @@ class VipPresenter : BasePresenter<VipView>() {
val code: Int = baseResponse.getStatus() val code: Int = baseResponse.getStatus()
when (code) { when (code) {
200 -> { 200 -> {
getMyInfo()
view.getVipProductSuc(baseResponse.data) view.getVipProductSuc(baseResponse.data)
} }
else -> { else -> {
......
...@@ -406,8 +406,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -406,8 +406,11 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
private fun initRvView() { private fun initRvView() {
if (vipList != null && vipList!!.size > 0) { if (vipList != null && vipList!!.size > 0) {
val gridLayoutManager = GridLayoutManager(this, 3) // val gridLayoutManager = GridLayoutManager(this, 3)
rvVip.layoutManager = gridLayoutManager // rvVip.layoutManager = gridLayoutManager
val layoutManager=LinearLayoutManager(this)
layoutManager.orientation=LinearLayoutManager.HORIZONTAL
rvVip.layoutManager=layoutManager
vipAdapter = VipAdapter(vipList!!) vipAdapter = VipAdapter(vipList!!)
rvVip.adapter = vipAdapter rvVip.adapter = vipAdapter
vipAdapter.setOnItemClickListener(this) vipAdapter.setOnItemClickListener(this)
...@@ -520,7 +523,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -520,7 +523,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} }
}, },
2000 800
) )
} }
}) })
...@@ -801,13 +804,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -801,13 +804,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
AlipayAuthManager.authV2(this@VipActivity, AlipayAuthManager.authV2(this@VipActivity,
object : AlipayAuthManager.AuthListener { object : AlipayAuthManager.AuthListener {
override fun authSuccess() { override fun authSuccess() {
vipPresenter.getMyInfo()
mainHandler.postDelayed({ mainHandler.postDelayed({
alipay(wxParanBean) alipay(wxParanBean)
}, 500) }, 500)
} }
override fun authFail(resultStatus: String) { override fun authFail(resultStatus: String) {
showToast("支付宝登录失败 " + resultStatus) // showToast("支付宝登录失败 " + resultStatus)
} }
}) })
} }
...@@ -823,6 +827,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -823,6 +827,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
"确定", "确定",
object : DialogListener() { object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
dialog?.dismiss()
alipayAuth(wxParanBean) alipayAuth(wxParanBean)
} }
}) })
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
android:id="@+id/rlVipItemRoot" android:id="@+id/rlVipItemRoot"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="150dp" android:layout_height="150dp"
android:layout_margin="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/shape_vip_adapter_none" android:background="@drawable/shape_vip_adapter_none"
android:orientation="vertical"> android:orientation="vertical">
...@@ -21,6 +24,9 @@ ...@@ -21,6 +24,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp" android:layout_marginTop="14dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:gravity="center_horizontal"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" android:textSize="18sp"
tools:text="包年会员" /> tools:text="包年会员" />
......
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