Vasilis

fix of uibuttons

......@@ -93,6 +93,9 @@ extension WalletView {
struct myCoupons: View {
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
var instanceOfMySwiftApi = swiftApi()
// var couponsLength = instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count
var body: some View {
......@@ -103,10 +106,18 @@ extension WalletView {
.foregroundColor(Color.white)
.fontWeight(.medium)
Spacer()
Text("Παλαιότερα κουπόνια ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
Button {
let instanceOfMyApi = MyApi()
let oldCouponsView = instanceOfMyApi.openOldCoupons(parentView)!
oldCouponsView.view.tag = 9
oldCouponsView.view.frame = parentView.frame
parentView.addSubview(oldCouponsView.view)
} label: {
Text("Παλαιότερα κουπόνια ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
}
}
.padding(.leading, self.uiscreen.width * 0.05)
.padding(.trailing, self.uiscreen.width * 0.05)
......@@ -117,10 +128,18 @@ extension WalletView {
.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)
Button {
let instanceOfMyApi = MyApi()
let couponsView = instanceOfMyApi.openCoupons(parentView)!
couponsView.view.tag = 1
couponsView.view.frame = parentView.frame
parentView.addSubview(couponsView.view)
} label: {
Text("Δες τα όλα ->")
.font(.system(size: 12))
.fontWeight(.medium)
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
}
Spacer()
}
.padding(.leading, self.uiscreen.width * 0.1)
......@@ -150,53 +169,63 @@ extension WalletView {
struct myRewards: View {
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
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))
Button {
let instanceOfMyApi = MyApi()
let allGiftsViewController = instanceOfMyApi.openAllGifts(parentView)!
allGiftsViewController.view.tag = 8
allGiftsViewController.view.frame = parentView.frame
parentView.addSubview(allGiftsViewController.view)
} label: {
VStack {
HStack {
Text("My rewards")
.font(.system(size: 18))
.foregroundColor(Color.white)
.fontWeight(.medium)
Spacer()
Text("Δες τα όλα ->")
.font(.system(size: 12))
Text("Παλαιότερα δώρα ->")
.font(.system(size: 14))
.foregroundColor(Color.white)
.fontWeight(.medium)
.frame(width: self.uiscreen.width * 0.35, alignment: .leading)
}
.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(.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)
.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)
}
}
......@@ -205,6 +234,8 @@ extension WalletView {
var uiscreen = UIScreen.main.bounds
@State var parentView:UIView
var body: some View {
VStack{
HStack {
......@@ -236,8 +267,8 @@ extension WalletView {
.cornerRadius(3)
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.04)
myCoupons()
myRewards()
myCoupons(parentView: parentView)
myRewards(parentView: parentView)
HStack {
Text("Ανάλυση")
.font(.system(size: 14))
......@@ -335,7 +366,7 @@ struct WalletView: View {
.padding(.top, self.uiscreen.height * 0.04)
.padding(.bottom, self.uiscreen.height * 0.02)
ScrollView(showsIndicators: false) {
linearView(data: data)
linearView(data: data, parentView: parentView)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.edgesIgnoringSafeArea([.bottom])
......