|
|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|
|
import android.content.Intent
|
|
|
import android.os.Build
|
|
|
import android.view.Gravity
|
|
|
+import android.view.View
|
|
|
import android.view.inputmethod.EditorInfo
|
|
|
import android.widget.CheckBox
|
|
|
import android.widget.EditText
|
|
|
@@ -82,19 +83,22 @@ class TradeCircleListedBuyUI(
|
|
|
lateinit var listednumberEdittext: MangeNumberEditText2
|
|
|
|
|
|
//挂牌最大数量
|
|
|
- val maxlistedNumber : MutableLiveData<Int> = MutableLiveData()
|
|
|
+ val maxlistedNumber: MutableLiveData<Int> = MutableLiveData()
|
|
|
|
|
|
//起摘数量输入框
|
|
|
lateinit var startInputNumber: EditText
|
|
|
|
|
|
//履约保证金
|
|
|
- lateinit var performance_bond : EditText
|
|
|
+ lateinit var performance_bond: EditText
|
|
|
+
|
|
|
//挂牌有效期
|
|
|
lateinit var validity_of_listing: TextView
|
|
|
+
|
|
|
//选择的履约模版数据
|
|
|
- val selectPerformanceStepData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
|
|
|
+ val selectPerformanceStepData: MutableLiveData<PermancePlanTmpData> = MutableLiveData()
|
|
|
+
|
|
|
//选择的朋友列表
|
|
|
- val selectFriendList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
|
|
|
+ val selectFriendList: MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
|
|
|
|
|
|
/**
|
|
|
* 是否可议价的选择
|
|
|
@@ -105,6 +109,8 @@ class TradeCircleListedBuyUI(
|
|
|
* 是否整单
|
|
|
*/
|
|
|
lateinit var whole_list: CheckBox
|
|
|
+ val whole_list_live_data: MutableLiveData<Boolean> =
|
|
|
+ MutableLiveData<Boolean>().apply { value = false }
|
|
|
|
|
|
/**
|
|
|
* 朋友是否不限
|
|
|
@@ -295,7 +301,9 @@ class TradeCircleListedBuyUI(
|
|
|
buttonDrawable = null
|
|
|
background =
|
|
|
resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
-
|
|
|
+ setOnCheckedChangeListener { compoundButton, b ->
|
|
|
+ whole_list_live_data.postValue(b)
|
|
|
+ }
|
|
|
}.lparams(autoSize(41), autoSize(41)) {
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
@@ -377,6 +385,13 @@ class TradeCircleListedBuyUI(
|
|
|
itemView()
|
|
|
|
|
|
linearLayout {
|
|
|
+ whole_list_live_data.bindOptional(context) {
|
|
|
+ if (it == true) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
|
textView {
|
|
|
@@ -414,7 +429,8 @@ class TradeCircleListedBuyUI(
|
|
|
if (hasType == "1") {
|
|
|
text = "最小单位" + data.minivalue + data.enumdicname
|
|
|
} else {
|
|
|
- text = "最小单位" + listedData.WrFtWrstandard?.minivalue + listedData.WrFtWrstandard?.enumdicname
|
|
|
+ text =
|
|
|
+ "最小单位" + listedData.WrFtWrstandard?.minivalue + listedData.WrFtWrstandard?.enumdicname
|
|
|
}
|
|
|
|
|
|
textSizeAuto = 29
|
|
|
@@ -507,7 +523,7 @@ class TradeCircleListedBuyUI(
|
|
|
onThrottleFirstClick {
|
|
|
val intent = Intent()
|
|
|
intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
|
|
|
- activity.startActivityForResult(intent,1003)
|
|
|
+ activity.startActivityForResult(intent, 1003)
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
@@ -545,11 +561,11 @@ class TradeCircleListedBuyUI(
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
onThrottleFirstClick {
|
|
|
- if (no_friend.isChecked.not()){
|
|
|
+ if (no_friend.isChecked.not()) {
|
|
|
val intent = Intent()
|
|
|
intent.setClass(context, SelectFriendActivty::class.java)
|
|
|
- activity.startActivityForResult(intent,1001)
|
|
|
- }else{
|
|
|
+ activity.startActivityForResult(intent, 1001)
|
|
|
+ } else {
|
|
|
ToastUtils.showLong("勾选不限后不能选择朋友")
|
|
|
}
|
|
|
|
|
|
@@ -590,7 +606,7 @@ class TradeCircleListedBuyUI(
|
|
|
buttonDrawable = null
|
|
|
background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
|
|
|
|
|
|
- }.lparams(autoSize(41), autoSize(41)){
|
|
|
+ }.lparams(autoSize(41), autoSize(41)) {
|
|
|
marginStart = autoSize(36)
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
@@ -599,7 +615,7 @@ class TradeCircleListedBuyUI(
|
|
|
text = "不限"
|
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_zhushi_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
marginEnd = autoSize(36)
|
|
|
}
|
|
|
}.lparams(wrapContent, autoSize(132))
|
|
|
@@ -640,7 +656,7 @@ class TradeCircleListedBuyUI(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fun getSelectFriendList() : List<String>{
|
|
|
+ fun getSelectFriendList(): List<String> {
|
|
|
val returnList = arrayListOf<String>()
|
|
|
selectFriendList.value?.forEach {
|
|
|
returnList.add(it.frienduserid?.toString() ?: "")
|
|
|
@@ -651,7 +667,7 @@ class TradeCircleListedBuyUI(
|
|
|
/**
|
|
|
* 提交资料前的校验
|
|
|
*/
|
|
|
- fun check() : Boolean{
|
|
|
+ fun check(): Boolean {
|
|
|
if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入挂牌价格")
|
|
|
return false
|
|
|
@@ -674,19 +690,23 @@ class TradeCircleListedBuyUI(
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (hasType == "1"){
|
|
|
- if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
- ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
- return false
|
|
|
- }
|
|
|
- }else{
|
|
|
- if (startInputNumber.text.toString().toLong() < listedData.WrFtWrstandard?.minivalue?.toLong() ?: 0) {
|
|
|
- ToastUtils.showLong("起摘数量不能小于" + listedData.WrFtWrstandard?.minivalue)
|
|
|
- return false
|
|
|
+ if (whole_list.isChecked.not()) {
|
|
|
+ if (hasType == "1") {
|
|
|
+ if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
|
|
|
+ ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (startInputNumber.text.toString()
|
|
|
+ .toLong() < listedData.WrFtWrstandard?.minivalue?.toLong() ?: 0
|
|
|
+ ) {
|
|
|
+ ToastUtils.showLong("起摘数量不能小于" + listedData.WrFtWrstandard?.minivalue)
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (performance_bond.text.toString().isNullOrEmpty()){
|
|
|
+ if (performance_bond.text.toString().isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请输入履约保证金比例")
|
|
|
return false
|
|
|
}
|
|
|
@@ -695,13 +715,13 @@ class TradeCircleListedBuyUI(
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
|
|
|
+ if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择履约模版")
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (no_friend.isChecked.not()){
|
|
|
- if (selectFriendList.value.isNullOrEmpty()){
|
|
|
+ if (no_friend.isChecked.not()) {
|
|
|
+ if (selectFriendList.value.isNullOrEmpty()) {
|
|
|
ToastUtils.showLong("请选择朋友")
|
|
|
return false
|
|
|
}
|