Merge branch 'master' of https://git.warp.ly/open-source/warply_sdk_framework
Showing
14 changed files
with
235 additions
and
52 deletions
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 | +} |
17.7 KB
17.7 KB
17.7 KB
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 | +} |
WarplySDKFrameworkIOS/Media.xcassets/ic_loyalty_rewards.imageset/ic_loyalty_rewards-1.png
0 → 100644
7.93 KB
WarplySDKFrameworkIOS/Media.xcassets/ic_loyalty_rewards.imageset/ic_loyalty_rewards-2.png
0 → 100644
7.93 KB
7.93 KB
No preview for this file type
... | @@ -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 | + var instanceOfMySwiftApi = swiftApi() | ||
89 | +// var couponsLength = instanceOfMySwiftApi.getCoupons().filter({ $0.status! == 1 }).count | ||
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) | ||
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() | ||
88 | 146 | ||
89 | var body: some View { | 147 | var body: some View { |
90 | - HStack { | 148 | + VStack { |
91 | - | 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() | ||
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) | ||
92 | } | 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,64 +271,66 @@ struct WalletView: View { | ... | @@ -159,64 +271,66 @@ 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) { | 274 | + HStack { |
163 | - HStack { | 275 | + ZStack { |
164 | - ZStack { | 276 | + if let value = (data["result"] as? String) { |
165 | - if let value = (data["result"] as? String) { | 277 | + ImageView(withURL: value, width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05, isFill: true) |
166 | - ImageView(withURL: value, width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05, isFill: true) | 278 | + .cornerRadius(self.uiscreen.height * 0.05) |
167 | - .cornerRadius(self.uiscreen.height * 0.05) | 279 | + .padding(.leading, self.uiscreen.width * 0.05) |
168 | - .padding(.leading, self.uiscreen.width * 0.05) | 280 | + |
169 | - | 281 | + } else { |
170 | - } else { | 282 | + Image("generic_profile") |
171 | - Image("generic_profile") | ||
172 | - .frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05) | ||
173 | - .background(Color.black) | ||
174 | - .cornerRadius(self.uiscreen.height * 0.05) | ||
175 | - .padding(.leading, self.uiscreen.width * 0.05) | ||
176 | - } | ||
177 | - Circle() | ||
178 | - .strokeBorder(Color(hex: 0x22A9B5), lineWidth: 1) | ||
179 | .frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05) | 283 | .frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05) |
284 | + .background(Color.black) | ||
285 | + .cornerRadius(self.uiscreen.height * 0.05) | ||
180 | .padding(.leading, self.uiscreen.width * 0.05) | 286 | .padding(.leading, self.uiscreen.width * 0.05) |
181 | } | 287 | } |
182 | - VStack(alignment: .leading) { | 288 | + Circle() |
183 | - Text(WalletView.localizedWithParameter(parameter: data["firstname"] as! String + " " + (data["lastname"] as! String))) | 289 | + .strokeBorder(Color(hex: 0x22A9B5), lineWidth: 1) |
184 | - .font(.system(size: 13)) | 290 | + .frame(width: self.uiscreen.height * 0.05, height: self.uiscreen.height * 0.05) |
185 | - .padding(.top, self.uiscreen.height * 0.005) | 291 | + .padding(.leading, self.uiscreen.width * 0.05) |
186 | - .frame(width: self.uiscreen.width * 0.7, alignment: .leading) | 292 | + } |
187 | - Spacer() | 293 | + VStack(alignment: .leading) { |
188 | - if let value = (data["profile_metadata"] as? NSDictionary) { | 294 | + Text(WalletView.localizedWithParameter(parameter: data["firstname"] as! String + " " + (data["lastname"] as! String))) |
189 | - if ((value["answered"] != nil) == true) { | 295 | + .font(.system(size: 13)) |
190 | - VStack { | 296 | + .padding(.top, self.uiscreen.height * 0.005) |
191 | - } | 297 | + .frame(width: self.uiscreen.width * 0.7, alignment: .leading) |
192 | - .background( | 298 | + Spacer() |
193 | - LinearGradient(gradient: Gradient(colors: [Color(hex: 0x1AADCC), Color(hex: 0x83C062)]), startPoint: .trailing, endPoint: .leading) | 299 | + if let value = (data["profile_metadata"] as? NSDictionary) { |
194 | - ) | 300 | + if ((value["answered"] != nil) == true) { |
195 | - } | 301 | + VStack { |
196 | - } else { | ||
197 | - HStack { | ||
198 | - Text("+") | ||
199 | - .font(.system(size: 17)) | ||
200 | - .padding(.bottom, 2) | ||
201 | - Text("Ερωτηματολόγιο") | ||
202 | - .font(.system(size: 13)) | ||
203 | - .fontWeight(.medium) | ||
204 | } | 302 | } |
205 | - .padding(.leading, 5) | 303 | + .background( |
206 | - .padding(.trailing, 5) | 304 | + LinearGradient(gradient: Gradient(colors: [Color(hex: 0x1AADCC), Color(hex: 0x83C062)]), startPoint: .trailing, endPoint: .leading) |
207 | - .overlay( | ||
208 | - RoundedRectangle(cornerRadius: 16).stroke(Color(hex: 0x556778), lineWidth: 1) | ||
209 | ) | 305 | ) |
210 | - .padding(.bottom, self.uiscreen.height * 0.005) | ||
211 | } | 306 | } |
307 | + } else { | ||
308 | + HStack { | ||
309 | + Text("+") | ||
310 | + .font(.system(size: 17)) | ||
311 | + .padding(.bottom, 2) | ||
312 | + Text("Ερωτηματολόγιο") | ||
313 | + .font(.system(size: 13)) | ||
314 | + .fontWeight(.medium) | ||
315 | + } | ||
316 | + .padding(.leading, 5) | ||
317 | + .padding(.trailing, 5) | ||
318 | + .overlay( | ||
319 | + RoundedRectangle(cornerRadius: 16).stroke(Color(hex: 0x556778), lineWidth: 1) | ||
320 | + ) | ||
321 | + .padding(.bottom, self.uiscreen.height * 0.005) | ||
212 | } | 322 | } |
213 | - .padding(.leading , self.uiscreen.width * 0.025) | ||
214 | } | 323 | } |
215 | - .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.06, alignment: .leading) | 324 | + .padding(.leading , self.uiscreen.width * 0.025) |
325 | + } | ||
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 | } | ... | ... |
-
Please register or login to post a comment