Skip to content

Commit

Permalink
#5 Feat: priceStack, eventBadge of DetailCell
Browse files Browse the repository at this point in the history
  • Loading branch information
zzisun committed Apr 28, 2021
1 parent e3c3e75 commit c01ab08
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ios/sidedishApp/sidedishApp/Domain/Entity/Detail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,9 @@ struct Detail: Codable, Hashable, Equatable {
func getIsPurchasable() -> Bool {
return item.getIsPurchasable()
}

func getEventBadgeList() -> [EventBadge] {
return item.getEventBadgeList()
}
}

4 changes: 4 additions & 0 deletions ios/sidedishApp/sidedishApp/Domain/Entity/DetailItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ struct DetailItem: Codable, Hashable, Equatable {
func getIsPurchasable() -> Bool {
return self.purchasable
}

func getEventBadgeList() -> [EventBadge] {
return eventBadgeList
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class DetailInfoCell: UICollectionViewCell {
private var orderViewModel: OrderViewModelType!
private var item: Detail!

@IBOutlet weak var priceStackView: PriceStackView!

@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var salePriceLabel: UILabel!
Expand Down Expand Up @@ -50,13 +52,23 @@ class DetailInfoCell: UICollectionViewCell {
func configureCell(item: Detail) {
nameLabel.text = item.getName()
descriptionLabel.text = item.getDescription()
salePriceLabel.text = "\(item.getSalePrice())"
normalPriceLabel.text = "\(item.getNormalPrice())"
// salePriceLabel.text = "\(item.getSalePrice())원"
// normalPriceLabel.text = "\(item.getNormalPrice())원"
pointPriceLabel.text = "\(item.getPointRate())"
self.orderViewModel = OrderViewModel(order: (1, item.getSalePrice()))
self.item = item
self.fetchOrderData()
self.updateOrder()

for view in eventBadgeStackView.subviews {
view.removeFromSuperview()
}
item.getEventBadgeList().forEach { eventBadge in
let badgeLabel = BadgeLabel()
badgeLabel.configureLabel(text: eventBadge.getName(), color: eventBadge.getColorHex())

eventBadgeStackView.addArrangedSubview(badgeLabel)
}
}

private func configureUI() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -40,7 +40,7 @@
<color key="textColor" systemColor="systemGray3Color"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="9KC-5s-bRb">
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="9KC-5s-bRb" customClass="PriceStackView" customModule="sidedishApp" customModuleProvider="target">
<rect key="frame" x="0.0" y="80" width="153.5" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5,500원" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eG3-cd-rzw">
Expand Down Expand Up @@ -296,14 +296,13 @@
<outlet property="descriptionLabel" destination="jgB-1x-XHZ" id="K8e-Ee-OrF"/>
<outlet property="eventBadgeStackView" destination="Tiv-bB-lxc" id="Y03-Me-g2f"/>
<outlet property="nameLabel" destination="HGu-dL-NBm" id="O15-OU-cf0"/>
<outlet property="normalPriceLabel" destination="2tj-so-mXj" id="dSk-eM-6Tb"/>
<outlet property="orderButton" destination="Yfi-fx-4iu" id="M7X-sT-xL5"/>
<outlet property="pointPriceLabel" destination="5PD-sG-JR0" id="J5k-cK-8tf"/>
<outlet property="priceStackView" destination="9KC-5s-bRb" id="RN4-Bj-iU1"/>
<outlet property="quantityLabel" destination="EHm-qx-g1F" id="mux-Ul-Kpz"/>
<outlet property="salePriceLabel" destination="eG3-cd-rzw" id="GEU-6U-diQ"/>
<outlet property="totalPriceLabel" destination="1nm-rW-Uw7" id="Rm4-03-ztS"/>
</connections>
<point key="canvasLocation" x="-123.91304347826087" y="10.714285714285714"/>
<point key="canvasLocation" x="72" y="12"/>
</collectionViewCell>
</objects>
<resources>
Expand Down

0 comments on commit c01ab08

Please sign in to comment.