优化
This commit is contained in:
parent
52d4104632
commit
8ade965635
@ -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)
|
||||||
|
|||||||
@ -71,6 +71,9 @@ struct IAPProduct {
|
|||||||
var reviewScreenshot: String = ""
|
var reviewScreenshot: String = ""
|
||||||
var familySharable: Bool = false
|
var familySharable: Bool = false
|
||||||
var inAppPurchaseType: IAPType = .UNKNOW //# CONSUMABLE、NON_CONSUMABLE、NON_RENEWING_SUBSCRIPTION
|
var inAppPurchaseType: IAPType = .UNKNOW //# CONSUMABLE、NON_CONSUMABLE、NON_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.
Loading…
x
Reference in New Issue
Block a user