修改转赠钻石逻辑和ui

This commit is contained in:
wushaocheng
2022-10-21 20:59:17 +08:00
parent 46250d4a52
commit 7fd8892f3c
26 changed files with 474 additions and 186 deletions

View File

@@ -852,6 +852,18 @@
<activity <activity
android:name=".ui.wallet.sendgold.SendGoldActivity" android:name=".ui.wallet.sendgold.SendGoldActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name=".pay.activity.GiveGoldActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name=".pay.activity.GiveGoldToUserActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name=".pay.activity.GiveGoldSearchActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- 隐私设置 --> android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- 隐私设置 -->
<activity <activity
android:name=".ui.setting.PrivacySettingActivity" android:name=".ui.setting.PrivacySettingActivity"

View File

@@ -198,7 +198,7 @@ public class XChatApplication extends Application {
String channel = ""; String channel = "";
channel = ChannelReaderUtil.getChannel(instance); channel = ChannelReaderUtil.getChannel(instance);
if (TextUtils.isEmpty(channel)) { if (TextUtils.isEmpty(channel)) {
channel = "official"; channel = "google";
} }
BasicConfig.INSTANCE.setOriginalChannel(channel); BasicConfig.INSTANCE.setOriginalChannel(channel);

View File

@@ -5,15 +5,16 @@ import com.yizhuan.erban.base.BaseViewModel
import com.yizhuan.xchat_android_core.home.bean.BannerInfo import com.yizhuan.xchat_android_core.home.bean.BannerInfo
import com.yizhuan.xchat_android_core.home.model.HomeModel import com.yizhuan.xchat_android_core.home.model.HomeModel
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
class MeViewModel : BaseViewModel() { class MeViewModel : BaseViewModel() {
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
private val _meCenterInfoLiveData = MutableLiveData<List<MeCenterInfo>?>() private val _meCenterInfoLiveData = MutableLiveData<List<MeCenterInfo>?>()
val meCenterInfoLiveData: MutableLiveData<List<MeCenterInfo>?> = _meCenterInfoLiveData val meCenterInfoLiveData: MutableLiveData<List<MeCenterInfo>?> = _meCenterInfoLiveData
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
init { init {
refreshData() refreshData()
} }

View File

@@ -25,6 +25,7 @@ import com.yizhuan.erban.home.helper.BannerHelper
import com.yizhuan.erban.home.helper.OpenRoomHelper import com.yizhuan.erban.home.helper.OpenRoomHelper
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity
import com.yizhuan.erban.pay.activity.GiveGoldActivity
import com.yizhuan.erban.ui.pay.ChargeActivity import com.yizhuan.erban.ui.pay.ChargeActivity
import com.yizhuan.erban.ui.relation.AttentionListActivity import com.yizhuan.erban.ui.relation.AttentionListActivity
import com.yizhuan.erban.ui.relation.FansListActivity import com.yizhuan.erban.ui.relation.FansListActivity
@@ -383,6 +384,9 @@ class MeFragment : BaseFragment(), View.OnClickListener {
Constants.WXPAY_REFERER + "peko/modules/myincome/index.html#/DiamondLog" Constants.WXPAY_REFERER + "peko/modules/myincome/index.html#/DiamondLog"
) )
} }
R.id.ll_clean_diamonds -> {
GiveGoldActivity.start(mContext)
}
else -> {} else -> {}
} }
} }

View File

@@ -0,0 +1,41 @@
package com.yizhuan.erban.pay
import androidx.lifecycle.MutableLiveData
import com.yizhuan.erban.base.BaseViewModel
import com.yizhuan.xchat_android_core.bean.response.ListResult
import com.yizhuan.xchat_android_core.home.model.HomeModel
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
import com.yizhuan.xchat_android_core.user.bean.SearchUserInfo
class GiveGoldModel : BaseViewModel() {
private val _diamondGiveHistoryLiveData = MutableLiveData<ListResult<DiamondGiveHistoryInfo>?>()
val diamondGiveHistoryLiveData: MutableLiveData<ListResult<DiamondGiveHistoryInfo>?> = _diamondGiveHistoryLiveData
private val _searchUserLiveData = MutableLiveData<SearchUserInfo?>()
val searchUserLiveData: MutableLiveData<SearchUserInfo?> = _searchUserLiveData
fun getDiamondListInfo(pageNum:Int, pageSize: Int) {
safeLaunch(
onError = {
_diamondGiveHistoryLiveData.value = ListResult.failed(pageNum)
},
block = {
val result = HomeModel.getDiamondGiveHistory(pageNum, pageSize)
_diamondGiveHistoryLiveData.value = ListResult.success(result, pageNum)
}
)
}
fun getSearchUserInfo(erbanNo:Long) {
safeLaunch(
onError = {
_searchUserLiveData.value = null
},
block = {
_searchUserLiveData.value = HomeModel.getSearchUser(erbanNo)
}
)
}
}

View File

