实现了部分收货UI。替换为张欢测试服务
This commit is contained in:
@@ -146,8 +146,8 @@ class ReceiptViewModel @Inject constructor(
|
||||
fun getReceiveDetail(id: Int) {
|
||||
launchWithLoading {
|
||||
val response = repository.getReceiveDetail(id)
|
||||
if (response.isSuccess()) {
|
||||
_currentPurchaseInfo.value = response.data
|
||||
if (parseResponse(response)) {
|
||||
_currentPurchaseInfo.value = response.result
|
||||
initOrders()
|
||||
}
|
||||
}
|
||||
@@ -305,15 +305,9 @@ class ReceiptViewModel @Inject constructor(
|
||||
fun partialReceipt(uploadInfo: UploadInfo) {
|
||||
launchWithLoading {
|
||||
val response = repository.partialReceipt(uploadInfo)
|
||||
if (!response.isSuccess()) {
|
||||
parseResponse(response)
|
||||
return@launchWithLoading
|
||||
}
|
||||
if (response.success == true) {
|
||||
if (parseResponse(response)) {
|
||||
ToastUtils.showToast("部分收货成功")
|
||||
_receiptResult.value = true
|
||||
} else {
|
||||
ToastUtils.showToast("部分收货失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,15 +315,9 @@ class ReceiptViewModel @Inject constructor(
|
||||
fun confirmReceipt(uploadInfo: UploadInfo) {
|
||||
launchWithLoading {
|
||||
val response = repository.confirmReceipt(uploadInfo)
|
||||
if (!response.isSuccess()) {
|
||||
parseResponse(response)
|
||||
return@launchWithLoading
|
||||
}
|
||||
if (response.success == true) {
|
||||
if (parseResponse(response)) {
|
||||
ToastUtils.showToast("收货成功")
|
||||
_receiptResult.value = true
|
||||
} else {
|
||||
ToastUtils.showToast("收货失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user