添加货物跳转修改
This commit is contained in:
parent
2b8f38dd2f
commit
039fd4ac37
@ -197,6 +197,8 @@ data class PostOrderBean(
|
|||||||
var receiverAddress: String,
|
var receiverAddress: String,
|
||||||
var vehicleType: String,
|
var vehicleType: String,
|
||||||
var vehicleLength: String,
|
var vehicleLength: String,
|
||||||
|
var requirement: String,
|
||||||
|
var remark: String,
|
||||||
var childList:MutableList<AddressBean> = mutableListOf(),
|
var childList:MutableList<AddressBean> = mutableListOf(),
|
||||||
var goodsList:MutableList<GoodBean> = mutableListOf(),
|
var goodsList:MutableList<GoodBean> = mutableListOf(),
|
||||||
var order : OrderBean? = null
|
var order : OrderBean? = null
|
||||||
@ -211,8 +213,8 @@ data class PostOrderBean(
|
|||||||
"","","","","","",
|
"","","","","","",
|
||||||
"","","","","","",
|
"","","","","","",
|
||||||
"","","","","",
|
"","","","","",
|
||||||
"","","","","","","","",
|
"","","","","","","","","",
|
||||||
"","", "","","")
|
"","", "","","","")
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Child(
|
data class Child(
|
||||||
|
@ -104,6 +104,13 @@ class GoodsInfoListActivity : BaseActivity<ActivityGoodsInfoListBinding>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
editPosition = -1
|
||||||
|
ActivityUtils.startActivityForResult(
|
||||||
|
this@GoodsInfoListActivity,
|
||||||
|
GoodsInfoActivity::class.java,
|
||||||
|
1
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
@ -114,12 +121,12 @@ class GoodsInfoListActivity : BaseActivity<ActivityGoodsInfoListBinding>(),
|
|||||||
super.onClick(view)
|
super.onClick(view)
|
||||||
when (view?.id) {
|
when (view?.id) {
|
||||||
R.id.tvGood -> {
|
R.id.tvGood -> {
|
||||||
var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
// var datas = mutableListOf("螺纹钢", "螺纹钢1", "螺纹钢2")
|
||||||
PickerUtils.getInstance().showSingleSelect(
|
// PickerUtils.getInstance().showSingleSelect(
|
||||||
this, "请选择货物", datas
|
// this, "请选择货物", datas
|
||||||
) { position, item ->
|
// ) { position, item ->
|
||||||
showToast(item as String)
|
// showToast(item as String)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.tvGoodType -> {
|
R.id.tvGoodType -> {
|
||||||
|
@ -70,6 +70,12 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
GoodsInfoListActivity::class.java,
|
GoodsInfoListActivity::class.java,
|
||||||
8888
|
8888
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ActivityUtils.startActivityForResult(
|
||||||
|
// this@SendGoodsActivity,
|
||||||
|
// GoodsInfoActivity::class.java,
|
||||||
|
// 8888
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
llCarType.setOnClickListener {
|
llCarType.setOnClickListener {
|
||||||
ActivityUtils.startActivityForResult(
|
ActivityUtils.startActivityForResult(
|
||||||
@ -96,40 +102,9 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
super.onActivityResult(requestCode, resultCode, data)
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
if (resultCode == AppCompatActivity.RESULT_OK) {
|
if (resultCode == AppCompatActivity.RESULT_OK) {
|
||||||
data?.extras?.let {
|
data?.extras?.let {
|
||||||
val string = it.getString(AppConfig.BEAN, "")
|
|
||||||
if (string.isNotEmpty()) {
|
|
||||||
val addressBean = Gson().fromJson<AddressBean>(string, AddressBean::class.java)
|
|
||||||
//处理地址信息
|
|
||||||
if (requestCode == 0) {
|
|
||||||
datas[requestCode] = addressBean.apply {
|
|
||||||
type = "1"
|
|
||||||
address = addressDetail
|
|
||||||
name = contactPerson
|
|
||||||
phone = contactNumber
|
|
||||||
}
|
|
||||||
} else if (requestCode == datas.size - 1) {
|
|
||||||
datas[requestCode] = addressBean.apply {
|
|
||||||
type = "2"
|
|
||||||
address = addressDetail
|
|
||||||
name = contactPerson
|
|
||||||
phone = contactNumber
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
datas[requestCode] = addressBean.apply {
|
|
||||||
isPassingPoints = "1"
|
|
||||||
address = addressDetail
|
|
||||||
name = contactPerson
|
|
||||||
phone = contactNumber
|
|
||||||
}
|
|
||||||
}
|
|
||||||
adapter.notifyItemChanged(requestCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
data?.let {
|
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
8888 -> {
|
8888 -> {
|
||||||
val datas = it.getStringExtra(AppConfig.DATAS)
|
val datas = it.getString(AppConfig.DATAS)
|
||||||
val userListType = object : TypeToken<MutableList<GoodBean>>() {}.type
|
val userListType = object : TypeToken<MutableList<GoodBean>>() {}.type
|
||||||
|
|
||||||
goodList = Gson().fromJson(datas, userListType)
|
goodList = Gson().fromJson(datas, userListType)
|
||||||
@ -142,20 +117,51 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
9999 -> {
|
9999 -> {
|
||||||
val cx = it.getStringExtra(AppConfig.CX)
|
val cx = it.getString(AppConfig.CX)
|
||||||
val cc = it.getStringExtra(AppConfig.CC)
|
val cc = it.getString(AppConfig.CC)
|
||||||
postOrderBean.run {
|
postOrderBean.run {
|
||||||
if (cx != null) {
|
if (cx != null) {
|
||||||
vehicleType = cx
|
vehicleType = cx
|
||||||
}
|
}
|
||||||
if (cc != null) {
|
if (cc != null) {
|
||||||
vehicleLength = cc.replace("米", "")
|
vehicleLength = cc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.tvCarType.text = """$cc $cx"""
|
binding.tvCarType.text = """$cc $cx"""
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
val string = it.getString(AppConfig.BEAN, "")
|
||||||
|
if (string.isNotEmpty()) {
|
||||||
|
val addressBean =
|
||||||
|
Gson().fromJson<AddressBean>(string, AddressBean::class.java)
|
||||||
|
//处理地址信息
|
||||||
|
if (requestCode == 0) {
|
||||||
|
datas[requestCode] = addressBean.apply {
|
||||||
|
type = "1"
|
||||||
|
address = addressDetail
|
||||||
|
name = contactPerson
|
||||||
|
phone = contactNumber
|
||||||
|
}
|
||||||
|
} else if (requestCode == datas.size - 1) {
|
||||||
|
datas[requestCode] = addressBean.apply {
|
||||||
|
type = "2"
|
||||||
|
address = addressDetail
|
||||||
|
name = contactPerson
|
||||||
|
phone = contactNumber
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
datas[requestCode] = addressBean.apply {
|
||||||
|
isPassingPoints = "1"
|
||||||
|
address = addressDetail
|
||||||
|
name = contactPerson
|
||||||
|
phone = contactNumber
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adapter.notifyItemChanged(requestCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,6 +190,9 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
inputFreight = binding.etMoney.text.toString()//运费
|
inputFreight = binding.etMoney.text.toString()//运费
|
||||||
childList = datas
|
childList = datas
|
||||||
goodsList = goodList
|
goodsList = goodList
|
||||||
|
requirement = binding.etRequire.text.toString().trim()
|
||||||
|
remark = binding.etRemark.text.toString().trim()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataManager.getInstance().addOrder(postOrderBean)
|
DataManager.getInstance().addOrder(postOrderBean)
|
||||||
|
@ -212,6 +212,77 @@
|
|||||||
tools:text="5000元" />
|
tools:text="5000元" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:background="@color/color_E1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="运输要求"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etRequire"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="请输入运输要求"
|
||||||
|
android:inputType="text"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_1"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:background="@color/color_E1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:text="备注"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etRemark"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="请输入备注"
|
||||||
|
android:inputType="text"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user