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 {
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,7 +271,6 @@ struct WalletView: View {
var body: some View {
VStack {
headerView(goBack: goBack)
ScrollView(showsIndicators: false) {
HStack {
ZStack {
if let value = (data["result"] as? String) {
......@@ -213,10 +324,13 @@ struct WalletView: View {
.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 )
}
......