|
@@ -3,36 +3,19 @@ package com.quansu.heifengwuliu.fragment
|
|
|
import android.app.Activity
|
|
|
import android.content.Context
|
|
|
import android.content.Intent
|
|
|
-import android.graphics.Color
|
|
|
-import android.graphics.Typeface
|
|
|
import android.os.Bundle
|
|
|
import android.text.Editable
|
|
|
import android.text.TextUtils
|
|
|
import android.text.TextWatcher
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.ViewGroup
|
|
|
-import android.widget.FrameLayout
|
|
|
-import android.widget.TextView
|
|
|
-import androidx.fragment.app.Fragment
|
|
|
import androidx.lifecycle.Observer
|
|
|
import com.google.gson.Gson
|
|
|
import com.hwangjr.rxbus.annotation.Subscribe
|
|
|
import com.hwangjr.rxbus.annotation.Tag
|
|
|
-import com.qmuiteam.qmui.layout.QMUIFrameLayout
|
|
|
-import com.qmuiteam.qmui.skin.QMUISkinHelper
|
|
|
-import com.qmuiteam.qmui.skin.QMUISkinValueBuilder
|
|
|
-import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
-import com.qmuiteam.qmui.util.QMUIResHelper
|
|
|
-import com.qmuiteam.qmui.widget.popup.QMUIPopup
|
|
|
-import com.qmuiteam.qmui.widget.popup.QMUIPopups
|
|
|
-import com.qmuiteam.qmui.widget.tab.QMUITab
|
|
|
-import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
-import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
-import com.quansu.heifengwuliu.R
|
|
|
import com.quansu.heifengwuliu.activity.AddressActivity
|
|
|
import com.quansu.heifengwuliu.activity.AreaSelectActivity
|
|
|
-import com.quansu.heifengwuliu.adapter.BaseFragmentPagerAdapter
|
|
|
-import com.quansu.heifengwuliu.adapter.CarEnterAdapter
|
|
|
+import com.quansu.heifengwuliu.activity.SourceDetailsActivity
|
|
|
import com.quansu.heifengwuliu.base.MBFragment
|
|
|
import com.quansu.heifengwuliu.config.ConfigRx
|
|
|
import com.quansu.heifengwuliu.config.MIntentAction
|
|
@@ -60,7 +43,6 @@ import java.text.DecimalFormat
|
|
|
*on 2020/9/11
|
|
|
*/
|
|
|
class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBinding>() {
|
|
|
- var cats = ArrayList<String>()
|
|
|
private var type = 1// 1:/装货 2卸货
|
|
|
|
|
|
private var selectViewpage = 0
|
|
@@ -73,7 +55,6 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
var is_public = 1//默认 发布到货源大厅
|
|
|
var is_insurance = 0//默认 不够买保险
|
|
|
|
|
|
-
|
|
|
//出
|
|
|
var lat_out: String = ""
|
|
|
var lng_out: String = ""
|
|
@@ -94,8 +75,6 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
override fun init(savedInstanceState: Bundle?) {
|
|
|
super.init(savedInstanceState)
|
|
|
getData()
|
|
@@ -105,6 +84,7 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
goodsTypeList.addAll(it.goods_type)
|
|
|
numsTypeList.addAll(it.nums_type)
|
|
|
initTab(it)
|
|
|
+
|
|
|
})
|
|
|
|
|
|
initData()
|
|
@@ -122,44 +102,6 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
//发布
|
|
|
judgeValue()
|
|
|
|
|
|
- return@setOnClickListener
|
|
|
-
|
|
|
- // var mNormalPopup = QMUIPopups.popup(context, QMUIDisplayHelper.dp2px(getContext(), 250))
|
|
|
-
|
|
|
- var mNormalPopup = QMUIPopups.fullScreenPopup(context)
|
|
|
- val builder: QMUISkinValueBuilder = QMUISkinValueBuilder.acquire()
|
|
|
- val frameLayout = QMUIFrameLayout(context)
|
|
|
- frameLayout.background = QMUIResHelper.getAttrDrawable(context, R.attr.qmui_skin_support_popup_bg)
|
|
|
- builder.background(R.attr.qmui_skin_support_popup_bg)
|
|
|
- QMUISkinHelper.setSkinValue(frameLayout, builder)
|
|
|
- frameLayout.radius = QMUIDisplayHelper.dp2px(context, 12)
|
|
|
- val padding = QMUIDisplayHelper.dp2px(context, 20)
|
|
|
- frameLayout.setPadding(padding, padding, padding, padding)
|
|
|
-
|
|
|
- //自定义布局
|
|
|
- val layoutInflater = requireContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
|
|
- var layout = layoutInflater.inflate(R.layout.item_app, null)
|
|
|
- val tv: TextView = layout.findViewById(R.id.label)
|
|
|
- tv.text = "123344"
|
|
|
- tv.setOnClickListener {
|
|
|
- mNormalPopup.dismiss()
|
|
|
- }
|
|
|
- builder.release();
|
|
|
-
|
|
|
- val size = QMUIDisplayHelper.dp2px(context, 200)
|
|
|
- val lp: FrameLayout.LayoutParams = FrameLayout.LayoutParams(size, size)
|
|
|
- frameLayout.addView(layout, lp)
|
|
|
-
|
|
|
- mNormalPopup.addView(frameLayout)
|
|
|
- mNormalPopup.onDismiss() {
|
|
|
- toast("onDismiss")
|
|
|
- }
|
|
|
-
|
|
|
- mNormalPopup.dismissIfOutsideTouch(false)
|
|
|
- mNormalPopup.animStyle(QMUIPopup.ANIM_GROW_FROM_CENTER)
|
|
|
- mNormalPopup.show(binding.tvPublish)
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
binding.llChoseUnits.setOnClickListener {
|
|
@@ -182,7 +124,7 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
binding.llIsInsurance.setOnClickListener {
|
|
|
|
|
|
- PopuListUtils.showQMUIPopup(context(), binding.llGoodsType, insurance, object : ChoiceData {
|
|
|
+ PopuListUtils.showQMUIPopup(context(), binding.tvIsInsurance, insurance, object : ChoiceData {
|
|
|
override fun onRestuse(name: String?) {
|
|
|
vm.insurance.value = name
|
|
|
is_insurance = if (name.equals("是")) 1 else 0
|
|
@@ -235,17 +177,25 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
|
|
|
private fun judgeValue() {
|
|
|
+
|
|
|
+ UiSwitch.bundle(context, SourceDetailsActivity::class.java, Bundle().apply {
|
|
|
+ putString("info_id", "55")
|
|
|
+ putString("type","1")
|
|
|
+ })
|
|
|
+
|
|
|
+ return
|
|
|
+
|
|
|
if (TextUtils.isEmpty(province_out)) {
|
|
|
toast("请选择装货地址!")
|
|
|
return
|
|
|
|
|
|
}
|
|
|
- var name_out = binding.viewOut.etName.text.toString().trim()
|
|
|
+ var name_out = binding.viewHead.getEtName()!!.text.toString().trim()
|
|
|
if (TextUtils.isEmpty(name_out)) {
|
|
|
toast("请输入发货人!")
|
|
|
return
|
|
|
}
|
|
|
- var mobile_out = binding.viewOut.etPhone.text.toString().trim()
|
|
|
+ var mobile_out = binding.viewHead.getEtPhone()!!.text.toString().trim()
|
|
|
if (TextUtils.isEmpty(mobile_out)) {
|
|
|
toast("请输入发货人电话!")
|
|
|
return
|
|
@@ -255,9 +205,9 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- var address_out = binding.viewOut.etDetailedAddress.text.toString().trim()
|
|
|
+ var address_out = binding.viewHead.getEtDetailedAddress()!!.text.toString().trim()
|
|
|
|
|
|
- var sendBean = SendBean(lat_out, lng_out, province_out, city_out, address_out, address_out, name_out, mobile_out, time_out, "0")
|
|
|
+ var sendBean = SendBean(lat_out, lng_out, province_out, city_out, area_out, address_out, name_out, mobile_out, time_out, "0")
|
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(province_in)) {
|
|
@@ -265,12 +215,12 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
return
|
|
|
|
|
|
}
|
|
|
- var name_in = binding.viewEnter.etName.text.toString().trim()
|
|
|
+ var name_in = binding.viewEnter.getEtName()!!.text.toString().trim()
|
|
|
if (TextUtils.isEmpty(name_in)) {
|
|
|
toast("请输入卸货人!")
|
|
|
return
|
|
|
}
|
|
|
- var mobile_in = binding.viewEnter.etPhone.text.toString().trim()
|
|
|
+ var mobile_in = binding.viewEnter.getEtPhone()!!.text.toString().trim()
|
|
|
if (TextUtils.isEmpty(mobile_in)) {
|
|
|
toast("请输入卸货人电话!")
|
|
|
return
|
|
@@ -280,6 +230,13 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ var goods_name=binding.etGoodsName.text.toString().trim()
|
|
|
+
|
|
|
+ if (TextUtils.isEmpty(goods_name)) {
|
|
|
+ toast("请输入货物类型")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (TextUtils.isEmpty(vm.goodstype.value.toString())) {
|
|
|
toast("请选择货物类型")
|
|
|
return
|
|
@@ -305,10 +262,10 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
toast("请输入卸货时间")
|
|
|
return
|
|
|
}
|
|
|
- var address_in = binding.viewEnter.etDetailedAddress.text.toString().trim()
|
|
|
+ var address_in = binding.viewEnter.getEtDetailedAddress()!!.text.toString().trim()
|
|
|
|
|
|
- var receiveBean = ReceiveBean(lat_in, lng_in, province_in, city_in, address_in, address_in, name_in, mobile_in, time_in, "1",
|
|
|
- "", vm.goodstype.value.toString(), nums, vm.unit.value.toString(), price, total
|
|
|
+ var receiveBean = ReceiveBean(lat_in, lng_in, province_in, city_in, area_in, address_in, name_in, mobile_in, time_in, "1",
|
|
|
+ goods_name, vm.goodstype.value.toString(), nums, vm.unit.value.toString(), price, total
|
|
|
)
|
|
|
|
|
|
if (is_agree==0) {
|
|
@@ -321,8 +278,16 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
return
|
|
|
}
|
|
|
var data=binding.etData.text.toString()
|
|
|
- var send= Gson().toJson(sendBean)
|
|
|
- var receive= Gson().toJson(receiveBean)
|
|
|
+
|
|
|
+ var sendList=ArrayList<SendBean>()
|
|
|
+ sendList.add(sendBean)
|
|
|
+
|
|
|
+ var send= Gson().toJson(sendList)
|
|
|
+ var receiveList=ArrayList<ReceiveBean>()
|
|
|
+ receiveList.add(receiveBean)
|
|
|
+
|
|
|
+ var receive= Gson().toJson(receiveList)
|
|
|
+
|
|
|
|
|
|
vm.setReleaseSource(info_id,total,"",carnums,is_public.toString(),is_insurance.toString(),"1",
|
|
|
data,send,receive)
|
|
@@ -355,7 +320,6 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
}
|
|
|
binding.etSingCarTotal.setText(total)
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -367,85 +331,37 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
|
|
|
private fun initTab(info: DataInfoBean) {
|
|
|
- if (null != info.car_type) {
|
|
|
- for (item in info.car_type) {
|
|
|
- cats.add(item.type_name)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //设置viewpager
|
|
|
- val fragments = ArrayList<Fragment>()
|
|
|
- var index = 0
|
|
|
- for (cat in cats) {
|
|
|
- var ownerImgFragment = OwnerImgFragment()
|
|
|
- ownerImgFragment.arguments = B().putString("img", info.car_type[index].type_img).ok()
|
|
|
- fragments.add(ownerImgFragment)
|
|
|
- index++
|
|
|
- }
|
|
|
- val adapter = BaseFragmentPagerAdapter(childFragmentManager, fragments)
|
|
|
- binding.qmViewPager.adapter = adapter
|
|
|
|
|
|
- //设置tab
|
|
|
- binding.tabs.setIndicator(QMUITabIndicator(QMUIDisplayHelper.dp2px(context(), 2), false, true))
|
|
|
- val space: Int = QMUIDisplayHelper.dp2px(context, 20)
|
|
|
- binding.tabs.setPadding(space, 0, space, 0)
|
|
|
- binding.tabs.mode = QMUITabSegment.MODE_SCROLLABLE
|
|
|
-// val space: Int = QMUIDisplayHelper.dp2px(context, 16)
|
|
|
-// binding.tabs.mode = QMUITabSegment.MODE_SCROLLABLE //MODE_SCROLLABLE 自适应宽度+滚动 MODE_FIXED 均分
|
|
|
-// binding.tabs.setItemSpaceInScrollMode(space)
|
|
|
-// binding.tabs.setupWithViewPager(binding.qmViewPager, false)
|
|
|
-// binding.tabs.setPadding(space, 0, space, 0)
|
|
|
-//
|
|
|
-
|
|
|
- val builder = binding.tabs.tabBuilder()
|
|
|
- builder
|
|
|
- .skinChangeWithTintColor(false)
|
|
|
- .setSelectColor(Color.parseColor("#2E4E71"))
|
|
|
- .setNormalColor(Color.parseColor("#666666"))
|
|
|
- .setTypeface(Typeface.DEFAULT_BOLD, Typeface.DEFAULT)
|
|
|
- .setDynamicChangeIconColor(false)
|
|
|
-
|
|
|
- val tabs = ArrayList<QMUITab>()
|
|
|
- for (cat in cats) {
|
|
|
- val item = builder
|
|
|
- .setText(cat)
|
|
|
- .build(context())
|
|
|
-
|
|
|
- tabs.add(item)
|
|
|
- }
|
|
|
- tabs.forEach {
|
|
|
- binding.tabs.addTab(it)
|
|
|
- }
|
|
|
- binding.tabs.setupWithViewPager(binding.qmViewPager, false)
|
|
|
|
|
|
+ binding.viewHead.setHeadData(info,childFragmentManager)
|
|
|
|
|
|
- binding.imgNext.setOnClickListener {
|
|
|
+ binding.viewHead.getImgNext()!!.setOnClickListener {
|
|
|
|
|
|
|
|
|
- selectViewpage = binding.qmViewPager.currentItem
|
|
|
+ selectViewpage = binding.viewHead.getQmViewPager()!!.currentItem
|
|
|
|
|
|
- if (selectViewpage < cats.size - 1) {
|
|
|
- binding.qmViewPager.currentItem = selectViewpage + 1
|
|
|
+ if (selectViewpage < binding.viewHead.getCats().size - 1) {
|
|
|
+ binding.viewHead.getQmViewPager()!!.currentItem = selectViewpage + 1
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//向右
|
|
|
- binding.imgDown.setOnClickListener {
|
|
|
+ binding.viewHead.getImgDown()!!.setOnClickListener {
|
|
|
toast("222")
|
|
|
- selectViewpage = binding.qmViewPager.currentItem
|
|
|
- if (selectViewpage < cats.size - 1) {
|
|
|
- binding.qmViewPager.currentItem = selectViewpage + 1
|
|
|
+ selectViewpage =binding.viewHead.getQmViewPager()!!.currentItem
|
|
|
+ if (selectViewpage < binding.viewHead.getCats().size - 1) {
|
|
|
+ binding.viewHead.getQmViewPager()!!.currentItem = selectViewpage + 1
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//向左
|
|
|
- binding.imgUp.setOnClickListener {
|
|
|
- selectViewpage = binding.qmViewPager.currentItem
|
|
|
+ binding.viewHead.getImgUp()!!.setOnClickListener {
|
|
|
+ selectViewpage = binding.viewHead.getQmViewPager()!!.currentItem
|
|
|
|
|
|
- if (selectViewpage < cats.size - 1 && selectViewpage > 0) {
|
|
|
- binding.qmViewPager.currentItem = selectViewpage - 1
|
|
|
+ if (selectViewpage < binding.viewHead.getCats().size - 1 && selectViewpage > 0) {
|
|
|
+ binding.viewHead.getQmViewPager()!!.currentItem = selectViewpage - 1
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -457,48 +373,48 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
insurance.add("是")
|
|
|
insurance.add("否")
|
|
|
|
|
|
-
|
|
|
//卸货信息
|
|
|
- binding.viewEnter.tvCity.setHint("请选择卸货地址")
|
|
|
- binding.viewEnter.llChoseMap.setOnClickListener {
|
|
|
+ binding.viewEnter.getTvCity()!!.hint = "请选择卸货地址"
|
|
|
+ binding.viewEnter.getTvChoseTime()!!.hint = "请选择卸货时间"
|
|
|
+
|
|
|
+ binding.viewEnter.getLlChoseMap()!!.setOnClickListener {
|
|
|
//地图选点
|
|
|
type = 2
|
|
|
choseMap()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- binding.viewOut.llChoseMap.setOnClickListener {
|
|
|
+ binding.viewHead.getLlChoseMap()!!.setOnClickListener {
|
|
|
//地图选点
|
|
|
type = 1
|
|
|
choseMap()
|
|
|
}
|
|
|
- binding.viewOut.llChoseAddress.setOnClickListener {
|
|
|
+ binding.viewHead.getLlChoseAddress()!!.setOnClickListener {
|
|
|
//地址薄 1
|
|
|
type = 1
|
|
|
UiSwitch.bundleRes(this, AddressActivity::class.java,
|
|
|
B.with().putString("type", "1").ok(), MIntentAction.REQUEST_CODE_ONE)
|
|
|
}
|
|
|
- binding.viewEnter.llChoseAddress.setOnClickListener {
|
|
|
+ binding.viewEnter.getLlChoseAddress()!!.setOnClickListener {
|
|
|
//地址薄 2
|
|
|
type = 2
|
|
|
UiSwitch.bundleRes(this, AddressActivity::class.java,
|
|
|
B.with().putString("type", "2").ok(), MIntentAction.REQUEST_CODE_ONE)
|
|
|
}
|
|
|
|
|
|
- binding.viewEnter.tvCity.setOnClickListener {
|
|
|
+ binding.viewEnter.getTvCity()!!.setOnClickListener {
|
|
|
|
|
|
type = 2
|
|
|
UiSwitch.singleRes(this, AreaSelectActivity::class.java,
|
|
|
MIntentAction.REQUEST_CODE_TWO)
|
|
|
}
|
|
|
- binding.viewOut.tvCity.setOnClickListener {
|
|
|
+ binding.viewHead.getTvCity()!!.setOnClickListener {
|
|
|
type = 1
|
|
|
UiSwitch.singleRes(this, AreaSelectActivity::class.java,
|
|
|
MIntentAction.REQUEST_CODE_TWO)
|
|
|
}
|
|
|
- binding.viewEnter.tvChoseTime.setOnClickListener {
|
|
|
+ binding.viewEnter.getTvChoseTime()!!.setOnClickListener {
|
|
|
//选择时间
|
|
|
- PopupUtils.setChoseTime(context, binding.viewEnter.tvChoseTime, object : ChoiceData {
|
|
|
+ PopupUtils.setChoseTime(context, binding.viewEnter.getTvChoseTime()!!, object : ChoiceData {
|
|
|
override fun onRestuse(time: String?) {
|
|
|
if (time != null) {
|
|
|
time_in = time
|
|
@@ -507,8 +423,8 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- binding.viewOut.tvChoseTime.setOnClickListener {
|
|
|
- PopupUtils.setChoseTime(context, binding.viewOut.tvChoseTime, object : ChoiceData {
|
|
|
+ binding.viewHead.getTvChoseTime()!!.setOnClickListener {
|
|
|
+ PopupUtils.setChoseTime(context, binding.viewHead.getTvChoseTime(), object : ChoiceData {
|
|
|
override fun onRestuse(time: String?) {
|
|
|
if (time != null) {
|
|
|
time_out = time
|
|
@@ -533,13 +449,12 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
province_out = bundle.getString("province_code")
|
|
|
city_out = bundle.getString("city_code")
|
|
|
|
|
|
- binding.viewOut.tvCity.text = name
|
|
|
+ binding.viewHead.getTvCity()!!.text = name
|
|
|
} else {
|
|
|
area_in = bundle.getString("area_code")
|
|
|
province_in = bundle.getString("province_code")
|
|
|
city_in = bundle.getString("city_code")
|
|
|
-
|
|
|
- binding.viewEnter.tvCity.text = name
|
|
|
+ binding.viewEnter.getTvCity()!!.text = name
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -553,27 +468,31 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
var item = bundle.getSerializable("item") as AddressBean
|
|
|
//todo
|
|
|
if (type == 1) {
|
|
|
- binding.viewOut.tvCity.text = item.province?.name + item.city?.name + item.area?.name
|
|
|
- binding.viewOut.etDetailedAddress.setText(item.address)
|
|
|
- binding.viewOut.tvChoseTime.text = item.create_time
|
|
|
- binding.viewOut.etName.setText(item.name)
|
|
|
- binding.viewOut.etPhone.setText(item.mobile)
|
|
|
-
|
|
|
- var province_code = item.province?.code
|
|
|
- var city_code = item.city?.code
|
|
|
- var area_code = item.area?.code
|
|
|
- } else {
|
|
|
-
|
|
|
- binding.viewEnter.tvCity.text = item.province?.name + item.city?.name + item.area?.name
|
|
|
- binding.viewEnter.etDetailedAddress.setText(item.address)
|
|
|
- binding.viewEnter.tvChoseTime.text = item.create_time
|
|
|
- binding.viewEnter.etName.setText(item.name)
|
|
|
- binding.viewEnter.etPhone.setText(item.mobile)
|
|
|
+ binding.viewHead.getTvCity()!!.text = item.province?.name + item.city?.name + item.area?.name
|
|
|
+ binding.viewHead.getEtDetailedAddress()!!.setText(item.address)
|
|
|
+ binding.viewHead.getTvChoseTime()!!.text = item.create_time
|
|
|
+ binding.viewHead.getEtName()!!.setText(item.name)
|
|
|
+ binding.viewHead.getEtPhone()!!.setText(item.mobile)
|
|
|
+ lat_out = item.lat.toString()
|
|
|
+ lng_out = item.lng.toString()
|
|
|
+ area_out = item.area!!.code.toString()
|
|
|
+ province_out = item.province!!.code.toString()
|
|
|
+ city_out = item.city!!.code.toString()
|
|
|
+ time_out = item.create_time.toString()
|
|
|
|
|
|
- var province_code = item.province?.code
|
|
|
- var city_code = item.city?.code
|
|
|
- var area_code = item.area?.code
|
|
|
+ } else {
|
|
|
|
|
|
+ binding.viewEnter.getTvCity()!!.text = item.province?.name + item.city?.name + item.area?.name
|
|
|
+ binding.viewEnter.getEtDetailedAddress()!!.setText(item.address)
|
|
|
+ binding.viewEnter.getTvChoseTime()!!.text = item.create_time
|
|
|
+ binding.viewEnter.getEtName()!!.setText(item.name)
|
|
|
+ binding.viewEnter.getEtPhone()!!.setText(item.mobile)
|
|
|
+ lat_in = item.lat.toString()
|
|
|
+ lng_in = item.lng.toString()
|
|
|
+ area_in = item.area!!.code.toString()
|
|
|
+ province_in = item.province!!.code.toString()
|
|
|
+ city_in = item.city!!.code.toString()
|
|
|
+ time_in = item.create_time.toString()
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -582,7 +501,6 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -634,9 +552,8 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
area_in = bean.areacode
|
|
|
province_in = bean.areacode.substring(0, 2) + "0000"
|
|
|
city_in = bean.areacode.substring(0, 4) + "00"
|
|
|
-
|
|
|
- binding.viewEnter.etDetailedAddress.setText(bean.position)
|
|
|
- binding.viewEnter.tvCity.text = bean.provincename + bean.cityname + bean.areaname
|
|
|
+ binding.viewEnter.getEtDetailedAddress()!!.setText(bean.position)
|
|
|
+ binding.viewEnter.getTvCity()!!.text = bean.provincename + bean.cityname + bean.areaname
|
|
|
} else {
|
|
|
|
|
|
lat_out = bean.latitude
|
|
@@ -644,10 +561,8 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
area_out = bean.areacode
|
|
|
province_out = bean.areacode.substring(0, 2) + "0000"
|
|
|
city_out = bean.areacode.substring(0, 4) + "00"
|
|
|
-
|
|
|
-
|
|
|
- binding.viewOut.etDetailedAddress.setText(bean.position)
|
|
|
- binding.viewOut.tvCity.text = bean.provincename + bean.cityname + bean.areaname
|
|
|
+ binding.viewHead.getEtDetailedAddress()!!.setText(bean.position)
|
|
|
+ binding.viewHead.getTvCity()!!.text = bean.provincename + bean.cityname + bean.areaname
|
|
|
}
|
|
|
|
|
|
|