Manos Chorianopoulos
{
"images" : [
{
"filename" : "deals_for_you.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "deals_for_you-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "deals_for_you-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_gifts_for_you.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_gifts_for_you-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_gifts_for_you-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_loyalty_rewards.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_loyalty_rewards-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_loyalty_rewards-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -85,12 +85,110 @@ extension WalletView {
struct myCoupons: View {
var uiscreen = UIScreen.main.bounds
var instanceOfMySwiftApi = swiftApi()
// var couponsLength = instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count
var body: some View {
VStack {
HStack {
Text("My coupons")
.font(.system(size: 18))
.foregroundColor(Color.white)
.fontWeight(.medium)
Spacer()
Text("Παλαιότερα κουπόνια ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
}
.padding(.leading, self.uiscreen.width * 0.05)
.padding(.trailing, self.uiscreen.width * 0.05)
HStack {
VStack {
Spacer()
Text(.init("Έχεις **" + String(instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count) + "** ενεργά κουπόνια"))
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
.font(.system(size: 17))
Spacer()
Text("Δες τα όλα ->")
.font(.system(size: 12))
.fontWeight(.medium)
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
Spacer()
}
.padding(.leading, self.uiscreen.width * 0.1)
Spacer()
Image("ic_gifts_for_you", bundle: Bundle(for: MyEmptyClass.self))
.frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.1)
.padding(.trailing, self.uiscreen.width * 0.08)
}
.padding(.top, self.uiscreen.height * 0.01)
.padding(.bottom, self.uiscreen.height * 0.01)
.background(
Image("coupons_container", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(minWidth: self.uiscreen.width * 0.975, idealWidth: self.uiscreen.width * 0.975, maxWidth: self.uiscreen.width * 0.975)
.scaledToFill()
.aspectRatio(contentMode: .fill)
)
.frame(width: self.uiscreen.width * 0.975)
}
.padding(.top, self.uiscreen.height * 0.025)
.padding(.bottom, self.uiscreen.height * 0.025)
.frame(width: self.uiscreen.width)
.background(Color(hex: 0xFFFFFF).opacity(0.13))
}
}
struct myRewards: View {
var uiscreen = UIScreen.main.bounds
var instanceOfMySwiftApi = swiftApi()
var body: some View {
HStack {
VStack {
HStack {
Text("My rewards")
.font(.system(size: 18))
.foregroundColor(Color.white)
.fontWeight(.medium)
Spacer()
Text("Παλαιότερα δώρα ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
}
.padding(.leading, self.uiscreen.width * 0.05)
.padding(.trailing, self.uiscreen.width * 0.05)
HStack {
VStack {
Spacer()
Text(.init("Έχεις **" + String(instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count) + "** ενεργά δώρα"))
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
.font(.system(size: 17))
Spacer()
Text("Δες τα όλα ->")
.font(.system(size: 12))
.fontWeight(.medium)
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
Spacer()
}
.padding(.leading, self.uiscreen.width * 0.1)
Spacer()
Image("ic_loyalty_rewards", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.08)
.padding(.trailing, self.uiscreen.width * 0.08)
}
.padding(.top, self.uiscreen.height * 0.02)
.padding(.bottom, self.uiscreen.height * 0.02)
.frame(width: self.uiscreen.width * 0.975)
.background(Color.white)
}
.padding(.top, self.uiscreen.height * 0.025)
.padding(.bottom, self.uiscreen.height * 0.025)
.frame(width: self.uiscreen.width)
.background(Color(hex: 0xFFFFFF).opacity(0.13))
.padding(.top, self.uiscreen.height * 0.02)
}
}
......@@ -117,7 +215,7 @@ extension WalletView {
.foregroundColor(Color(hex: 0x84929E))
}
Spacer()
Image("deals_for_you")
Image("deals_for_you", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.08)
.padding(.top, self.uiscreen.height * 0.01)
......@@ -125,12 +223,26 @@ extension WalletView {
}
.padding(.leading, self.uiscreen.width * 0.04)
.padding(.trailing, self.uiscreen.width * 0.04)
.frame(width: self.uiscreen.width * 0.95, alignment: .leading)
.frame(width: self.uiscreen.width * 0.975, alignment: .leading)
.background(Color.white)
.cornerRadius(3)
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.04)
myCoupons()
myRewards()
HStack {
Text("Ανάλυση")
.font(.system(size: 14))
.fontWeight(.medium)
.foregroundColor(Color(hex: 0x509E2F))
.padding(.top, self.uiscreen.height * 0.015)
.padding(.bottom, self.uiscreen.height * 0.015)
}
.frame(width: self.uiscreen.width * 0.925)
.background(Color(hex: 0xE6E6E6))
.padding(.top, self.uiscreen.height * 0.02)
.padding(.bottom, self.uiscreen.height * 0.03)
}
.frame(width: self.uiscreen.width, alignment: .center)
.background(
......@@ -159,64 +271,66 @@ struct WalletView: View {
var body: some View {
VStack {
headerView(goBack: goBack)
ScrollView(showsIndicators: false) {
HStack {
ZStack {
if let value = (data["result"] as? String) {
ImageView(withURL: value, width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05, isFill: true)
.cornerRadius(self.uiscreen.height * 0.05)
.padding(.leading, self.uiscreen.width * 0.05)
} else {
Image("generic_profile")
.frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05)
.background(Color.black)
.cornerRadius(self.uiscreen.height * 0.05)
.padding(.leading, self.uiscreen.width * 0.05)
}
Circle()
.strokeBorder(Color(hex: 0x22A9B5), lineWidth: 1)
HStack {
ZStack {
if let value = (data["result"] as? String) {
ImageView(withURL: value, width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05, isFill: true)
.cornerRadius(self.uiscreen.height * 0.05)
.padding(.leading, self.uiscreen.width * 0.05)
} else {
Image("generic_profile")
.frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05)
.background(Color.black)
.cornerRadius(self.uiscreen.height * 0.05)
.padding(.leading, self.uiscreen.width * 0.05)
}
VStack(alignment: .leading) {
Text(WalletView.localizedWithParameter(parameter: data["firstname"] as! String + " " + (data["lastname"] as! String)))
.font(.system(size: 13))
.padding(.top, self.uiscreen.height * 0.005)
.frame(width: self.uiscreen.width * 0.7, alignment: .leading)
Spacer()
if let value = (data["profile_metadata"] as? NSDictionary) {
if ((value["answered"] != nil) == true) {
VStack {
}
.background(
LinearGradient(gradient: Gradient(colors: [Color(hex: 0x1AADCC), Color(hex: 0x83C062)]), startPoint: .trailing, endPoint: .leading)
)
}
} else {
HStack {
Text("+")
.font(.system(size: 17))
.padding(.bottom, 2)
Text("Ερωτηματολόγιο")
.font(.system(size: 13))
.fontWeight(.medium)
Circle()
.strokeBorder(Color(hex: 0x22A9B5), lineWidth: 1)
.frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05)
.padding(.leading, self.uiscreen.width * 0.05)
}
VStack(alignment: .leading) {
Text(WalletView.localizedWithParameter(parameter: data["firstname"] as! String + " " + (data["lastname"] as! String)))
.font(.system(size: 13))
.padding(.top, self.uiscreen.height * 0.005)
.frame(width: self.uiscreen.width * 0.7, alignment: .leading)
Spacer()
if let value = (data["profile_metadata"] as? NSDictionary) {
if ((value["answered"] != nil) == true) {
VStack {
}
.padding(.leading, 5)
.padding(.trailing, 5)
.overlay(
RoundedRectangle(cornerRadius: 16).stroke(Color(hex: 0x556778), lineWidth: 1)
.background(
LinearGradient(gradient: Gradient(colors: [Color(hex: 0x1AADCC), Color(hex: 0x83C062)]), startPoint: .trailing, endPoint: .leading)
)
.padding(.bottom, self.uiscreen.height * 0.005)
}
} else {
HStack {
Text("+")
.font(.system(size: 17))
.padding(.bottom, 2)
Text("Ερωτηματολόγιο")
.font(.system(size: 13))
.fontWeight(.medium)
}
.padding(.leading, 5)
.padding(.trailing, 5)
.overlay(
RoundedRectangle(cornerRadius: 16).stroke(Color(hex: 0x556778), lineWidth: 1)
)
.padding(.bottom, self.uiscreen.height * 0.005)
}
.padding(.leading , self.uiscreen.width * 0.025)
}
.frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.06, alignment: .leading)
.padding(.leading , self.uiscreen.width * 0.025)
}
.frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.06, alignment: .leading)
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.02)
ScrollView(showsIndicators: false) {
linearView(data: data)
}
.frame(width:self.uiscreen.width, height:self.uiscreen.height * 0.9 )
.frame(width:self.uiscreen.width, height:self.uiscreen.height * 0.78 )
}
.frame(width:self.uiscreen.width, height:self.uiscreen.height )
}
......