|
@@ -0,0 +1,217 @@
|
|
|
|
|
+package cn.muchinfo.rma.view.base.home.commodity.modify
|
|
|
|
|
+
|
|
|
|
|
+import android.os.Bundle
|
|
|
|
|
+import android.view.Gravity
|
|
|
|
|
+import android.view.inputmethod.EditorInfo
|
|
|
|
|
+import android.widget.EditText
|
|
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
|
|
+import cn.muchinfo.rma.R
|
|
|
|
|
+import cn.muchinfo.rma.global.MTPEnums
|
|
|
|
|
+import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
|
|
+import cn.muchinfo.rma.view.autoWidget.*
|
|
|
|
|
+import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
|
|
+import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
|
|
|
|
|
+import mtp.polymer.com.autowidget.dialog.SelectData
|
|
|
|
|
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
|
|
|
|
|
+import org.jetbrains.anko.*
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 修改商品参数页面
|
|
|
|
|
+ */
|
|
|
|
|
+@Suppress("DEPRECATION")
|
|
|
|
|
+class ChangeGoodsParameterActivity : BaseActivity<ModifyViewModel>(){
|
|
|
|
|
+
|
|
|
|
|
+ val parameterType : MutableLiveData<SelectData> = MutableLiveData()
|
|
|
|
|
+
|
|
|
|
|
+ //输入的设置值
|
|
|
|
|
+ lateinit var set_value : EditText
|
|
|
|
|
+
|
|
|
|
|
+ override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
|
+ super.onCreate(savedInstanceState)
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.segtabment_bg_color)
|
|
|
|
|
+ topBar {
|
|
|
|
|
+ commonLeftButton()
|
|
|
|
|
+ commonTitle {
|
|
|
|
|
+ text = "修改商品参数"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "商品名称"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(autoSize(250), autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "铜"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "套保品种"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(autoSize(250), autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "铜"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "单位"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(autoSize(250), autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "吨"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+ val selectDataList = arrayListOf(
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = "2",
|
|
|
|
|
+ value = "折算系数"
|
|
|
|
|
+ ),
|
|
|
|
|
+ SelectData(
|
|
|
|
|
+ id = "3",
|
|
|
|
|
+ value = "成本权重"
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ creatBottomSheetDialog("请选择合同类型", selectDataList) {
|
|
|
|
|
+ parameterType.postValue(this)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "*"
|
|
|
|
|
+ textColorInt = R.color.rma_star_color
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(37)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "参数类别"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ parameterType.bindOptional(context) {
|
|
|
|
|
+ text = it?.value
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(80)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
|
|
+ marginEnd = autoSize(25)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "*"
|
|
|
|
|
+ textColorInt = R.color.rma_star_color
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(37)
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "设置值"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginStart = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ editText {
|
|
|
|
|
+ set_value = this
|
|
|
|
|
+ hint = "请输入设置值"
|
|
|
|
|
+ background = null
|
|
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
|
|
+// setDecimalInputType()
|
|
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorStr = "#333333"
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132)) {
|
|
|
|
|
+ marginStart = autoSize(80)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
+
|
|
|
|
|
+ verticalEmptyView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ backgroundResource = R.mipmap.rma_submit_bg
|
|
|
|
|
+ text = "确定"
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ textSizeAuto = 38
|
|
|
|
|
+ }.lparams(0, autoSize(119),1f) {
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ marginEnd = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(144))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|