Explorar el Código

feat: 商城 装扮api

tongmengxiao hace 6 meses
padre
commit
8cffdb2b89

+ 13 - 0
baseswago/src/main/java/com/swago/baseswago/inter/UserApi.kt

@@ -4,6 +4,7 @@ import com.swago.baseswago.model.*
 import com.swago.baseswago.model.mine.LevelModel
 import com.swago.baseswago.model.mine.RoomBlackBean
 import com.swago.baseswago.model.mine.RoomBlackModel
+import com.swago.baseswago.model.mine.StoreProductModel
 import com.swago.baseswago.model.mine.TaskModel
 import okhttp3.MultipartBody
 import retrofit2.http.*
@@ -126,4 +127,16 @@ interface UserApi {
     @POST("/v1/user/password/reset")
     suspend fun changePwd(@Field("old_password") old_password: String,@Field("password") password: String,@Field("repeat_password") repeat_password: String):Any
 
+    //商城列表
+    @POST("/v1/user/coin/product/list")
+    suspend fun getProductList(): StoreProductModel
+
+    @FormUrlEncoded
+    @POST("/v1/user/buy/product")
+    suspend fun buyProduct(@Field("product_id") product_id: Long):Any
+
+    @POST("/v1/user/exist/product/list")
+    suspend fun exitProductList():StoreProductModel
+
+
 }

+ 50 - 0
baseswago/src/main/java/com/swago/baseswago/model/mine/StoreProductModel.kt

@@ -0,0 +1,50 @@
+package com.swago.baseswago.model.mine
+
+import android.os.Parcel
+import android.os.Parcelable
+
+data class StoreProductModel(
+    val list: List<StoreItemBean>?
+)
+
+data class StoreItemBean (
+    val product_name: String?,
+    val product_url: String?,
+    val product_category: Int,
+    val product_coin: Long,
+    val id: Long,
+    val product_status: Int
+) :Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt(),
+        parcel.readLong(),
+        parcel.readLong(),
+        parcel.readInt()
+    )
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(product_name)
+        parcel.writeString(product_url)
+        parcel.writeInt(product_category)
+        parcel.writeLong(product_coin)
+        parcel.writeLong(id)
+        parcel.writeInt(product_status)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<StoreItemBean> {
+        override fun createFromParcel(parcel: Parcel): StoreItemBean {
+            return StoreItemBean(parcel)
+        }
+
+        override fun newArray(size: Int): Array<StoreItemBean?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 5 - 0
baseswago/src/main/res/drawable/shape_8c25cb_top_bottom_one_4.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#8C25CB"/>
+    <corners android:topLeftRadius="4dp"  android:bottomRightRadius="4dp"/>
+</shape>

+ 2 - 2
home/src/main/java/com/swago/home/MineFragment.kt

@@ -142,13 +142,13 @@ class MineFragment : BaseXFragment<FragmentMineBinding>() {
 
         binding.tvXStore.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
-                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+                ARouter.getInstance().build(ARouteConstant.User.storeList).withInt("type",1).navigation()
             }
         })
 
         binding.tvXoutfit.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
-                ARouter.getInstance().build(ARouteConstant.User.storeList).navigation()
+                ARouter.getInstance().build(ARouteConstant.User.storeList).withInt("type",2).navigation()
             }
         })
 

+ 6 - 0
home/src/main/res/layout/fragment_mine.xml

@@ -286,6 +286,7 @@
             android:text="@string/level"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXTopUp"
             app:layout_constraintStart_toStartOf="parent"
@@ -300,6 +301,7 @@
             android:text="@string/top_up"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintEnd_toStartOf="@+id/tvXWithdrawal"
             app:layout_constraintStart_toEndOf="@+id/tvXLevel"
@@ -314,6 +316,7 @@
             android:text="@string/withdrawal"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             android:visibility="gone"
             app:layout_constraintEnd_toStartOf="@+id/tvXTaskCenter"
