装扮商城新增充值入口
This commit is contained in:
@@ -52,6 +52,7 @@ class DecorationCommonFragment : BaseViewBindingFragment<FragmentDecorationCommo
|
|||||||
rvDelegate = RVDelegate.Builder<DecorationInfo>()
|
rvDelegate = RVDelegate.Builder<DecorationInfo>()
|
||||||
.setAdapter(decorationAdapter)
|
.setAdapter(decorationAdapter)
|
||||||
.setRecyclerView(binding.recyclerView)
|
.setRecyclerView(binding.recyclerView)
|
||||||
|
.setRefreshLayout(binding.swipeRefresh)
|
||||||
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无装扮"))
|
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无装扮"))
|
||||||
.setLayoutManager(
|
.setLayoutManager(
|
||||||
if (dressType == DecorationStoreActivity.TAB_USER_CARD) {
|
if (dressType == DecorationStoreActivity.TAB_USER_CARD) {
|
||||||
@@ -61,6 +62,9 @@ class DecorationCommonFragment : BaseViewBindingFragment<FragmentDecorationCommo
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
|
binding.swipeRefresh.setOnRefreshListener {
|
||||||
|
decorationViewModel.getDecorationInfoList(dressType)
|
||||||
|
}
|
||||||
decorationViewModel.getDecorationInfoList(dressType)
|
decorationViewModel.getDecorationInfoList(dressType)
|
||||||
decorationViewModel.decorationInfoListLiveData.observe(viewLifecycleOwner) {
|
decorationViewModel.decorationInfoListLiveData.observe(viewLifecycleOwner) {
|
||||||
rvDelegate.loadData(it)
|
rvDelegate.loadData(it)
|
||||||
|
@@ -17,11 +17,18 @@ import com.yizhuan.erban.decoration.view.widgets.CarMagicIndicator
|
|||||||
import com.yizhuan.erban.decoration.view.widgets.MyDecorationMagicIndicator
|
import com.yizhuan.erban.decoration.view.widgets.MyDecorationMagicIndicator
|
||||||
import com.yizhuan.erban.decoration.viewmodel.DecorationViewModel
|
import com.yizhuan.erban.decoration.viewmodel.DecorationViewModel
|
||||||
import com.yizhuan.erban.home.helper.BannerHelper
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
|
import com.yizhuan.erban.ui.pay.ChargeActivity
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
import com.yizhuan.xchat_android_core.Constants
|
import com.yizhuan.xchat_android_core.Constants
|
||||||
import com.yizhuan.xchat_android_core.home.bean.TabInfo
|
import com.yizhuan.xchat_android_core.home.bean.TabInfo
|
||||||
|
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.UpdateWalletInfoEvent
|
||||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||||
|
import com.yizhuan.xchat_android_library.utils.FormatUtils
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import org.greenrobot.eventbus.Subscribe
|
||||||
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
|
|
||||||
@ActLayoutRes(R.layout.activity_decoration_store)
|
@ActLayoutRes(R.layout.activity_decoration_store)
|
||||||
class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreBinding>(),
|
class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreBinding>(),
|
||||||
@@ -47,6 +54,7 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
|
|||||||
private val decorationViewModel: DecorationViewModel by viewModels()
|
private val decorationViewModel: DecorationViewModel by viewModels()
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
EventBus.getDefault().register(this)
|
||||||
initWhiteTitleBar("装扮商城")
|
initWhiteTitleBar("装扮商城")
|
||||||
mTitleBar?.addAction(object : TitleBar.TextAction(
|
mTitleBar?.addAction(object : TitleBar.TextAction(
|
||||||
"我的装扮", Color.parseColor("#999999")
|
"我的装扮", Color.parseColor("#999999")
|
||||||
@@ -57,13 +65,17 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
|
|||||||
})
|
})
|
||||||
mPosition = intent.getIntExtra(Constants.KEY_POSITION, 0)
|
mPosition = intent.getIntExtra(Constants.KEY_POSITION, 0)
|
||||||
initViews()
|
initViews()
|
||||||
decorationViewModel.bannerLiveData.observe(this)
|
decorationViewModel.bannerLiveData.observe(this) {
|
||||||
{
|
|
||||||
BannerHelper.setBanner(binding.rollView, it)
|
BannerHelper.setBanner(binding.rollView, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.tvCharge.setOnClickListener {
|
||||||
|
ChargeActivity.start(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
|
onWalletInfoUpdate(null)
|
||||||
val viewPager = binding.viewpager
|
val viewPager = binding.viewpager
|
||||||
val mMagicIndicator = binding.viewIndicator
|
val mMagicIndicator = binding.viewIndicator
|
||||||
val tabInfoList: MutableList<TabInfo> = ArrayList(5)
|
val tabInfoList: MutableList<TabInfo> = ArrayList(5)
|
||||||
@@ -90,15 +102,6 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
|
|||||||
return DecorationCommonFragment.newInstance(position)
|
return DecorationCommonFragment.newInstance(position)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
viewPager.addOnPageChangeListener(object : SimpleOnPageChangeListener() {
|
|
||||||
override fun onPageSelected(position: Int) {
|
|
||||||
super.onPageSelected(position)
|
|
||||||
if (position == 1) {
|
|
||||||
mMagicIndicator.findViewById<View>(R.id.car_badge_garage).visibility =
|
|
||||||
View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
viewPager.currentItem = mPosition
|
viewPager.currentItem = mPosition
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +109,12 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
|
|||||||
binding.viewpager.currentItem = position
|
binding.viewpager.currentItem = position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
|
||||||
|
binding.tvDiamondNum.text =
|
||||||
|
FormatUtils.formatBigInteger(PayModel.get().currentWalletInfo?.diamondNum ?: 0.0)
|
||||||
|
}
|
||||||
|
|
||||||
override fun needSteepStateBar(): Boolean {
|
override fun needSteepStateBar(): Boolean {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -116,4 +125,10 @@ class DecorationStoreActivity : BaseViewBindingActivity<ActivityDecorationStoreB
|
|||||||
StatusBarUtil.StatusBarLightMode(this)
|
StatusBarUtil.StatusBarLightMode(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
EventBus.getDefault().unregister(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -423,8 +423,9 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
|
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
|
||||||
mBinding.tvDiamondNum.text = PayModel.get().currentWalletInfo?.diamondNum?.toString()
|
mBinding.tvDiamondNum.text =
|
||||||
?: "0"
|
FormatUtils.formatBigInteger(PayModel.get().currentWalletInfo?.diamondNum ?: 0.0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/bg_normal_1c1b22">
|
android:background="@color/bg_normal_1c1b22"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.yizhuan.erban.base.TitleBar
|
<com.yizhuan.erban.base.TitleBar
|
||||||
android:id="@+id/title_bar"
|
android:id="@+id/title_bar"
|
||||||
@@ -16,7 +17,6 @@
|
|||||||
android:id="@+id/fl_roll_view"
|
android:id="@+id/fl_roll_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/title_bar"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||||
@@ -36,14 +36,60 @@
|
|||||||
android:id="@+id/view_indicator"
|
android:id="@+id/view_indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_below="@+id/fl_roll_view"
|
|
||||||
android:layout_marginTop="@dimen/dp_10" />
|
android:layout_marginTop="@dimen/dp_10" />
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:id="@+id/viewpager"
|
android:id="@+id/viewpager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:layout_below="@+id/view_indicator" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
</RelativeLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:baselineAligned="true"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableStart="@drawable/ic_charge_diamond"
|
||||||
|
android:drawablePadding="3dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="我的钻石"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_diamond_num"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="0"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="#ffffbc51"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_charge"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:text="充值"
|
||||||
|
android:background="@drawable/bg_common_confirm"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -22,7 +22,9 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_pic"
|
android:id="@+id/iv_pic"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/view_pic_bg"
|
app:layout_constraintBottom_toBottomOf="@id/view_pic_bg"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@@ -61,7 +61,7 @@ object DecorationModel : BaseModel() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/dress/shop/send")
|
@POST("/dress/shop/give")
|
||||||
fun sendDecoration(
|
fun sendDecoration(
|
||||||
@Field("dressType") dressType: Int,
|
@Field("dressType") dressType: Int,
|
||||||
@Field("dressId") dressId: Int,
|
@Field("dressId") dressId: Int,
|
||||||
|
Reference in New Issue
Block a user