Skip to content

Commit

Permalink
Merge pull request #137 from woowahan-techcamp/jw
Browse files Browse the repository at this point in the history
170818 로그인이미지 개선
  • Loading branch information
JuneBuug authored Aug 18, 2017
2 parents 5cc5937 + 459df73 commit 7c2926c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions iOSProject/pyunrihae/pyunrihae/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@
<outlet property="emailLabel" destination="4pP-oC-oPW" id="Yel-gI-YSY"/>
<outlet property="nickNameLabel" destination="HBX-4g-kUR" id="fT0-eJ-TVZ"/>
<outlet property="tableView" destination="ZtX-Y0-mGN" id="zGF-2O-iWd"/>
<outlet property="userImage" destination="UZ3-IR-ABc" id="3wp-Lc-Zvt"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jlV-RO-HwI" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down
1 change: 1 addition & 0 deletions iOSProject/pyunrihae/pyunrihae/DataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ class DataManager{
update["p_image"] = imgURL
id.updateChildValues(update)
NotificationCenter.default.post(name: NSNotification.Name("reviewUpload"), object: self)
NotificationCenter.default.post(name: NSNotification.Name("complete"), object: self)
}

let productRef = ref.child("product").child(p_id)
Expand Down
4 changes: 3 additions & 1 deletion iOSProject/pyunrihae/pyunrihae/MypageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import FirebaseAuth
class MypageViewController: UIViewController {

@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var emailLabel: UILabel!
@IBOutlet weak var alertLabel: UILabel!
Expand All @@ -35,9 +36,9 @@ class MypageViewController: UIViewController {
if Auth.auth().currentUser != nil {
DataManager.getUserFromUID(uid: (Auth.auth().currentUser?.uid)!, completion: { (user) in
self.currentUser = user

if user.email != "" {
DispatchQueue.main.async{
self.userImage.image = UIImage(named: "user_default.png")
self.nickNameLabel.text = self.currentUser.nickname
self.emailLabel.text = self.currentUser.email
self.labelList[3] = "로그아웃"
Expand Down Expand Up @@ -65,6 +66,7 @@ class MypageViewController: UIViewController {
}
}else{
DispatchQueue.main.async{
self.userImage.image = UIImage(named: "ic_user.png")
self.nickNameLabel.text = "로그인을 해주세요."
self.emailLabel.text = "로그인을 해주세요."
self.labelList[3] = "회원가입 / 로그인"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ extension ProductDetailViewController: UITableViewDataSource, UITableViewDelegat
cell.uploadedImageLoading.stopAnimating()
})
} else {
if cell.detailReviewLabel.text == "" {
cell.detailReviewLabel.isHidden = true
cell.reviewBoxView.frame.size.height = 90
}else {
cell.reviewBoxView.frame.size.height = 120
cell.detailReviewLabel.frame.origin.y = 50
}
cell.uploadedFoodImageBtn.isHidden = true
}

Expand Down
12 changes: 8 additions & 4 deletions iOSProject/pyunrihae/pyunrihae/WritingReviewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import UIKit
import FirebaseDatabase
import Fusuma
import FirebaseAuth

class WritingReviewViewController: UIViewController, FusumaDelegate{

Expand Down Expand Up @@ -109,10 +110,13 @@ class WritingReviewViewController: UIViewController, FusumaDelegate{
}

DataManager.getProductById(id: SelectedProduct.foodId) { (product) in
DataManager.writeReview(brand: product.brand, category: product.category, grade: self.grade, priceLevel: self.priceLevel, flavorLevel: self.flavorLevel, quantityLevel: self.quantityLevel, allergy: self.allergy, review: self.detailReview.text, user: "우아한 형제들", user_image: user_image, p_id: product.id, p_image: self.reviewImage, p_name: product.name, p_price: Int(product.price)!){
self.navigationController?.popToRootViewController(animated: true)
NotificationCenter.default.post(name: NSNotification.Name("startUploading"), object: self)
}
DataManager.getUserFromUID(uid: (Auth.auth().currentUser?.uid)!, completion: { (user) in
let userNickName = user.nickname
DataManager.writeReview(brand: product.brand, category: product.category, grade: self.grade, priceLevel: self.priceLevel, flavorLevel: self.flavorLevel, quantityLevel: self.quantityLevel, allergy: self.allergy, review: self.detailReview.text, user: userNickName, user_image: user_image, p_id: product.id, p_image: self.reviewImage, p_name: product.name, p_price: Int(product.price)!){
self.navigationController?.popToRootViewController(animated: true)
NotificationCenter.default.post(name: NSNotification.Name("startUploading"), object: self)
}
})
}


Expand Down

0 comments on commit 7c2926c

Please sign in to comment.