@@ -329,6 +332,7 @@
             android:text="@string/task_center"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             app:layout_constraintStart_toEndOf="@+id/tvXWithdrawal"
             app:layout_constraintEnd_toStartOf="@+id/tvXStore"
@@ -344,6 +348,7 @@
             android:textColor="#131B23"
             android:textSize="12dp"
             android:layout_marginTop="12dp"
+            android:gravity="center"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toEndOf="@+id/tvXTaskCenter"
             app:layout_constraintTop_toTopOf="parent" />
@@ -357,6 +362,7 @@
             android:text="@string/dress_up"
             android:textColor="#131B23"
             android:textSize="12dp"
+            android:gravity="center"
             android:layout_marginTop="12dp"
             android:layout_marginBottom="12dp"
             app:layout_constraintBottom_toBottomOf="parent"

+ 23 - 8
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -3,18 +3,24 @@ package com.swago.user.store
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
+import androidx.activity.viewModels
+import androidx.fragment.app.viewModels
 import com.opensource.svgaplayer.SVGADrawable
 import com.opensource.svgaplayer.SVGAParser
 import com.opensource.svgaplayer.SVGAVideoEntity
 import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.util.NoDoubleClickListener
 import com.swago.user.databinding.DialogStoreDetailBinding
+import com.swago.user.vm.StoreVm
 import java.io.File
 import java.net.URL
 
 class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
+    private val storeVm by viewModels<StoreVm>()
 
     private var svgaParser: SVGAParser? = null
