Commit e94cf267 by 王佳洋

1.修改昵称

1.修改简介
parent 7c369f43
...@@ -67,6 +67,7 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -67,6 +67,7 @@ class ModifyInfoActivity : BaseActivity() {
if (INTRODUCTION == from) { if (INTRODUCTION == from) {
tb_title_bar.title = "简介" tb_title_bar.title = "简介"
det_set_info.layoutParams.height = RxImageTool.dp2px(180f) det_set_info.layoutParams.height = RxImageTool.dp2px(180f)
det_set_info.hint = "一句话介绍下自己"
} }
val userInfo = findRouteService(IUserService::class.java).getUserInfo() val userInfo = findRouteService(IUserService::class.java).getUserInfo()
det_set_info.setText(userInfo?.nick_name) det_set_info.setText(userInfo?.nick_name)
...@@ -99,22 +100,9 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -99,22 +100,9 @@ class ModifyInfoActivity : BaseActivity() {
tv_tip1.visible() tv_tip1.visible()
tv_tip1.text = "七天内可修改一次昵称" tv_tip1.text = "七天内可修改一次昵称"
iv_warn.visible() iv_warn.visible()
tv_tip2.visible() customerService("审核失败 ,昵称中含有违规文字。如有疑问联系客服小壹")
tv_tip2.text = SpannableString("审核失败 ,昵称中含有违规文字。如有疑问联系客服小壹").also {
it.setSpan(
ForegroundColorSpan(resources.getColor(R.color.color_1DA1F2)),
22,
it.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
tv_tip2.setOnClickListener { // 客服
ARouter.getInstance().navigation(
IImService::class.java
).startKefuChat(this, "", 0, 0)
}
} }
3 -> { // 审核成功 3 -> { // 审核成功 || 提交审核
if (last7Day) { if (last7Day) {
tv_tip1.visible() tv_tip1.visible()
tv_tip1.text = "抱歉,七天内只能修改一次昵称" tv_tip1.text = "抱歉,七天内只能修改一次昵称"
...@@ -127,31 +115,57 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -127,31 +115,57 @@ class ModifyInfoActivity : BaseActivity() {
"抱歉,七天内只能修改一次" "抱歉,七天内只能修改一次"
) )
} }
det_set_info.setText(modifyAfter) modifyAfter?.let {
userInfo?.nick_name = modifyAfter det_set_info.setText(it)
userInfo?.nick_name = it
}
} else { } else {
tv_tip1.visible() tv_tip1.visible()
tv_tip1.text = "七天内可修改一次昵称" tv_tip1.text = "七天内可修改一次昵称"
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2)) tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2))
tb_title_bar.setOnRightTextClick { _: View?, _: Boolean ->
if (checkInput()) {
modifyUserBaseInfo(101) {
ToastUtil.toastShort("提交成功,昵称审核中,预计24小时内审核完成")
setResult(RESULT_OK, intent)
finish()
}
}
}
} }
} }
} }
} else if (INTRODUCTION == from) { } else if (INTRODUCTION == from) {
when (auditStatus) { when (auditStatus) {
1 -> { // 审核中 1 -> { // 审核中
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_9d9ea7))
tb_title_bar.isEnabled = false
det_set_info.setText(modifyAfter)
det_set_info.keyListener = null
det_set_info.setTextColor(resources.getColor(R.color.color_9d9ea7))
det_set_info.setOnClickListener {
ToastUtil.toastShort(
"简介审核中,预计24小时内审核完成"
)
}
tv_tip2.visible()
tv_tip2.text = "审核中 预计24小时内审核完成,暂无法修改"
} }
2 -> { // 审核失败 2 -> { // 审核失败
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2))
iv_warn.visible()
customerService("审核失败,简介中含违规文字如有疑问联系客服小壹")
} }
3 -> { // 审核成功 3 -> { // 审核成功 || 提交审核
modifyAfter?.let {
det_set_info.setText(it)
userInfo?.description = it
}
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2)) tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2))
tb_title_bar.setOnClickListener { tb_title_bar.setOnClickListener {
showProgressDialog("保存中")
modifyUserBaseInfo(103) { modifyUserBaseInfo(103) {
dismissProgressDialog()
ToastUtil.toastShort("提交成功,简介审核中,预计24小时内审核完成") ToastUtil.toastShort("提交成功,简介审核中,预计24小时内审核完成")
userInfo?.description = finish()
} }
} }
} }
...@@ -160,6 +174,26 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -160,6 +174,26 @@ class ModifyInfoActivity : BaseActivity() {
}) })
} }
/**
* 客服提示
*/
private fun customerService(tip: String) {
tv_tip2.visible()
tv_tip2.text = SpannableString(tip).also {
it.setSpan(
ForegroundColorSpan(resources.getColor(R.color.color_1DA1F2)),
it.indexOf("客服"),
it.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
}
tv_tip2.setOnClickListener { // 客服
ARouter.getInstance().navigation(
IImService::class.java
).startKefuChat(this, "", 0, 0)
}
}
private fun checkInput(): Boolean { private fun checkInput(): Boolean {
if (det_set_info.text.isEmpty()) { if (det_set_info.text.isEmpty()) {
ToastUtil.toastShort("请输入昵称") ToastUtil.toastShort("请输入昵称")
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
android:id="@+id/det_set_info" android:id="@+id/det_set_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:textColorHint="@color/color_C3C4CA"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="@drawable/bg_corner_8_white" android:background="@drawable/bg_corner_8_white"
......
...@@ -132,5 +132,6 @@ ...@@ -132,5 +132,6 @@
<color name="color_FAFAFF">#FAFAFF</color> <color name="color_FAFAFF">#FAFAFF</color>
<color name="color_242424">#242424</color> <color name="color_242424">#242424</color>
<color name="color_9d9ea7">#9D9EA7</color> <color name="color_9d9ea7">#9D9EA7</color>
<color name="color_C3C4CA">#C3C4CA</color>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment