package cn.muchinfo.rma.view.base.future.deals

import android.os.Bundle
import cn.muchinfo.rma.global.ViewEnumUtils
import cn.muchinfo.rma.global.data.futureOrders.DealOrderData
import cn.muchinfo.rma.view.autoWidget.commonLeftButton
import cn.muchinfo.rma.view.autoWidget.commonTitle
import cn.muchinfo.rma.view.autoWidget.topBar
import cn.muchinfo.rma.view.base.BaseActivity
import cn.muchinfo.rma.view.base.future.detailsView
import cn.muchinfo.rma.view.base.future.trade.itemView
import org.jetbrains.anko.verticalLayout

class DealDetailsActivity : BaseActivity<DealViewModel>(){

    val data by lazy {
        intent.getParcelableExtra<DealOrderData>("data") as DealOrderData
     }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        verticalLayout {
            //头部标题
            topBar {
                commonLeftButton()
                commonTitle {
                    text = "订单详情（成交）"
                }
            }

            detailsView(title = "合约名称",content = data.goodsname ?: "")

            itemView()

            detailsView(title = "订单类型",content = ViewEnumUtils.getDealOrderType(data.buyorsell ?: "",data.channelbuildtype ?: ""))

            itemView()

            detailsView(title = "成交类型",content = ViewEnumUtils.getchanneloperatetype(data?.channeloperatetype ?: ""))

            itemView()

            detailsView(title = "成交数量",content = data.tradeqty ?: "")

            itemView()

            detailsView(title = "成交价格（CNY）",content = data.tradeprice ?: "")

            itemView()

//            detailsView(title = "手续费（CNY）",content = "")

            detailsView(title = "成交时间",content = data.tradetime ?: "")

            itemView()

            detailsView(title = "参考汇率",content = data.curexchangerate ?: "")

            itemView()

            detailsView(title = "交易所",content = data.exchangefullname ?: "")

            itemView()

            detailsView(title = "订单号",content = data.orderid ?: "")

//            detailsView(title = "委托人",content = "")

        }
    }


}