|
@@ -6,6 +6,7 @@ import android.view.Gravity
|
|
|
import android.view.View
|
|
import android.view.View
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
import cn.muchinfo.rma.R
|
|
import cn.muchinfo.rma.R
|
|
|
|
|
+import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.data.AccMgrLoginUserData
|
|
import cn.muchinfo.rma.global.data.AccMgrLoginUserData
|
|
|
import cn.muchinfo.rma.global.data.Userlist
|
|
import cn.muchinfo.rma.global.data.Userlist
|
|
|
import cn.muchinfo.rma.global.loginstatus
|
|
import cn.muchinfo.rma.global.loginstatus
|
|
@@ -17,6 +18,8 @@ import cn.muchinfo.rma.view.autoWidget.textSizeAuto
|
|
|
import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerViewModel
|
|
import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerViewModel
|
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleActivity
|
|
import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleActivity
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.rolemanagement.AddTradingLoginRoleActivity
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.rolemanagement.ResetAccountPasswordActivity
|
|
|
import com.blankj.utilcode.util.ActivityUtils
|
|
import com.blankj.utilcode.util.ActivityUtils
|
|
|
import mtp.polymer.com.autowidget.adapter.BaseViewHolder
|
|
import mtp.polymer.com.autowidget.adapter.BaseViewHolder
|
|
|
import org.jetbrains.anko.*
|
|
import org.jetbrains.anko.*
|
|
@@ -31,7 +34,8 @@ import java.io.Serializable
|
|
|
class TradingUserViewHolder(
|
|
class TradingUserViewHolder(
|
|
|
private val activity: AppCompatActivity,
|
|
private val activity: AppCompatActivity,
|
|
|
private val viewModel: AccountManagerViewModel,
|
|
private val viewModel: AccountManagerViewModel,
|
|
|
- private val index : Int
|
|
|
|
|
|
|
+ private val index : Int,
|
|
|
|
|
+ private val rolename : String//所属的交易用户
|
|
|
) : BaseViewHolder<Userlist>(activity) {
|
|
) : BaseViewHolder<Userlist>(activity) {
|
|
|
override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
|
|
override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
|
|
|
|
|
|
|
@@ -49,14 +53,14 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
- viewModel.setOnLoginSonItemClick(index = index,sonIndex = dataIndex)
|
|
|
|
|
|
|
+ viewModel.setOnTradingSonItemClick(index = index,sonIndex = dataIndex)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
textView {
|
|
|
data.bindOptional(context) {
|
|
data.bindOptional(context) {
|
|
|
- text = it?.rolename
|
|
|
|
|
|
|
+ text = it?.logincode + " " + it?.userid
|
|
|
}
|
|
}
|
|
|
textColorInt = R.color.rma_black_33
|
|
textColorInt = R.color.rma_black_33
|
|
|
textSizeAuto = 31
|
|
textSizeAuto = 31
|
|
@@ -96,10 +100,11 @@ class TradingUserViewHolder(
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
val intent = Intent()
|
|
val intent = Intent()
|
|
|
intent.putExtra("data1",data.value)
|
|
intent.putExtra("data1",data.value)
|
|
|
|
|
+ intent.putExtra("rolename",rolename)
|
|
|
intent.putExtra("data", AccMgrLoginUserData())
|
|
intent.putExtra("data", AccMgrLoginUserData())
|
|
|
intent.putExtra("seletType", arrayListOf<AccMgrLoginUserData>() as Serializable)
|
|
intent.putExtra("seletType", arrayListOf<AccMgrLoginUserData>() as Serializable)
|
|
|
intent.putExtra("type","2")
|
|
intent.putExtra("type","2")
|
|
|
- intent.setClass(context,AddRoleActivity::class.java)
|
|
|
|
|
|
|
+ intent.setClass(context, AddTradingLoginRoleActivity::class.java)
|
|
|
ActivityUtils.startActivity(intent)
|
|
ActivityUtils.startActivity(intent)
|
|
|
}
|
|
}
|
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
@@ -112,6 +117,11 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
|
|
+ if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_accountmanage",secondCode = "client_accountmanage_trade_add",threeCode = "client_accountmanage_trade_update") == true){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
data.bindOptional(context){
|
|
data.bindOptional(context){
|
|
|
if (it?.loginstatus == "1"){
|
|
if (it?.loginstatus == "1"){
|
|
|
visibility = View.VISIBLE
|
|
visibility = View.VISIBLE
|
|
@@ -122,10 +132,11 @@ class TradingUserViewHolder(
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
val intent = Intent()
|
|
val intent = Intent()
|
|
|
intent.putExtra("data1",data.value)
|
|
intent.putExtra("data1",data.value)
|
|
|
|
|
+ intent.putExtra("rolename",rolename)
|
|
|
intent.putExtra("data", AccMgrLoginUserData())
|
|
intent.putExtra("data", AccMgrLoginUserData())
|
|
|
intent.putExtra("seletType", arrayListOf<AccMgrLoginUserData>() as Serializable)
|
|
intent.putExtra("seletType", arrayListOf<AccMgrLoginUserData>() as Serializable)
|
|
|
intent.putExtra("type","3")
|
|
intent.putExtra("type","3")
|
|
|
- intent.setClass(context,AddRoleActivity::class.java)
|
|
|
|
|
|
|
+ intent.setClass(context,AddTradingLoginRoleActivity::class.java)
|
|
|
ActivityUtils.startActivity(intent)
|
|
ActivityUtils.startActivity(intent)
|
|
|
}
|
|
}
|
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
@@ -138,6 +149,11 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
|
|
+ if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_accountmanage",secondCode = "client_accountmanage_trade_add",threeCode = "client_accountmanage_trade_resetpwd") == true){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
data.bindOptional(context){
|
|
data.bindOptional(context){
|
|
|
if (it?.loginstatus == "1"){
|
|
if (it?.loginstatus == "1"){
|
|
|
visibility = View.VISIBLE
|
|
visibility = View.VISIBLE
|
|
@@ -146,7 +162,10 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
-
|
|
|
|
|
|
|
+ val intent = Intent()
|
|
|
|
|
+ intent.putExtra("logincode",data.value?.logincode)
|
|
|
|
|
+ intent.setClass(context, ResetAccountPasswordActivity::class.java)
|
|
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
}
|
|
}
|
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
backgroundResource = R.drawable.rma_item_click_bg
|
|
|
gravity = Gravity.CENTER
|
|
gravity = Gravity.CENTER
|
|
@@ -158,6 +177,11 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
|
|
+ if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_accountmanage",secondCode = "client_accountmanage_trade_add",threeCode = "client_accountmanage_trade_lock") == true){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
data.bindOptional(context){
|
|
data.bindOptional(context){
|
|
|
if (it?.loginstatus == "1"){
|
|
if (it?.loginstatus == "1"){
|
|
|
visibility = View.VISIBLE
|
|
visibility = View.VISIBLE
|
|
@@ -184,6 +208,11 @@ class TradingUserViewHolder(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
textView {
|
|
textView {
|
|
|
|
|
+ if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_accountmanage",secondCode = "client_accountmanage_trade_add",threeCode = "client_accountmanage_trade_close") == true){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
data.bindOptional(context){
|
|
data.bindOptional(context){
|
|
|
if (it?.loginstatus == "1"){
|
|
if (it?.loginstatus == "1"){
|
|
|
visibility = View.VISIBLE
|
|
visibility = View.VISIBLE
|
|
@@ -209,6 +238,11 @@ class TradingUserViewHolder(
|
|
|
marginEnd = autoSize(24)
|
|
marginEnd = autoSize(24)
|
|
|
}
|
|
}
|
|
|
textView {
|
|
textView {
|
|
|
|
|
+ if (GlobalDataCollection.instance?.getThreeLevelMenu(firstCode = "client_accountmanage",secondCode = "client_accountmanage_trade_add",threeCode = "client_accountmanage_trade_unlock") == true){
|
|
|
|
|
+ visibility = View.VISIBLE
|
|
|
|
|
+ }else{
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ }
|
|
|
data.bindOptional(context){
|
|
data.bindOptional(context){
|
|
|
if (it?.loginstatus == "2"){
|
|
if (it?.loginstatus == "2"){
|
|
|
visibility = View.VISIBLE
|
|
visibility = View.VISIBLE
|