钱包功能调试
This commit is contained in:
parent
683d8eb283
commit
23f6e12b35
@ -223,10 +223,24 @@ public class OssServiceUtil {
|
|||||||
*
|
*
|
||||||
* @param localFiles
|
* @param localFiles
|
||||||
*/
|
*/
|
||||||
public void asyncPutImages(final List<String> localFiles, PicsResultCallback callback) {
|
public void asyncPutImages(final List<String> localFiles, final AppCompatActivity activity, PicsResultCallback callback) {
|
||||||
|
|
||||||
|
if (activity != null) {
|
||||||
|
activity.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
initDialog(activity);
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
number = 1;
|
number = 1;
|
||||||
success.clear();
|
success.clear();
|
||||||
|
failure.clear();
|
||||||
for (int i = 0; i < localFiles.size(); i++) {
|
for (int i = 0; i < localFiles.size(); i++) {
|
||||||
File file = new File(localFiles.get(i));
|
File file = new File(localFiles.get(i));
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
@ -245,6 +259,14 @@ public class OssServiceUtil {
|
|||||||
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
||||||
success.add(aliPath);
|
success.add(aliPath);
|
||||||
if (number == localFiles.size()) {
|
if (number == localFiles.size()) {
|
||||||
|
if (activity != null) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
//返回 上传路径,以及失败的路径
|
//返回 上传路径,以及失败的路径
|
||||||
callback.onOssSuccess(success, failure);
|
callback.onOssSuccess(success, failure);
|
||||||
}
|
}
|
||||||
@ -257,6 +279,14 @@ public class OssServiceUtil {
|
|||||||
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
||||||
failure.add(aliPath);
|
failure.add(aliPath);
|
||||||
if (number == localFiles.size()) {
|
if (number == localFiles.size()) {
|
||||||
|
if (activity != null) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
callback.onOssSuccess(success, failure);
|
callback.onOssSuccess(success, failure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ class WaybillAppraiseActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
|
|||||||
tvCom.text = orderBean?.receiverBusinessName//收货方
|
tvCom.text = orderBean?.receiverBusinessName//收货方
|
||||||
tvFreight.text = orderBean?.driverFreight.toString()
|
tvFreight.text = orderBean?.driverFreight.toString()
|
||||||
|
|
||||||
tvCarInfo.text = """${t.data.vehicleLength} ${t.data.vehicleType}"""
|
tvCarInfo.text = """${t.data.waybillInfo.carLong}/${t.data.waybillInfo.vehicleType}"""
|
||||||
tvGoods.text = goods
|
tvGoods.text = goods
|
||||||
|
|
||||||
tvReceTime.text = orderBean.waybillInfo.receivingOrderTime
|
tvReceTime.text = orderBean.waybillInfo.receivingOrderTime
|
||||||
|
@ -61,10 +61,10 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
|
|||||||
binding.btnCall.setOnClickListener {
|
binding.btnCall.setOnClickListener {
|
||||||
BaseUtils.callPhone(this@WaybillDetailActivity, "15838201105")
|
BaseUtils.callPhone(this@WaybillDetailActivity, "15838201105")
|
||||||
}
|
}
|
||||||
binding.cvCap.visibility = if (isCap) View.VISIBLE else View.GONE
|
|
||||||
binding.btnReceiving.setOnClickListener {
|
binding.btnReceiving.setOnClickListener {
|
||||||
if (!::orderDetailInfo.isInitialized){
|
if (!::orderDetailInfo.isInitialized) {
|
||||||
ToastUtils.showToast(mContext,"请稍等,暂未获取订单信息")
|
ToastUtils.showToast(mContext, "请稍等,暂未获取订单信息")
|
||||||
}
|
}
|
||||||
OrderUtils.getInstance().goReceWaybill(
|
OrderUtils.getInstance().goReceWaybill(
|
||||||
mContext,
|
mContext,
|
||||||
@ -106,9 +106,12 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
|
|||||||
}
|
}
|
||||||
binding.run {
|
binding.run {
|
||||||
|
|
||||||
tvTime.text = """${TimeUtil.changeDateNoneFormat(t.data.receiverDeadline,
|
tvTime.text = """${
|
||||||
"yyyy-MM-dd"
|
TimeUtil.changeDateNoneFormat(
|
||||||
)} 卸货"""
|
t.data.receiverDeadline,
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
)
|
||||||
|
} 卸货"""
|
||||||
tvCom.text = t.data.receiverBusinessName
|
tvCom.text = t.data.receiverBusinessName
|
||||||
tvUnloadDis.text = t.data.distance + "km"
|
tvUnloadDis.text = t.data.distance + "km"
|
||||||
tvCarType.text = """${t.data.vehicleLength}/${t.data.vehicleType}"""
|
tvCarType.text = """${t.data.vehicleLength}/${t.data.vehicleType}"""
|
||||||
@ -117,6 +120,15 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
|
|||||||
tvConsignor.text = t.data.realCompanyName
|
tvConsignor.text = t.data.realCompanyName
|
||||||
tvType.text = if (t.data.orderType == "0") "一装一卸" else "一装多卸"
|
tvType.text = if (t.data.orderType == "0") "一装一卸" else "一装多卸"
|
||||||
tvFreight.text = t.data.driverFreight.toString()
|
tvFreight.text = t.data.driverFreight.toString()
|
||||||
|
|
||||||
|
if (!t.data.shipperCaptainId.isNullOrEmpty() && t.data.shipperCaptainId != "0") {
|
||||||
|
tvCapName.text = t.data.captainInfo.captainName
|
||||||
|
tvCapPhone.text = t.data.captainInfo.contactPhone
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, t.data.captainInfo.avatar, 8, ivCapHead)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tvGoods.text = goods
|
tvGoods.text = goods
|
||||||
btnCall.setOnClickListener {
|
btnCall.setOnClickListener {
|
||||||
PermissionX.init(this@WaybillDetailActivity)
|
PermissionX.init(this@WaybillDetailActivity)
|
||||||
|
@ -164,10 +164,17 @@ class WaybillLoadActivity : BaseActivity<ActivityWaybillLoadBinding>() {
|
|||||||
tvCom.text = orderBean?.receiverBusinessName//收货方
|
tvCom.text = orderBean?.receiverBusinessName//收货方
|
||||||
tvFreight.text = orderBean?.driverFreight.toString()
|
tvFreight.text = orderBean?.driverFreight.toString()
|
||||||
|
|
||||||
tvCarInfo.text = """${t.data.vehicleLength} ${t.data.vehicleType}"""
|
tvCarInfo.text = """${t.data.waybillInfo.carLong}/${t.data.waybillInfo.vehicleType}"""
|
||||||
tvGoods.text = goods
|
tvGoods.text = goods
|
||||||
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
|
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
|
||||||
|
|
||||||
|
if (!t.data.shipperCaptainId.isNullOrEmpty() && t.data.shipperCaptainId != "0") {
|
||||||
|
tvCapName.text = t.data.captainInfo.captainName
|
||||||
|
tvCapPhone.text = t.data.captainInfo.contactPhone
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, t.data.captainInfo.avatar, 8, ivCapHead)
|
||||||
|
}
|
||||||
|
|
||||||
btnLeft.setOnClickListener {
|
btnLeft.setOnClickListener {
|
||||||
val phone = orderBean.orderChildList.first { it.type == "1" }.phone
|
val phone = orderBean.orderChildList.first { it.type == "1" }.phone
|
||||||
if (phone.isNullOrEmpty()){
|
if (phone.isNullOrEmpty()){
|
||||||
|
@ -33,6 +33,7 @@ import com.arpa.mylibrary.recycleviewswipe.RecycleViewDivider
|
|||||||
import com.arpa.mylibrary.utils.ActivityUtils
|
import com.arpa.mylibrary.utils.ActivityUtils
|
||||||
import com.arpa.mylibrary.utils.BaseUtils
|
import com.arpa.mylibrary.utils.BaseUtils
|
||||||
import com.arpa.mylibrary.utils.ConvertUtils
|
import com.arpa.mylibrary.utils.ConvertUtils
|
||||||
|
import com.arpa.mylibrary.utils.ImageLoader
|
||||||
import com.arpa.mylibrary.utils.LoadingUtils
|
import com.arpa.mylibrary.utils.LoadingUtils
|
||||||
import com.arpa.mylibrary.utils.TimeUtil
|
import com.arpa.mylibrary.utils.TimeUtil
|
||||||
import com.arpa.mylibrary.utils.ToastUtils
|
import com.arpa.mylibrary.utils.ToastUtils
|
||||||
@ -165,7 +166,7 @@ class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
|
|||||||
tvCom.text = orderBean?.receiverBusinessName//收货方
|
tvCom.text = orderBean?.receiverBusinessName//收货方
|
||||||
tvFreight.text = orderBean?.driverFreight.toString()
|
tvFreight.text = orderBean?.driverFreight.toString()
|
||||||
|
|
||||||
tvCarInfo.text = """${t.data.vehicleLength}/${t.data.vehicleType}"""
|
tvCarInfo.text = """${t.data.waybillInfo.carLong}/${t.data.waybillInfo.vehicleType}"""
|
||||||
tvGoods.text = goods
|
tvGoods.text = goods
|
||||||
|
|
||||||
tvReceTime.text = orderBean.waybillInfo.receivingOrderTime
|
tvReceTime.text = orderBean.waybillInfo.receivingOrderTime
|
||||||
@ -174,6 +175,13 @@ class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
|
|||||||
|
|
||||||
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
|
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
|
||||||
|
|
||||||
|
if (!t.data.shipperCaptainId.isNullOrEmpty() && t.data.shipperCaptainId != "0") {
|
||||||
|
tvCapName.text = t.data.captainInfo.captainName
|
||||||
|
tvCapPhone.text = t.data.captainInfo.contactPhone
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, t.data.captainInfo.avatar, 8, ivCapHead)
|
||||||
|
}
|
||||||
|
|
||||||
btnLeft.setOnClickListener {
|
btnLeft.setOnClickListener {
|
||||||
var phone = orderBean.orderChildList.findLast { it.type=="2" }?.phone
|
var phone = orderBean.orderChildList.findLast { it.type=="2" }?.phone
|
||||||
if (phone.isNullOrEmpty()){
|
if (phone.isNullOrEmpty()){
|
||||||
|
@ -33,6 +33,7 @@ import com.arpa.mylibrary.utils.ActivityUtils
|
|||||||
import com.arpa.mylibrary.utils.BitmapUtil
|
import com.arpa.mylibrary.utils.BitmapUtil
|
||||||
import com.arpa.mylibrary.utils.FileUtil
|
import com.arpa.mylibrary.utils.FileUtil
|
||||||
import com.arpa.mylibrary.utils.LoadingUtils
|
import com.arpa.mylibrary.utils.LoadingUtils
|
||||||
|
import com.arpa.mylibrary.utils.LoadingUtils.Companion.instance
|
||||||
import com.arpa.mylibrary.utils.PopsUtils
|
import com.arpa.mylibrary.utils.PopsUtils
|
||||||
import com.arpa.mylibrary.utils.TimeUtil
|
import com.arpa.mylibrary.utils.TimeUtil
|
||||||
import com.arpa.mylibrary.utils.ToastUtils
|
import com.arpa.mylibrary.utils.ToastUtils
|
||||||
@ -125,37 +126,39 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
myAdapter.selectMax = 1
|
myAdapter.selectMax = 1
|
||||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||||
override fun onItemClick(v: View?, position: Int) {
|
override fun onItemClick(v: View?, position: Int) {
|
||||||
PopsUtils.getInstance().showSelPic(mContext, true, myAdapter) {
|
PopsUtils.getInstance()
|
||||||
OssServiceUtil.getInstance().run {
|
.showSelPic(mContext, 1, true, myAdapter) {
|
||||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
OssServiceUtil.getInstance().run {
|
||||||
setResultCallBack { data, oldPath ->
|
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||||
picBean = WaybillPhoto()
|
setResultCallBack { data, oldPath ->
|
||||||
picBean.run {
|
picBean = WaybillPhoto()
|
||||||
localPhotoUrl = it[0].availablePath
|
picBean.run {
|
||||||
photoUrl = oldPath
|
localPhotoUrl = it[0].availablePath
|
||||||
location = binding.tvLoca.text.toString()
|
photoUrl = oldPath
|
||||||
receiptType =
|
location = binding.tvLoca.text.toString()
|
||||||
if (type == 1) "4" else if (type == 2) "5" else "6"
|
receiptType =
|
||||||
this.type = "3"
|
if (type == 1) "4" else if (type == 2) "5" else "6"
|
||||||
}
|
this.type = "3"
|
||||||
if (upBean.waybillPhotoList.find { it.type == "3" } == null) {
|
}
|
||||||
upBean.waybillPhotoList.add(picBean)
|
if (upBean.waybillPhotoList.find { it.type == "3" } == null) {
|
||||||
} else {
|
upBean.waybillPhotoList.add(picBean)
|
||||||
upBean.waybillPhotoList.find { it.type == "3" }!!.photoUrl =
|
} else {
|
||||||
oldPath
|
upBean.waybillPhotoList.find { it.type == "3" }!!.photoUrl =
|
||||||
|
oldPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
myAdapter.data.run {
|
||||||
|
clear()
|
||||||
|
addAll(it)
|
||||||
|
}
|
||||||
|
myAdapter.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
myAdapter.data.run {
|
|
||||||
clear()
|
|
||||||
addAll(it)
|
|
||||||
}
|
|
||||||
myAdapter.notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openPicture() {
|
override fun openPicture() {
|
||||||
PopsUtils.getInstance().showSelPic(mContext, true, myAdapter) {
|
PopsUtils.getInstance()
|
||||||
|
.showSelPic(mContext, 1, true, myAdapter) {
|
||||||
OssServiceUtil.getInstance().run {
|
OssServiceUtil.getInstance().run {
|
||||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
@ -176,12 +179,12 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myAdapter.data.run {
|
myAdapter.data.run {
|
||||||
clear()
|
clear()
|
||||||
addAll(it)
|
addAll(it)
|
||||||
|
}
|
||||||
|
myAdapter.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
myAdapter.notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -208,8 +211,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun subMit(orderType: Int?) {
|
private fun subMit(orderType: Int?) {
|
||||||
if (!::latLng.isInitialized){
|
if (!::latLng.isInitialized) {
|
||||||
ToastUtils.showToast(mContext,"未获取到定位,请重新获取位置")
|
ToastUtils.showToast(mContext, "未获取到定位,请重新获取位置")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
upBean.run {
|
upBean.run {
|
||||||
@ -557,9 +560,8 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun selGoodPic(goodType: Int?, myAdapter: GridImageAdapter) {
|
private fun selGoodPic(goodType: Int?, myAdapter: GridImageAdapter) {
|
||||||
PopsUtils.getInstance().showSelPic(mContext, false, myAdapter) {
|
PopsUtils.getInstance().showSelPic(mContext, 1, false, myAdapter) {
|
||||||
OssServiceUtil.getInstance().run {
|
OssServiceUtil.getInstance().run {
|
||||||
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
|
||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
|
@ -62,7 +62,7 @@ class OrderUtils private constructor() {
|
|||||||
"102030" -> "去接单"
|
"102030" -> "去接单"
|
||||||
"102040" -> "去装货"
|
"102040" -> "去装货"
|
||||||
"102050" -> "去卸货"
|
"102050" -> "去卸货"
|
||||||
"102060" -> "待签收"
|
"102060" -> "去评价"
|
||||||
"102070" -> "去评价"
|
"102070" -> "去评价"
|
||||||
"102090" -> "去评价"
|
"102090" -> "去评价"
|
||||||
"103000" -> "已取消"
|
"103000" -> "已取消"
|
||||||
|
@ -115,7 +115,7 @@ class PopBottomPic(
|
|||||||
.isMaxSelectEnabledMask(true)
|
.isMaxSelectEnabledMask(true)
|
||||||
.setMaxSelectNum(num)
|
.setMaxSelectNum(num)
|
||||||
.isGif(false)
|
.isGif(false)
|
||||||
.setSelectionMode(SelectModeConfig.SINGLE)
|
// .setSelectionMode(SelectModeConfig.SINGLE)
|
||||||
.setSelectedData(myAdapter.data)
|
.setSelectedData(myAdapter.data)
|
||||||
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {
|
||||||
override fun onResult(result: ArrayList<LocalMedia>) {
|
override fun onResult(result: ArrayList<LocalMedia>) {
|
||||||
|
@ -27,10 +27,10 @@ class PopsUtils private constructor(){
|
|||||||
* @param myAdapter
|
* @param myAdapter
|
||||||
* @param listenter 结果回调
|
* @param listenter 结果回调
|
||||||
*/
|
*/
|
||||||
fun showSelPic(ctx: Context,isReturn : Boolean = false,myAdapter: GridImageAdapter, listenter: OnPicResultListener){
|
fun showSelPic(ctx: Context,maxPics :Int = 1, isReturn : Boolean = false,myAdapter: GridImageAdapter, listenter: OnPicResultListener){
|
||||||
XPopup.Builder(ctx)
|
XPopup.Builder(ctx)
|
||||||
.dismissOnTouchOutside(true)
|
.dismissOnTouchOutside(true)
|
||||||
.asCustom(PopBottomPic(ctx,1,isReturn, myAdapter, listenter))
|
.asCustom(PopBottomPic(ctx,maxPics,isReturn, myAdapter, listenter))
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user