@@ -1,67 +1,121 @@
package com.yizhuan.erban.pay.activity package com.yizhuan.erban.pay.activity
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.text.TextUtils
import android.view.KeyEvent
import android.view.inputmethod.EditorInfo
import android.widget.TextView.OnEditorActionListener
import androidx.activity.viewModels
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.yinyuan.doudou.pay.activity.GiveGoldSearchActivity import com.netease.nim.uikit.StatusBarUtil
import com.yinyuan.doudou.pay.adapter.LatelyGiveAdapter
import com.yizhuan.erban.R import com.yizhuan.erban.R
import com.yizhuan.erban.base.BaseActivity import com.yizhuan.erban.base.BaseViewBindingActivity
import com.yizhuan.erban.common.EmptyViewHelper import com.yizhuan.erban.common.EmptyViewHelper
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo import com.yizhuan.erban.databinding.ActivityGiveGoldBinding
import com.yizhuan.xchat_android_core.user.UserModel import com.yizhuan.erban.pay.GiveGoldModel
import com.yizhuan.xchat_android_core.user.bean.UserInfo import com.yizhuan.erban.pay.adapter.LatelyGiveAdapter
import com.yizhuan.erban.ui.utils.RVDelegate
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
import com.yizhuan.xchat_android_library.utils.ResUtil import com.yizhuan.xchat_android_library.utils.ResUtil
import kotlinx.android.synthetic.main.activity_give_gold.*
/**
* 轉贈鉆石頁面
*/
class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
class GiveGoldActivity : BaseActivity() { private var pageNum: Int = 1
private val pageSize = 20
private lateinit var mAdapter: LatelyGiveAdapter
private lateinit var rvDelegate: RVDelegate<DiamondGiveHistoryInfo>
private lateinit var adapter: LatelyGiveAdapter private val giveGoldModel: GiveGoldModel by viewModels()
override fun onCreate(savedInstanceState: Bundle?) { companion object {
super.onCreate(savedInstanceState) fun start(context: Context) {
setContentView(R.layout.activity_give_gold) val intent = Intent(context, GiveGoldActivity::class.java)
initTitleBar(ResUtil.getString(R.string.pay_activity_givegoldactivity_01)) context.startActivity(intent)
recyclerView.layoutManager = LinearLayoutManager(this) }
adapter = LatelyGiveAdapter() }
adapter.bindToRecyclerView(recyclerView)
adapter.emptyView = EmptyViewHelper.createEmptyView(this, ResUtil.getString(R.string.pay_activity_givegoldactivity_02)) override fun init() {
adapter.setOnItemClickListener { _, _, position -> initTitleBar(ResUtil.getString(R.string.me_clean_diamond))
adapter.getItem(position)?.let { binding.etSearch.setOnEditorActionListener(OnEditorActionListener { v, actionId, event -> //以下方法防止两次发送请求
if (actionId == EditorInfo.IME_ACTION_SEARCH && event != null || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) {
if (event.action == KeyEvent.ACTION_UP) { //发送请求
val newStr: String = binding.etSearch.text.toString().trim { it <= ' ' }
if (!TextUtils.isEmpty(newStr)) {
giveGoldModel.getSearchUserInfo(newStr.toLong())
}
return@OnEditorActionListener true //自己消费
}
return@OnEditorActionListener true
}
false
})
binding.mTvSearch.setOnClickListener {
val newStr: String = binding.etSearch.text.toString().trim { it <= ' ' }
if (!TextUtils.isEmpty(newStr)) {
giveGoldModel.getSearchUserInfo(newStr.toLong())
}
}
mAdapter = LatelyGiveAdapter()
rvDelegate = RVDelegate.Builder<DiamondGiveHistoryInfo>()
.setAdapter(mAdapter)
.setLayoutManager(LinearLayoutManager(this))
.setPageSize(20)
.setEmptyView(
EmptyViewHelper.createEmptyView(
this,
ResUtil.getString(R.string.me_give_gold_empty)
)
)
.setRefreshLayout(binding.refreshLayout)
.setRecyclerView(binding.recyclerView)
.build()
mAdapter.setOnItemClickListener { _, _, position ->
mAdapter.getItem(position)?.let {
GiveGoldToUserActivity.start(this, it) GiveGoldToUserActivity.start(this, it)
} }
} }
llSearch.setOnClickListener { GiveGoldSearchActivity.start(this) } mAdapter.setOnLoadMoreListener({
} loadData(false)
}, binding.recyclerView)
@SuppressLint("CheckResult") binding.refreshLayout.setOnRefreshListener {
override fun onResume() { loadData(true)
super.onResume() }
UserModel.get().giveUserList giveGoldModel.diamondGiveHistoryLiveData.observe(this) {
.compose(bindToLifecycle()) rvDelegate.loadData(it)
.doOnError { toast(it.message) } }
.subscribe { users -> giveGoldModel.searchUserLiveData.observe(this) {
adapter.setNewData(users.filterNotNull()) it?.let {
} GiveGoldToUserActivity.start(this, it)
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == Activity.RESULT_OK && requestCode == GiveGoldSearchActivity.REQUEST_CODE) {
GiveGoldToUserActivity.start(this, UserInfo().apply {
val room = data?.getParcelableExtra<SearchRoomInfo>("searchRoomInfo")
room?.let {
birth = it.birth
erbanNo = it.erbanNo
uid = it.uid
nick = it.nick
avatar = it.avatar
}
})
} }
} }
override fun onResume() {
super.onResume()
loadData(true)
}
@SuppressLint("CheckResult")
fun loadData(isRefresh: Boolean) {
binding.refreshLayout.isRefreshing = isRefresh
pageNum = if (isRefresh) 1 else (pageNum + 1)
giveGoldModel.getDiamondListInfo(pageNum, pageSize)
}
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
override fun needSteepStateBar(): Boolean {
return true
}
} }

