修复合作获客扫码绑定崩溃与 Toast 层级,并接入分成比例修改。
将扫码页提升到列表层弹出并补齐 AppDelegate.window,避免扫码时 UIKit 取主窗口崩溃;Toast 改用独立 UIWindow 显示在 sheet 之上;合作获客员支持短信验证修改分成比例,同时优化冷启动根视图创建时机并补充相关测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -17,7 +17,7 @@ protocol CooperationOrderServing {
|
||||
func saleUserInviteInfo(saleUserId: Int) async throws -> SaleUserInviteInfo
|
||||
|
||||
/// 接受获客员绑定。
|
||||
func saleUserAcceptBind(saleUserId: Int) async throws
|
||||
func saleUserAcceptBind(saleUserId: Int, commissionRate: Int) async throws
|
||||
|
||||
/// 获取获客员线索列表。
|
||||
func saleUserReferralLeads(page: Int, pageSize: Int) async throws -> ListPayload<ReferralLead>
|
||||
@ -36,6 +36,12 @@ protocol CooperationOrderServing {
|
||||
|
||||
/// 更新合作获客员备注名。
|
||||
func saleUserUpdateRemark(saleUserId: Int, photogRemarkName: String) async throws
|
||||
|
||||
/// 发送修改分成比例短信验证码。
|
||||
func saleUserCommissionRateSendSmsCode(phone: String) async throws
|
||||
|
||||
/// 更新合作获客员分成比例。
|
||||
func saleUserUpdateCommissionRate(saleUserId: Int, commissionRate: Int, smsCode: String) async throws -> CooperativeSaler
|
||||
}
|
||||
|
||||
@MainActor
|
||||
@ -78,12 +84,15 @@ final class CooperationOrderAPI: CooperationOrderServing {
|
||||
}
|
||||
|
||||
/// 接受获客员绑定。
|
||||
func saleUserAcceptBind(saleUserId: Int) async throws {
|
||||
func saleUserAcceptBind(saleUserId: Int, commissionRate: Int) async throws {
|
||||
let _: EmptyPayload = try await client.send(
|
||||
APIRequest(
|
||||
method: .post,
|
||||
path: "/api/yf-handset-app/photog/sale-user/accept-bind",
|
||||
queryItems: [URLQueryItem(name: "sale_user_id", value: "\(saleUserId)")]
|
||||
queryItems: [
|
||||
URLQueryItem(name: "sale_user_id", value: "\(saleUserId)"),
|
||||
URLQueryItem(name: "commission_rate", value: "\(commissionRate)"),
|
||||
]
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -173,4 +182,34 @@ final class CooperationOrderAPI: CooperationOrderServing {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/// 发送修改分成比例短信验证码。
|
||||
func saleUserCommissionRateSendSmsCode(phone: String) async throws {
|
||||
let _: EmptyPayload = try await client.send(
|
||||
APIRequest(
|
||||
method: .post,
|
||||
path: "/api/yf-handset-app/photog/sale-user/commission-rate/send-sms-code",
|
||||
body: SaleUserCommissionRateSmsRequest(phone: phone)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/// 更新合作获客员分成比例。
|
||||
func saleUserUpdateCommissionRate(
|
||||
saleUserId: Int,
|
||||
commissionRate: Int,
|
||||
smsCode: String
|
||||
) async throws -> CooperativeSaler {
|
||||
try await client.send(
|
||||
APIRequest(
|
||||
method: .post,
|
||||
path: "/api/yf-handset-app/photog/sale-user/commission-rate",
|
||||
body: SaleUserCommissionRateUpdateRequest(
|
||||
saleUserId: saleUserId,
|
||||
commissionRate: commissionRate,
|
||||
smsCode: smsCode
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user