|
|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|
|
import android.app.Dialog
|
|
|
import android.content.Intent
|
|
|
import android.os.Bundle
|
|
|
+import android.text.InputType
|
|
|
import android.text.TextUtils
|
|
|
import android.view.Gravity
|
|
|
import android.widget.EditText
|
|
|
@@ -28,6 +29,7 @@ class FeedbackActivity : MyAppCompatActivity() {
|
|
|
}
|
|
|
|
|
|
private lateinit var inputEdit: EditText
|
|
|
+ private lateinit var phoneEdit: EditText
|
|
|
private var loadingDialog: Dialog? = null
|
|
|
private lateinit var textAmount : TextView
|
|
|
|
|
|
@@ -108,12 +110,47 @@ class FeedbackActivity : MyAppCompatActivity() {
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
+ text = "联系电话"
|
|
|
+ textSizeAuto = 40
|
|
|
+ textColorInt = R.color.p_global_black_color
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = margerding
|
|
|
+ topMargin = autoSize(32)
|
|
|
+ }
|
|
|
+
|
|
|
+ editText{
|
|
|
+ phoneEdit = this
|
|
|
+ gravity = Gravity.TOP
|
|
|
+ hintColorStr = "#cccccc"
|
|
|
+ textColorStr = "#000000"
|
|
|
+ inputType = InputType.TYPE_CLASS_PHONE
|
|
|
+ hint = "请输入联系电话"
|
|
|
+ maxLines = 1
|
|
|
+ maxEms = 15
|
|
|
+ ellipsize = TextUtils.TruncateAt.END
|
|
|
+ backgroundDrawable = createRoundRectDrawable("#f6f6f8", 10)
|
|
|
+ textSizeAuto = 36
|
|
|
+ setPadding(autoSize(20), autoSize(20),0,autoSize(20))
|
|
|
+ }.lparams(matchParent, matchParent) {
|
|
|
+ marginStart = autoSize(20)
|
|
|
+ marginEnd = autoSize(20)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
onThrottleFirstClick {
|
|
|
if (inputEdit.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入留言内容")
|
|
|
return@onThrottleFirstClick
|
|
|
}
|
|
|
- viewModule.addMessageBoard(message = inputEdit.text.toString())
|
|
|
+ if (phoneEdit.text.toString().isNullOrEmpty()) {
|
|
|
+ ToastUtils.showLong("请输入联系电话")
|
|
|
+ return@onThrottleFirstClick
|
|
|
+ }
|
|
|
+ if (phoneEdit.text.toString().length < 7) {
|
|
|
+ ToastUtils.showLong("请输入正确的联系电话")
|
|
|
+ return@onThrottleFirstClick
|
|
|
+ }
|
|
|
+ viewModule.addMessageBoard(message = inputEdit.text.toString(), phone = phoneEdit.text.toString().trim())
|
|
|
}
|
|
|
text = "提交留言"
|
|
|
backgroundResource = R.drawable.hn_market_item_botton_bg_2
|
|
|
@@ -141,7 +178,7 @@ class FeedbackActivity : MyAppCompatActivity() {
|
|
|
|
|
|
viewModule.messgelist.bindOptional(context) {
|
|
|
it?.forEach { data ->
|
|
|
- feedbackItemUI(data.message, TimeUtils.covnDate(data.createtime))
|
|
|
+ feedbackItemUI(data.message, TimeUtils.covnDate(data.createtime), data.contactnum)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -162,13 +199,14 @@ class FeedbackActivity : MyAppCompatActivity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private fun _LinearLayout.feedbackItemUI(messge: String, time: String) {
|
|
|
+ private fun _LinearLayout.feedbackItemUI(messge: String, time: String, phone: String) {
|
|
|
val marginpadding = autoSize(32)
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
val intentAccount = Intent()
|
|
|
intentAccount.putExtra("messge",messge)
|
|
|
intentAccount.putExtra("time",time)
|
|
|
+ intentAccount.putExtra("phone", phone)
|
|
|
intentAccount.setClass(context, FeedbackDetailsActivity::class.java)
|
|
|
startActivity(intentAccount)
|
|
|
}
|