一装多卸
This commit is contained in:
parent
54b3db22e3
commit
8dd32b77c0
@ -20,10 +20,13 @@ class SendGoodsAdapter : BaseQuickAdapter<AddressBean, QuickViewHolder>() {
|
|||||||
item?.run {
|
item?.run {
|
||||||
holder.run {
|
holder.run {
|
||||||
if (0==position){
|
if (0==position){
|
||||||
|
setGone(R.id.tvDel,true)
|
||||||
setBackgroundResource(R.id.ivType,R.drawable.icon_loading)
|
setBackgroundResource(R.id.ivType,R.drawable.icon_loading)
|
||||||
}else if (position==items.size-1){
|
}else if (position==items.size-1){
|
||||||
|
setGone(R.id.tvDel,true)
|
||||||
setBackgroundResource(R.id.ivType,R.drawable.icon_unloading)
|
setBackgroundResource(R.id.ivType,R.drawable.icon_unloading)
|
||||||
}else{
|
}else{
|
||||||
|
setGone(R.id.tvDel,false)
|
||||||
setBackgroundResource(R.id.ivType,R.drawable.icon_point)
|
setBackgroundResource(R.id.ivType,R.drawable.icon_point)
|
||||||
}
|
}
|
||||||
setText(R.id.tvAddress, item.addressDetail)
|
setText(R.id.tvAddress, item.addressDetail)
|
||||||
|
@ -15,6 +15,7 @@ object AppConfig {
|
|||||||
const val CX = "DA_HE_CX"
|
const val CX = "DA_HE_CX"
|
||||||
const val CC = "DA_HE_CC"
|
const val CC = "DA_HE_CC"
|
||||||
const val IS_ADD = "DA_HE_IS_ADD"
|
const val IS_ADD = "DA_HE_IS_ADD"
|
||||||
|
const val IS_MUL = "DA_HE_IS_MUL"
|
||||||
const val CAPTAIN_ID = "CAPTAIN_ID"
|
const val CAPTAIN_ID = "CAPTAIN_ID"
|
||||||
const val PWD = "DA_HE_PHONE"
|
const val PWD = "DA_HE_PHONE"
|
||||||
const val CODE = "DA_HE_PHONE"
|
const val CODE = "DA_HE_PHONE"
|
||||||
|
@ -77,6 +77,7 @@ data class AddressBean(
|
|||||||
val cityCode: String,
|
val cityCode: String,
|
||||||
val companyCode: String,
|
val companyCode: String,
|
||||||
val companyName: String,
|
val companyName: String,
|
||||||
|
var isPassingPoints: String,
|
||||||
val contactNumber: String,
|
val contactNumber: String,
|
||||||
val contactPerson: String,
|
val contactPerson: String,
|
||||||
val createBy: String,
|
val createBy: String,
|
||||||
@ -108,7 +109,7 @@ data class AddressBean(
|
|||||||
"", "", "", "", "",
|
"", "", "", "", "",
|
||||||
"", "", "", "", "", "",
|
"", "", "", "", "", "",
|
||||||
"", "", "", "", "", "",
|
"", "", "", "", "", "",
|
||||||
"", "", "", "", "", "","","", ""
|
"", "", "", "", "", "", "","","", ""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import RxHttpCallBack
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
@ -68,12 +67,11 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
|||||||
|
|
||||||
binding.ivNor.setOnClickListener {
|
binding.ivNor.setOnClickListener {
|
||||||
// ActivityUtils.startActivity(mContext, MarketsActivity::class.java)
|
// ActivityUtils.startActivity(mContext, MarketsActivity::class.java)
|
||||||
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java,Bundle().apply { putBoolean(AppConfig.IS_MUL,false) })
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.ivMul.setOnClickListener {
|
binding.ivMul.setOnClickListener {
|
||||||
showToast("开发中,敬请期待")
|
ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java,Bundle().apply { putBoolean(AppConfig.IS_MUL,true) })
|
||||||
// ActivityUtils.startActivity(mContext, SendGoodsActivity::class.java)
|
|
||||||
}
|
}
|
||||||
initData()
|
initData()
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import android.content.Intent
|
|||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.view.View
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
@ -47,76 +48,51 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
private lateinit var datas: MutableList<AddressBean>
|
private lateinit var datas: MutableList<AddressBean>
|
||||||
private lateinit var adapter: SendGoodsAdapter
|
private lateinit var adapter: SendGoodsAdapter
|
||||||
private var goodList: MutableList<GoodBean> = mutableListOf()
|
private var goodList: MutableList<GoodBean> = mutableListOf()
|
||||||
|
|
||||||
|
private var isMul = false
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("普通装货", true)
|
setTitleBar("普通装货", true)
|
||||||
|
|
||||||
|
intent.extras?.let {
|
||||||
|
isMul = it.getBoolean(AppConfig.IS_MUL, false)
|
||||||
|
}
|
||||||
|
|
||||||
datas = mutableListOf<AddressBean>(
|
datas = mutableListOf<AddressBean>(
|
||||||
AddressBean(),
|
AddressBean(),
|
||||||
AddressBean()
|
AddressBean()
|
||||||
)
|
)
|
||||||
|
binding.run {
|
||||||
|
llAdd.visibility = if (isMul) View.VISIBLE else View.GONE
|
||||||
|
tvAdd.setOnClickListener {
|
||||||
|
|
||||||
binding.llGoods.setOnClickListener {
|
adapter.add(datas.size-1,AddressBean())
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
llGoods.setOnClickListener {
|
||||||
ActivityUtils.startActivityForResult(
|
ActivityUtils.startActivityForResult(
|
||||||
this@SendGoodsActivity,
|
this@SendGoodsActivity,
|
||||||
GoodsInfoListActivity::class.java,
|
GoodsInfoListActivity::class.java,
|
||||||
8888
|
8888
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.llCarType.setOnClickListener {
|
llCarType.setOnClickListener {
|
||||||
ActivityUtils.startActivityForResult(
|
ActivityUtils.startActivityForResult(
|
||||||
this@SendGoodsActivity,
|
this@SendGoodsActivity,
|
||||||
CarTypeActivity::class.java,
|
CarTypeActivity::class.java,
|
||||||
9999
|
9999
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
btnOk.setOnClickListener {
|
||||||
|
|
||||||
binding.btnOk.setOnClickListener {
|
|
||||||
submit()
|
submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.tvDate.setOnClickListener {
|
tvDate.setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
selectDate()
|
||||||
.showDateSim(this@SendGoodsActivity, "装货截止时间") { date ->
|
}
|
||||||
binding.tvDate.text = date
|
|
||||||
postOrderBean.run {
|
|
||||||
effectiveTimeStart =TimeUtil.getString(
|
|
||||||
date,
|
|
||||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
|
||||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
|
||||||
1439,
|
|
||||||
TimeConstants.MIN
|
|
||||||
)
|
|
||||||
loadingDeadline =
|
|
||||||
TimeUtil.getString(
|
|
||||||
date,
|
|
||||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
|
||||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
|
||||||
8639,
|
|
||||||
TimeConstants.MIN
|
|
||||||
) //装货截止时间
|
|
||||||
receiverDeadline =
|
|
||||||
TimeUtil.getString(
|
|
||||||
date,
|
|
||||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
|
||||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
|
||||||
23039,
|
|
||||||
TimeConstants.MIN
|
|
||||||
)//卸货截止时间
|
|
||||||
effectiveTimeEnd =
|
|
||||||
TimeUtil.getString(
|
|
||||||
date,
|
|
||||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
|
||||||
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
|
||||||
30239,
|
|
||||||
TimeConstants.MIN
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
adapter = binding.recycler.run {
|
adapter = binding.recycler.run {
|
||||||
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
|
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
|
||||||
@ -138,6 +114,10 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
position
|
position
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addOnItemChildClickListener(R.id.tvDel){adapter,_,position->
|
||||||
|
adapter.removeAt(position)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
adapter.submitList(datas)
|
adapter.submitList(datas)
|
||||||
|
|
||||||
@ -161,13 +141,20 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
name = contactPerson
|
name = contactPerson
|
||||||
phone = contactNumber
|
phone = contactNumber
|
||||||
}
|
}
|
||||||
} else if (requestCode == 1) {
|
} else if (requestCode == datas.size-1) {
|
||||||
datas[requestCode] = addressBean.apply {
|
datas[requestCode] = addressBean.apply {
|
||||||
type = "2"
|
type = "2"
|
||||||
address = addressDetail
|
address = addressDetail
|
||||||
name = contactPerson
|
name = contactPerson
|
||||||
phone = contactNumber
|
phone = contactNumber
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
datas[requestCode] = addressBean.apply {
|
||||||
|
isPassingPoints = "1"
|
||||||
|
address = addressDetail
|
||||||
|
name = contactPerson
|
||||||
|
phone = contactNumber
|
||||||
|
}
|
||||||
}
|
}
|
||||||
adapter.notifyItemChanged(requestCode)
|
adapter.notifyItemChanged(requestCode)
|
||||||
}
|
}
|
||||||
@ -240,8 +227,11 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
override fun onSuccess(t: CommonResponseBean<PostOrderBean>) {
|
override fun onSuccess(t: CommonResponseBean<PostOrderBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data.order?.let {
|
t.data.order?.let {
|
||||||
ActivityUtils.startActivity(mContext, SendSuccActivity::class.java,Bundle().apply {
|
ActivityUtils.startActivity(
|
||||||
putString(AppConfig.ID,it.orderId)
|
mContext,
|
||||||
|
SendSuccActivity::class.java,
|
||||||
|
Bundle().apply {
|
||||||
|
putString(AppConfig.ID, it.orderId)
|
||||||
})
|
})
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
@ -249,4 +239,46 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun selectDate(){
|
||||||
|
PickerUtils.getInstance()
|
||||||
|
.showDateSim(this@SendGoodsActivity, "装货截止时间") { date ->
|
||||||
|
binding.tvDate.text = date
|
||||||
|
postOrderBean.run {
|
||||||
|
effectiveTimeStart = TimeUtil.getString(
|
||||||
|
date,
|
||||||
|
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
||||||
|
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
||||||
|
1439,
|
||||||
|
TimeConstants.MIN
|
||||||
|
)
|
||||||
|
loadingDeadline =
|
||||||
|
TimeUtil.getString(
|
||||||
|
date,
|
||||||
|
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
||||||
|
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
||||||
|
8639,
|
||||||
|
TimeConstants.MIN
|
||||||
|
) //装货截止时间
|
||||||
|
receiverDeadline =
|
||||||
|
TimeUtil.getString(
|
||||||
|
date,
|
||||||
|
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
||||||
|
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
||||||
|
23039,
|
||||||
|
TimeConstants.MIN
|
||||||
|
)//卸货截止时间
|
||||||
|
effectiveTimeEnd =
|
||||||
|
TimeUtil.getString(
|
||||||
|
date,
|
||||||
|
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()),
|
||||||
|
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()),
|
||||||
|
30239,
|
||||||
|
TimeConstants.MIN
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ import android.view.View
|
|||||||
import com.dahe.gldriver.base.AppConfig
|
import com.dahe.gldriver.base.AppConfig
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil
|
||||||
import com.dhsd.glowner.R
|
import com.dhsd.glowner.R
|
||||||
import com.dhsd.glowner.bean.HomeEvent
|
import com.dhsd.glowner.bean.HomeEvent
|
||||||
import com.dhsd.glowner.databinding.ActivitySendSuccBinding
|
import com.dhsd.glowner.databinding.ActivitySendSuccBinding
|
||||||
@ -36,6 +37,7 @@ class SendSuccActivity : BaseActivity<ActivitySendSuccBinding>(), OnLimitClickLi
|
|||||||
orderId= it.getString(AppConfig.ID,"")
|
orderId= it.getString(AppConfig.ID,"")
|
||||||
}
|
}
|
||||||
binding.run {
|
binding.run {
|
||||||
|
tvTime.text = TimeUtil.getNowString("yyyy-MM-dd HH:mm:ss")
|
||||||
btnLeft.setOnClickListener {
|
btnLeft.setOnClickListener {
|
||||||
EventBus.getDefault().post(HomeEvent(true))
|
EventBus.getDefault().post(HomeEvent(true))
|
||||||
ActivityUtils.finishToActivity(HomeActivity::class.java,false)
|
ActivityUtils.finishToActivity(HomeActivity::class.java,false)
|
||||||
|
BIN
app/src/main/res/drawable-xxhdpi/icon_add.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/icon_add.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 969 B |
@ -18,17 +18,50 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<LinearLayout
|
||||||
android:id="@+id/recycler"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_13"
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
android:background="@drawable/shape_white_8"
|
android:background="@drawable/shape_white_8"
|
||||||
|
android:orientation="vertical"
|
||||||
android:paddingTop="@dimen/dp_15"
|
android:paddingTop="@dimen/dp_15"
|
||||||
android:paddingBottom="@dimen/dp_15" />
|
android:paddingBottom="@dimen/dp_15">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llAdd"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="一装多卸" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvAdd"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/icon_add"
|
||||||
|
android:drawablePadding="@dimen/dp_4"
|
||||||
|
android:gravity="right"
|
||||||
|
android:text="添加途径点" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/llGoods"
|
android:id="@+id/llGoods"
|
||||||
@ -161,7 +194,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:drawableLeft="@drawable/start"
|
android:drawableLeft="@drawable/start"
|
||||||
android:text="运费"
|
android:text="运费(元)"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16" />
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_marginRight="@dimen/dp_10"
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -14,6 +15,7 @@
|
|||||||
android:background="@drawable/icon_loading" />
|
android:background="@drawable/icon_loading" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_6"
|
android:layout_marginLeft="@dimen/dp_6"
|
||||||
@ -66,4 +68,15 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/tvDel"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/main_red"
|
||||||
|
android:paddingLeft="@dimen/dp_6"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="删除"
|
||||||
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user