|
|
@@ -0,0 +1,217 @@
|
|
|
+package cn.muchinfo.rma.view.base.home.xhcp
|
|
|
+
|
|
|
+import android.annotation.SuppressLint
|
|
|
+import android.os.Bundle
|
|
|
+import android.view.Gravity
|
|
|
+import android.widget.ImageView
|
|
|
+import cn.muchinfo.rma.R
|
|
|
+import cn.muchinfo.rma.global.data.WrPreSaleInfoData
|
|
|
+import cn.muchinfo.rma.global.toShowTime
|
|
|
+import cn.muchinfo.rma.global.toShowTime3
|
|
|
+import cn.muchinfo.rma.global.toTimeData
|
|
|
+import cn.muchinfo.rma.view.autoWidget.*
|
|
|
+import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
+import cn.muchinfo.rma.view.base.BaseViewModel
|
|
|
+import cn.muchinfo.rma.view.base.app.Constant
|
|
|
+import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
+import com.blankj.utilcode.util.SPUtils
|
|
|
+import org.jetbrains.anko.*
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新品发售商品详情(抢购中)
|
|
|
+ * @property data WrPreSaleInfoData
|
|
|
+ */
|
|
|
+class XhcpPreSaleActivity: BaseActivity<BaseViewModel>() {
|
|
|
+ private val data by lazy {
|
|
|
+ intent.getParcelableExtra<WrPreSaleInfoData>("data") as WrPreSaleInfoData
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressLint("RtlHardcoded")
|
|
|
+ override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
+ super.onCreate(savedInstanceState)
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ topBar {
|
|
|
+ // 返回
|
|
|
+ commonLeftButton()
|
|
|
+ commonTitle {
|
|
|
+ text = "商品详情"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ scrollView {
|
|
|
+ verticalLayout {
|
|
|
+ // ********** 商品信息 **********
|
|
|
+ // 商品banner
|
|
|
+ imageView {
|
|
|
+ showImage(SPUtils.getInstance().getString(Constant.uploadUrl).
|
|
|
+ replace("/upload","") +
|
|
|
+ data.bannerpicurl?.substring(1))
|
|
|
+ }.lparams(matchParent, autoSize(400))
|
|
|
+
|
|
|
+ // 商品名称
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 40
|
|
|
+ text = data.wrstandardname
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ leftMargin = autoSize(20)
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "发行价"
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = data.unitprice
|
|
|
+ gravity = Gravity.RIGHT
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(20)
|
|
|
+ rightMargin = autoSize(30)
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "发行总量"
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = data.presaleqty
|
|
|
+ gravity = Gravity.RIGHT
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(30)
|
|
|
+ rightMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "开始时间"
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = data.startdate?.toShowTime3() ?: "--"
|
|
|
+ gravity = Gravity.RIGHT
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(20)
|
|
|
+ rightMargin = autoSize(30)
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "结束时间"
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = data.enddate?.toShowTime3() ?: "--"
|
|
|
+ gravity = Gravity.RIGHT
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(30)
|
|
|
+ rightMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_zhushi_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "仓库"
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = data.warehousename
|
|
|
+ gravity = Gravity.RIGHT
|
|
|
+ }.lparams(autoSize(0), wrapContent, 1F)
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(20)
|
|
|
+ rightMargin = autoSize(30)
|
|
|
+ }
|
|
|
+ linearLayout {
|
|
|
+
|
|
|
+ }.lparams(matchParent, wrapContent, 1F) {
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ leftMargin = autoSize(30)
|
|
|
+ rightMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ view { }.lparams(0, autoSize(10), 1f)
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ // ********** 交互相关 **********
|
|
|
+ relativeLayout {
|
|
|
+ button {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ text = "我要认购"
|
|
|
+ textSizeAuto = 36
|
|
|
+ textColorInt = R.color.white
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#2794FF", 10)
|
|
|
+ }.lparams(autoSize(320), autoSize(100)) {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(200))
|
|
|
+
|
|
|
+ // ********** 商品详情 **********
|
|
|
+ linearLayout {
|
|
|
+ view {
|
|
|
+ background = resources.getDrawable(R.color.pickerview_bgColor_overlay, null)
|
|
|
+ }.lparams(autoSize(0), autoSize(1), 1F) {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ leftMargin = autoSize(100)
|
|
|
+ }
|
|
|
+ textView {
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ textSizeAuto = 31
|
|
|
+ text = "商品详情"
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ }.lparams(autoSize(200), wrapContent, 1F) {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ }
|
|
|
+ view {
|
|
|
+ background = resources.getDrawable(R.color.pickerview_bgColor_overlay, null)
|
|
|
+ }.lparams(autoSize(0), autoSize(1), 1F) {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ rightMargin = autoSize(100)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(40))
|
|
|
+ scrollView {
|
|
|
+ imageView {
|
|
|
+ showImage(SPUtils.getInstance().getString(Constant.uploadUrl).
|
|
|
+ replace("/upload","") +
|
|
|
+ data.pictureurls?.substring(1))
|
|
|
+ scaleType = ImageView.ScaleType.FIT_XY
|
|
|
+ adjustViewBounds = true
|
|
|
+ }.lparams(matchParent, wrapContent) {
|
|
|
+ topMargin = autoSize(15)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|