Skip to content

Commit

Permalink
Merged in madoka_igarashi/sba19aw/19AW/develop (pull request wangjwch…
Browse files Browse the repository at this point in the history
…n#35)

19AW/develop
  • Loading branch information
madoka3530 committed May 10, 2019
2 parents aca12c5 + 8118a7b commit 41ab838
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 81 deletions.
3 changes: 2 additions & 1 deletion Share Beauty App/Common/Const.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -515,7 +546,7 @@ class LifeStyleViewController: UIViewController, NavigationControllerAnnotation,
// }
}

mContentWidth = contentWidth + 700
mContentWidth = contentWidth + 270

setInfoImage()
}
Expand All @@ -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
Expand Down

0 comments on commit 41ab838

Please sign in to comment.