|
@@ -16,6 +16,7 @@ import androidx.viewpager.widget.PagerAdapter
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import cn.muchinfo.rma.R
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
|
|
+import cn.muchinfo.rma.global.data.AccountData
|
|
|
import cn.muchinfo.rma.global.data.OrderQuoteData
|
|
import cn.muchinfo.rma.global.data.OrderQuoteData
|
|
|
import cn.muchinfo.rma.global.data.OrderQuoteDetailData
|
|
import cn.muchinfo.rma.global.data.OrderQuoteDetailData
|
|
|
import cn.muchinfo.rma.global.data.SpotGoodsPriceData
|
|
import cn.muchinfo.rma.global.data.SpotGoodsPriceData
|
|
@@ -31,12 +32,16 @@ import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
|
|
|
import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
|
|
import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
|
|
|
import com.blankj.utilcode.util.ActivityUtils
|
|
import com.blankj.utilcode.util.ActivityUtils
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
|
|
+import com.blankj.utilcode.util.ToastUtils
|
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
|
|
|
+import mtp.polymer.com.autowidget.dialog.creatAccountDataSheetDialog
|
|
|
|
|
+import mtp.polymer.com.autowidget.dialog.creatGoodsInfoBottomSheetDialog
|
|
|
import mtp.polymer.com.autowidget.dialog.createCustomDialog
|
|
import mtp.polymer.com.autowidget.dialog.createCustomDialog
|
|
|
import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
|
|
|
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
|
|
|
import org.jetbrains.anko.*
|
|
import org.jetbrains.anko.*
|
|
|
import org.jetbrains.anko.support.v4.viewPager
|
|
import org.jetbrains.anko.support.v4.viewPager
|
|
|
|
|
|
|
@@ -49,19 +54,20 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
var selectedTabIndex: Int = 0
|
|
var selectedTabIndex: Int = 0
|
|
|
private lateinit var viewPager: ViewPager
|
|
private lateinit var viewPager: ViewPager
|
|
|
|
|
|
|
|
|
|
+ //1 仓单贸易 2 仓单预售
|
|
|
|
|
+ val type by lazy { intent.getStringExtra("type") }
|
|
|
|
|
+
|
|
|
|
|
+ //1是一口价 2是浮动价
|
|
|
|
|
+ val pricetype by lazy { intent.getStringExtra("pricetype") }
|
|
|
|
|
+
|
|
|
val data by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
|
|
val data by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
|
|
|
|
|
|
|
|
//卖大厅
|
|
//卖大厅
|
|
|
- private val sellHallUI by lazy { SellHallUI(this,viewModel) }
|
|
|
|
|
|
|
+ private val sellHallUI by lazy { SellHallUI(this,viewModel,type ?: "",pricetype ?: "",data) }
|
|
|
|
|
|
|
|
//买大厅
|
|
//买大厅
|
|
|
- private val buyHallUI by lazy { BuyHallUI(this,viewModel) }
|
|
|
|
|
|
|
+ private val buyHallUI by lazy { BuyHallUI(this,viewModel,type ?: "",pricetype ?: "",data) }
|
|
|
|
|
|
|
|
- /** 一口价摘牌输入框 **/
|
|
|
|
|
- lateinit var onePriceInputEdittext: MangeNumberEditText2
|
|
|
|
|
-
|
|
|
|
|
- /*** 一口价摘牌金额 **/
|
|
|
|
|
- lateinit var one_delisting_amount : TextView
|
|
|
|
|
|
|
|
|
|
/** 浮动价摘牌输入框 **/
|
|
/** 浮动价摘牌输入框 **/
|
|
|
lateinit var floatPriceInputEdittext: MangeNumberEditText2
|
|
lateinit var floatPriceInputEdittext: MangeNumberEditText2
|
|
@@ -113,9 +119,11 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @RequiresApi(Build.VERSION_CODES.O)
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
super.onCreate(savedInstanceState)
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
+ createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
|
initMenuData()
|
|
initMenuData()
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
|
//头部标题
|
|
//头部标题
|
|
@@ -325,13 +333,321 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
segment.setupWithViewPager(viewPager)
|
|
segment.setupWithViewPager(viewPager)
|
|
|
segment.selectTab(selectedTabIndex)
|
|
segment.selectTab(selectedTabIndex)
|
|
|
selectIndex.postValue(selectedTabIndex)
|
|
selectIndex.postValue(selectedTabIndex)
|
|
|
|
|
+
|
|
|
|
|
+ viewModel.showOnePriceDialog.bindOptional(context){
|
|
|
|
|
+ if (it == true){
|
|
|
|
|
+ creatOneSellOrBuyDialog(type = type ?: "",pricetype = pricetype ?: "",data = data,buySelldata = viewModel.selectData.value ?: OrderQuoteDetailData())
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//一口价 摘牌
|
|
//一口价 摘牌
|
|
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
|
- fun creatOneSellOrBuyDialog(data : OrderQuoteDetailData){
|
|
|
|
|
|
|
+ fun creatOneSellOrBuyDialog(type: String,pricetype: String,buySelldata : OrderQuoteDetailData,data: OrderQuoteData){
|
|
|
|
|
+
|
|
|
|
|
+ val selectAccountData : MutableLiveData<AccountData> = MutableLiveData()
|
|
|
|
|
+
|
|
|
|
|
+ /** 摘牌数量 **/
|
|
|
|
|
+ lateinit var onePriceInputNumberEdittext: MangeNumberEditText2
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /*** 一口价摘牌金额 **/
|
|
|
|
|
+ lateinit var one_delisting_amount : TextView
|
|
|
|
|
+
|
|
|
|
|
+ createCustomDialog(cancelable = false) { dialog ->
|
|
|
|
|
+
|
|
|
|
|
+ backgroundColor = Color.parseColor("#5f000000")
|
|
|
|
|
+ selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ creatAccountDataSheetDialog("请选择资金账号", GlobalDataCollection.instance?.accountDataList ?: arrayListOf()) {
|
|
|
|
|
+ selectAccountData.postValue(this)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "交易账户"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ selectAccountData.bindOptional(context){
|
|
|
|
|
+ text = it?.accountid.toString() + " " + it?.accountname
|
|
|
|
|
+ }
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
|
|
+ }.lparams(autoSize(36), autoSize(36))
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(172))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "挂牌方"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = buySelldata.username
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "挂牌价格"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = buySelldata.fixedprice
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "挂牌数量"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = buySelldata.orderqty
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "摘牌数量"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ topMargin = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "(10吨起)"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ topMargin = autoSize(20)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), autoSize(290))
|
|
|
|
|
+
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ numberEditText {
|
|
|
|
|
+ onePriceInputNumberEdittext = this
|
|
|
|
|
+ setOnTextChangeListener { view, value ->
|
|
|
|
|
+ one_delisting_amount.text = value?.toDouble()?.times(buySelldata.fixedprice?.toDouble() ?: 0.0).toString()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(0, autoSize(72),1f){
|
|
|
|
|
+ marginEnd = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "吨"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginEnd = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
|
|
+ min = 10
|
|
|
|
|
+ max = 100
|
|
|
|
|
+ isIndeterminate = false
|
|
|
|
|
+ splitTrack = false
|
|
|
|
|
+ setPadding(0,0,0,0)
|
|
|
|
|
+ thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
|
|
|
+ progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
|
|
+ setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
|
|
|
+ override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
|
|
|
|
|
+ onePriceInputNumberEdittext.text = NumberUtils.roundNum(buySelldata.orderqty?.toDouble()?.times(p1.div(100.0)).toString(),0)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun onStartTrackingTouch(p0: SeekBar?) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }.lparams(matchParent, autoSize(46)){
|
|
|
|
|
+ marginEnd = autoSize(110)
|
|
|
|
|
+ topMargin = autoSize(20)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "0"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = buySelldata.orderqty + "吨"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, wrapContent){
|
|
|
|
|
+ marginEnd = autoSize(110)
|
|
|
|
|
+ topMargin = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "摘牌金额"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(autoSize(214), wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ one_delisting_amount = this
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+ verticalEmptyView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ if (onePriceInputNumberEdittext.text.toString().isNullOrEmpty() || onePriceInputNumberEdittext.text.toString().toDouble() == 0.0){
|
|
|
|
|
+ return@onThrottleFirstClick
|
|
|
|
|
+ ToastUtils.showLong("请输入摘牌数量")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (buySelldata.buyorsell == "0"){//买单所以是摘卖
|
|
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
|
|
+ RelatedWRTradeOrderID = buySelldata.wrtradeorderid?.toLong() ?: 0,
|
|
|
|
|
+ WRTransferUserID = buySelldata.userid?.toInt() ?: 0,
|
|
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
|
|
|
|
|
+ BuyOrSell = 1,
|
|
|
|
|
+ LadingBillId = 0,
|
|
|
|
|
+ SubNum = 0,
|
|
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
|
|
+ HasWr = 1
|
|
|
|
|
+ ){
|
|
|
|
|
+ dialog.dismiss()
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{//卖单所以是摘买
|
|
|
|
|
+ viewModel.HdWRDealOrderReq(
|
|
|
|
|
+ RelatedWRTradeOrderID = buySelldata.wrtradeorderid?.toLong() ?: 0,
|
|
|
|
|
+ WRTransferUserID = buySelldata.userid?.toInt() ?: 0,
|
|
|
|
|
+ OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
|
|
|
|
|
+ BuyOrSell = 0,
|
|
|
|
|
+ LadingBillId = 0,
|
|
|
|
|
+ SubNum = 0,
|
|
|
|
|
+ WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
|
|
|
|
|
+ DeliveryMonth = data.deliverymonth ?: "",
|
|
|
|
|
+ HasWr = 1
|
|
|
|
|
+ ){
|
|
|
|
|
+ dialog.dismiss()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
|
|
+ text = "卖出"
|
|
|
|
|
+ textSizeAuto = 38
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
|
|
+ marginStart = autoSize(24)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ dialog.dismiss()
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ backgroundResource = R.drawable.hnxt_cancel_bg
|
|
|
|
|
+ text = "取消"
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ textSizeAuto = 38
|
|
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
|
|
+ marginStart = autoSize(13)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(144)) {
|
|
|
|
|
+ gravity = Gravity.BOTTOM
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, matchParent){
|
|
|
|
|
+ topMargin = autoSize(120)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.show()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //浮动价 摘牌
|
|
|
|
|
+ @RequiresApi(Build.VERSION_CODES.O)
|
|
|
|
|
+ fun creatFloatSellOrBuyDialog(type: String,pricetype: String,data : OrderQuoteDetailData){
|
|
|
|
|
|
|
|
createCustomDialog(cancelable = false) { dialog ->
|
|
createCustomDialog(cancelable = false) { dialog ->
|
|
|
|
|
|
|
@@ -393,7 +709,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
textView {
|
|
textView {
|
|
|
- text = "挂牌价格"
|
|
|
|
|
|
|
+ text = "基差"
|
|
|
textSizeAuto = 34
|
|
textSizeAuto = 34
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
}.lparams(wrapContent, wrapContent){
|
|
}.lparams(wrapContent, wrapContent){
|
|
@@ -402,9 +718,9 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
}.lparams(autoSize(250), wrapContent)
|
|
}.lparams(autoSize(250), wrapContent)
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
- text = data.fixedprice
|
|
|
|
|
|
|
+ text = "10"
|
|
|
textSizeAuto = 34
|
|
textSizeAuto = 34
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
|
|
|
|
+ textColorInt = R.color.buy_hall_color
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
}.lparams(matchParent, autoSize(143))
|
|
}.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
|
@@ -456,7 +772,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
numberEditText {
|
|
numberEditText {
|
|
|
- onePriceInputEdittext = this
|
|
|
|
|
|
|
+ floatPriceInputEdittext = this
|
|
|
setOnTextChangeListener { view, value ->
|
|
setOnTextChangeListener { view, value ->
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -472,9 +788,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
}
|
|
}
|
|
|
}.lparams(matchParent, autoSize(143))
|
|
}.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
|
|
- seekBar {
|
|
|
|
|
|
|
+ inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
min = 10
|
|
min = 10
|
|
|
max = 100
|
|
max = 100
|
|
|
|
|
+ isIndeterminate = false
|
|
|
|
|
+ splitTrack = false
|
|
|
|
|
+ setPadding(0,0,0,0)
|
|
|
thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
|
progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
@@ -530,7 +849,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
- one_delisting_amount = this
|
|
|
|
|
|
|
+ float_delisting_amount = this
|
|
|
textSizeAuto = 29
|
|
textSizeAuto = 29
|
|
|
textColorInt = R.color.rma_black_33
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
}.lparams(wrapContent, wrapContent)
|
|
@@ -570,13 +889,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
gravity = Gravity.BOTTOM
|
|
gravity = Gravity.BOTTOM
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
|
|
|
|
+ }.lparams(matchParent, matchParent){
|
|
|
|
|
+ topMargin = autoSize(120)
|
|
|
|
|
+ }
|
|
|
}.show()
|
|
}.show()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //浮动价 摘牌
|
|
|
|
|
|
|
+ //融资摘牌 type 1 一口价 2 浮动价
|
|
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
|
- fun creatFloatSellOrBuyDialog(data : OrderQuoteDetailData){
|
|
|
|
|
|
|
+ fun creatFinancingDialog(data : OrderQuoteDetailData,type : String){
|
|
|
|
|
|
|
|
createCustomDialog(cancelable = false) { dialog ->
|
|
createCustomDialog(cancelable = false) { dialog ->
|
|
|
|
|
|
|
@@ -635,6 +956,35 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
itemView()
|
|
itemView()
|
|
|
|
|
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
|
|
+ visibility = if (type == "1"){
|
|
|
|
|
+ View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ View.GONE
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "挂牌价格"
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = data.fixedprice
|
|
|
|
|
+ textSizeAuto = 34
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ visibility = if (type == "2"){
|
|
|
|
|
+ View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ View.GONE
|
|
|
|
|
+ }
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
textView {
|
|
textView {
|
|
@@ -717,9 +1067,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
}
|
|
}
|
|
|
}.lparams(matchParent, autoSize(143))
|
|
}.lparams(matchParent, autoSize(143))
|
|
|
|
|
|
|
|
- seekBar {
|
|
|
|
|
|
|
+ inflateLayout<SeekBar>(R.layout.main_seekbar) {
|
|
|
min = 10
|
|
min = 10
|
|
|
max = 100
|
|
max = 100
|
|
|
|
|
+ isIndeterminate = false
|
|
|
|
|
+ splitTrack = false
|
|
|
|
|
+ setPadding(0,0,0,0)
|
|
|
thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
|
progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
@@ -827,7 +1180,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
* @property viewModel BusinessHallViewModel
|
|
* @property viewModel BusinessHallViewModel
|
|
|
* @constructor
|
|
* @constructor
|
|
|
*/
|
|
*/
|
|
|
-class SellHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
|
|
|
|
|
|
|
+class SellHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel,private val type : String,private val pricetype : String,private val data: OrderQuoteData){
|
|
|
|
|
|
|
|
// 下拉刷新
|
|
// 下拉刷新
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
@@ -837,12 +1190,14 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
|
|
|
BaseAdapter { _, _ ->
|
|
BaseAdapter { _, _ ->
|
|
|
BusinessSellHallViewHolder(
|
|
BusinessSellHallViewHolder(
|
|
|
activity,
|
|
activity,
|
|
|
- viewModel
|
|
|
|
|
|
|
+ viewModel,
|
|
|
|
|
+ pricetype
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
val root = _FrameLayout(activity).apply {
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
+ viewModel.querySellDataList(type, pricetype, data)
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.hnst_sell_hall_top_bg_color)
|
|
background = resources.getDrawable(R.color.hnst_sell_hall_top_bg_color)
|
|
|
linearLayout {
|
|
linearLayout {
|
|
@@ -881,14 +1236,14 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
|
|
|
statusLayout = this
|
|
statusLayout = this
|
|
|
// bindTaskStatus(viewModule.status)
|
|
// bindTaskStatus(viewModule.status)
|
|
|
setRetryAction {
|
|
setRetryAction {
|
|
|
-
|
|
|
|
|
|
|
+ viewModel.querySellDataList(type, pricetype, data)
|
|
|
}
|
|
}
|
|
|
swipeToLoadLayout {
|
|
swipeToLoadLayout {
|
|
|
swipeToLayout = this
|
|
swipeToLayout = this
|
|
|
setEnableRefresh(true)
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
|
|
|
|
+ viewModel.querySellDataList(type, pricetype, data)
|
|
|
}
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
@@ -926,7 +1281,7 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
|
|
|
* @property viewModel BusinessHallViewModel
|
|
* @property viewModel BusinessHallViewModel
|
|
|
* @constructor
|
|
* @constructor
|
|
|
*/
|
|
*/
|
|
|
-class BuyHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
|
|
|
|
|
|
|
+class BuyHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel,private val type : String,private val pricetype : String,private val data: OrderQuoteData){
|
|
|
|
|
|
|
|
// 下拉刷新
|
|
// 下拉刷新
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
@@ -936,12 +1291,14 @@ class BuyHallUI(private val activity : AppCompatActivity,private val viewModel:
|
|
|
BaseAdapter { _, _ ->
|
|
BaseAdapter { _, _ ->
|
|
|
BusinessBuyHallViewHolder(
|
|
BusinessBuyHallViewHolder(
|
|
|
activity,
|
|
activity,
|
|
|
- viewModel
|
|
|
|
|
|
|
+ viewModel,
|
|
|
|
|
+ pricetype
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
val root = _FrameLayout(activity).apply {
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
+ viewModel.queryBuyDataList(type, pricetype, data)
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.hnst_buy_hall_top_bg_color)
|
|
background = resources.getDrawable(R.color.hnst_buy_hall_top_bg_color)
|
|
|
linearLayout {
|
|
linearLayout {
|
|
@@ -980,14 +1337,14 @@ class BuyHallUI(private val activity : AppCompatActivity,private val viewModel:
|
|
|
statusLayout = this
|
|
statusLayout = this
|
|
|
// bindTaskStatus(viewModule.status)
|
|
// bindTaskStatus(viewModule.status)
|
|
|
setRetryAction {
|
|
setRetryAction {
|
|
|
-
|
|
|
|
|
|
|
+ viewModel.queryBuyDataList(type, pricetype, data)
|
|
|
}
|
|
}
|
|
|
swipeToLoadLayout {
|
|
swipeToLoadLayout {
|
|
|
swipeToLayout = this
|
|
swipeToLayout = this
|
|
|
setEnableRefresh(true)
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
|
|
|
|
+ viewModel.queryBuyDataList(type, pricetype, data)
|
|
|
}
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
setEnableLoadMoreWhenContentNotFull(false)
|