Vasilis

wallet ready

1 +{
2 + "images" : [
3 + {
4 + "filename" : "deals_for_you.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "deals_for_you-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "deals_for_you-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_gifts_for_you.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_gifts_for_you-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_gifts_for_you-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_loyalty_rewards.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_loyalty_rewards-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_loyalty_rewards-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
...@@ -85,12 +85,110 @@ extension WalletView { ...@@ -85,12 +85,110 @@ extension WalletView {
85 85
86 struct myCoupons: View { 86 struct myCoupons: View {
87 var uiscreen = UIScreen.main.bounds 87 var uiscreen = UIScreen.main.bounds
88 - 88 + var instanceOfMySwiftApi = swiftApi()
89 +// var couponsLength = instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count
89 var body: some View { 90 var body: some View {
91 + VStack {
92 + HStack {
93 + Text("My coupons")
94 + .font(.system(size: 18))
95 + .foregroundColor(Color.white)
96 + .fontWeight(.medium)
97 + Spacer()
98 + Text("Παλαιότερα κουπόνια ->")
99 + .font(.system(size: 14))
100 + .foregroundColor(Color.white)
101 + .fontWeight(.medium)
102 + }
103 + .padding(.leading, self.uiscreen.width * 0.05)
104 + .padding(.trailing, self.uiscreen.width * 0.05)
90 HStack { 105 HStack {
106 + VStack {
107 + Spacer()
108 + Text(.init("Έχεις **" + String(instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count) + "** ενεργά κουπόνια"))
109 + .frame(width: self.uiscreen.width * 0.35, alignment: .leading)
110 + .font(.system(size: 17))
111 + Spacer()
112 + Text("Δες τα όλα ->")
113 + .font(.system(size: 12))
114 + .fontWeight(.medium)
115 + .frame(width: self.uiscreen.width * 0.35, alignment: .leading)
116 + Spacer()
117 + }
118 + .padding(.leading, self.uiscreen.width * 0.1)
119 + Spacer()
120 + Image("ic_gifts_for_you", bundle: Bundle(for: MyEmptyClass.self))
121 + .frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.1)
122 + .padding(.trailing, self.uiscreen.width * 0.08)
123 + }
124 + .padding(.top, self.uiscreen.height * 0.01)
125 + .padding(.bottom, self.uiscreen.height * 0.01)
126 + .background(
127 + Image("coupons_container", bundle: Bundle(for: MyEmptyClass.self))
128 + .resizable()
129 + .frame(minWidth: self.uiscreen.width * 0.975, idealWidth: self.uiscreen.width * 0.975, maxWidth: self.uiscreen.width * 0.975)
130 + .scaledToFill()
131 + .aspectRatio(contentMode: .fill)
132 + )
133 + .frame(width: self.uiscreen.width * 0.975)
134 + }
135 + .padding(.top, self.uiscreen.height * 0.025)
136 + .padding(.bottom, self.uiscreen.height * 0.025)
137 + .frame(width: self.uiscreen.width)
138 + .background(Color(hex: 0xFFFFFF).opacity(0.13))
139 + }
140 + }
141 +
142 + struct myRewards: View {
143 + var uiscreen = UIScreen.main.bounds
144 +
145 + var instanceOfMySwiftApi = swiftApi()
91 146
147 + var body: some View {
148 + VStack {
149 + HStack {
150 + Text("My rewards")
151 + .font(.system(size: 18))
152 + .foregroundColor(Color.white)
153 + .fontWeight(.medium)
154 + Spacer()
155 + Text("Παλαιότερα δώρα ->")
156 + .font(.system(size: 14))
157 + .foregroundColor(Color.white)
158 + .fontWeight(.medium)
159 + }
160 + .padding(.leading, self.uiscreen.width * 0.05)
161 + .padding(.trailing, self.uiscreen.width * 0.05)
162 + HStack {
163 + VStack {
164 + Spacer()
165 + Text(.init("Έχεις **" + String(instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count) + "** ενεργά δώρα"))
166 + .frame(width: self.uiscreen.width * 0.35, alignment: .leading)
167 + .font(.system(size: 17))
168 + Spacer()
169 + Text("Δες τα όλα ->")
170 + .font(.system(size: 12))
171 + .fontWeight(.medium)
172 + .frame(width: self.uiscreen.width * 0.35, alignment: .leading)
173 + Spacer()
92 } 174 }
175 + .padding(.leading, self.uiscreen.width * 0.1)
176 + Spacer()
177 + Image("ic_loyalty_rewards", bundle: Bundle(for: MyEmptyClass.self))
178 + .resizable()
179 + .frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.08)
180 + .padding(.trailing, self.uiscreen.width * 0.08)
181 + }
182 + .padding(.top, self.uiscreen.height * 0.02)
183 + .padding(.bottom, self.uiscreen.height * 0.02)
184 + .frame(width: self.uiscreen.width * 0.975)
185 + .background(Color.white)
186 + }
187 + .padding(.top, self.uiscreen.height * 0.025)
188 + .padding(.bottom, self.uiscreen.height * 0.025)
93 .frame(width: self.uiscreen.width) 189 .frame(width: self.uiscreen.width)
190 + .background(Color(hex: 0xFFFFFF).opacity(0.13))
191 + .padding(.top, self.uiscreen.height * 0.02)
94 } 192 }
95 } 193 }
96 194
...@@ -117,7 +215,7 @@ extension WalletView { ...@@ -117,7 +215,7 @@ extension WalletView {
117 .foregroundColor(Color(hex: 0x84929E)) 215 .foregroundColor(Color(hex: 0x84929E))
118 } 216 }
119 Spacer() 217 Spacer()
120 - Image("deals_for_you") 218 + Image("deals_for_you", bundle: Bundle(for: MyEmptyClass.self))
121 .resizable() 219 .resizable()
122 .frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.08) 220 .frame(width: self.uiscreen.height * 0.08, height: self.uiscreen.height * 0.08)
123 .padding(.top, self.uiscreen.height * 0.01) 221 .padding(.top, self.uiscreen.height * 0.01)
...@@ -125,12 +223,26 @@ extension WalletView { ...@@ -125,12 +223,26 @@ extension WalletView {
125 } 223 }
126 .padding(.leading, self.uiscreen.width * 0.04) 224 .padding(.leading, self.uiscreen.width * 0.04)
127 .padding(.trailing, self.uiscreen.width * 0.04) 225 .padding(.trailing, self.uiscreen.width * 0.04)
128 - .frame(width: self.uiscreen.width * 0.95, alignment: .leading) 226 + .frame(width: self.uiscreen.width * 0.975, alignment: .leading)
129 .background(Color.white) 227 .background(Color.white)
130 .cornerRadius(3) 228 .cornerRadius(3)
131 .padding(.top, self.uiscreen.height * 0.04) 229 .padding(.top, self.uiscreen.height * 0.04)
132 .padding(.bottom, self.uiscreen.height * 0.04) 230 .padding(.bottom, self.uiscreen.height * 0.04)
133 myCoupons() 231 myCoupons()
232 + myRewards()
233 + HStack {
234 + Text("Ανάλυση")
235 + .font(.system(size: 14))
236 + .fontWeight(.medium)
237 + .foregroundColor(Color(hex: 0x509E2F))
238 + .padding(.top, self.uiscreen.height * 0.015)
239 + .padding(.bottom, self.uiscreen.height * 0.015)
240 + }
241 + .frame(width: self.uiscreen.width * 0.925)
242 + .background(Color(hex: 0xE6E6E6))
243 + .padding(.top, self.uiscreen.height * 0.02)
244 + .padding(.bottom, self.uiscreen.height * 0.03)
245 +
134 } 246 }
135 .frame(width: self.uiscreen.width, alignment: .center) 247 .frame(width: self.uiscreen.width, alignment: .center)
136 .background( 248 .background(
...@@ -159,7 +271,6 @@ struct WalletView: View { ...@@ -159,7 +271,6 @@ struct WalletView: View {
159 var body: some View { 271 var body: some View {
160 VStack { 272 VStack {
161 headerView(goBack: goBack) 273 headerView(goBack: goBack)
162 - ScrollView(showsIndicators: false) {
163 HStack { 274 HStack {
164 ZStack { 275 ZStack {
165 if let value = (data["result"] as? String) { 276 if let value = (data["result"] as? String) {
...@@ -213,10 +324,13 @@ struct WalletView: View { ...@@ -213,10 +324,13 @@ struct WalletView: View {
213 .padding(.leading , self.uiscreen.width * 0.025) 324 .padding(.leading , self.uiscreen.width * 0.025)
214 } 325 }
215 .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.06, alignment: .leading) 326 .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.06, alignment: .leading)
327 + .padding(.top, self.uiscreen.height * 0.04)
328 + .padding(.bottom, self.uiscreen.height * 0.02)
329 + ScrollView(showsIndicators: false) {
216 linearView(data: data) 330 linearView(data: data)
217 -
218 } 331 }
219 - .frame(width:self.uiscreen.width, height:self.uiscreen.height * 0.9 ) 332 + .frame(width:self.uiscreen.width, height:self.uiscreen.height * 0.78 )
333 +
220 } 334 }
221 .frame(width:self.uiscreen.width, height:self.uiscreen.height ) 335 .frame(width:self.uiscreen.width, height:self.uiscreen.height )
222 } 336 }
......