View File

@@ -1,4 +1,4 @@
package com.yinyuan.doudou.pay.activity package com.yizhuan.erban.pay.activity
import android.annotation.SuppressLint import android.annotation.SuppressLint
@@ -9,10 +9,10 @@ import android.os.Parcelable
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.yinyuan.doudou.pay.adapter.GiveSearchAdapter
import com.yizhuan.erban.R import com.yizhuan.erban.R
import com.yizhuan.erban.base.BaseActivity import com.yizhuan.erban.base.BaseActivity
import com.yizhuan.erban.common.EmptyViewHelper import com.yizhuan.erban.common.EmptyViewHelper
import com.yizhuan.erban.pay.adapter.GiveSearchAdapter
import com.yizhuan.erban.ui.utils.RVDelegate import com.yizhuan.erban.ui.utils.RVDelegate
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo
import com.yizhuan.xchat_android_core.room.model.AvRoomModel import com.yizhuan.xchat_android_core.room.model.AvRoomModel

View File

@@ -7,12 +7,15 @@ import android.os.Bundle
import android.text.Editable import android.text.Editable
import android.text.TextWatcher import android.text.TextWatcher
import com.jungly.gridpasswordview.GridPasswordView import com.jungly.gridpasswordview.GridPasswordView
import com.netease.nim.uikit.StatusBarUtil
import com.yizhuan.erban.R import com.yizhuan.erban.R
import com.yizhuan.erban.base.BaseActivity import com.yizhuan.erban.base.BaseActivity
import com.yizhuan.erban.pay.password.GiveGoldPassWordFragment import com.yizhuan.erban.pay.password.GiveGoldPassWordFragment
import com.yizhuan.erban.ui.utils.ImageLoadUtils import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.xchat_android_core.DemoCache import com.yizhuan.xchat_android_core.DemoCache
import com.yizhuan.xchat_android_core.pay.PayModel import com.yizhuan.xchat_android_core.pay.PayModel
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
import com.yizhuan.xchat_android_core.user.bean.SearchUserInfo
import com.yizhuan.xchat_android_core.user.bean.UserInfo import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_library.utils.ResUtil import com.yizhuan.xchat_android_library.utils.ResUtil
import kotlinx.android.synthetic.main.activity_give_gold_to_user.* import kotlinx.android.synthetic.main.activity_give_gold_to_user.*
@@ -21,27 +24,68 @@ class GiveGoldToUserActivity : BaseActivity(), GridPasswordView.OnPasswordChange
companion object { companion object {
@JvmStatic @JvmStatic
fun start(context: Context, user: UserInfo) { fun start(context: Context, user: DiamondGiveHistoryInfo) {
val intent = Intent(context, GiveGoldToUserActivity::class.java) val intent = Intent(context, GiveGoldToUserActivity::class.java)
intent.putExtra("user", user) intent.putExtra("user", user)
context.startActivity(intent) context.startActivity(intent)
} }
@JvmStatic
fun start(context: Context, searchUser: SearchUserInfo) {
val intent = Intent(context, GiveGoldToUserActivity::class.java)
intent.putExtra("searchUser", searchUser)
context.startActivity(intent)
}
} }
private var userInfo: UserInfo? = null private var userInfo: DiamondGiveHistoryInfo? = null
private var searchUserInfo: SearchUserInfo? = null
private var passWordFragment: GiveGoldPassWordFragment? = null private var passWordFragment: GiveGoldPassWordFragment? = null
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_give_gold_to_user) setContentView(R.layout.activity_give_gold_to_user)
userInfo = intent.getSerializableExtra("user") as UserInfo? userInfo = intent.getSerializableExtra("user") as DiamondGiveHistoryInfo?
searchUserInfo = intent.getSerializableExtra("searchUser") as SearchUserInfo?
init() init()
} }
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
override fun needSteepStateBar(): Boolean {
return true
}
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun init() { private fun init() {
initTitleBar(ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_01)) initTitleBar(ResUtil.getString(R.string.me_clean_diamond))
userInfo?.apply { userInfo?.apply {
tvId.text = "Id:${targetErbanNo}"
tvNickname.text = targetNick
ImageLoadUtils.loadAvatar(context, targetAvatar, ivAvatar)
val initInfo = DemoCache.readInitInfo()
editGold.hint = if (initInfo.redEnvelopeConfig.rate == 0.0) ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_02) else ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_03)
tv_desc.text = if (initInfo.redEnvelopeConfig.rate == 0.0) ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_04) else ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_05)
tvSure.setOnClickListener {
val gold = editGold.text.toString().toInt()
if (gold <= 0) {
toast(ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_06))
return@setOnClickListener
}
val rateGold = gold * initInfo.redEnvelopeConfig.rate / 100
GiveGoldPassWordFragment.newInstance(supportFragmentManager, gold.toString(), targetNick, if (rateGold == 0.0) "" else "手續費:(${initInfo.redEnvelopeConfig.rate.toInt()}%): ${rateGold}鉆石")
.apply {
passWordFragment = this
setListener(this@GiveGoldToUserActivity)
}
}
}
searchUserInfo?.apply {
tvId.text = "Id:${erbanNo}" tvId.text = "Id:${erbanNo}"
tvNickname.text = nick tvNickname.text = nick
ImageLoadUtils.loadAvatar(context, avatar, ivAvatar) ImageLoadUtils.loadAvatar(context, avatar, ivAvatar)
@@ -50,12 +94,12 @@ class GiveGoldToUserActivity : BaseActivity(), GridPasswordView.OnPasswordChange
tv_desc.text = if (initInfo.redEnvelopeConfig.rate == 0.0) ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_04) else ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_05) tv_desc.text = if (initInfo.redEnvelopeConfig.rate == 0.0) ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_04) else ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_05)
tvSure.setOnClickListener { tvSure.setOnClickListener {
var gold = editGold.text.toString().toInt() val gold = editGold.text.toString().toInt()
if (gold <= 0) { if (gold <= 0) {
toast(ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_06)) toast(ResUtil.getString(R.string.pay_activity_givegoldtouseractivity_06))
return@setOnClickListener return@setOnClickListener
} }
var rateGold = gold * initInfo.redEnvelopeConfig.rate / 100 val rateGold = gold * initInfo.redEnvelopeConfig.rate / 100
GiveGoldPassWordFragment.newInstance(supportFragmentManager, gold.toString(), nick, if (rateGold == 0.0) "" else "手續費:(${initInfo.redEnvelopeConfig.rate.toInt()}%): ${rateGold}鉆石") GiveGoldPassWordFragment.newInstance(supportFragmentManager, gold.toString(), nick, if (rateGold == 0.0) "" else "手續費:(${initInfo.redEnvelopeConfig.rate.toInt()}%): ${rateGold}鉆石")
.apply { .apply {
passWordFragment = this passWordFragment = this
@@ -71,12 +115,29 @@ class GiveGoldToUserActivity : BaseActivity(), GridPasswordView.OnPasswordChange
override fun onInputFinish(psw: String) { override fun onInputFinish(psw: String) {
} }
@SuppressLint("CheckResult")
override fun onTextChanged(psw: String) { override fun onTextChanged(psw: String) {
val password = passWordFragment?.password?.password ?: "" val password = passWordFragment?.password?.password ?: ""
if (password.length == 6) { if (password.length == 6) {
userInfo?.apply { userInfo?.apply {
dialogManager.showProgressDialog(context) dialogManager.showProgressDialog(context)
PayModel.get().giveGold(uid, editGold.text.toString(), password) PayModel.get().giveGold(targetUid, editGold.text.toString(), DESAndBase64(password))
.compose(bindToLifecycle())
.doOnError {
toast(it.message)
passWordFragment?.password?.clearPassword()
dialogManager.dismissDialog()
}
.subscribe { _ ->
passWordFragment?.dismissAllowingStateLoss()
dialogManager.dismissDialog()
finish()
GiveGoldSuccessActivity.start(context, editGold.text.toString(), targetNick)
}
}
searchUserInfo?.apply {
dialogManager.showProgressDialog(context)
PayModel.get().giveGold(uid, editGold.text.toString(), DESAndBase64(password))
.compose(bindToLifecycle()) .compose(bindToLifecycle())
.doOnError { .doOnError {
toast(it.message) toast(it.message)

View File

@@ -1,4 +1,4 @@
package com.yinyuan.doudou.pay.adapter package com.yizhuan.erban.pay.adapter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.graphics.Color import android.graphics.Color
@@ -18,20 +18,7 @@ class GiveSearchAdapter : BaseQuickAdapter<SearchRoomInfo, BaseViewHolder>(R.lay
override fun convert(helper: BaseViewHolder, item: SearchRoomInfo) { override fun convert(helper: BaseViewHolder, item: SearchRoomInfo) {
helper.getView<TextView>(R.id.tv_id).text = "Id:${item.erbanNo}" helper.getView<TextView>(R.id.tv_id).text = "Id:${item.erbanNo}"
helper.getView<TextView>(R.id.tv_nickname).text = item.nick helper.getView<TextView>(R.id.tv_nickname).text = item.nick
setGenderAndBirth(helper.getView(R.id.tv_gender), item.gender, item.birth)
ImageLoadUtils.loadAvatar(mContext, item.avatar, helper.getView(R.id.iv_avatar)) ImageLoadUtils.loadAvatar(mContext, item.avatar, helper.getView(R.id.iv_avatar))
} }
private fun setGenderAndBirth(tvGender: SuperTextView, gender: Int, birth: Long) {
if (gender == 1) {
tvGender.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_man_white, 0, 0, 0)
tvGender.solid = Color.parseColor("#FF72D1E7")
}
if (gender == 2) {
tvGender.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_women_white, 0, 0, 0)
tvGender.solid = Color.parseColor("#FFEF82B6")
}
tvGender.text = ((CurrentTimeUtils.getCurrentTime() - birth) / 1000 / 60 / 60 / 24 / 365).toString()
}
} }

View File

@@ -1,37 +1,22 @@
package com.yinyuan.doudou.pay.adapter package com.yizhuan.erban.pay.adapter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.graphics.Color
import android.widget.TextView import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder import com.chad.library.adapter.base.BaseViewHolder
import com.coorchice.library.SuperTextView
import com.yizhuan.erban.R import com.yizhuan.erban.R
import com.yizhuan.erban.ui.utils.ImageLoadUtils import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.xchat_android_core.user.bean.UserInfo import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
class LatelyGiveAdapter : BaseQuickAdapter<UserInfo, BaseViewHolder>(R.layout.item_lately_give) { class LatelyGiveAdapter :
BaseQuickAdapter<DiamondGiveHistoryInfo, BaseViewHolder>(R.layout.item_lately_give) {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun convert(helper: BaseViewHolder, item: UserInfo) { override fun convert(helper: BaseViewHolder, item: DiamondGiveHistoryInfo) {
helper.getView<TextView>(R.id.tv_id).text = "Id:${item.erbanNo}" helper.getView<TextView>(R.id.tv_id).text = "Id:${item.targetErbanNo}"
helper.getView<TextView>(R.id.tv_nickname).text = item.nick helper.getView<TextView>(R.id.tv_nickname).text = item.targetNick
setGenderAndBirth(helper.getView(R.id.tv_gender), item.gender, item.birth) ImageLoadUtils.loadAvatar(mContext, item.targetAvatar, helper.getView(R.id.iv_avatar))
ImageLoadUtils.loadAvatar(mContext, item.avatar, helper.getView(R.id.iv_avatar))
} }
private fun setGenderAndBirth(tvGender: SuperTextView, gender: Int, birth: Long) {
if (gender == 1) {
tvGender.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_man_white, 0, 0, 0)
tvGender.solid = Color.parseColor("#FF72D1E7")
}
if (gender == 2) {
tvGender.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_women_white, 0, 0, 0)
tvGender.solid = Color.parseColor("#FFEF82B6")
}
tvGender.text = ((CurrentTimeUtils.getCurrentTime() - birth) / 1000 / 60 / 60 / 24 / 365).toString()
}
} }

View File

@@ -90,7 +90,7 @@ public class SimpleJSInterface {
String channel; String channel;
channel = ChannelReaderUtil.getChannel(XChatApplication.instance()); channel = ChannelReaderUtil.getChannel(XChatApplication.instance());
if (TextUtils.isEmpty(channel)) { if (TextUtils.isEmpty(channel)) {
channel = "official"; channel = "google";
} }
return channel; return channel;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -12,6 +12,7 @@
android:id="@+id/title_bar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView

View File

@@ -300,12 +300,12 @@
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_16"
android:textStyle="bold" android:textStyle="bold"
tools:text="999" /> tools:text="999" />
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/tv_diamond_text" android:id="@+id/tv_diamond_text"
@@ -320,11 +320,11 @@
android:textSize="@dimen/sp_10" /> android:textSize="@dimen/sp_10" />
<ImageView <ImageView
android:src="@drawable/ic_diamond_arrow"
android:layout_marginTop="@dimen/dp_2"
android:layout_marginStart="@dimen/dp_3"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_2"
android:src="@drawable/ic_diamond_arrow" />
</LinearLayout> </LinearLayout>
@@ -377,10 +377,10 @@
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout <LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/tv_vip_desc" android:id="@+id/tv_vip_desc"
@@ -394,11 +394,11 @@
android:textSize="@dimen/sp_10" /> android:textSize="@dimen/sp_10" />
<ImageView <ImageView
android:src="@drawable/ic_vip_arrow"
android:layout_marginTop="2dp"
android:layout_marginStart="3dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:layout_marginTop="2dp"
android:src="@drawable/ic_vip_arrow" />
</LinearLayout> </LinearLayout>
@@ -463,16 +463,16 @@
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:layout_marginStart="@dimen/dp_18" android:layout_marginStart="@dimen/dp_18"
android:onClick="@{click}" android:onClick="@{click}"
android:visibility="gone" android:src="@drawable/default_avatar"
android:src="@drawable/default_avatar" /> android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/iv_guide" android:id="@+id/iv_guide"
android:src="@drawable/icon_guild"
android:layout_marginStart="@dimen/dp_18"
android:visibility="visible"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_18"
android:src="@drawable/icon_guild"
android:visibility="visible" />
<TextView <TextView
android:id="@+id/tv_association_message" android:id="@+id/tv_association_message"
@@ -501,7 +501,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cs_my_center" android:id="@+id/cs_my_center"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="100dp" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15" android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginEnd="@dimen/dp_15" android:layout_marginEnd="@dimen/dp_15"
@@ -525,10 +525,11 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_room" android:id="@+id/ll_room"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center" android:gravity="center"
android:onClick="@{click}" android:onClick="@{click}"
android:orientation="horizontal" android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/ll_gain" app:layout_constraintEnd_toStartOf="@+id/ll_gain"
app:layout_constraintHorizontal_weight="1" app:layout_constraintHorizontal_weight="1"
@@ -543,7 +544,8 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_18"
android:text="@string/me_my_room" android:text="@string/me_my_room"
android:textColor="@color/color_1F1A4E" android:textColor="@color/color_1F1A4E"
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14" />
@@ -554,11 +556,12 @@
android:id="@+id/ll_gain" android:id="@+id/ll_gain"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center" android:gravity="center"
android:onClick="@{click}" android:onClick="@{click}"
android:orientation="horizontal" android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/ll_clean_diamonds"
app:layout_constraintHorizontal_weight="1" app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/ll_room" app:layout_constraintStart_toEndOf="@+id/ll_room"
app:layout_constraintTop_toBottomOf="@+id/tv_my_center"> app:layout_constraintTop_toBottomOf="@+id/tv_my_center">
@@ -571,13 +574,44 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_18"
android:text="@string/me_gain_recording" android:text="@string/me_gain_recording"
android:textColor="@color/color_1F1A4E" android:textColor="@color/color_1F1A4E"
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_clean_diamonds"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center"
android:onClick="@{click}"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/ll_gain"
app:layout_constraintTop_toBottomOf="@+id/tv_my_center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/me_clean_diamond" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_18"
android:text="@string/me_clean_diamond"
android:textColor="@color/color_1F1A4E"
android:textSize="@dimen/sp_14" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

View File

@@ -2,50 +2,28 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout 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_marginTop="@dimen/dp_20"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <com.yizhuan.erban.common.widget.CircleImageView
android:id="@+id/iv_avatar" android:id="@+id/iv_avatar"
android:layout_width="60dp" android:layout_width="50dp"
android:layout_height="60dp" android:layout_height="50dp"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginBottom="10dp"
android:src="@drawable/default_avatar" android:src="@drawable/default_avatar"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.coorchice.library.SuperTextView
android:id="@+id/tv_gender"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/dp_5"
android:adjustViewBounds="true"
android:drawableLeft="@drawable/ic_man_white"
android:drawablePadding="2dp"
android:gravity="center"
android:includeFontPadding="false"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/white"
android:textSize="10sp"
app:corner="6dp"
app:layout_constraintBottom_toBottomOf="@id/tv_nickname"
app:layout_constraintStart_toEndOf="@id/tv_nickname"
app:layout_constraintTop_toTopOf="@id/tv_nickname"
app:solid="#EF82B6"
tools:text="12" />
<TextView <TextView
android:id="@+id/tv_nickname" android:id="@+id/tv_nickname"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:textColor="#ff333333" android:textColor="@color/color_1F1A4E"
android:textSize="16sp" android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tv_id" app:layout_constraintBottom_toTopOf="@id/tv_id"
app:layout_constraintStart_toEndOf="@id/iv_avatar" app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar" app:layout_constraintTop_toTopOf="@id/iv_avatar"
@@ -57,11 +35,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:textColor="#ff999999" android:textColor="@color/color_b3b3b3"
android:textSize="14sp" android:textSize="@dimen/sp_12"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_avatar" app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toBottomOf="@id/tv_gender" app:layout_constraintTop_toBottomOf="@id/tv_nickname"
tools:text="ID:123456" /> tools:text="ID:123456" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -965,6 +965,7 @@
<string name="me_personal_center">個人中心</string> <string name="me_personal_center">個人中心</string>
<string name="me_my_room">我的房間</string> <string name="me_my_room">我的房間</string>
<string name="me_gain_recording">收益記錄</string> <string name="me_gain_recording">收益記錄</string>
<string name="me_clean_diamond">轉贈鉆石</string>
<!--登錄--> <!--登錄-->
<string name="login_contact_service">請聯系客服處理</string> <string name="login_contact_service">請聯系客服處理</string>
@@ -4905,5 +4906,6 @@
<string name="share_link">複製鏈接</string> <string name="share_link">複製鏈接</string>
<string name="association_list">公會周榜</string> <string name="association_list">公會周榜</string>
<string name="association_list_empty">還沒有公會榜單哦</string> <string name="association_list_empty">還沒有公會榜單哦</string>
<string name="me_give_gold_empty">暫無轉贈記錄</string>
</resources> </resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -9,35 +9,55 @@
android:id="@+id/title_bar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <LinearLayout
android:id="@+id/llSearch" android:id="@+id/llSearch"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="30dp" android:layout_height="32dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:background="@drawable/bg_search_edit" android:background="@drawable/bg_search_user"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_bar"> app:layout_constraintTop_toBottomOf="@id/title_bar">
<TextView <EditText
android:layout_width="match_parent" android:id="@+id/etSearch"
android:layout_height="match_parent" android:layout_width="0dp"
android:layout_marginStart="10dp" android:layout_weight="1"
android:background="@null" android:layout_height="30dp"
android:drawableStart="@mipmap/icon_little_search" android:background="@android:color/transparent"
android:drawablePadding="5dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:maxLength="20" android:imeOptions="actionSearch"
android:text="@string/search_hint" android:singleLine="true"
android:textColor="@color/color_999999" android:hint="@string/search_hint"
android:paddingStart="@dimen/dp_15"
android:paddingEnd="@dimen/dp_15"
android:textColor="@color/color_1F1A4E"
android:textColorHint="@color/text_color_secondary" android:textColorHint="@color/text_color_secondary"
android:textSize="14sp" /> android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/mTvSearch"
android:text="@string/search"
android:textSize="@dimen/sp_14"
android:textColor="@color/color_white"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_3"
android:paddingBottom="@dimen/dp_3"
android:layout_marginEnd="@dimen/dp_3"
android:background="@drawable/bg_common_confirm_press"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginBottom="@dimen/dp_3"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>
@@ -53,13 +73,20 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSearch" /> app:layout_constraintTop_toBottomOf="@id/llSearch" />
<androidx.recyclerview.widget.RecyclerView <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/recyclerView" android:id="@+id/refreshLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="15dp" app:layout_constraintTop_toBottomOf="@+id/tvLately"
app:layout_constraintTop_toBottomOf="@id/tvLately" app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toBottomOf="parent"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:overScrollMode="never"
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout >
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -12,6 +12,8 @@ import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo import com.yizhuan.xchat_android_core.room.bean.MeCenterInfo
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
import com.yizhuan.xchat_android_core.room.game.GameInfo import com.yizhuan.xchat_android_core.room.game.GameInfo
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo
import com.yizhuan.xchat_android_core.user.bean.SearchUserInfo
import com.yizhuan.xchat_android_core.user.bean.UserInfo import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_core.utils.net.RxHelper import com.yizhuan.xchat_android_core.utils.net.RxHelper
import com.yizhuan.xchat_android_core.utils.net.launchRequest import com.yizhuan.xchat_android_core.utils.net.launchRequest
@@ -101,6 +103,16 @@ object HomeModel : BaseModel() {
) )
} }
suspend fun getDiamondGiveHistory(page: Int, pageSize: Int): List<DiamondGiveHistoryInfo>? =
launchRequest {
api.getRecord(page, pageSize)
}
suspend fun getSearchUser(erbanNo: Long): SearchUserInfo? =
launchRequest {
api.getSearchUser(erbanNo)
}
suspend fun getHotRoom(): List<HomeRoomInfo>? = suspend fun getHotRoom(): List<HomeRoomInfo>? =
launchRequest { launchRequest {
api.getHotRoom() api.getHotRoom()
@@ -394,6 +406,27 @@ object HomeModel : BaseModel() {
@GET("/home/playV2") @GET("/home/playV2")
suspend fun apiHomePlayV2(): ServiceResult<List<HomeRoomInfo>> suspend fun apiHomePlayV2(): ServiceResult<List<HomeRoomInfo>>
/**
* 轉贈鉆石歷史記錄
*
* @return
*/
@GET("/user/diamond/giveRecord")
suspend fun getRecord(
@Query("pageNum") pageNum: Int?,
@Query("pageSize") pageSize: Int?
): ServiceResult<List<DiamondGiveHistoryInfo>>
/**
* 精確搜索用戶
*
* @return
*/
@POST("/user/diamond/searchUser")
suspend fun getSearchUser(
@Query("erbanNo") erbanNo: Long?
): ServiceResult<SearchUserInfo>
} }
} }

View File

@@ -27,6 +27,13 @@ public class InitInfo implements Serializable {
private NobleResourceComponent nobleResource; private NobleResourceComponent nobleResource;
private List<MonsterInitInfo> monsters; private List<MonsterInitInfo> monsters;
private List<Long> giveDiamondErbanNoList;
/** 每日转赠钻石总额限制 */
private Long giveDiamondDailyNum;
/** 转赠钻石单笔最大限额 */
private Long giveDiamondOnceLimitNum;
/** 转赠手续费率 */
private Double giveDiamondRate;
private double exchangeGoldRate;// 钻石兑换钻石比率 private double exchangeGoldRate;// 钻石兑换钻石比率
private double exchangeRate;// 钻石兑换钻石比率 private double exchangeRate;// 钻石兑换钻石比率

View File

@@ -627,10 +627,10 @@ public class PayModel extends BaseModel implements IPayModel {
* @return * @return
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("/user/gold/give") @POST("/user/diamond/give")
Single<ServiceResult<String>> giveGold(@Field("toUid") long toUid, Single<ServiceResult<String>> giveGold(@Field("toUid") long toUid,
@Field("goldNum") String goldNum, @Field("diamondNum") String diamondNum,
@Field("password") String password); @Field("payPwd") String payPwd);
/** /**
* 获取首充产品列表 * 获取首充产品列表

View File

@@ -6,6 +6,7 @@ import com.yizhuan.xchat_android_core.base.IModel;
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo; import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult; import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_core.home.bean.VisitorInfo; import com.yizhuan.xchat_android_core.home.bean.VisitorInfo;
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo;
import com.yizhuan.xchat_android_core.user.bean.GiftAchievementInfo; import com.yizhuan.xchat_android_core.user.bean.GiftAchievementInfo;
import com.yizhuan.xchat_android_core.user.bean.GiftWallInfo; import com.yizhuan.xchat_android_core.user.bean.GiftWallInfo;
import com.yizhuan.xchat_android_core.user.bean.NewUserInfo; import com.yizhuan.xchat_android_core.user.bean.NewUserInfo;
@@ -217,7 +218,7 @@ public interface IUserModel extends IModel {
*/ */
Single<String> getRandomAvatar(); Single<String> getRandomAvatar();
Single<List<UserInfo>> getGiveUserList(); Single<List<DiamondGiveHistoryInfo>> getGiveUserList(int page, int pageSize);
@Nullable @Nullable
String getPreFillInviteCode(); String getPreFillInviteCode();

View File

@@ -21,6 +21,7 @@ import com.yizhuan.xchat_android_core.home.bean.VisitorInfo;
import com.yizhuan.xchat_android_core.level.event.CharmLevelUpEvent; import com.yizhuan.xchat_android_core.level.event.CharmLevelUpEvent;
import com.yizhuan.xchat_android_core.level.event.LevelUpEvent; import com.yizhuan.xchat_android_core.level.event.LevelUpEvent;
import com.yizhuan.xchat_android_core.noble.NobleUtil; import com.yizhuan.xchat_android_core.noble.NobleUtil;
import com.yizhuan.xchat_android_core.user.bean.DiamondGiveHistoryInfo;
import com.yizhuan.xchat_android_core.user.bean.GiftAchievementInfo; import com.yizhuan.xchat_android_core.user.bean.GiftAchievementInfo;
import com.yizhuan.xchat_android_core.user.bean.GiftWallInfo; import com.yizhuan.xchat_android_core.user.bean.GiftWallInfo;
import com.yizhuan.xchat_android_core.user.bean.NewUserInfo; import com.yizhuan.xchat_android_core.user.bean.NewUserInfo;
@@ -769,8 +770,8 @@ public final class UserModel extends BaseModel implements IUserModel {
} }
@Override @Override
public Single<List<UserInfo>> getGiveUserList() { public Single<List<DiamondGiveHistoryInfo>> getGiveUserList(int page, int pageSize) {
return api.getGiveUserList() return api.getGiveUserList(page, pageSize)
.compose(RxHelper.handleBeanData()) .compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers()); .compose(RxHelper.handleSchedulers());
} }
@@ -1014,8 +1015,9 @@ public final class UserModel extends BaseModel implements IUserModel {
* *
* @return - * @return -
*/ */
@GET("user/gold/give/recent") @GET("/user/diamond/giveRecord")
Single<ServiceResult<List<UserInfo>>> getGiveUserList(); Single<ServiceResult<List<DiamondGiveHistoryInfo>>> getGiveUserList(@Query("page") int page,
@Query("pageSize") int pageSize);
/** /**

View File

@@ -0,0 +1,22 @@
package com.yizhuan.xchat_android_core.user.bean;
import java.io.Serializable;
import lombok.Data;
@Data
public class DiamondGiveHistoryInfo implements Serializable {
private Long id;//记录 id
private Long fromUid;//用户uid
private Long targetUid;//对方用户uid
private Long targetErbanNo;//对方平台id
private String targetNick;//对方用户信息
private String targetAvatar;//對方用戶頭像
private Long diamondNum;//转赠给对方的数量
private Double realDiamondNum;//转赠实际支出的数量,包含手续费
private String createTime;//创建时间
private String updateTime;//更新时间
}

View File

@@ -0,0 +1,36 @@
package com.yizhuan.xchat_android_core.user.bean;
import java.io.Serializable;
import lombok.Data;
@Data
public class SearchUserInfo implements Serializable {
/**
* 用户uid
*/
private Long uid;
/**
* 平台号
*/
private Long erbanNo;
/**
* 头像
*/
private String avatar;
/**
* 昵称
*/
private String nick;
/**
* 性别 1.男 2.女
*/
private Byte gender;
/**
* 生日
*/
private String birth;
}

View File

@@ -26,7 +26,7 @@ public class AppMetaDataUtil {
*/ */
public static String getChannelID() { public static String getChannelID() {
String channelID = BasicConfig.INSTANCE.getChannel(); String channelID = BasicConfig.INSTANCE.getChannel();
channelID = TextUtils.isEmpty(channelID) ? "official" : channelID; channelID = TextUtils.isEmpty(channelID) ? "google" : channelID;
return channelID; return channelID;
} }