Blame view
script.js
13.4 KB
53b83aa9e
|
1 |
// create the module and name it scotchApp |
f263889f0
|
2 |
var scotchApp = angular.module('scotchApp', ['ngRoute','angular-google-analytics']); |
53b83aa9e
|
3 4 5 |
// configure our routes scotchApp.config(function($routeProvider) { |
6ae8d3cdd
|
6 |
$routeProvider |
dcb703070
|
7 |
// route for the Home page |
6ae8d3cdd
|
8 |
.when('/', { |
dcb703070
|
9 10 11 12 13 |
templateUrl: 'pages/Home.html', controller: 'mainController' }) // route for the registration page |
e856f2161
|
14 |
.when('/caricatures', { |
dcb703070
|
15 |
templateUrl: 'pages/registration.html', |
6ae8d3cdd
|
16 17 |
controller: 'mainController' }) |
317a80571
|
18 19 20 21 22 |
// // route for the paymentVerify page // .when('/pendingPayment/:id', { // templateUrl: 'pages/verify.html', // controller: 'verifyController' // }) |
6ae8d3cdd
|
23 24 |
// route for the ambassador page |
e856f2161
|
25 |
.when('/registration', { |
6ae8d3cdd
|
26 27 28 |
templateUrl: 'pages/ambassador.html', controller: 'ambassadorController' }) |
5348de778
|
29 30 31 32 |
// route for the confirmation page .when('/confirmation', { templateUrl: 'pages/confirmation.html', |
5e3b90de3
|
33 |
controller: 'ambassadorController' |
5348de778
|
34 |
}) |
6ae8d3cdd
|
35 |
}); |
53b83aa9e
|
36 |
|
f263889f0
|
37 38 |
scotchApp.config(['AnalyticsProvider', function (AnalyticsProvider) { // Add configuration code as desired |
61b69ada0
|
39 |
AnalyticsProvider.setAccount('UA-106416759-1'); //UU-XXXXXXX-X should be your tracking code |
f263889f0
|
40 41 42 43 44 45 46 47 |
// Track all routes (default is true). AnalyticsProvider.trackPages(true); // Track all URL query params (default is false). AnalyticsProvider.trackUrlParams(true); }]).run(['Analytics', function(Analytics) { }]); |
124f7528f
|
48 49 |
scotchApp.constant("BASE_URL", "http://35.154.24.158:4001/v1") //scotchApp.constant("BASE_URL", "http://0.0.0.0:4001/v1") |
6ae8d3cdd
|
50 |
|
2d6a9fbea
|
51 |
// create the controller and inject Angular's $scope |
f263889f0
|
52 |
scotchApp.controller('mainController', function($scope, $http, $location, $route, $rootScope, BASE_URL, Analytics) { |
6ae8d3cdd
|
53 54 55 56 57 58 |
$scope.data = { show: true, hide: false }; $scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e847b36f8
|
59 |
$scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
c62079487
|
60 |
// $scope.Textshow = "yes" |
6ae8d3cdd
|
61 |
$scope.max = 100; |
88dd26b3d
|
62 |
$scope.formPage = false; |
6ae8d3cdd
|
63 64 |
$scope.current = 0; $scope.payingAmnt = 0; |
6ae8d3cdd
|
65 |
$scope.data = {}; |
ea3c31126
|
66 |
$scope.discountAmount = 0; |
7b2bef227
|
67 |
// $scope.data.quantity = "1"; |
6ae8d3cdd
|
68 69 |
$scope.check = false; $scope.numberCheck = false; |
6ae8d3cdd
|
70 |
$scope.paymentResult = {}; |
6ae8d3cdd
|
71 72 73 74 75 |
var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
53b83aa9e
|
76 |
|
dcb703070
|
77 |
$scope.apply = function() { |
317a80571
|
78 |
//Analytics.trackEvent('register', 'click', 'Registration'); |
e856f2161
|
79 |
$location.path("/caricatures") |
dcb703070
|
80 |
} |
629cc1f8f
|
81 |
|
317a80571
|
82 83 84 85 86 87 |
$scope.data.city = ''; $scope.watch = function(value){ console.log("cllll",value) $scope.data.city = value; localStorage.setItem("city" ,value); //$location.path('/registration').search({city: value}); |
9d4fa776e
|
88 |
$location.path('/registration'); |
317a80571
|
89 |
//$state.go('registration', { 'city': value}) |
163c5adae
|
90 |
} |
e847b36f8
|
91 |
|
6ae8d3cdd
|
92 |
$scope.stagekeyPress = function() { |
f8b43c6f8
|
93 |
$('.icon-circle-a').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
94 95 |
} $scope.sectorkeyPress = function() { |
f8b43c6f8
|
96 |
$('.icon-circle-b').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
97 |
} |
163c5adae
|
98 |
$scope.productLaunchkeyPress = function() { |
f8b43c6f8
|
99 |
$('.icon-circle-ab').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
100 |
} |
163c5adae
|
101 |
$scope.launchPeriodkeyPress = function() { |
f8b43c6f8
|
102 |
$('.icon-circle-abc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
103 |
} |
7b2bef227
|
104 105 |
$scope.industrykeyPress = function(quantity) { console.log("fghj",quantity) |
f8b43c6f8
|
106 |
$('.icon-circle-abcdefg').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
107 |
} |
204302c02
|
108 109 110 111 112 |
$scope.industryNamekeyPress = function(firstName) { console.log("lastName==", firstName); if (firstName == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
113 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
204302c02
|
114 115 |
} } |
c62079487
|
116 |
$scope.amountkeyPress = function() { |
f8b43c6f8
|
117 |
$('.icon-circle-bc').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
118 |
} |
2321f803a
|
119 120 121 |
$scope.firstNamekeyPress = function(name) { console.log("lastName==", name); if (name == undefined) { |
6ae8d3cdd
|
122 123 |
$('.icon-circle-c').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
124 |
$('.icon-circle-c').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
125 126 |
} } |
dcb703070
|
127 |
|
6ae8d3cdd
|
128 129 130 131 132 |
$scope.emailkeyPress = function(email) { console.log("email", email); if (email == undefined) { $('.icon-circle-d').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
133 |
$('.icon-circle-d').css('background-color', 'rgb(25, 104, 157)'); |
8ddc94e00
|
134 |
} |
6ae8d3cdd
|
135 |
} |
6ae8d3cdd
|
136 137 |
$scope.phonekeyPress = function(number) { console.log("number", number); |
204302c02
|
138 |
if (number == undefined || number == '') { |
6ae8d3cdd
|
139 140 |
$('.icon-circle-e').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
141 |
$('.icon-circle-e').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
142 143 144 145 146 147 148 149 |
} } $scope.citykeyPress = function(city) { console.log("city", city); if (city == undefined) { $('.icon-circle-f').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
150 |
$('.icon-circle-f').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
151 152 |
} } |
7e3bb1018
|
153 |
$scope.startupNamekeyPress = function(q) { |
6ae8d3cdd
|
154 155 156 |
if (q == undefined) { $('.icon-circle-x').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
157 |
$('.icon-circle-x').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
158 159 |
} } |
dcb703070
|
160 |
$scope.linkedInkeyPress = function(technology) { |
204302c02
|
161 |
if (technology == undefined || technology == '') { |
6ae8d3cdd
|
162 163 |
$('.icon-circle-h').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
164 |
$('.icon-circle-h').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
165 166 |
} } |
dcb703070
|
167 |
$scope.companykeyPress = function(problem) { |
6ae8d3cdd
|
168 169 170 |
if (problem == undefined) { $('.icon-circle-i').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
171 |
$('.icon-circle-i').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
172 173 |
} } |
dcb703070
|
174 |
$scope.productNamekeyPress = function(solution) { |
6ae8d3cdd
|
175 176 177 |
if (solution == undefined) { $('.icon-circle-j').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
178 |
$('.icon-circle-j').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
179 180 181 |
} } $scope.businesskeyPress = function(business) { |
f8b43c6f8
|
182 |
$('.icon-circle-p').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
183 |
} |
dcb703070
|
184 |
$scope.websitekeyPress = function(prototype) { |
204302c02
|
185 |
if (prototype == undefined || prototype == '') { |
6ae8d3cdd
|
186 187 |
$('.icon-circle-k').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
188 |
$('.icon-circle-k').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
189 190 |
} } |
dcb703070
|
191 |
$scope.employeekeyPress = function(market) { |
204302c02
|
192 |
if (market == undefined || market == '') { |
6ae8d3cdd
|
193 194 |
$('.icon-circle-l').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
195 |
$('.icon-circle-l').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
196 197 |
} } |
dcb703070
|
198 |
$scope.annualkeyPress = function(risk) { |
204302c02
|
199 |
if (risk == undefined || risk == '') { |
6ae8d3cdd
|
200 201 |
$('.icon-circle-m').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
202 |
$('.icon-circle-m').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
203 204 |
} } |
dcb703070
|
205 |
$scope.revenuekeyPress = function(team) { |
204302c02
|
206 |
if (team == undefined || team == '') { |
6ae8d3cdd
|
207 208 |
$('.icon-circle-n').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
209 |
$('.icon-circle-n').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
210 211 |
} } |
dcb703070
|
212 |
$scope.descriptionkeyPress = function(pitch) { |
6ae8d3cdd
|
213 214 215 |
if (pitch == undefined) { $('.icon-circle-z').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
216 |
$('.icon-circle-z').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
217 218 |
} } |
e284785e4
|
219 |
$scope.discountkeyPress = function(discount) { |
e284785e4
|
220 221 222 |
if (discount == undefined) { $('.icon-circle-o').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
223 |
$('.icon-circle-o').css('background-color', 'rgb(25, 104, 157)'); |
e284785e4
|
224 225 |
} } |
91eeb4455
|
226 227 228 229 |
$scope.removeNooError = function() { $('#invalidIdea').css('display', 'block'); $('#noExist').css('display', 'none'); }; |
c62079487
|
230 |
$scope.ideakeyPress = function(financial) { |
6ae8d3cdd
|
231 232 233 234 |
console.log("financial", financial); if (financial == undefined) { $('.icon-circle-q').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
235 |
$('.icon-circle-q').css('background-color', 'rgb(25, 104, 157)'); |
6ae8d3cdd
|
236 237 |
} } |
c62079487
|
238 239 240 241 242 243 |
$scope.fundkeyPress = function(financial) { console.log("financial", financial); if (financial == undefined) { $('.icon-circle-y').css('background-color', 'rgb(102, 102, 102)'); } else { |
f8b43c6f8
|
244 |
$('.icon-circle-y').css('background-color', 'rgb(25, 104, 157)'); |
c62079487
|
245 246 |
} } |
2d6a9fbea
|
247 248 249 250 |
$scope.changeReferalIconColor = function(referalToken){ if (referalToken == undefined || referalToken == '') { $('.referel-icon').css('background-color', 'rgb(102, 102, 102)'); }else { |
f8b43c6f8
|
251 |
$('.referel-icon').css('background-color', 'rgb(25, 104, 157)'); |
2d6a9fbea
|
252 253 |
} } |
6ae8d3cdd
|
254 |
|
53b83aa9e
|
255 |
}); |
2d6a9fbea
|
256 |
scotchApp.controller('ambassadorController', function($scope, $http, $location, $route,BASE_URL) { |
6ae8d3cdd
|
257 |
$scope.data = {}; |
8e25d825b
|
258 259 |
$scope.check = false; $scope.numberCheck = false; |
e856f2161
|
260 261 |
$scope.infoForm = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ $scope.space = false; /*THIS CODE FOR HIDE STEP 2 FORM*/ |
e856f2161
|
262 263 264 265 |
$scope.max = 100; $scope.formPage = false; $scope.current = 0; $scope.payingAmnt = 0; |
e856f2161
|
266 267 268 269 270 271 272 273 274 275 |
$scope.discountAmount = 0; // $scope.data.quantity = "1"; $scope.check = false; $scope.numberCheck = false; $scope.paymentResult = {}; var data = { "amount": $scope.payingAmnt, "currency": "INR", "status": "pending" } |
8e25d825b
|
276 |
|
5348de778
|
277 278 279 280 |
$scope.removeError = function() { $('#invalidEmail').css('display', 'none'); $('#alreadyExist').css('display', 'none'); }; |
248bd9b7c
|
281 282 283 284 285 |
$scope.emailcheck = function(val) { if (val == undefined) { $('#invalidEmail').css('display', 'block'); } else { $('#alreadyExist').css('display', 'block'); |
248bd9b7c
|
286 287 |
} }; |
b678502c9
|
288 |
|
317a80571
|
289 |
// $scope.$on('city', function (event, value) { |
9d4fa776e
|
290 291 |
$scope.data.city = localStorage.getItem("city"); console.log("HERE===",$scope.data.city ); |
317a80571
|
292 |
// }); |
6ae8d3cdd
|
293 |
$scope.submit = function() { |
70b1fd33b
|
294 |
$scope.payingAmnt = 100; |
e856f2161
|
295 296 |
if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) { var x = document.getElementById("snackbar") |
e856f2161
|
297 |
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); |
317a80571
|
298 |
}else if($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) { |
e856f2161
|
299 |
$scope.infoForm = true; |
e856f2161
|
300 301 302 303 304 305 306 307 308 |
$scope.detail = {}; $scope.data.phone = "+91"+$scope.data.number; $http({ method: 'POST', url: BASE_URL+'/applicants', data: $scope.data, headers: {} }).then(function mySuccess(result) { console.log("=====result=====",result) |
e856f2161
|
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
$scope.detail = result; data.applicantId = result.data.id; $scope.userId = result.data.id; console.log("=====data=====",data) data.amount = $scope.payingAmnt /100; if($scope.detail != null){ $http({ method: 'POST', url: BASE_URL+'/payments', data: data, headers: {} }).then(function mySuccess(paymentResult) { $scope.paymentResult = paymentResult; }, function myError(error) { }); } var i = 0; var options = { |
5f03559c6
|
327 328 |
"key": "rzp_test_YwHsVFiDIQ2WUQ", //"key": "rzp_live_mkmCb4FkstuWaS", |
e856f2161
|
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
"amount": $scope.payingAmnt, "name": "Startup Jalsa", "description":"amount", "currency": "INR", "status": "done", "prefill": { "email": $scope.detail.email, "contact": $scope.detail.phone }, "theme": { "color": "#2196f3 ", "image_padding":"NO" }, "modal": { "ondismiss": function(){ } }, "handler": function (response){ createPayment(response); } }; var rzp1 = new Razorpay(options); rzp1.open(); $scope.paymentResponse = {}; function createPayment(response){ console.log("response12333333",response) $scope.paymentResponse.razorPaymentId = response.razorpay_payment_id; $scope.paymentResponse.razorOrderId = $scope.paymentResult.data.razorOrderId; $scope.paymentResponse.amount = data.amount; $scope.paymentResponse.currency = "INR"; $scope.paymentResponse.status = $scope.paymentResult.data.status; $http({ method: 'PUT', url: BASE_URL+'/payments/'+$scope.paymentResult.data.id, data: $scope.paymentResponse, headers: {} }).then(function mySuccess(searchResult) { console.log("searchResult",searchResult) |
5e3b90de3
|
370 |
$location.path("/confirmation") |
e856f2161
|
371 372 373 374 375 |
}, function myError(error) { }); } }, function myError(error) { |
317a80571
|
376 |
|
e856f2161
|
377 |
}); |
317a80571
|
378 |
|
e856f2161
|
379 |
} |
e856f2161
|
380 |
|
317a80571
|
381 382 383 |
} }); |
53b83aa9e
|
384 |
|
96991e0c1
|
385 |