|
|
@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.business.future.adapter.ChannelOrderReqData
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
+import cn.muchinfo.rma.global.data.futureOrders.DealOrderData
|
|
|
import cn.muchinfo.rma.global.data.futureOrders.FutureHoldData
|
|
|
import cn.muchinfo.rma.netManage.base.InteractiveException
|
|
|
import cn.muchinfo.rma.view.MyApplication
|
|
|
@@ -46,7 +47,7 @@ class HoldViewModel : BaseViewModel() {
|
|
|
*/
|
|
|
fun makeCostInfo(data: FutureHoldData): ArrayList<OrderDetailData>? {
|
|
|
val orderDetailList: ArrayList<OrderDetailData>? = ArrayList()
|
|
|
- val paddingLeft = 350 // 右侧的文字,距离左侧的距离
|
|
|
+ val paddingLeft = 400 // 右侧的文字,距离左侧的距离
|
|
|
val leftTextPadding = 0 // 左侧的文字,距离左侧的距离
|
|
|
|
|
|
var m = OrderDetailData()
|
|
|
@@ -58,14 +59,22 @@ class HoldViewModel : BaseViewModel() {
|
|
|
|
|
|
m = OrderDetailData()
|
|
|
m.setLeftText(context?.getString(R.string.str_order_all_num))
|
|
|
- m.setRightText(data.curpositionqty.toString() + "/" + data.curpositionqty)
|
|
|
+ m.setRightText(data.curtdposition.toString() + "/" + data.curpositionqty)
|
|
|
m.setRightTextPadding(paddingLeft)
|
|
|
m.setLeftTextPadding(leftTextPadding)
|
|
|
orderDetailList?.add(m)
|
|
|
|
|
|
m = OrderDetailData()
|
|
|
m.setLeftText(context?.getString(R.string.str_order_all_available))
|
|
|
- m.setRightText(data.enableqty.toString() + "" + data.curpositionqty)
|
|
|
+ m.setRightText(data.curtdposition.toString() + "/" + data.enableqty)
|
|
|
+ m.setRightTextPadding(paddingLeft)
|
|
|
+ m.setLeftTextPadding(leftTextPadding)
|
|
|
+ orderDetailList?.add(m)
|
|
|
+
|
|
|
+ // 开仓均价
|
|
|
+ m = OrderDetailData()
|
|
|
+ m.setLeftText(context?.getString(R.string.str_ava_open))
|
|
|
+ m.setRightText(data.openaverageprice.toString())
|
|
|
m.setRightTextPadding(paddingLeft)
|
|
|
m.setLeftTextPadding(leftTextPadding)
|
|
|
orderDetailList?.add(m)
|
|
|
@@ -78,19 +87,26 @@ class HoldViewModel : BaseViewModel() {
|
|
|
orderDetailList?.add(m)
|
|
|
|
|
|
m = OrderDetailData()
|
|
|
- m.setLeftText(context?.getString(R.string.str_hold_pl))
|
|
|
- m.setRightText(data.positionpl.toString())
|
|
|
+ m.setLeftText(context?.getString(R.string.str_open_pl))
|
|
|
+ m.setRightText(data.openpl.toString())
|
|
|
m.setRightTextPadding(paddingLeft)
|
|
|
m.setLeftTextPadding(leftTextPadding)
|
|
|
orderDetailList?.add(m)
|
|
|
|
|
|
m = OrderDetailData()
|
|
|
- m.setLeftText(context?.getString(R.string.str_use_amount))
|
|
|
- m.setRightText(data.usedmargin.toString())
|
|
|
+ m.setLeftText(context?.getString(R.string.str_hold_pl))
|
|
|
+ m.setRightText(data.positionpl.toString())
|
|
|
m.setRightTextPadding(paddingLeft)
|
|
|
m.setLeftTextPadding(leftTextPadding)
|
|
|
orderDetailList?.add(m)
|
|
|
|
|
|
+// m = OrderDetailData()
|
|
|
+// m.setLeftText(context?.getString(R.string.str_use_amount))
|
|
|
+// m.setRightText(data.usedmargin.toString())
|
|
|
+// m.setRightTextPadding(paddingLeft)
|
|
|
+// m.setLeftTextPadding(leftTextPadding)
|
|
|
+// orderDetailList?.add(m)
|
|
|
+
|
|
|
m = OrderDetailData()
|
|
|
m.setLeftText(context?.getString(R.string.str_exchange))
|
|
|
m.setRightText(data.exexchangename)
|
|
|
@@ -109,7 +125,7 @@ class HoldViewModel : BaseViewModel() {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 通用的适配器。
|
|
|
+ * 持仓汇总相关成交单适配器
|
|
|
*/
|
|
|
inner class HoldAdapter(context: Context?, fragment: Fragment) :
|
|
|
RecyclerView.Adapter<HoldAdapter.HoldHolder>() {
|
|
|
@@ -279,7 +295,9 @@ class HoldViewModel : BaseViewModel() {
|
|
|
OrderDetail.start(
|
|
|
context!!,
|
|
|
data,
|
|
|
- context?.resources?.getString(R.string.str_order_detail_head)
|
|
|
+ context?.resources?.getString(R.string.str_order_detail_head),
|
|
|
+ tagData.goodsid,
|
|
|
+ tagData.buyorsell
|
|
|
)
|
|
|
}
|
|
|
|
|
|
@@ -469,5 +487,4 @@ class HoldViewModel : BaseViewModel() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|