This commit is contained in:
zeng 2025-10-28 12:23:49 +08:00
parent 52d4104632
commit 8ade965635
3 changed files with 44 additions and 24 deletions

View File

@ -445,7 +445,7 @@ extension APUploadIAPListVC {
// //
if let group = currentSubGroup { if let group = currentSubGroup {
for localization in product.localizations { if let localization = product.groupLocalization {
let _ = await ascAPI.createSubscriptionGroupLocalizations(iapGroupId: group.id, name: localization.name, locale: localization.locale, customAppName: nil) let _ = await ascAPI.createSubscriptionGroupLocalizations(iapGroupId: group.id, name: localization.name, locale: localization.locale, customAppName: nil)
} }
} }
@ -478,7 +478,8 @@ extension APUploadIAPListVC {
// 2. // 2.
ascAPI.addMessage("开始更新订阅商品本地化版本:\(product.productId)") ascAPI.addMessage("开始更新订阅商品本地化版本:\(product.productId)")
let localizations = await ascAPI.fetchSubscriptionLocalizations(iapId: iap.id) let localizations = await ascAPI.fetchSubscriptionLocalizations(iapId: iap.id)
for localization in product.localizations { // for localization in product.localizations {
if let localization = product.subscriptionLocalization {
// //
if let locale = localizations.filter({ $0.attributes?.locale == localization.locale }).first { if let locale = localizations.filter({ $0.attributes?.locale == localization.locale }).first {
// //
@ -514,9 +515,12 @@ extension APUploadIAPListVC {
} }
// 2. // 2.
for localization in product.localizations { if let localization = product.subscriptionLocalization {
await createSubscriptionLocalization(iapId: iap.id, localization: localization, product: product, ascAPI: ascAPI) await createSubscriptionLocalization(iapId: iap.id, localization: localization, product: product, ascAPI: ascAPI)
} }
// for localization in product.localizations {
// await createSubscriptionLocalization(iapId: iap.id, localization: localization, product: product, ascAPI: ascAPI)
// }
// 3. // 3.
await updateSubscriptionPricePoint(iapId: iap.id, product: product, ascAPI: ascAPI) await updateSubscriptionPricePoint(iapId: iap.id, product: product, ascAPI: ascAPI)

View File

@ -71,6 +71,9 @@ struct IAPProduct {
var reviewScreenshot: String = "" var reviewScreenshot: String = ""
var familySharable: Bool = false var familySharable: Bool = false
var inAppPurchaseType: IAPType = .UNKNOW //# CONSUMABLENON_CONSUMABLENON_RENEWING_SUBSCRIPTION var inAppPurchaseType: IAPType = .UNKNOW //# CONSUMABLENON_CONSUMABLENON_RENEWING_SUBSCRIPTION
var groupLocalization: IAPLocalization?
var subscriptionLocalization: IAPLocalization?
var localizations: [IAPLocalization] = [] var localizations: [IAPLocalization] = []
// //
var subscriptions: IAPSubscriptions? var subscriptions: IAPSubscriptions?
@ -186,6 +189,18 @@ struct IAPExcelParser {
iap.reviewScreenshot = columnValues["F"] ?? "" iap.reviewScreenshot = columnValues["F"] ?? ""
iap.reviewNote = columnValues["G"] ?? "" iap.reviewNote = columnValues["G"] ?? ""
//
if let text = columnValues["H"], !text.isEmpty {
let localization = IAPLocalization(name: text, description: "", locale: "en-US")
iap.groupLocalization = localization
}
//
if let text = columnValues["I"], !text.isEmpty {
let des = columnValues["J"] ?? ""
let localization = IAPLocalization(name: text, description: des, locale: "en-US")
iap.subscriptionLocalization = localization
}
// //
if iap.productId.isEmpty, iap.name.isEmpty { if iap.productId.isEmpty, iap.name.isEmpty {
continue continue
@ -214,28 +229,29 @@ struct IAPExcelParser {
iap.territories = territory iap.territories = territory
} }
// //
var localizations: [IAPLocalization] = [] // var localizations: [IAPLocalization] = []
// 7 // // 7
let columeMax = columnIndexs.count // let columeMax = columnIndexs.count
let columeEndIndex = columnIndexs.count - 1 // let columeEndIndex = columnIndexs.count - 1
for idx in stride(from: 7, to: columeEndIndex, by: 2){ // for idx in stride(from: 7, to: columeEndIndex, by: 2){
if idx + 1 <= columeMax { // if idx + 1 <= columeMax {
let locale = columnTitles[idx] // let locale = columnTitles[idx]
let key1 = columnIndexs[idx] // let key1 = columnIndexs[idx]
let key2 = columnIndexs[idx+1] // let key2 = columnIndexs[idx+1]
let name = columnValues[key1] ?? "" // let name = columnValues[key1] ?? ""
let description = columnValues[key2] ?? "" // let description = columnValues[key2] ?? ""
if !name.isEmpty && !description.isEmpty { // if !name.isEmpty && !description.isEmpty {
var localization = IAPLocalization() // var localization = IAPLocalization()
localization.locale = locale // localization.locale = locale
localization.name = name // localization.name = name
localization.description = description // localization.description = description
localizations.append(localization) // localizations.append(localization)
} // }
} // }
} // }
iap.localizations = localizations // iap.localizations = localizations
result.append(iap) result.append(iap)
} }
} }

Binary file not shown.