|
@@ -1,7 +1,6 @@
|
|
|
package com.quansu.heifengwuliu.fragment
|
|
|
|
|
|
import android.app.Activity
|
|
|
-import android.content.Context
|
|
|
import android.content.Intent
|
|
|
import android.os.Bundle
|
|
|
import android.text.Editable
|
|
@@ -15,12 +14,12 @@ import com.hwangjr.rxbus.annotation.Subscribe
|
|
|
import com.hwangjr.rxbus.annotation.Tag
|
|
|
import com.quansu.heifengwuliu.activity.AddressActivity
|
|
|
import com.quansu.heifengwuliu.activity.AreaSelectActivity
|
|
|
-import com.quansu.heifengwuliu.activity.SourceDetailsActivity
|
|
|
import com.quansu.heifengwuliu.base.MBFragment
|
|
|
import com.quansu.heifengwuliu.config.ConfigRx
|
|
|
import com.quansu.heifengwuliu.config.MIntentAction
|
|
|
import com.quansu.heifengwuliu.databinding.FragmentOwnersingleBinding
|
|
|
import com.quansu.heifengwuliu.inte.ChoiceData
|
|
|
+import com.quansu.heifengwuliu.inte.ChoiceListData
|
|
|
import com.quansu.heifengwuliu.model.AddressBean
|
|
|
import com.quansu.heifengwuliu.model.DataInfoBean
|
|
|
import com.quansu.heifengwuliu.model.bean.ReceiveBean
|
|
@@ -47,6 +46,8 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
private var selectViewpage = 0
|
|
|
var goodsTypeList = ArrayList<String>()
|
|
|
+ var goodsTypeCode = ArrayList<String>()
|
|
|
+
|
|
|
var numsTypeList = ArrayList<String>()
|
|
|
|
|
|
var insurance = ArrayList<String>()
|
|
@@ -72,6 +73,7 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
var time_in: String = ""
|
|
|
|
|
|
var info_id:String="0"
|
|
|
+ var goods_type_code="0"
|
|
|
|
|
|
|
|
|
|
|
@@ -81,7 +83,10 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
vm.info.observe(this, Observer {
|
|
|
//观察
|
|
|
- goodsTypeList.addAll(it.goods_type)
|
|
|
+ for(item in it.goods_type){
|
|
|
+ goodsTypeList.add(item.name)
|
|
|
+ goodsTypeCode.add(item.code)
|
|
|
+ }
|
|
|
numsTypeList.addAll(it.nums_type)
|
|
|
initTab(it)
|
|
|
|
|
@@ -106,8 +111,8 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
binding.llChoseUnits.setOnClickListener {
|
|
|
|
|
|
- PopuListUtils.showQMUIPopup(context(), binding.llChoseUnits, numsTypeList, object : ChoiceData {
|
|
|
- override fun onRestuse(name: String?) {
|
|
|
+ PopuListUtils.showQMUIPopup(context(), binding.llChoseUnits, numsTypeList,null, object : ChoiceListData {
|
|
|
+ override fun onRestuse(code: String?,name: String?) {
|
|
|
vm.unit.value = name
|
|
|
}
|
|
|
})
|
|
@@ -115,17 +120,20 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
|
|
|
|
|
|
binding.llGoodsType.setOnClickListener {
|
|
|
- PopuListUtils.showQMUIPopup(context(), binding.llGoodsType, goodsTypeList, object : ChoiceData {
|
|
|
- override fun onRestuse(name: String?) {
|
|
|
+
|
|
|
+ PopuListUtils.showQMUIPopup(context(), binding.llGoodsType, goodsTypeList,goodsTypeCode, object : ChoiceListData {
|
|
|
+ override fun onRestuse(code: String?,name: String?) {
|
|
|
+ goods_type_code=code!!
|
|
|
vm.goodstype.value = name
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
binding.llIsInsurance.setOnClickListener {
|
|
|
|
|
|
- PopuListUtils.showQMUIPopup(context(), binding.tvIsInsurance, insurance, object : ChoiceData {
|
|
|
- override fun onRestuse(name: String?) {
|
|
|
+ PopuListUtils.showQMUIPopup(context(), binding.tvIsInsurance, insurance,null, object : ChoiceListData {
|
|
|
+ override fun onRestuse(code: String?,name: String?) {
|
|
|
vm.insurance.value = name
|
|
|
is_insurance = if (name.equals("是")) 1 else 0
|
|
|
|
|
@@ -265,7 +273,7 @@ class OwnerSingleFragment : MBFragment<OwnerSingleVModel, FragmentOwnersingleBin
|
|
|
var address_in = binding.viewEnter.getEtDetailedAddress()!!.text.toString().trim()
|
|
|
|
|
|
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
|
|
|
+ goods_name, goods_type_code, nums, vm.unit.value.toString(), price, total
|
|
|
)
|
|
|
|
|
|
if (is_agree==0) {
|