Commit 40dbb673 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

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