-    var svgaString: String ?= null
+    var storeBean: StoreItemBean ?= null
     init {
         setGravity(Gravity.BOTTOM)
         setDimAmount(0.5f)
@@ -22,10 +28,10 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
     }
 
     companion object{
-        fun newInstance(): StoreBuyDialog {
+        fun newInstance(bean: StoreItemBean): StoreBuyDialog {
             val dialog = StoreBuyDialog()
             val bundle = Bundle()
-//            bundle.putString("svgaString",svgaString)
+            bundle.putParcelable("data" , bean)
             dialog.arguments = bundle
             return dialog
         }
@@ -34,12 +40,14 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
 
     override fun initOther() {
         svgaParser = SVGAParser(activity)
-//        arguments?.let {
-//            svgaString = it.getString("svgaString")
-//        }
-        svgaString?.let {
+        arguments?.let {
+            storeBean = it.getParcelable("data")
+        }
+        storeBean?.let {
+            binding.tvName.text = it.product_name
+            binding.tvCoin.text = "${it.product_coin}"
             svgaParser?.let { svgaParser ->
-                svgaParser.decodeFromURL(URL(it), object : SVGAParser.ParseCompletion{
+                svgaParser.decodeFromURL(URL(it.product_url), object : SVGAParser.ParseCompletion{
                     override fun onComplete(videoItem: SVGAVideoEntity) {
                         val drawable = SVGADrawable(videoItem)
                         binding.svgContent.setImageDrawable(drawable)
@@ -69,6 +77,13 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
     }
 
     override fun initLiveData() {
+        binding.tvBuy.setOnClickListener(object: NoDoubleClickListener(){
+            override fun onClick() {
+                storeBean?.let {
+                    storeVm.buyProduct(it.id)
+                }
 
+            }
+        })
     }
 }

+ 14 - 3
user/src/main/java/com/swago/user/store/StoreItemAdapter.kt

@@ -1,14 +1,25 @@
 package com.swago.user.store
 
+import android.view.View
+import com.bumptech.glide.Glide
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.BaseViewHolder
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.loadUrl
 import com.swago.user.R
+import de.hdodenhof.circleimageview.CircleImageView
 
-class StoreItemAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_store, arrayListOf())  {
-    override fun convert(helper: BaseViewHolder?, item: String?) {
+class StoreItemAdapter(private val type: Int) : BaseQuickAdapter<StoreItemBean, BaseViewHolder>(R.layout.item_store, arrayListOf())  {
+
+    override fun convert(helper: BaseViewHolder?, item: StoreItemBean?) {
         helper?.apply {
+            setVisible(R.id.tvUsing , type != 1)
+            setVisible(R.id.tv_coin , type == 1)
+
             item?.let {
-                setText(R.id.tv_name ,item)
+                setText(R.id.tv_name ,item.product_name)
+                setText(R.id.tv_coin ,"${item.product_coin}")
+                itemView.findViewById<CircleImageView>(R.id.iv_svg).loadUrl(mContext,item.product_url?: "")
             }
 
         }

+ 244 - 14
user/src/main/java/com/swago/user/store/StoreListActivity.kt

@@ -1,13 +1,25 @@
 package com.swago.user.store
 
 import android.graphics.Color
+import android.view.View
+import androidx.activity.viewModels
+import androidx.fragment.app.viewModels
+import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.LinearLayoutManager
+import com.alibaba.android.arouter.facade.annotation.Autowired
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.alibaba.android.arouter.launcher.ARouter
 import com.swago.baseswago.activity.BaseXActivity
 import com.swago.baseswago.constant.ARouteConstant
+import com.swago.baseswago.model.live.audio.PositionBean
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.util.AppContext
 import com.swago.user.R
 import com.swago.user.databinding.ActivityStoreListBinding
+import com.swago.user.vm.StoreVm
 import com.swago.user.vm.TaskVm
+import com.zy.multistatepage.state.EmptyState
+import java.util.concurrent.CopyOnWriteArrayList
 
 /**
  *@date 2022/2/26 13:37
@@ -15,36 +27,254 @@ import com.swago.user.vm.TaskVm
  */
 @Route(path = ARouteConstant.User.storeList)
 class StoreListActivity : BaseXActivity<ActivityStoreListBinding>() {
+    private val storeVm by viewModels<StoreVm>()
 
-    val adapter by lazy {
-        StoreTypeAdapter()
+    @Autowired(required = true)
+    @JvmField
+    var type: Int = 1
+    /**
+     * 入场特效
+     * */
+    private val enterList by lazy {
+        ArrayList<StoreItemBean>()
     }
 
+    val enterAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isEnterExpanded: Boolean = false
+
+    /**
+     * 头像框
+     * */
+    private val avatarList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val avatarAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isAvatarExpanded: Boolean = false
+
+
+    /**
+     * 徽章
+     * */
+    private val badgeList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val badgeAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isBadgeExpanded: Boolean = false
+
+    /**
+     * 聊天气泡
+     * */
+    private val bubbleList by lazy {
+        ArrayList<StoreItemBean>()
+    }
+
+    private val bubbleAdapter by lazy {
+        StoreItemAdapter(type)
+    }
+
+    var isBubbleExpanded: Boolean = false
+
     override fun loadData() {
+        if (type == 1){
+            storeVm.getProductList()
+        } else {
+            storeVm.getExitProductList()
+        }
+
     }
 
     override fun initOther() {
+        ARouter.getInstance().inject(this)
         setBackView(binding.toolbar.ivBack)
         binding.toolbar.ivBack.setImageResource(R.mipmap.back_white)
         binding.toolbar.tvTitle.setTextColor(Color.parseColor("#FFFFFF"))
-        binding.toolbar.tvTitle.text =
-            "Store"
+        if (type == 1){
+            binding.toolbar.tvTitle.text =
+                AppContext.getContext().resources.getString(R.string.mall)
+        } else {
+            binding.toolbar.tvTitle.text =
+                AppContext.getContext().resources.getString(R.string.dress_up)
+            binding.tvEnterMore.visibility = View.GONE
+            binding.ivEnterMore.visibility = View.GONE
+
+            binding.tvAvatarMore.visibility = View.GONE
+            binding.ivAvatarMore.visibility = View.GONE
+
+            binding.tvBadgeMore.visibility = View.GONE
+            binding.ivBadgeMore.visibility = View.GONE
+
+            binding.tvBubbleMore.visibility = View.GONE
+            binding.ivBubbleMore.visibility = View.GONE
+        }
     }
 
     override fun initLiveData() {
-        binding.swagoRv.layoutManager = LinearLayoutManager(this)
-        adapter.setNewData(arrayListOf(StoreListBean("dfg", false), StoreListBean("fsdfds", false)))
-        binding.swagoRv.adapter = adapter
-        adapter.setOnItemChildClickListener { _, view, positon ->
-            when (view?.id) {
-                R.id.clMore -> {
-                    adapter.data[positon].isExpanded = !adapter.data[positon].isExpanded
-                    adapter.notifyItemChanged(positon)
+        binding.rvEnter.layoutManager = GridLayoutManager(this, 3)
+        binding.rvEnter.adapter = enterAdapter
+
+        binding.rvAvatar.layoutManager = GridLayoutManager(this, 3)
+        binding.rvAvatar.adapter = avatarAdapter
+
+        binding.rvBadge.layoutManager = GridLayoutManager(this, 3)
+        binding.rvBadge.adapter = badgeAdapter
+
+        binding.rvBubble.layoutManager = GridLayoutManager(this, 3)
+        binding.rvBubble.adapter = bubbleAdapter
+
+        storeVm.storeProductData.observe(this){
+            if (it.isNullOrEmpty()){
+                binding.clEmpty.visibility = View.VISIBLE
+            } else {
+                it.forEach { item ->
+                    when (item.product_category){
+                        1 -> {
+                            enterList.add(item)
+                        }
+                        2 -> {
+                            avatarList.add(item)
+                        }
+                        3 -> {
+                            badgeList.add(item)
+                        }
+                        4 -> {
+                            bubbleList.add(item)
+                        }
+                    }
                 }
+                if (enterList.isNotEmpty()){
+                    binding.clEnterMore.visibility = View.VISIBLE
+                    enterAdapter.setNewData(enterList.subList(0, enterList.size.coerceAtMost(3)))
+                }
+                if (avatarList.isNotEmpty()){
+                    binding.clAvatarMore.visibility = View.VISIBLE
+                    avatarAdapter.setNewData(avatarList.subList(0, avatarList.size.coerceAtMost(3)))
+                }
+                if (badgeList.isNotEmpty()){
+                    binding.clBadgeMore.visibility = View.VISIBLE
+                    badgeAdapter.setNewData(badgeList.subList(0, badgeList.size.coerceAtMost(3)))
+                }
+                if (bubbleList.isNotEmpty()){
+                    binding.clBubbleMore.visibility = View.VISIBLE
+                    bubbleAdapter.setNewData(bubbleList.subList(0, bubbleList.size.coerceAtMost(3)))
+                }
+
+            }
+
+
+        }
+
+        storeVm.exitProductData.observe(this){
+            if (it.isNullOrEmpty()){
+                binding.clEmpty.visibility = View.VISIBLE
+            } else {
+                it.forEach { item ->
+                    when (item.product_category){
+                        1 -> {
+                            enterList.add(item)
+                        }
+                        2 -> {
+                            avatarList.add(item)
+                        }
+                        3 -> {
+                            badgeList.add(item)
+                        }
+                        4 -> {
+                            bubbleList.add(item)
+                        }
+                    }
+                }
+                if (enterList.isNotEmpty()){
+                    binding.clEnterMore.visibility = View.VISIBLE
+                    enterAdapter.setNewData(enterList)
+                }
+                if (avatarList.isNotEmpty()){
+                    binding.clAvatarMore.visibility = View.VISIBLE
+                    avatarAdapter.setNewData(avatarList)
+                }
+                if (badgeList.isNotEmpty()){
+                    binding.clBadgeMore.visibility = View.VISIBLE
+                    badgeAdapter.setNewData(badgeList)
+                }
+                if (bubbleList.isNotEmpty()){
+                    binding.clBubbleMore.visibility = View.VISIBLE
+                    bubbleAdapter.setNewData(bubbleList)
+                }
+            }
+
+        }
+
+        binding.clEnterMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isEnterExpanded) {
+                enterAdapter.setNewData(enterList)
+                binding.tvEnterMore.text = "Show Less"
+                binding.ivEnterMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                enterAdapter.setNewData(enterList.subList(0, enterList.size.coerceAtMost(3)))
+                binding.tvEnterMore.text = "Show More"
+                binding.ivEnterMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isEnterExpanded = !isEnterExpanded
+        }
+
+        binding.clAvatarMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isAvatarExpanded) {
+                avatarAdapter.setNewData(avatarList)
+                binding.tvAvatarMore.text = "Show Less"
+                binding.ivAvatarMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                avatarAdapter.setNewData(avatarList.subList(0, avatarList.size.coerceAtMost(3)))
+                binding.tvAvatarMore.text = "Show More"
+                binding.ivAvatarMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isAvatarExpanded = !isAvatarExpanded
+        }
+
+        binding.clBadgeMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isBadgeExpanded) {
+                badgeAdapter.setNewData(badgeList)
+                binding.tvBadgeMore.text = "Show Less"
+                binding.ivBadgeMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                badgeAdapter.setNewData(badgeList.subList(0, badgeList.size.coerceAtMost(3)))
+                binding.tvBadgeMore.text = "Show More"
+                binding.ivBadgeMore.setImageResource(R.mipmap.ic_show_more)
+            }
+            isBadgeExpanded = !isBadgeExpanded
+        }
+
+        binding.clBubbleMore.setOnClickListener {
+            if (type == 2)
+                return@setOnClickListener
+            if (isBubbleExpanded) {
+                bubbleAdapter.setNewData(bubbleList)
+                binding.tvBubbleMore.text = "Show Less"
+                binding.ivBubbleMore.setImageResource(R.mipmap.ic_show_less)
+            } else {
+                bubbleAdapter.setNewData(bubbleList.subList(0, bubbleList.size.coerceAtMost(3)))
+                binding.tvBubbleMore.text = "Show More"
+                binding.ivBubbleMore.setImageResource(R.mipmap.ic_show_more)
             }
+            isBubbleExpanded = !isBubbleExpanded
         }
-        adapter.itemClickFun = { typeItem, position ->
-            StoreBuyDialog.newInstance().show(supportFragmentManager ,"StoreBuyDialog")
+        enterAdapter.setOnItemClickListener { _, _, position ->
+            StoreBuyDialog.newInstance(enterAdapter.data[position]).show(supportFragmentManager ,"StoreBuyDialog")
         }
     }
 

+ 0 - 6
user/src/main/java/com/swago/user/store/StoreListBean.kt

@@ -1,6 +0,0 @@
-package com.swago.user.store
-
-data class StoreListBean(
-    val name: String,
-    var isExpanded: Boolean
-)

+ 0 - 39
user/src/main/java/com/swago/user/store/StoreTypeAdapter.kt

@@ -1,39 +0,0 @@
-package com.swago.user.store
-
-import androidx.recyclerview.widget.GridLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import com.chad.library.adapter.base.BaseQuickAdapter
-import com.chad.library.adapter.base.BaseViewHolder
-import com.swago.user.R
-
-class StoreTypeAdapter: BaseQuickAdapter<StoreListBean, BaseViewHolder>(R.layout.item_type_store, arrayListOf())  {
-    var itemClickFun: ((typeItem: StoreListBean , position:Int) -> Unit)? = null
-
-    override fun convert(helper: BaseViewHolder?, item: StoreListBean?) {
-        val itemAdapter = StoreItemAdapter()
-        val array = arrayListOf("ds", "ferg","dfdg","dfdg")
-        helper?.apply {
-            item?.let {
-                setText(R.id.tvType ,item.name)
-                if (item.isExpanded){
-                    itemAdapter.setNewData(array)
-                    setText(R.id.tvMore ,"Show Less")
-                    setImageResource(R.id.ivMore , R.mipmap.ic_show_less)
-                } else {
-                    itemAdapter.setNewData(array.subList(0 , array.size.coerceAtMost(3)))
-                    setText(R.id.tvMore ,"Show More")
-                    setImageResource(R.id.ivMore , R.mipmap.ic_show_more)
-                }
-                val recyclerView = itemView.findViewById<RecyclerView>(R.id.rvType)
-                recyclerView.layoutManager = GridLayoutManager(mContext, 3)
-                recyclerView.adapter = itemAdapter
-                addOnClickListener(R.id.clMore)
-                itemAdapter.setOnItemClickListener { _, _, postion ->
-                    itemClickFun?.invoke(item,postion)
-                }
-            }
-
-
-        }
-    }
-}

+ 54 - 0
user/src/main/java/com/swago/user/vm/StoreVm.kt

@@ -0,0 +1,54 @@
+package com.swago.user.vm
+
+import android.app.Application
+import androidx.lifecycle.MutableLiveData
+import com.swago.baseswago.inter.ApiManager
+import com.swago.baseswago.model.mine.StoreItemBean
+import com.swago.baseswago.model.mine.TaskModel
+import com.swago.baseswago.util.ActivityManagerUtil
+import com.swago.baseswago.util.BaseViewModel
+import com.swago.baseswago.util.SwagoLoading
+
+class StoreVm(application: Application) : BaseViewModel(application){
+
+    val storeProductData by lazy {
+        MutableLiveData<List<StoreItemBean>?>()
+    }
+
+    fun getProductList(){
+        requestData2 {
+            requestData {
+                val data = ApiManager.userApi.getProductList()
+                storeProductData.value  = data.list
+            }
+            requestError {
+                storeProductData.value = null
+            }
+        }
+    }
+
+    fun buyProduct(productId:Long){
+        requestData2 (){
+            requestData {
+                ApiManager.userApi.buyProduct(productId)
+            }
+
+        }
+    }
+
+    val exitProductData by lazy {
+        MutableLiveData<List<StoreItemBean>?>()
+    }
+
+    fun getExitProductList(){
+        requestData2 {
+            requestData {
+                val data = ApiManager.userApi.exitProductList()
+                exitProductData.value  = data.list
+            }
+            requestError {
+                exitProductData.value = null
+            }
+        }
+    }
+}

+ 247 - 10
user/src/main/res/layout/activity_store_list.xml

@@ -4,6 +4,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#030417"
+    xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <ImageView
@@ -20,17 +21,253 @@
         android:layout_marginTop="25dp"
         app:layout_constraintTop_toTopOf="parent" />
 
-    <FrameLayout
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
-        android:layout_marginTop="81dp"
+    <androidx.core.widget.NestedScrollView
         android:layout_width="match_parent"
-        android:layout_height="0dp">
-
-        <androidx.recyclerview.widget.RecyclerView
-            android:id="@+id/swagoRv"
+        android:layout_height="0dp"
+        android:layout_marginTop="81dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent">
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="match_parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent">
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clEnterMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvEnterType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="入场特效" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvEnterMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivEnterMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivEnterMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvEnter"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clEnterMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clAvatarMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvEnter">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvAvatarType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="头像框" />
 
-    </FrameLayout>
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvAvatarMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivAvatarMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivAvatarMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvAvatar"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clAvatarMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clBadgeMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvAvatar">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvBadgeType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="徽章" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvBadgeMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivBadgeMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivBadgeMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvBadge"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clBadgeMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:id="@+id/clBubbleMore"
+                android:layout_width="match_parent"
+                android:layout_height="43dp"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/rvBadge">
+
+                <com.swago.baseswago.cusview.BoldTextView
+                    android:id="@+id/tvBubbleType"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="16dp"
+                    android:textColor="#fff"
+                    android:textSize="@dimen/sp_16"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="聊天气泡" />
+
+                <com.swago.baseswago.cusview.MediumTextView
+                    android:id="@+id/tvBubbleMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="2dp"
+                    android:drawablePadding="2dp"
+                    android:textColor="#99ffffff"
+                    android:textSize="12sp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toStartOf="@+id/ivBubbleMore"
+                    app:layout_constraintTop_toTopOf="parent"
+                    android:text="Show Less" />
+                <ImageView
+                    android:id="@+id/ivBubbleMore"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    android:src="@mipmap/ic_show_more"
+                    android:layout_marginEnd="16dp"/>
+            </androidx.constraintlayout.widget.ConstraintLayout>
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvBubble"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/clBubbleMore"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </androidx.core.widget.NestedScrollView>
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clEmpty"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="81dp"
+        android:visibility="gone"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent">
+        <ImageView
+            android:id="@+id/ivEmpty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@mipmap/state_error_empty"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="14sp"
+            android:textColor="@color/_ffffff"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/ivEmpty"
+            android:text="@string/There_is_nothing_here"
+            android:layout_marginTop="@dimen/dp_4"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 0
user/src/main/res/layout/dialog_store_detail.xml

@@ -52,6 +52,7 @@
                 tools:text="fgg" />
 
             <com.swago.baseswago.cusview.MediumTextView
+                android:id="@+id/tvBuy"
                 android:layout_width="match_parent"
                 android:layout_height="44dp"
                 android:layout_marginStart="17dp"

+ 12 - 1
user/src/main/res/layout/item_store.xml

@@ -15,7 +15,6 @@
         android:background="@drawable/shape_0fffffff_4"
         app:layout_constraintDimensionRatio="h,52:66"
         app:layout_constraintTop_toTopOf="parent">
-
         <ImageView
             android:id="@+id/iv_svg"
             android:layout_width="90dp"
@@ -50,6 +49,18 @@
             android:drawableStart="@mipmap/ic_coin_store"
             android:textSize="10sp"
             android:textColor="#A3FFFFFF"/>
+        <TextView
+            android:id="@+id/tvUsing"
+            android:layout_width="51dp"
+            android:layout_height="18dp"
+            android:textSize="@dimen/sp_12"
+            android:textColor="@color/_ffffff"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            android:text="Using"
+            android:gravity="center"
+            android:visibility="gone"
+            android:background="@drawable/shape_8c25cb_top_bottom_one_4"/>
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 57
user/src/main/res/layout/item_type_store.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/clMore"
-        android:layout_width="match_parent"
-        android:layout_height="43dp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
-
-        <com.swago.baseswago.cusview.BoldTextView
-            android:id="@+id/tvType"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="16dp"
-            android:textColor="#fff"
-            android:textSize="@dimen/sp_16"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            tools:text="Enter" />
-
-        <com.swago.baseswago.cusview.MediumTextView
-            android:id="@+id/tvMore"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginEnd="2dp"
-            android:drawablePadding="2dp"
-            android:textColor="#99ffffff"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toStartOf="@+id/ivMore"
-            app:layout_constraintTop_toTopOf="parent"
-            android:text="Show Less" />
-        <ImageView
-            android:id="@+id/ivMore"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            android:src="@mipmap/ic_show_more"
-            android:layout_marginEnd="16dp"/>
-    </androidx.constraintlayout.widget.ConstraintLayout>
-
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/rvType"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="4dp"
-        android:layout_marginEnd="4dp"
-        app:layout_constraintTop_toBottomOf="@+id/clMore"/>
-</androidx.constraintlayout.widget.ConstraintLayout>