Commit a8032d68 by 王佳洋

1,修改昵称

2,修改简介开发中
parent 58b1ac72
...@@ -4,7 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseCommand ...@@ -4,7 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseCommand
data class UserModifyAuditRespDto( data class UserModifyAuditRespDto(
val auditReason: String?, // 审核原因 val auditReason: String?, // 审核原因
val auditStatus: Int, // 审核状态 1待审核,2审核失败,3已审核 val auditStatus: Int, // 审核状态 1审核中,2审核失败,3已审核
val auditTime: String?, // 审核时间 val auditTime: String?, // 审核时间
val auditor: String?, // 审核人 val auditor: String?, // 审核人
val auditorId: String?, // 审核人id val auditorId: String?, // 审核人id
......
...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.BaseActivity ...@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.extend.visible
import com.ydl.ydlcommon.view.DeleteEditTextView import com.ydl.ydlcommon.view.DeleteEditTextView
import com.ydl.ydlcommon.view.TitleBar import com.ydl.ydlcommon.view.TitleBar
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
...@@ -21,7 +22,6 @@ import com.yidianling.common.tools.ToastUtil ...@@ -21,7 +22,6 @@ import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.UserHttpImpl.Companion.getInstance import com.yidianling.user.http.UserHttpImpl.Companion.getInstance
import com.yidianling.user.http.request.ModifyBaseInfo import com.yidianling.user.http.request.ModifyBaseInfo
import com.yidianling.user.http.request.UserModifyAuditRespDto import com.yidianling.user.http.request.UserModifyAuditRespDto
...@@ -65,6 +65,7 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -65,6 +65,7 @@ class ModifyInfoActivity : BaseActivity() {
findView() findView()
val from = intent.getIntExtra("from", 0) val from = intent.getIntExtra("from", 0)
if (INTRODUCTION == from) { if (INTRODUCTION == from) {
tb_title_bar.title = "简介"
det_set_info.layoutParams.height = RxImageTool.dp2px(180f) det_set_info.layoutParams.height = RxImageTool.dp2px(180f)
} }
val userInfo = findRouteService(IUserService::class.java).getUserInfo() val userInfo = findRouteService(IUserService::class.java).getUserInfo()
...@@ -77,43 +78,49 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -77,43 +78,49 @@ class ModifyInfoActivity : BaseActivity() {
if (response.code != "200") return@subscribe if (response.code != "200") return@subscribe
val (_, auditStatus, _, _, _, _, _, last7Day, modifyAfter) = response.data val (_, auditStatus, _, _, _, _, _, last7Day, modifyAfter) = response.data
if (NICKNAME == from) { if (NICKNAME == from) {
if (last7Day) { // 7天内 when (auditStatus) {
1 -> { // 审核中
tv_tip1.visible()
tv_tip1.text = "抱歉,七天内只能修改一次昵称" tv_tip1.text = "抱歉,七天内只能修改一次昵称"
tv_tip1.visibility = View.VISIBLE
tb_title_bar.setRightTextEnable(false) tb_title_bar.setRightTextEnable(false)
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_9d9ea7)) tb_title_bar.setRightTextColor(resources.getColor(R.color.color_9d9ea7))
det_set_info.setTextColor(resources.getColor(R.color.color_9d9ea7))
when (auditStatus) {
1 -> { // 审核中
det_set_info.keyListener = null det_set_info.keyListener = null
det_set_info.setTextColor(resources.getColor(R.color.color_9d9ea7))
det_set_info.setOnClickListener { det_set_info.setOnClickListener {
ToastUtil.toastShort( ToastUtil.toastShort(
"昵称审核中,预计24小时内审核完成" "昵称审核中,预计24小时内审核完成"
) )
} }
det_set_info.setText(modifyAfter) det_set_info.setText(modifyAfter)
tv_tip2.visibility = View.VISIBLE tv_tip2.visible()
tv_tip2.text = "昵称审核中,预计24小时内审核完成,暂无法修改。" tv_tip2.text = "昵称审核中,预计24小时内审核完成,暂无法修改。"
} }
2 -> { // 审核失败 2 -> { // 审核失败
det_set_info.isEnabled = false tv_tip1.visible()
tv_tip2.visibility = View.VISIBLE tv_tip1.text = "七天内可修改一次昵称"
iv_warn.visibility = View.VISIBLE iv_warn.visible()
val ss = SpannableString("审核失败 ,昵称中含有违规文字。如有疑问联系客服小壹") tv_tip2.visible()
ss.setSpan( tv_tip2.text = SpannableString("审核失败 ,昵称中含有违规文字。如有疑问联系客服小壹").also {
it.setSpan(
ForegroundColorSpan(resources.getColor(R.color.color_1DA1F2)), ForegroundColorSpan(resources.getColor(R.color.color_1DA1F2)),
22, 22,
ss.length, it.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
) )
tv_tip2.text = ss }
tv_tip2.setOnClickListener { tv_tip2.setOnClickListener { // 客服
ARouter.getInstance().navigation( ARouter.getInstance().navigation(
IImService::class.java IImService::class.java
).startKefuChat(this, "", 0, 0) ).startKefuChat(this, "", 0, 0)
} }
} }
else -> { // 3: 审核成功 3 -> { // 审核成功
if (last7Day) {
tv_tip1.visible()
tv_tip1.text = "抱歉,七天内只能修改一次昵称"
tb_title_bar.setRightTextEnable(false)
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_9d9ea7))
det_set_info.setTextColor(resources.getColor(R.color.color_9d9ea7))
det_set_info.keyListener = null det_set_info.keyListener = null
det_set_info.setOnClickListener { det_set_info.setOnClickListener {
ToastUtil.toastShort( ToastUtil.toastShort(
...@@ -121,36 +128,35 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -121,36 +128,35 @@ class ModifyInfoActivity : BaseActivity() {
) )
} }
det_set_info.setText(modifyAfter) det_set_info.setText(modifyAfter)
tv_tip2.visibility = View.GONE
userInfo?.nick_name = modifyAfter userInfo?.nick_name = modifyAfter
}
}
} else { } else {
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()) {
mDisposable.add(
getInstance().modifyUserBaseInfo(
ModifyBaseInfo(
det_set_info.text.toString(),
101
)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
ToastUtil.toastShort("提交成功,昵称审核中,预计24小时内审核完成")
setResult(RESULT_OK, intent)
finish()
}
)
} }
} }
} }
} else if (INTRODUCTION == from) { } else if (INTRODUCTION == from) {
when (auditStatus) {
1 -> { // 审核中
} }
2 -> { // 审核失败
}
3 -> { // 审核成功
tb_title_bar.setRightTextColor(resources.getColor(R.color.color_1DA1F2))
tb_title_bar.setOnClickListener {
showProgressDialog("保存中")
modifyUserBaseInfo(103) {
dismissProgressDialog()
ToastUtil.toastShort("提交成功,简介审核中,预计24小时内审核完成")
}
}
}
}
}
}) })
} }
...@@ -167,4 +173,20 @@ class ModifyInfoActivity : BaseActivity() { ...@@ -167,4 +173,20 @@ class ModifyInfoActivity : BaseActivity() {
} }
return true return true
} }
private fun modifyUserBaseInfo(type: Int, block: () -> Unit) {
mDisposable.add(
getInstance().modifyUserBaseInfo(
ModifyBaseInfo(
det_set_info.text.toString(),
type
)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
block.invoke()
}
)
}
} }
\ No newline at end of file
...@@ -340,7 +340,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi ...@@ -340,7 +340,7 @@ public class PersonalInfoActivity extends BaseActivity implements View.OnClickLi
}); });
builderm.create().show(); builderm.create().show();
} else if (id == R.id.jtv_jianjie) {//个人简介 } else if (id == R.id.jtv_jianjie) {//个人简介
Intent intent1 = new Intent(this, PersonalDesActivity.class); Intent intent1 = new Intent(this, ModifyInfoActivity.class);
startActivity(intent1); startActivity(intent1);
} }
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
android:background="@drawable/bg_corner_8_white" android:background="@drawable/bg_corner_8_white"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingTop="15dp" android:paddingTop="15dp"
android:textColor="@color/color_1C1F28"
android:paddingBottom="15dp" android:paddingBottom="15dp"
android:singleLine="true" /> android:singleLine="true" />
......
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