修正拍摄任务状态并优化素材提示显示
区分整单状态与关联任务状态,素材上传中的任务不再占用继续查看入口。列表仅展示上传中或失败提示,保留交付确认入口,并补充状态和卡片复用回归。同步 Build 号至 2020202。
This commit is contained in:
@@ -77,11 +77,11 @@ final class DroneDockDeliveryViewModelTests: XCTestCase {
|
||||
XCTAssertFalse(fixture.model.canSubmit)
|
||||
}
|
||||
|
||||
/// 整单上传中仍可交付成片,但不能把状态 25 本身当作上传许可。
|
||||
func testUploadingOrderDeliveryRequiresExplicitPermission() async throws {
|
||||
/// 原素材上传中的执行订单仍按成片交付许可决定操作,活动任务 25 不额外授权。
|
||||
func testUploadingMaterialsDeliveryRequiresExplicitPermission() async throws {
|
||||
for allowed in [false, true] {
|
||||
let fixture = try DeliveryVMFixture(initialTaskID: 11)
|
||||
fixture.service.detailValue = try DeliveryVMData.detail(allowed: allowed, status: 25)
|
||||
fixture.service.detailValue = try DeliveryVMData.detail(allowed: allowed, materialStatus: 2, activeTaskStatus: 25)
|
||||
await fixture.prepare()
|
||||
XCTAssertEqual(fixture.model.canChooseVideo, allowed)
|
||||
XCTAssertEqual(fixture.model.canSubmit, allowed)
|
||||
@@ -94,7 +94,7 @@ final class DroneDockDeliveryViewModelTests: XCTestCase {
|
||||
|
||||
/// 无上传权限、已取消、已退款和不支持的视频均不发送写请求。
|
||||
func testPermissionAndVideoValidationDisableSubmission() async throws {
|
||||
for (allowed, status) in [(false, 20), (true, 10), (true, 40), (true, 50)] {
|
||||
for (allowed, status) in [(false, 20), (true, 10), (true, 25), (true, 40), (true, 50)] {
|
||||
let fixture = try DeliveryVMFixture(initialTaskID: 11)
|
||||
fixture.service.detailValue = try DeliveryVMData.detail(allowed: allowed, status: status)
|
||||
await fixture.prepare()
|
||||
@@ -503,11 +503,16 @@ private enum DeliveryVMData {
|
||||
.init(url: URL(fileURLWithPath: "/tmp/\(name)"), fileName: name, fileSize: 20)
|
||||
}
|
||||
|
||||
static func detail(allowed: Bool = true, status: Int = 20, number: String = "TEST-ORDER") throws -> DroneDockMaterialDetail {
|
||||
try decode(["order_number": number, "order_status": status, "can_upload_film": allowed,
|
||||
static func detail(allowed: Bool = true, status: Int = 20, number: String = "TEST-ORDER",
|
||||
materialStatus: Int = 0, activeTaskStatus: Int? = nil) throws -> DroneDockMaterialDetail {
|
||||
var value: [String: Any] = ["order_number": number, "order_status": status, "can_upload_film": allowed,
|
||||
"shoot_count": 5, "shot_count": 1, "remaining_count": 4,
|
||||
"spot": [["scenic_spot_id": 201, "scenic_spot_name": "测试点位一"],
|
||||
["scenic_spot_id": 202, "scenic_spot_name": "测试点位二"]]] as [String: Any])
|
||||
["scenic_spot_id": 202, "scenic_spot_name": "测试点位二"]]]
|
||||
value["material_status"] = materialStatus
|
||||
value["active_task_status"] = activeTaskStatus
|
||||
if activeTaskStatus != nil { value["active_task_id"] = 21 }
|
||||
return try decode(value)
|
||||
}
|
||||
|
||||
static func record(id: Int, spot: Int) -> [String: Any] {
|
||||
|
||||
Reference in New Issue
Block a user