diff --git a/Share Beauty App/Common/Const.swift b/Share Beauty App/Common/Const.swift index 72c336d..98c65ce 100644 --- a/Share Beauty App/Common/Const.swift +++ b/Share Beauty App/Common/Const.swift @@ -95,7 +95,8 @@ struct Const { static let troubleDisplayNormal = 2 static let troubleDisplayHide = 1 - static let lifeStyleBeautyList:[Int] = [616, 617, 618, 619, 620, 623, 624, 626] +// static let lifeStyleBeautyList:[Int] = [616, 617, 618, 619, 620, 623, 624, 626] + static let lifeStyleBeautyList:[Int] = [616, 618, 619, 620, 623, 624, 625, 597, 627, 632, 626, 595, 629, 631] // 613のみ 612はつかわないWaso t-hirai 19ss LanguageConfigure.UTMId // 18AW // private var productIdsDefault:[Int] = [564,566,568,LanguageConfigure.UTMId, 570, 571, 578, 572] diff --git a/Share Beauty App/Controllers/LifeStyleBeauty/LifeStyleViewController.swift b/Share Beauty App/Controllers/LifeStyleBeauty/LifeStyleViewController.swift index 9657df8..14e2373 100644 --- a/Share Beauty App/Controllers/LifeStyleBeauty/LifeStyleViewController.swift +++ b/Share Beauty App/Controllers/LifeStyleBeauty/LifeStyleViewController.swift @@ -411,6 +411,7 @@ class LifeStyleViewController: UIViewController, NavigationControllerAnnotation, let productId = product.productId //19AW対応 + //新規追加625, 597, 627, 632, 626, 595, 629, 631 if pastProductId != 0 { if productId == 617 || productId == 618 { contentWidth += viewWidth + 400 @@ -458,14 +459,44 @@ class LifeStyleViewController: UIViewController, NavigationControllerAnnotation, } else { contentWidth += viewWidth * 2 + 200 } - } else if productId == 626 { + + } else if productId == 625 { if pastProductId == 619 || pastProductId == 623 { contentWidth += viewWidth * 2 + 225 } else if pastProductId == 620 || pastProductId == 624 { contentWidth += viewWidth + 225 - } else { + } + else { contentWidth += viewWidth + 400 } + } else if productId == 597{ + if pastProductId == 625{ + contentWidth += viewWidth + } + } else if productId == 627 { + if pastProductId == 625 || pastProductId == 597{ + contentWidth += viewWidth + } + } else if productId == 632{ + if pastProductId == 625 || pastProductId == 597 || pastProductId == 627{ + contentWidth += viewWidth + } + } else if productId == 626 { + if pastProductId == 632{ + contentWidth += viewWidth + 200 + } + } else if productId == 595 { + if pastProductId == 626{ + contentWidth += viewWidth + } + } else if productId == 629 { + if pastProductId == 595 { + contentWidth += viewWidth + } + } else if productId == 631 { + if pastProductId == 629 { + contentWidth += viewWidth + } } } else { if productId == 619 || productId == 623 { @@ -515,7 +546,7 @@ class LifeStyleViewController: UIViewController, NavigationControllerAnnotation, // } } - mContentWidth = contentWidth + 700 + mContentWidth = contentWidth + 270 setInfoImage() } @@ -539,88 +570,25 @@ class LifeStyleViewController: UIViewController, NavigationControllerAnnotation, imageItemIds = [] labelItems = [] - var hasUtmComment: Bool = false - var hasMoiComment: Bool = false - var hasSunComment: Bool = false + var hasMakComment: Bool = false - var pastProductId: Int = 0 - var oChangeIndex: Bool = false - var tChangeIndex: Bool = false - var itemIds = [616: 8160, 617: 8161, 618: 8162, 619: 8163, 623: 8164, 626: 8165] - for (index, product) in productList.products.enumerated() { - let productId = product.productId - if productId == 620 { - if pastProductId != 619 { - itemIds[620] = 8163 - } - } else if productId == 624 { - if pastProductId != 623 { - itemIds[624] = 8164 - } - } - if itemIds[product.productId] ?? 0 != 0 - { - var index_f = index; - if tChangeIndex { - index_f = index - 2 - } else if oChangeIndex { - index_f = index - 1 - } - let itemWidth: CGFloat = 680 - var imageX: CGFloat = itemWidth * CGFloat(index_f) - 20//60 + let itemIds = [616, 617, 618, 619, 625, 626] + let itemIdSentences = [616: 8160, 617: 8161, 618: 8162, 619: 8163, 625: 8165, 626: 8165] + for (index, item) in itemIds.enumerated() { + let productId = item + + let itemWidth: CGFloat = [625, 626].contains(productId) ? 1400 : 680 + let imageX: CGFloat = [625, 626].contains(productId) ? (680 * 4 + itemWidth * CGFloat(index - 4) + 120) : (itemWidth * CGFloat(index) + 20) let imageY: CGFloat = 170 let height: CGFloat = 130 - var width: CGFloat = itemWidth - 150 //80 + let width: CGFloat = [625, 626].contains(productId) ? itemWidth - 300 : itemWidth - 150 //80 let font: UIFont = UIFont(name: "Reader", size: 17)! - - if product.lineId == Const.lineIdUTM && utmProductsCount >= 2 && !hasUtmComment { - hasUtmComment = true - width = width * CGFloat(utmProductsCount) - imageX += (itemWidth * CGFloat(utmProductsCount) - width) / 2 - imageItemIds.append((discription: "lifestyle10", x: imageX, y: imageY, width: width, height: height)) - labelItems.append((discription: 7985, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) - - } else if moistureProductIds.contains(product.productId) && moistureProductsCount >= 2 && !hasMoiComment { - hasMoiComment = true - width = width * CGFloat(moistureProductsCount) - imageX += (itemWidth * CGFloat(moistureProductsCount) - width) / 2 - imageItemIds.append((discription: "lifestyle10", x: imageX, y: imageY, width: width, height: height)) - labelItems.append((discription: 7986, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) - - } else if product.lineId == Const.lineIdSUNCARE && suncareProductsCount >= 2 && !hasSunComment { - hasSunComment = true - width = width * CGFloat(suncareProductsCount) - imageX += (itemWidth * CGFloat(suncareProductsCount) - width) / 2 - imageItemIds.append((discription: "lifestyle10", x: imageX, y: imageY, width: width, height: height)) - labelItems.append((discription: 7987, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) - - } else if product.lineId == Const.lineIdMAKEUP && makeUpProductsCount >= 2 && !hasMakComment { - hasMakComment = true - width = width * CGFloat(makeUpProductsCount) - imageX += (itemWidth * CGFloat(makeUpProductsCount) - width) / 2 - imageItemIds.append((discription: "lifestyle10", x: imageX, y: imageY, width: width, height: height)) - labelItems.append((discription: 7988, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) - } else if productIdsDefault.contains(product.productId) { - - hasMakComment = true - width = width * CGFloat(makeUpProductsCount) - imageX += (itemWidth * CGFloat(makeUpProductsCount) - width) / 2 - imageItemIds.append((discription: "baloon_19AW", x: imageX, y: imageY, width: width, height: height)) - labelItems.append((discription: itemIds[product.productId] ?? 8165, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) - } - - } - if pastProductId == 619 && productId == 620 { - oChangeIndex = true - } else if pastProductId == 623 && productId == 624 { - if oChangeIndex { - tChangeIndex = true - } else { - oChangeIndex = true - } - } - pastProductId = productId + hasMakComment = true + print(productId) + print(itemIdSentences[productId]) + imageItemIds.append((discription: "baloon_19AW", x: imageX, y: imageY, width: width, height: height)) + labelItems.append((discription: itemIdSentences[productId] ?? 1111, x: imageX + CGFloat(10), y: imageY, width: width - CGFloat(20), font: font)) } imageItemIds.enumerated().forEach { (i: Int, element: (discription: String, x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat)) in