|
|
@@ -21,6 +21,7 @@ import com.yc.module_base.model.PostUserBody
|
|
|
import com.yc.module_base.view.giftwall.GiftWallInfo
|
|
|
import com.yc.module_base.view.giftwall.GiftWallShowBody
|
|
|
import com.yc.module_me.model.MysteryMenStatus
|
|
|
+import com.mita.module_me.view.invite.ShareInviteRepository
|
|
|
import kotlinx.coroutines.async
|
|
|
|
|
|
/** Created by yc on 2021/2/25
|
|
|
@@ -32,9 +33,11 @@ class MeViewModel(
|
|
|
) : BaseVm(app, map, savedStateHandle) {
|
|
|
public val userRepository: MeRepository by lazy { MeRepository() }
|
|
|
private val commonRepository: CommonRepository by lazy { CommonRepository() }
|
|
|
+ private val shareInviteRepository: ShareInviteRepository by lazy { ShareInviteRepository() }
|
|
|
var isFetch = MutableLiveData<Boolean>()
|
|
|
var isToken = MutableLiveData<Boolean>()
|
|
|
var isUpdateCoin = MutableLiveData<Boolean>()
|
|
|
+ var inviteBannerUrl = MutableLiveData<String>()
|
|
|
val list = ObservableAdapterList<Any>()
|
|
|
val bannerList = arrayListOf<Banner>()
|
|
|
val userId: Long? = null
|
|
|
@@ -147,4 +150,25 @@ class MeViewModel(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+ fun getInviteBanner(platform: String = "all") {
|
|
|
+ requestMix(
|
|
|
+ block = {
|
|
|
+ val res = shareInviteRepository.getInviteBanner(platform)
|
|
|
+ if (res.code != 200) {
|
|
|
+ throw com.yc.baselibrary.net.exception.Errors.ErrorException(
|
|
|
+ res.code ?: -1,
|
|
|
+ res.message ?: "获取banner失败"
|
|
|
+ )
|
|
|
+ }
|
|
|
+ res.data?.inviteBanner?.trim().orEmpty()
|
|
|
+ },
|
|
|
+ build = {
|
|
|
+ setLoadingType(LoadingType.NONE)
|
|
|
+ success {
|
|
|
+ inviteBannerUrl.value = it
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+}
|