Browse Source

code added

sachinganesh 2 years ago
parent
commit
1f615ff33a
75 changed files with 14841 additions and 0 deletions
  1. 96
    0
      dist/js/allInOne.js
  2. 353
    0
      dist/js/auth/apiservice.js
  3. 720
    0
      dist/js/auth/login.js
  4. 383
    0
      dist/js/auth/login_11.js
  5. 780
    0
      dist/js/auth/login_ing.js
  6. 110
    0
      dist/js/components/accordion/accordion.js
  7. 162
    0
      dist/js/components/authloader/authloader.js
  8. 0
    0
      dist/js/components/authloader/passwordinput.js
  9. 256
    0
      dist/js/components/select/selectcomponent.js
  10. 6
    0
      dist/js/fontawesome.all.js
  11. 6
    0
      dist/js/fontawesome.min.js
  12. 446
    0
      dist/js/footer.js
  13. 73
    0
      dist/js/form.js
  14. 178
    0
      dist/js/index/index.js
  15. 2
    0
      dist/js/jquery.min.js
  16. 23
    0
      dist/js/json.js
  17. 14
    0
      dist/js/laptopmuti.js
  18. 18
    0
      dist/js/localstorage/checkout.js
  19. 14
    0
      dist/js/localstorage/loginauthlocal.js
  20. 1658
    0
      dist/js/main.js
  21. 377
    0
      dist/js/myaccount/Address.js
  22. 10
    0
      dist/js/myaccount/Myaccount.js
  23. 158
    0
      dist/js/myaccount/Profile.js
  24. 158
    0
      dist/js/myaccount/myaccount_warrenty.js
  25. 171
    0
      dist/js/myaccount/orderdetails.js
  26. 79
    0
      dist/js/myaccount/support_tickets.js
  27. 644
    0
      dist/js/navbar.js
  28. 487
    0
      dist/js/navbar2.js
  29. 453
    0
      dist/js/navbar_okay.js
  30. 271
    0
      dist/js/orderDetails/order_summary.js
  31. 160
    0
      dist/js/orderconfirmation.js
  32. 48
    0
      dist/js/plugins/ajax-mail.js
  33. 22
    0
      dist/js/plugins/countdown.js
  34. 7
    0
      dist/js/plugins/easyzoom.js
  35. 7
    0
      dist/js/plugins/images-loaded.js
  36. 5
    0
      dist/js/plugins/instafeed.js
  37. 12
    0
      dist/js/plugins/isotope.js
  38. 11
    0
      dist/js/plugins/jquery-ui-touch-punch.js
  39. 6
    0
      dist/js/plugins/jquery-ui.js
  40. 4
    0
      dist/js/plugins/jquery.nice-select.min.js
  41. 6
    0
      dist/js/plugins/magnific-popup.js
  42. 2
    0
      dist/js/plugins/mouse-parallax.js
  43. 215
    0
      dist/js/plugins/plugins.js
  44. 1
    0
      dist/js/plugins/plugins.min.js
  45. 11
    0
      dist/js/plugins/scrollup.js
  46. 13
    0
      dist/js/plugins/slick.js
  47. 8
    0
      dist/js/plugins/svg-injector.min.js
  48. 3
    0
      dist/js/plugins/wow.js
  49. 67
    0
      dist/js/product.js
  50. 943
    0
      dist/js/productdetails/laptopd.js
  51. 606
    0
      dist/js/productdetails/laptopdetails.js
  52. 650
    0
      dist/js/productdetails/laptopdetails.js-old
  53. 589
    0
      dist/js/productdetails/productdetails.js
  54. 243
    0
      dist/js/productdetails_old.js
  55. 188
    0
      dist/js/products/accessories.js
  56. 316
    0
      dist/js/products/allinoneproduct.js
  57. 419
    0
      dist/js/products/laptopproduct.js
  58. 302
    0
      dist/js/products/products.js
  59. 81
    0
      dist/js/ramproducts/ramproducts.js
  60. 248
    0
      dist/js/shoppingcart/addtocart.js
  61. 825
    0
      dist/js/shoppingcart/select_delivery.js
  62. 287
    0
      dist/js/shoppingcart/shoppingcart.js
  63. 29
    0
      dist/js/support/supportticket.js
  64. 0
    0
      dist/js/utils/cookiehelper.js
  65. 150
    0
      dist/js/utils/helpers.js
  66. 4
    0
      dist/js/validate.min.js
  67. 6
    0
      dist/js/vendor/bootstrap.bundle.min.js
  68. 6
    0
      dist/js/vendor/bootstrap.min.js
  69. 2
    0
      dist/js/vendor/jquery-migrate-v3.3.2.min.js
  70. 2
    0
      dist/js/vendor/jquery-v3.6.0.min.js
  71. 3
    0
      dist/js/vendor/modernizr-3.11.7.min.js
  72. 6
    0
      dist/js/vendor/popper.js
  73. 34
    0
      dist/js/vendor/vendor.js
  74. 1
    0
      dist/js/vendor/vendor.min.js
  75. 187
    0
      dist/js/warranty.js

+ 96
- 0
dist/js/allInOne.js View File

@@ -0,0 +1,96 @@
1
+$('.owl-carousel').owlCarousel({
2
+    // rtl:true,
3
+    // loop:true,
4
+    margin:200,
5
+ 
6
+    nav:true,
7
+    URLhashListener:true,
8
+        autoplayHoverPause:true,
9
+        responsiveClass:true,
10
+        responsive:{
11
+            0:{
12
+                items:1,
13
+                nav:true,
14
+                margin:10
15
+            },
16
+
17
+            600:{
18
+                items:2,
19
+                nav:false,
20
+                margin:200
21
+            },  
22
+
23
+            1000:{
24
+                items:3,
25
+                nav:true,
26
+                loop:false,
27
+                margin:10
28
+            },
29
+            1400:{
30
+                items:5,
31
+                nav:true,
32
+                loop:false,
33
+                margin:200
34
+            }
35
+        }
36
+})
37
+
38
+const controller  = new ScrollMagic.Controller();
39
+const exploreSence = new ScrollMagic.Scene({
40
+    triggerElement:".animateHeadingLeft",
41
+    triggerHook:0.5,
42
+    reverse:false
43
+}).setClassToggle('.animateHeadingLeft','addTextanimationLeft').addTo(controller)
44
+const controllerNew  = new ScrollMagic.Controller();
45
+new ScrollMagic.Scene({
46
+    triggerElement:".animateHeadingRight",
47
+    triggerHook:0.9,
48
+    reverse:false
49
+}).setClassToggle('.animateHeadingRight','addTextanimationRight').addTo(controllerNew)
50
+
51
+const controllerThree  = new ScrollMagic.Controller();
52
+new ScrollMagic.Scene({
53
+    triggerElement:".laptoponanimation",
54
+    triggerHook:0.9,
55
+    reverse:false
56
+}).setClassToggle('.laptoponanimation','addOpacity').addTo(controllerThree)
57
+
58
+const controllerFour  = new ScrollMagic.Controller();
59
+new ScrollMagic.Scene({
60
+    triggerElement:".allinOnepc",
61
+    triggerHook:0.9,
62
+    reverse:false
63
+}).setClassToggle('.allinOnepc','addOpacity').addTo(controllerFour)
64
+
65
+
66
+const controllerFive = new ScrollMagic.Controller();
67
+new ScrollMagic.Scene({
68
+    triggerElement:".dualLaptopSlideone",
69
+    triggerHook:0.9,
70
+    reverse:false
71
+}).setClassToggle('.dualLaptopSlideone','addTextanimationRight').addTo(controllerFive)
72
+
73
+const controllerSix = new ScrollMagic.Controller();
74
+new ScrollMagic.Scene({
75
+    triggerElement:".dualLaptopSlideLeftone",
76
+    triggerHook:0.9,
77
+    reverse:false
78
+}).setClassToggle('.dualLaptopSlideLeftone','dualLaptopSlideLeftoneLeft').addTo(controllerSix)
79
+
80
+const controllerSeven = new ScrollMagic.Controller();
81
+new ScrollMagic.Scene({
82
+    triggerElement:".cpuSlideLeftone",
83
+    triggerHook:0.9,
84
+    reverse:false
85
+}).setClassToggle('.cpuSlideLeftone','traslateZero').addTo(controllerSeven)
86
+
87
+const controllerEight = new ScrollMagic.Controller();
88
+new ScrollMagic.Scene({
89
+    triggerElement:".controllerEight",
90
+    triggerHook:0.9,
91
+    reverse:false
92
+}).setClassToggle('.controllerEight','traslateZero').addTo(controllerSeven)
93
+
94
+
95
+
96
+

+ 353
- 0
dist/js/auth/apiservice.js View File

@@ -0,0 +1,353 @@
1
+//let SERVERNAME = 'https://anwi.bizgaze.app';
2
+//let SERVERNAME = 'http://beta.bizgaze.com';
3
+let SERVERNAME = 'https://qa.anwisystems.com';
4
+ //let SERVERNAME = 'http://localhost:3088';
5
+
6
+//template
7
+const STAT = 'd8c3dc7ce4d2404484004c02d1d3145f';
8
+
9
+//live
10
+//const STAT = '23bdb3c6d08d492c939a53daec34e89a';
11
+
12
+const USER_AUTH_OKAY = 'USER_AUTH_OKAY';
13
+
14
+
15
+function imgServerNameBuild(path){
16
+    
17
+    return `https://appassets.bizgaze.app/${path}`;
18
+}
19
+
20
+
21
+function buildLinkWithServerName(link){
22
+    return `${SERVERNAME}/${link}`
23
+}
24
+
25
+
26
+async function getStatAPIService(url,data={}){
27
+    let config = {
28
+        url,
29
+        method:'get',
30
+        data:data,
31
+        headers: {
32
+            'Authorization': `stat ${STAT}`,
33
+            'Content-Type': 'application/json'
34
+        },
35
+    }
36
+    let response = await axios(config);
37
+
38
+    return response;
39
+}
40
+
41
+async function getAPIService(url,data={}){
42
+ 
43
+    const config = {
44
+        url:`${SERVERNAME}/${url}`,
45
+        method: "get",
46
+      };
47
+    let response = await axios(config);
48
+
49
+    return response;
50
+}
51
+
52
+async function postAPIService(url,data={}){
53
+    let config = {
54
+        url:`${SERVERNAME}/${url}`,
55
+        method:'post',
56
+        data:data,
57
+    }
58
+    let response = await axios(config);
59
+
60
+    return response;
61
+}
62
+
63
+
64
+async function postStatAPIService(url,data={}){
65
+    let config = {
66
+        url,
67
+        method:'post',
68
+        data:data,
69
+        headers: {
70
+            'Authorization': `stat ${STAT}`,
71
+            'Content-Type': 'application/json'
72
+        },
73
+    }
74
+    let response = await axios(config);
75
+
76
+    return response;
77
+}
78
+
79
+
80
+
81
+
82
+
83
+async function postAPIServiceLocal(url,data={}){
84
+    let config = {
85
+      url:`${SERVERNAME}/${url}`,
86
+        method:'post',
87
+        data:JSON.stringify(data    ),
88
+        headers: {
89
+            'Authorization': `Basic b67607dd-283e-478e-b2cf-35736e8bad69`,
90
+            'Content-Type': 'application/json'
91
+        },
92
+    }
93
+    let response = await axios(config);
94
+
95
+    return response;
96
+}
97
+async function getAPIServiceLocal(url){
98
+    let config = {
99
+      url:`${SERVERNAME}/${url}`,
100
+        method:'get',
101
+    
102
+        headers: {
103
+            'Authorization': `Basic b67607dd-283e-478e-b2cf-35736e8bad69`,
104
+            'Content-Type': 'application/json'
105
+        },
106
+    }
107
+    let response = await axios(config);
108
+
109
+    return response;
110
+}
111
+
112
+
113
+class API_SERVICE_CLASS{
114
+    baseURL = '';
115
+    token='';
116
+    statToken=STAT;
117
+    Instance = null;
118
+    
119
+    constructor(baseurl){
120
+        this.Instance = this;
121
+        this.baseURL = baseurl;
122
+
123
+        this.getService = this.getService.bind(this);
124
+        this.postService = this.postService.bind(this);
125
+        this.justGetAPIService =this.justGetAPIService.bind(this);
126
+        this.justPostAPIService = this.justPostAPIService.bind(this);
127
+        
128
+    }
129
+
130
+    getService(url,isStat = false){
131
+       return this.baseService(this.buildURL(url),'get',isStat);
132
+    }
133
+
134
+    postService(url,data,isStat = false){
135
+        return this.baseService(this.buildURL(url),'post',isStat,data);
136
+    }
137
+
138
+    
139
+
140
+    async baseService(url,method,isStat,data){
141
+        let isPost = method == 'get' ? false : true;
142
+        const cookieData = COOKIE_HELPER_ACTIONS.getCookie();
143
+       if(!isStat){
144
+        if(!cookieData) return window.location.href = "login.html"
145
+       }
146
+        let token = isStat ?`stat ${this.statToken}` : `Basic ${cookieData.token}`;
147
+        this.token = token;
148
+        let successResFun = this.buildSuccessResponse;
149
+        let failureResFun = this.buildFailureResponse;
150
+        let config = {
151
+            url,
152
+            method,
153
+            headers:{
154
+               'Authorization': token,
155
+               'Content-Type': 'application/json'
156
+            }
157
+        }
158
+
159
+        if(isPost){
160
+            config['data'] = data;
161
+        }
162
+
163
+        try {
164
+            let response 
165
+           try {
166
+            response = await axios(config);
167
+            if(response.data === true || response.data === false){
168
+                return successResFun(response.data)
169
+            }
170
+            if(response.data.code == '417'){
171
+                // window.location.href = '/index.html'
172
+                return failureResFun(response.data)
173
+            }
174
+            if(response.data.code != '0'){
175
+                return failureResFun(response.data)
176
+            }
177
+
178
+            if(response.data.errors?.length){
179
+                return failureResFun(response.data)
180
+            }
181
+            return successResFun(response.data)
182
+            
183
+           } catch (error) {
184
+            return failureResFun(error)
185
+           }
186
+            
187
+        } catch (error) {
188
+            return failureResFun(error)
189
+        }
190
+
191
+    }
192
+
193
+    buildURL(url){
194
+        return `${this.baseURL}/${url}`;
195
+    }
196
+
197
+    buildSuccessResponse(response){
198
+        return {
199
+            isError : false,
200
+            errorMsg : null,
201
+            response:response,
202
+        }
203
+    }
204
+
205
+    buildFailureResponse(error){
206
+        return {
207
+            isError : true,
208
+            errorMsg : error,
209
+            response:null,
210
+        }
211
+    }
212
+
213
+    async justAPI_BaseService(){
214
+        let isPost = method == 'get' ? false : true;
215
+
216
+    
217
+        let successResFun = this.buildSuccessResponse;
218
+        let failureResFun = this.buildFailureResponse;
219
+        let config = {
220
+            url,
221
+            method,
222
+            headers:{
223
+               
224
+               'Content-Type': 'application/json'
225
+            }
226
+        }
227
+
228
+        if(isPost){
229
+            config['data'] = data;
230
+        }
231
+
232
+        try {
233
+            let response 
234
+           try {
235
+            response = await axios(config);
236
+            if(response.data.code == '417'){
237
+                // window.location.href = '/index.html'
238
+                return failureResFun(response.data)
239
+            }
240
+            if(response.data.code != '0'){
241
+                return failureResFun(response.data)
242
+            }
243
+            return successResFun(response.data)
244
+            
245
+           } catch (error) {
246
+            return failureResFun(error)
247
+           }
248
+            
249
+        } catch (error) {
250
+            return failureResFun(error)
251
+        }
252
+    }
253
+
254
+    justGetAPIService(url){
255
+        return this.justAPI_BaseService('get',url)
256
+    }
257
+    justPostAPIService(url){
258
+        return this.justAPI_BaseService('post',url)
259
+    }
260
+
261
+
262
+    isValid(){
263
+        const cookieData = COOKIE_HELPER_ACTIONS.getCookie();
264
+        if(!cookieData){
265
+          return  justGetAPIService('/Account/Session/Validate')
266
+        }
267
+
268
+      
269
+
270
+
271
+    }
272
+
273
+    
274
+}
275
+
276
+const API_SERVICES = new API_SERVICE_CLASS(SERVERNAME);
277
+
278
+const API_SERVICES_ACTIONS = {
279
+    postAPIService:API_SERVICES.postService,
280
+    getAPIService:API_SERVICES.getService
281
+}
282
+
283
+
284
+// cookie helper
285
+const AUTH = 'AUTH'
286
+
287
+class COOKIE_HELPER_CLASS{
288
+    constructor(){
289
+        this.getCookie = this.getCookie.bind(this);
290
+    }
291
+    getCookie(){
292
+        let cookieVal = Cookies.get(AUTH);
293
+        if(!cookieVal){
294
+            return null;
295
+        }
296
+    return JSON.parse(cookieVal)
297
+    };
298
+    setCookie(value){
299
+        debugger;
300
+        return Cookies.set(AUTH,value)
301
+    };
302
+
303
+    removeCookie(token){
304
+           debugger;
305
+        Cookies.remove(token)
306
+    }
307
+
308
+
309
+    async validateToken(){
310
+        return await API_SERVICES_ACTIONS.getAPIService(`Account/Session/Validate`)
311
+    }
312
+}
313
+
314
+
315
+const COOKIE_HELPER = new COOKIE_HELPER_CLASS();
316
+const COOKIE_HELPER_ACTIONS ={
317
+    getCookie : COOKIE_HELPER.getCookie,
318
+    setCookie :COOKIE_HELPER.setCookie,
319
+    removeAuthCookie:COOKIE_HELPER.removeCookie.bind(null,AUTH)
320
+}
321
+
322
+
323
+function setCookieManual(token){
324
+    Cookies.set(AUTH,{
325
+        token,
326
+        userId:null
327
+    })
328
+}
329
+
330
+async function checkValidAuth(cb,redirect=undefined){
331
+
332
+
333
+   document.querySelector('auth-loader').show();
334
+    const res = await COOKIE_HELPER.validateToken();
335
+    if(!res.response){
336
+        if(redirect){
337
+            window.location.href =redirect;
338
+         document.querySelector('auth-loader').hide();
339
+         return;
340
+        }
341
+        window.location.href = '/';
342
+         document.querySelector('auth-loader').hide();
343
+        return;
344
+    }
345
+    
346
+   setTimeout(()=>{
347
+    document.querySelector('auth-loader').hide();
348
+    cb();
349
+   },300);
350
+}
351
+
352
+
353
+// setCookieManual('6eb70fee-35ef-4ca2-95cd-01ebdd616eb1');

+ 720
- 0
dist/js/auth/login.js View File

@@ -0,0 +1,720 @@
1
+
2
+
3
+let AUTH_LOGIN_APIS_URL = {
4
+  isUser(user) {
5
+    return `account/getuserbyphoneormail/${user}/${user}`;
6
+  },
7
+  login() {
8
+    return `bizgaze/crm/webapi/crmuserlogin`
9
+  },
10
+  signUp() {
11
+    return `bizgaze/crm/webapi/registercrmuser`;
12
+  },
13
+  resendOTP() {
14
+    return `bizgaze/crm/webapi/ReSendOtp`;
15
+  },
16
+  sendOTP() {
17
+    return `account/sendotp`;
18
+  },
19
+  updatePassword() {
20
+    return `account/UpdatePassword`;
21
+  }
22
+}
23
+
24
+initLogin();
25
+
26
+
27
+
28
+
29
+
30
+function initLogin() {
31
+  
32
+  let userDetails = {
33
+    otpid: null,
34
+    email: null,
35
+    password: null,
36
+    unibaseid: null
37
+  }
38
+  let backotp = null;
39
+  let backOptions = {
40
+    forgotPassword:'forgotPassword',
41
+    EmailnotV:'EmailnotV',
42
+    signUp:'signUp'
43
+  }
44
+  let authloginLoadingBtnAction = {
45
+    addLoading() {
46
+      $('.authloginLoading').addClass('d-none');
47
+      $('.authloginLoadingBtn').removeClass('d-none');
48
+    },
49
+    removeLoading() {
50
+      $('.authloginLoading').removeClass('d-none');
51
+      $('.authloginLoadingBtn').addClass('d-none');
52
+    }
53
+  }
54
+
55
+  let otpLoadingAction = {
56
+    addLoadingOTP() {
57
+      $('.otploading').removeClass('d-none');
58
+      $('.otploadingtext').addClass('d-none');
59
+    },
60
+    removeLoadingOTP() {
61
+      $('.otploading').addClass('d-none');
62
+      $('.otploadingtext').removeClass('d-none');
63
+    }
64
+  }
65
+
66
+  let formErrorAction = {
67
+    addError(message) {
68
+      $('.error_msg').removeClass('d-none');
69
+      $('.error_msg_res').html(message);
70
+    },
71
+    removeClass() {
72
+      $('.error_msg').addClass('d-none');
73
+      $('.error_msg_res').html('');
74
+    }
75
+  }
76
+  function init() {
77
+    const logoauth = $('.logoauth');
78
+    logoauth.removeClass('d-none');
79
+    loginUI();
80
+    //updatePasswordUI();
81
+    //OTP_UI()
82
+  }
83
+
84
+
85
+  function checkPassword(value){
86
+    const specailHelper = containsSpecialCharsHelper(value);
87
+    const isUpperCase = isUpperCaseHelper(value);
88
+    const isLowerCase = isLowerCaseHelper(value);
89
+    const isNumber = isNumberContainsHelper(value);
90
+    const len = value.length>=8;
91
+
92
+    return specailHelper && isUpperCase && isLowerCase && isNumber && len;
93
+
94
+  }
95
+
96
+  init();
97
+
98
+  function updatePasswordUI() {
99
+    formErrorAction.removeClass();
100
+    let html = ` <form class="row g-3 needs-validation" novalidate> <div class="form-floating position-relative py-0"> <input required type="password" class="form-control shadow-none h-50p passwordvalidui" id="updatepassword" placeholder="Enter Your Password" autocomplete="off"> <span class="position-absolute eyePassword" style=" top: 50%; right: 3%; transform: translateY(-50%);"> <i class="text-dark fa fa-eye-slash"></i> </span> <label for="updatepassword">Password </label> <div class="invalid-feedback"> Please enter password. </div> <div class="pswd_info" style="display: none;z-index: 1;"> <p>Password must contain:</p> <ul> <li id="chck_capital" class="invalid">At least <strong>one capital letter</strong> </li> <li id="chck_small" class="invalid">At least <strong>one lowercase letter</strong> </li> <li id="chck_special" class="invalid">At least <strong>one special letter</strong> </li> <li id="chck_number" class="invalid">At least <strong>one number</strong> </li> <li id="chck_length" class="invalid">At least <strong>8 characters</strong> </li> </ul> </div> </div> <div class="form-floating position-relative py-0"> <input required type="password" class="form-control shadow-none h-50p passwordvalidui" id="updateconfirmpassword" placeholder="Enter Your Password" autocomplete="off"> <span class="position-absolute eyePassword" style=" top: 50%; right: 3%; transform: translateY(-50%);"> <i class="text-dark fa fa-eye-slash"></i> </span> <label for="updateconfirmpassword">Password </label> <div class="invalid-feedback"> Please enter password. </div> <div class="pswd_info" style="display: none;z-index: 1;"> <p>Password must contain:</p> <ul> <li id="chck_capital" class="invalid">At least <strong>one capital letter</strong> </li> <li id="chck_small" class="invalid">At least <strong>one lowercase letter</strong> </li> <li id="chck_special" class="invalid">At least <strong>one special letter</strong> </li> <li id="chck_number" class="invalid">At least <strong>one number</strong> </li> <li id="chck_length" class="invalid">At least <strong>8 characters</strong> </li> </ul> </div> </div> <div class="col-12 pt-3 mt-0 px-0"> <button class="btn bg-gradient-anwi text-white w-100 cursor-pointer h-50p btnupdatepassword" type="submit"> <div class="spinner-border authloginLoadingBtn d-none" role="status"> <span class="visually-hidden">Loading...</span> </div> <span class="authloginLoading">Update Password</span> </button> </div> </form>`;
101
+
102
+    $('.authContainerUI').html(html);
103
+    updatepasswordEvents();
104
+  }
105
+
106
+  function updatepasswordEvents() {
107
+
108
+    $('.needs-validation').off('submit');
109
+    loadPasswordListener();
110
+    $('.needs-validation').on('submit', async (event) => {
111
+      event.preventDefault();
112
+      let ele = document.querySelector('.needs-validation')
113
+      if (!ele.checkValidity()) {
114
+        ele.classList.add('was-validated')
115
+        return;
116
+      }
117
+
118
+
119
+      let newPassword = $('#updatepassword').val();
120
+      let passwordConfirm = $('#updateconfirmpassword').val();
121
+      
122
+
123
+      if (newPassword != passwordConfirm) {
124
+        formErrorAction.addError("Password doesn't match");
125
+        return;
126
+      }
127
+
128
+      if(!checkPassword(newPassword)){
129
+        formErrorAction.addError("Password doesn't match");
130
+        return;
131
+      }
132
+
133
+      const forgotpassPayload = {
134
+        username: userDetails.unibaseid,
135
+        password: passwordConfirm,
136
+      };
137
+
138
+      const res = await postAPIService(AUTH_LOGIN_APIS_URL.updatePassword(), forgotpassPayload);
139
+
140
+      console.log(res);
141
+
142
+      if (res.data.message == 'Password Updated Successfully') {
143
+        loginUI();
144
+        toasterHelper("success", "Password updated successfull");
145
+      }
146
+    });
147
+    
148
+
149
+  }
150
+
151
+  function loadPasswordListener(){
152
+    
153
+    $('.passwordvalidui').off().on('keyup',function (e){
154
+
155
+      $(this).parent().find('.pswd_info').css('display','block');
156
+      let value = $(this).val();
157
+
158
+      const specailHelper = containsSpecialCharsHelper(value);
159
+      const isUpperCase = isUpperCaseHelper(value);
160
+      const isLowerCase = isLowerCaseHelper(value);
161
+      const isNumber = isNumberContainsHelper(value);
162
+
163
+
164
+      if(isLowerCase){
165
+         $(this).parent().find('#chck_small').addClass('text-decoration-line-through');
166
+      }else{
167
+         $(this).parent().find('#chck_small').removeClass('text-decoration-line-through');
168
+      }
169
+
170
+      if(specailHelper){
171
+         $(this).parent().find('#chck_special').addClass('text-decoration-line-through');
172
+      }else{
173
+         $(this).parent().find('#chck_special').removeClass('text-decoration-line-through');
174
+      }
175
+
176
+      if(isUpperCase){
177
+         $(this).parent().find('#chck_capital').addClass('text-decoration-line-through');
178
+      }else{
179
+         $(this).parent().find('#chck_capital').removeClass('text-decoration-line-through');
180
+      }
181
+
182
+      if(value.length>=8){
183
+         $(this).parent().find('#chck_length').addClass('text-decoration-line-through');
184
+      }else{
185
+         $(this).parent().find('#chck_length').removeClass('text-decoration-line-through');
186
+      }
187
+
188
+      if(isNumber){
189
+         $(this).parent().find('#chck_number').addClass('text-decoration-line-through');
190
+      }else{
191
+         $(this).parent().find('#chck_number').removeClass('text-decoration-line-through');
192
+      }
193
+
194
+
195
+    }).blur(function (e){
196
+      $(this).parent().find('.pswd_info').css('display','none');
197
+    })
198
+
199
+    $('.eyePassword').off();
200
+    $('.eyePassword').click(function (e){
201
+      e.stopPropagation();
202
+     let eyeOpen = '<i class="text-dark fa fa-eye"></i>';
203
+     let eyeClose = '<i class="text-dark fa fa-eye-slash"></i>';
204
+      console.log(this);
205
+      let isClose = $(this).find(`.fa-eye-slash`).length;
206
+      
207
+      if(isClose){
208
+        $(this).html(eyeOpen);
209
+        $(this).parent().find('.passwordvalidui').attr('type','text');
210
+      }else{
211
+        $(this).html(eyeClose);
212
+        $(this).parent().find('.passwordvalidui').attr('type','password');
213
+      }
214
+    });
215
+  }
216
+
217
+  async function resendOTP() {
218
+    otpLoadingAction.addLoadingOTP();
219
+    let payload = {
220
+      "FirstName": "",
221
+      "LastName": "",
222
+      "ContactNumber": "",
223
+      "Email": "",
224
+      "TenantName": "",
225
+      "ContactOrEmail": userDetails.email,
226
+      "IsSignup": false,
227
+      "IsRegisterUser": true,
228
+      "IsForgotPswd": false,
229
+      "UnibaseId": userDetails.unibaseid,
230
+      "OtpId": parseInt(userDetails.otpid),
231
+      "UserOtp": ""
232
+    }
233
+    let res = await postAPIService(AUTH_LOGIN_APIS_URL.resendOTP(), payload);
234
+    res = res.data;
235
+    if (res.code != '0' || res.message != 'OTP resent successfully') {
236
+      return;
237
+    }
238
+    userDetails = { ...userDetails, otpid: res.result };
239
+    otpLoadingAction.removeLoadingOTP();
240
+  }
241
+
242
+  function loadForpasswordsEvents() {
243
+    $('.needs-validation').off('submit');
244
+    $('.needs-validation').on('submit', async (event) => {
245
+      event.preventDefault()
246
+      let ele = document.querySelector('.needs-validation')
247
+      if (!ele.checkValidity()) {
248
+        ele.classList.add('was-validated')
249
+        return;
250
+      }
251
+      debugger;
252
+
253
+      const email = $('#forgotpassword').val();
254
+
255
+      await sendOTPService(email,1,backOptions.forgotPassword);
256
+
257
+      authloginLoadingBtnAction.removeLoading();
258
+
259
+
260
+
261
+
262
+    });
263
+
264
+    $('.btnForgotback').click(function (e) {
265
+      loginUI();
266
+    })
267
+  }
268
+
269
+  function forgotPasswordUIEmail() {
270
+    formErrorAction.removeClass();
271
+    let html = `<div> <div class="d-flex justify-content-between border-bottom pb-1"><span>Forgot Password?</span><span class="btnForgotback cursor-pointer"><i class="fa-solid fa-arrow-left"></i></span></div> <div class="py-3">Enter the email associated with your account and we'll send an email with instructions to reset your password.</div> <div> <form class="row g-3 needs-validation" novalidate> <div class="pb-3 form-floating py-0"> <input required type="email" class="form-control shadow-none h-50p" id="forgotpassword" placeholder="Enter Your Email" autocomplete="off"> <label for="forgotpassword">Email address</label> <div class="invalid-feedback"> Please enter email. </div> </div>  <div class="col-12 mt-0 px-0"> <button class="btn h-50p forgotpasswordbtn bg-gradient-anwi text-white w-100 cursor-pointer" type="submit"> <div class="spinner-border authloginLoadingBtn d-none" role="status"> <span class="visually-hidden">Loading...</span> </div> <span class="authloginLoading ">Password Reset</span> </button> </div> </form> </div></div>`;
272
+    $('.authContainerUI').html(html);
273
+    loadForpasswordsEvents();
274
+  }
275
+
276
+
277
+
278
+  function loginEvents() {
279
+
280
+
281
+    // submit event
282
+    $('.needs-validation').off('submit');
283
+    $('.needs-validation').on('submit', async (event) => {
284
+      event.preventDefault();
285
+      let ele = document.querySelector('.needs-validation')
286
+      if (!ele.checkValidity()) {
287
+        ele.classList.add('was-validated')
288
+        return;
289
+      }
290
+
291
+      debugger;
292
+      const email = $('#User_Email').val();
293
+
294
+      const isUserURL = AUTH_LOGIN_APIS_URL.isUser(email);
295
+      authloginLoadingBtnAction.addLoading();
296
+      const user = await getAPIService(isUserURL);
297
+      const isUser = user.data.result === null && user.data.message === `Email/Phonenumber doesn't exist`;
298
+
299
+      if (!isUser) {
300
+        loginUser();
301
+      } else {
302
+        debugger;
303
+        signUpUser();
304
+      }
305
+    });
306
+
307
+    // forgot password
308
+    $('.forgotpasswordBtn').click(function (e) {
309
+      forgotPasswordUIEmail();
310
+    });
311
+
312
+  
313
+
314
+    loadPasswordListener();
315
+
316
+    
317
+    
318
+
319
+  }
320
+
321
+
322
+
323
+  async function loginUserService(email, passord) {
324
+    const loginPayload = {
325
+      username: email,
326
+      Password: passord,
327
+      UnibaseId: "",
328
+      RememberMe: false,
329
+    };
330
+
331
+    let res = await postAPIService(AUTH_LOGIN_APIS_URL.login(),
332
+      loginPayload
333
+    );
334
+
335
+    return res;
336
+  }
337
+
338
+  async function loginUser() {
339
+    formErrorAction.removeClass();
340
+    let userEmail = $("#User_Email").val();
341
+    let userPassword = $("#User_password").val();
342
+
343
+
344
+    let res = await loginUserService(userEmail, userPassword);
345
+    res = res.data;
346
+
347
+    let isError = res.code != '0';
348
+
349
+
350
+    userDetails['email'] = userEmail;
351
+    userDetails['password'] = userPassword;
352
+    debugger;
353
+    if (isError) {
354
+      if (res.message === 'Email is not verified') {
355
+        formErrorAction.addError(`<span><span>${res.message}</span> <span class="validemail cursor-pointer"><u>Valid here</u></span></span>`);
356
+
357
+        $('.validemail').off('click')
358
+        $('.validemail').click(async function (e) {
359
+          await sendOTPService(userEmail,2,backOptions.EmailnotV);
360
+          formErrorAction.removeClass();
361
+          authloginLoadingBtnAction.removeLoading();
362
+
363
+        });
364
+        authloginLoadingBtnAction.removeLoading();
365
+        return;
366
+      }
367
+
368
+      formErrorAction.addError(`${res.message}`);
369
+      authloginLoadingBtnAction.removeLoading();
370
+      return;
371
+    }
372
+    let authObj = {
373
+      token: res.result.sessionId,
374
+      userId: res.result.userId,
375
+      unibaseId:res.result.unibaseId,
376
+      sessionId:res.result.sessionId,
377
+      tenantId:res.result.tenantId,
378
+      name:res.result.name,
379
+      assetUrl:res.result.assetUrl
380
+    };
381
+ 
382
+    COOKIE_HELPER_ACTIONS.setCookie(authObj);
383
+
384
+   
385
+    localStorage.setItem("userdata",JSON.stringify(res.result));
386
+  
387
+
388
+    const isCartAdded = localStorage.getItem(CART_ADD);
389
+          if(isCartAdded){
390
+            localStorage.removeItem(CART_ADD);
391
+            window.location.href = `/selectdelivery.html`;
392
+            return;
393
+          }
394
+    localStorage.setItem(USER_AUTH_OKAY,2);
395
+    window.location.href = '/';
396
+    //authloginLoadingBtnAction.removeLoading();
397
+    console.log(res);
398
+  }
399
+
400
+  async function sendOTPService(userEmail,num=0,option) {
401
+    const isUserURL = AUTH_LOGIN_APIS_URL.isUser(userEmail);
402
+    authloginLoadingBtnAction.addLoading();
403
+    const user = await getAPIService(isUserURL);
404
+    const isUser = user.data.result === null || user.data.message === `Email/Phonenumber doesn't exist`;
405
+    if (isUser) {
406
+      formErrorAction.addError(user.data.message);
407
+      authloginLoadingBtnAction.removeLoading();
408
+      return;
409
+    }
410
+
411
+    const forgotpassPayload = {
412
+      firstname: "",
413
+      lastname: "",
414
+      contactnumber: "",
415
+      email: "",
416
+      tenantname: "",
417
+      contactoremail: user.data.result.email,
418
+      IsSignup: false,
419
+      IsRegisterUser: false,
420
+      IsForgotPswd: true,
421
+      UnibaseId: user.data.result.userName,
422
+      OtpId: 0,
423
+      UserOtp: "",
424
+    };
425
+
426
+    const forgetpassRes = await postAPIService(
427
+      AUTH_LOGIN_APIS_URL.sendOTP(),
428
+      forgotpassPayload
429
+    );
430
+
431
+    userDetails.email = userEmail;
432
+    userDetails.otpid = forgetpassRes.data;
433
+    userDetails.unibaseid = user.data.result.userName;
434
+
435
+    console.log(forgetpassRes, userDetails);
436
+    backotp = option
437
+    OTP_UI(num);
438
+ 
439
+  }
440
+
441
+  async function signUpUser() {
442
+    formErrorAction.removeClass();
443
+    let userEmail = $("#User_Email").val();
444
+    let userPassword = $("#User_password").val();
445
+    let checkPasswordValue = checkPassword(userPassword);
446
+    if(!checkPasswordValue){
447
+      authloginLoadingBtnAction.removeLoading();
448
+      formErrorAction.addError('Password must contain one specail letter ,number,small letter, uppercase letter and 8 letters');
449
+      return;
450
+    }
451
+
452
+  
453
+    const userRegistratioNPayload = {
454
+      organizationtypeid: "2",
455
+      organizationid: "0",
456
+      contactid: "0",
457
+      userid: "0",
458
+      username: "0",
459
+      users_phonenumber: "0",
460
+      password: userPassword,
461
+      users_emailaddress: "0",
462
+      emailaddress: userEmail,
463
+      contactname: userEmail.split('@')[0],
464
+      phonenumber: "0",
465
+      branchid: "0",
466
+      tenantname: "Anwi Systems",
467
+      rolename: "Customer Admin",
468
+      currencyid: "0",
469
+      customerformuniqueid: "Bizgaze_Platform_Crm_RegisterCRMUser",
470
+    };
471
+
472
+    let res = await postAPIService(
473
+      AUTH_LOGIN_APIS_URL.signUp(),
474
+      userRegistratioNPayload
475
+    );
476
+
477
+    console.log(res);
478
+
479
+    res = res.data;
480
+    if (res.code != '0') {
481
+      formErrorAction.addError(res.message);
482
+      authloginLoadingBtnAction.removeLoading();
483
+      return;
484
+    }
485
+
486
+    res = res.result;
487
+
488
+    userDetails['otpid'] = res.OtpId;
489
+    userDetails['email'] = userEmail;
490
+    userDetails['password'] = userPassword;
491
+    userDetails['unibaseid'] = res.UnibaseId;
492
+    backotp = backOptions.signUp
493
+    OTP_UI();
494
+  
495
+
496
+  }
497
+
498
+
499
+  function loginUI() {
500
+    formErrorAction.removeClass();
501
+    let html = `  <div class="text-center pb-4">
502
+    <span class="font-weight-600">Login</span> / <span class="font-weight-600">Signup</span>
503
+  </div>
504
+  <form class="row g-3 needs-validation" novalidate>
505
+    <div class="form-floating py-0">
506
+      <input required type="email" class="form-control shadow-none h-50p" id="User_Email" placeholder="Enter Your Email" autocomplete="off">
507
+      <label for="User_Email">Email address</label>
508
+      <div class="invalid-feedback"> Please enter email. </div>
509
+    </div>
510
+    <div class="form-floating position-relative py-0">
511
+      <input required type="password" class="form-control shadow-none h-50p passwordvalidui" id="User_password" placeholder="Enter Your Password" autocomplete="off">
512
+      <span class="position-absolute eyePassword" style=" top: 50%; right: 3%; transform: translateY(-50%);">
513
+        <i class="text-dark fa fa-eye-slash"></i>
514
+      </span>
515
+      <label for="User_password">Password </label>
516
+      <div class="invalid-feedback"> Please enter password. </div>
517
+      <div class="pswd_info" style="display: none;z-index: 1;">
518
+        <p>Password must contain:</p>
519
+        <ul>
520
+        <li id="chck_capital" class="invalid">At least <strong>one capital letter</strong>
521
+        </li>
522
+         <li id="chck_small" class="invalid">At least <strong>one lowercase letter</strong>
523
+        </li>
524
+        <li id="chck_special" class="invalid">At least <strong>one special letter</strong>
525
+        </li>
526
+        <li id="chck_number" class="invalid">At least <strong>one number</strong>
527
+        </li>
528
+        <li id="chck_length" class="invalid">At least <strong>8 characters</strong>
529
+        </li>
530
+        </ul>
531
+      </div>
532
+    </div>
533
+    <div class="fs-7 my-2 satoshi_font text-center"> By continuing, I agree to the Terms of Use & Privacy Policy </div>
534
+    <div class="col-12 mt-0 px-0">
535
+      <button class="btn bg-gradient-anwi text-white w-100 cursor-pointer h-50p" type="submit">
536
+        <div class="spinner-border authloginLoadingBtn d-none" role="status">
537
+          <span class="visually-hidden">Loading...</span>
538
+        </div>
539
+        <span class="authloginLoading h-50p">Continue</span>
540
+      </button>
541
+    </div>
542
+  </form>
543
+  <div class="pt-3 text-center">
544
+    <span class="forgotpasswordBtn cursor-pointer">Forgot password?</span>
545
+  </div>
546
+ `;
547
+    $('.authContainerUI').html(html);
548
+    
549
+    loginEvents();
550
+  }
551
+
552
+  function OTP_UI(forgot = 0) {
553
+    formErrorAction.removeClass();
554
+    let html = `<div class="d-flex justify-content-between border-bottom pb-1">
555
+    <span></span>
556
+    <span class="btnForgotback">
557
+      <i class="fa-solid fa-arrow-left"></i>
558
+    </span>
559
+  </div> <div class="otp-validation"> <div class="otp-input-group mt-3"> <div> <h4 class="text-center">Enter OTP</h4> <div class="text-center">We have send OTP to your email </div> <p class="user_email text-center"></p> <div class="otp-sent-email fw-600 text-center"></div> </div> <div class="d-flex my-4"> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="1" autocomplete="off"> </div> </div> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="2" autocomplete="off"> </div> </div> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="3" autocomplete="off"> </div> </div> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="4" autocomplete="off"> </div> </div> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="5" autocomplete="off"> </div> </div> <div class="col"> <div class="form-group"> <input type="text" class="press form-control" name="code" maxlength="1" tabindex="6" autocomplete="off"> </div> </div> </div> <div> <a href="#" class=" h-50p d-flex align-items-center justify-content-center bg-gradient-anwi btn fw-500 text-white w-100" id="email_validate_proceed" type="submit"><div class="spinner-border otploading d-none" role="status">
560
+  </div><span class="otploadingtext">Verfiy OTP</span></a> </div> <div class="resendOTP cursor-pointer text-center pt-4 ">Resend OTP</div> </div></div>`;
561
+    $('.authContainerUI').html(html);
562
+    loadOTPEvents(forgot);
563
+  }
564
+
565
+  async function validOTP(email, id, otp) {
566
+    const validateForgotpass = {
567
+      email: email,
568
+      otpid: id,
569
+      userotp: otp,
570
+    };
571
+
572
+    const res = await postAPIService(
573
+      `hyperfusion/validateotp`,
574
+      validateForgotpass
575
+    );
576
+
577
+    return res;
578
+  }
579
+
580
+  function loadOTPEvents(forgot) {
581
+
582
+
583
+    $('.resendOTP').click(function (e) {
584
+      resendOTP();
585
+    })
586
+
587
+
588
+    $('.btnForgotback').off().click(function(e){
589
+      debugger;
590
+      if(backotp === backOptions.forgotPassword){
591
+        forgotPasswordUIEmail();
592
+      }else if(backotp === backOptions.EmailnotV){
593
+        loginUI();
594
+      }else if(backotp === backOptions.signUp){
595
+        loginUI();
596
+      }
597
+    });
598
+
599
+    $("#email_validate_proceed").click(async function () {
600
+      debugger;
601
+      otpLoadingAction.addLoadingOTP();
602
+      let userotp = '';
603
+      $(".otp-validation .otp-input-group input").each(function () {
604
+        let presVal = $(this).val();
605
+        userotp += presVal;
606
+      });
607
+debugger;
608
+      if (userotp.length == 6) {
609
+        // const validateForgotpass = {
610
+        //   email: userDetails.email,
611
+        //   otpid: userDetails.otpid,
612
+        //   userotp: userotp,
613
+        // };
614
+        $('#email_validate_proceed').hide()
615
+        $(".loader-btn").show();
616
+        const validate_email_resopt = await validOTP(userDetails.email, userDetails.otpid, userotp);
617
+
618
+        $(".loader-btn").hide();
619
+        $('#email_validate_proceed').show()
620
+        const Resotp = validate_email_resopt.data.result;
621
+        if (Resotp == "Otp verified successfully") {
622
+          if (forgot == 1) {
623
+            updatePasswordUI();
624
+            return;
625
+          } else if (forgot == 2) {
626
+            loginUI();
627
+            toasterHelper("success", "Email has been verified");
628
+            return;
629
+          }
630
+          let res = await loginUserService(userDetails.email, userDetails.password);
631
+          res = res.data;
632
+
633
+          let authObj = {
634
+            token: res.result.sessionId,
635
+            userId: res.result.userId,
636
+            unibaseId:res.result.unibaseId,
637
+            sessionId:res.result.sessionId,
638
+            tenantId:res.result.tenantId,
639
+            name:res.result.name,
640
+            assetUrl:res.result.assetUrl
641
+          };
642
+       
643
+          COOKIE_HELPER_ACTIONS.setCookie(authObj);
644
+          localStorage.setItem("userdata",JSON.stringify(res.result));
645
+          const isCartAdded = localStorage.getItem(CART_ADD);
646
+          if(isCartAdded){
647
+            localStorage.removeItem(CART_ADD);
648
+            window.location.href = `/selectdelivery.html`;
649
+            return;
650
+          }
651
+          localStorage.setItem(USER_AUTH_OKAY,1);
652
+          window.location.href = '/';
653
+          otpLoadingAction.removeLoadingOTP();
654
+        } else {
655
+          // toasterOpts()
656
+          // Command: toastr["error"]("Please enter Valid OTP");
657
+          otpLoadingAction.removeLoadingOTP();
658
+          formErrorAction.addError("Please enter Valid OTP")
659
+  
660
+        }
661
+      }
662
+      else {
663
+        otpLoadingAction.removeLoadingOTP();
664
+        formErrorAction.addError("Please enter Valid OTP")
665
+      }
666
+    });
667
+
668
+    $(".otp-validation .otp-input-group").on("paste", function (p) {
669
+      let data = p.originalEvent.clipboardData.getData("text");
670
+      let dataLength = data.length;
671
+      for (let i = 0; i < dataLength; i++) {
672
+        let input = $(
673
+          '.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
674
+        );
675
+        input.val(data.charAt(i));
676
+        if (input.val().length >= input.attr("maxlength")) {
677
+          let nextInput = $(
678
+            '.otp-validation .otp-input-group input[tabindex="' +
679
+            (i + 2) +
680
+            '"]'
681
+          );
682
+          if (nextInput) {
683
+            nextInput.focus();
684
+          }
685
+        }
686
+      }
687
+      p.preventDefault();
688
+    });
689
+
690
+    $('.otp-validation .otp-input-group input[type="text"]').on(
691
+      "keyup",
692
+      function (e) {
693
+        if ($(this).val().length >= $(this).attr("maxlength")) {
694
+          if (e.keyCode !== 9 && e.keyCode !== 16) {
695
+            let tabIndex = parseInt($(this).attr("tabindex")) + 1;
696
+            $(
697
+              '.otp-validation .otp-input-group input[tabindex="' +
698
+              $(this).attr("tabindex") +
699
+              '"]'
700
+            ).val($(this).val());
701
+            $(
702
+              '.otp-validation .otp-input-group input[tabindex="' +
703
+              tabIndex +
704
+              '"]'
705
+            ).focus();
706
+          }
707
+        } else {
708
+          if (e.keyCode === 8) {
709
+            let tabIndex = parseInt($(this).attr("tabindex")) - 1;
710
+            $(
711
+              '.otp-validation .otp-input-group input[tabindex="' +
712
+              tabIndex +
713
+              '"]'
714
+            ).focus();
715
+          }
716
+        }
717
+      }
718
+    );
719
+  }
720
+}

+ 383
- 0
dist/js/auth/login_11.js View File

@@ -0,0 +1,383 @@
1
+function initLogin() {
2
+  let reg_name, reg_email, reg_number, reg_pwd, reg_otp_email;
3
+  let loginForm = $("#login_form");
4
+  let registerForm = $("#register_form");
5
+
6
+  // document.querySelector('#register_form .otp-input-group input.press').addEventListener("paste", function (p) {
7
+  //   var data = p.clipboardData.getData('text');
8
+  //   var dataLength = data.length;
9
+
10
+  //   for (var i = 0; i < dataLength; i++) {
11
+  //     var input = document.querySelector("#register_form .otp-input-group input[tabindex='" + (i + 1) + "']");
12
+  //     input.value = data.charAt(i);
13
+  //     if (input.value.length >= input.maxLength) {
14
+  //       var nextInput = document.querySelector("#register_form .otp-input-group input[tabindex='" + (i + 2) + "']");
15
+  //       if (nextInput) {
16
+  //         nextInput.focus();
17
+  //       }
18
+  //     }
19
+  //   }
20
+  //   p.preventDefault();
21
+  // });
22
+  // document.querySelectorAll('#register_form .otp-input-group input[type="text"]').forEach(function (input) {
23
+  //   input.addEventListener('keyup', function (e) {
24
+  //     if (this.value.length >= this.maxLength) {
25
+  //       if (e.keyCode !== 9 && e.keyCode !== 16) {
26
+  //         var tabIndex = this.tabIndex + 1;
27
+  //         document.querySelector("#register_form .otp-input-group input[tabindex='" + this.tabIndex + "']").value = this.value;
28
+  //         document.querySelector("#register_form .otp-input-group input[tabindex='" + tabIndex + "']").focus();
29
+  //       }
30
+  //     } else {
31
+  //       if (e.keyCode === 8) {
32
+  //         var tabIndex = this.tabIndex - 1;
33
+  //         document.querySelector("#register_form .otp-input-group input[tabindex='" + tabIndex + "']").focus();
34
+  //       }
35
+  //     }
36
+  //   });
37
+  // });
38
+
39
+  $('#register_form .otp-input-group input.press').on('paste', function (p) {
40
+    var data = p.originalEvent.clipboardData.getData('text');
41
+    var dataLength = data.length;
42
+
43
+    for (var i = 0; i < dataLength; i++) {
44
+      var input = $('#register_form .otp-input-group input[tabindex="' + (i + 1) + '"]');
45
+      input.val(data.charAt(i));
46
+      if (input.val().length >= input.attr('maxlength')) {
47
+        var nextInput = $('#register_form .otp-input-group input[tabindex="' + (i + 2) + '"]');
48
+        if (nextInput) {
49
+          nextInput.focus();
50
+        }
51
+      }
52
+    }
53
+    p.preventDefault();
54
+  });
55
+
56
+  $('#register_form .otp-input-group input[type="text"]').on('keyup', function (e) {
57
+    if ($(this).val().length >= $(this).attr('maxlength')) {
58
+      if (e.keyCode !== 9 && e.keyCode !== 16) {
59
+        var tabIndex = parseInt($(this).attr('tabindex')) + 1;
60
+        $('#register_form .otp-input-group input[tabindex="' + $(this).attr('tabindex') + '"]').val($(this).val());
61
+        $('#register_form .otp-input-group input[tabindex="' + tabIndex + '"]').focus();
62
+      }
63
+    } else {
64
+      if (e.keyCode === 8) {
65
+        var tabIndex = parseInt($(this).attr('tabindex')) - 1;
66
+        $('#register_form .otp-input-group input[tabindex="' + tabIndex + '"]').focus();
67
+      }
68
+    }
69
+  });
70
+
71
+
72
+  loginForm.find("#User_Email,#User_password").keypress(function (e) {
73
+    if (e.which == 13)
74
+      document.getElementById("Login_btn").click();
75
+
76
+  });
77
+
78
+  $("#Login_btn").click(function () {
79
+    loginForm.find(".loader-btn").show();
80
+    $(this).hide();
81
+    let userEmail = loginForm.find("#User_Email").val();
82
+    let userPassword = loginForm.find("#User_password").val();
83
+    let emailInput = loginForm.find(".email-login-inputgroup");
84
+    let passwordInput = loginForm.find(".password-login-inputgroup");
85
+    if (userEmail == "") {
86
+      emailInput.find('#User_Email').addClass('is-invalid');
87
+      emailInput.find('.form-floating').addClass('is-invalid');
88
+      emailInput.find('.invalid-feedback').text('Please enter your email');
89
+      loginForm.find(".loader-btn").hide();
90
+      $(this).show();
91
+
92
+    }
93
+    if (userPassword == "") {
94
+      passwordInput.find('#User_password').addClass('is-invalid');
95
+      passwordInput.find('.form-floating').addClass('is-invalid');
96
+      loginForm.find(".loader-btn").hide();
97
+      $(this).show();
98
+    }
99
+    else {
100
+      emailInput.find('#User_Email').removeClass('is-invalid');
101
+      emailInput.find('.form-floating').removeClass('is-invalid');
102
+      passwordInput.find('#User_password').removeClass('is-invalid');
103
+      passwordInput.find('.form-floating').removeClass('is-invalid');
104
+      if (validateEmail(userEmail)) {
105
+        let port = SERVERNAME
106
+        // let port = "http://localhost:3088";
107
+        let url = `${port}/account/getuserbyphoneormail/${userEmail}/${userEmail}`;
108
+        getDataStatAxios(url, userEmail);
109
+      } else {
110
+        loginForm.find(".loader-btn").hide();
111
+        $(this).show();
112
+        emailInput.find('#User_Email').addClass('is-invalid');
113
+        emailInput.find('.form-floating').addClass('is-invalid');
114
+        emailInput.find('.invalid-feedback').text('Please enter a valid email');
115
+      }
116
+    }
117
+  });
118
+
119
+  async function getDataStatAxios(url, userEmail) {
120
+    const config = {
121
+      url,
122
+      method: "get",
123
+    };
124
+    let response = await axios(config);
125
+    if (response.data.result == null) {
126
+      $('.error-div').text(response.data.message);
127
+    }
128
+    else {
129
+      let userEmail = $("#User_Email").val();
130
+      let userPassword = $("#User_password").val();
131
+      const loginPayload = {
132
+        username: userEmail,
133
+        Password: userPassword,
134
+        UnibaseId: "",
135
+        RememberMe: false,
136
+      };
137
+      const res = await postAPIService(
138
+        `bizgaze/crm/webapi/crmuserlogin`,
139
+        loginPayload
140
+      );
141
+      debugger;
142
+      console.log(res);
143
+      if (res.data.message == "200") {
144
+        // Command: toastr["success"]("Logged in successfully")
145
+        // toasterOpts();
146
+        debugger;
147
+        COOKIE_HELPER_ACTIONS.setCookie({
148
+          token: res.data.result.sessionId,
149
+          userid: res.data.result.userId,
150
+          ...res.data.result
151
+        })
152
+        // setInitLoginLocal();
153
+        // window.localStorage.setItem("Useremail", userEmail);
154
+        //window.localStorage.setItem("Userpassword", userPassword);
155
+        //window.localStorage.setItem("Isloggedin", true);
156
+        const isCartAdded = localStorage.getItem(CART_ADD);
157
+        if(isCartAdded){
158
+          localStorage.removeItem(CART_ADD);
159
+          window.location.href = `/selectdelivery.html`;
160
+          return;
161
+        }
162
+        window.location.href = `/index.html`;
163
+      } else {
164
+        $("#empt_num").removeClass("d-none text-success").text(res.data.message).addClass('text-danger');
165
+        $(".my_avatar").attr("href", "./login.html");
166
+      }
167
+    }
168
+  }
169
+
170
+  // this function will be triggered on new user registration 
171
+  async function userRegistration() {
172
+    reg_form = $('#register_form');
173
+    // reg_name = $("#User_Name").val();
174
+    reg_email = reg_form.find("#User_Email").val();
175
+    // reg_otp_email = $("#User_otp_Email").val();
176
+    // reg_number = $("#user_number").val();
177
+    reg_pwd = reg_form.find("#User_password").val();
178
+    let userName = reg_email.split("@");
179
+    let otpRes = null;
180
+    const userRegistratioNPayload = {
181
+      organizationtypeid: "2",
182
+      organizationid: "0",
183
+      contactid: "0",
184
+      userid: "0",
185
+      username: "0",
186
+      users_phonenumber: "0",
187
+      password: reg_pwd,
188
+      users_emailaddress: "0",
189
+      emailaddress: reg_email,
190
+      contactname: userName[0],
191
+      phonenumber: "0",
192
+      branchid: "0",
193
+      tenantname: "Anwi Systems",
194
+      rolename: "Customer Admin",
195
+      currencyid: "0",
196
+      customerformuniqueid: "Bizgaze_Platform_Crm_RegisterCRMUser",
197
+    };
198
+    $('.spinner-border').removeClass('d-none');
199
+    const res = await postAPIService(
200
+      `bizgaze/crm/webapi/registercrmuser`,
201
+      userRegistratioNPayload
202
+    );
203
+    console.log(res, "register");
204
+    $('.spinner-border').addClass('d-none');
205
+    if (res.data.message == "User Already Exists!") {
206
+      $('.error-div').text('User Already Exists!');
207
+      // $(".useralready_exist").removeClass("d-none");
208
+    } else {
209
+    }
210
+
211
+    $("#proceed").click(async function () {
212
+      let userEnterOtp = "";
213
+      let userEmail = registerForm.find("#User_Email").val();
214
+      $('.otp-input-group input').each(function () {
215
+        let presVal = $(this).val();
216
+        userEnterOtp += presVal;
217
+      })
218
+      console.log(userEnterOtp);
219
+      debugger;
220
+      const userotppayload = {
221
+        email: userEmail,
222
+        otpid: res.data.result.OtpId,
223
+        userotp: userEnterOtp,
224
+      };
225
+      $('.spinner-border').removeClass('d-none');
226
+      otpRes = await postAPIService(
227
+        `bizgaze/crm/webapi/ValidateOtp`,
228
+        userotppayload
229
+      );
230
+      $('.spinner-border').addClass('d-none');
231
+      debugger;
232
+      console.log(otpRes, "otp");
233
+      const verifyotpStatus = otpRes.data.result;
234
+      debugger;
235
+      if (verifyotpStatus == "Otp verified successfully") {
236
+        alert("Account created successfully");
237
+        window.location.href = `/myaccount.html`;
238
+      } else {
239
+        alert("please enter valid otp");
240
+      }
241
+    });
242
+  }
243
+
244
+  // to validate password on keyup in password input field 
245
+  function passwordValidate(pswd) {
246
+    if (pswd.length < 11) {
247
+      $('#chck_length').removeClass('pswd_valid').addClass('pswd_invalid');
248
+    } else {
249
+      $('#chck_length').removeClass('pswd_invalid').addClass('pswd_valid');
250
+    }
251
+    // validate uppercase letter
252
+    if (pswd.match(/[A-Z]/)) {
253
+      $('#chck_capital').removeClass('pswd_invalid').addClass('pswd_valid');
254
+    } else {
255
+      $('#chck_capital').removeClass('pswd_valid').addClass('pswd_invalid');
256
+    }
257
+    //validate special letter
258
+    if (pswd.match(/[!@#$%^&*]/)) {
259
+      $('#chck_special').removeClass('pswd_invalid').addClass('pswd_valid');
260
+    } else {
261
+      $('#chck_special').removeClass('pswd_valid').addClass('pswd_invalid');
262
+    }
263
+    let pswdVal = $('#register_form #User_password').val();
264
+    let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
265
+    if (pswdVal.match(pattern)) {
266
+      $('#pswd_info').hide()
267
+    }
268
+    else {
269
+      $('#pswd_info').show()
270
+    }
271
+    //validate number
272
+    if (pswd.match(/\d/)) {
273
+      $('#chck_number').removeClass('pswd_invalid').addClass('pswd_valid');
274
+    } else {
275
+      $('#chck_number').removeClass('pswd_valid').addClass('pswd_invalid');
276
+    }
277
+
278
+  };
279
+
280
+  //you have to use keyup, because keydown will not catch the currently entered value
281
+  $('#register_form #User_password').keyup(function () {
282
+    // set password variable
283
+    var pswd = $(this).val();
284
+    passwordValidate(pswd);
285
+  }).focus(function () {
286
+    let pswdVal = $('#register_form #User_password').val();
287
+    let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
288
+    if (pswdVal.match(pattern)) {
289
+      $('#pswd_info').hide()
290
+    }
291
+    else {
292
+      $('#pswd_info').show()
293
+    }
294
+  }).blur(function () {
295
+    $('#pswd_info').hide();
296
+  });
297
+
298
+  // function to validate user entered email 
299
+  function validateEmail(userEmail) {
300
+    var pattern =
301
+      /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
302
+    return $.trim(userEmail).match(pattern) ? true : false;
303
+  }
304
+
305
+  // function to validate user entered password
306
+  function validatepassword(userPassword) {
307
+    var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
308
+    return $.trim(userPassword).match(pattern) ? true : false;
309
+  }
310
+
311
+  registerForm.find("#User_Email,#User_password").keypress(function (e) {
312
+    if (e.which == 13)
313
+      document.getElementById("register_btn").click();
314
+
315
+  });
316
+
317
+  // this will be triggered on clicking continue in signup form 
318
+  $("#register_btn").click(function () {
319
+    registerForm.find(".loader-btn").show();
320
+    $(this).hide();
321
+    let userEmail = registerForm.find("#User_Email").val();
322
+    let userPassword = registerForm.find("#User_password").val();
323
+    let emailInput = registerForm.find(".email-login-inputgroup");
324
+    let passwordInput = registerForm.find(".password-login-inputgroup");
325
+    if (userEmail == "") {
326
+      emailInput.find('#User_Email').addClass('is-invalid');
327
+      emailInput.find('.form-floating').addClass('is-invalid');
328
+      emailInput.find('.invalid-feedback').text('Please enter your email');
329
+      registerForm.find(".loader-btn").hide();
330
+      $(this).show();
331
+    }
332
+    if (userPassword == "") {
333
+      passwordInput.find('#User_password').addClass('is-invalid');
334
+      passwordInput.find('.form-floating').addClass('is-invalid');
335
+      registerForm.find(".loader-btn").hide();
336
+      $(this).show();
337
+    }
338
+    else {
339
+      emailInput.find('#User_Email').removeClass('is-invalid');
340
+      emailInput.find('.form-floating').removeClass('is-invalid');
341
+      passwordInput.find('#User_password').removeClass('is-invalid');
342
+      passwordInput.find('.form-floating').removeClass('is-invalid');
343
+      if (validateEmail(userEmail)) {
344
+        $('#register_form .email-password-group').hide();
345
+        $('#register_form .otp-input-group').show();
346
+        $('#register_form .otp-input-group .otp-sent-email').text(userEmail);
347
+        userRegistration();
348
+      } else {
349
+        emailInput.find('#User_Email').addClass('is-invalid');
350
+        emailInput.find('.form-floating').addClass('is-invalid');
351
+        emailInput.find('.invalid-feedback').text('Please enter a valid email');
352
+        registerForm.find(".loader-btn").hide();
353
+        $(this).show();
354
+      }
355
+    }
356
+  });
357
+
358
+  $('#forgotPassword').click(function () {
359
+    $('.login-email-password-div').hide();
360
+    $('.login-forgot-passsword-div').show();
361
+  })
362
+
363
+  function toasterOpts() {
364
+    toastr.options = {
365
+      "closeButton": true,
366
+      "debug": false,
367
+      "newestOnTop": true,
368
+      "progressBar": true,
369
+      "positionClass": "toast-top-center",
370
+      "preventDuplicates": true,
371
+      "showDuration": "300",
372
+      "hideDuration": "1000",
373
+      "timeOut": "3000",
374
+      "extendedTimeOut": "1000",
375
+      "showEasing": "swing",
376
+      "hideEasing": "linear",
377
+      "showMethod": "fadeIn",
378
+      "hideMethod": "fadeOut"
379
+    }
380
+  }
381
+}
382
+
383
+initLogin();

+ 780
- 0
dist/js/auth/login_ing.js View File

@@ -0,0 +1,780 @@
1
+function initLogin() {
2
+  // alert('as')
3
+  // Command: toastr["success"]("Logged in successfully")
4
+  // Command: toastr["success"]("My name is Inigo Montoya. You killed my father. Prepare to die!")
5
+
6
+  // toasterOpts();
7
+  let reg_name, reg_email, reg_number, reg_pwd, reg_otp_email;
8
+  let loginForm = $("#login_form");
9
+  let registerForm = $("#register_form");
10
+
11
+  $("#register_form .otp-input-group input.press").on("paste", function (p) {
12
+    var data = p.originalEvent.clipboardData.getData("text");
13
+    var dataLength = data.length;
14
+
15
+    for (var i = 0; i < dataLength; i++) {
16
+      var input = $(
17
+        '#register_form .otp-input-group input[tabindex="' + (i + 1) + '"]'
18
+      );
19
+      input.val(data.charAt(i));
20
+      if (input.val().length >= input.attr("maxlength")) {
21
+        var nextInput = $(
22
+          '#register_form .otp-input-group input[tabindex="' + (i + 2) + '"]'
23
+        );
24
+        if (nextInput) {
25
+          nextInput.focus();
26
+        }
27
+      }
28
+    }
29
+    p.preventDefault();
30
+  });
31
+
32
+  $('#register_form .otp-input-group input[type="text"]').on(
33
+    "keyup",
34
+    function (e) {
35
+      if ($(this).val().length >= $(this).attr("maxlength")) {
36
+        if (e.keyCode !== 9 && e.keyCode !== 16) {
37
+          var tabIndex = parseInt($(this).attr("tabindex")) + 1;
38
+          $(
39
+            '#register_form .otp-input-group input[tabindex="' +
40
+              $(this).attr("tabindex") +
41
+              '"]'
42
+          ).val($(this).val());
43
+          $(
44
+            '#register_form .otp-input-group input[tabindex="' + tabIndex + '"]'
45
+          ).focus();
46
+        }
47
+      } else {
48
+        if (e.keyCode === 8) {
49
+          var tabIndex = parseInt($(this).attr("tabindex")) - 1;
50
+          $(
51
+            '#register_form .otp-input-group input[tabindex="' + tabIndex + '"]'
52
+          ).focus();
53
+        }
54
+      }
55
+    }
56
+  );
57
+
58
+  loginForm.find("#User_Email,#User_password").keypress(function (e) {
59
+    if (e.which == 13) $("#Login_btn").click();
60
+  });
61
+
62
+  $("#Login_btn").click(function () {
63
+    $('.error_msg').hide();
64
+    // loginForm.find(".loader-btn").show();
65
+    let userEmail = loginForm.find("#User_Email").val();
66
+    let userPassword = loginForm.find("#User_password").val();
67
+    let emailInput = loginForm.find(".email-login-inputgroup");
68
+    let passwordInput = loginForm.find(".password-login-inputgroup");
69
+    if (userEmail == "") {
70
+      emailInput.find("#User_Email").addClass("is-invalid");
71
+      emailInput.find(".form-floating").addClass("is-invalid");
72
+      emailInput.find(".invalid-feedback").text("Please enter your email");
73
+      loginForm.find(".loader-btn").hide();
74
+      $(this).show();
75
+    }
76
+    if (userPassword == "") {
77
+      passwordInput.find("#User_password").addClass("is-invalid");
78
+      passwordInput.find(".form-floating").addClass("is-invalid");
79
+      loginForm.find(".loader-btn").hide();
80
+      $(this).show();
81
+    } else {
82
+      emailInput.find("#User_Email").removeClass("is-invalid");
83
+      emailInput.find(".form-floating").removeClass("is-invalid");
84
+      passwordInput.find("#User_password").removeClass("is-invalid");
85
+      passwordInput.find(".form-floating").removeClass("is-invalid");
86
+      if (validateEmail(userEmail)) {
87
+         let port = SERVERNAME
88
+      // let port = "http://localhost:3088";
89
+        let url = `${port}/account/getuserbyphoneormail/${userEmail}/${userEmail}`;
90
+        getDataStatAxios(url, userEmail);
91
+      } else {
92
+        loginForm.find(".loader-btn").hide();
93
+        $(this).show();
94
+        emailInput.find("#User_Email").addClass("is-invalid");
95
+        emailInput.find(".form-floating").addClass("is-invalid");
96
+        emailInput.find(".invalid-feedback").text("Please enter a valid email");
97
+      }
98
+    }
99
+  });
100
+  async function getDataStatAxios(url, userEmail) {
101
+    const config = {
102
+      url,
103
+      method: "get",
104
+    };
105
+    let response = await axios(config);
106
+    if (response.data.result == null) {
107
+      $('.error_msg').show();
108
+      $('.error_msg .error_msg_res').html(`User doesn't exists with the email,  <a href="#" class="alert-link register_sectionbtn" id="register_sectionbtn">Sign Up </a>`);
109
+      $(".register_sectionbtn").click(function(){
110
+   
111
+      
112
+        $(".login_section").css("display","none");
113
+        $(".register_section").css("display","block");
114
+        $(".login_section").find("#User_Email").removeClass("is-invalid");
115
+        $(".login_section").find(".form-floating").removeClass("is-invalid");
116
+        $(".login_section").find("#User_password").removeClass("is-invalid");
117
+        $(".login_section").find(".form-floating").removeClass("is-invalid");
118
+        $('.error_msg').hide();
119
+      });
120
+      // toasterOpts();
121
+      
122
+      // Command: toastr["error"]("Please enter Valid email / password");
123
+    } else {
124
+      let userEmail = $("#User_Email").val();
125
+      let userPassword = $("#User_password").val();
126
+      const loginPayload = {
127
+        username: userEmail,
128
+        Password: userPassword,
129
+        UnibaseId: "",
130
+        RememberMe: false,
131
+      };
132
+      $("#Login_btn").hide();
133
+      $(".loader-btn").show();
134
+      const res = await postAPIService(
135
+        `bizgaze/crm/webapi/crmuserlogin`,
136
+        loginPayload
137
+      );
138
+      debugger;
139
+      console.log(res);
140
+      $(".loader-btn").hide();
141
+      $("#Login_btn").show();
142
+      if (res.data.message == "200") {
143
+        debugger;
144
+        // Command: toastr["success"]("Logged in successfully")
145
+        // toasterOpts();
146
+        COOKIE_HELPER_ACTIONS.setCookie({
147
+          token: res.data.result.sessionId,
148
+          userid: res.data.result.userId,
149
+          ...res.data.result
150
+        });
151
+        // setInitLoginLocal();
152
+        window.localStorage.setItem("Useremail", userEmail);
153
+        //window.localStorage.setItem("Userpassword", userPassword);
154
+        window.localStorage.setItem("Isloggedintoaster", true);
155
+        window.localStorage.setItem("Isloggedin", true);
156
+
157
+        const isCartAdded = localStorage.getItem(CART_ADD);
158
+        if(isCartAdded){
159
+          localStorage.removeItem(CART_ADD);
160
+          window.location.href = `/selectdelivery.html`;
161
+          return;
162
+        }
163
+        
164
+      window.location.href = `./index.html`;
165
+      } else {
166
+        $('.error_msg').show();
167
+        $('.error_msg .error_msg_res').html(res.data.message + ' <a class="validate_mail text-danger"><b>Validate Email</b></a>');
168
+      //   toasterOpts();
169
+      // Command: toastr["error"]()
170
+        /*Email validation*/
171
+  $('.validate_mail').click(function(){
172
+    $(".login_section").hide();
173
+    $(".email-validate-div").show();
174
+    $('.error_msg').hide();
175
+  })
176
+      }
177
+    }
178
+  }
179
+
180
+  // this function will be triggered on new user registration
181
+  async function userRegistration() {
182
+    reg_form = $("#register_form");
183
+    // reg_name = $("#User_Name").val();
184
+    reg_email = reg_form.find("#User_Email").val();
185
+    // reg_otp_email = $("#User_otp_Email").val();
186
+    // reg_number = $("#user_number").val();
187
+    reg_pwd = reg_form.find("#User_password").val();
188
+    let userName = reg_email.split("@");
189
+    let otpRes = null;
190
+    const userRegistratioNPayload = {
191
+      organizationtypeid: "2",
192
+      organizationid: "0",
193
+      contactid: "0",
194
+      userid: "0",
195
+      username: "0",
196
+      users_phonenumber: "0",
197
+      password: reg_pwd,
198
+      users_emailaddress: "0",
199
+      emailaddress: reg_email,
200
+      contactname: userName[0],
201
+      phonenumber: "0",
202
+      branchid: "0",
203
+      tenantname: "Anwi Systems",
204
+      rolename: "Customer Admin",
205
+      currencyid: "0",
206
+      customerformuniqueid: "Bizgaze_Platform_Crm_RegisterCRMUser",
207
+    };
208
+    debugger;
209
+    $('#register_btn').hide()
210
+    $(".loader-btn").show();
211
+    debugger;
212
+    const res = await postAPIService(
213
+      `bizgaze/crm/webapi/registercrmuser`,
214
+      userRegistratioNPayload
215
+    );
216
+    console.log(res, "register");
217
+    $(".loader-btn").hide();
218
+    $('#register_btn').show()
219
+    if (res.data.code == "404" ) {
220
+      // toasterOpts();
221
+      // Command: toastr["error"](res.data.message)
222
+      $('.error_msg').show();
223
+      $('.error_msg .error_msg_res').html(res.data.message);
224
+      return;
225
+    }
226
+     else {
227
+      $("#register_form .email-password-group").hide();
228
+      $("#register_form .register_otp.otp-input-group").show();
229
+    }
230
+  
231
+    $("#proceed").click(async function () {
232
+      let userEnterOtp = "";
233
+      let userEmail = registerForm.find("#User_Email").val();
234
+      $(".otp-input-group input").each(function () {
235
+        let presVal = $(this).val();
236
+        userEnterOtp += presVal;
237
+      });
238
+      console.log(userEnterOtp);
239
+      debugger;
240
+      const userotppayload = {
241
+        email: userEmail,
242
+        otpid: res.data.result.OtpId,
243
+        userotp: userEnterOtp,
244
+      };
245
+      $(".loader-btn").show();
246
+      $('#proceed').hide()
247
+      otpRes = await postAPIService(
248
+        `bizgaze/crm/webapi/ValidateOtp`,
249
+        userotppayload
250
+      );
251
+      $(".loader-btn").hide();
252
+      $('#proceed').show()
253
+      debugger;
254
+      console.log(otpRes, "otp");
255
+      const verifyotpStatus = otpRes.data.result;
256
+      if (verifyotpStatus == "Otp verified successfully") {
257
+        const loginPayload = {
258
+          username: reg_email,
259
+          Password: reg_pwd,
260
+          UnibaseId: "",
261
+          RememberMe: false,
262
+        };
263
+        const res = await postAPIService(
264
+          `bizgaze/crm/webapi/crmuserlogin`,
265
+          loginPayload
266
+        );
267
+        if (res.data.message == "200") {
268
+          debugger;
269
+          // Command: toastr["success"]("Logged in successfully")
270
+          // toasterOpts();
271
+          COOKIE_HELPER_ACTIONS.setCookie({
272
+            token: res.data.result.sessionId,
273
+            userid: res.data.result.userId,
274
+            ...res.data.result
275
+          });
276
+          // setInitLoginLocal();
277
+          window.localStorage.setItem("Useremail", userEmail);
278
+          //window.localStorage.setItem("Userpassword", userPassword);
279
+          window.localStorage.setItem("isaccountCreated", true);
280
+          const isCartAdded = localStorage.getItem(CART_ADD);
281
+          if(isCartAdded){
282
+            localStorage.removeItem(CART_ADD);
283
+            window.location.href = `/selectdelivery.html`;
284
+            return;
285
+          }
286
+          window.location.href = `./index.html`;
287
+        } else {
288
+        //   toasterOpts();
289
+        // Command: toastr["error"](res.data.message)
290
+        $('.error_msg').show();
291
+        $('.error_msg .error_msg_res').html(res.data.message);
292
+        }       
293
+      } else {
294
+        // toasterOpts();
295
+        // Command: toastr["error"]("Please enter Valid OTP");
296
+        $('.error_msg').show();
297
+        $('.error_msg .error_msg_res').html("Please enter Valid OTP");
298
+      }
299
+    });
300
+  }
301
+
302
+  // to validate password on keyup in password input field
303
+  function passwordValidate(pswd) {
304
+    if (pswd.length < 8) {
305
+      $("#chck_length").removeClass("pswd_valid").addClass("pswd_invalid");
306
+    } else {
307
+      $("#chck_length").removeClass("pswd_invalid").addClass("pswd_valid");
308
+    }
309
+    // validate uppercase letter
310
+    if (pswd.match(/[A-Z]/)) {
311
+      $("#chck_capital").removeClass("pswd_invalid").addClass("pswd_valid");
312
+    } else {
313
+      $("#chck_capital").removeClass("pswd_valid").addClass("pswd_invalid");
314
+    }
315
+    //validate special letter
316
+    if (pswd.match(/[!@#$%^&*]/)) {
317
+      $("#chck_special").removeClass("pswd_invalid").addClass("pswd_valid");
318
+    } else {
319
+      $("#chck_special").removeClass("pswd_valid").addClass("pswd_invalid");
320
+    }
321
+    let pswdVal = $("#register_form #User_password").val();
322
+    let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/;
323
+    if (pswdVal.match(pattern)) {
324
+      $(".pswd_info").hide();
325
+    } else {
326
+      $(".pswd_info").show();
327
+    }
328
+    //validate number
329
+    if (pswd.match(/\d/)) {
330
+      $("#chck_number").removeClass("pswd_invalid").addClass("pswd_valid");
331
+    } else {
332
+      $("#chck_number").removeClass("pswd_valid").addClass("pswd_invalid");
333
+    }
334
+  }
335
+
336
+  //you have to use keyup, because keydown will not catch the currently entered value
337
+  $("#register_form #User_password")
338
+    .keyup(function () {
339
+      // set password variable
340
+      var pswd = $(this).val();
341
+      passwordValidate(pswd);
342
+    })
343
+    .focus(function () {
344
+      let pswdVal = $("#register_form #User_password").val();
345
+      let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
346
+      if (pswdVal.match(pattern)) {
347
+        $(".pswd_info").hide();
348
+      } else {
349
+        $(".pswd_info").show();
350
+      }
351
+    })
352
+    .blur(function () {
353
+      $(".pswd_info").hide();
354
+    });
355
+
356
+  // function to validate user entered email
357
+  function validateEmail(userEmail) {
358
+    var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
359
+    // return $.trim(userEmail).test(pattern) ? true : false;
360
+    return pattern.test(userEmail) ? true : false;
361
+  }
362
+
363
+  // function to validate user entered password
364
+  function validatepassword(userPassword) {
365
+    var pattern =  /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
366
+    // return $.trim(userPassword).test(pattern) ? true : false;
367
+    return pattern.test(userPassword) ? true : false;
368
+  }
369
+
370
+  registerForm.find("#User_Email,#User_password").keypress(function (e) {
371
+    if (e.which == 13) $("#register_btn").click();
372
+  });
373
+
374
+  // this will be triggered on clicking continue in signup form
375
+  $("#register_btn").click(function () {
376
+    $('.error_msg').hide();
377
+    registerForm.find(".loader-btn").show();
378
+    $(this).hide();
379
+    let userEmail = registerForm.find("#User_Email").val();
380
+    let userPassword = registerForm.find("#User_password").val();
381
+    let emailInput = registerForm.find(".email-login-inputgroup");
382
+    let passwordInput = registerForm.find(".password-login-inputgroup");
383
+    if (userEmail == "") {
384
+      emailInput.find("#User_Email").addClass("is-invalid");
385
+      emailInput.find(".form-floating").addClass("is-invalid");
386
+      emailInput.find(".invalid-feedback").text("Please enter your email");
387
+      registerForm.find(".loader-btn").hide();
388
+      $(this).show();
389
+    }
390
+    if (userPassword == "") {
391
+      passwordInput.find("#User_password").addClass("is-invalid");
392
+      passwordInput.find(".form-floating").addClass("is-invalid");
393
+      registerForm.find(".loader-btn").hide();
394
+      $(this).show();
395
+    } else {
396
+      emailInput.find("#User_Email").removeClass("is-invalid");
397
+      emailInput.find(".form-floating").removeClass("is-invalid");
398
+      passwordInput.find("#User_password").removeClass("is-invalid");
399
+      passwordInput.find(".form-floating").removeClass("is-invalid");
400
+      let Email_valid = validateEmail(userEmail);
401
+      let Pwd_valid = validatepassword(userPassword);
402
+      if (Email_valid === true && Pwd_valid === true) {
403
+        userRegistration();
404
+        $("#register_form .otp-input-group .otp-sent-email").text(userEmail);
405
+      } else if(Email_valid === false) {
406
+        emailInput.find("#User_Email").addClass("is-invalid");
407
+        emailInput.find(".form-floating").addClass("is-invalid");
408
+        emailInput.find(".invalid-feedback").text("Please enter a valid email");
409
+        registerForm.find(".loader-btn").hide();
410
+        $(this).show();
411
+      }else if(Pwd_valid === false){
412
+        passwordInput.find("#User_password").addClass("is-invalid");
413
+        passwordInput.find(".form-floating").addClass("is-invalid");
414
+        passwordInput.find(".invalid-feedback").text("Please check the password!");
415
+        registerForm.find(".loader-btn").hide();
416
+        $(this).show();
417
+      }
418
+    }
419
+  });
420
+  $(".pswd_eye").click(function(){
421
+    let eyeClass = $(this).find('svg').hasClass("fa-eye-slash");
422
+    if(eyeClass == true){
423
+         $(this).find('svg').removeClass("fa-eye-slash"); 
424
+        $(this).find('svg').addClass("fa-eye");
425
+        $(this).siblings('input').attr('type','password')
426
+      }else{
427
+        $(this).find('svg').removeClass("fa-eye");
428
+        $(this).find('svg').addClass("fa-eye-slash");  
429
+        $(this).siblings('input').attr('type','text')
430
+    }
431
+})
432
+  
433
+  $("#forgotPassword").click(function () {
434
+    $(".login-email-password-div").hide();
435
+    $(".login-forgot-password-div").show();
436
+  });
437
+  $("#forgot_Password_Back").click(function () {
438
+    $(".login-forgot-password-div").hide();
439
+    $(".login-email-password-div").show();
440
+  });
441
+  $("#forgot_password_submit").click(async function () {
442
+    let forgot_email = $("#forgot_User_Email").val();
443
+    if(forgot_email == ''){
444
+$('#forgot_User_Email').addClass('is-invalid')
445
+$('#forgot_User_Email').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
446
+return
447
+    }
448
+    else{
449
+    debugger;
450
+  let port = SERVERNAME
451
+   // let port = "http://localhost:3088";
452
+    let url = `${port}/account/getuserbyphoneormail/${forgot_email}/${forgot_email}`;
453
+    const config = {
454
+      url,
455
+      method: "get",
456
+    };
457
+    $(".loader-btn").show();
458
+    $('#forgot_password_submit').hide()
459
+    let response = await axios(config);
460
+    debugger;
461
+    console.log(response);
462
+    $(".loader-btn").hide();
463
+    $('#forgot_password_submit').show()
464
+    if (response.data.result != null) {
465
+      debugger;
466
+      console.log(response.data);
467
+      const forgotpassPayload = {
468
+        firstname: "",
469
+        lastname: "",
470
+        contactnumber: "",
471
+        email: "",
472
+        tenantname: "",
473
+        contactoremail: response.data.result.email,
474
+        IsSignup: false,
475
+        IsRegisterUser: false,
476
+        IsForgotPswd: true,
477
+        UnibaseId: response.data.result.userName,
478
+        OtpId: 0,
479
+        UserOtp: "",
480
+      };
481
+      $('#forgot_password_submit').hide()
482
+      $(".loader-btn").show();
483
+      const forgetpassRes = await postAPIService(
484
+        `account/sendotp`,
485
+        forgotpassPayload
486
+      );
487
+      $(".loader-btn").hide();
488
+      console.log(forgetpassRes);
489
+      $(".email-validation").hide();
490
+      $('.user_email').html(forgot_email)
491
+      $(".otp-validation .otp-input-group").show();
492
+      $(".otp-validation .otp-input-group").on("paste", function (p) {
493
+        let data = p.originalEvent.clipboardData.getData("text");
494
+        let dataLength = data.length;
495
+        for (let i = 0; i < dataLength; i++) {
496
+          let input = $(
497
+            '.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
498
+          );
499
+          input.val(data.charAt(i));
500
+          if (input.val().length >= input.attr("maxlength")) {
501
+            let nextInput = $(
502
+              '.otp-validation .otp-input-group input[tabindex="' +
503
+                (i + 2) +
504
+                '"]'
505
+            );
506
+            if (nextInput) {
507
+              nextInput.focus();
508
+            }
509
+          }
510
+        }
511
+        p.preventDefault();
512
+      });
513
+
514
+      $('.otp-validation .otp-input-group input[type="text"]').on(
515
+        "keyup",
516
+        function (e) {
517
+          if ($(this).val().length >= $(this).attr("maxlength")) {
518
+            if (e.keyCode !== 9 && e.keyCode !== 16) {
519
+              let tabIndex = parseInt($(this).attr("tabindex")) + 1;
520
+              $(
521
+                '.otp-validation .otp-input-group input[tabindex="' +
522
+                  $(this).attr("tabindex") +
523
+                  '"]'
524
+              ).val($(this).val());
525
+              $(
526
+                '.otp-validation .otp-input-group input[tabindex="' +
527
+                  tabIndex +
528
+                  '"]'
529
+              ).focus();
530
+            }
531
+          } else {
532
+            if (e.keyCode === 8) {
533
+              let tabIndex = parseInt($(this).attr("tabindex")) - 1;
534
+              $(
535
+                '.otp-validation .otp-input-group input[tabindex="' +
536
+                  tabIndex +
537
+                  '"]'
538
+              ).focus();
539
+            }
540
+          }
541
+        }
542
+      );
543
+      $("#Forgot_pass_proceed").click(async function () {
544
+        debugger;
545
+        let userotp='';
546
+        $(".otp-validation .otp-input-group input").each(function () {
547
+          let presVal = $(this).val();
548
+          userotp += presVal;
549
+        });
550
+        console.log(userotp);
551
+          const validateForgotpass = {
552
+           email: forgot_email,
553
+            otpid: forgetpassRes.data,
554
+            userotp: userotp,
555
+          };
556
+          $('#Forgot_pass_proceed').hide()
557
+          $(".loader-btn").show();
558
+          const forgetpassResotp = await postAPIService(
559
+            `hyperfusion/validateotp`,
560
+            validateForgotpass
561
+         );
562
+         $(".loader-btn").hide();
563
+         $('#Forgot_pass_proceed').show()
564
+          console.log(forgetpassResotp);
565
+          const Resotp = forgetpassResotp.data.result;
566
+          if (Resotp == "Otp verified successfully") {
567
+            $(".login-forgot-password-details-div").show();
568
+        $(".otp-validation .otp-input-group").hide();
569
+          } else {
570
+            // toasterOpts()
571
+            // Command: toastr["error"]("Please enter Valid OTP");
572
+            $('.error_msg').show();
573
+            $('.error_msg .error_msg_res').html("Please enter Valid OTP");
574
+          }
575
+      });
576
+      $("#forgot_password_details_submit").click(async function () {
577
+        debugger;
578
+        let pswdone =$("#forgot-password-input-one").val();
579
+        let pswdtwo =$("#forgot-password-input-two").val();
580
+        if(pswdone == pswdtwo) {
581
+          const forgotpassPayload = {
582
+            username: response.data.result.userName,
583
+            password: pswdtwo,
584
+          };
585
+          $("#forgot_password_details_submit").hide();
586
+          $(".loader-btn").show();
587
+          const forgetpassRes = await postAPIService(
588
+            `account/UpdatePassword`,
589
+            forgotpassPayload
590
+          );
591
+          console.log(forgetpassRes);
592
+          $(".loader-btn").hide();
593
+          $("#forgot_password_details_submit").show();
594
+          window.localStorage.setItem('Ispasswordupdate',true)
595
+          window.location.href = `./myaccount.html`;
596
+        }else {
597
+          $("#forgot-password-input-one").addClass('is-invalid');
598
+          $("#forgot-password-input-two").addClass('is-invalid')
599
+          $('.password_display').text('Passwords are not matched !').addClass('text-danger')
600
+        }
601
+     
602
+      
603
+      });
604
+    } 
605
+    else{
606
+      $('#forgot_User_Email').addClass('is-invalid');
607
+      $('#forgot_User_Email').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
608
+   
609
+    }
610
+  }
611
+  });
612
+  $(".user_pass")
613
+  .keyup(function () {
614
+    // set password variable
615
+    var pswd = $(this).val();
616
+    passwordValidate(pswd);
617
+    $('.pswd_info').hide();
618
+    $(this).parent().siblings('.pswd_info').show();
619
+  })
620
+  .focus(function () {
621
+    let pswdVal = $(this).val();
622
+    let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/;
623
+    if (pswdVal.match(pattern)) {
624
+      $(this).parent().siblings('.pswd_info').hide();
625
+    } else {
626
+      $(this).parent().siblings('.pswd_info').show();
627
+    }
628
+  })
629
+  .blur(function () {
630
+    $(this).parent().siblings('.pswd_info').hide();
631
+  });
632
+
633
+  function toasterOpts(){
634
+    toastr.options = {
635
+      "closeButton": true,
636
+      "debug": false,
637
+      "newestOnTop": true,
638
+      "progressBar": true,
639
+      "positionClass": "toast-top-center",
640
+      "preventDuplicates": true,
641
+      "onclick": null,
642
+      "showDuration": "300",
643
+      "hideDuration": "1000",
644
+      "timeOut": "5000",
645
+      "extendedTimeOut": "1000",
646
+      "showEasing": "swing",
647
+      "hideEasing": "linear",
648
+      "showMethod": "fadeIn",
649
+      "hideMethod": "fadeOut"
650
+    }
651
+  }
652
+}
653
+ $("#email_validate_submit").click(async function () {
654
+  let vaidate_otp;
655
+    let validate_email = $("#email_validation_input").val();
656
+    if(validate_email == ''){
657
+$('#email_validation_input').addClass('is-invalid')
658
+$('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
659
+return
660
+    }
661
+    else{
662
+    debugger;
663
+  let port = SERVERNAME;
664
+   // let port = "http://localhost:3088";
665
+    let url = `${port}/account/getuserbyphoneormail/${validate_email}/${validate_email}`;
666
+    const config = {
667
+      url,
668
+      method: "get",
669
+    };
670
+    $(".loader-btn").show();
671
+    $('#email_validate_submit').hide()
672
+    let response = await axios(config);
673
+    debugger;
674
+    console.log(response);
675
+    $(".loader-btn").hide();
676
+    $('#email_validate_submit').show()
677
+    if (response.data.result != null) {
678
+      debugger;
679
+      console.log(response.data);
680
+      const forgotpassPayload = {
681
+        firstname: "",
682
+        lastname: "",
683
+        contactnumber: "",
684
+        email: "",
685
+        tenantname: "",
686
+        contactoremail: response.data.result.email,
687
+        IsSignup: false,
688
+        IsRegisterUser: false,
689
+        IsForgotPswd: true,
690
+        UnibaseId: response.data.result.userName,
691
+        OtpId: 0,
692
+        UserOtp: "",
693
+      };
694
+      $('#email_validate_submit').hide()
695
+      $(".loader-btn").show();
696
+      const validate_email_res = await postAPIService(
697
+        `account/sendotp`,
698
+        forgotpassPayload
699
+      );
700
+      $(".loader-btn").hide();
701
+      vaidate_otp = validate_email_res.data;
702
+      console.log(validate_email_res);
703
+      $(".email-validation").hide();
704
+      $('.user_email').html(validate_email)
705
+      $(".otp-validation .otp-input-group").show();
706
+      $(".otp-validation .otp-input-group").on("paste", function (p) {
707
+        let data = p.originalEvent.clipboardData.getData("text");
708
+        let dataLength = data.length;
709
+        for (let i = 0; i < dataLength; i++) {
710
+          let input = $(
711
+            '.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
712
+          );
713
+          input.val(data.charAt(i));
714
+          if (input.val().length >= input.attr("maxlength")) {
715
+            let nextInput = $(
716
+              '.otp-validation .otp-input-group input[tabindex="' +
717
+                (i + 2) +
718
+                '"]'
719
+            );
720
+            if (nextInput) {
721
+              nextInput.focus();
722
+            }
723
+          }
724
+        }
725
+        p.preventDefault();
726
+      });
727
+     
728
+    } 
729
+    else{
730
+      $('#email_validation_input').addClass('is-invalid');
731
+      $('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
732
+   
733
+    }
734
+  }
735
+  $("#email_validate_proceed").click(async function () {
736
+    debugger;
737
+    let userotp='';
738
+    let validate_email = $("#email_validation_input").val();
739
+    $(".email-validate-div .otp-validation .otp-input-group input").each(function () {
740
+      let presVal = $(this).val();
741
+      userotp += presVal;
742
+    });
743
+  
744
+     if(userotp.length == 6){
745
+      const validateForgotpass = {
746
+        email: validate_email,
747
+         otpid: vaidate_otp,
748
+         userotp: userotp,
749
+       };
750
+       $('#email_validate_proceed').hide()
751
+       $(".loader-btn").show();
752
+       const validate_email_resopt = await postAPIService(
753
+         `hyperfusion/validateotp`,
754
+         validateForgotpass
755
+      );
756
+      
757
+      $(".loader-btn").hide();
758
+      $('#email_validate_proceed').show()
759
+       const Resotp = validate_email_resopt.data.result;
760
+       if (Resotp == "Otp verified successfully") {
761
+       $(".login_section").show();
762
+       $(".otp-validation .otp-input-group").hide();
763
+       $("#email_validate_back").hide();
764
+       $('.error_msg').hide();
765
+       } else {
766
+         // toasterOpts()
767
+         // Command: toastr["error"]("Please enter Valid OTP");
768
+         $('.error_msg').show();
769
+         $('.error_msg .error_msg_res').html("Please enter Valid OTP");
770
+       }
771
+     }
772
+     else{
773
+      $('.error_msg').show();
774
+      $('.error_msg .error_msg_res').html("Please enter OTP");
775
+     }
776
+  });
777
+  });
778
+
779
+
780
+initLogin();

+ 110
- 0
dist/js/components/accordion/accordion.js View File

@@ -0,0 +1,110 @@
1
+class AccordionItem extends HTMLElement {
2
+    static get observedAttributes() {
3
+      return ['title'];
4
+    }
5
+  
6
+    #title = '';
7
+    #collapsed = true;
8
+  
9
+    constructor() {
10
+      super();
11
+      this.attachShadow({ mode: 'open' });
12
+    }
13
+  
14
+    connectedCallback() {
15
+      this.update();
16
+      this.shadowRoot.addEventListener('click', this.toggle.bind(this));
17
+    }
18
+  
19
+    attributeChangedCallback(name, oldValue, newValue) {
20
+      if (name === 'title') {
21
+        this.#title = newValue;
22
+      }
23
+      this.update();
24
+    }
25
+  
26
+    toggle() {
27
+      this.#collapsed = !this.#collapsed;
28
+      this.update();
29
+  
30
+      // Dispatch a custom event to notify the parent AccordionElement
31
+      const event = new CustomEvent('accordion-item-toggle', {
32
+        bubbles: true,
33
+        detail: {
34
+          collapsed: this.#collapsed,
35
+          item: this,
36
+        },
37
+      });
38
+      this.dispatchEvent(event);
39
+    }
40
+  
41
+    update() {
42
+      this.shadowRoot.innerHTML = `
43
+        <style>
44
+          .accordion-item {
45
+          
46
+          }
47
+          .accordion-title {
48
+            display: flex;
49
+            justify-content: space-between;
50
+            align-items: center;
51
+            cursor: pointer;
52
+            padding: 0.5rem;
53
+            background-color: white;
54
+          }
55
+          .accordion-title:hover {
56
+            background-color: white;
57
+          }
58
+          .accordion-title::after {
59
+            content: '${this.#collapsed ? '+' : '−'}';
60
+            font-size: 1rem;
61
+            font-weight: bold;
62
+            color: #777;
63
+            margin-left: 0.5rem;
64
+          }
65
+          .accordion-content {
66
+            padding: 0.5rem;
67
+            display: ${this.#collapsed ? 'none' : 'block'};
68
+          }
69
+        </style>
70
+        <div class="accordion-item">
71
+          <div class="accordion-title">${this.#title}</div>
72
+          <div class="accordion-content">
73
+            <slot></slot>
74
+          </div>
75
+        </div>
76
+      `;
77
+    }
78
+  }
79
+
80
+  class AccordionElement extends HTMLElement {
81
+    #activeItem = null;
82
+  
83
+    constructor() {
84
+      super();
85
+      this.attachShadow({ mode: 'open' });
86
+      this.shadowRoot.innerHTML = '<slot></slot>';
87
+      this.addEventListener('accordion-item-toggle', this.handleItemToggle.bind(this));
88
+    }
89
+  
90
+    handleItemToggle(event) {
91
+      const { collapsed, item } = event.detail;
92
+  
93
+      // If the active item is different from the toggled item, collapse the active item
94
+      if (this.#activeItem && this.#activeItem !== item && !collapsed) {
95
+        this.#activeItem.toggle();
96
+      }
97
+
98
+      // Update the active item
99
+      if (!collapsed) {
100
+        this.#activeItem = item;
101
+      } else if (this.#activeItem === item) {
102
+        this.#activeItem = null;
103
+      }
104
+    }
105
+  }
106
+  
107
+  customElements.define('accordion-item', AccordionItem);
108
+  customElements.define('accordion-element', AccordionElement);
109
+  
110
+  

+ 162
- 0
dist/js/components/authloader/authloader.js View File

@@ -0,0 +1,162 @@
1
+const template = document.createElement('template');
2
+
3
+template.innerHTML = `
4
+<style>
5
+.authloaderanwi {
6
+    display: flex;
7
+    justify-content: center;
8
+    align-items: center;
9
+}
10
+.wrap{
11
+    position:absolute;
12
+    left:50%;
13
+    width:5em;
14
+    height:5em;
15
+    top:20%;
16
+    transform: translate(-50%,-50%);
17
+  }
18
+  
19
+  .loader{
20
+      transition: all 0.7s ease-in-out;
21
+  
22
+    border:5px solid #ebebeb;
23
+    border-bottom-color:black;
24
+    width: 20px;
25
+    height: 20px;
26
+    border-radius:50%;
27
+    -webkit-font-smoothing: antialiased !important;
28
+    margin:30px 0px;
29
+  }
30
+  
31
+  #lrd1{
32
+      -webkit-animation: spin1 0.5s linear infinite;
33
+  
34
+  }
35
+  #lrd2{
36
+      -webkit-animation: spin2 3s ease-in-out infinite;
37
+  
38
+  }
39
+  #lrd3{
40
+      -webkit-animation: spin3 15s ease-in-out infinite;
41
+  
42
+  }
43
+  
44
+  @keyframes spin1{
45
+    0% {
46
+      transform: rotate(0deg);    
47
+    }
48
+  
49
+  
50
+    100% {
51
+      transform: rotate(360deg); 
52
+    }
53
+  
54
+  }
55
+  @keyframes spin2{
56
+    0% {
57
+      transform: rotate(0deg);    
58
+    }
59
+    50% {
60
+      transform: rotate(1020deg);    
61
+    }
62
+    
63
+    
64
+    100% {
65
+      transform: rotate(720deg); 
66
+    }
67
+  }
68
+  
69
+  @keyframes spin3{
70
+    0% {
71
+      transform: rotate(0deg);    
72
+    }
73
+    40% {
74
+      transform: rotate(1070deg);    
75
+    }
76
+    
77
+    
78
+    100% {
79
+      transform: rotate(6119deg);
80
+      border-bottom-color:#072426 !important;
81
+    }
82
+  }
83
+  
84
+.authloaderanwi {
85
+    height: 100vh;
86
+}
87
+
88
+
89
+.overlayanwiAuth{
90
+    width:100vw;
91
+    height:100vh;
92
+    background:white;
93
+    position:fixed;
94
+    top:0;
95
+    right:0;
96
+    z-index:99999;
97
+    display:none;
98
+}
99
+
100
+</style>
101
+  <div class="overlayanwiAuth ">
102
+  
103
+  <div style="
104
+    position: absolute;
105
+    top: 50%;
106
+    left: 50%;
107
+    transform: translate(-50%, -50%);
108
+    width:40px;
109
+    display:none;
110
+    ">
111
+
112
+    <span>
113
+  <?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 116.31" style="enable-background:new 0 0 122.88 116.31" xml:space="preserve"><g><path d="M4.06,12.67C1.87,12.67,0,10.8,0,8.51c0-2.19,1.87-4.06,4.06-4.06h5.62c0.1,0,0.31,0,0.42,0c3.75,0.1,7.08,0.83,9.88,2.6 c3.12,1.98,5.41,4.99,6.66,9.47c0,0.1,0,0.21,0.1,0.31L27.78,21h2.34V4.12c0-2.27,1.85-4.12,4.12-4.12h21.67 c2.27,0,4.12,1.85,4.12,4.12v10.02c3.42-3.41,8.06-5.5,13.18-5.5c2.22,0,4.36,0.4,6.34,1.12c4.08-4.33,9.87-7.04,16.29-7.04 c10.96,0,20.07,7.88,21.99,18.28h0.99c2.29,0,4.06,1.87,4.06,4.06c0,0.42-0.11,0.83-0.21,1.25l-10.61,42.76 c-0.42,1.87-2.08,3.12-3.95,3.12l0,0H41.51c1.46,5.41,2.91,8.32,4.89,9.68c2.39,1.56,6.56,1.66,13.53,1.56h0.1l0,0h47.03 c2.29,0,4.06,1.87,4.06,4.06c0,2.29-1.87,4.06-4.06,4.06H60.04l0,0c-8.64,0.1-13.94-0.1-18.21-2.91 c-4.37-2.91-6.66-7.91-8.95-16.96l0,0L18.94,18.92c0-0.1,0-0.1-0.1-0.21c-0.62-2.29-1.66-3.85-3.12-4.68 c-1.46-0.94-3.43-1.35-5.72-1.35c-0.1,0-0.21,0-0.31,0H4.06L4.06,12.67L4.06,12.67z M84.38,37.69c0-1.28,1.27-2.32,2.83-2.32 c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32c-1.56,0-2.83-1.04-2.83-2.32V37.69L84.38,37.69z M67.43,37.69 c0-1.28,1.27-2.32,2.83-2.32c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32c-1.56,0-2.83-1.04-2.83-2.32V37.69 L67.43,37.69z M50.49,37.69c0-1.28,1.27-2.32,2.83-2.32c1.56,0,2.83,1.04,2.83,2.32v15.69c0,1.28-1.27,2.32-2.83,2.32 c-1.56,0-2.83-1.04-2.83-2.32V37.69L50.49,37.69z M85.57,13.37c2.31,2.05,4.14,4.66,5.29,7.63h19.85 c-1.68-6.65-7.7-11.58-14.87-11.58C91.89,9.42,88.29,10.91,85.57,13.37L85.57,13.37z M92.21,29.11L92.21,29.11l-38.01,0l0,0H30.07 l0,0l9.26,34.86h65.65l8.63-34.86H92.21L92.21,29.11z M55.31,21c0.11-0.29,0.23-0.57,0.35-0.85V7.2c0-1.64-1.35-2.99-2.99-2.99 H37.71c-1.64,0-2.99,1.34-2.99,2.99V21H55.31L55.31,21z M94.89,96.33c5.52,0,9.99,4.47,9.99,9.99s-4.47,9.99-9.99,9.99 c-5.51,0-9.99-4.47-9.99-9.99S89.38,96.33,94.89,96.33L94.89,96.33L94.89,96.33z M51.09,96.33c5.51,0,9.99,4.47,9.99,9.99 s-4.47,9.99-9.99,9.99s-9.99-4.47-9.99-9.99S45.57,96.33,51.09,96.33L51.09,96.33L51.09,96.33z"/></g>
114
+    </svg>
115
+    </span>
116
+    </div>
117
+<div class="authloaderanwi">
118
+<div class='loader' id='lrd1'></div>
119
+</div>
120
+
121
+  </div>
122
+`
123
+
124
+class AuthLoader extends HTMLElement {
125
+    constructor() {
126
+      super();
127
+      console.log(this.payment);
128
+      this._shadowRoot = this.attachShadow({ 'mode': 'open' });
129
+      this._shadowRoot.appendChild(template.content.cloneNode(true));
130
+      this.show();
131
+    }
132
+
133
+    static get observedAttributes() {
134
+      return ['payment'];
135
+    }
136
+  
137
+    // define getters and setters for attributes
138
+    get payment() {
139
+      return this.getAttribute('payment');
140
+    }
141
+  
142
+    set payment(val) {
143
+      if (val) {
144
+        this.setAttribute('payment', val);
145
+      } else {
146
+        this.removeAttribute('payment');
147
+      }
148
+    }
149
+    
150
+
151
+    show(){
152
+        // $('.overlayanwiAuth').css('display','block');
153
+        this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "block";
154
+    }
155
+
156
+    hide(){
157
+         //$('.overlayanwiAuth').addClass('display','none');
158
+        this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "none";
159
+    }
160
+}
161
+
162
+window.customElements.define('auth-loader', AuthLoader);

+ 0
- 0
dist/js/components/authloader/passwordinput.js View File


+ 256
- 0
dist/js/components/select/selectcomponent.js View File

@@ -0,0 +1,256 @@
1
+
2
+class SearchableMulti extends HTMLElement {
3
+    static get observedAttributes() {
4
+      return ['placeholder'];
5
+    }
6
+  
7
+    constructor() {
8
+      super();
9
+      this._values = [];
10
+      this._placeholder = 'Search...';
11
+    }
12
+  
13
+    connectedCallback() {
14
+      if(!this._rendered) {
15
+        this._rendered = true;
16
+        this.attachShadow({ mode: 'open' });
17
+        this.shadowRoot.appendChild(this._template());
18
+        this._refresh();
19
+      }
20
+  
21
+      this._nonSelected.addEventListener('click', this);
22
+      this._selected.addEventListener('click', this);
23
+      this._search.addEventListener('keyup', this);
24
+    }
25
+  
26
+    disconnectedCallback() {
27
+      this._nonSelected.removeEventListener('click', this);
28
+      this._selected.removeEventListener('click', this);
29
+      this._search.removeEventListener('keyup', this);
30
+    }
31
+  
32
+    attributeChangedCallback(name, oldVal, newVal) {
33
+      if(name === 'placeholder') {
34
+        this.placeholder = newVal;
35
+      }
36
+    }
37
+  
38
+    get value() {
39
+      return this._values;
40
+    }
41
+  
42
+    get placeholder() {
43
+      return this._placeholder;
44
+    }
45
+  
46
+    set placeholder(val) {
47
+      this._placeholder = val;
48
+      if(this._rendered) {
49
+        this.shadowRoot.querySelector('input').placeholder = val;
50
+      }
51
+    }
52
+  
53
+    handleEvent(ev) {
54
+      var el = ev.target;
55
+      switch(ev.type) {
56
+        case 'click':
57
+          if(el.className === 'item') {
58
+            if(el.parentNode.className === 'non-selected-wrapper') {
59
+              this._nonSelectedClick(el);
60
+            } else {
61
+              this._selectedClick(el);
62
+            }
63
+          }
64
+          break;
65
+        case 'keyup':
66
+          if(ev.keyCode === 32 || ev.keyCode === 13) {
67
+            if(el.className === 'item') {
68
+              if(el.parentNode.className === 'non-selected-wrapper') {
69
+                this._nonSelectedClick(el);
70
+              } else {
71
+                this._selectedClick(el);
72
+              }
73
+              ev.preventDefault();
74
+            }
75
+          } else {
76
+            this._onSearch();
77
+          }
78
+          break;
79
+      }
80
+    }
81
+  
82
+    _nonSelectedClick(el) {
83
+      // Not already selected
84
+      if(!el._selected) {
85
+        this._setSelected(el);
86
+        this.dispatchEvent(new Event('change'));
87
+      }
88
+    }
89
+  
90
+    _setSelected(el) {
91
+      el._option.selected = true;
92
+      var clone = el._selected = el.cloneNode(true);
93
+      clone._nonSelected = el;
94
+      this._selected.appendChild(clone);
95
+      this._values.push(el.dataset.value);
96
+    }
97
+  
98
+    _selectedClick(el) {
99
+      var nonSelected = el._nonSelected;
100
+      var option = nonSelected._option;
101
+      nonSelected._selected = undefined;
102
+      el.parentNode.removeChild(el);
103
+  
104
+      // Deselect the option
105
+      option.selected = false;
106
+  
107
+      // Remove from values
108
+      var idx = this._values.indexOf(el.dataset.value);
109
+      if(idx !== -1) {
110
+        this._values.splice(idx, 1);
111
+        this.dispatchEvent(new Event('change'));
112
+      }
113
+    }
114
+  
115
+    _onSearch() {
116
+      var term = this._search.value.toLowerCase();
117
+  
118
+      function includes(str) {
119
+        return str.toLowerCase().indexOf(term) !== -1;
120
+      }
121
+  
122
+      var nonSelected, d;
123
+      for(var i = 0, len = this._nonSelected.children.length; i < len; i++) {
124
+        nonSelected = this._nonSelected.children[i];
125
+  
126
+        if(term && !includes(nonSelected.dataset.value) &&
127
+          !includes(nonSelected.textContent)) {
128
+          d = 'none';
129
+        } else {
130
+          d = '';
131
+        }
132
+        nonSelected.style.display = d;
133
+        if(nonSelected._selected) {
134
+          nonSelected._selected.style.display = d;
135
+        }
136
+      }
137
+    }
138
+  
139
+    _template() {
140
+      var doc = this.ownerDocument;
141
+      var wrapper = doc.createElement('div');
142
+      wrapper.className = 'wrapper';
143
+  
144
+      var style = doc.createElement('style');
145
+      style.textContent = this._styles();
146
+  
147
+      var input = this._search = doc.createElement('input');
148
+      input.type = 'text';
149
+      input.className = 'search-input';
150
+      input.placeholder = this.placeholder;
151
+  
152
+      var nonSelected = this._nonSelected = doc.createElement('div');
153
+      nonSelected.className = 'non-selected-wrapper';
154
+  
155
+      var selected = this._selected = doc.createElement('div');
156
+      selected.className = 'selected-wrapper';
157
+  
158
+      wrapper.appendChild(style);
159
+      wrapper.appendChild(input);
160
+      wrapper.appendChild(nonSelected);
161
+      wrapper.appendChild(selected);
162
+      return wrapper;
163
+    }
164
+  
165
+    _styles() {
166
+      return `
167
+        :host {
168
+          display: block;
169
+        }
170
+  
171
+        .wrapper {
172
+            border: 1px solid #ccc;
173
+            border-radius: 3px;
174
+            overflow: hidden;
175
+            width: 100%;
176
+        }
177
+  
178
+        .non-selected-wrapper,
179
+        .selected-wrapper {
180
+            box-sizing: border-box;
181
+            display: inline-block;
182
+            height: 200px;
183
+            overflow-y: scroll;;
184
+            padding: 10px;
185
+            vertical-align: top;
186
+            width: 50%;
187
+        }
188
+  
189
+        .non-selected-wrapper {
190
+            background: #fafafa;
191
+            border-right: 1px solid #ccc;
192
+        }
193
+  
194
+        .selected-wrapper {
195
+            background: #fff;
196
+        }
197
+  
198
+        .item {
199
+            cursor: pointer;
200
+            display: block;
201
+            padding: 5px 10px;
202
+        }
203
+  
204
+        .item:hover {
205
+            background: #ececec;
206
+            border-radius: 2px;
207
+        }
208
+  
209
+        .search-input {
210
+            border: 0;
211
+            border-bottom: 1px solid #ccc;
212
+            border-radius: 0;
213
+            display: block;
214
+            font-size: 1em;
215
+            margin: 0;
216
+            outline: 0;
217
+            padding: 10px 20px;
218
+            width: 100%;
219
+        }
220
+  
221
+        .non-selected-wrapper .item.selected {
222
+            opacity: 0.5;
223
+        }
224
+  
225
+        .non-selected-wrapper .row.selected:hover {
226
+            background: inherit;
227
+            cursor: inherit;
228
+        }
229
+      `;
230
+    }
231
+  
232
+    _refresh() {
233
+      this._selected.innerHTML = this._nonSelected.innerHTML = '';
234
+  
235
+      var term = this._search.value;
236
+      var options = [].slice.call(this.querySelectorAll('option'));
237
+      var doc = this.ownerDocument;
238
+  
239
+      options.forEach(function(option){
240
+        var row = doc.createElement('a');
241
+        row.setAttribute('tabindex', "0");
242
+        row.setAttribute('role', 'button');
243
+        row.textContent = option.textContent;
244
+        row.dataset.value = option.value;
245
+        row.className = 'item';
246
+        row._option = option;
247
+        this._nonSelected.appendChild(row);
248
+  
249
+        if(option.selected) {
250
+          this._setSelected(row);
251
+        }
252
+      }.bind(this));
253
+    }
254
+  }
255
+  
256
+  customElements.define('searchable-multi', SearchableMulti);

+ 6
- 0
dist/js/fontawesome.all.js
File diff suppressed because it is too large
View File


+ 6
- 0
dist/js/fontawesome.min.js
File diff suppressed because it is too large
View File


+ 446
- 0
dist/js/footer.js View File

@@ -0,0 +1,446 @@
1
+$(document).ready(function () {
2
+    // Footer Js
3
+    let product_pg = $("body").hasClass("product_page");
4
+    let cookie = `<div id="cookieAcceptBar" class="cookieAcceptBar shadow bg-white py-3">
5
+   
6
+    <div class="cookie-content">
7
+        <p class="text-dark">We use cookies to enhance your user experience. please accept our
8
+          <a href="#" class="text-dark">cookies policy</a>
9
+        </p>
10
+        <div class="text-end">
11
+          <button id="btnAcceptCookiePolicy" class="btn btn-dark rounded">Accept</button>
12
+        </div>
13
+    </div>
14
+  </div>`;
15
+    $("#footer-head").after(cookie);
16
+        let footerHtml = `<footer class="footer-wrapper bg-black sec-space-1">
17
+    <div class="aw-mobile-footer d-block d-sm-none">
18
+    <div class="accordion" id="accordionExample">
19
+    <div class="accordion-item">
20
+      <h2 class="accordion-header" id="headingOne">
21
+        <button class="accordion-button bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
22
+        Products
23
+        </button>
24
+      </h2>
25
+      <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
26
+        <div class="accordion-body pt-0">
27
+        <ul class="list-inline ">
28
+            <li class="fs-6">
29
+                <a href="/ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
30
+            </li>
31
+            <li class="fs-6">
32
+                <a href="./storageproducts.html" class="text-white fs-9  text-decoration-none satoshi_font">Storage</a>
33
+            </li class="fs-6">
34
+                <a href="./index1.html" class="text-white fs-9  text-decoration-none satoshi_font">Coming Soon</a>
35
+            </li>
36
+      <!--  <li>Monitors </li>
37
+        <li>Peripherals</li>
38
+        <li>Desktops</li>
39
+        <li>Components</li>
40
+        <li>Network Switches</li>
41
+        <li>Network Cards</li>
42
+        <li>Servers</li>
43
+        <li>Storage</li>
44
+        <li>Compact Workstations</li>-->
45
+    </ul>
46
+        </div>
47
+      </div>
48
+    </div>
49
+    <div class="accordion-item">
50
+      <h2 class="accordion-header" id="headingTwo">
51
+        <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
52
+        Anwi
53
+        </button>
54
+      </h2>
55
+      <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
56
+        <div class="accordion-body pt-0">
57
+        <ul class="list-inline">
58
+            <li><a href="./about.html" class="text-white text-decoration-none satoshi_font">About Us</a></li>
59
+            <li><a href="./press.html" class="text-white text-decoration-none satoshi_font">Press</a></li>
60
+            <li><a href="./becomeamember.html" class="text-white text-decoration-none satoshi_font">Become a Member</a></li>
61
+            <li><a href="#" class="text-white text-decoration-none satoshi_font">Quality Certification</a></li>
62
+            <li><a href="#" class="text-white text-decoration-none satoshi_font">Case Study</a></li>
63
+            <li><a href="#" class="text-white text-decoration-none satoshi_font">Terms</a></li>
64
+            <li><a href="#" class="text-white text-decoration-none satoshi_font">Privacy</a></li>
65
+            <li><a href="#" class="text-white text-decoration-none satoshi_font">Careers</a></li>
66
+        </ul>
67
+        </div>
68
+      </div>
69
+    </div>
70
+   <!-- <div class="accordion-item">
71
+      <h2 class="accordion-header" id="headingThree">
72
+        <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
73
+        User Centre
74
+        </button>
75
+      </h2>
76
+      <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
77
+        <div class="accordion-body pt-0">
78
+        <ul class="list-inline">
79
+        <li>My Quotes</li>
80
+        <li><a href="./support.html" class="text-white text-decoration-none satoshi_font">My Support</a></li>
81
+    </ul>
82
+        </div>
83
+      </div>
84
+    </div>-->
85
+    <div class="accordion-item">
86
+    <h2 class="accordion-header" id="headingFour">
87
+      <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
88
+      Support
89
+      </button>
90
+    </h2>
91
+    <div id="collapseFour" class="accordion-collapse collapse" aria-labelledby="headingFour" data-bs-parent="#accordionExample">
92
+      <div class="accordion-body pt-0">
93
+      <ul class="list-inline">
94
+      <li><a href="./contact.html" class="text-white text-decoration-none satoshi_font">Contact Us</a></li>
95
+      <li><a href="./support.html" class="text-white text-decoration-none satoshi_font">Support</a></li>
96
+      <li>Help Centre</li>
97
+      <li>Feedback</li>
98
+  </ul>
99
+      </div>
100
+    </div>
101
+  </div>
102
+    <div class="accordion-item">
103
+    <h2 class="accordion-header" id="headingFive">
104
+      <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFive" aria-expanded="false" aria-controls="collapseFive">
105
+      Service
106
+      </button>
107
+    </h2>
108
+    <div id="collapseFive" class="accordion-collapse collapse" aria-labelledby="headingFive" data-bs-parent="#accordionExample">
109
+      <div class="accordion-body pt-0">
110
+      <ul class="list-inline Services_list">
111
+        <li><a href="./services/paymentmethod.html" class="text-white text-decoration-none satoshi_font">Payment Method</a></li>
112
+        <li><a href="./services/shipping-delivary.html" class="text-white text-decoration-none satoshi_font">Shipping &amp; Delivery</a></li>
113
+        <li><a href="./services/return-policy.html" class="text-white text-decoration-none satoshi_font">Return Policy</a></li>
114
+        <li><a href="./services/product-warrenty.html" class="text-white text-decoration-none satoshi_font">Product Warranty</a></li>
115
+        <li><a href="./services/online-help.html" class="text-white text-decoration-none satoshi_font">Online Help</a></li>
116
+        <li><a href="./services/bulk-orders.html" class="text-white text-decoration-none satoshi_font">Bulk Orders</a></li>
117
+  </ul>
118
+      </div>
119
+    </div>
120
+  </div>
121
+    <div class="accordion-item">
122
+    <h2 class="accordion-header" id="headingSix">
123
+      <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSix" aria-expanded="false" aria-controls="collapseSix">
124
+      Account
125
+      </button>
126
+    </h2>
127
+    <div id="collapseSix" class="accordion-collapse collapse" aria-labelledby="headingSix" data-bs-parent="#accordionExample">
128
+      <div class="accordion-body pt-0">
129
+      <ul class="list-inline">
130
+      <li>My Shopping Cart</li>
131
+      <li>My Account
132
+      </li>
133
+  </ul>
134
+      </div>
135
+    </div>
136
+  </div>
137
+    <div class="accordion-item">
138
+    <h2 class="accordion-header" id="headingSeven">
139
+      <button class="accordion-button collapsed bg-black text-white" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSeven" aria-expanded="false" aria-controls="collapseSeven">
140
+      Follow Us
141
+      </button>
142
+    </h2>
143
+    <div id="collapseSeven" class="accordion-collapse collapse" aria-labelledby="headingSeven" data-bs-parent="#accordionExample">
144
+      <div class="accordion-body pt-0">
145
+      <ul class="p-0" style="list-style:none;">
146
+      <li>
147
+      <a href="#" target="_blank" class="text-white">
148
+          <ul class="d-flex list-inline">
149
+              <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/twitter.png" alt="logo" class="px-1 img-fluid"></li>
150
+              <li>Twitter</li>
151
+          </ul>
152
+      </a>
153
+  </li>
154
+  <li>
155
+      <a href="https://www.instagram.com/anwi_systems/" target="_blank" class="text-white">
156
+          <ul class="d-flex list-inline">
157
+              <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/instra.png" alt="logo" class="px-1 img-fluid"></li>
158
+              <li>Instagram</li>
159
+          </ul>
160
+      </a>
161
+  </li>
162
+  <li>
163
+      <a href="#" target="_blank" class="text-white">
164
+          <ul class="d-flex list-inline">
165
+              <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/youtube.png" alt="logo" class="px-1 img-fluid"></li>
166
+              <li>Youtube</li>
167
+          </ul>
168
+      </a>
169
+  </li>
170
+  <li>
171
+      <a href="https://www.linkedin.com/company/anwisystems" target="_blank" class="text-white">
172
+          <ul class="d-flex list-inline">
173
+              <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/linkedin.png" alt="logo" class="px-1 img-fluid"></li>
174
+              <li>Linkedin</li>
175
+          </ul>
176
+      </a>
177
+  </li>
178
+  <li>
179
+      <a href="https://www.facebook.com/profile.php?id=100089547520891" target="_blank" class="text-white">
180
+          <ul class="d-flex list-inline">
181
+              <li class="footer-socailImg">
182
+                  <img src="./dist/assets/imgs/footer/facebook.png" alt="logo" class="px-1 img-fluid">
183
+              </li>
184
+              <li>Facebook</li>
185
+          </ul>
186
+      </a>
187
+  </li>
188
+  </ul>
189
+
190
+      </div>
191
+    </div>
192
+  </div>
193
+  
194
+  </div>
195
+  <div class="footer-sub-content ">
196
+  <div class="container">
197
+  <div class="row g-0 align-items-center justify-content-around">
198
+          <div class="col-md-2 col-6 text-white
199
+                  text-center">
200
+              <p class="mb-0">Privacy Policy</p>
201
+          </div>
202
+          <div class="col-md-2 col-6 text-white
203
+                  text-center">
204
+              <p class="mb-0"> Terms of Use Sales
205
+              </p>
206
+          </div>
207
+          <div class="col-md-2 col-6 text-center text-white">
208
+          <p class="mb-0 d-flex align-items-center"><i class="fa fa-envelope"></i> <span class="satoshi_font"><a href="mailto:sales@anwisystems.com" class="satoshi_font text-white ps-1">sales@anwisystems.com </a></span>
209
+          </p>
210
+          </div>
211
+      </div>
212
+  <div class="text-white">
213
+  <p class="mb-0 text-center">Copyright ©2023 Anwisystems pvt ltd.</p>
214
+  <p class="mb-0 text-center">All rights reserved.</p>
215
+</div>
216
+  </div>
217
+</div>
218
+  </div>
219
+    <div class="footer-main-container d-none d-sm-block ">
220
+        <div class="footer-logo py-3
221
+                container"> <img src="./dist/assets/imgs/anwi-logo-2.png" class="img-fluid "  alt="anwi"> </div>
222
+        <hr class="container-fluid
223
+                text-white">
224
+        <div class="footer-content-main-container">
225
+            <div class="footer-content text-white position-relative ">
226
+                <div class="container">
227
+                    <div class="d-flex my-3">
228
+                        <div class="col-lg-3 border-end col-lg-3 mx-3">
229
+                            <h5 class="fw-bold">Products</h5>
230
+                            <ul class="list-inline ">
231
+                                <li class="fs-6">
232
+                                    <a href="/ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
233
+                                </li>
234
+                                <li class="fs-6">
235
+                                    <a href="./storageproducts.html" class="text-white fs-9  text-decoration-none satoshi_font">Storage</a>
236
+                                </li>
237
+                                <li class="fs-6">
238
+                                    <a href="./index1.html" class="text-white fs-9  text-decoration-none satoshi_font">Coming Soon</a>
239
+                                </li>
240
+                            </ul>
241
+                        </div>
242
+                        <div class="col-lg-3 border-end col-lg-3 mx-3 fs-6">
243
+                            <h5 class="fw-bold">Anwi</h5>
244
+                            <ul class="list-inline">
245
+                                <li class="fs-6"><a href="./about.html" class="text-white text-decoration-none satoshi_font">About Us</a></li>
246
+                                <li class="fs-6"><a href="./press.html" class="text-white text-decoration-none satoshi_font">Press</a></li>
247
+                                <li><a href="./becomeamember.html" class="text-white text-decoration-none satoshi_font">Become a Member</a></li>
248
+                                <li class="fs-6"><a href="#" class="text-white text-decoration-none satoshi_font">Quality Certification</a></li>
249
+                                <li class="fs-6"><a href="#" class="text-white text-decoration-none satoshi_font">Case Study</a></li>
250
+                                <li class="fs-6"><a href="#" class="text-white text-decoration-none satoshi_font">Terms</a></li>
251
+                                <li class="fs-6"><a href="#" class="text-white text-decoration-none satoshi_font">Privacy</a></li>
252
+                                <li class="fs-6"><a href="#" class="text-white text-decoration-none satoshi_font">Careers</a></li>
253
+                            </ul>
254
+                        </div>
255
+                        <div class="col-lg-3 border-end col-lg-3
256
+                                mx-3">
257
+                            <h5 class="fw-bold">Support</h5>
258
+                            <ul class="list-inline">
259
+                                <li><a href="./contact.html" class="text-white text-decoration-none satoshi_font">Contact Us</a></li>
260
+                                <li><a href="./support.html" class="text-white text-decoration-none satoshi_font">Support</a></li>
261
+                                <li>Help Centre</li>
262
+                                <li>Feedback</li>
263
+                            </ul>
264
+                            <h5 class="fw-bold">Service</h5>
265
+                            <ul class="list-inline">
266
+                                <li><a href="./services/paymentmethod.html" class="text-white text-decoration-none satoshi_font">Payment Method</a></li>
267
+                                <li><a href="./services/shipping-delivary.html" class="text-white text-decoration-none satoshi_font">Shipping &amp; Delivery</a></li>
268
+                                <li><a href="./services/return-policy.html" class="text-white text-decoration-none satoshi_font">Return Policy</a></li>
269
+                                <li><a href="./services/product-warrenty.html" class="text-white text-decoration-none satoshi_font">Product Warranty</a></li>
270
+                                <li><a href="./services/online-help.html" class="text-white text-decoration-none satoshi_font">Online Help</a></li>
271
+                                <li><a href="./services/bulk-orders.html" class="text-white text-decoration-none satoshi_font">Bulk Orders</a></li>
272
+                            </ul>
273
+                        </div>
274
+                        <div class="col-lg-3 last-col-footer">
275
+                            <h5 class="fw-bold">Account</h5>
276
+                            <ul class="list-inline">
277
+                            <li>
278
+                            <a href="/shopping-cart.html" class="text-white text-decoration-none satoshi_font"> My Shopping Cart</a>
279
+                           </li>
280
+                      
281
+                            <li>
282
+                            <a href="/myaccount.html" class="text-white text-decoration-none satoshi_font"> My Account</a>
283
+                            
284
+                            </li>
285
+                                </li>
286
+                            </ul>
287
+                            <h5 class="fw-bold">Follow Us</h5>
288
+                            <ul class="p-0" style="list-style:none;">
289
+                                <li>
290
+                                    <a href="#" target="_blank" class="text-white">
291
+                                        <ul class="d-flex list-inline">
292
+                                            <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/twitter.png" alt="logo" class="px-1 img-fluid"></li>
293
+                                            <li>Twitter</li>
294
+                                        </ul>
295
+                                    </a>
296
+                                </li>
297
+                                <li>
298
+                                    <a href="https://www.instagram.com/anwi_systems/" target="_blank" class="text-white">
299
+                                        <ul class="d-flex list-inline">
300
+                                            <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/instra.png" alt="logo" class="px-1 img-fluid"></li>
301
+                                            <li>Instagram</li>
302
+                                        </ul>
303
+                                    </a>
304
+                                </li>
305
+                                <li>
306
+                                    <a href="#" target="_blank" class="text-white">
307
+                                        <ul class="d-flex list-inline">
308
+                                            <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/youtube.png" alt="logo" class="px-1 img-fluid"></li>
309
+                                            <li>Youtube</li>
310
+                                        </ul>
311
+                                    </a>
312
+                                </li>
313
+                                <li>
314
+                                    <a href="https://www.linkedin.com/company/anwisystems" target="_blank" class="text-white">
315
+                                        <ul class="d-flex list-inline">
316
+                                            <li class="footer-socailImg"><img src="./dist/assets/imgs/footer/linkedin.png" alt="logo" class="px-1 img-fluid"></li>
317
+                                            <li>Linkedin</li>
318
+                                        </ul>
319
+                                    </a>
320
+                                </li>
321
+                                <li>
322
+                                    <a href="https://www.facebook.com/profile.php?id=100089547520891" target="_blank" class="text-white">
323
+                                        <ul class="d-flex list-inline">
324
+                                            <li class="footer-socailImg">
325
+                                                <img src="./dist/assets/imgs/footer/facebook.png" alt="logo" class="px-1 img-fluid">
326
+                                            </li>
327
+                                            <li>Facebook</li>
328
+                                        </ul>
329
+                                    </a>
330
+                                </li>
331
+                            </ul>
332
+                        </div>
333
+                    </div>
334
+                </div>
335
+                <div class="footer-rkt position-absolute bottom-0
336
+                        end-0 me-5">
337
+                    <img src="../dist/assets/imgs/Home/rocket-footer.png" alt="footer-rocket-img">
338
+                </div>
339
+            </div>
340
+        </div>
341
+        <hr class="container-fluid text-white">
342
+        <div class="footer-sub-content ">
343
+            <div class="container">
344
+                <div class="row g-0 py-4 align-items-center">
345
+                    <div class="col-md-5 text-white">
346
+                        <p class="mb-0">Copyright ©${new Date().getFullYear()} Anwisystems pvt ltd. All rights reserved.</p>
347
+                    </div>
348
+                    <div class="col-md-2 text-white border-end
349
+                            text-center">
350
+                        <p class="mb-0">Privacy Policy</p>
351
+                    </div>
352
+                    <div class="col-md-2 text-white border-end ps-3
353
+                            text-center">
354
+                        <p class="mb-0"> Terms of Use Sales
355
+                        </p>
356
+                    </div>
357
+                    <div class="col-md-2 text-white ps-5">
358
+                        <p class="mb-0 d-flex align-items-center"><i class="fa fa-envelope"></i> <span class="satoshi_font"><a href="mailto:sales@anwisystems.com" class="satoshi_font text-white ps-1">sales@anwisystems.com </a></span>
359
+                        </p>
360
+                    </div>
361
+
362
+                    <!-- <ul class="d-flex mb-0
363
+                            list-inline align-items-center text-white">
364
+                        <li>Copyright © 2022 Anwisystems pvt ltd. All rights reserved.
365
+                        </li>
366
+                        <li>
367
+                            <ul class="d-flex list-inline
368
+                                    align-items-center
369
+                                    ms-4">
370
+                                <li>Privacy Policy</li>
371
+                                <li class="mx-5">Terms of Use Sales</li>
372
+                                <li><p class="mb-0 d-flex align-items-center"><i class="fa fa-envelope"></i> <span class="satoshi_font"><a href="mailto:sales@anwisystems.com" class="satoshi_font text-white ps-1">sales@anwisystems.com </a></span>
373
+                                </p>
374
+                                </li>
375
+                            </ul>
376
+                        </li>
377
+                    </ul> -->
378
+                </div>
379
+            </div>
380
+        </div>
381
+    </div>
382
+</footer>`;
383
+        $("#footer-head").html(footerHtml);
384
+
385
+
386
+
387
+    $("[alt=footer-rocket-img]").click(function (e) {
388
+        document.documentElement.scrollTop = 0;
389
+    })
390
+    cookiesPolicyPrompt();
391
+
392
+    function cookiesPolicyPrompt() {
393
+        if (Cookies.get('AnwiCookiesPolicy') !== "yes") {
394
+            $("#cookieAcceptBar").fadeIn("slow");
395
+        }
396
+        $('#btnAcceptCookiePolicy').on('click', function () {
397
+            Cookies.set('AnwiCookiesPolicy', 'yes', { expires: 30 });
398
+            $("#cookieAcceptBar").fadeOut("slow");
399
+        });
400
+        let width = $(window).width();
401
+        if (width < 575) {
402
+            $("#cookieAcceptBar").css({
403
+                "max-width": "100%",
404
+            });
405
+        } else if (width <= 1600 && width > 1200) {
406
+            $("#cookieAcceptBar").css({
407
+                "max-width": "28%",
408
+            });
409
+        }
410
+        else if (width <= 1200 && width > 575) {
411
+            $("#cookieAcceptBar").css({
412
+                "max-width": "50%",
413
+            });
414
+        }
415
+    }
416
+
417
+
418
+    //services pages links and sources
419
+
420
+    let $body_pg = $("body").hasClass("services_page");
421
+    let $nav_img ="../dist/assets/imgs/anwi-logo-1.png";
422
+    let $footer_img = "../dist/assets/imgs/anwi-logo-2.png";
423
+    let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png";
424
+
425
+    if($body_pg == true){
426
+        $("#footer-head").find(".footer-logo img").attr("src",$footer_img);
427
+        $(".footer-socailImg").each(function(){
428
+            let $social_img = $(this).find("img").attr("src");
429
+            let $social_img_mbil = $social_img.includes("https://anwisystems.com/");
430
+                if($social_img_mbil === false){
431
+                    let $social_icon_mbil = `.${$social_img}`
432
+                    $(this).find("img").attr("src",$social_icon_mbil);
433
+                }
434
+        })
435
+        $(".list-inline").find("li a").each(function(){
436
+            let $footer_link = $(this).attr("href");
437
+            let $footer_in = $footer_link.includes("https://anwisystems.com/");
438
+            if($footer_in === false){
439
+                if( $footer_link != "#"){
440
+                    let $in_link = `.${$footer_link}`
441
+                    $(this).attr("href", $in_link);
442
+                }
443
+            }
444
+        }) 
445
+    }
446
+});

+ 73
- 0
dist/js/form.js View File

@@ -0,0 +1,73 @@
1
+let formHTML = `  <!-- pop up -->
2
+<!-- enquire-form pop up -->
3
+<div class="modal fade style" id="enquireModal" tabindex="-1" role="dialog">
4
+  <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable mx-md-3 mx-3 mx-lg-auto" role="document">
5
+    <div class="wrap-contact100">
6
+      
7
+    <div class="modal-content contact100-form validate-form">
8
+      <div class=" justify-content-center position-absolute btn" style="right:0;z-index:10;">
9
+        <!-- <h5 class="modal-title" id="itemTitle"> </h5> -->
10
+        <button type="button" class="close btn" data-bs-dismiss="modal" >
11
+          <span >&times;</span>
12
+        </button>
13
+      </div>
14
+       <div class="d-flex w-100">
15
+      <div class="enquire-form-img col-md-6 col-lg-6 col-12 d-none d-lg-block d-md-block d-xl-block">
16
+      <img class="h-100 img-fluid" src="../backups/anwi-old-website/assets/img/quote-image.png">
17
+      </div>
18
+  <div class="enquire-form position-relative col-12 col-md-6 col-lg-6 pt-lg-5 pt-md-5 pt-2 px-30">
19
+  <div class="p-3">
20
+     <div>
21
+          <h3 class="contact-page-title">Request a Quote</h3>
22
+    </div>
23
+    <div>
24
+    
25
+                        <div id="pageloader" class="d-none">
26
+                            <img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif"
27
+                                alt="processing..." />
28
+                        </div>
29
+    <form id="anwi-enquire-form" action="">
30
+      <div class="form-floating">
31
+        <input type="text" class="form-control" id="userName" name="name" placeholder="name@example.com"  required>
32
+        <label for="name">Your Name</label>
33
+      </div>
34
+      <div class="form-floating">
35
+        <input type="text" class="form-control" id="itemTitle" name="Title" placeholder="Password" disabled>
36
+        <label for="name">Product</label>
37
+      </div>
38
+      <div class="form-floating ">
39
+        <input type="email" class="form-control" id="floatingEmail" name="email" placeholder="name@example.com"  required>
40
+        <label for="floatingEmail">Email address</label>
41
+      </div>
42
+      <div class="form-floating">
43
+        <input type="number" class="form-control" id="floatingPhonenumber" name="phone" placeholder="Password"  required>
44
+        <label for="floatingPhonenumber">Mobile No</label>
45
+      </div>
46
+      <div class="form-floating ">
47
+        <input type="text" class="form-control" id="floatingSubject" name="subject" placeholder="name@example.com"  required>
48
+        <label for="floatingSubject">Subject</label>
49
+      </div>
50
+      <div class="form-floating">
51
+        <textarea name="contactMessage" class="form-control" id="contactMessage" name="message" placeholder="Your Message" required style="height:100px"></textarea>
52
+        <label for="floatingPassword">Message</label>
53
+      </div>
54
+      <div class="form-floating text-center my-4">
55
+        <button type="submit"  class="bg-black btn btn-lg text-white w-50" >
56
+          submit
57
+        </button>
58
+      </div>
59
+    </form>
60
+    </div>
61
+    </div>
62
+  </div>
63
+</div>
64
+    </div>
65
+    </div>
66
+  </div>
67
+</div>
68
+<!-- end popup -->`;
69
+
70
+$("#enquire").html(formHTML);
71
+$(".close").on("click", function () {
72
+    $("body").removeClass("open");
73
+  });

+ 178
- 0
dist/js/index/index.js View File

@@ -0,0 +1,178 @@
1
+function indexInit(){
2
+    function init(){
3
+        initData();
4
+    }
5
+    async function initData(){
6
+        const ids = await getProductIdService();
7
+        if(!ids) return;
8
+        let dataAcc = [];
9
+        for(let i=0;i<ids.length;i++){
10
+            let currId = ids[i];
11
+            let {productid} = currId;
12
+
13
+            let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${productid}`,true); 
14
+
15
+            if(resData.isError){
16
+                alert(resData.errorMsg.message);
17
+                return;
18
+            }
19
+    
20
+            let res = resData.response;
21
+                
22
+            res = JSON.parse(res.result);
23
+    
24
+            dataAcc = [...dataAcc,...res.slice(0, 4)];
25
+
26
+        }
27
+
28
+   
29
+
30
+        shuffleArray(dataAcc);
31
+        console.log(dataAcc);
32
+        let html = '';
33
+       for(let i=0;i<dataAcc.length;i++){
34
+        html += getCardHTML({...dataAcc[i],img:dataAcc[i].itemimageurl})
35
+       }
36
+
37
+       $('.slider-hero').html(html);
38
+       
39
+
40
+        console.log(ids);
41
+        initSlider();
42
+
43
+        $('.topproductbtn').click(function (e){
44
+            let productid = $(e.target).data('productid');
45
+            let itemid = $(e.target).data('itemid');
46
+            let name =  $(e.target).data('name');
47
+            debugger;
48
+            window.location.href = `/productdetails.html?productId=${productid}#itemid=${itemid}`;
49
+        });
50
+    }
51
+
52
+    function initSlider(){
53
+        $('.slider-hero').slick({
54
+            dots: false,
55
+            lazyLoad: 'ondemand',
56
+            // autoplay: true,
57
+            // autoplaySpeed: 1000,
58
+            slidesToShow: 4,
59
+            slidesToScroll: 1,
60
+            responsive: [
61
+                {
62
+                  breakpoint: 1024,
63
+                  settings: {
64
+                    slidesToShow: 3,
65
+                    slidesToScroll: 3,
66
+                    infinite: true,
67
+                  }
68
+                },
69
+                {
70
+                  breakpoint: 600,
71
+                  settings: {
72
+                    slidesToShow: 2,
73
+                    slidesToScroll: 2
74
+                  }
75
+                },
76
+                {
77
+                  breakpoint: 480,
78
+                  settings: {
79
+                    slidesToShow: 1,
80
+                    slidesToScroll: 1
81
+                  }
82
+                },
83
+                {
84
+                    breakpoint: 1199,
85
+                    settings: {
86
+                        slidesToShow: 5,
87
+                        slidesToScroll: 1,
88
+                    }
89
+                },
90
+                {
91
+                    breakpoint: 991,
92
+                    settings: {
93
+                        slidesToShow: 3,
94
+                        slidesToScroll: 1,
95
+                    }
96
+                },
97
+                {
98
+                    breakpoint: 767,
99
+                    settings: {
100
+                        slidesToShow: 3,
101
+                        slidesToScroll: 1,
102
+                    }
103
+                },
104
+                {
105
+                    breakpoint: 575,
106
+                    settings: {
107
+                        autoplay: true,
108
+                        slidesToShow: 3,
109
+                    }
110
+                }
111
+                // You can unslick at a given breakpoint now by adding:
112
+                // settings: "unslick"
113
+                // instead of a settings object
114
+            ]
115
+        });
116
+
117
+        $(".slick-prev").addClass("btn text-white");
118
+        $(".slick-next").addClass("btn text-white");
119
+        $(".slick-prev").html("←");
120
+        $(".slick-next").html("→")
121
+    }
122
+    function getCardHTML({itemname,img,sku,itemid,productid}){
123
+        let defaultImg = img ? imgServerNameBuild(img): `./dist/assets/imgs/nophoto.png`;
124
+        return ` <div class="card h-100 mx-1 text-center bg-gray-4 border-0">
125
+        <div class="card-body h-100">
126
+            <div class="d-flex flex-column h-100 justify-content-between">
127
+                <img src="${defaultImg}" class="w-100"/>
128
+                <p class="mb-0 fs-7 py-2">${itemname}</p>
129
+                <p class="fw-600 text-primary mb-0 topproductbtn" data-name="${itemname}" data-sku="${sku}" data-productid="${productid}" data-itemid="${itemid}">Buy Now</p>
130
+            </div>
131
+        </div>
132
+    </div>`;
133
+        return ` <div class="card h-100 mx-1 text-center bg-gray-4 border-0 top_sell">
134
+        <div class="card-body">
135
+            <img src="${defaultImg}" class="w-100"/>
136
+            <p class="mb-0 fs-7 py-2">${itemname}</p>
137
+             <p class="fw-600 text-primary mb-0" data-sku="${sku}" data-productid="${productid}" data-itemid="${itemid}">Buy Now</p>
138
+             
139
+        </div>
140
+    </div>`;
141
+    }
142
+
143
+    function getProductIdService(){
144
+        return new Promise(async (reslove,reject)=>{
145
+            let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
146
+           if(resData.isError){
147
+                alert(resData.errorMsg.message);
148
+                return;
149
+            }
150
+
151
+            let res = resData.response;
152
+                
153
+            res = JSON.parse(res.result);
154
+
155
+          
156
+            let resultItem = [];
157
+
158
+            for(let i=0;i<res.length;i++){
159
+                if(resultItem.length == 2) break;
160
+                if(res[i].productname.includes('RAM ORA')||res[i].productname.includes('SSD ORA')){
161
+                    resultItem.push(res[i]);
162
+                  
163
+                }
164
+            }
165
+          
166
+            return reslove(resultItem)
167
+
168
+        });
169
+    }
170
+
171
+    
172
+
173
+    init();
174
+
175
+    
176
+}
177
+
178
+indexInit();

+ 2
- 0
dist/js/jquery.min.js
File diff suppressed because it is too large
View File


+ 23
- 0
dist/js/json.js View File

@@ -0,0 +1,23 @@
1
+let product_detail = [
2
+  {
3
+    Name:"RAM",
4
+    Types:{
5
+        ProductType:"ORA",
6
+        ProductName:"DDR4 DESKTOP Memory",
7
+        ProductDesc:"ORA, Desktop RAM",
8
+        ProductSize:"16GB DDR4, 3200 Mhz",
9
+        ProductImage:"",
10
+        Product_features:{
11
+            memorysize:"32GB Kit (2 x 16GB)",
12
+            Frequency:"DDR5-6000 MT/s",
13
+            timing:"40-40-40-76 (XMP 6000MT/s)",
14
+            performance:"XMP 3.0",
15
+            warranty:"5 years",
16
+            intel:"Intel Z690 certificated",
17
+            productdesign:"Copper-aluminum composite heat spreaders with nano carbon coating to keep performance",
18
+            industrialStandards:"Comply with industrial standard JEDEC DDR5",
19
+            support:"RGB Fusion 2.0 Supported",
20
+        }
21
+    }
22
+  }
23
+];

+ 14
- 0
dist/js/laptopmuti.js View File

@@ -0,0 +1,14 @@
1
+function callGallery(){
2
+    $('.PO_gallery_box').each(function(i,el){
3
+        $(el).click(function(e){
4
+            const src = $(e.target).attr('src');
5
+            $('.PO_gallery_display_img').attr('src',src)
6
+        });
7
+    });
8
+}
9
+
10
+function callMain(){
11
+    callGallery();
12
+}
13
+
14
+callMain();

+ 18
- 0
dist/js/localstorage/checkout.js View File

@@ -0,0 +1,18 @@
1
+const ALL_ADDRESS_LOCAL = 'ALL_ADDRESS_LOCAL';
2
+
3
+function setAddressLocal(payload){
4
+    let addressList = getAddressLocal();
5
+    addressList = addressList?addressList:[];
6
+    localStorage.setItem(ALL_ADDRESS_LOCAL,JSON.stringify({...addressList,...payload}))
7
+}
8
+
9
+function getAddressLocal(){
10
+    let res =  localStorage.getItem(ALL_ADDRESS_LOCAL)
11
+    if(!res) return null;
12
+
13
+    return JSON.parse(res);
14
+}
15
+
16
+function removeAddressLocal(){
17
+    localStorage.removeItem(ALL_ADDRESS_LOCAL);
18
+}

+ 14
- 0
dist/js/localstorage/loginauthlocal.js View File

@@ -0,0 +1,14 @@
1
+const INIT_LOGIN_AUTH = 'INIT_LOGIN_AUTH';
2
+
3
+function setInitLoginLocal(){
4
+    localStorage.setItem(INIT_LOGIN_AUTH,true);
5
+}
6
+
7
+function getInitLoginLocal(){
8
+    return JSON.parse(localStorage.getItem(INIT_LOGIN_AUTH));
9
+}
10
+
11
+
12
+function removeInitLoginLocal(){
13
+    localStorage.setItem(INIT_LOGIN_AUTH,false);
14
+}

+ 1658
- 0
dist/js/main.js
File diff suppressed because it is too large
View File


+ 377
- 0
dist/js/myaccount/Address.js View File

@@ -0,0 +1,377 @@
1
+async function addressDetails() {
2
+
3
+  // const user_addr_num =$("#Profile_Phone_num").val();
4
+  getbillinginfoBind();
5
+  let addr_phone = $('#phonenumber');
6
+  let addr_addrline = $('#addressdes');
7
+  let addr_zip = $('#zipcode');
8
+
9
+  let stateArr = [];
10
+
11
+  function getCustomDropDownHTML({ cityid, cityname, countryid }) {
12
+    return ` <div class="bg-white stateoption px-2 border-bottom py-2 cursor-pointer" data-name="${cityname}" data-value="${cityid}">${cityname}</div>`;
13
+  }
14
+
15
+  function renderCustomStateDropdown(stateList) {
16
+    let html = ``;
17
+
18
+    let maxLen = stateList.length > 10 ? 10 : stateList.length
19
+    for (let i = 0; i < maxLen; i++) {
20
+      let currItem = stateList[i];
21
+      html += getCustomDropDownHTML(currItem);
22
+    }
23
+
24
+    $('.stateBox').html(html);
25
+
26
+    $('.stateoption').off().click(function (e) {
27
+ 
28
+      const name = $(e.target).data('name');
29
+      const id = $(e.target).data('value');
30
+      $('#state').val(name);
31
+      $('#state').attr('data-id', id);
32
+    })
33
+  }
34
+
35
+  function loadDropdownStateEvents() {
36
+    $('#state').off().focus(function () {
37
+      $('.stateBox').removeClass('d-none');
38
+      $(document).off('click').click(closeDrop);
39
+
40
+
41
+    })
42
+
43
+
44
+    $(document).off().click(closeDrop);
45
+
46
+    function closeDrop(e) {
47
+      let id = $(e.target).hasClass('stateoption');
48
+      if ($(e.target).attr('id') === 'state') return;
49
+      if (id) {
50
+        $('.stateBox').addClass('d-none');
51
+        $(document).off();
52
+      } else {
53
+        $('.stateBox').addClass('d-none');
54
+        $(document).off();
55
+      }
56
+
57
+    }
58
+
59
+    $('#state').keyup(debounce(function (event) {
60
+      onChangeState(event)
61
+    }));
62
+  }
63
+
64
+  function getbillinginfoBind() {
65
+    return new Promise(async (resolve, reject) => {
66
+      let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
67
+      console.log(cookieRes);
68
+      const { errorMsg, isError, response } =
69
+        await API_SERVICES_ACTIONS.getAPIService(
70
+          `apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`
71
+        );
72
+      let res = JSON.parse(response.result);
73
+
74
+      console.log(res);
75
+      res = res[res.length - 1];
76
+
77
+      addr_phone.val(res?.phonenumber);
78
+      $('#Profile_User_name').val(res?.organizationname)
79
+      $('#Profile_Phone_num').val(res?.phonenumber)
80
+      let Profileusername = $('#Profile_User_name').val()
81
+      let Profileuserphone = $('#Profile_Phone_num').val()
82
+      $('.overview_user_name').html(Profileusername);
83
+      $('.overview_user_phone').html(Profileuserphone);
84
+      if (res?.cityid == "0") {
85
+        $(".profile_Address").html(
86
+          `<div class=User_address><button class="btn btn-outline-primary create_address" type="button"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/></svg> ADD NEW ADDRESS</button></div>`
87
+        );
88
+
89
+        $(".address_edit").hide();
90
+        $(".create_address").on("click", function () {
91
+    
92
+          $(this).hide();
93
+          $('.saveaddress').hide()
94
+          $(".addresslist").show();
95
+          $(".Createaddress").show();
96
+          getCountryStateCurrency();
97
+        });
98
+        $('.Createaddress').off().on('click', async function () {
99
+          if (addr_zip.val() == "" || addr_addrline.val() == "") {
100
+            // toastr.error('Required Feilds are Empty!');
101
+            //  if(addr_phone.val() == '' || addr_phone.val().length <10){
102
+            //     addr_phone.addClass("is-invalid");
103
+            //  }
104
+            //  else{
105
+            //     addr_phone.removeClass("is-invalid");
106
+            //  }
107
+            if (addr_zip.val() == '' || addr_zip.val().length < 6) {
108
+              addr_zip.addClass("is-invalid");
109
+            }
110
+            else {
111
+              addr_zip.removeClass("is-invalid");
112
+            }
113
+            if (addr_addrline.val() == '') {
114
+              addr_addrline.addClass("is-invalid");
115
+            } else {
116
+              addr_addrline.removeClass("is-invalid");
117
+            }
118
+          }
119
+          else {
120
+            $(".addresslist").hide();
121
+            $(".profile_Address").show();
122
+            $(".address_edit").show();
123
+            $(".address_edit_cancel").hide();
124
+            await createBillingForm()
125
+            await getbillinginfoBind();
126
+          }
127
+
128
+        })
129
+      } else {
130
+        $(".profile_Address").html(
131
+          `<div class=User_address><address><p><strong class="">${res?.organizationname}</strong><p>${res?.addressline},${res?.cityname},${res?.zipcode}<p>Mobile: ${res?.phonenumber}</address></div>`
132
+        );
133
+        $('#state').val(res?.cityname)
134
+        $('#state').attr('data-id',res?.cityid);
135
+        $('#zipcode').val(res?.zipcode);
136
+        $('#addressdes').val(res?.addressline);
137
+      }
138
+      resolve();
139
+    });
140
+  } 
141
+
142
+
143
+  $(".address_edit").on("click", function () {
144
+    $(this).hide();
145
+    $(".profile_Address").hide();
146
+    $(".addresslist").show();
147
+    $(".address_edit_cancel").show();
148
+    getCountryStateCurrency();
149
+    getbillinginfoBind()
150
+  });
151
+
152
+  $(".address_edit_cancel").on("click", function () {
153
+    $(this).hide();
154
+    $(".addresslist").hide();
155
+    $(".profile_Address").show();
156
+    $(".address_edit").show();
157
+  });
158
+
159
+  $(".saveaddress")
160
+    .off("click")
161
+    .click(async function () {
162
+
163
+    
164
+      if (addr_zip.val() == "" || addr_addrline.val() == "") {
165
+        // toastr.error('Required Feilds are Empty!');
166
+        //  if(addr_phone.val() == '' || addr_phone.val().length <10){
167
+        //     addr_phone.addClass("is-invalid");
168
+        //  }
169
+        //  else{
170
+        //     addr_phone.removeClass("is-invalid");
171
+        //  }
172
+        if (addr_zip.val() == '' || addr_zip.val().length < 6) {
173
+          addr_zip.addClass("is-invalid");
174
+        }
175
+        else {
176
+          addr_zip.removeClass("is-invalid");
177
+        }
178
+        if (addr_addrline.val() == '') {
179
+          addr_addrline.addClass("is-invalid");
180
+        } else {
181
+          addr_addrline.removeClass("is-invalid");
182
+        }
183
+      }
184
+      else {
185
+        $(".addresslist").hide();
186
+        $(".profile_Address").show();
187
+        $(".address_edit").show();
188
+        $(".address_edit_cancel").hide();
189
+        $('.spinner-border').removeClass('d-none')
190
+        $('.saveaddress').find('span').addClass('d-none')
191
+        await AddresssaveForm();
192
+        $('.spinner-border').addClass('d-none')
193
+        $('.saveaddress').find('span').removeClass('d-none')
194
+        await getbillinginfoBind();
195
+      }
196
+
197
+    });
198
+
199
+    function onChangeState(e){
200
+      let userItem = e.target.value.toLowerCase();
201
+      let limit = 10;
202
+      let results = [];
203
+      let maxLen = stateArr.length > 10 ? 10 :stateArr.length;
204
+      
205
+      for(let i=0;i<stateArr.length;i++){
206
+          let currItem = stateArr[i];
207
+          let stateName = currItem.cityname.toLowerCase();
208
+          if(stateName.includes(userItem)){
209
+              results.push(currItem);
210
+              if(results.length>=10) break;
211
+          }
212
+      }
213
+      $('.stateBox').removeClass('d-none');
214
+      renderCustomStateDropdown(results);
215
+      loadDropdownStateEvents();
216
+
217
+
218
+  }
219
+
220
+  async function getCountryStateCurrency() {
221
+ 
222
+    const countryRes = await API_SERVICES_ACTIONS.getAPIService(
223
+      "apis/v4/bizgaze/integrations/anwiauth/getcountry"
224
+    );
225
+    if (countryRes.isError) {
226
+      alert("something went wrong");
227
+      console.log(countryRes);
228
+      return;
229
+    }
230
+    let countryData = JSON.parse(countryRes.response.result);
231
+
232
+    console.log(countryData, "country");
233
+
234
+    for (let i = 0; i < countryData.length; i++) {
235
+      if (countryData[i].countryname.toLowerCase() === "india") {
236
+        countryID = countryData[i].countryid;
237
+        countrynameData = countryData[i].countryname;
238
+        break;
239
+      }
240
+    }
241
+    const stateRes = await API_SERVICES_ACTIONS.getAPIService(
242
+      `apis/v4/bizgaze/integrations/anwiauth/getcities/countryid/${countryID}`
243
+    );
244
+
245
+    if (stateRes.isError) {
246
+      alert("something went wrong");
247
+      console.log(stateRes, "state");
248
+      return;
249
+    }
250
+
251
+    let stateData = JSON.parse(stateRes.response.result);
252
+
253
+    console.log(stateData, "state");
254
+    stateArr = stateData;
255
+    renderCustomStateDropdown(stateArr);
256
+    loadDropdownStateEvents();
257
+    const currencyRes = await API_SERVICES_ACTIONS.getAPIService(
258
+      "apis/v4/bizgaze/integrations/anwiauth/getcurrencies"
259
+    );
260
+
261
+    if (currencyRes.isError) {
262
+      alert("something went wrong");
263
+      console.log(currencyRes);
264
+      return;
265
+    }
266
+
267
+    let currencyData = JSON.parse(currencyRes.response.result);
268
+
269
+    console.log(currencyData, "currencyDatacurrencyDatacurrencyData");
270
+
271
+    for (let i = 0; i < currencyData.length; i++) {
272
+      const curr = currencyData[i];
273
+      if (curr.currencyname.toLowerCase().includes("india")) {
274
+        currencyid = curr.currencyid;
275
+      }
276
+    }
277
+  }
278
+
279
+  async function getCountryId() {
280
+    const countryRes = await API_SERVICES_ACTIONS.getAPIService(
281
+      "apis/v4/bizgaze/integrations/anwiauth/getcountry"
282
+    );
283
+
284
+    if (countryRes.isError) {
285
+      alert("something went wrong");
286
+      console.log(countryRes);
287
+      return;
288
+    }
289
+
290
+    let ctyId = 0;
291
+    let countryData = JSON.parse(countryRes.response.result);
292
+
293
+    console.log(countryData);
294
+
295
+    for (let i = 0; i < countryData.length; i++) {
296
+      if (countryData[i].countryname.toLowerCase() === "india") {
297
+        countryId = countryData[i].countryid;
298
+        ctyId = countryId;
299
+        countrynameData = countryData[i].countryname;
300
+        break;
301
+      }
302
+    }
303
+
304
+    return ctyId;
305
+  }
306
+
307
+  function createBillingForm() {
308
+
309
+    return new Promise(async (resolve, reject) => {
310
+      let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
311
+      let { userId, name } = cookieRes;
312
+      const ctyId = await getCountryId();
313
+      let stateId = $("#state").data('id');
314
+      let payload = {
315
+        cityid: stateId,
316
+        CityName: $(`[data-id="${stateId}"`).html(),
317
+        addressline1: $("#addressdes").val(),
318
+        OrganizationType: 2,
319
+        organizationname: name,
320
+        //"OrganizationId":,
321
+        ContactName: name,
322
+        ContactId: userId,
323
+        countryname: "india",
324
+        countryid: ctyId,
325
+        statename: $(`[data-id="${stateId}"`).html(),
326
+        phonenumber: $("#phonenumber").val(),
327
+        OrganizationId: userId,
328
+        currencyid: 2,
329
+        taxno: "0",
330
+        BillingInfoExists: false,
331
+        lobid: 0,
332
+        lobname: "IT Products",
333
+        gstindetailid: 0,
334
+        zipcode: $("#zipcode").val(),
335
+      };
336
+      const res = await API_SERVICES_ACTIONS.postAPIService(
337
+        "apis/v4/bizgaze/crm/address/savebillinginfo",
338
+        payload
339
+      );
340
+      // http://localhost:3088/apis/v4/bizgaze/crm/address/savebillinginfo
341
+      console.log(res);
342
+      resolve();
343
+    });
344
+  }
345
+
346
+  async function AddresssaveForm() {
347
+
348
+    let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
349
+    let { userId, name } = cookieRes;
350
+    const { errorMsg, isError, response } =
351
+      await API_SERVICES_ACTIONS.getAPIService(
352
+        `apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`
353
+      );
354
+    let resAnwi = JSON.parse(response.result);
355
+    console.log(resAnwi, "befores");
356
+    resAnwi = resAnwi[resAnwi.length - 1];
357
+    let stateId = parseInt($("#state").data('id'));
358
+    let payload = {
359
+      ...resAnwi,
360
+      phonenumber: $("#phonenumber").val(),
361
+      addressline1: $("#addressdes").val(),
362
+      zipcode: $("#zipcode").val(),
363
+      cityid: stateId,
364
+      CityName: $('#state').val(),
365
+      cityname: $('#state').val(),
366
+    };
367
+    console.log(payload, "addresssaave");
368
+    //
369
+    const res = await API_SERVICES_ACTIONS.postAPIService(
370
+      "apis/v4/bizgaze/crm/address/savebillinginfo",
371
+      payload
372
+    );
373
+    return new Promise((reslove, reject) => {
374
+      reslove(res);
375
+    });
376
+  }
377
+}

+ 10
- 0
dist/js/myaccount/Myaccount.js View File

@@ -0,0 +1,10 @@
1
+function initmyaccount(){
2
+    $('.my_account_page').removeClass('d-none')
3
+    myProfile();
4
+    supportTicketMain();
5
+    bindOrderDetails();   
6
+    wattantyFunction();
7
+    addressDetails()
8
+}
9
+
10
+checkValidAuth(initmyaccount,'./login.html')

+ 158
- 0
dist/js/myaccount/Profile.js View File

@@ -0,0 +1,158 @@
1
+function myProfile() {
2
+    
3
+    getbillinginfoBind()
4
+   async function getbillinginfoBind(){
5
+    let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
6
+    console.log(cookieRes);
7
+    const { errorMsg, isError, response } = await API_SERVICES_ACTIONS.getAPIService(
8
+      `apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`
9
+    );
10
+    let res = JSON.parse(response.result);
11
+   
12
+    console.log(res);
13
+    res = res[res.length - 1];
14
+   $('#Profile_User_name').val(res?.organizationname)
15
+  $('#Profile_Phone_num').val(res?.phonenumber)
16
+    let Profileusername =$('#Profile_User_name').val()
17
+    let Profileuserphone=$('#Profile_Phone_num').val()
18
+    $('.overview_user_name').html(Profileusername);
19
+    $('.overview_user_phone').html(Profileuserphone);
20
+    $(".profile_Address").html(`<div class=User_address><address><p><strong>${res?.organizationname}</strong><p>${res?.addressline},${res?.cityname}<br>${res?.statename},${res?.zipcode}<p>Mobile: ${res?.phonenumber}</address></div>`
21
+      );
22
+}
23
+    let countryId = null;   
24
+  $(".profile_edit").on("click", function () {
25
+    $(this).hide();
26
+    // $('.profile_save_btn,.profile_edit_cancel').removeClass('d-none')
27
+    $(".profile_save_btn,.profile_edit_cancel,.profile_info_label").show();
28
+    $(".profile_info").removeAttr("disabled").removeClass("cursor-notvalid");
29
+  });
30
+  $(".profile_edit_cancel").on("click", function () {
31
+    $(this).hide();
32
+    $(".profile_save_btn,.profile_info_label").hide();
33
+    $('#Profile_User_name').val('');
34
+    $('#Profile_Phone_num').val('');
35
+    getbillinginfoBind();
36
+    $(".profile_edit").show();
37
+    $(".profile_info").attr("disabled", "disabled").addClass("cursor-notvalid");
38
+  });
39
+  $(".pass_edit").on("click", function () {
40
+    $(this).hide();
41
+    $(".update_profile_pass,.pass_edit_cancel").show();
42
+    $(".profile_info_pass")
43
+      .removeAttr("disabled")
44
+      .removeClass("cursor-notvalid");
45
+  });
46
+  $(".pass_edit_cancel").on("click", function () {
47
+    $('#Profile_User_current_pass').val('');
48
+    $('#Profile_User_confirm_pass').val('');
49
+    $('#Profile_User_new_pass').val('');
50
+    $('#Profile_User_current_pass,#Profile_User_new_pass,#Profile_User_confirm_pass').removeClass('is-invalid')
51
+    // $('#Profile_User_new_pass').val().removeClass('is-invalid')
52
+    // $('#Profile_User_confirm_pass').val().removeClass('is-invalid')
53
+    $(this).hide();
54
+    $(".update_profile_pass").hide();
55
+    $(".pass_edit").show();
56
+    $(".profile_info_pass")
57
+      .attr("disabled", "disabled")
58
+      .addClass("cursor-notvalid");
59
+  });
60
+  $(".update_profile_pass").on("click", async function () {
61
+    let userEmail = window.localStorage.getItem("Useremail");
62
+    console.log(userEmail);
63
+    let port = SERVERNAME;
64
+    // let port = "http://localhost:3088";
65
+    let url = `${port}/account/getuserbyphoneormail/${userEmail}/${userEmail}`;
66
+    const config = {
67
+      url,
68
+      method: "get",
69
+    };
70
+
71
+
72
+    let response = await axios(config);
73
+    let usernameId = response.data.result.userName;
74
+    let UserNewpassword = $("#Profile_User_new_pass");
75
+    let usercurrentPass = $("#Profile_User_current_pass");
76
+    let userConfirmpass = $("#Profile_User_confirm_pass");
77
+    if (usercurrentPass.val() != "") {
78
+      $(usercurrentPass).removeClass("is-invalid");
79
+      if (UserNewpassword.val() && userConfirmpass.val() != "") {
80
+        if (UserNewpassword.val() == userConfirmpass.val()) {
81
+          console.log(usernameId);
82
+          const UpdatePassPayload = {
83
+            username: usernameId,
84
+            password: UserNewpassword.val(),
85
+            oldpassword: usercurrentPass.val(),
86
+          };
87
+          const update_passres = await postAPIService(
88
+            `hyperfusion/HypersfusionUpdatePassword`,
89
+            UpdatePassPayload
90
+          );
91
+          console.log(update_passres);
92
+          if (update_passres.data.errors != null) {
93
+            $(".profilepass_feedbackres")
94
+              .html(`<div class="alert alert-danger error_msg " role="alert" style="font-size: 12px;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.2646 3.41366C11.7212 3.15681 12.2788 3.15681 12.7354 3.41366L19.2354 7.06991C19.7077 7.33558 20 7.83536 20 8.37727V15.6227C20 16.1646 19.7077 16.6644 19.2354 16.9301L12.7354 20.5863C12.2788 20.8432 11.7212 20.8432 11.2646 20.5863L4.76461 16.9301C4.29229 16.6644 4 16.1646 4 15.6227V8.37727C4 7.83536 4.29229 7.33559 4.76461 7.06991L11.2646 3.41366Z" fill="#FF3A2E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 7.4C11 7.17909 11.1791 7 11.4 7H12.6C12.8209 7 13 7.17909 13 7.4V12.6C13 12.8209 12.8209 13 12.6 13H11.4C11.1791 13 11 12.8209 11 12.6V7.4Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16Z" fill="white"></path></svg>
95
+         <span class="error_msg_res">${update_passres.data.message}</a></span> 
96
+         
97
+         </div>`);
98
+            $(userConfirmpass).addClass("is-invalid");
99
+            $(UserNewpassword).removeClass("is-invalid");
100
+            $(userConfirmpass).removeClass("is-invalid");
101
+          } else {
102
+            $(".profilepass_feedbackres")
103
+              .html(`<div class="alert alert-success success_msg" role="alert" style="font-size: 12px;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check" viewBox="0 0 16 16">
104
+                <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/>
105
+              </svg>
106
+         <span class="success_msg_res">${update_passres.data.message}</a></span> 
107
+         </div>`);
108
+            usercurrentPass.val("");
109
+            UserNewpassword.val("");
110
+            userConfirmpass.val("");
111
+          }
112
+        } else {
113
+          $(UserNewpassword).addClass("is-invalid");
114
+          $(userConfirmpass).addClass("is-invalid");
115
+          return;
116
+        }
117
+      } else {
118
+        $(UserNewpassword).addClass("is-invalid");
119
+        $(userConfirmpass).addClass("is-invalid");
120
+        return;
121
+      }
122
+    } else {
123
+      $(usercurrentPass).addClass("is-invalid");
124
+      return;
125
+    }
126
+  });
127
+  $('.profile_save_btn').on('click',async function(){
128
+    await ProfilesaveForm();
129
+    $('.profile_edit_cancel').trigger('click')
130
+})
131
+  async function ProfilesaveForm() {
132
+
133
+    let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
134
+    let { userId, name } = cookieRes;
135
+    const { errorMsg, isError, response } =
136
+      await API_SERVICES_ACTIONS.getAPIService(
137
+        `apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`
138
+      );
139
+    let resAnwi = JSON.parse(response.result);
140
+    console.log(resAnwi, "previous profilesave");
141
+    resAnwi = resAnwi[resAnwi.length - 1];
142
+    let payload = {
143
+      ...resAnwi,
144
+      organizationname: $("#Profile_User_name").val(),
145
+      phonenumber: $("#Profile_Phone_num").val(),
146
+    };
147
+    console.log(payload, "profilesave");
148
+    //
149
+    const res = await API_SERVICES_ACTIONS.postAPIService(
150
+      "apis/v4/bizgaze/crm/address/savebillinginfo",
151
+      payload
152
+    );
153
+    return new Promise((reslove, reject) => {
154
+      reslove(res);
155
+      getbillinginfoBind();
156
+    });
157
+  }
158
+}

+ 158
- 0
dist/js/myaccount/myaccount_warrenty.js View File

@@ -0,0 +1,158 @@
1
+function wattantyFunction(){
2
+
3
+
4
+let order_card = `<div class=warranty_product><div class="py-3 warranty_productform"><div class=mb-3><label class=form-label for=Add_serial_number_inp>Enter Your Serial Number</label><input class=form-control id=Add_serial_number_inp  required><label class="form-label text-danger d-none error_serial_num" for=Add_serial_number_inp >Serial Number Not Found</label></div><div class=mb-3><label class=form-label for=Add_phonenumber_inp>Enter Your Phone Number</label> <input class=form-control id=Add_phonenumber_inp required><label class="text-danger d-none form-label error_phonenumber" for=Add_phonenumber_inp>Enter Valid Phone Number</label></div><div class=mb-3><label class=form-label for=Add_contactname_inp>Enter Your Contactname</label> <input class=form-control id=Add_contactname_inp required></div><div class="serial_submit text-end"><button class="btn btn-dark warranty_serialNumber_submit" type="button">Submit</button></div></div></div>`;
5
+
6
+$(".user_orders").append(order_card);
7
+$('.add_serialNum').click(function () {
8
+    $('.warranty_productform').removeClass('d-none');
9
+    $(this).addClass('d-none');
10
+});
11
+$('.warranty_serialNumber_submit').click(async function () {
12
+    let serial_no_inp = $('#Add_serial_number_inp').val();
13
+    let phonenumber_inp = $('#Add_phonenumber_inp').val();
14
+    let contactname_inp = $('#Add_contactname_inp').val();
15
+    if(serial_no_inp && phonenumber_inp !=''){
16
+        $('.error_serial_num').addClass('d-none');
17
+         $('.error_phonenumber').addClass('d-none');
18
+         $('#Add_serial_number_inp').removeClass('border-danger')    
19
+         $('#Add_phonenumber_inp').removeClass('border-danger');
20
+    let port = SERVERNAME;
21
+
22
+    let url = `${port}/apis/v4/Bizgaze/integrations/products/warrantyservice/serialno/${serial_no_inp}`;
23
+    console.log(url);
24
+    // const STAT = `05b2f2ca510344968c65e1ebf49a5595`
25
+    const config = {
26
+        url,
27
+        method: "get",
28
+        headers: {
29
+            Authorization: `stat ${STAT}`,
30
+        },
31
+    };
32
+
33
+    let response = await axios(config);
34
+
35
+    console.log(response)
36
+    let product_res = response.data.result
37
+    if (product_res != null) {
38
+        let warrenty_res = JSON.parse(product_res);
39
+        let new_arr = [warrenty_res];
40
+        $.each(new_arr, function (key, value) {
41
+            console.log(value)
42
+            if (response.data.result == '[]') {
43
+                // Command: toastr["error"]("Serial number not found !")
44
+                // toasterOpts();
45
+                // $('#Add_serial_number_inp').addClass('border-danger');
46
+                // $('.error_serial_num').removeClass('d-none')
47
+                $(".user_Warranty_details").html(`<div class="Serial_numb_notfound text-danger text-center"><h2>Serial Number Not Found !</h2>`);
48
+                // $('.warranty_productform').addClass('d-none');
49
+                // $('.add_serialNum').removeClass('d-none');
50
+                return;
51
+            }
52
+            else {
53
+                const warrantyEnabled = value[0].warrantyenabled;
54
+                if (warrantyEnabled == false) {
55
+                    let phonenumber_updated = Number(phonenumber_inp)
56
+                    $('.user_Warranty_details').removeClass('d-none')
57
+                    //  let  strDate =  new Date(value[0].purchasedate).toISOString().slice(0, 10);
58
+                     let Warrentypayload =
59
+                     {
60
+                         "sku": value[0].sku,
61
+                         "serialno": serial_no_inp,
62
+                         "phonenumber": phonenumber_updated,
63
+                         "contactname": contactname_inp,
64
+                         "warrantyfromdate": value[0].purchasedate
65
+                    }
66
+                     warrentyService(Warrentypayload);
67
+                }
68
+                else {
69
+                    // let warrantySerialnumber =$('.serial_no_warrantynumber').text()
70
+                    let warrenty_date =value[0].warrantytodate
71
+                        let userwarrenty_product = `<div class="border-3 border-start my-3 order-cards ps-4 rounded-0" id='order-cards'> <div class="col-md-12 "><b>Warranty For :</b> ${value[0].itemname}</div><div class="row align-items-center"> <div class=col-md-12>  <div class="col-md-6 my-2"><span>Serail NO :</span> <span class="fs-9 text-secondary serial_no_warrantynumber">${value[0].serialno}</span> </div><div class="col-md-6 my-2"><span> Warrenty Expiry Date :</span> <span class=" fs-9 text-secondary rounded-2 warrenty_date">${value[0].warrantytodate}</span> </div><div class="my-2 col-md-6"><span> Warranty Start Date :</span> <span class="fs-9 text-secondary purchase_date">${value[0].warrantyfromdate}</span> </div><div class="col-md-6 my-2"> <span> Warranty Status : </span><span class="bg-success btn fs-9 is_warranty_enable py-0 text-white"> ${value[0].warrantyenabled}</span> </div></div></div></div>`;
72
+                       let is_warranty_enable=value[0].warrantyenabled
73
+               
74
+                       $(".user_Warranty_details").html(userwarrenty_product);
75
+                       if(is_warranty_enable == true){
76
+                       $('.is_warranty_enable').text('Activated')
77
+                       }
78
+                       else{
79
+                        $('.is_warranty_enable').text('Not Activated')
80
+                       }
81
+                       if(warrenty_date == "" ){
82
+                        $('.warrenty_date').addClass('d-none')
83
+                       }
84
+                       else{
85
+                        $('.warrenty_date').removeClass('d-none')
86
+                       }
87
+                       $('#Add_serial_number_inp').addClass('border-success')
88
+                       $('.error_serial_num').addClass('d-none')
89
+                        // $('.warranty_productform').addClass('d-none');
90
+                        $('.add_serialNum').removeClass('d-none');
91
+                        //Command: toastr["success"]("Warranty already enabled !")
92
+                   
93
+                }
94
+                
95
+            }
96
+
97
+        })
98
+        
99
+
100
+    }
101
+}
102
+else{
103
+    if(serial_no_inp == ''){
104
+        $('#Add_serial_number_inp').addClass('border-danger')
105
+        $('.error_serial_num').removeClass('d-none')
106
+    }
107
+    else if(phonenumber_inp == ''){
108
+        $('#Add_phonenumber_inp').addClass('border-danger');
109
+        $('.error_phonenumber').removeClass('d-none');
110
+        
111
+
112
+    }
113
+}
114
+})
115
+async function warrentyService(Warrentypayload) {
116
+    //       let d = new Date();
117
+    //     // let  strDate = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
118
+    //     let  strDate =  new Date().toISOString().slice(0, 10)
119
+    // console.log(strDate)
120
+   
121
+    const res = await postAPIServiceWarranty(`apis/v4/bizgaze/transact/items/savewarrantyasync`, Warrentypayload);
122
+    
123
+    console.log(res)
124
+  if (res.data.status == 2) {
125
+    //   $('.warranty_productform').addClass('d-none');
126
+    //   $('.add_serialNum').removeClass('d-none');
127
+        // Command: toastr["warning"](res.data.message)
128
+        // toasterOpts();
129
+        $(".user_Warranty_details").html(`<div class="text-warning text-center"><h2>No Serial number found / Product not Delivered</h2>`);
130
+
131
+    }
132
+    else if(res.data.status == '0'){
133
+        // $('.warranty_productform').addClass('d-none');
134
+        // $('.add_serialNum').removeClass('d-none');
135
+        // Command: toastr["success"](res.data.message);
136
+        // toasterOpts();
137
+        $(".user_Warranty_details").html(`<div class="text-danger text-center"><h2>${res.data.message}</h2>`);
138
+ }
139
+}
140
+// function toasterOpts() {
141
+//     toastr.options = {
142
+//         "closeButton": true,
143
+//         "debug": false,
144
+//         "newestOnTop": true,
145
+//         "progressBar": true,
146
+//         "positionClass": "toast-top-center",
147
+//         "preventDuplicates": true,
148
+//         "showDuration": "300",
149
+//         "hideDuration": "1000",
150
+//         "timeOut": "3000",
151
+//         "extendedTimeOut": "1000",
152
+//         "showEasing": "swing",
153
+//         "hideEasing": "linear",
154
+//         "showMethod": "fadeIn",
155
+//         "hideMethod": "fadeOut"
156
+//     }
157
+// }
158
+}

+ 171
- 0
dist/js/myaccount/orderdetails.js View File

@@ -0,0 +1,171 @@
1
+async function bindOrderDetails() {
2
+  let user_number = $('.User_phoneum').text();
3
+  // validatesession()
4
+
5
+  let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
6
+  let { userId } = cookieRes;
7
+  //let userId = '106631380000048';
8
+
9
+  console.log(cookieRes);
10
+  let port = SERVERNAME;
11
+  // let port = "http://localhost:3088";
12
+  let url = `${port}/apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/${userId}`;
13
+  // /apis/v4/bizgaze/integrations/products/salesorderdetailsbyorgid/phonenumber/
14
+  // https://anwi.bizgaze.app/apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/{organizationid}
15
+  const config = {
16
+    url,
17
+    method: "get",
18
+    headers: {
19
+      'Authorization': `stat ${STAT} `,
20
+      'Content-Type': 'application/json'
21
+    }
22
+  };
23
+
24
+  let res = await axios(config);
25
+  if (res.data.result == '[]' || res.data.result === null) {
26
+    $(".user_order_details").append(`<div><h6 class="text-center">No orders Found</h6></div>`);
27
+    return;
28
+  }
29
+  const orderDetailsres = JSON.parse(res.data.result);
30
+  console.log(orderDetailsres,"order");
31
+  let new_arrr = orderDetailsres;
32
+  console.log(new_arrr);
33
+  $(".user_order_details").html(``)
34
+  console.log('hello')
35
+  let user_order_details = ``;
36
+  let order_itemTotal = '';
37
+  let order_netTotal = '';
38
+  let order_quantity = '';
39
+  let order_taxAmount = '';
40
+
41
+  for (let i = 0; i < new_arrr.length; i++) {
42
+    let current = new_arrr[i]
43
+    console.log(current);
44
+    let updatedCurent_total = current.nettotal.toLocaleString()
45
+    order_itemTotal = current.itemtotal;
46
+    order_netTotal = current.nettotal;
47
+    order_quantity = current.Quantity;
48
+    order_taxAmount = current.taxamount;
49
+    user_order_details += `<div href="" class="order_details_main_container">
50
+  <div class="border-3 mb-3 card">
51
+    <div class="text-dark card-body px-0 pt-0">
52
+      <div class="d-none">
53
+        <span class="order_itemTotal">${order_itemTotal}</span>
54
+        <span class="order_netTotal">${order_netTotal}</span>
55
+        <span class="order_tax">${order_taxAmount}</span>
56
+        <span class="order_qty">${order_quantity}</span>
57
+      </div>
58
+      <div class="bg-gray-4 p-2 m-0 border-bottom">
59
+      <p class="m-0 fw-600 text-secondary">ORDER NO: <span class="text-blue fs-9 serial_no serial_no_btn "><u class="cursor-pointer">${current.OrderNo}</u></span>
60
+      </p>
61
+    </div>
62
+      <div class="bg-gray-4 p-2 row g-0">
63
+        <div class="col-md-6 ">
64
+          <div class="d-flex justify-content-between align-items-center">
65
+            <div>
66
+              <p class="mb-1">ORDER PLACED</p>
67
+              <p class="mb-1 fw-500 order_date">${current.OrderDate}</p>
68
+            </div>
69
+            <div>
70
+              <p class="mb-1"> TOTAL</p>
71
+              <p class="mb-1 fw-500 Current_netTotal"> ₹${updatedCurent_total}</p>
72
+            </div>
73
+            <div>
74
+              <p class="mb-1">Delivered TO </p>
75
+              <p class="mb-1 fw-500">${current.OrganizationName}</p>
76
+            </div>
77
+          </div>
78
+        </div>
79
+        <div class="col-md-4 ms-auto">
80
+       
81
+          <div class="d-flex justify-content-between">
82
+         <div>
83
+         <p class="mb-1 text-info fw-500"> View order details </p>
84
+         
85
+         </div>
86
+           <div>
87
+           <p class="mb-0 text-info fw-500 text-center">Invoice</p>
88
+           <p class="mb-1 fw-500 d-flex gap-2 pt-1">
89
+          <span data-invoiceid="${current.invoiceid}" class="invoicedownload w-100 cursor-pointer bg-white rounded p-1 d-flex align-items-center justify-content-around">  <i  class="fa-solid fa-file-invoice p-1 "></i></span>
90
+         
91
+           </p>
92
+           </div>
93
+          </div>
94
+        </div>
95
+      </div>
96
+      <div class="border-0 card rounded-0 order-cards py-3">
97
+        <div class="d-flex flex-wrap px-2 align-items-center text-center">
98
+          <div class="col-md-3">
99
+            <img src="https://appassets.bizgaze.app/${current.imageurl}" class="img-fluid w-75 order_item_name" />
100
+          </div>
101
+          <div class="col-md-9">
102
+            <div class="row align-items-center">
103
+              <div class="col-md-8">
104
+                <div class="order_item_name">${current.itemname}</div>
105
+              </div>
106
+              <div class="col-md-4">
107
+                <button type="button" class="btn btn-sm rounded order_details_btn  bg-gradient-anwi-outline py-0 mb-3" onClick="event.preventDefault();">Track Package</button>
108
+                <button type="button" class="btn btn-sm btn-light rounded order_details_btn py-0 mb-3 shadow-sm" onClick="event.preventDefault();">Cancel Item</button>
109
+              </div>
110
+            </div>
111
+          </div>
112
+        </div>
113
+      </div>
114
+    </div>
115
+  </div>
116
+</div>`;
117
+  }
118
+  $(".user_order_details").append(user_order_details);
119
+  $('.serial_no_btn').click(function () {
120
+    // order_details_main_container
121
+    let current_serial_no = $(this).text();
122
+    //  window.localStorage.setItem('orderDate',current_order_date);
123
+    //  window.localStorage.setItem('orderSerialno',current_serial_no);
124
+    //  window.localStorage.setItem('Userphonenumber',user_number);
125
+    // $(this).attr('href', `./orderdetails.html#${current_serial_no}`);
126
+
127
+    window.location.href = `/orderdetails.html#${current_serial_no}`;
128
+  });
129
+
130
+  $('.invoicedownload').off('click').click(async function (e){
131
+    let invoiceId = $(this).data('invoiceid');
132
+    console.log(invoiceId);
133
+    $(this).html(`<div style="width:15px;height:15px" class="spinner-border" role="status">
134
+    <span class="sr-only">Loading...</span>
135
+  </div>`)
136
+    let res = await API_SERVICES_ACTIONS.postAPIService(`apis/v4/unibase/platform/templates/generatetemplatepdf/printprovideruniquekey/Bizgaze_Extension_Transact_Transact_PrintProvider_InvoicePrint/pkid/${invoiceId}`);
137
+
138
+    if(res.isError){
139
+      toasterHelper(`error`,err.errorMsg,`toast-top-right`);
140
+      return;
141
+    }
142
+
143
+    res=JSON.parse(res.response.result);
144
+    let {FilePath:fileLink} = res;
145
+    let link = buildLinkWithServerName(fileLink);
146
+    console.log(link);
147
+    window.open(link, "_blank");
148
+
149
+    $(this).html(`<i  class="fa-solid fa-file-invoice p-1 "></i>`)
150
+    
151
+  });
152
+}
153
+function toasterOpts() {
154
+  toastr.options = {
155
+    "closeButton": true,
156
+    "debug": false,
157
+    "newestOnTop": true,
158
+    "progressBar": true,
159
+    "positionClass": "toast-top-center",
160
+    "preventDuplicates": true,
161
+    "onclick": null,
162
+    "showDuration": "300",
163
+    "hideDuration": "1000",
164
+    "timeOut": "5000",
165
+    "extendedTimeOut": "1000",
166
+    "showEasing": "swing",
167
+    "hideEasing": "linear",
168
+    "showMethod": "fadeIn",
169
+    "hideMethod": "fadeOut"
170
+  }
171
+}

+ 79
- 0
dist/js/myaccount/support_tickets.js View File

@@ -0,0 +1,79 @@
1
+function supportTicketMain() {
2
+    // https://qa.anwisystems.com/apis/v4/anwisystems/integrations/products/getticket/contactid/{contactid}
3
+    let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
4
+    let { userId } = cookieRes;
5
+    init()
6
+    function init() {
7
+        getTickets();
8
+    };
9
+
10
+    async function getTickets() {
11
+        let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/products/getticket/contactid/${userId}`);
12
+
13
+        if (res.isError) {
14
+            toasterHelper("error", res.errorMsg);
15
+            return;
16
+        }
17
+
18
+        res = JSON.parse(res.response.result);
19
+
20
+        if (!res.length) {
21
+            $('.nosupportticket').removeClass('d-none');
22
+            $('.headersupportlist').addClass('d-none');
23
+            return;
24
+        } else {
25
+            $('.nosupportticket').addClass('d-none');
26
+            $('.headersupportlist').removeClass('d-none');
27
+        }
28
+
29
+        let supportHTMLTicketList = '';
30
+
31
+        debugger
32
+        for (let i = 0; i < res.length; i++) {
33
+            supportHTMLTicketList += getTicketHTML(res[i]);
34
+        }
35
+
36
+        $('.support-list-container').html(supportHTMLTicketList);
37
+
38
+
39
+        console.log(res, "support");
40
+
41
+
42
+    }
43
+
44
+
45
+    function getTicketHTML(ticket) {
46
+        let color = '';
47
+        let prioityName = ticket[`Priority Name`];
48
+        if (prioityName.toLowerCase() === 'low') {
49
+            color = 'info';
50
+        } else if (prioityName.toLowerCase() === 'high') {
51
+            color = 'danger';
52
+        } else {
53
+            color = 'warning';
54
+        }
55
+
56
+
57
+
58
+        //<a href="#" data-bs-toggle="modal" data-bs-target="#supportmodalticket" class="supportlistview d-block
59
+        return `<a href="supportticket.html?ticketno=${ticket[`ticketno`]}"  class="supportlistview d-block    bg-gradient-anwi-outline btn-sm btn "><div class="p-2"><div class="card p-2">
60
+    <div class="row ">
61
+    <div class="col-sm-3">
62
+        ${ticket[`Raised Date`]}
63
+    </div>
64
+    <div class="col-sm-3">
65
+
66
+        ${ticket[`ticketno`]}
67
+    </div>
68
+    <div class="col-sm-3 text-center">
69
+   
70
+        ${ticket[`Stage Name`]}
71
+    </div>
72
+    <div class="col-sm-3 text-center">
73
+      
74
+       <span class="badge  badge-${color} text-bg-${color}">${prioityName}</span>
75
+    </div>
76
+</div>
77
+    </div></div> </a>`;
78
+    }
79
+}

+ 644
- 0
dist/js/navbar.js View File

@@ -0,0 +1,644 @@
1
+navINIT();
2
+
3
+function navINIT() {
4
+
5
+
6
+
7
+   
8
+
9
+    async function getAllProdouctsIds(){
10
+        let res = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/products/getallproducts',true);
11
+        if(res.isError){
12
+            alert(res.errorMsg);
13
+            return;
14
+        }
15
+
16
+        res = JSON.parse(res.response.result);
17
+    
18
+        for(let i=0;i<res.length;i++){
19
+            let curr = res[i];
20
+            let productname = curr.productname;
21
+            let id = curr.productid;
22
+            
23
+            // ACCESSORIES
24
+            switch (productname) {
25
+                case 'Zeno Sleekbook':
26
+                    appendIdNav('zenosleekbook',id);
27
+                    break;
28
+                case 'Zeno Dualbook':
29
+                    appendIdNav('zenodualbook',id);
30
+                    break;
31
+                case "FYRO Flagship":
32
+                    appendIdNav('fyroflagship',id);
33
+                    break;
34
+                case "AIO Fyro":
35
+                    // appendIdNav('fyroaio',id);
36
+                    break;
37
+                case "AIO Zeno":
38
+                    // appendIdNav('zenoaio',id);
39
+                default:
40
+                    break;
41
+            }
42
+        }
43
+    }
44
+
45
+    function appendIdNav(className,id){
46
+        let html = $(`.${className}`).attr('href');
47
+        const pattern = /{[^}]+}/g;
48
+        const replacedString = html.replace(pattern, id);
49
+        $(`.${className}`).parents('.nav-tab-show').removeClass('d-none')
50
+        $(`.${className}`).attr('href',replacedString);
51
+    }
52
+    
53
+    if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){
54
+        loadCart();
55
+        
56
+    }
57
+   
58
+    function loadHelper(src = './dist/js/utils/helpers.js'){
59
+        if ($(`script[src="${src}"]`).length > 0) {
60
+          return new Promise((resolve) => resolve());
61
+        }
62
+        return new Promise(function (resolve, reject) {
63
+            var s;
64
+            s = document.createElement('script');
65
+            s.src = src;
66
+            s.onload = resolve;
67
+            s.onerror = reject;
68
+            document.head.appendChild(s);
69
+        });
70
+    }
71
+    async function loadCart(){
72
+
73
+        if(!window.location.href.includes('services/paymentmethod.html')){
74
+            let files = ['./dist/js/shoppingcart/addtocart.js'];
75
+            await loadHelper();
76
+            for(let i=0;i<files.length;i++){
77
+                if ($(`script[src="${files[i]}"]`).length > 0) {
78
+                    continue;
79
+                }
80
+                try {
81
+            
82
+                    await loadHelper(files[i])
83
+                    console.log("done");
84
+    
85
+                } catch (error) {
86
+                    console.log(error);
87
+                    return;
88
+                }
89
+            }
90
+        }
91
+
92
+         setLengthCart();
93
+         getAllProdouctsIds();
94
+        //console.log("hello");
95
+
96
+        
97
+        
98
+      
99
+    }
100
+    let URLNAMENAV = window.location.href;
101
+    const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation')|| URLNAMENAV.includes('services/paymentmethod.html');
102
+   
103
+    let nav_html = `
104
+<header class="header-area section-padding-1 transparent-bar" ${isTransparent ?'style="background:#000"' :''}>
105
+            <div class="header-large-device">
106
+                <div class="header-bottom sticky-bar">
107
+                    <div class="container">
108
+                        <div class="header-bottom-flex">
109
+                            <div class="logo-menu-wrap d-flex gap-5">
110
+                                <div class="logo">
111
+                                    <a href="../index.html">
112
+                                        <img src="/dist/assets/imgs/anwi-logo-2.png" alt="logo" class="nav_logo">
113
+                                    </a>
114
+                                </div>
115
+                                <div class="main-menu menu-lh-1 main-menu-padding-1">
116
+                                    <nav>
117
+                                        <ul class="mb-0 p-0">
118
+                                        <li class="hover_tab_1">
119
+                                            <a href="/laptops.html" class="satoshi_font">LAPTOPS
120
+                                                <svg style="width:18px;height:15px" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
121
+                                                    <path fill="#fff" d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"/>
122
+                                                </svg>
123
+                                            </a>
124
+                                        <ul class="pb-3" style="list-style:none">
125
+                                            <li>
126
+                                                <div class="d-flex gap-4r pt-4 pb-2 align-items-center justify-content-center">
127
+                                                    <div class="position-relative nav-tab-show  d-none">
128
+                                                        <a class="h-100 nav_items zenosleekbook" href="/laptopdetails.html?Zeno#productId={106633230000029}">
129
+                                                            <div  style="" class="align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
130
+                                                                <img src="https://appassets.bizgaze.app/_files/documents/663/cfed4b55-9c51-48a8-969f-2d443fdb9bac/15%20inch.png" alt="ora img" class="nav_imgs"/>
131
+                                                                <p  class="mb-0 text-center text-dark w-100">Zeno Sleekbook </p>
132
+                                                            </div>
133
+                                                        </a>
134
+                                                    </div>
135
+                                                    <div class="position-relative nav-tab-show  d-none">
136
+                                                        <a class="h-100 nav_items fyroflagship" href="/laptopdetails.html?Fyro#productId={106633230000031}">
137
+                                                            <div  style="" class=" align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
138
+                                                                <img src="https://appassets.bizgaze.app/_files/documents/663/39d3ec7f-c692-4489-a808-60d79c0ffcb1/17%20inches.png" alt="ora img" class="nav_imgs"/>
139
+                                                                <p  class="mb-0 text-center text-dark w-100">Fyro Flagship </p>
140
+                                                            </div>
141
+                                                        </a>
142
+                                                    </div>
143
+                                                    <div class="position-relative nav-tab-show  d-none">
144
+                                                    <a class="h-100 nav_items zenodualbook" href="/laptopdetails.html?Zeno#productId={106633230000030}">
145
+                                                        <div  style="" class=" align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
146
+                                                            <img src="https://appassets.bizgaze.app/_files/documents/663/3feb2ad5-7451-4cd5-ba7a-f6695e1fa708/zeno_dualbook.png" alt="ora img" class="nav_imgs"/>
147
+                                                            <p  class="mb-0 text-center text-dark w-100">Zeno Dual Book </p>
148
+                                                        </div>
149
+                                                    </a>
150
+                                                </div>
151
+                                                </div>
152
+                                            </li>
153
+                                        </ul>
154
+                                    </li>
155
+                                    <li class="hover_tab_2">
156
+                                        <a href="/allinones.html" class="satoshi_font">ALL IN ONES
157
+                                            <svg style="width:18px;height:15px;" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
158
+                                                <path fill="#fff" d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"/>
159
+                                            </svg>
160
+                                        </a>
161
+                                    <ul class="pb-3" style="list-style:none">
162
+                                        <li>
163
+                                            <div class="d-flex gap-4r pt-4 pb-2 align-items-center justify-content-center">
164
+                                                <div class="position-relative  nav-tab-show">
165
+                                                    <a class="h-100 nav_items zenoaio" href="/laptopdetails.html?AIO Zeno#productId=106633230000026#itemid=106633240000112">
166
+                                                        <div  style="" class="align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
167
+                                                            <img src="https://appassets.bizgaze.app/_files/documents/663/42bdf033-74fb-45ca-b180-9bff7a0dca86/zeno_aio.png" alt="ora img" class="nav_imgs"/>
168
+                                                            <p  class="mb-0 text-center text-dark w-100">Zeno All in ones</p>
169
+                                                        </div>
170
+                                                    </a>
171
+                                                </div>
172
+                                                <div class="position-relative  nav-tab-show">
173
+                                                    <a class="h-100 nav_items" href="/laptopdetails.html?AIO Fyro#productId=106633230000027#itemid=106633240000126">
174
+                                                        <div  style="" class=" align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
175
+                                                            <img src="https://appassets.bizgaze.app/_files/documents/663/39e90b38-3d04-4f88-bff4-2b6feb3eb54c/Asset%204@2x.png" alt="ora img" class="nav_imgs"/>
176
+                                                            <p  class="mb-0 text-center text-dark w-100">Fyro All in ones </p>
177
+                                                        </div>
178
+                                                    </a>
179
+                                                </div>
180
+                                            </div>
181
+                                        </li>
182
+                                    </ul>
183
+                                    </li>
184
+                                    <li class="hover_tab_2">
185
+                                        <a href="/accessories.html" class="satoshi_font">ACCESSORIES
186
+                                            <svg style="width:18px;height:15px;" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
187
+                                                <path fill="#fff" d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"/>
188
+                                            </svg>
189
+                                        </a>
190
+                                        <ul class="pb-3" style="list-style:none">
191
+                                        <li>
192
+                                            <div class="d-flex gap-4r pt-4 pb-2 align-items-center justify-content-center">
193
+                                                <div class="position-relative  nav-tab-show_acc">
194
+                                                    <a class="h-100 nav_items" href="/storageproducts.html">
195
+                                                        <div  style="" class="align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
196
+                                                            <img src="https://appassets.bizgaze.app/_files/documents/663/c3ea1dde-6c5b-4169-922b-97c297c55737/Ora4%20SSD%202TB%20copy.png" alt="ora img" class="nav_imgs"/>
197
+                                                            <p  class="mb-0 text-center text-dark w-100">Storage</p>
198
+                                                        </div>
199
+                                                    </a>
200
+                                                </div>
201
+                                                <div class="position-relative  nav-tab-show_acc">
202
+                                                    <a class="h-100 nav_items" href="/ramproducts.html">
203
+                                                        <div  style="" class=" align-items-center cursor-pointer d-flex flex-column h-100 justify-content-center rounded-3">
204
+                                                            <img src="https://appassets.bizgaze.app/_files/documents/663/9d71f7a4-bf31-4d3c-b120-5de610321dc2/image_2023_05_05T09_12_42_081Z.png" alt="ora img" class="nav_imgs"/>
205
+                                                            <p  class="mb-0 text-center text-dark w-100">Memory </p>
206
+                                                        </div>
207
+                                                    </a>
208
+                                                </div>
209
+                                            </div>
210
+                                        </li>
211
+                                    </ul>
212
+                                    </li>
213
+                                    <!-- 
214
+                                    <li><a href="./storageproducts.html" class="satoshi_font">STORAGE</a></li>
215
+                                    <li><a href="./ramproducts.html" class="satoshi_font">MEMORY</a></li> -->
216
+                                            <li><a href="./support.html" class="satoshi_font">SUPPORT</a></li>
217
+                                            <li><a href="./press.html" class="satoshi_font">PRESS</a></li>
218
+                                            <li><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
219
+                                            <li class="d-none"><a href="#" class="satoshi_font product_data" item_id="106633220000002">ACCESSORIES</a></li>
220
+                                        </ul>
221
+                                    </nav>
222
+                                </div>
223
+                            </div>
224
+                            <div class="header-action-wrap header-action-flex header-action-width header-action-mrg-1">
225
+                                <div class="same-style">
226
+                                <a href="/myaccount.html" class="my_avatar">
227
+                                <svg class="user-icon" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
228
+                                    <g clip-path="url(#clip0)">
229
+                                        <path d="M21.4443 24.3665H19.4443V19.3235C19.4435 18.5395 19.1317 17.7879 18.5774 17.2335C18.023 16.6791 17.2713 16.3673 16.4873 16.3665H8.40134C7.61733 16.3673 6.86567 16.6791 6.3113 17.2335C5.75693 17.7879 5.44513 18.5395 5.44434 19.3235V24.3665H3.44434V19.3235C3.44592 18.0093 3.96869 16.7494 4.89796 15.8201C5.82723 14.8909 7.08714 14.3681 8.40134 14.3665H16.4873C17.8015 14.3681 19.0614 14.8909 19.9907 15.8201C20.92 16.7494 21.4427 18.0093 21.4443 19.3235V24.3665Z" fill="#fff"/>
230
+                                        <path d="M12.4443 12.3665C11.2577 12.3665 10.0976 12.0146 9.11092 11.3553C8.12422 10.696 7.35519 9.75898 6.90106 8.66262C6.44694 7.56626 6.32812 6.35986 6.55963 5.19598C6.79114 4.03209 7.36258 2.96299 8.2017 2.12388C9.04081 1.28476 10.1099 0.713318 11.2738 0.481807C12.4377 0.250296 13.6441 0.369116 14.7404 0.823242C15.8368 1.27737 16.7739 2.0464 17.4332 3.0331C18.0924 4.01979 18.4443 5.17983 18.4443 6.36652C18.4427 7.95733 17.8101 9.48253 16.6852 10.6074C15.5604 11.7323 14.0352 12.3649 12.4443 12.3665ZM12.4443 2.36652C11.6532 2.36652 10.8799 2.60111 10.2221 3.04064C9.56426 3.48017 9.05157 4.10488 8.74882 4.83579C8.44607 5.56669 8.36686 6.37096 8.5212 7.14688C8.67554 7.9228 9.0565 8.63554 9.61591 9.19495C10.1753 9.75436 10.8881 10.1353 11.664 10.2897C12.4399 10.444 13.2442 10.3648 13.9751 10.062C14.706 9.75929 15.3307 9.2466 15.7702 8.5888C16.2097 7.931 16.4443 7.15764 16.4443 6.36652C16.4443 5.30565 16.0229 4.28824 15.2728 3.53809C14.5226 2.78795 13.5052 2.36652 12.4443 2.36652Z" fill="#fff"/>
231
+                                    </g>
232
+                                    <defs>
233
+                                        <clipPath id="clip0">
234
+                                            <rect width="24" height="24" fill="white" transform="translate(0.444336 0.366516)"/>
235
+                                        </clipPath>
236
+                                    </defs>
237
+                                </svg>
238
+                                </a>
239
+                                </div>
240
+                                <div class="same-style header-cart">
241
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html">
242
+                                <svg class="cart_icon" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
243
+                                    <g clip-path="url(#clip0)">
244
+                                        <path d="M24.4941 3.36652H4.73614L4.69414 3.01552C4.60819 2.28593 4.25753 1.61325 3.70863 1.12499C3.15974 0.636739 2.45077 0.366858 1.71614 0.366516L0.494141 0.366516V2.36652H1.71614C1.96107 2.36655 2.19748 2.45647 2.38051 2.61923C2.56355 2.78199 2.68048 3.00626 2.70914 3.24952L4.29414 16.7175C4.38009 17.4471 4.73076 18.1198 5.27965 18.608C5.82855 19.0963 6.53751 19.3662 7.27214 19.3665H20.4941V17.3665H7.27214C7.02705 17.3665 6.79052 17.2764 6.60747 17.1134C6.42441 16.9505 6.30757 16.7259 6.27914 16.4825L6.14814 15.3665H22.3301L24.4941 3.36652ZM20.6581 13.3665H5.91314L4.97214 5.36652H22.1011L20.6581 13.3665Z" fill="#fff"/>
245
+                                        <path d="M7.49414 24.3665C8.59871 24.3665 9.49414 23.4711 9.49414 22.3665C9.49414 21.2619 8.59871 20.3665 7.49414 20.3665C6.38957 20.3665 5.49414 21.2619 5.49414 22.3665C5.49414 23.4711 6.38957 24.3665 7.49414 24.3665Z" fill="#fff"/>
246
+                                        <path d="M17.4941 24.3665C18.5987 24.3665 19.4941 23.4711 19.4941 22.3665C19.4941 21.2619 18.5987 20.3665 17.4941 20.3665C16.3896 20.3665 15.4941 21.2619 15.4941 22.3665C15.4941 23.4711 16.3896 24.3665 17.4941 24.3665Z" fill="#fff"/>
247
+                                    </g>
248
+                                    <defs>
249
+                                        <clipPath id="clip0">
250
+                                            <rect width="24" height="24" fill="white" transform="translate(0.494141 0.366516)"/>
251
+                                        </clipPath>
252
+                                    </defs>
253
+                                </svg>
254
+                                <span class="position-absolute cartnumcount d-none" >0</span>
255
+                                </a>
256
+                                </div>
257
+                            </div>
258
+                        </div>
259
+                    </div>
260
+                    <div class="sub_nav_container bg-white d-none border-top" style="
261
+                        box-shadow: 0 6PX 16PX 0 #1919190f;
262
+                        -webkit-backdrop-filter: blur(6px);
263
+                        backdrop-filter: blur(6px);">
264
+                        <div class="container">
265
+                            <div class="d-flex justify-content-between">
266
+                           <span class="d-flex align-items-center font-weight-600">
267
+                           <h2 class="titleproductnav sub_nav_item me-3 fs-9"></h2></span>
268
+                                <ul class="d-flex mb-0 py-3  justify-content-center align-items-center" style="list-style:none;">
269
+                                    <li>
270
+                                        <a data-overview="#${window.location.href.includes('Zeno')?'overview_data_zeno':'overview_data_fyro'}" class="sub_nav_item overview me-3 fs-9">Overview</a>
271
+                                    </li>
272
+                                    <li>
273
+                                        <a data-spec="true" class="sub_nav_item me-3 fs-9 overviewspecs">Specifications</a>
274
+                                    </li>
275
+                                    <li>
276
+                                        <a href="#"  class="font-12p btn btn-dark button_dark sub_nav_item text-white">Buy now</a>
277
+                                    </li>
278
+                                </ul>
279
+                            </div>
280
+                        </div>
281
+                    </div>
282
+                </div>
283
+            </div>
284
+            <div class="header-small-device header-small-ptb sticky-bar py-md-2 py-2 bg-white">
285
+                <div class="container-fluid px-4">
286
+                    <div class="row align-items-center">
287
+                        <div class="col-6 header-action-wrap">
288
+                            <div class="d-flex">
289
+                                <div class="same-style header-info">
290
+                                    <button class="mobile-menu-button-active">
291
+                                        <span class="info-width-1"></span>
292
+                                        <span class="info-width-2"></span>
293
+                                        <span class="info-width-3"></span>
294
+                                    </button>
295
+                                </div>
296
+                                <div class="mobile-logo mobile-logo-width ps-3">
297
+                                    <a href="../index.html">
298
+                                        <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-50">
299
+                                    </a>
300
+                                </div>
301
+                            </div>
302
+                        </div>
303
+                        <div class="col-6">
304
+                            <div class="header-action-wrap header-action-flex header-action-mrg-1">
305
+                                <div class="same-style">
306
+                                <a href="/myaccount.html" class="my_avatar">
307
+                                    <svg class="user-icon" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656">
308
+                                    <g clip-path="url(#clip0)">
309
+                                        <path d="M21.4443 24.3665H19.4443V19.3235C19.4435 18.5395 19.1317 17.7879 18.5774 17.2335C18.023 16.6791 17.2713 16.3673 16.4873 16.3665H8.40134C7.61733 16.3673 6.86567 16.6791 6.3113 17.2335C5.75693 17.7879 5.44513 18.5395 5.44434 19.3235V24.3665H3.44434V19.3235C3.44592 18.0093 3.96869 16.7494 4.89796 15.8201C5.82723 14.8909 7.08714 14.3681 8.40134 14.3665H16.4873C17.8015 14.3681 19.0614 14.8909 19.9907 15.8201C20.92 16.7494 21.4427 18.0093 21.4443 19.3235V24.3665Z" fill="#fff"/>
310
+                                        <path d="M12.4443 12.3665C11.2577 12.3665 10.0976 12.0146 9.11092 11.3553C8.12422 10.696 7.35519 9.75898 6.90106 8.66262C6.44694 7.56626 6.32812 6.35986 6.55963 5.19598C6.79114 4.03209 7.36258 2.96299 8.2017 2.12388C9.04081 1.28476 10.1099 0.713318 11.2738 0.481807C12.4377 0.250296 13.6441 0.369116 14.7404 0.823242C15.8368 1.27737 16.7739 2.0464 17.4332 3.0331C18.0924 4.01979 18.4443 5.17983 18.4443 6.36652C18.4427 7.95733 17.8101 9.48253 16.6852 10.6074C15.5604 11.7323 14.0352 12.3649 12.4443 12.3665ZM12.4443 2.36652C11.6532 2.36652 10.8799 2.60111 10.2221 3.04064C9.56426 3.48017 9.05157 4.10488 8.74882 4.83579C8.44607 5.56669 8.36686 6.37096 8.5212 7.14688C8.67554 7.9228 9.0565 8.63554 9.61591 9.19495C10.1753 9.75436 10.8881 10.1353 11.664 10.2897C12.4399 10.444 13.2442 10.3648 13.9751 10.062C14.706 9.75929 15.3307 9.2466 15.7702 8.5888C16.2097 7.931 16.4443 7.15764 16.4443 6.36652C16.4443 5.30565 16.0229 4.28824 15.2728 3.53809C14.5226 2.78795 13.5052 2.36652 12.4443 2.36652Z" fill="#fff"/>
311
+                                    </g>
312
+                                    <defs>
313
+                                        <clipPath id="clip0">
314
+                                            <rect width="24" height="24" fill="white" transform="translate(0.444336 0.366516)"/>
315
+                                        </clipPath>
316
+                                    </defs>
317
+                                </svg>
318
+                                </a>
319
+                                </div>
320
+                                <div class="same-style header-cart ms-3">
321
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html">
322
+                                <svg class="cart_icon icon" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656">
323
+                                    <g clip-path="url(#clip0)">
324
+                                        <path d="M24.4941 3.36652H4.73614L4.69414 3.01552C4.60819 2.28593 4.25753 1.61325 3.70863 1.12499C3.15974 0.636739 2.45077 0.366858 1.71614 0.366516L0.494141 0.366516V2.36652H1.71614C1.96107 2.36655 2.19748 2.45647 2.38051 2.61923C2.56355 2.78199 2.68048 3.00626 2.70914 3.24952L4.29414 16.7175C4.38009 17.4471 4.73076 18.1198 5.27965 18.608C5.82855 19.0963 6.53751 19.3662 7.27214 19.3665H20.4941V17.3665H7.27214C7.02705 17.3665 6.79052 17.2764 6.60747 17.1134C6.42441 16.9505 6.30757 16.7259 6.27914 16.4825L6.14814 15.3665H22.3301L24.4941 3.36652ZM20.6581 13.3665H5.91314L4.97214 5.36652H22.1011L20.6581 13.3665Z" fill="#fff"/>
325
+                                        <path d="M7.49414 24.3665C8.59871 24.3665 9.49414 23.4711 9.49414 22.3665C9.49414 21.2619 8.59871 20.3665 7.49414 20.3665C6.38957 20.3665 5.49414 21.2619 5.49414 22.3665C5.49414 23.4711 6.38957 24.3665 7.49414 24.3665Z" fill="#fff"/>
326
+                                        <path d="M17.4941 24.3665C18.5987 24.3665 19.4941 23.4711 19.4941 22.3665C19.4941 21.2619 18.5987 20.3665 17.4941 20.3665C16.3896 20.3665 15.4941 21.2619 15.4941 22.3665C15.4941 23.4711 16.3896 24.3665 17.4941 24.3665Z" fill="#fff"/>
327
+                                    </g>
328
+                                    <defs>
329
+                                        <clipPath id="clip0">
330
+                                            <rect width="24" height="24" fill="white" transform="translate(0.494141 0.366516)"/>
331
+                                        </clipPath>
332
+                                    </defs>
333
+                                </svg>
334
+                                <span class="position-absolute cartnumcount d-none"  style="top:-27%;right:-80%">0</span>
335
+                                </a>
336
+                                </div>
337
+                            </div>
338
+                        </div>
339
+                    </div>
340
+                </div>
341
+            </div>
342
+        </header>
343
+        <!-- Mobile menu start -->
344
+        <div class="mobile-menu-active clickalbe-sidebar-wrapper-style-1">
345
+            <div class="clickalbe-sidebar-wrap">
346
+            <div class="row pb-2 border-bottom">
347
+                <div class="col-6">
348
+                    <div class="mobile-logo mobile-logo-width">
349
+                        <a href="../index.html">
350
+                            <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-75">
351
+                        </a>
352
+                    </div>
353
+                </div>
354
+                <div class="col-6 text-end pe-4">
355
+                    <a class="sidebar-close"><i class="fa-solid fa-xmark"></i></a>
356
+                </div>
357
+            </div>
358
+               
359
+                <div class="mobile-menu-content-area sidebar-content-100-percent pt-3">
360
+                    <div class="mobile-search d-none">
361
+                        <form class="search-form" action="#">
362
+                            <input type="text" placeholder="Search here…" class="satoshi_font">
363
+                            <button class="button-search"><i class="fa-solid fa-magnifying-glass"></i></button>
364
+                        </form>
365
+                    </div>
366
+                    <div class="clickable-mainmenu-wrap clickable-mainmenu-style1">
367
+                        <nav>
368
+                            <ul class="pl-0">
369
+                          
370
+
371
+                                
372
+                                <li class="expandlinav">
373
+                                <div class="d-flex justify-content-between explandlinavnameparent">
374
+                                    <span class="explandlinavname">LAPTOP</span><span data-name="laptops.html" class=" viewall_li">+</span>
375
+                                </div>
376
+                               <div class="content-expandlinav pt-2 d-none">
377
+                               <a class="h-100 p-1 zenosleekbook" href="/laptopdetails.html?Zeno#productId={106633230000029}">
378
+                                    <div class="ps-2">
379
+                                    Zeno Sleekbook
380
+                                    </div>
381
+                                </a>
382
+                                <a class="h-100 p-1 fyroflagship" href="/laptopdetails.html?Fyro#productId={106633230000031}">
383
+                                    <div class="ps-2">Fyro Flagship  </div>
384
+                                    </a>
385
+                                    <a class="h-100 p-1 zenodualbook" href="/laptopdetails.html?Zeno#productId={106633230000030}">
386
+                                    <div class="ps-2">Zeno Dual Book   </div>
387
+                                    </a>
388
+                               </div>
389
+                                </li>
390
+                                <li class="expandlinav">
391
+                                <div class="d-flex justify-content-between explandlinavnameparent">
392
+                                    <span class="explandlinavname">ALL IN ONES </span><span  data-name="allinones.html" class="viewall_li">+</span>
393
+                                </div>
394
+                               <div class="content-expandlinav pt-2 d-none">
395
+                               <a class="h-100 p-1" href="/laptopdetails.html?AIO Zeno#productId=106633230000026#itemid=106633240000112">
396
+                                    <div class="ps-2">
397
+                                    Zeno All In One
398
+                                    </div>
399
+                                    </a>
400
+                                    <a class="h-100 p-1" href="/laptopdetails.html?AIO Fyro#productId=106633230000027#itemid=106633240000126">
401
+                                    <div class="ps-2">
402
+                                    Fyro All iIn One
403
+                                    </div>
404
+                                    </a>
405
+                               </div>
406
+                                </li>
407
+                                <li class="expandlinav">
408
+                                 <div class="d-flex justify-content-between explandlinavnameparent">
409
+                                   <span class="explandlinavname">ACCESSORIES </span><span  data-name="allinones.html" class="viewall_li">+</span>
410
+                                  </div>
411
+                                     <div class="content-expandlinav pt-2 d-none">
412
+                                    <a class="h-100 p-1" href="/storageproducts.html">
413
+                                     <div class="ps-2">
414
+                                      Storage
415
+                                     </div>
416
+                                      </a>
417
+                                   <a class="h-100 p-1" href="/ramproducts.html">
418
+                                  <div class="ps-2">
419
+                                   Memory
420
+                                   </div>
421
+                                  </a>
422
+                                 </div>
423
+                                 </li>
424
+                                 <!-- 
425
+                                 <li class=""><a href="./ramproducts.html" class="satoshi_font">MEMORY</a></li>
426
+                                 <li class=""><a href="./storageproducts.html" class="satoshi_font">STORAGE</a></li> -->
427
+                                <li class=""><a href="./support.html" class="satoshi_font" >SUPPORT</a></li>
428
+                                <li class=""><a href="./press.html" class="satoshi_font">PRESS</a></li>
429
+                                <li class=""><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
430
+                            </ul>
431
+                        </nav>
432
+                    </div>
433
+                    <div class="mobile-curr-lang-wrap d-none">
434
+                        <div class="single-mobile-curr-lang">
435
+                            <a class="mobile-language-active" href="#">Language <i class="icofont-simple-down"></i></a>
436
+                            <div class="lang-curr-dropdown lang-dropdown-active">
437
+                                <ul>
438
+                                    <li><a href="#">English</a></li>
439
+                                    <li><a href="#">Spanish</a></li>
440
+                                    <li><a href="#">Hindi </a></li>
441
+                                </ul>
442
+                            </div>
443
+                        </div>
444
+                    </div>
445
+                    <div class="aside-contact-info d-none">
446
+                        <ul>
447
+                            <li><i class="icofont-clock-time"></i>Monday - Friday: 9:00 - 19:00</li>
448
+                            <li><i class="icofont-envelope"></i>Info@example.com</li>
449
+                            <li><i class="icofont-stock-mobile"></i>(+55) 254. 254. 254</li>
450
+                            <li><i class="icofont-home"></i>Helios Tower 75 Tam Trinh Hoang - Ha Noi - Viet Nam</li>
451
+                        </ul>
452
+                    </div>
453
+                </div>
454
+            </div>
455
+        </div>`;
456
+    $("#navbar-head").html(nav_html);
457
+
458
+    $('.explandlinavnameparent').click(function (e){
459
+
460
+        let parentElement = $(e.target).parents('.expandlinav');
461
+        if($(parentElement).find('.content-expandlinav').hasClass('d-none')){
462
+            const name = $(parentElement).find('.viewall_li').data('name');
463
+            $(parentElement).find('.viewall_li').html(`<a href="${name}">view all</a>`);
464
+            $(parentElement).find('.content-expandlinav').removeClass('d-none');
465
+           }else{
466
+            $(parentElement).find('.viewall_li').html('+');
467
+            $(parentElement).find('.content-expandlinav').addClass('d-none');
468
+           }
469
+       
470
+       console.log($(e.target));
471
+        
472
+    });
473
+
474
+    let width = $(window).width();
475
+    $(".menu-negative-mrg2,.menu-negative-mrg3,.menu-negative-mrg4").css("width", width);
476
+    let ele_page = $("body").hasClass("product_pg");
477
+    if (ele_page == true) {
478
+        $(".header-area").removeClass("bg-white");
479
+        $(".main-menu").find("nav ul li a").addClass("text-white");
480
+        $(".header-bottom.sticky-bar").removeClass("sticky-bar");
481
+        let src = `../dist/assets/imgs/anwi-logo-2.png`;
482
+        $(".logo-menu-wrap").find(".logo a img").attr("src", src);
483
+        $(".main-body").find("iframe").attr("width", width);
484
+        if (width <= 575 && width >= 390) {
485
+            $(".main-body").find("iframe").attr({
486
+                width: width,
487
+                height: 236,
488
+            })
489
+        } else if (width <= 390 && width >= 270) {
490
+            $(".main-body").find("iframe").attr({
491
+                width: width,
492
+                height: 210,
493
+            });
494
+        } else if (width <= 998 && width > 575) {
495
+            $(".main-body").find("iframe").attr({
496
+                width: width,
497
+                height: 530,
498
+            });
499
+        } else if (width <= 2720 && width > 2300) {
500
+            $(".main-body").find("iframe").attr({
501
+                width: width,
502
+                height: 1440,
503
+            });
504
+        } else if(width <= 2300 && width > 1921){
505
+            $(".main-body").find("iframe").attr({
506
+                width: width,
507
+                height: 1132,
508
+            });
509
+        }
510
+        else if(width <= 1920 && width > 1620){
511
+            $(".main-body").find("iframe").attr({
512
+                width: width,
513
+                height: 1083,
514
+            });
515
+        }else {
516
+            $(".main-body").find("iframe").attr({
517
+                width: width,
518
+                height: 861,
519
+            });
520
+        }
521
+    }
522
+
523
+
524
+    $("a.ram_data").click(function () {
525
+        let item_id = $(this).attr("accessories_id");
526
+        let loc_path = '/products.html'
527
+        if (window.location.pathname.includes(loc_path)) {
528
+            window.location.href = `?itemid=${item_id}`
529
+        }
530
+        else {
531
+            window.location.href = `/products.html#itemid=${item_id}`;
532
+        }
533
+    })
534
+
535
+
536
+    // $(".main-menu nav ul").find("li").each(function () {
537
+    //     var current = window.location.pathname;
538
+    //     var $this = $(this).find("a");
539
+    //     if (current != "/") {
540
+    //         if ($this.attr('href').indexOf(current) !== -1) {
541
+    //             $(this).addClass('active_nav');
542
+    //         }
543
+    //     }
544
+
545
+    // })
546
+
547
+    // destroy localstorage data
548
+    let loc_path = '/productdetails.html';
549
+    if (window.location.pathname.includes(loc_path) === false) {
550
+        localStorage.removeItem("product_data");
551
+        localStorage.removeItem("top_data")
552
+    }
553
+    let loc_path1 = '/productcatloguedetails.html';
554
+    if (window.location.pathname.includes(loc_path1) === false) {
555
+        localStorage.removeItem("product_catlogue_obj");
556
+    }
557
+
558
+    //services pages links and sources
559
+
560
+   
561
+
562
+
563
+
564
+    let $body_pg = $("body").hasClass("services_page");
565
+    let $hm_pg = "../index.html";
566
+    let $nav_img = "../dist/assets/imgs/anwi-logo-1.png";
567
+    let $footer_img = "../dist/assets/imgs/anwi-logo-2.png";
568
+    let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png";
569
+    let $about_pg = $("body").hasClass("about_page");
570
+    if($about_pg == true){
571
+        $(".main-menu").find("nav ul li a").addClass("text-dark");
572
+        let img_src = `./dist/assets/imgs/anwi-logo-1.png`;
573
+        $(".logo-menu-wrap").find(".logo a img").attr("src",img_src);
574
+        $(".header-bottom").addClass("sticky-bar stick");
575
+        $("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
576
+    }
577
+    if ($body_pg == true) {
578
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a").attr("href", $hm_pg);
579
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a img").attr("src", $nav_img);
580
+        $(".mobile-logo").find("a").attr("href", $hm_pg);
581
+        $(".mobile-logo").find(".logo a img").attr("src", $nav_img);
582
+        $("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
583
+        $(".main-menu").find("nav ul").find("li a").each(function () {
584
+            $(this).addClass("text-dark")
585
+            $(".header-bottom").addClass("sticky-bar stick");
586
+            let $arc = $(this).attr("href");
587
+            let $spcial_char = $arc.includes("./");
588
+            if ($spcial_char === true) {
589
+                let $refarence = `.${$arc}`
590
+                $(this).attr("href", $refarence);
591
+            }
592
+            
593
+        });
594
+        $(".same-style").find("a").each(function () {
595
+            let $arc1 = $(this).attr("href");
596
+            let $spcial_char1 = $arc1.includes("./");
597
+            if ($spcial_char1 === true) {
598
+                let $refarence1 = `.${$arc1}`
599
+                $(this).attr("href", $refarence1);
600
+            }
601
+        })
602
+        $(".tab-content").find("img").each(function(){
603
+            let $img_src = $(this).attr("src");
604
+            let $img_src1 = $img_src.includes("./");
605
+            if ($img_src1 === true) {
606
+                let $refarenceimg1 = `.${$img_src}`;
607
+                $(this).attr("src", $refarenceimg1);
608
+            }
609
+        });
610
+        $(".clickable-mainmenu-wrap").find("nav ul").find("li a").each(function () {
611
+            let $arc_mbil = $(this).attr("href");
612
+            let $spcial_char_mbil = $arc_mbil.includes("./");
613
+            if ($spcial_char_mbil === true) {
614
+                let $refarence_mbil = `.${$arc_mbil}`
615
+                $(this).attr("href", $refarence_mbil);
616
+            }
617
+        });
618
+    }
619
+
620
+    setTimeout(()=>{
621
+        if(width<=600){
622
+            $('.same-style').find('svg path').attr('fill','#000');
623
+        }
624
+    },300);
625
+
626
+    // overview 
627
+
628
+    $('.overview').click(function (e){
629
+        let name = $(e.target).data('overview');
630
+        
631
+        document.querySelector(name)?.scrollIntoView({
632
+            behavior: 'smooth'
633
+        });
634
+        
635
+    });
636
+
637
+    $('.overviewspecs').click(function (e){
638
+        document.querySelector('#specification_data')?.scrollIntoView({
639
+            behavior: 'smooth'
640
+        });
641
+    });
642
+
643
+    
644
+}

+ 487
- 0
dist/js/navbar2.js View File

@@ -0,0 +1,487 @@
1
+navINIT();
2
+
3
+function navINIT() {
4
+    if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){
5
+        loadCart();
6
+    }
7
+   
8
+    function loadHelper(src = './dist/js/utils/helpers.js'){
9
+        if ($(`script[src="${src}"]`).length > 0) {
10
+          return new Promise((resolve) => resolve());
11
+        }
12
+        return new Promise(function (resolve, reject) {
13
+            var s;
14
+            s = document.createElement('script');
15
+            s.src = src;
16
+            s.onload = resolve;
17
+            s.onerror = reject;
18
+            document.head.appendChild(s);
19
+        });
20
+    }
21
+    async function loadCart(){
22
+
23
+        if(!window.location.href.includes('services/paymentmethod.html')){
24
+            let files = ['./dist/js/shoppingcart/addtocart.js'];
25
+            await loadHelper();
26
+            for(let i=0;i<files.length;i++){
27
+                if ($(`script[src="${files[i]}"]`).length > 0) {
28
+                    continue;
29
+                }
30
+                try {
31
+            
32
+                    await loadHelper(files[i])
33
+                    console.log("done");
34
+    
35
+                } catch (error) {
36
+                    console.log(error);
37
+                    return;
38
+                }
39
+            }
40
+        }
41
+
42
+         setLengthCart();
43
+        //console.log("hello");
44
+
45
+        
46
+        
47
+      
48
+    }
49
+    let URLNAMENAV = window.location.href;
50
+    const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation')|| URLNAMENAV.includes('services/paymentmethod.html');
51
+    let nav_html = `
52
+<header class="header-area section-padding-1 transparent-bar" ${isTransparent ?'style="background:#0A1039"' :''}>
53
+            <div class="header-large-device">
54
+                <div class="header-bottom sticky-bar">
55
+                    <div class="container">
56
+                        <div class="header-bottom-flex">
57
+                            <div class="logo-menu-wrap d-flex">
58
+                                <div class="logo">
59
+                                    <a href="../index.html">
60
+                                        <img src="/dist/assets/imgs/anwi-logo-2.png" alt="logo" class="w-50">
61
+                                    </a>
62
+                                </div>
63
+                                <div class="main-menu menu-lh-1 main-menu-padding-1">
64
+                                    <nav>
65
+                                        <ul class="mb-0 p-0">
66
+                                        <li class="hover_tab_1"><a href="./storageproducts.html" class="satoshi_font">STORAGE</a>
67
+                                        <ul class="py-3 px-3 rounded-bottom shadow">
68
+                                            <li class="d-flex">
69
+                                                <ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
70
+                                                    <li class="nav-item">
71
+                                                        <a class="nav-link active text-dark" data-bs-toggle="tab" href="#ora3">ORA 3</a>
72
+                                                    </li>
73
+                                                    <li class="nav-item">
74
+                                                        <a class="nav-link text-dark" data-bs-toggle="tab" href="#ora4">ORA 4</a>
75
+                                                    </li>
76
+                                                </ul>
77
+                                                <ul class="nav w-500">
78
+                                                    <li>
79
+                                                    <div class="tab-content">
80
+                                                        <div id="ora3" class="container tab-pane active">
81
+                                                            <div class="row">
82
+                                                                <div class="col-4">
83
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
84
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
85
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 512GB</p>
86
+                                                                    </div>
87
+                                                                </div>
88
+                                                                <div class="col-4">
89
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
90
+                                                                         <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
91
+                                                                         <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 1TB</p>
92
+                                                                    </div>
93
+                                                                </div>
94
+                                                                <div class="col-4">
95
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
96
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
97
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 2TB</p>
98
+                                                                    </div>
99
+                                                                </div>
100
+                                                            </div>
101
+                                                        </div>
102
+                                                        <div id="ora4" class="container tab-pane fade">
103
+                                                            <div class="row">
104
+                                                                <div class="col-4">
105
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
106
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
107
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 512GB</p>
108
+                                                                    </div>
109
+                                                                </div>
110
+                                                                <div class="col-4">
111
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
112
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
113
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 1TB</p>
114
+                                                                    </div>
115
+                                                                </div>
116
+                                                                <div class="col-4">
117
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
118
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
119
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 2TB</p>
120
+                                                                    </div>
121
+                                                                </div>
122
+                                                            </div>
123
+                                                        </div>
124
+                                                  </div>
125
+                                                </li>
126
+                                                </ul>
127
+                                            </li>
128
+                                        </ul>
129
+                                    </li>
130
+                                    <li class="hover_tab_2"><a href="./ramproducts.html" class="satoshi_font">MEMORY</a>
131
+                                    <ul class="py-3 px-3 rounded-bottom shadow">
132
+                                    <li class="d-flex">
133
+                                        <ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
134
+                                            <li class="nav-item">
135
+                                                <a class="nav-link active text-dark" data-bs-toggle="tab" href="#laptop">Laptop</a>
136
+                                            </li>
137
+                                            <li class="nav-item">
138
+                                                <a class="nav-link text-dark" data-bs-toggle="tab" href="#desktop">Desktop</a>
139
+                                            </li>
140
+                                        </ul>
141
+                                        <ul class="nav w-500">
142
+                                            <li>
143
+                                            <div class="tab-content">
144
+                                                <div id="laptop" class="container tab-pane active">
145
+                                                    <div class="row">
146
+                                                        <div class="col-4">
147
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
148
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_laptop.png" alt="ora img" class=""/>
149
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 8GB DDR5</p>
150
+                                                            </div>
151
+                                                        </div>
152
+                                                        <div class="col-4">
153
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
154
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
155
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 16GB DDR5</p>
156
+                                                            </div>
157
+                                                        </div>
158
+                                                        <div class="col-4 ">
159
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
160
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
161
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 32GB DDR5</p>
162
+                                                            </div>
163
+                                                        </div>
164
+                                                    </div>
165
+                                                </div>
166
+                                                <div id="desktop" class="container tab-pane fade">
167
+                                                    <div class="row">
168
+                                                        <div class="col-4">
169
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
170
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
171
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 8GB DDR4</p>
172
+                                                            </div>
173
+                                                        </div>
174
+                                                        <div class="col-4">
175
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
176
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
177
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 16GB DDR4</p>
178
+                                                            </div>
179
+                                                        </div>
180
+                                                        <div class="col-4">
181
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
182
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
183
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 32GB DDR4</p>
184
+                                                            </div>
185
+                                                        </div>
186
+                                                    </div>
187
+                                                </div>
188
+                                          </div>
189
+                                        </li>
190
+                                        </ul>
191
+                                    </li>
192
+                                </ul>
193
+                                    </li>
194
+                                            <li><a href="./support.html" class="satoshi_font">SUPPORT</a></li>
195
+                                            <li><a href="./press.html" class="satoshi_font">PRESS</a></li>
196
+                                            <li><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
197
+                                            <li><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
198
+                                            <li class="d-none"><a href="#" class="satoshi_font product_data" item_id="106633220000002">ACCESSORIES</a></li>
199
+                                        </ul>
200
+                                    </nav>
201
+                                </div>
202
+                            </div>
203
+                            <div class="header-action-wrap header-action-flex header-action-width header-action-mrg-1">
204
+                                <div class="same-style">
205
+                                <a href="/myaccount.html" class="my_avatar">
206
+                      
207
+                                <svg style="width:20px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656"><path fill="#fff" d="M48 50c17.346 0 32 14.221 32 31.054V89c0 2.757-2.243 5-5 5H21c-2.757 0-5-2.243-5-5v-7.946C16 64.221 30.654 50 48 50zm0 8c-12.785 0-24 10.773-24 23.054V86h48v-4.946C72 68.773 60.785 58 48 58zm-.002-56c12.133 0 22.003 9.87 22.003 22.001C70 36.131 60.13 46 47.998 46c-12.13 0-21.997-9.869-21.997-21.999C26 11.87 35.867 2 47.998 2zm0 8c-7.718 0-13.997 6.281-13.997 14.001C34 31.72 40.28 38 47.998 38 55.718 38 62 31.72 62 24.001 62 16.281 55.719 10 47.998 10z"></path></svg>
208
+                                </a>
209
+                                </div>
210
+                                <div class="same-style header-cart">
211
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html">
212
+                                <svg  style="width:20px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656"><path  fill="#fff"  d="M72.848 70.25c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm-35 0c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11c0-6.074 4.926-11 11-11zm35 7a4 4 0 10.002 8.001 4 4 0 00-.002-8.001zm-35 0a4 4 0 100 8 4 4 0 000-8zM13.892 3.75c2.287 0 4.376 1.55 5.058 3.72l.064.22 2.97 11.187h68.128a4.727 4.727 0 014.661 5.786l-.048.2-9.559 36.291c-.583 2.216-2.618 3.842-4.894 3.944l-.228.005H30.06c-2.287 0-4.377-1.55-5.06-3.72l-.063-.219-13.124-49.413-10.7.006-.004-8 12.782-.007zm72.03 23.127H24.108l8.027 30.226H77.96l7.962-30.226z"></path></svg>
213
+                                
214
+                                <span class="position-absolute cartnumcount d-none" >0</span>
215
+                                </a>
216
+                                </div>
217
+                            </div>
218
+                        </div>
219
+                    </div>
220
+                </div>
221
+            </div>
222
+            <div class="header-small-device header-small-ptb sticky-bar py-md-2 py-2 bg-white">
223
+                <div class="container-fluid px-4">
224
+                    <div class="row align-items-center">
225
+                        <div class="col-6 header-action-wrap">
226
+                            <div class="d-flex">
227
+                                <div class="same-style header-info">
228
+                                    <button class="mobile-menu-button-active">
229
+                                        <span class="info-width-1"></span>
230
+                                        <span class="info-width-2"></span>
231
+                                        <span class="info-width-3"></span>
232
+                                    </button>
233
+                                </div>
234
+                                <div class="mobile-logo mobile-logo-width ps-3">
235
+                                    <a href="../index.html">
236
+                                        <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-50">
237
+                                    </a>
238
+                                </div>
239
+                            </div>
240
+                        </div>
241
+                        <div class="col-6">
242
+                            <div class="header-action-wrap header-action-flex header-action-mrg-1">
243
+                                <div class="same-style">
244
+                                <a href="/myaccount.html" class="my_avatar"> <svg style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656"><path fill="#fff" d="M48 50c17.346 0 32 14.221 32 31.054V89c0 2.757-2.243 5-5 5H21c-2.757 0-5-2.243-5-5v-7.946C16 64.221 30.654 50 48 50zm0 8c-12.785 0-24 10.773-24 23.054V86h48v-4.946C72 68.773 60.785 58 48 58zm-.002-56c12.133 0 22.003 9.87 22.003 22.001C70 36.131 60.13 46 47.998 46c-12.13 0-21.997-9.869-21.997-21.999C26 11.87 35.867 2 47.998 2zm0 8c-7.718 0-13.997 6.281-13.997 14.001C34 31.72 40.28 38 47.998 38 55.718 38 62 31.72 62 24.001 62 16.281 55.719 10 47.998 10z"></path></svg></a>
245
+                                </div>
246
+                                <div class="same-style header-cart">
247
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html"> <svg  style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656"><path  fill="#fff"  d="M72.848 70.25c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm-35 0c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11c0-6.074 4.926-11 11-11zm35 7a4 4 0 10.002 8.001 4 4 0 00-.002-8.001zm-35 0a4 4 0 100 8 4 4 0 000-8zM13.892 3.75c2.287 0 4.376 1.55 5.058 3.72l.064.22 2.97 11.187h68.128a4.727 4.727 0 014.661 5.786l-.048.2-9.559 36.291c-.583 2.216-2.618 3.842-4.894 3.944l-.228.005H30.06c-2.287 0-4.377-1.55-5.06-3.72l-.063-.219-13.124-49.413-10.7.006-.004-8 12.782-.007zm72.03 23.127H24.108l8.027 30.226H77.96l7.962-30.226z"></path></svg>
248
+                                <span class="position-absolute cartnumcount d-none"  style="top:-27%;right:-80%">0</span>
249
+                                </a>
250
+                                </div>
251
+                            </div>
252
+                        </div>
253
+                    </div>
254
+                </div>
255
+            </div>
256
+        </header>
257
+        <!-- Mobile menu start -->
258
+        <div class="mobile-menu-active clickalbe-sidebar-wrapper-style-1">
259
+            <div class="clickalbe-sidebar-wrap">
260
+            <div class="row pb-2 border-bottom">
261
+                <div class="col-6">
262
+                    <div class="mobile-logo mobile-logo-width">
263
+                        <a href="../index.html">
264
+                            <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-75">
265
+                        </a>
266
+                    </div>
267
+                </div>
268
+                <div class="col-6 text-end pe-4">
269
+                    <a class="sidebar-close"><i class="fa-solid fa-xmark"></i></a>
270
+                </div>
271
+            </div>
272
+               
273
+                <div class="mobile-menu-content-area sidebar-content-100-percent pt-3">
274
+                    <div class="mobile-search d-none">
275
+                        <form class="search-form" action="#">
276
+                            <input type="text" placeholder="Search here…" class="satoshi_font">
277
+                            <button class="button-search"><i class="fa-solid fa-magnifying-glass"></i></button>
278
+                        </form>
279
+                    </div>
280
+                    <div class="clickable-mainmenu-wrap clickable-mainmenu-style1">
281
+                        <nav>
282
+                            <ul class="pl-0">
283
+                          
284
+
285
+                                <li class=""><a href="./ramproducts.html" class="satoshi_font">RAM</a></li>
286
+                                <li class=""><a href="./storageproducts.html" class="satoshi_font">STORAGE</a></li>
287
+                                <li class="expandlinav">
288
+                                <div class="d-flex justify-content-between">
289
+                                    <span class="explandlinavname">LAPTOP</span><span class="d-none viewall_li">view all</span>
290
+                                </div>
291
+                               <div class="content-expandlinav d-none">
292
+                               <accordion-element>
293
+                               <accordion-item title="Accordion Item #1">
294
+                                 <p>Lorem ipsum dolor sit amet,.</p>
295
+                               </accordion-item>
296
+                               <accordion-item title="Accordion Item #2">
297
+                                 <p>Lorem ipsum dolor sit amet,.</p>
298
+                               </accordion-item>
299
+                               <accordion-item title="Accordion Item #3">
300
+                                 <p>Lorem ipsum dolor sit amet,</p>
301
+                               </accordion-item>
302
+                             </accordion-element>
303
+                               </div>
304
+                                </li>
305
+                                <li class=""><a href="./support.html" class="satoshi_font" >SUPPORT</a></li>
306
+                                <li class=""><a href="./press.html" class="satoshi_font">PRESS</a></li>
307
+                                <li class=""><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
308
+                                <li class=""><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
309
+                            </ul>
310
+                        </nav>
311
+                    </div>
312
+                    <div class="mobile-curr-lang-wrap d-none">
313
+                        <div class="single-mobile-curr-lang">
314
+                            <a class="mobile-language-active" href="#">Language <i class="icofont-simple-down"></i></a>
315
+                            <div class="lang-curr-dropdown lang-dropdown-active">
316
+                                <ul>
317
+                                    <li><a href="#">English</a></li>
318
+                                    <li><a href="#">Spanish</a></li>
319
+                                    <li><a href="#">Hindi </a></li>
320
+                                </ul>
321
+                            </div>
322
+                        </div>
323
+                    </div>
324
+                    <div class="aside-contact-info d-none">
325
+                        <ul>
326
+                            <li><i class="icofont-clock-time"></i>Monday - Friday: 9:00 - 19:00</li>
327
+                            <li><i class="icofont-envelope"></i>Info@example.com</li>
328
+                            <li><i class="icofont-stock-mobile"></i>(+55) 254. 254. 254</li>
329
+                            <li><i class="icofont-home"></i>Helios Tower 75 Tam Trinh Hoang - Ha Noi - Viet Nam</li>
330
+                        </ul>
331
+                    </div>
332
+                </div>
333
+            </div>
334
+        </div>`;
335
+    $("#navbar-head").html(nav_html);
336
+
337
+    $('.explandlinavname').click(function (e){
338
+       if($('.expandlinav .viewall_li').hasClass('d-none')){
339
+        $('.expandlinav').find('.viewall_li').removeClass('d-none');
340
+        $('.expandlinav').find('.content-expandlinav').removeClass('d-none');
341
+       }else{
342
+        $('.expandlinav').find('.viewall_li').addClass('d-none');
343
+        $('.expandlinav').find('.content-expandlinav').addClass('d-none');
344
+       }
345
+       
346
+       console.log($(e.target));
347
+        
348
+    });
349
+
350
+    let width = $(window).width();
351
+    $(".menu-negative-mrg2,.menu-negative-mrg3,.menu-negative-mrg4").css("width", width);
352
+    let ele_page = $("body").hasClass("product_pg");
353
+    if (ele_page == true) {
354
+        $(".header-area").removeClass("bg-white");
355
+        $(".main-menu").find("nav ul li a").addClass("text-white");
356
+        $(".header-bottom.sticky-bar").removeClass("sticky-bar");
357
+        let src = `../dist/assets/imgs/anwi-logo-2.png`;
358
+        $(".logo-menu-wrap").find("a img").attr("src", src);
359
+        $(".main-body").find("iframe").attr("width", width);
360
+        if (width <= 575 && width >= 390) {
361
+            $(".main-body").find("iframe").attr({
362
+                width: width,
363
+                height: 236,
364
+            })
365
+        } else if (width <= 390 && width >= 270) {
366
+            $(".main-body").find("iframe").attr({
367
+                width: width,
368
+                height: 210,
369
+            });
370
+        } else if (width <= 998 && width > 575) {
371
+            $(".main-body").find("iframe").attr({
372
+                width: width,
373
+                height: 530,
374
+            });
375
+        } else if (width <= 2720 && width > 1920) {
376
+            $(".main-body").find("iframe").attr({
377
+                width: width,
378
+                height: 1440,
379
+            });
380
+        } else {
381
+            $(".main-body").find("iframe").attr({
382
+                width: width,
383
+                height: 860,
384
+            });
385
+        }
386
+    }
387
+
388
+
389
+    $("a.ram_data").click(function () {
390
+        let item_id = $(this).attr("accessories_id");
391
+        let loc_path = '/products.html'
392
+        if (window.location.pathname.includes(loc_path)) {
393
+            window.location.href = `?itemid=${item_id}`
394
+        }
395
+        else {
396
+            window.location.href = `/products.html#itemid=${item_id}`;
397
+        }
398
+    })
399
+
400
+
401
+    // $(".main-menu nav ul").find("li").each(function () {
402
+    //     var current = window.location.pathname;
403
+    //     var $this = $(this).find("a");
404
+    //     if (current != "/") {
405
+    //         if ($this.attr('href').indexOf(current) !== -1) {
406
+    //             $(this).addClass('active_nav');
407
+    //         }
408
+    //     }
409
+
410
+    // })
411
+
412
+    // destroy localstorage data
413
+    let loc_path = '/productdetails.html';
414
+    if (window.location.pathname.includes(loc_path) === false) {
415
+        localStorage.removeItem("product_data");
416
+        localStorage.removeItem("top_data")
417
+    }
418
+    let loc_path1 = '/productcatloguedetails.html';
419
+    if (window.location.pathname.includes(loc_path1) === false) {
420
+        localStorage.removeItem("product_catlogue_obj");
421
+    }
422
+
423
+    //services pages links and sources
424
+
425
+    let $body_pg = $("body").hasClass("services_page");
426
+    let $hm_pg = "../index.html";
427
+    let $nav_img = "../dist/assets/imgs/anwi-logo-1.png";
428
+    let $footer_img = "../dist/assets/imgs/anwi-logo-2.png";
429
+    let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png";
430
+    let $about_pg = $("body").hasClass("about_page");
431
+    if($about_pg == true){
432
+        debugger
433
+        $(".main-menu").find("nav ul li a").addClass("text-dark");
434
+        let img_src = `./dist/assets/imgs/anwi-logo-1.png`;
435
+        $(".logo-menu-wrap").find("a img").attr("src",img_src);
436
+        $(".header-bottom").addClass("sticky-bar stick");
437
+        $("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
438
+    }
439
+    if ($body_pg == true) {
440
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a").attr("href", $hm_pg);
441
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a img").attr("src", $nav_img);
442
+        $(".mobile-logo").find("a").attr("href", $hm_pg);
443
+        $(".mobile-logo").find("a img").attr("src", $nav_img);
444
+        $("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
445
+        $(".main-menu").find("nav ul").find("li a").each(function () {
446
+            $(this).addClass("text-dark")
447
+            $(".header-bottom").addClass("sticky-bar stick");
448
+            let $arc = $(this).attr("href");
449
+            let $spcial_char = $arc.includes("./");
450
+            if ($spcial_char === true) {
451
+                let $refarence = `.${$arc}`
452
+                $(this).attr("href", $refarence);
453
+            }
454
+            
455
+        });
456
+        $(".same-style").find("a").each(function () {
457
+            let $arc1 = $(this).attr("href");
458
+            let $spcial_char1 = $arc1.includes("./");
459
+            if ($spcial_char1 === true) {
460
+                let $refarence1 = `.${$arc1}`
461
+                $(this).attr("href", $refarence1);
462
+            }
463
+        })
464
+        $(".tab-content").find("img").each(function(){
465
+            let $img_src = $(this).attr("src");
466
+            let $img_src1 = $img_src.includes("./");
467
+            if ($img_src1 === true) {
468
+                let $refarenceimg1 = `.${$img_src}`;
469
+                $(this).attr("src", $refarenceimg1);
470
+            }
471
+        });
472
+        $(".clickable-mainmenu-wrap").find("nav ul").find("li a").each(function () {
473
+            let $arc_mbil = $(this).attr("href");
474
+            let $spcial_char_mbil = $arc_mbil.includes("./");
475
+            if ($spcial_char_mbil === true) {
476
+                let $refarence_mbil = `.${$arc_mbil}`
477
+                $(this).attr("href", $refarence_mbil);
478
+            }
479
+        });
480
+    }
481
+
482
+    setTimeout(()=>{
483
+        if(width<=600){
484
+            $('.same-style').find('svg path').attr('fill','#000')
485
+        }
486
+    },300)
487
+}

+ 453
- 0
dist/js/navbar_okay.js View File

@@ -0,0 +1,453 @@
1
+navINIT();
2
+
3
+function navINIT() {
4
+    if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){
5
+        loadCart();
6
+    }
7
+   
8
+    function loadHelper(src = './dist/js/utils/helpers.js'){
9
+        if ($(`script[src="${src}"]`).length > 0) {
10
+          return new Promise((resolve) => resolve());
11
+        }
12
+        return new Promise(function (resolve, reject) {
13
+            var s;
14
+            s = document.createElement('script');
15
+            s.src = src;
16
+            s.onload = resolve;
17
+            s.onerror = reject;
18
+            document.head.appendChild(s);
19
+        });
20
+    }
21
+    async function loadCart(){
22
+
23
+        if(!window.location.href.includes('services/paymentmethod.html')){
24
+            let files = ['./dist/js/shoppingcart/addtocart.js'];
25
+            await loadHelper();
26
+            for(let i=0;i<files.length;i++){
27
+                if ($(`script[src="${files[i]}"]`).length > 0) {
28
+                    continue;
29
+                }
30
+                try {
31
+            
32
+                    await loadHelper(files[i])
33
+                    console.log("done");
34
+    
35
+                } catch (error) {
36
+                    console.log(error);
37
+                    return;
38
+                }
39
+            }
40
+        }
41
+
42
+         setLengthCart();
43
+        //console.log("hello");
44
+
45
+        
46
+        
47
+      
48
+    }
49
+    let URLNAMENAV = window.location.href;
50
+    const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation')|| URLNAMENAV.includes('services/paymentmethod.html');
51
+    let nav_html = `
52
+<header class="header-area section-padding-1 transparent-bar" ${isTransparent ?'style="background:#0A1039"' :''}>
53
+            <div class="header-large-device">
54
+                <div class="header-bottom sticky-bar">
55
+                    <div class="container">
56
+                        <div class="header-bottom-flex">
57
+                            <div class="logo-menu-wrap d-flex">
58
+                                <div class="logo">
59
+                                    <a href="../index.html">
60
+                                        <img src="/dist/assets/imgs/anwi-logo-2.png" alt="logo" class="w-50">
61
+                                    </a>
62
+                                </div>
63
+                                <div class="main-menu menu-lh-1 main-menu-padding-1">
64
+                                    <nav>
65
+                                        <ul class="mb-0 p-0">
66
+                                        <li class="hover_tab_1"><a href="./storageproducts.html" class="satoshi_font">STORAGE</a>
67
+                                        <ul class="py-3 px-3 rounded-bottom shadow">
68
+                                            <li class="d-flex">
69
+                                                <ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
70
+                                                    <li class="nav-item">
71
+                                                        <a class="nav-link active text-dark" data-bs-toggle="tab" href="#ora3">ORA 3</a>
72
+                                                    </li>
73
+                                                    <li class="nav-item">
74
+                                                        <a class="nav-link text-dark" data-bs-toggle="tab" href="#ora4">ORA 4</a>
75
+                                                    </li>
76
+                                                </ul>
77
+                                                <ul class="nav w-500">
78
+                                                    <li>
79
+                                                    <div class="tab-content">
80
+                                                        <div id="ora3" class="container tab-pane active">
81
+                                                            <div class="row">
82
+                                                                <div class="col-4">
83
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
84
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
85
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 512GB</p>
86
+                                                                    </div>
87
+                                                                </div>
88
+                                                                <div class="col-4">
89
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
90
+                                                                         <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
91
+                                                                         <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 1TB</p>
92
+                                                                    </div>
93
+                                                                </div>
94
+                                                                <div class="col-4">
95
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
96
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
97
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 2TB</p>
98
+                                                                    </div>
99
+                                                                </div>
100
+                                                            </div>
101
+                                                        </div>
102
+                                                        <div id="ora4" class="container tab-pane fade">
103
+                                                            <div class="row">
104
+                                                                <div class="col-4">
105
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
106
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
107
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 512GB</p>
108
+                                                                    </div>
109
+                                                                </div>
110
+                                                                <div class="col-4">
111
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
112
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
113
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 1TB</p>
114
+                                                                    </div>
115
+                                                                </div>
116
+                                                                <div class="col-4">
117
+                                                                    <div class="bg-gray-4 rounded-3 cursor-pointer">
118
+                                                                        <img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
119
+                                                                        <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora4 M.2 NVMe 2TB</p>
120
+                                                                    </div>
121
+                                                                </div>
122
+                                                            </div>
123
+                                                        </div>
124
+                                                  </div>
125
+                                                </li>
126
+                                                </ul>
127
+                                            </li>
128
+                                        </ul>
129
+                                    </li>
130
+                                    <li class="hover_tab_2"><a href="./ramproducts.html" class="satoshi_font">MEMORY</a>
131
+                                    <ul class="py-3 px-3 rounded-bottom shadow">
132
+                                    <li class="d-flex">
133
+                                        <ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
134
+                                            <li class="nav-item">
135
+                                                <a class="nav-link active text-dark" data-bs-toggle="tab" href="#laptop">Laptop</a>
136
+                                            </li>
137
+                                            <li class="nav-item">
138
+                                                <a class="nav-link text-dark" data-bs-toggle="tab" href="#desktop">Desktop</a>
139
+                                            </li>
140
+                                        </ul>
141
+                                        <ul class="nav w-500">
142
+                                            <li>
143
+                                            <div class="tab-content">
144
+                                                <div id="laptop" class="container tab-pane active">
145
+                                                    <div class="row">
146
+                                                        <div class="col-4">
147
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
148
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_laptop.png" alt="ora img" class=""/>
149
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 8GB DDR5</p>
150
+                                                            </div>
151
+                                                        </div>
152
+                                                        <div class="col-4">
153
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
154
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
155
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 16GB DDR5</p>
156
+                                                            </div>
157
+                                                        </div>
158
+                                                        <div class="col-4 ">
159
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
160
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
161
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 32GB DDR5</p>
162
+                                                            </div>
163
+                                                        </div>
164
+                                                    </div>
165
+                                                </div>
166
+                                                <div id="desktop" class="container tab-pane fade">
167
+                                                    <div class="row">
168
+                                                        <div class="col-4">
169
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
170
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
171
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 8GB DDR4</p>
172
+                                                            </div>
173
+                                                        </div>
174
+                                                        <div class="col-4">
175
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
176
+                                                                <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
177
+                                                                <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 16GB DDR4</p>
178
+                                                            </div>
179
+                                                        </div>
180
+                                                        <div class="col-4">
181
+                                                            <div class="bg-gray-4 rounded-3 cursor-pointer">
182
+                                                                 <img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
183
+                                                                 <p class="fs-7 fw-600 mb-0 text-a-color text-center  pb-1">Ora 32GB DDR4</p>
184
+                                                            </div>
185
+                                                        </div>
186
+                                                    </div>
187
+                                                </div>
188
+                                          </div>
189
+                                        </li>
190
+                                        </ul>
191
+                                    </li>
192
+                                </ul>
193
+                                    </li>
194
+                                            <li><a href="./support.html" class="satoshi_font">SUPPORT</a></li>
195
+                                            <li><a href="./press.html" class="satoshi_font">PRESS</a></li>
196
+                                            <li><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
197
+                                            <li><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
198
+                                            <li class="d-none"><a href="#" class="satoshi_font product_data" item_id="106633220000002">ACCESSORIES</a></li>
199
+                                        </ul>
200
+                                    </nav>
201
+                                </div>
202
+                            </div>
203
+                            <div class="header-action-wrap header-action-flex header-action-width header-action-mrg-1">
204
+                                <div class="same-style">
205
+                                <a href="/myaccount.html" class="my_avatar">
206
+                      
207
+                                <svg style="width:20px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656"><path fill="#fff" d="M48 50c17.346 0 32 14.221 32 31.054V89c0 2.757-2.243 5-5 5H21c-2.757 0-5-2.243-5-5v-7.946C16 64.221 30.654 50 48 50zm0 8c-12.785 0-24 10.773-24 23.054V86h48v-4.946C72 68.773 60.785 58 48 58zm-.002-56c12.133 0 22.003 9.87 22.003 22.001C70 36.131 60.13 46 47.998 46c-12.13 0-21.997-9.869-21.997-21.999C26 11.87 35.867 2 47.998 2zm0 8c-7.718 0-13.997 6.281-13.997 14.001C34 31.72 40.28 38 47.998 38 55.718 38 62 31.72 62 24.001 62 16.281 55.719 10 47.998 10z"></path></svg>
208
+                                </a>
209
+                                </div>
210
+                                <div class="same-style header-cart">
211
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html">
212
+                                <svg  style="width:20px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656"><path  fill="#fff"  d="M72.848 70.25c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm-35 0c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11c0-6.074 4.926-11 11-11zm35 7a4 4 0 10.002 8.001 4 4 0 00-.002-8.001zm-35 0a4 4 0 100 8 4 4 0 000-8zM13.892 3.75c2.287 0 4.376 1.55 5.058 3.72l.064.22 2.97 11.187h68.128a4.727 4.727 0 014.661 5.786l-.048.2-9.559 36.291c-.583 2.216-2.618 3.842-4.894 3.944l-.228.005H30.06c-2.287 0-4.377-1.55-5.06-3.72l-.063-.219-13.124-49.413-10.7.006-.004-8 12.782-.007zm72.03 23.127H24.108l8.027 30.226H77.96l7.962-30.226z"></path></svg>
213
+                                
214
+                                <span class="position-absolute cartnumcount d-none" >0</span>
215
+                                </a>
216
+                                </div>
217
+                            </div>
218
+                        </div>
219
+                    </div>
220
+                </div>
221
+            </div>
222
+            <div class="header-small-device header-small-ptb sticky-bar py-md-2 py-2 bg-white">
223
+                <div class="container-fluid px-4">
224
+                    <div class="row align-items-center">
225
+                        <div class="col-6 header-action-wrap">
226
+                            <div class="d-flex">
227
+                                <div class="same-style header-info">
228
+                                    <button class="mobile-menu-button-active">
229
+                                        <span class="info-width-1"></span>
230
+                                        <span class="info-width-2"></span>
231
+                                        <span class="info-width-3"></span>
232
+                                    </button>
233
+                                </div>
234
+                                <div class="mobile-logo mobile-logo-width ps-3">
235
+                                    <a href="../index.html">
236
+                                        <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-50">
237
+                                    </a>
238
+                                </div>
239
+                            </div>
240
+                        </div>
241
+                        <div class="col-6">
242
+                            <div class="header-action-wrap header-action-flex header-action-mrg-1">
243
+                                <div class="same-style">
244
+                                <a href="/myaccount.html" class="my_avatar"> <svg style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-2f4a9ed6" data-di-rand="1682677695656"><path fill="#fff" d="M48 50c17.346 0 32 14.221 32 31.054V89c0 2.757-2.243 5-5 5H21c-2.757 0-5-2.243-5-5v-7.946C16 64.221 30.654 50 48 50zm0 8c-12.785 0-24 10.773-24 23.054V86h48v-4.946C72 68.773 60.785 58 48 58zm-.002-56c12.133 0 22.003 9.87 22.003 22.001C70 36.131 60.13 46 47.998 46c-12.13 0-21.997-9.869-21.997-21.999C26 11.87 35.867 2 47.998 2zm0 8c-7.718 0-13.997 6.281-13.997 14.001C34 31.72 40.28 38 47.998 38 55.718 38 62 31.72 62 24.001 62 16.281 55.719 10 47.998 10z"></path></svg></a>
245
+                                </div>
246
+                                <div class="same-style header-cart">
247
+                                <a class="cart-active1 position-relative" href="/shopping-cart.html"> <svg  style="width:22px;" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" class="icon" data-di-res-id="e576e1a9-90f52cd9" data-di-rand="1682677695656"><path  fill="#fff"  d="M72.848 70.25c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm-35 0c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11c0-6.074 4.926-11 11-11zm35 7a4 4 0 10.002 8.001 4 4 0 00-.002-8.001zm-35 0a4 4 0 100 8 4 4 0 000-8zM13.892 3.75c2.287 0 4.376 1.55 5.058 3.72l.064.22 2.97 11.187h68.128a4.727 4.727 0 014.661 5.786l-.048.2-9.559 36.291c-.583 2.216-2.618 3.842-4.894 3.944l-.228.005H30.06c-2.287 0-4.377-1.55-5.06-3.72l-.063-.219-13.124-49.413-10.7.006-.004-8 12.782-.007zm72.03 23.127H24.108l8.027 30.226H77.96l7.962-30.226z"></path></svg>
248
+                                <span class="position-absolute cartnumcount d-none"  style="top:-27%;right:-80%">0</span>
249
+                                </a>
250
+                                </div>
251
+                            </div>
252
+                        </div>
253
+                    </div>
254
+                </div>
255
+            </div>
256
+        </header>
257
+        <!-- Mobile menu start -->
258
+        <div class="mobile-menu-active clickalbe-sidebar-wrapper-style-1">
259
+            <div class="clickalbe-sidebar-wrap">
260
+            <div class="row pb-2 border-bottom">
261
+                <div class="col-6">
262
+                    <div class="mobile-logo mobile-logo-width">
263
+                        <a href="../index.html">
264
+                            <img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-75">
265
+                        </a>
266
+                    </div>
267
+                </div>
268
+                <div class="col-6 text-end pe-4">
269
+                    <a class="sidebar-close"><i class="fa-solid fa-xmark"></i></a>
270
+                </div>
271
+            </div>
272
+               
273
+                <div class="mobile-menu-content-area sidebar-content-100-percent pt-3">
274
+                    <div class="mobile-search d-none">
275
+                        <form class="search-form" action="#">
276
+                            <input type="text" placeholder="Search here…" class="satoshi_font">
277
+                            <button class="button-search"><i class="fa-solid fa-magnifying-glass"></i></button>
278
+                        </form>
279
+                    </div>
280
+                    <div class="clickable-mainmenu-wrap clickable-mainmenu-style1">
281
+                        <nav>
282
+                            <ul class="pl-0">
283
+                                <li class=""><a href="./ramproducts.html" class="satoshi_font">RAM</a></li>
284
+                                <li class=""><a href="./storageproducts.html" class="satoshi_font">STORAGE</a></li>
285
+                                <li class=""><a href="./support.html" class="satoshi_font" >SUPPORT</a></li>
286
+                                <li class=""><a href="./press.html" class="satoshi_font">PRESS</a></li>
287
+                                <li class=""><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
288
+                                <li class=""><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
289
+                            </ul>
290
+                        </nav>
291
+                    </div>
292
+                    <div class="mobile-curr-lang-wrap d-none">
293
+                        <div class="single-mobile-curr-lang">
294
+                            <a class="mobile-language-active" href="#">Language <i class="icofont-simple-down"></i></a>
295
+                            <div class="lang-curr-dropdown lang-dropdown-active">
296
+                                <ul>
297
+                                    <li><a href="#">English</a></li>
298
+                                    <li><a href="#">Spanish</a></li>
299
+                                    <li><a href="#">Hindi </a></li>
300
+                                </ul>
301
+                            </div>
302
+                        </div>
303
+                    </div>
304
+                    <div class="aside-contact-info d-none">
305
+                        <ul>
306
+                            <li><i class="icofont-clock-time"></i>Monday - Friday: 9:00 - 19:00</li>
307
+                            <li><i class="icofont-envelope"></i>Info@example.com</li>
308
+                            <li><i class="icofont-stock-mobile"></i>(+55) 254. 254. 254</li>
309
+                            <li><i class="icofont-home"></i>Helios Tower 75 Tam Trinh Hoang - Ha Noi - Viet Nam</li>
310
+                        </ul>
311
+                    </div>
312
+                </div>
313
+            </div>
314
+        </div>`;
315
+    $("#navbar-head").html(nav_html);
316
+    let width = $(window).width();
317
+    $(".menu-negative-mrg2,.menu-negative-mrg3,.menu-negative-mrg4").css("width", width);
318
+    let ele_page = $("body").hasClass("product_pg");
319
+    if (ele_page == true) {
320
+        $(".header-area").removeClass("bg-white");
321
+        $(".main-menu").find("nav ul li a").addClass("text-white");
322
+        $(".header-bottom.sticky-bar").removeClass("sticky-bar");
323
+        let src = `../dist/assets/imgs/anwi-logo-2.png`;
324
+        $(".logo-menu-wrap").find("a img").attr("src", src);
325
+        $(".main-body").find("iframe").attr("width", width);
326
+        if (width <= 575 && width >= 390) {
327
+            $(".main-body").find("iframe").attr({
328
+                width: width,
329
+                height: 236,
330
+            })
331
+        } else if (width <= 390 && width >= 270) {
332
+            $(".main-body").find("iframe").attr({
333
+                width: width,
334
+                height: 210,
335
+            });
336
+        } else if (width <= 998 && width > 575) {
337
+            $(".main-body").find("iframe").attr({
338
+                width: width,
339
+                height: 530,
340
+            });
341
+        } else if (width <= 2720 && width > 1920) {
342
+            $(".main-body").find("iframe").attr({
343
+                width: width,
344
+                height: 1440,
345
+            });
346
+        } else {
347
+            $(".main-body").find("iframe").attr({
348
+                width: width,
349
+                height: 860,
350
+            });
351
+        }
352
+    }
353
+
354
+
355
+    $("a.ram_data").click(function () {
356
+        let item_id = $(this).attr("accessories_id");
357
+        let loc_path = '/products.html'
358
+        if (window.location.pathname.includes(loc_path)) {
359
+            window.location.href = `?itemid=${item_id}`
360
+        }
361
+        else {
362
+            window.location.href = `/products.html#itemid=${item_id}`;
363
+        }
364
+    })
365
+
366
+
367
+    // $(".main-menu nav ul").find("li").each(function () {
368
+    //     var current = window.location.pathname;
369
+    //     var $this = $(this).find("a");
370
+    //     if (current != "/") {
371
+    //         if ($this.attr('href').indexOf(current) !== -1) {
372
+    //             $(this).addClass('active_nav');
373
+    //         }
374
+    //     }
375
+
376
+    // })
377
+
378
+    // destroy localstorage data
379
+    let loc_path = '/productdetails.html';
380
+    if (window.location.pathname.includes(loc_path) === false) {
381
+        localStorage.removeItem("product_data");
382
+        localStorage.removeItem("top_data")
383
+    }
384
+    let loc_path1 = '/productcatloguedetails.html';
385
+    if (window.location.pathname.includes(loc_path1) === false) {
386
+        localStorage.removeItem("product_catlogue_obj");
387
+    }
388
+
389
+    //services pages links and sources
390
+
391
+    let $body_pg = $("body").hasClass("services_page");
392
+    let $hm_pg = "../index.html";
393
+    let $nav_img = "../dist/assets/imgs/anwi-logo-1.png";
394
+    let $footer_img = "../dist/assets/imgs/anwi-logo-2.png";
395
+    let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png";
396
+    let $about_pg = $("body").hasClass("about_page");
397
+    if($about_pg == true){
398
+        debugger
399
+        $(".main-menu").find("nav ul li a").addClass("text-dark");
400
+        let img_src = `./dist/assets/imgs/anwi-logo-1.png`;
401
+        $(".logo-menu-wrap").find("a img").attr("src",img_src);
402
+        $(".header-bottom").addClass("sticky-bar stick");
403
+        $("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
404
+    }
405
+    if ($body_pg == true) {
406
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a").attr("href", $hm_pg);
407
+        $(".header-large-device").find(".logo-menu-wrap .logo").find("a img").attr("src", $nav_img);
408
+        $(".mobile-logo").find("a").attr("href", $hm_pg);
409
+        $(".mobile-logo").find("a img").attr("src", $nav_img);
410
+        $("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
411
+        $(".main-menu").find("nav ul").find("li a").each(function () {
412
+            $(this).addClass("text-dark")
413
+            $(".header-bottom").addClass("sticky-bar stick");
414
+            let $arc = $(this).attr("href");
415
+            let $spcial_char = $arc.includes("./");
416
+            if ($spcial_char === true) {
417
+                let $refarence = `.${$arc}`
418
+                $(this).attr("href", $refarence);
419
+            }
420
+            
421
+        });
422
+        $(".same-style").find("a").each(function () {
423
+            let $arc1 = $(this).attr("href");
424
+            let $spcial_char1 = $arc1.includes("./");
425
+            if ($spcial_char1 === true) {
426
+                let $refarence1 = `.${$arc1}`
427
+                $(this).attr("href", $refarence1);
428
+            }
429
+        })
430
+        $(".tab-content").find("img").each(function(){
431
+            let $img_src = $(this).attr("src");
432
+            let $img_src1 = $img_src.includes("./");
433
+            if ($img_src1 === true) {
434
+                let $refarenceimg1 = `.${$img_src}`;
435
+                $(this).attr("src", $refarenceimg1);
436
+            }
437
+        });
438
+        $(".clickable-mainmenu-wrap").find("nav ul").find("li a").each(function () {
439
+            let $arc_mbil = $(this).attr("href");
440
+            let $spcial_char_mbil = $arc_mbil.includes("./");
441
+            if ($spcial_char_mbil === true) {
442
+                let $refarence_mbil = `.${$arc_mbil}`
443
+                $(this).attr("href", $refarence_mbil);
444
+            }
445
+        });
446
+    }
447
+
448
+    setTimeout(()=>{
449
+        if(width<=600){
450
+            $('.same-style').find('svg path').attr('fill','#000')
451
+        }
452
+    },300)
453
+}

+ 271
- 0
dist/js/orderDetails/order_summary.js View File

@@ -0,0 +1,271 @@
1
+async function order_summary() {
2
+
3
+  let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
4
+  let { userId } = cookieRes;
5
+  let filesInputSupport = [];
6
+
7
+
8
+  // let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/salesorderdetailsbyorgid/organizationid/${userId}`,true);
9
+  // https://templateserver.bizgaze.com/apis/v4/bizgaze/integrations/products/getordersbyid/organizationid/{organizationid}/orderno/{orderno}
10
+  let orderno = window.location.hash.split('#')[1];
11
+  let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getordersbyid/organizationid/${userId}/orderno/${orderno}`);
12
+  if (res.isError) {
13
+    return;
14
+  }
15
+  const orderDetailsres = JSON.parse(res.response.result);
16
+
17
+  let new_arrr = orderDetailsres;
18
+  console.log(new_arrr)
19
+  let orderNumber = window.location.hash.split('#')[1];
20
+  let filteredOrders = new_arrr.filter(function (order) {
21
+    return order.OrderNo === orderNumber;
22
+  });
23
+
24
+  for (let i = 0; i < filteredOrders.length; i++) {
25
+    let order = filteredOrders[i];
26
+    let Delivery_status = order.stageshortcode
27
+    let deliverdCard = appendItemHTML(order);
28
+    $('.deliverd-card').append(deliverdCard)
29
+    if (Delivery_status == 'CMD') {
30
+      $('.delivery_status').html('Deliverd')
31
+    }
32
+    if (Delivery_status == 'APL') {
33
+      $('.delivery_status').html('Approval')
34
+    }
35
+  }
36
+
37
+  $('.supportBtn').click(function (e) {
38
+    let parentEl = $(e.target).parents('.card-body');
39
+
40
+    const orderName = $(parentEl).find('.ordernameModal').text();
41
+    const img = $(parentEl).find('.order_img').attr('src');
42
+    $('#exampleModalsupport').find('.order_img').attr('src', img);
43
+
44
+    $('.modalitemname').text(orderName);
45
+
46
+    const orderQty = $(parentEl).find('.orderqtymodalinfo').text();
47
+    const orderPrice = $(parentEl).find('.order_price').text();
48
+    const [symbol, price] = getCurrencySymbol(orderPrice)
49
+    $('.modalitemqty').html(orderQty);
50
+    $('.modalprice').html(`${symbol} ${price}`);
51
+    console.log(orderName);
52
+  });
53
+
54
+
55
+  // modal start
56
+
57
+
58
+  // files append html ui
59
+  function getInputsListHTML(arr){
60
+    let html = '';
61
+
62
+    for(let i=0;i<arr.length;i++){
63
+      const {FileName,FileType} = arr[i];
64
+      html += `<span class='p-1  rounded text-truncate containerfilesupport' data-name="${FileName}.${FileType}" >
65
+     <span class="border p-1 rounded"> <span class=" w-50 filenamesupportticket"> ${FileName}.${FileType}</span>
66
+     <span  class=' text-center bg-white rounded removeFilesupportticket'>
67
+      <i class='p-1  fa fa-close'></i>
68
+     </span></span>
69
+   </span>`
70
+    } 
71
+
72
+    return html;
73
+  }
74
+
75
+  // files onchange handler for input files
76
+  async function fileUploadSaveHandler(e){
77
+
78
+    const promiseFiles = await getMulFileToGetBase64(e);
79
+    // console.log(promiseFiles,'promisepromise');
80
+    filesInputSupport = promiseFiles;
81
+
82
+    let html = getInputsListHTML(filesInputSupport);
83
+
84
+    $('.inputlistsupportcontainer').html(html);
85
+
86
+    $('.removeFilesupportticket').off('click').click(function (e){
87
+      let el = $(this);
88
+
89
+      let nameWithExt = $(el).parents('.containerfilesupport').data('name')
90
+      console.log(nameWithExt);
91
+
92
+      filterRemoveInputsFiles(nameWithExt)
93
+    });
94
+
95
+  }  
96
+
97
+  function filterRemoveInputsFiles(nameWithExt){
98
+    console.log("okay");
99
+    console.log(filesInputSupport);
100
+    filesInputSupport = filesInputSupport.filter(function (e){
101
+      const {FileName,FileType} = e;
102
+      const str = `${FileName}.${FileType}`;
103
+      if(str != nameWithExt) return e;
104
+    });
105
+
106
+    console.log(filesInputSupport);
107
+  }
108
+
109
+  $('#supportattachfile').off().change(function (e){
110
+    debugger;
111
+    if(!e.target.files.length) return;
112
+    fileUploadSaveHandler(e);
113
+  });
114
+
115
+
116
+
117
+  // submit support ticket
118
+  $('.submitsupportticket').off('click').click(async function (e) {
119
+    console.log("tick");
120
+
121
+    let supportGroup = $('#supportgroups').val();
122
+    let priortyGroup = $('#supportlevel').val();
123
+    let description = $('.desmodalsupportarea').val()?.trim();
124
+
125
+
126
+
127
+    let isErrorValidtion = false;
128
+    if (!supportGroup) {
129
+      isErrorValidtion = true;
130
+      $('#supportgroups').parent().find('.invalid-feedback').addClass('d-block');
131
+    } else {
132
+      $('#supportgroups').parent().find('.invalid-feedback').removeClass('d-block');
133
+    }
134
+
135
+    if (!priortyGroup) {
136
+      isErrorValidtion = true;
137
+      $('#supportlevel').parent().find('.invalid-feedback').addClass('d-block');
138
+    } else {
139
+      $('#supportlevel').parent().find('.invalid-feedback').removeClass('d-block');
140
+    }
141
+
142
+    if (!description) {
143
+      isErrorValidtion = true;
144
+      $('.desmodalsupportarea').parent().find('.invalid-feedback').addClass('d-block');
145
+    } else {
146
+      $('.desmodalsupportarea').parent().find('.invalid-feedback').removeClass('d-block');
147
+    }
148
+
149
+    if (isErrorValidtion) return;
150
+
151
+    const payload = {
152
+      ticketgroupid: Number(supportGroup),
153
+      description: description,
154
+      documents: filesInputSupport.length > 0 ? filesInputSupport : 0,
155
+      PriorityId: Number(priortyGroup),
156
+      ticketid: 0,
157
+      contactid: Number(userId)
158
+    }
159
+    $('.supportticketsubmit').removeClass('d-none');
160
+    $('.supportticketsubmitbtn').addClass('d-none');
161
+
162
+    $('.closesupportticket').attr('disabled', true);
163
+    console.log(payload);
164
+    const res = await API_SERVICES_ACTIONS.postAPIService(`apis/v4/hyperfusion/hireserver/machines/saveticket`, payload);
165
+
166
+    console.log(res);
167
+
168
+    if (res.isError) {
169
+      toasterHelper("error", res.errorMsg, `toast-top-right`);
170
+      $('.supportticketsubmit').addClass('d-none');
171
+      $('.supportticketsubmitbtn').removeClass('d-none');
172
+      $('.closesupportticket').attr('disabled', false);
173
+      return;
174
+    }
175
+    $('.supportticketsubmit').addClass('d-none');
176
+    $('.supportticketsubmitbtn').removeClass('d-none');
177
+    $('.closesupportticket').attr('disabled', false);
178
+    toasterHelper("success", 'Ticket successfully submitted!', `toast-top-right`);
179
+
180
+    // $('#supportgroups').val(null);
181
+    // $('#supportlevel').val(null);
182
+    $('.desmodalsupportarea').val('');
183
+    $("#exampleModalsupport .closesupportticket").click()
184
+  });
185
+
186
+
187
+
188
+  // modal end
189
+
190
+  $('.warrantybtn').click(function (e) {
191
+    let parentEl = $(e.target).parents('.card-body');
192
+
193
+    const orderName = $(parentEl).find('.ordernameModal').text();
194
+
195
+    $('#warrenymodalname').html(orderName);
196
+  });
197
+
198
+  let summary = `<div class="bg-gradient-anwi card-body"><div><p class="mb-0 fw-500">Order : <span>${orderNumber}</span><small class=" "> ( ${filteredOrders.length} items )</samll><p class="mb-0 ">Order placed on ${filteredOrders[0].OrderDate}</p></div>`;
199
+
200
+  $('.Order_details_section  .order_tax').html(filteredOrders[0].taxamount)
201
+  $('.Order_details_section .Order_total').html(filteredOrders[0].nettotal)
202
+  $('.Order_details_section  .order_price').html(filteredOrders[0].assessableamount)
203
+  $('.Order_details_section  .order-summary').html(summary);
204
+
205
+  $('.back_to_orders').click(function () {
206
+    $(this).attr('href', './myaccount.html')
207
+  });
208
+
209
+  function appendItemHTML(order) {
210
+
211
+    return `<div class="card rounded-0 bg-white mb-3 "><div class=card-body><div class="align-items-center row"><div class=col-md-6><div class=d-flex><img class=img-fluid src=""></div><div class="d-flex align-items-center"><div class="text-secondary">Delivery Status : </div><div class=" delivery_status text-blue fw-600" data-status="${order.stageshortcode}"></div></div></div><div class="col-md-6 text-end"><button data-bs-toggle="modal" data-bs-target="#exampleModalwarrenty" class=" bg-gradient-anwi-outline btn-sm  btn warrantybtn ">Claim warranty</button> <button data-bs-toggle="modal" data-bs-target="#exampleModalsupport" class="supportBtn bg-gradient-anwi-outline btn-sm btn ">Support</button></div></div><div><small class=" text-secondary me-2">Delivered To : </small><small class="fw-600 user_name">${order.OrganizationName}</div><div class="row pb-4 pb-md-0 align-items-center"><div class="col-md-4 text-center"><img class="img-fluid order_img w-75"src=https://appassets.bizgaze.app/${order.imageurl?.replaceAll(" ", "%20")}></div><div class="col-md-8 position-relative"><small class=" mb-0 order_itemname"><span ><span class="ordernameModal">${order.itemname}</span>  (<span class="orderqtymodalinfo">${order.Quantity}</span> items)</span><small class=" align-items-center d-flex fw-600 mb-3"><svg class="bi bi-currency-rupee"fill=currentColor height=16 viewBox="0 0 16 16"width=16 xmlns=http://www.w3.org/2000/svg><path d="M4 3.06h2.726c1.22 0 2.12.575 2.325 1.724H4v1.051h5.051C8.855 7.001 8 7.558 6.788 7.558H4v1.317L8.437 14h2.11L6.095 8.884h.855c2.316-.018 3.465-1.476 3.688-3.049H12V4.784h-1.345c-.08-.778-.357-1.335-.793-1.732H12V2H4v1.06Z"></path></svg><small class="order_price fs-6">${order.itemtotal}</small><p class=" mb-0 close_exchange position-absolute d-none text-secondary">Return/Exchange window closed on Friday,24 March <a class=text-primary href=#>Why?</a></div></div></div></div>`;
212
+  }
213
+
214
+
215
+
216
+
217
+
218
+  async function supportModalInit() {
219
+    $.fn.modal.Constructor.prototype.enforceFocus = function () { };
220
+    let ticketGroupRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/anwiauth/getticketgoups`);
221
+
222
+
223
+    if (ticketGroupRes.isError) {
224
+      console.log(ticketGroupRes.errorMsg);
225
+      return;
226
+    }
227
+
228
+
229
+    ticketGroupRes = JSON.parse(ticketGroupRes.response.result);
230
+
231
+    console.log(ticketGroupRes);
232
+
233
+
234
+
235
+    let htmlTGroup = '';
236
+    for (let i = 0; i < ticketGroupRes.length; i++) {
237
+      htmlTGroup += `<option value="${ticketGroupRes[i].ticketgroupid}" data-id="${ticketGroupRes[i].ticketgroupid}">${ticketGroupRes[i].ticketgroupname}</option>`
238
+    }
239
+
240
+    $('#supportgroups').html(htmlTGroup);
241
+
242
+    // priopty
243
+
244
+    let prioritiesRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/anwiauth/getticketpriorities`);
245
+
246
+    if (prioritiesRes.isError) {
247
+      console.log(prioritiesRes.errorMsg);
248
+      return;
249
+    }
250
+
251
+
252
+    prioritiesRes = JSON.parse(prioritiesRes.response.result);
253
+
254
+    console.log(prioritiesRes, 'prioritiesRes');
255
+
256
+
257
+    let htmlTpriorites = '';
258
+    for (let i = 0; i < prioritiesRes.length; i++) {
259
+      htmlTpriorites += `<option value="${prioritiesRes[i].priorityid}" data-id="${prioritiesRes[i].priorityid}">${prioritiesRes[i].priorityname}</option>`
260
+    }
261
+
262
+    $('#supportlevel').html(htmlTpriorites);
263
+
264
+
265
+
266
+  }
267
+
268
+
269
+  supportModalInit();
270
+}
271
+order_summary()

+ 160
- 0
dist/js/orderconfirmation.js View File

@@ -0,0 +1,160 @@
1
+function orderConfirmation(){
2
+    init();
3
+    function init(){
4
+        addFullLoader();
5
+        getOrderStatus();
6
+    }
7
+
8
+    function orderlistsummary({name,price,qty,total,img}){
9
+        let priceAmt = '';
10
+        let totalAmt = '';
11
+
12
+        let defaultImg =img ? imgServerNameBuild(img): `./dist/assets/imgs/nophoto.png`;
13
+
14
+debugger;
15
+        
16
+        let [priceSysm,priceamt] = getCurrencySymbol(price)
17
+        priceAmt = `${priceSysm}${priceamt}`
18
+        
19
+
20
+        
21
+        let [qtySymb,qtyamt] = getCurrencySymbol(qty*price)
22
+       
23
+
24
+        totalAmt = `${qtySymb}${qtyamt}`
25
+
26
+        return `<div class="col-sm-4">
27
+     <div style="max-width:200px">   <img src="${defaultImg}" alt="" class="w-100 h-100">   </div>
28
+    </div>
29
+    <div class="col-sm-8 d-flex flex-column justify-content-center">
30
+        <div class="itemname"><span class="font-weight-500">${name}</span></div>
31
+        <div> <span>Unit Price :</span><span class="font-weight-500">${priceAmt}</span> </div>
32
+        <div> <span>Quantity :</span><span class="font-weight-500">${qty}</span> </div>
33
+        <div> <span>Total Amount :</span>  <span class="font-weight-500">${totalAmt}</span></div>
34
+    </div>`;
35
+
36
+        return `
37
+        <div class="row">
38
+                            <div class="col-4">
39
+                                <div class="row">
40
+                                    <div class="col-6">
41
+                                        <img class="w-100 h-100" src="http://127.0.0.1:5504/dist/assets/imgs/Navbar/Accessiories-2.png" alt="">
42
+                                    </div>
43
+                                    <div class="col-6 d-flex justify-content-center align-items-center">
44
+                                        <div class="itemname">${name}</div>
45
+                                        
46
+                                    </div>
47
+                                </div>
48
+                            </div>
49
+                            <div class="col-3 d-flex align-items-center justify-content-center">
50
+                                ${priceAmt}
51
+                            </div>
52
+                            <div class="col-2 d-flex align-items-center justify-content-center">
53
+                               ${qty}
54
+                            </div>
55
+                            <div class="col-3 text-end">
56
+                               ${totalAmt}
57
+                             </div>
58
+                        </div>`;
59
+    }
60
+
61
+    function addFullLoader(){
62
+        document.querySelector('auth-loader').show();
63
+    }
64
+
65
+    function removeFullLoader(){
66
+        document.querySelector('auth-loader').hide();
67
+    }
68
+
69
+    async function getOrderStatus(){
70
+       
71
+        const searchParams = window.location.search.split('&');
72
+        let orderId = searchParams[0].split('=')[1];
73
+
74
+        debugger;
75
+        let orderRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/hyperfusionpaymentgateway/gethyperfusionpaymentdetails/orderid/${orderId}`);
76
+        if(orderRes.isError){
77
+            removeFullLoader();
78
+            return;
79
+        }
80
+        console.log(orderRes);
81
+        //payment_group
82
+       
83
+        orderRes = JSON.parse(orderRes.response.result)[0];
84
+        $('.paymentmethodconfirm').html(orderRes.payment_group)
85
+        if(orderRes.payment_status === 'FAILED'){
86
+            $('.ordercontainerconfirmError').removeClass('d-none');
87
+            $('.successorderconfirm').addClass('d-none');
88
+            removeFullLoader();
89
+            return;
90
+        }
91
+      
92
+        const res =  await API_SERVICES_ACTIONS.postAPIService(`apis/v4/bizgaze/transact/orders/updatepaymenttransactionstatus/refid/${orderId}`,null);
93
+
94
+        console.log(res,'ress');
95
+
96
+        if(res.isError){
97
+            console.log(res);
98
+            $('.ordercontainerconfirmError').removeClass('d-none');
99
+            $('.successorderconfirm').addClass('d-none');
100
+            removeFullLoader();
101
+            return;
102
+        }
103
+
104
+
105
+        if(!res.response.message.toLowerCase().includes('success')){
106
+            console.log(res);
107
+            $('.ordercontainerconfirmError').removeClass('d-none');
108
+            $('.successorderconfirm').addClass('d-none');
109
+            removeFullLoader();
110
+            return;
111
+        }
112
+
113
+        let resData = JSON.parse(res.response.result);
114
+
115
+        const {NetTotal,TaxAmount,OrderItems,CreatedDate,OrderNo
116
+        } = resData;
117
+        let [netcurrencySymbol,netamount] = getCurrencySymbol(NetTotal);    
118
+        $('.totalordersummary').html(`${netcurrencySymbol}${netamount}`);
119
+
120
+       {
121
+        let [ordercurrencySymbol,orderamount] = getCurrencySymbol(TaxAmount);
122
+        $('.totaltaxsummary').html(`${ordercurrencySymbol}${orderamount}`);
123
+       }
124
+
125
+       let orderItemsListHTML = '';
126
+
127
+       for(let i=0;i<OrderItems.length;i++){
128
+        const {ItemName:name,UnitPrice:price,Quantity:qty,UnitPrice:total,ItemImage:img} = OrderItems[i];
129
+        debugger;
130
+        orderItemsListHTML += orderlistsummary({
131
+            name,
132
+            price,
133
+            qty,
134
+            total,
135
+            img
136
+        });
137
+       }
138
+       let userData = COOKIE_HELPER_ACTIONS.getCookie();
139
+       let {name} = userData;
140
+       $('.username').html(name);
141
+       $('.orderlistconfirm').html(orderItemsListHTML);
142
+
143
+       $('.createdDateConfirm').html(CreatedDate);
144
+
145
+       $('.ordernumber').html(OrderNo);
146
+debugger;
147
+       localStorage.removeItem(CART_DATA)
148
+
149
+       setLengthCart();
150
+       removeFullLoader();
151
+        console.log(resData);
152
+
153
+    }
154
+
155
+
156
+   
157
+}
158
+
159
+    
160
+checkValidAuth(orderConfirmation)

+ 48
- 0
dist/js/plugins/ajax-mail.js View File

@@ -0,0 +1,48 @@
1
+$(function() {
2
+
3
+	// Get the form.
4
+	var form = $('#contact-form');
5
+
6
+	// Get the messages div.
7
+	var formMessages = $('.form-messege');
8
+
9
+	// Set up an event listener for the contact form.
10
+	$(form).submit(function(e) {
11
+		// Stop the browser from submitting the form.
12
+		e.preventDefault();
13
+
14
+		// Serialize the form data.
15
+		var formData = $(form).serialize();
16
+
17
+		// Submit the form using AJAX.
18
+		$.ajax({
19
+			type: 'POST',
20
+			url: $(form).attr('action'),
21
+			data: formData
22
+		})
23
+		.done(function(response) {
24
+			// Make sure that the formMessages div has the 'success' class.
25
+			$(formMessages).removeClass('error');
26
+			$(formMessages).addClass('success');
27
+
28
+			// Set the message text.
29
+			$(formMessages).text(response);
30
+
31
+			// Clear the form.
32
+			$('#contact-form input,#contact-form textarea').val('');
33
+		})
34
+		.fail(function(data) {
35
+			// Make sure that the formMessages div has the 'error' class.
36
+			$(formMessages).removeClass('success');
37
+			$(formMessages).addClass('error');
38
+
39
+			// Set the message text.
40
+			if (data.responseText !== '') {
41
+				$(formMessages).text(data.responseText);
42
+			} else {
43
+				$(formMessages).text('Oops! An error occured and your message could not be sent.');
44
+			}
45
+		});
46
+	});
47
+
48
+});

+ 22
- 0
dist/js/plugins/countdown.js View File

@@ -0,0 +1,22 @@
1
+/*!
2
+ * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
3
+ * Copyright (c) 2016 Edson Hilios
4
+ * 
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ * this software and associated documentation files (the "Software"), to deal in
7
+ * the Software without restriction, including without limitation the rights to
8
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ * the Software, and to permit persons to whom the Software is furnished to do so,
10
+ * subject to the following conditions:
11
+ * 
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ * 
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+ */
22
+!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.firstTick=!0,this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var a,b=new Date;return a=this.finalDate.getTime()-b.getTime(),a=Math.ceil(a/1e3),a=!this.options.elapse&&a<0?0:Math.abs(a),this.totalSecsLeft===a||this.firstTick?void(this.firstTick=!1):(this.totalSecsLeft=a,this.elapsed=b>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-b.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},void(this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish"))))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});

+ 7
- 0
dist/js/plugins/easyzoom.js View File

@@ -0,0 +1,7 @@
1
+/*!
2
+ * @name        easyzoom
3
+ * @author       <>
4
+ * @modified    Thursday, November 22nd, 2018
5
+ * @version     2.5.2
6
+ */
7
+!function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(t){e(t)}):"object"==typeof module&&module.exports?module.exports=t.EasyZoom=e(require("jquery")):t.EasyZoom=e(t.jQuery)}(this,function(i){"use strict";var c,d,l,p,u,f,o={loadingNotice:"Loading image",errorNotice:"The image could not be loaded",errorDuration:2500,linkAttribute:"href",preventClicks:!0,beforeShow:i.noop,beforeHide:i.noop,onShow:i.noop,onHide:i.noop,onMove:i.noop};function s(t,e){this.$target=i(t),this.opts=i.extend({},o,e,this.$target.data()),void 0===this.isOpen&&this._init()}return s.prototype._init=function(){this.$link=this.$target.find("a"),this.$image=this.$target.find("img"),this.$flyout=i('<div class="easyzoom-flyout" />'),this.$notice=i('<div class="easyzoom-notice" />'),this.$target.on({"mousemove.easyzoom touchmove.easyzoom":i.proxy(this._onMove,this),"mouseleave.easyzoom touchend.easyzoom":i.proxy(this._onLeave,this),"mouseenter.easyzoom touchstart.easyzoom":i.proxy(this._onEnter,this)}),this.opts.preventClicks&&this.$target.on("click.easyzoom",function(t){t.preventDefault()})},s.prototype.show=function(t,e){var o=this;if(!1!==this.opts.beforeShow.call(this)){if(!this.isReady)return this._loadImage(this.$link.attr(this.opts.linkAttribute),function(){!o.isMouseOver&&e||o.show(t)});this.$target.append(this.$flyout);var i=this.$target.outerWidth(),s=this.$target.outerHeight(),h=this.$flyout.width(),n=this.$flyout.height(),a=this.$zoom.width(),r=this.$zoom.height();(c=a-h)<0&&(c=0),(d=r-n)<0&&(d=0),l=c/i,p=d/s,this.isOpen=!0,this.opts.onShow.call(this),t&&this._move(t)}},s.prototype._onEnter=function(t){var e=t.originalEvent.touches;this.isMouseOver=!0,e&&1!=e.length||(t.preventDefault(),this.show(t,!0))},s.prototype._onMove=function(t){this.isOpen&&(t.preventDefault(),this._move(t))},s.prototype._onLeave=function(){this.isMouseOver=!1,this.isOpen&&this.hide()},s.prototype._onLoad=function(t){t.currentTarget.width&&(this.isReady=!0,this.$notice.detach(),this.$flyout.html(this.$zoom),this.$target.removeClass("is-loading").addClass("is-ready"),t.data.call&&t.data())},s.prototype._onError=function(){var t=this;this.$notice.text(this.opts.errorNotice),this.$target.removeClass("is-loading").addClass("is-error"),this.detachNotice=setTimeout(function(){t.$notice.detach(),t.detachNotice=null},this.opts.errorDuration)},s.prototype._loadImage=function(t,e){var o=new Image;this.$target.addClass("is-loading").append(this.$notice.text(this.opts.loadingNotice)),this.$zoom=i(o).on("error",i.proxy(this._onError,this)).on("load",e,i.proxy(this._onLoad,this)),o.style.position="absolute",o.src=t},s.prototype._move=function(t){if(0===t.type.indexOf("touch")){var e=t.touches||t.originalEvent.touches;u=e[0].pageX,f=e[0].pageY}else u=t.pageX||u,f=t.pageY||f;var o=this.$target.offset(),i=f-o.top,s=u-o.left,h=Math.ceil(i*p),n=Math.ceil(s*l);if(n<0||h<0||c<n||d<h)this.hide();else{var a=-1*h,r=-1*n;this.$zoom.css({top:a,left:r}),this.opts.onMove.call(this,a,r)}},s.prototype.hide=function(){this.isOpen&&!1!==this.opts.beforeHide.call(this)&&(this.$flyout.detach(),this.isOpen=!1,this.opts.onHide.call(this))},s.prototype.swap=function(t,e,o){this.hide(),this.isReady=!1,this.detachNotice&&clearTimeout(this.detachNotice),this.$notice.parent().length&&this.$notice.detach(),this.$target.removeClass("is-loading is-ready is-error"),this.$image.attr({src:t,srcset:i.isArray(o)?o.join():o}),this.$link.attr(this.opts.linkAttribute,e)},s.prototype.teardown=function(){this.hide(),this.$target.off(".easyzoom").removeClass("is-loading is-ready is-error"),this.detachNotice&&clearTimeout(this.detachNotice),delete this.$link,delete this.$zoom,delete this.$image,delete this.$notice,delete this.$flyout,delete this.isOpen,delete this.isReady},i.fn.easyZoom=function(e){return this.each(function(){var t=i.data(this,"easyZoom");t?void 0===t.isOpen&&t._init():i.data(this,"easyZoom",new s(this,e))})},s});

+ 7
- 0
dist/js/plugins/images-loaded.js
File diff suppressed because it is too large
View File


+ 5
- 0
dist/js/plugins/instafeed.js
File diff suppressed because it is too large
View File


+ 12
- 0
dist/js/plugins/isotope.js
File diff suppressed because it is too large
View File


+ 11
- 0
dist/js/plugins/jquery-ui-touch-punch.js View File

@@ -0,0 +1,11 @@
1
+/*!
2
+ * jQuery UI Touch Punch 0.2.3
3
+ *
4
+ * Copyright 2011–2014, Dave Furfero
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ *
7
+ * Depends:
8
+ *  jquery.ui.widget.js
9
+ *  jquery.ui.mouse.js
10
+ */
11
+!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);

+ 6
- 0
dist/js/plugins/jquery-ui.js
File diff suppressed because it is too large
View File


+ 4
- 0
dist/js/plugins/jquery.nice-select.min.js View File

@@ -0,0 +1,4 @@
1
+/*  jQuery Nice Select - v1.0
2
+    https://github.com/hernansartorio/jquery-nice-select
3
+    Made by Hernán Sartorio  */
4
+!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);

+ 6
- 0
dist/js/plugins/magnific-popup.js
File diff suppressed because it is too large
View File


+ 2
- 0
dist/js/plugins/mouse-parallax.js
File diff suppressed because it is too large
View File


+ 215
- 0
dist/js/plugins/plugins.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/js/plugins/plugins.min.js
File diff suppressed because it is too large
View File


+ 11
- 0
dist/js/plugins/scrollup.js View File

@@ -0,0 +1,11 @@
1
+
2
+/*
3
+ * 
4
+ * scrollup 
5
+ * Url: http://markgoodyear.com/labs/scrollup/
6
+ * v2.4.1
7
+ * 
8
+ */
9
+!function(l,o,e){"use strict";l.fn.scrollUp=function(o){l.data(e.body,"scrollUp")||(l.data(e.body,"scrollUp",!0),l.fn.scrollUp.init(o))},l.fn.scrollUp.init=function(r){var s,t,c,i,n,a,d,p=l.fn.scrollUp.settings=l.extend({},l.fn.scrollUp.defaults,r),f=!1;switch(d=p.scrollTrigger?l(p.scrollTrigger):l("<a/>",{id:p.scrollName,href:"#top"}),p.scrollTitle&&d.attr("title",p.scrollTitle),d.appendTo("body"),p.scrollImg||p.scrollTrigger||d.html(p.scrollText),d.css({display:"none",position:"fixed",zIndex:p.zIndex}),p.activeOverlay&&l("<div/>",{id:p.scrollName+"-active"}).css({position:"absolute",top:p.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+p.activeOverlay,zIndex:p.zIndex}).appendTo("body"),p.animation){case"fade":s="fadeIn",t="fadeOut",c=p.animationSpeed;break;case"slide":s="slideDown",t="slideUp",c=p.animationSpeed;break;default:s="show",t="hide",c=0}i="top"===p.scrollFrom?p.scrollDistance:l(e).height()-l(o).height()-p.scrollDistance,n=l(o).scroll(function(){l(o).scrollTop()>i?f||(d[s](c),f=!0):f&&(d[t](c),f=!1)}),p.scrollTarget?"number"==typeof p.scrollTarget?a=p.scrollTarget:"string"==typeof p.scrollTarget&&(a=Math.floor(l(p.scrollTarget).offset().top)):a=0,d.click(function(o){o.preventDefault(),l("html, body").animate({scrollTop:a},p.scrollSpeed,p.easingType)})},l.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},l.fn.scrollUp.destroy=function(r){l.removeData(e.body,"scrollUp"),l("#"+l.fn.scrollUp.settings.scrollName).remove(),l("#"+l.fn.scrollUp.settings.scrollName+"-active").remove(),l.fn.jquery.split(".")[1]>=7?l(o).off("scroll",r):l(o).unbind("scroll",r)},l.scrollUp=l.fn.scrollUp}(jQuery,window,document);
10
+
11
+

+ 13
- 0
dist/js/plugins/slick.js
File diff suppressed because it is too large
View File


+ 8
- 0
dist/js/plugins/svg-injector.min.js View File

@@ -0,0 +1,8 @@
1
+/**
2
+ * SVGInjector v1.1.3 - Fast, caching, dynamic inline SVG DOM injection library
3
+ * https://github.com/iconic/SVGInjector
4
+ *
5
+ * Copyright (c) 2014-2015 Waybury <hello@waybury.com>
6
+ * @license MIT
7
+ */
8
+!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},l=0,s=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},v=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(l){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},h=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===s.indexOf(e)&&(s.push(e),e.setAttribute("src",""),v(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var v=e.getAttribute("style");v&&i.setAttribute("style",v);var h=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(h,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});var g,m,b,y,A,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach(function(t){g=t,b=w[t],m=i.querySelectorAll("defs "+g+"[id]");for(var e=0,r=m.length;r>e;e++){y=m[e].id,A=y+"-"+l;var n;o.call(b,function(t){n=i.querySelectorAll("["+t+'*="'+y+'"]');for(var e=0,r=n.length;r>e;e++)n[e].setAttribute(t,"url(#"+A+")")}),m[e].id=A}}),i.removeAttribute("xmlns:a");for(var x,S,k=i.querySelectorAll("script"),j=[],G=0,T=k.length;T>G;G++)S=k[G].getAttribute("type"),S&&"application/ecmascript"!==S&&"application/javascript"!==S||(x=k[G].innerText||k[G].textContent,j.push(x),i.removeChild(k[G]));if(j.length>0&&("always"===n||"once"===n&&!c[f])){for(var M=0,V=j.length;V>M;M++)new Function(j[M])(t);c[f]=!0}var E=i.querySelectorAll("style");o.call(E,function(t){t.textContent+=""}),e.parentNode.replaceChild(i,e),delete s[s.indexOf(e)],e=null,l++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var l=0;o.call(t,function(e){h(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++l&&r(l)})})}else t?h(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document);

+ 3
- 0
dist/js/plugins/wow.js
File diff suppressed because it is too large
View File


+ 67
- 0
dist/js/product.js View File

@@ -0,0 +1,67 @@
1
+
2
+async function getDataStatAxios(url) {
3
+    const config = {
4
+        url,
5
+        method: 'get',
6
+        headers: {
7
+            'Authorization': `stat 05b2f2ca510344968c65e1ebf49a5595`,
8
+        }
9
+    };
10
+
11
+    let response = await axios(config);
12
+    let item_array = JSON.parse(response.data.result);
13
+    $.each(item_array, function (key, value) {
14
+        let item_html = `
15
+            <div class="col-lg-4 col-md-6 pb-3 items_ptoducts" data_item_search="${value.productname}">
16
+                <div class="card h-100 shadow border-0 p-1">
17
+                    <div class="card-head text-center">
18
+                    <img src="../dist/assets/imgs/Navbar/Accessiories-1.png" class="img-fluid"/>
19
+                    </div>
20
+                    <div class="card-body">
21
+                        <ul style="list-style:none" class="h-10p p-0">
22
+                            <li class="border-bottom py-1 satoshi_font">${value.productname}</li>
23
+                            <li class="border-bottom py-1 d-none satoshi_font">${value.itemname}</li>
24
+                            <li class="border-bottom py-1 d-none satoshi_font">${value.sku}</li>
25
+                        </ul>
26
+                        <div>
27
+                        <a href="#" class="bg-black btn font-1-2 px-5 rounded-5 text-white w-100 satoshi_font" data_detail="${value.productid}">Details</a>
28
+                        </div>
29
+                    </div>
30
+                </div>
31
+            </div>`;
32
+        // $(".product_name").html(value.productname);
33
+        $(".item_details").append(item_html);
34
+    })
35
+    $(".item_details").find(".items_ptoducts").each(function(){
36
+        $(this).find(".card_body").find("a.btn").click(function(){
37
+            let product_id = $(this).find(".card-body").find("a.btn").attr("data_detail");
38
+            let loc_path = '/productdetails.html'
39
+                   if (window.location.pathname.includes(loc_path)) {
40
+                       window.location.href = `?itemid=${product_id}`
41
+                   }
42
+                   else {
43
+                       window.location.href = `/productdetails.html?itemid=${product_id}`;
44
+                   }
45
+        })
46
+    });
47
+}
48
+let port = SERVERNAME
49
+let loc_id = window.location.search;
50
+let loc_url = loc_id.split("=");
51
+let locpath = "/products.html?products";
52
+let url;
53
+if (window.location.href.includes(locpath)) {
54
+    url = `${port}/apis/v4/bizgaze/integrations/products/getallproducts`;
55
+}else{
56
+    url = `${port}/apis/v4/bizgaze/integrations/products/getproductsbyid/itemgroupid/${loc_url[1]}`;
57
+}
58
+getDataStatAxios(url);
59
+
60
+$("#item_search").on("keyup", function() {
61
+    var value = $(this).val().toLowerCase();
62
+    $(".list_items").find(".items_ptoducts").filter(function() {
63
+      $(this).toggle($(this).attr("data_item_search").toLowerCase().indexOf(value) > -1)
64
+    });
65
+});
66
+
67
+

+ 943
- 0
dist/js/productdetails/laptopd.js View File

@@ -0,0 +1,943 @@
1
+function startDetails() {
2
+    // http://127.0.0.1:5502/productdetails.html?productId=106633230000024
3
+    
4
+    if (window.location.search.split('=')[0] == '') {
5
+        window.location.href = "/notfound.html";
6
+        return;
7
+    }
8
+    let productId = window.location.hash.split('#')[1].split('=')[1];
9
+   // console.log(productId);
10
+    let itemtagscombinationRes = null;
11
+    let labels = {};
12
+    let isThereInLabel = {};
13
+    let currentComb = null;
14
+
15
+    let colorId = null;
16
+
17
+    let group = {};
18
+
19
+    let loadingActions = {
20
+        addLoader() {
21
+            $('.loadingCall').removeClass('d-none');
22
+            $('.mainContanierProduct').addClass('d-none');
23
+        },
24
+        removeLoader() {
25
+            $('.loadingCall').addClass('d-none');
26
+            $('.mainContanierProduct').removeClass('d-none');
27
+        }
28
+    }
29
+
30
+    let currentClick = null;
31
+
32
+    if (productId) {
33
+        swapSectionsVideo();
34
+        loadingActions.addLoader();
35
+        updateProductId(productId);
36
+        getProductDetails(productId);
37
+        appendSpecs(productId)
38
+    } else {
39
+        window.location.href = "/notfound.html"
40
+    }
41
+
42
+    function updateProductId(val) {
43
+        $('#productidtag').val(val);
44
+    }
45
+
46
+    function updateItemId(val) {
47
+        $('#itemidtag').val(val);
48
+    }
49
+
50
+    let specification_wrap_action = {
51
+        remove() {
52
+
53
+            $('.specification-wrap').addClass('d-none');
54
+        },
55
+
56
+        add() {
57
+            $('.specification-wrap').removeClass('d-none');
58
+        }
59
+    }
60
+
61
+    let description_action = {
62
+        addVal(value) {
63
+            $('.description-wrap > p').html(value);
64
+        },
65
+
66
+        removeVal(value) {
67
+            $('.description-wrap > p').html('');
68
+        }
69
+    }
70
+
71
+    function getSpecsItemHTML({ name, des, itemid, id }) {
72
+        let isMobile = $(window).width()<=600 ? '' : '';
73
+        let addPaddM =  $(window).width()<=600 ? 'py-2' : 'py-4';
74
+        return `<div id="${id}" data-specitemid="${itemid}" >
75
+        <div class="row   border-bottom">
76
+            <div class="col-sm-3 ${isMobile} font-weight-600  ${addPaddM} ">
77
+            ${name}
78
+            </div>
79
+            <div class="col-sm-9  py-2 d-flex align-items-center">
80
+            ${des}	
81
+            </div>
82
+        </div>
83
+    </div>`;
84
+    }
85
+    // function getSpecsItemHTML({name,des,itemid,id}){
86
+    //     return ` <tr id="${id}" data-specitemid="${itemid}">
87
+    //     <td style="width:200px">${name}</td>
88
+    //     <td class="">${des}</td>
89
+    // </tr>`;
90
+    // }
91
+
92
+    async function appendSpecs(id) {
93
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
94
+
95
+        if (resData.isError) {
96
+            $('.productdetailstabs').addClass('d-none');
97
+            $('.specContainerleft').html('')
98
+            $('.specContainerRight').html('')
99
+            return;
100
+        }
101
+        $('.productdetailstabs ').removeClass('d-none');
102
+        const res = resData.response;
103
+   //     console.log(JSON.parse(res.result));
104
+        const data = JSON.parse(res.result);
105
+     //   console.log(data);
106
+        let html = '';
107
+        let leftHtml = '';
108
+        let rightHtml = '';
109
+
110
+        if (data.length == 0) {
111
+            $('.productdetailstabs ').addClass('d-none');
112
+            $('.specContainerleft').html('')
113
+            $('.specContainerRight').html('')
114
+            return;
115
+        }
116
+
117
+        for (let i = 0; i < data.length; i++) {
118
+            const { specificationname, specificationitemid, itemid, description } = data[i];
119
+            if ((i + 1) % 2 == 0) {
120
+                rightHtml += getSpecsItemHTML({
121
+                    name: specificationname, id: specificationitemid, itemid, des: description
122
+                })
123
+            } else {
124
+                leftHtml += getSpecsItemHTML({
125
+                    name: specificationname, id: specificationitemid, itemid, des: description
126
+                });
127
+            }
128
+
129
+        }
130
+
131
+        $('.specContainerleft').html(leftHtml)
132
+        $('.specContainerRight').html(rightHtml)
133
+
134
+    }
135
+
136
+
137
+    function getParentHTML(name, productid, id, isMain) {
138
+        return `<div data-parentidgroup="${name?.replace(" ", '')}-parent" class="pb-2 groupingitems_search ${name?.replace(" ", '')}-parent">
139
+        <h5 class="py-2 smallHeadingProductDetails">${name}</h5>
140
+        <div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
141
+           
142
+        </div>
143
+    </div>`;
144
+    }
145
+
146
+    function onClickHandler(e) {
147
+
148
+        $(e).parent().find('.borderselector').removeClass('borderselector');
149
+
150
+        $(e).addClass('borderselector')
151
+
152
+    }
153
+
154
+    function getChildHTML(tagid, name, isTrue,parentid) {
155
+
156
+        let blue = '#253746';
157
+        let greenLight = '#5e7975';
158
+        let brown = '#624839';
159
+        let bgColor = '';
160
+       if(name === 'Deep Sea Blue'){
161
+        bgColor = blue;
162
+       }else if(name == 'Desert Brown'){
163
+        bgColor =  brown;
164
+       }else if(name == 'Eucalyptus Green'){
165
+        bgColor = greenLight;
166
+       }
167
+
168
+        if(colorId == parentid){
169
+            return `
170
+            <div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} colorselector card text-center small-font cursor-pointer ">
171
+        <span  style="
172
+        height: 25px;
173
+        border-radius: 5px;
174
+        width:25px;
175
+        background: ${bgColor} !important;
176
+        pointer-events:none;
177
+      
178
+    "></span>
179
+            </div> `
180
+        }
181
+        return `
182
+            <div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
183
+                ${name}
184
+            </div> `
185
+
186
+
187
+    }
188
+
189
+    function addeventlisteners() {
190
+
191
+        $('.optiontaganwi').each(function (i, el) {
192
+            $(el).click(function (e) {
193
+                
194
+                $('#quantity').val(1);
195
+
196
+                $(e.target).parent().find('.borderselector').removeClass('borderselector');
197
+                $(e.target).addClass('borderselector');
198
+            
199
+                currentClick = e.target;
200
+                ;
201
+             //searchComb();
202
+                // getAllCombination();
203
+                getandsetCombination();
204
+              
205
+            })
206
+        });
207
+
208
+    }
209
+
210
+    function getandsetCombination(){
211
+        
212
+        let keyOption = $(currentClick).data('tagiditem');
213
+        $('.disabled-option-item').removeClass('disabled-option-item');
214
+        let tagsNames = [];
215
+     
216
+       
217
+
218
+        let currOptionAvaIds = {};
219
+       
220
+        $('.borderselector').each(function (i,e){
221
+            let id = $(e).data('tagiditem');
222
+            tagsNames.push(id);
223
+        });
224
+      
225
+
226
+        for(let i=0;i<itemtagscombinationRes.length;i++){
227
+            let tagItems = itemtagscombinationRes[i].tagids;;
228
+            if(tagItems.includes(keyOption)){
229
+                let splitArr = tagItems.split('|');
230
+                for(let j=0;j<splitArr.length;j++){
231
+                    if(keyOption){
232
+                        currOptionAvaIds[splitArr[j]] = splitArr[j];
233
+                    }
234
+                  
235
+                }
236
+            }
237
+        }
238
+
239
+      //  console.log(currOptionAvaIds);
240
+//console.log(itemtagscombinationRes);
241
+        let parentsArr = []; 
242
+        $('.optiontaganwi').each(function (i,e){
243
+           
244
+            let currParent = $(e).parents('.groupingitems_search');
245
+        
246
+            if(currParent.find(`[data-tagiditem="${keyOption}"]`).length==0){
247
+                let currId = $(e).data('tagiditem');
248
+                if(!currOptionAvaIds[currId]){
249
+                    if($(e).hasClass('borderselector')){
250
+                        parentsArr.push(currParent);
251
+                        $(e).removeClass('borderselector');
252
+                    }
253
+                    $(e).addClass('disabled-option-item');
254
+                }
255
+            }
256
+        });
257
+
258
+        for(let i=0;i<parentsArr.length;i++){
259
+            let currParent = parentsArr[i];
260
+            currParent.find('.optiontaganwi').each(function (j,e){
261
+                let isTrue = $(e).hasClass('disabled-option-item');
262
+                if(!isTrue){
263
+                    $(e).addClass('borderselector');
264
+                    return false; 
265
+                }
266
+            });
267
+        }
268
+
269
+        // $('.optiontaganwi').addClass('disabled-option-item');
270
+        let parentId = $(currentClick).parents('.groupingitems_search');
271
+        let parentData = $(parentId).data('parentidgroup');
272
+        let parentArr = [];
273
+       $('.groupingitems_search').each(function (i,e){
274
+           const curParentId =  $(e).data('parentidgroup');
275
+           if(parentData != curParentId){
276
+            let obj = {
277
+                name:$(e).find('.smallHeadingProductDetails').html(),
278
+                arr:[]
279
+            }
280
+                $(e).find('.optiontaganwi').each(function (j,evt){
281
+                    let id = $(evt).data('tagiditem');
282
+                    obj.arr.push(id);
283
+                });
284
+                parentArr.push(obj);
285
+
286
+           }
287
+       })
288
+
289
+      // console.log(parentArr);
290
+
291
+       let arrone = parentArr[0].arr;
292
+       let arrtwo = []; 
293
+       if(parentArr.length>1){
294
+        arrtwo = parentArr[1]?.arr;
295
+       }
296
+
297
+       let currId = keyOption;
298
+       let ids = [];
299
+       for(let i=0;i<arrone.length;i++){
300
+        //let currEl = [currId,arrone[i]];
301
+        let currEl = ``
302
+        for(let j=0;j<arrtwo.length;j++){
303
+            currEl = `${currId}|${arrone[i]}|${arrtwo[j]}`;
304
+
305
+            ids.push(currEl);
306
+            currEl = '';
307
+        }
308
+        
309
+       }
310
+       console.log(ids,'ids');
311
+       let findObj = [];
312
+       debugger 
313
+       for(let i=0;i<ids.length;i++){
314
+      
315
+        let curId = ids[i]
316
+        for(let j=0;j<itemtagscombinationRes.length;j++){
317
+            const currItem = itemtagscombinationRes[j].tagids.split('|');
318
+            let isTrue = true;
319
+            for(let k=0;k<currItem.length;k++){
320
+                if(!curId.includes(currItem[k])){
321
+                    isTrue = false;
322
+                    break;
323
+                }
324
+            }
325
+
326
+            if(isTrue){
327
+                findObj.push(itemtagscombinationRes[j]);
328
+            }
329
+        }
330
+       }
331
+
332
+
333
+       //console.log(findObj);
334
+
335
+       $('.optiontaganwi').addClass('disabled-option-item');
336
+
337
+debugger;
338
+       for(let i=0;i<findObj.length;i++){
339
+
340
+        let item = findObj[i].tagids.split('|');
341
+        for(let j=0;j<item.length;j++){
342
+            $(`[data-tagiditem=${item[j]}]`).removeClass('disabled-option-item');
343
+        }
344
+       
345
+       }
346
+
347
+       $(parentId).find('.optiontaganwi').each(function (i,e){
348
+        $(e).removeClass('disabled-option-item')
349
+       });
350
+
351
+
352
+       for(let i=0;i<itemtagscombinationRes.length;i++){
353
+        let currIds = itemtagscombinationRes[i].tagids;
354
+        let isTrue = true;
355
+        let isPro = false;
356
+
357
+        for(let j=0;j<tagsNames.length;j++){
358
+            if(tagsNames.join().includes('106631360000128')&&(tagsNames.join().includes('106631360000132')||tagsNames.join().includes('106631360000133'))){
359
+                isPro = true;
360
+            }
361
+            if(!currIds.includes(tagsNames[j])){
362
+                isTrue = false;
363
+            }
364
+        }
365
+
366
+        if(isTrue){
367
+            const { quantity } = itemtagscombinationRes[i];
368
+            if (true) {
369
+                currentComb = itemtagscombinationRes[i];
370
+              
371
+                updateDetailsByObj(itemtagscombinationRes[i]);
372
+
373
+                if(isPro){
374
+                    $(`[data-tagiditem="106631360000089"]`).addClass(' disabled-option-item')
375
+                    $(`[data-tagiditem="106631360000088"]`).addClass(' disabled-option-item')
376
+                }
377
+
378
+                
379
+            } else {
380
+
381
+                let name = itemtagscombinationRes[i].itemname.split('-')[0];
382
+                $('#addtocart').addClass('disabled');
383
+                let itemsName = name;
384
+                $('.borderselector').each(function (i, e) {
385
+                    itemsName += ` ${$(e).html().trim()}`;
386
+                });
387
+
388
+                updateItemId(null);
389
+
390
+                let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
391
+            
392
+                $('.productDetailsMain  > img').attr('src', defaultImg);
393
+
394
+                specification_wrap_action.remove();
395
+                $('#skudetailitem').val(-1)
396
+                $('.productname').html(itemsName)
397
+               
398
+
399
+                $('.msgErrorDetailsItem').removeClass('d-none');
400
+                $('.des_productdes').html('');
401
+                $('.price').html('');
402
+            }
403
+
404
+            initAddToCart()
405
+            return;
406
+        }
407
+        
408
+       }
409
+
410
+   
411
+       
412
+   
413
+        // return;
414
+
415
+    
416
+
417
+
418
+        return;
419
+        let commonTags = [];
420
+      //  $('.optiontaganwi').addClass('disabled-option-item')
421
+
422
+        for(let i=0;i<tagsNames.length;i++){
423
+            let currtagName = tagsNames[i];
424
+            let arr = currtagItemCom(currtagName);
425
+            commonTags.push(arr);
426
+        }
427
+
428
+        
429
+
430
+         console.log(commonTags);
431
+
432
+        // for(let i=0;i<commonTags.length;i++){
433
+        //     let currObj = commonTags[i];
434
+        //     for(let item in currObj){
435
+        //         console.log($(`[data-tagiditem="${item}"]`));
436
+        //         $(`[data-tagiditem="${item}"]`).removeClass('disabled-option-item')
437
+        //     }
438
+        // }
439
+
440
+        let finalAns = {};
441
+        let arra = [];
442
+        for(let i=0;i<commonTags.length;i++){
443
+            let currObj = commonTags[i];
444
+            for(let item in currObj){
445
+                let isTrue = true;
446
+                for(let j=0;j<commonTags.length;j++){
447
+                    if(j!=i){
448
+                        let currComb = commonTags[j];
449
+                        if(!currComb[item]){
450
+                            isTrue = false;
451
+                        }
452
+                    }
453
+                }
454
+                if(isTrue){
455
+                    arra.push(currObj[item])
456
+                    finalAns[currObj[item]] = currObj[item];
457
+                    $(`[data-tagiditem="${item}"]`).removeClass('disabled-option-item')
458
+                }
459
+            }
460
+        }
461
+
462
+        // console.log(arra);
463
+
464
+        
465
+        
466
+
467
+       
468
+       
469
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
470
+        //     let tagItems = itemtagscombinationRes[i].tagids;;
471
+        //     if(tagItems.includes(keyOption)){
472
+        //         let splitArr = tagItems.split('|');
473
+        //         for(let j=0;j<splitArr.length;j++){
474
+        //             commonTags[splitArr[j]] = splitArr[j];
475
+        //         }
476
+        //     }
477
+        // }
478
+
479
+
480
+
481
+        // for(let i=0;i<currOptionAvaIds.length;i++){
482
+        //     let currId = currOptionAvaIds[i];
483
+        //     if(parentId.find(currId).length === 0){
484
+        //         console.log(currId);
485
+        //     }
486
+        // }
487
+    }
488
+
489
+    
490
+    
491
+    function currtagItemCom(keyOption){
492
+        debugger;
493
+        let arr = [];
494
+        let commonTags = {};
495
+        for(let i=0;i<itemtagscombinationRes.length;i++){
496
+            let tagItems = itemtagscombinationRes[i].tagids;;
497
+            if(tagItems.includes(keyOption)){
498
+                let splitArr = tagItems.split('|');
499
+                for(let j=0;j<splitArr.length;j++){
500
+                    if(!commonTags[splitArr[j]]){
501
+                        commonTags[splitArr[j]] = {
502
+                        keyOption,
503
+                        data:itemtagscombinationRes[i]
504
+                        };
505
+                        arr.push(splitArr[j]);
506
+
507
+                    }
508
+                    
509
+                }
510
+            }
511
+        }
512
+
513
+        return commonTags;
514
+    }
515
+
516
+
517
+
518
+    function updateDetailsByObj(obj) {
519
+        $('.productname').html(obj.itemname);
520
+        $('.titleproductnav').html(obj.itemname);
521
+        let  [currencySymbol, amount] = getCurrencySymbol(obj?.pricelist||0);
522
+
523
+        let commingSoonText = window.location.href.toLowerCase().includes('zeno')||window.location.href.toLowerCase().includes('fyro')
524
+        $('.price').html(obj.pricelist ? `<span class="font-w600">${currencySymbol}${amount}</span>${commingSoonText?'<span class="mx-1 badge  bg-gradient-violet text-a-color">Coming Soon</span>':''}` : 'coming soon');
525
+        $('.price').attr('data-price',obj.pricelist);
526
+        appendSpecs(obj.itemid)
527
+        $('#skudetailitem').val(obj.sku)
528
+        $('.des_productdes').html(obj.itemdescription);
529
+        $('#addtocart').attr('data-qty', obj.quantity);
530
+
531
+
532
+        let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
533
+      //  console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
534
+debugger;
535
+let productId = window.location.hash.split('#')[1]?.split('=')[1];
536
+let itemId = window.location.hash.split('#')[2]?.split('=')[1];
537
+history.replaceState(undefined, undefined, `#productId=${productId}#itemid=${obj.itemid}`)
538
+        $('.productDetailsMain  > img').attr('src', defaultImg).attr('loading','lazy');
539
+
540
+        updateItemId(obj.itemid);
541
+
542
+//console.log(obj,'objobjobj');
543
+        if (!obj.pricelist || !obj.quantity) {
544
+            $('.buynow').attr('disabled', true);
545
+            $('#addtocart').attr('disabled', true);
546
+        } else {
547
+            $('.buynow').attr('disabled', false);
548
+            $('#addtocart').attr('disabled', false);
549
+        }
550
+    }
551
+
552
+    function searchComb() {
553
+        let valuesSelected = [];
554
+        $('.optiontaganwi').removeClass('disabled-option-item')
555
+
556
+        $('#addtocart').removeClass('disabled');
557
+        $('.msgErrorDetailsItem').addClass('d-none');
558
+        $('.borderselector,border_selector').each(function (i, el) {
559
+           // console.log($(el).html())
560
+            let val = $(el).data('tagiditem');
561
+            valuesSelected.push(val);
562
+        });
563
+
564
+        let labelRecord = {};
565
+
566
+        for (let label in labels) {
567
+            labelRecord[label] = false;
568
+        }
569
+
570
+        specification_wrap_action.add();
571
+   
572
+        let unFiler = null;
573
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
574
+            const currItem = itemtagscombinationRes[i];
575
+            const { tagids } = currItem;
576
+
577
+
578
+            let isTrue = true;
579
+            let labelFilter = labelRecord;
580
+
581
+            for (let i = 0; i < valuesSelected.length; i++) {
582
+
583
+                if (!tagids.includes(valuesSelected[i])) {
584
+                    isTrue = false
585
+
586
+                    unFiler = labelFilter;
587
+                    break;
588
+                }
589
+                labelFilter[group[valuesSelected[i]]] = true;
590
+            }
591
+
592
+            if (isTrue) {
593
+              //  console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
594
+                const { quantity } = itemtagscombinationRes[i];
595
+                if (quantity >= $('#quantity').val() && quantity >= 1) {
596
+                    currentComb = itemtagscombinationRes[i];
597
+                    // $('.productname').html(itemtagscombinationRes[i].itemname)
598
+                    // $('.price').html(itemtagscombinationRes[i].pricelist);
599
+                    // location.hash = itemtagscombinationRes[i].itemname.trim();
600
+                    // appendSpecs(itemtagscombinationRes[i].itemid)
601
+                    // history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
602
+
603
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
604
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
605
+                    updateDetailsByObj(itemtagscombinationRes[i]);
606
+                } else {
607
+
608
+                    let name = itemtagscombinationRes[i].itemname.split('-')[0];
609
+                    $('#addtocart').addClass('disabled');
610
+                    let itemsName = name;
611
+                    $('.borderselector').each(function (i, e) {
612
+                        itemsName += ` ${$(e).html().trim()}`;
613
+                    });
614
+
615
+                    updateItemId(null);
616
+
617
+                    let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
618
+                   // console.log(itemtagscombinationRes[i].itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
619
+            
620
+                    $('.productDetailsMain  > img').attr('src', defaultImg);
621
+
622
+                    specification_wrap_action.remove();
623
+                    $('#skudetailitem').val(-1)
624
+                    $('.productname').html(itemsName)
625
+                    // history.replaceState(null, null, `#`);
626
+
627
+                    $('.msgErrorDetailsItem').removeClass('d-none');
628
+                    $('.des_productdes').html('');
629
+                    $('.price').html('');
630
+                }
631
+
632
+                initAddToCart()
633
+                return;
634
+
635
+            }
636
+
637
+        }
638
+
639
+        
640
+
641
+        alert("j");
642
+       
643
+        let name = itemtagscombinationRes[0].itemname.split('-')[0];
644
+        let itemsName = name;
645
+        $('.borderselector').each(function (i, e) {
646
+            itemsName += `- ${$(e).html().trim()}`;
647
+        })
648
+        specification_wrap_action.remove();
649
+        $('.productname').html(itemsName)
650
+        $('#skudetailitem').val(-1)
651
+        $('.price').html('');
652
+        $('#addtocart').addClass('disabled');
653
+        $('.msgErrorDetailsItem').removeClass('d-none');
654
+
655
+        initAddToCart()
656
+    }
657
+
658
+    function getAllCombination() {
659
+        debugger;
660
+        const currClickAttr = $(currentClick).html().trim();
661
+        const optionId = $(currentClick).data('tagiditem');
662
+
663
+        let curr = $(currentClick).parents('.groupingitems_search').data('parentidgroup');
664
+        $('.groupingitems_search').each(function (i, e) {
665
+            const id = $(e).data('parentidgroup');
666
+            if (id != curr) {
667
+                $(e).find('.optiontaganwi').addClass('disabled-option-item');
668
+                $(e).find('.borderselector').removeClass('borderselector');
669
+            }
670
+        });
671
+
672
+        let ansArr = [];
673
+        let index = 0;
674
+        let comb = null;
675
+        for(let i=0;i<itemtagscombinationRes.length;i++){
676
+          
677
+            let currIds = itemtagscombinationRes[i].tagids;
678
+          
679
+            if(currIds.includes(optionId)){
680
+                currIds = currIds.split('|');
681
+              
682
+                for(let j=0;j<currIds.length;j++){
683
+                    debugger;
684
+                    if(index==0 &&optionId != currIds[j] ) {
685
+                        $(`[data-tagiditem="${currIds[j]}"]`).addClass('borderselector')
686
+                        comb = itemtagscombinationRes[i];
687
+                        index++;
688
+                    }
689
+                    $(`[data-tagiditem="${currIds[j]}"]`).removeClass('disabled-option-item');
690
+                   
691
+                    // $().parents('[data-tagid]').find()
692
+                }    
693
+    
694
+            }
695
+
696
+            
697
+           
698
+        }
699
+
700
+      //  console.log(comb,'comb tag');
701
+
702
+        updateDetailsByObj(comb);
703
+
704
+        let currentItem = comb.tagids.split('|');
705
+
706
+        for(let i=0;i<currentItem.length;i++){
707
+            $(`[data-tagiditem="${currentItem[i]}"]`).removeClass('disabled-option-item').addClass('borderselector');
708
+        }
709
+
710
+        // history.replaceState(null, null, `#${comb.itemname}`);
711
+        // window.location.href =  `#${comb.itemname}`
712
+        console.log(itemtagscombinationRes,'gobal');
713
+        return;
714
+      
715
+
716
+    };
717
+
718
+
719
+   
720
+
721
+
722
+    async function getProductDetails(id) {
723
+
724
+
725
+        debugger;
726
+
727
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
728
+
729
+       
730
+        
731
+        if (resData.isError) {
732
+            loadingActions.removeLoader();
733
+            alert(resData.errorMsg.message);
734
+            return;
735
+        }
736
+
737
+        if(resData.response.result == '[]' || !resData.response.result){
738
+            $('.barbgnav').removeClass('d-none')
739
+            loadingActions.removeLoader();
740
+            toasterHelper("Something Went Wrong")
741
+            return;
742
+        }
743
+
744
+        let res = resData.response;
745
+       
746
+
747
+        res = JSON.parse(res.result);
748
+       // console.log(res,'resDataresDataresDataresDataresData');
749
+       // console.log(res, 'productattributelist');
750
+
751
+        if (!res) {
752
+            loadingActions.removeLoader();
753
+            return;
754
+        };
755
+
756
+
757
+
758
+
759
+        let html = '';
760
+
761
+        for (let i = 0; i < res.length; i++) {
762
+            const currItem = res[i];
763
+            // parenttagid means under what label
764
+            // tag id means it know unquie id
765
+            const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
766
+
767
+            if (labels[parentattribute]) {
768
+                labels[parentattribute].items.push({
769
+                    attribute,
770
+                    tagid: tagid
771
+                });
772
+            } else {
773
+                labels[parentattribute] = {
774
+                    id: parenttagid,
775
+                    items: [{
776
+                        attribute,
777
+                        tagid: tagid
778
+                    }]
779
+                };
780
+               
781
+                if(parentattribute.toLowerCase() === 'colour'){
782
+                    colorId = parenttagid;
783
+                }
784
+                html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
785
+            }
786
+
787
+        }
788
+        $('#spec-container-details').html(html);
789
+
790
+
791
+      console.log(labels,'labels');
792
+
793
+        let childIds = [];
794
+
795
+        for (let item in labels) {
796
+            let { id, items } = labels[item];
797
+            // $(`[data-tagid=${id}]`)
798
+            let html = '';
799
+
800
+            for (let i = 0; i < items.length; i++) {
801
+                const { attribute, tagid } = items[i]
802
+                childIds.push(tagid);
803
+                group[attribute] = item;
804
+              //  console.log(attribute,colorId,"s");
805
+                html += getChildHTML(tagid, attribute, i == 0,id);
806
+               // console.log(attribute,"attributeattributeattributeattribute");
807
+            }
808
+            debugger;
809
+            $(`[data-tagid="${id}"]`).html(html);
810
+        }
811
+        itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
812
+        itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
813
+        console.log(itemtagscombinationRes, "conductt");
814
+
815
+        let itemidSearch = window.location.hash.split('#')[2]?.split('=')[1];
816
+
817
+        if(!itemidSearch){
818
+            itemidSearch = itemtagscombinationRes[0].itemid
819
+        }
820
+
821
+        let valuesSelected = [];
822
+
823
+        $('.borderselector').each(function (i, el) {
824
+
825
+            let val = $(el).html();
826
+            valuesSelected.push(val.trim());
827
+        });
828
+debugger;
829
+        // let searchParams = window.location.search.split("&");
830
+        // let skuId = window.location.hash.split('#')[2].split('=')[1];
831
+        // skuId = skuId.split('=')[1]
832
+        let isGo = true;
833
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
834
+            const currItem = itemtagscombinationRes[i];
835
+
836
+            const { tagnames, sku, itemid } = currItem;
837
+
838
+            isThereInLabel[tagnames] = itemtagscombinationRes[i];
839
+            let isTrue = true;
840
+            if (isGo) {
841
+                // for(let i=0;i<valuesSelected.length;i++){
842
+                //     if(!tagnames.includes(valuesSelected[i])){
843
+                //         isTrue = false
844
+                //     }
845
+                // }
846
+                if (itemidSearch != itemid) {
847
+                    isTrue = false
848
+                }
849
+                // if (i != 0) {
850
+                //     isTrue = false
851
+                // }
852
+                if (isTrue) {
853
+
854
+                   // console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
855
+
856
+
857
+                    currentComb = itemtagscombinationRes[i];
858
+
859
+
860
+                    updateDetailsByObj(itemtagscombinationRes[i]);
861
+
862
+
863
+
864
+                    isGo = false;
865
+                    let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
866
+                    tagids = tagids.split('|');
867
+                    tagnames = tagnames.split('|');
868
+                    $('.optiontaganwi').removeClass('borderselector');
869
+
870
+                    for (let i = 0; i < tagids.length; i++) {
871
+
872
+                        $(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
873
+                    }
874
+
875
+                    break;
876
+                    // tagiditem
877
+                }
878
+            }
879
+        }
880
+
881
+
882
+        if (isGo && itemtagscombinationRes.length != 0) {
883
+
884
+          //  console.log(itemtagscombinationRes[0]);
885
+            let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
886
+            tagids = tagids.split('|');
887
+            tagnames = tagnames.split('|');
888
+            $('.optiontaganwi').removeClass('borderselector');
889
+            currentComb = itemtagscombinationRes[0];
890
+            // updateItemId(itemtagscombinationRes[0].itemid);
891
+
892
+            for (let i = 0; i < tagids.length; i++) {
893
+
894
+                $(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
895
+                // $(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
896
+                // $(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
897
+                // $(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
898
+            }
899
+
900
+            // $('.price').html(pricelist);
901
+            // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
902
+            // appendSpecs(itemtagscombinationRes[0].itemid);
903
+
904
+            updateDetailsByObj(itemtagscombinationRes[0]);
905
+            //console.log(childIds);
906
+            // 
907
+
908
+        }
909
+
910
+      
911
+
912
+        //getAllCombination()
913
+
914
+
915
+
916
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
917
+        //     const {tagnames} = itemtagscombinationRes[i];
918
+
919
+        // }
920
+
921
+        $('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
922
+
923
+
924
+
925
+        //getting the first borderselector in first $('.groupingitems_search')[0] 
926
+
927
+        let firstParentGroup = $('.groupingitems_search')[0];
928
+        debugger;
929
+        let optionId = $(firstParentGroup).find('.borderselector').data('tagiditem');
930
+        
931
+        currentClick = $(firstParentGroup).find('.borderselector')
932
+        getandsetCombination();
933
+        addeventlisteners();
934
+        loadingActions.removeLoader();
935
+        return;
936
+       
937
+
938
+    }
939
+
940
+
941
+}
942
+startDetails();
943
+

+ 606
- 0
dist/js/productdetails/laptopdetails.js View File

@@ -0,0 +1,606 @@
1
+function startDetails() {
2
+    // http://127.0.0.1:5502/productdetails.html?productId=106633230000024
3
+    if (window.location.search.split('=')[0] == '') {
4
+        window.location.href = "/notfound.html";
5
+        return;
6
+    }
7
+    let productId = window.location.href.split('=')[1].split('&')[0].split('#')[0];
8
+    console.log(productId);
9
+    let itemtagscombinationRes = null;
10
+    let labels = {};
11
+    let isThereInLabel = {};
12
+    let currentComb = null;
13
+
14
+    let group = {};
15
+
16
+    let loadingActions = {
17
+        addLoader() {
18
+            $('.loadingCall').removeClass('d-none');
19
+            $('.mainContanierProduct').addClass('d-none');
20
+        },
21
+        removeLoader() {
22
+            $('.loadingCall').addClass('d-none');
23
+            $('.mainContanierProduct').removeClass('d-none');
24
+        }
25
+    }
26
+
27
+    let currentClick = null;
28
+
29
+    if (productId) {
30
+        loadingActions.addLoader();
31
+        updateProductId(productId);
32
+        getProductDetails(productId);
33
+        appendSpecs(productId)
34
+    } else {
35
+        window.location.href = "/notfound.html"
36
+    }
37
+
38
+    function updateProductId(val) {
39
+        $('#productidtag').val(val);
40
+    }
41
+
42
+    function updateItemId(val) {
43
+        $('#itemidtag').val(val);
44
+    }
45
+
46
+    let specification_wrap_action = {
47
+        remove() {
48
+
49
+            $('.specification-wrap').addClass('d-none');
50
+        },
51
+
52
+        add() {
53
+            $('.specification-wrap').removeClass('d-none');
54
+        }
55
+    }
56
+
57
+    let description_action = {
58
+        addVal(value) {
59
+            $('.description-wrap > p').html(value);
60
+        },
61
+
62
+        removeVal(value) {
63
+            $('.description-wrap > p').html('');
64
+        }
65
+    }
66
+
67
+    function getSpecsItemHTML({ name, des, itemid, id }) {
68
+        let isMobile = $(window).width()<=600 ? '' : '';
69
+        let addPaddM =  $(window).width()<=600 ? 'py-2' : 'py-4';
70
+        return `<div id="${id}" data-specitemid="${itemid}" >
71
+        <div class="row   border-bottom">
72
+            <div class="col-sm-3 ${isMobile} font-weight-600  ${addPaddM} ">
73
+            ${name}
74
+            </div>
75
+            <div class="col-sm-9  py-2 d-flex align-items-center">
76
+            ${des}	
77
+            </div>
78
+        </div>
79
+    </div>`;
80
+        return `<div id="${id}" data-specitemid="${itemid}" class="">
81
+        <div class="row  border-bottom">
82
+            <div class="col-sm-6 bg-gray-3 py-2">
83
+            ${name}
84
+            </div>
85
+            <div class="col-sm-6  py-2">
86
+            ${des}	
87
+            </div>
88
+        </div>
89
+    </div>`;
90
+
91
+    }
92
+    // function getSpecsItemHTML({name,des,itemid,id}){
93
+    //     return ` <tr id="${id}" data-specitemid="${itemid}">
94
+    //     <td style="width:200px">${name}</td>
95
+    //     <td class="">${des}</td>
96
+    // </tr>`;
97
+    // }
98
+
99
+    async function appendSpecs(id) {
100
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
101
+
102
+        if (resData.isError) {
103
+            $('.productdetailstabs').addClass('d-none');
104
+            $('.specContainerleft').html('')
105
+            $('.specContainerRight').html('')
106
+            return;
107
+        }
108
+        $('.productdetailstabs ').removeClass('d-none');
109
+        const res = resData.response;
110
+        console.log(JSON.parse(res.result));
111
+        const data = JSON.parse(res.result);
112
+        console.log(data);
113
+        let html = '';
114
+        let leftHtml = '';
115
+        let rightHtml = '';
116
+
117
+        if (data.length == 0) {
118
+            $('.productdetailstabs ').addClass('d-none');
119
+            $('.specContainerleft').html('')
120
+            $('.specContainerRight').html('')
121
+            return;
122
+        }
123
+
124
+        for (let i = 0; i < data.length; i++) {
125
+            const { specificationname, specificationitemid, itemid, description } = data[i];
126
+            if ((i + 1) % 2 == 0) {
127
+                rightHtml += getSpecsItemHTML({
128
+                    name: specificationname, id: specificationitemid, itemid, des: description
129
+                })
130
+            } else {
131
+                leftHtml += getSpecsItemHTML({
132
+                    name: specificationname, id: specificationitemid, itemid, des: description
133
+                });
134
+            }
135
+
136
+        }
137
+
138
+        $('.specContainerleft').html(leftHtml)
139
+        $('.specContainerRight').html(rightHtml)
140
+
141
+    }
142
+
143
+
144
+    function getParentHTML(name, productid, id, isMain) {
145
+        return `<div data-parentidgroup="${name?.replace(" ", '')}-parent" class="pb-2 groupingitems_search ${name?.replace(" ", '')}-parent">
146
+        <h5 class="py-2 smallHeadingProductDetails">${name}</h5>
147
+        <div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
148
+           
149
+        </div>
150
+    </div>`;
151
+    }
152
+
153
+    function onClickHandler(e) {
154
+
155
+        $(e).parent().find('.borderselector').removeClass('borderselector');
156
+
157
+        $(e).addClass('borderselector')
158
+
159
+    }
160
+
161
+    function getChildHTML(tagid, name, isTrue) {
162
+
163
+
164
+        return `
165
+            <div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
166
+                ${name}
167
+            </div> `
168
+
169
+
170
+    }
171
+
172
+    function addeventlisteners() {
173
+
174
+        $('.optiontaganwi').each(function (i, el) {
175
+            $(el).click(function (e) {
176
+                debugger;
177
+                $('#quantity').val(1);
178
+
179
+                $(e.target).parent().find('.borderselector').removeClass('borderselector');
180
+                $(e.target).addClass('borderselector');
181
+                searchComb();
182
+                currentClick = e.target;
183
+                getAllCombination();
184
+            })
185
+        });
186
+
187
+    }
188
+
189
+
190
+
191
+    function updateDetailsByObj(obj) {
192
+        $('.productname').html(obj.itemname)
193
+        let  [currencySymbol, amount] = getCurrencySymbol(obj?.pricelist||0);
194
+        
195
+        $('.price').html(obj.pricelist ?`${currencySymbol}${amount}'`:'');
196
+        $('.price').attr('data-price',obj.pricelist);
197
+        appendSpecs(obj.itemid)
198
+        $('#skudetailitem').val(obj.sku)
199
+        $('.des_productdes').html(obj.itemdescription);
200
+        $('#addtocart').attr('data-qty', obj.quantity);
201
+
202
+debugger;
203
+        let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
204
+        console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
205
+
206
+        $('.productDetailsMain  > img').attr('src', defaultImg);
207
+
208
+        updateItemId(obj.itemid);
209
+
210
+
211
+        if (!obj.pricelist) {
212
+            $('.buynow').attr('disabled', true);
213
+            $('#addtocart').attr('disabled', true);
214
+        } else {
215
+            $('.buynow').attr('disabled', false);
216
+            $('#addtocart').attr('disabled', false);
217
+        }
218
+    }
219
+
220
+    function searchComb() {
221
+        let valuesSelected = [];
222
+        $('.optiontaganwi').removeClass('disabled-option-item')
223
+
224
+        $('#addtocart').removeClass('disabled');
225
+        $('.msgErrorDetailsItem').addClass('d-none');
226
+        $('.borderselector,border_selector').each(function (i, el) {
227
+            console.log($(el).html())
228
+            let val = $(el).data('tagiditem');
229
+            valuesSelected.push(val);
230
+        });
231
+
232
+        let labelRecord = {};
233
+
234
+        for (let label in labels) {
235
+            labelRecord[label] = false;
236
+        }
237
+
238
+        console.log(labelRecord);
239
+        specification_wrap_action.add();
240
+        console.log(group);
241
+        let unFiler = null;
242
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
243
+            const currItem = itemtagscombinationRes[i];
244
+            const { tagids } = currItem;
245
+
246
+
247
+            let isTrue = true;
248
+            let labelFilter = labelRecord;
249
+
250
+            for (let i = 0; i < valuesSelected.length; i++) {
251
+
252
+                if (!tagids.includes(valuesSelected[i])) {
253
+                    isTrue = false
254
+
255
+                    unFiler = labelFilter;
256
+                    break;
257
+                }
258
+                labelFilter[group[valuesSelected[i]]] = true;
259
+            }
260
+
261
+            if (isTrue) {
262
+                console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
263
+                const { quantity } = itemtagscombinationRes[i];
264
+                if (quantity >= $('#quantity').val() && quantity >= 1) {
265
+                    currentComb = itemtagscombinationRes[i];
266
+                    // $('.productname').html(itemtagscombinationRes[i].itemname)
267
+                    // $('.price').html(itemtagscombinationRes[i].pricelist);
268
+                    // location.hash = itemtagscombinationRes[i].itemname.trim();
269
+                    // appendSpecs(itemtagscombinationRes[i].itemid)
270
+                    history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
271
+
272
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
273
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
274
+                    updateDetailsByObj(itemtagscombinationRes[i]);
275
+                } else {
276
+
277
+                    let name = itemtagscombinationRes[i].itemname.split('-')[0];
278
+                    $('#addtocart').addClass('disabled');
279
+                    let itemsName = name;
280
+                    $('.borderselector').each(function (i, e) {
281
+                        itemsName += ` ${$(e).html().trim()}`;
282
+                    });
283
+
284
+                    updateItemId(null);
285
+
286
+                    let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
287
+                    console.log(itemtagscombinationRes[i].itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
288
+            
289
+                    $('.productDetailsMain  > img').attr('src', defaultImg);
290
+
291
+                    specification_wrap_action.remove();
292
+                    $('#skudetailitem').val(-1)
293
+                    $('.productname').html(itemsName)
294
+                    history.replaceState(null, null, `#`);
295
+
296
+                    $('.msgErrorDetailsItem').removeClass('d-none');
297
+                    $('.des_productdes').html('');
298
+                    $('.price').html('');
299
+                }
300
+
301
+                initAddToCart()
302
+                return;
303
+
304
+            }
305
+
306
+        }
307
+
308
+        alert("j");
309
+        let name = itemtagscombinationRes[0].itemname.split('-')[0];
310
+        let itemsName = name;
311
+        $('.borderselector').each(function (i, e) {
312
+            itemsName += `- ${$(e).html().trim()}`;
313
+        })
314
+        specification_wrap_action.remove();
315
+        $('.productname').html(itemsName)
316
+        $('#skudetailitem').val(-1)
317
+        $('.price').html('');
318
+        $('#addtocart').addClass('disabled');
319
+        $('.msgErrorDetailsItem').removeClass('d-none');
320
+
321
+        initAddToCart()
322
+    }
323
+
324
+    function getAllCombination() {
325
+        debugger;
326
+        const currClickAttr = $(currentClick).html().trim();
327
+
328
+        let isThere = [];
329
+        for (let item in isThereInLabel) {
330
+            let { tagnames } = isThereInLabel[item];
331
+            if (tagnames.includes(currClickAttr)) {
332
+                isThere.push(isThereInLabel[item])
333
+            }
334
+        }
335
+
336
+        if (!isThere.length) {
337
+            let curr = $(currentClick).parents('.groupingitems_search').data('parentidgroup');
338
+            $('.groupingitems_search').each(function (i, e) {
339
+                const id = $(e).data('parentidgroup');
340
+                if (id != curr) {
341
+                    $(e).find('.optiontaganwi').addClass('disabled-option-item');
342
+                }
343
+
344
+
345
+            });
346
+
347
+            return;
348
+        }
349
+        let selected = [];
350
+        $('.borderselector').each(function (i, e) {
351
+            selected.push($(e).html().trim())
352
+        });
353
+
354
+        // console.log(selected);
355
+        // console.log(isThere);
356
+
357
+        let ishashObj = {};
358
+
359
+        for (let i = 0; i < isThere.length; i++) {
360
+            let { tagnames, tagids } = isThere[i];
361
+            tagnames = tagnames.split('|');
362
+            tagids = tagids.split('|');
363
+
364
+            for (let j = 0; j < tagnames.length; j++) {
365
+                if (!ishashObj[tagnames[j]]) {
366
+                    ishashObj[tagnames[j]] = tagids[j];
367
+                }
368
+            }
369
+        }
370
+
371
+         console.log(ishashObj);
372
+
373
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
374
+
375
+        // }
376
+
377
+    }
378
+
379
+
380
+    async function getProductDetails(id) {
381
+
382
+
383
+        debugger;
384
+
385
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
386
+
387
+        if (resData.isError) {
388
+            loadingActions.removeLoader();
389
+            alert(resData.errorMsg.message);
390
+            return;
391
+        }
392
+
393
+        let res = resData.response;
394
+
395
+        res = JSON.parse(res.result);
396
+        console.log(res, 'productattributelist');
397
+
398
+        if (!res) {
399
+            loadingActions.removeLoader();
400
+            return;
401
+        };
402
+
403
+
404
+
405
+
406
+        let html = '';
407
+
408
+        for (let i = 0; i < res.length; i++) {
409
+            const currItem = res[i];
410
+            // parenttagid means under what label
411
+            // tag id means it know unquie id
412
+            const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
413
+
414
+            if (labels[parentattribute]) {
415
+                labels[parentattribute].items.push({
416
+                    attribute,
417
+                    tagid: tagid
418
+                });
419
+            } else {
420
+                labels[parentattribute] = {
421
+                    id: parenttagid,
422
+                    items: [{
423
+                        attribute,
424
+                        tagid: tagid
425
+                    }]
426
+                };
427
+                html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
428
+            }
429
+
430
+        }
431
+        $('#spec-container-details').html(html);
432
+
433
+
434
+        // console.log(labels,'labels');
435
+
436
+        let childIds = [];
437
+
438
+        for (let item in labels) {
439
+            let { id, items } = labels[item];
440
+            // $(`[data-tagid=${id}]`)
441
+            let html = '';
442
+
443
+            for (let i = 0; i < items.length; i++) {
444
+                const { attribute, tagid } = items[i]
445
+                childIds.push(tagid);
446
+                group[attribute] = item;
447
+                html += getChildHTML(tagid, attribute, i == 0);
448
+            }
449
+            $(`[data-tagid="${id}"]`).html(html);
450
+        }
451
+        itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
452
+        itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
453
+        console.log(itemtagscombinationRes, "conductt");
454
+
455
+        let valuesSelected = [];
456
+
457
+        $('.borderselector').each(function (i, el) {
458
+
459
+            let val = $(el).html();
460
+            valuesSelected.push(val.trim());
461
+        });
462
+
463
+        let searchParams = window.location.search.split("&");
464
+        let skuId = window.location.hash.split('#')[1].split('=')[1];
465
+        // skuId = skuId.split('=')[1]
466
+        let isGo = true;
467
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
468
+            const currItem = itemtagscombinationRes[i];
469
+
470
+            const { tagnames, sku, itemid } = currItem;
471
+
472
+            isThereInLabel[tagnames] = itemtagscombinationRes[i];
473
+            let isTrue = true;
474
+            if (isGo) {
475
+                // for(let i=0;i<valuesSelected.length;i++){
476
+                //     if(!tagnames.includes(valuesSelected[i])){
477
+                //         isTrue = false
478
+                //     }
479
+                // }
480
+                if (i != 0) {
481
+                    isTrue = false
482
+                }
483
+                if (isTrue) {
484
+
485
+                    console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
486
+
487
+
488
+                    currentComb = itemtagscombinationRes[i];
489
+
490
+
491
+                    updateDetailsByObj(itemtagscombinationRes[i]);
492
+
493
+
494
+
495
+                    isGo = false;
496
+                    let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
497
+                    tagids = tagids.split('|');
498
+                    tagnames = tagnames.split('|');
499
+                    $('.optiontaganwi').removeClass('borderselector');
500
+
501
+                    for (let i = 0; i < tagids.length; i++) {
502
+
503
+                        $(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
504
+                    }
505
+                    // tagiditem
506
+                }
507
+            }
508
+        }
509
+
510
+
511
+        if (isGo && itemtagscombinationRes.length != 0) {
512
+
513
+            console.log(itemtagscombinationRes[0]);
514
+            let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
515
+            tagids = tagids.split('|');
516
+            tagnames = tagnames.split('|');
517
+            $('.optiontaganwi').removeClass('borderselector');
518
+            currentComb = itemtagscombinationRes[0];
519
+            // updateItemId(itemtagscombinationRes[0].itemid);
520
+
521
+            for (let i = 0; i < tagids.length; i++) {
522
+
523
+                $(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
524
+                // $(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
525
+                // $(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
526
+                // $(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
527
+            }
528
+
529
+            // $('.price').html(pricelist);
530
+            // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
531
+            // appendSpecs(itemtagscombinationRes[0].itemid);
532
+
533
+            updateDetailsByObj(itemtagscombinationRes[0]);
534
+            //console.log(childIds);
535
+            // 
536
+
537
+        }
538
+
539
+        //getAllCombination()
540
+
541
+
542
+
543
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
544
+        //     const {tagnames} = itemtagscombinationRes[i];
545
+
546
+        // }
547
+
548
+        $('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
549
+
550
+        addeventlisteners();
551
+        loadingActions.removeLoader();
552
+        return;
553
+        // let resTwo = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`);
554
+
555
+
556
+        //let html = '';
557
+        let attributesObj = {};
558
+        for (let i = 0; i < res.length; i++) {
559
+            const { parentattribute, tagid, productid } = res[i];
560
+            // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
561
+            // attributesObj[tagid] = JSON.parse(attributes.data.result);
562
+            // console.log(attributes.data.result,tagid);
563
+            html += getParentHTML(parentattribute, productid, tagid, i == 0);
564
+        }
565
+
566
+        $('#spec-container-details').html(html);
567
+
568
+
569
+        // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
570
+        return;
571
+        for (let attr in attributesObj) {
572
+            const arr = attributesObj[attr];
573
+
574
+            let html = '';
575
+            for (let i = 0; i < arr.length; i++) {
576
+                const { attribute, tagid } = arr[i];
577
+                html += getChildHTML(tagid, attribute, i == 0);
578
+            }
579
+
580
+
581
+            $(`[data-tagid="${attr}"]`).html(html);
582
+
583
+
584
+        }
585
+
586
+        let defaultValues = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/sellableitemlist/productid/${id}`);
587
+        defaultValues = JSON.parse(defaultValues.data.result);
588
+        let { itemname, price } = defaultValues[0];
589
+        $('.productname').html(itemname);
590
+        $('.price').html(price)
591
+
592
+        $('#spec-container-details').children().slice(1).find('.specsmallcard').removeClass('specsmallcard');
593
+
594
+
595
+
596
+
597
+        // getQuantityById(id)
598
+
599
+
600
+
601
+    }
602
+
603
+
604
+}
605
+startDetails();
606
+

+ 650
- 0
dist/js/productdetails/laptopdetails.js-old View File

@@ -0,0 +1,650 @@
1
+function startDetails() {
2
+    // http://127.0.0.1:5502/productdetails.html?productId=106633230000024
3
+    if (window.location.search.split('=')[0] == '') {
4
+        window.location.href = "/notfound.html";
5
+        return;
6
+    }
7
+    let productId = window.location.href.split('=')[1].split('&')[0].split('#')[0];
8
+    console.log(productId);
9
+    let itemtagscombinationRes = null;
10
+    let labels = {};
11
+    let isThereInLabel = {};
12
+    let currentComb = null;
13
+
14
+    let group = {};
15
+
16
+    let loadingActions = {
17
+        addLoader() {
18
+            $('.loadingCall').removeClass('d-none');
19
+            $('.mainContanierProduct').addClass('d-none');
20
+        },
21
+        removeLoader() {
22
+            $('.loadingCall').addClass('d-none');
23
+            $('.mainContanierProduct').removeClass('d-none');
24
+        }
25
+    }
26
+
27
+    let currentClick = null;
28
+
29
+    if (productId) {
30
+        loadingActions.addLoader();
31
+        updateProductId(productId);
32
+        getProductDetails(productId);
33
+        appendSpecs(productId)
34
+    } else {
35
+        window.location.href = "/notfound.html"
36
+    }
37
+
38
+    function updateProductId(val) {
39
+        $('#productidtag').val(val);
40
+    }
41
+
42
+    function updateItemId(val) {
43
+        $('#itemidtag').val(val);
44
+    }
45
+
46
+    let specification_wrap_action = {
47
+        remove() {
48
+
49
+            $('.specification-wrap').addClass('d-none');
50
+        },
51
+
52
+        add() {
53
+            $('.specification-wrap').removeClass('d-none');
54
+        }
55
+    }
56
+
57
+    let description_action = {
58
+        addVal(value) {
59
+            $('.description-wrap > p').html(value);
60
+        },
61
+
62
+        removeVal(value) {
63
+            $('.description-wrap > p').html('');
64
+        }
65
+    }
66
+
67
+    function getSpecsItemHTML({ name, des, itemid, id }) {
68
+        return `<div id="${id}" data-specitemid="${itemid}" class="">
69
+        <div class="row  border-bottom">
70
+            <div class="col-sm-6 bg-gray-3 py-2">
71
+            ${name}
72
+            </div>
73
+            <div class="col-sm-6  py-2">
74
+            ${des}	
75
+            </div>
76
+        </div>
77
+    </div>`;
78
+        return ` <tr id="${id}" data-specitemid="${itemid}">
79
+        <td style="width:200px">${name}</td>
80
+        <td class="">${des}</td>
81
+    </tr>`;
82
+    }
83
+    // function getSpecsItemHTML({name,des,itemid,id}){
84
+    //     return ` <tr id="${id}" data-specitemid="${itemid}">
85
+    //     <td style="width:200px">${name}</td>
86
+    //     <td class="">${des}</td>
87
+    // </tr>`;
88
+    // }
89
+
90
+    async function appendSpecs(id) {
91
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
92
+
93
+        if (resData.isError) {
94
+            $('.productdetailstabs').addClass('d-none');
95
+            $('.specContainerleft').html('')
96
+            $('.specContainerRight').html('')
97
+            return;
98
+        }
99
+        $('.productdetailstabs ').removeClass('d-none');
100
+        const res = resData.response;
101
+        console.log(JSON.parse(res.result));
102
+        const data = JSON.parse(res.result);
103
+        console.log(data);
104
+        let html = '';
105
+        let leftHtml = '';
106
+        let rightHtml = '';
107
+
108
+        if (data.length == 0) {
109
+            $('.productdetailstabs ').addClass('d-none');
110
+            $('.specContainerleft').html('')
111
+            $('.specContainerRight').html('')
112
+            return;
113
+        }
114
+
115
+        for (let i = 0; i < data.length; i++) {
116
+            const { specificationname, specificationitemid, itemid, description } = data[i];
117
+            if ((i + 1) % 2 == 0) {
118
+                rightHtml += getSpecsItemHTML({
119
+                    name: specificationname, id: specificationitemid, itemid, des: description
120
+                })
121
+            } else {
122
+                leftHtml += getSpecsItemHTML({
123
+                    name: specificationname, id: specificationitemid, itemid, des: description
124
+                });
125
+            }
126
+
127
+        }
128
+
129
+        $('.specContainerleft').html(leftHtml)
130
+        $('.specContainerRight').html(rightHtml)
131
+
132
+    }
133
+
134
+
135
+    function getParentHTML(name, productid, id, isMain) {
136
+        return `<div class="pb-2 $${name?.replace(" ", '')}-parent">
137
+        <h5 class="py-2 smallHeadingProductDetails">${name}</h5>
138
+        <div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
139
+           
140
+        </div>
141
+    </div>`;
142
+    }
143
+
144
+    function onClickHandler(e) {
145
+
146
+        $(e).parent().find('.borderselector').removeClass('borderselector');
147
+
148
+        $(e).addClass('borderselector')
149
+
150
+    }
151
+
152
+    function getChildHTML(tagid, name, isTrue) {
153
+        
154
+        let  item_color_1 = `#5e7975`;
155
+        let item_color_2 = `#624839`;
156
+        let item_color_3 = `#253746`;
157
+        if(name == "Eucalyptus Green"){
158
+
159
+            return `<p item_color=${item_color_1} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi fs-7 cursor-pointer text-white rounded mb-0 me-1 py-2 px-3" ${item_color_1 ? `style="background-color:${item_color_1}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
160
+
161
+        }else if(name == "Desert Brown"){
162
+
163
+            return `<p item_color=${item_color_2} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi mb-0 fs-7 cursor-pointer me-1 rounded text-white py-2 px-3" ${item_color_2 ? `style="background-color:${item_color_2}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
164
+
165
+        }else if(name == "Deep Sea Blue"){
166
+
167
+            return `<p item_color=${item_color_3} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi mb-0 fs-7 text-white cursor-pointer rounded py-2 px-3 " ${item_color_3 ? `style="background-color:${item_color_3}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
168
+        }
169
+        else{
170
+            return `
171
+            <div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
172
+                ${name}
173
+            </div> `
174
+         }
175
+   
176
+    }
177
+
178
+    function addeventlisteners() {
179
+
180
+        $('.optiontaganwi').each(function (i, el) {
181
+            $(el).click(function (e) {
182
+                $('#quantity').val(1);
183
+                debugger;
184
+                let ele_col = $(e.target).hasClass("color");
185
+                let ele_col1 = $(e.target).hasClass("optiontaganwi_color");
186
+                if(ele_col === true){
187
+                    $(e.target).parent().find("span.color").removeClass('border-bottom');
188
+                    $(e.target).parent().addClass("border_selector");
189
+                    $(e.target).addClass("border-bottom");
190
+                    $(e.target).parent().find("span.border-bottom").removeClass("border-bottom text-dark");
191
+                    $(e.target).addClass("border_selector");
192
+                    $(e.target).find("span.color").addClass("border-bottom text-dark");
193
+                    $(e.target).parent().find('.borderselector').removeClass('borderselector');
194
+                    // $(e.target).addClass('borderselector');
195
+                    searchComb();
196
+                    currentClick = e.target;
197
+                }else if(ele_col1 === true){
198
+                    $(e.target).parent().find("span.text-dark").removeClass("text-dark border-bottom");
199
+                    $(e.target).addClass("border_selector");
200
+                    $(e.target).find("span.color").addClass("text-dark");
201
+                    $(e.target).parent().find('.borderselector').removeClass('borderselector');
202
+                    $(e.target).addClass('borderselector');
203
+                    searchComb();
204
+                    currentClick = e.target;
205
+                }else{
206
+                    $(e.target).parent().find('.borderselector').removeClass('borderselector');
207
+                    $(e.target).addClass('borderselector');
208
+                    searchComb();
209
+                    currentClick = e.target;
210
+                 }
211
+              
212
+                searchComb();
213
+                currentClick = e.target;
214
+                // getAllCombination();
215
+            })
216
+        });
217
+        // $('.optiontaganwi_color span.color').each(function (i, el) {
218
+        //     $(el).click(function (e) {
219
+        //         $('#quantity').val(1);
220
+        //         $(e.target).parent().find("span.border-bottom").removeClass("border-bottom");
221
+        //         $(e.target).addClass("border-bottom");
222
+        //         searchComb();
223
+        //         currentClick = e.target;
224
+        //         // getAllCombination();
225
+        //     })
226
+        // });
227
+    }
228
+
229
+    // function getChildHTML(tagid,name,isTrue){
230
+    //     return `
231
+    //     <div  data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue?'borderselector':''} card small-font cursor-pointer p-3">
232
+    //         ${name}
233
+    //     </div>
234
+    // `
235
+    // }
236
+
237
+    // function addeventlisteners(){
238
+      
239
+    //     $('.optiontaganwi').each(function (i,el){
240
+    //       $(el).click(function (e){
241
+    //         $('#quantity').val(1)
242
+    //         $(e.target).parent().find('.borderselector').removeClass('borderselector');
243
+    //         $(e.target).addClass('borderselector')
244
+    //        searchComb();
245
+    //         currentClick = e.target;
246
+    //        // getAllCombination();
247
+    //       })
248
+    //     });
249
+    // }
250
+
251
+    function updateDetailsByObj(obj) {
252
+        $('.productname').html(obj.itemname)
253
+        $('.price').html(obj.pricelist?obj.pricelist:'coming soon');
254
+        appendSpecs(obj.itemid)
255
+        $('#skudetailitem').val(obj.sku)
256
+        $('.des_productdes').html(obj.itemdescription);
257
+        $('#addtocart').attr('data-qty', obj.quantity);
258
+
259
+
260
+        let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
261
+        console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
262
+
263
+        $('.productDetailsMain  > img').attr('src', defaultImg);
264
+
265
+        updateItemId(obj.itemid);
266
+        
267
+
268
+        if(!obj.pricelist){
269
+            $('.buynow').attr('disabled',true);
270
+            $('#addtocart').attr('disabled',true);
271
+        }else{
272
+            $('.buynow').attr('disabled',false);
273
+            $('#addtocart').attr('disabled',false);
274
+        }
275
+    }
276
+
277
+    function searchComb() {
278
+        let valuesSelected = [];
279
+
280
+
281
+        $('#addtocart').removeClass('disabled');
282
+        $('.msgErrorDetailsItem').addClass('d-none');
283
+        $('.borderselector,border_selector').each(function (i, el) {
284
+            console.log($(el).html())
285
+            let val = $(el).html();
286
+            valuesSelected.push(val.trim());
287
+        });
288
+
289
+        let labelRecord = {};
290
+
291
+        for (let label in labels) {
292
+            labelRecord[label] = false;
293
+        }
294
+
295
+        console.log(labelRecord);
296
+        specification_wrap_action.add();
297
+        console.log(group);
298
+        let unFiler = null;
299
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
300
+            const currItem = itemtagscombinationRes[i];
301
+            const { tagnames } = currItem;
302
+
303
+
304
+            let isTrue = true;
305
+            let labelFilter = labelRecord;
306
+
307
+            for (let i = 0; i < valuesSelected.length; i++) {
308
+
309
+                if (!tagnames.includes(valuesSelected[i])) {
310
+                    isTrue = false
311
+
312
+                    unFiler = labelFilter;
313
+                    break;
314
+                }
315
+                labelFilter[group[valuesSelected[i]]] = true;
316
+            }
317
+
318
+            if (isTrue) {
319
+                console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
320
+                const { quantity } = itemtagscombinationRes[i];
321
+                if (quantity >= $('#quantity').val() && quantity >= 1) {
322
+                    currentComb = itemtagscombinationRes[i];
323
+                    // $('.productname').html(itemtagscombinationRes[i].itemname)
324
+                    // $('.price').html(itemtagscombinationRes[i].pricelist);
325
+                    // location.hash = itemtagscombinationRes[i].itemname.trim();
326
+                    // appendSpecs(itemtagscombinationRes[i].itemid)
327
+                    history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
328
+
329
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
330
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
331
+                    updateDetailsByObj(itemtagscombinationRes[i]);
332
+                } else {
333
+
334
+                    let name = itemtagscombinationRes[i].itemname.split('-')[0];
335
+                    $('#addtocart').addClass('disabled');
336
+                    let itemsName = name;
337
+                    $('.borderselector').each(function (i, e) {
338
+                        itemsName += ` ${$(e).html().trim()}`;
339
+                    });
340
+
341
+                    updateItemId(null);
342
+
343
+                    specification_wrap_action.remove();
344
+                    $('#skudetailitem').val(-1)
345
+                    $('.productname').html(itemsName)
346
+                    history.replaceState(null, null, `#`);
347
+
348
+                    $('.msgErrorDetailsItem').removeClass('d-none');
349
+                    $('.des_productdes').html('');
350
+                    $('.price').html('');
351
+                }
352
+
353
+                initAddToCart()
354
+                return;
355
+
356
+            }
357
+
358
+        }
359
+
360
+        let name = itemtagscombinationRes[0].itemname.split('-')[0];
361
+        let itemsName = name;
362
+        $('.borderselector').each(function (i, e) {
363
+            itemsName += `- ${$(e).html().trim()}`;
364
+        })
365
+        specification_wrap_action.remove();
366
+        $('.productname').html(itemsName)
367
+        $('#skudetailitem').val(-1)
368
+        $('.price').html('');
369
+        $('#addtocart').addClass('disabled');
370
+        $('.msgErrorDetailsItem').removeClass('d-none');
371
+
372
+        initAddToCart()
373
+    }
374
+
375
+    function getAllCombination() {
376
+        const currClickAttr = $(currentClick).html().trim();
377
+
378
+        let isThere = [];
379
+        for (let item in isThereInLabel) {
380
+            let { tagnames } = isThereInLabel[item];
381
+            if (tagnames.includes(currClickAttr)) {
382
+                isThere.push(isThereInLabel[item])
383
+            }
384
+        }
385
+        let selected = [];
386
+        $('.borderselector').each(function (i, e) {
387
+            selected.push($(e).html().trim())
388
+        });
389
+
390
+        // console.log(selected);
391
+        // console.log(isThere);
392
+
393
+        let ishashObj = {};
394
+
395
+        for (let i = 0; i < isThere.length; i++) {
396
+            let { tagnames, tagids } = isThere[i];
397
+            tagnames = tagnames.split('|');
398
+            tagids = tagids.split('|');
399
+
400
+            for (let j = 0; j < tagnames.length; j++) {
401
+                if (!ishashObj[tagnames[j]]) {
402
+                    ishashObj[tagnames[j]] = tagids[j];
403
+                }
404
+            }
405
+        }
406
+
407
+        // console.log(ishashObj);
408
+
409
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
410
+
411
+        // }
412
+
413
+    }
414
+
415
+
416
+    async function getProductDetails(id) {
417
+
418
+
419
+
420
+        // let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
421
+
422
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
423
+
424
+        if (resData.isError) {
425
+            loadingActions.removeLoader();
426
+            alert(resData.errorMsg.message);
427
+            return;
428
+        }
429
+
430
+        let res = resData.response;
431
+
432
+        res = JSON.parse(res.result);
433
+        console.log(res, 'productattributelist');
434
+
435
+        if (!res) {
436
+            loadingActions.removeLoader();
437
+            return;
438
+        };
439
+
440
+
441
+
442
+
443
+        let html = '';
444
+
445
+        for (let i = 0; i < res.length; i++) {
446
+            const currItem = res[i];
447
+            // parenttagid means under what label
448
+            // tag id means it know unquie id
449
+            const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
450
+
451
+            if (labels[parentattribute]) {
452
+                labels[parentattribute].items.push({
453
+                    attribute,
454
+                    tagid: tagid
455
+                });
456
+            } else {
457
+                labels[parentattribute] = {
458
+                    id: parenttagid,
459
+                    items: [{
460
+                        attribute,
461
+                        tagid: tagid
462
+                    }]
463
+                };
464
+                html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
465
+            }
466
+
467
+        }
468
+        $('#spec-container-details').html(html);
469
+
470
+
471
+        // console.log(labels,'labels');
472
+
473
+        let childIds = [];
474
+
475
+        for (let item in labels) {
476
+            let { id, items } = labels[item];
477
+            // $(`[data-tagid=${id}]`)
478
+            let html = '';
479
+
480
+            for (let i = 0; i < items.length; i++) {
481
+                const { attribute, tagid } = items[i]
482
+                childIds.push(tagid);
483
+                group[attribute] = item;
484
+                html += getChildHTML(tagid, attribute, i == 0);
485
+            }
486
+            $(`[data-tagid="${id}"]`).html(html);
487
+        }
488
+        itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
489
+        itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
490
+        console.log(itemtagscombinationRes, "conductt");
491
+
492
+        let valuesSelected = [];
493
+
494
+        $('.borderselector').each(function (i, el) {
495
+
496
+            let val = $(el).html();
497
+            valuesSelected.push(val.trim());
498
+        });
499
+
500
+        let searchParams = window.location.search.split("&");
501
+        let skuId = window.location.hash.split('#')[1].split('=')[1];
502
+        // skuId = skuId.split('=')[1]
503
+        let isGo = true;
504
+        for (let i = 0; i < itemtagscombinationRes.length; i++) {
505
+            const currItem = itemtagscombinationRes[i];
506
+
507
+            const { tagnames, sku, itemid } = currItem;
508
+
509
+            isThereInLabel[tagnames] = itemtagscombinationRes[i];
510
+            let isTrue = true;
511
+            if (isGo) {
512
+                // for(let i=0;i<valuesSelected.length;i++){
513
+                //     if(!tagnames.includes(valuesSelected[i])){
514
+                //         isTrue = false
515
+                //     }
516
+                // }
517
+                if (skuId != itemid) {
518
+                    isTrue = false
519
+                }
520
+                if (isTrue) {
521
+
522
+                    console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
523
+
524
+
525
+                    currentComb = itemtagscombinationRes[i];
526
+                    // location.hash = itemtagscombinationRes[i].itemname.trim();
527
+
528
+                    // $('.productname').html(itemtagscombinationRes[i].itemname);
529
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
530
+                    // $('.price').html(itemtagscombinationRes[i].pricelist)
531
+
532
+                    // appendSpecs(itemtagscombinationRes[i].itemid);
533
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
534
+
535
+                    updateDetailsByObj(itemtagscombinationRes[i]);
536
+
537
+
538
+
539
+                    isGo = false;
540
+                    let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
541
+                    tagids = tagids.split('|');
542
+                    tagnames = tagnames.split('|');
543
+                    $('.optiontaganwi').removeClass('borderselector');
544
+
545
+                    for (let i = 0; i < tagids.length; i++) {
546
+
547
+                        $(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
548
+                    }
549
+                    // tagiditem
550
+                }
551
+            }
552
+        }
553
+
554
+
555
+        if (isGo && itemtagscombinationRes.length != 0) {
556
+
557
+            console.log(itemtagscombinationRes[0]);
558
+            let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
559
+            tagids = tagids.split('|');
560
+            tagnames = tagnames.split('|');
561
+            $('.optiontaganwi').removeClass('borderselector');
562
+            currentComb = itemtagscombinationRes[0];
563
+            // updateItemId(itemtagscombinationRes[0].itemid);
564
+
565
+            for (let i = 0; i < tagids.length; i++) {
566
+
567
+                $(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
568
+                $(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
569
+                $(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
570
+                $(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
571
+            }
572
+
573
+            // $('.price').html(pricelist);
574
+            // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
575
+            // appendSpecs(itemtagscombinationRes[0].itemid);
576
+
577
+            updateDetailsByObj(itemtagscombinationRes[0]);
578
+            //console.log(childIds);
579
+            // 
580
+
581
+        }
582
+
583
+        //getAllCombination(valuesSelected)
584
+
585
+
586
+
587
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
588
+        //     const {tagnames} = itemtagscombinationRes[i];
589
+
590
+        // }
591
+
592
+        $('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
593
+
594
+        addeventlisteners();
595
+        loadingActions.removeLoader();
596
+        return;
597
+        // let resTwo = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`);
598
+
599
+
600
+        //let html = '';
601
+        let attributesObj = {};
602
+        for (let i = 0; i < res.length; i++) {
603
+            const { parentattribute, tagid, productid } = res[i];
604
+            // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
605
+            // attributesObj[tagid] = JSON.parse(attributes.data.result);
606
+            // console.log(attributes.data.result,tagid);
607
+            html += getParentHTML(parentattribute, productid, tagid, i == 0);
608
+        }
609
+
610
+        $('#spec-container-details').html(html);
611
+
612
+
613
+        // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
614
+        return;
615
+        for (let attr in attributesObj) {
616
+            const arr = attributesObj[attr];
617
+
618
+            let html = '';
619
+            for (let i = 0; i < arr.length; i++) {
620
+                const { attribute, tagid } = arr[i];
621
+                html += getChildHTML(tagid, attribute, i == 0);
622
+            }
623
+
624
+
625
+            $(`[data-tagid="${attr}"]`).html(html);
626
+
627
+
628
+        }
629
+
630
+        let defaultValues = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/sellableitemlist/productid/${id}`);
631
+        defaultValues = JSON.parse(defaultValues.data.result);
632
+        let { itemname, price } = defaultValues[0];
633
+        $('.productname').html(itemname);
634
+        $('.price').html(price)
635
+
636
+        $('#spec-container-details').children().slice(1).find('.specsmallcard').removeClass('specsmallcard');
637
+
638
+
639
+
640
+
641
+        // getQuantityById(id)
642
+
643
+
644
+
645
+    }
646
+
647
+
648
+}
649
+startDetails();
650
+

+ 589
- 0
dist/js/productdetails/productdetails.js View File

@@ -0,0 +1,589 @@
1
+function startDetails(){
2
+    // http://127.0.0.1:5502/productdetails.html?productId=106633230000024
3
+    if(window.location.search.split('=')[0] == ''){
4
+        window.location.href = "/notfound.html";
5
+        return;
6
+    }
7
+    debugger;
8
+    let productId = window.location.href.split('=')[1].split('&')[0].split('#')[0];
9
+    console.log(productId);
10
+    let itemtagscombinationRes = null;
11
+    let labels = {};    
12
+    let isThereInLabel = {};
13
+    let currentComb = null;
14
+
15
+    let group = {};
16
+
17
+    let loadingActions = {
18
+        addLoader(){
19
+            $('.loadingCall').removeClass('d-none');
20
+            $('.mainContanierProduct').addClass('d-none');
21
+        },
22
+        removeLoader(){
23
+            $('.loadingCall').addClass('d-none');
24
+            $('.mainContanierProduct').removeClass('d-none');
25
+        }
26
+    }
27
+
28
+    let currentClick = null;
29
+   
30
+    if(productId){
31
+        loadingActions.addLoader();
32
+        updateProductId(productId);
33
+       getProductDetails(productId);
34
+        appendSpecs(productId)
35
+    }else{
36
+       window.location.href = "/notfound.html"
37
+    }
38
+
39
+    function updateProductId(val){
40
+        $('#productidtag').val(val);
41
+    }
42
+
43
+    function updateItemId(val){
44
+        $('#itemidtag').val(val);
45
+    }
46
+
47
+    let specification_wrap_action = {
48
+        remove(){
49
+    
50
+            $('.specification-wrap').addClass('d-none');
51
+        },
52
+
53
+        add(){
54
+            $('.specification-wrap').removeClass('d-none');
55
+        }
56
+    }
57
+
58
+    let description_action = {
59
+        addVal(value){
60
+            $('.description-wrap > p').html(value);
61
+        },
62
+
63
+        removeVal(value){
64
+            $('.description-wrap > p').html('');
65
+        }
66
+    }
67
+
68
+    function getSpecsItemHTML({name,des,itemid,id}){
69
+        let isMobile = $(window).width()<=600 ? '' : '';
70
+        let addPaddM =  $(window).width()<=600 ? 'py-2' : 'py-4';
71
+        return `<div id="${id}" data-specitemid="${itemid}" >
72
+        <div class="row   border-bottom">
73
+            <div class="col-sm-3 ${isMobile} font-weight-600  ${addPaddM} ">
74
+            ${name}
75
+            </div>
76
+            <div class="col-sm-9  py-2 d-flex align-items-center">
77
+            ${des}	
78
+            </div>
79
+        </div>
80
+    </div>`;
81
+        return ` <tr id="${id}" data-specitemid="${itemid}">
82
+        <td style="width:200px">${name}</td>
83
+        <td class="">${des}</td>
84
+    </tr>`;
85
+    }
86
+    // function getSpecsItemHTML({name,des,itemid,id}){
87
+    //     return ` <tr id="${id}" data-specitemid="${itemid}">
88
+    //     <td style="width:200px">${name}</td>
89
+    //     <td class="">${des}</td>
90
+    // </tr>`;
91
+    // }
92
+
93
+    async function appendSpecs(id){
94
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`,true);
95
+
96
+        if(resData.isError){
97
+            $('.productdetailstabs').addClass('d-none');
98
+            $('.specContainerleft').html('')
99
+            $('.specContainerRight').html('')
100
+            return;
101
+        }
102
+        $('.productdetailstabs ').removeClass('d-none');
103
+        const res = resData.response;
104
+        console.log(JSON.parse(res.result));
105
+        const data = JSON.parse(res.result);
106
+        console.log(data);
107
+        let html = '';
108
+        let leftHtml = '';
109
+        let rightHtml = '';
110
+
111
+        if(data.length == 0){
112
+            $('.productdetailstabs ').addClass('d-none');
113
+            $('.specContainerleft').html('')
114
+            $('.specContainerRight').html('')
115
+            return;
116
+        }
117
+
118
+        for(let i=0;i<data.length;i++){
119
+            const {specificationname,specificationitemid,itemid,description} = data[i];
120
+            leftHtml += getSpecsItemHTML({
121
+                name:specificationname,id:specificationitemid,itemid,des:description
122
+            });
123
+            // if((i+1)%2 == 0){
124
+            //     rightHtml += getSpecsItemHTML({
125
+            //         name:specificationname,id:specificationitemid,itemid,des:description
126
+            //     })
127
+            // }else{
128
+            //     leftHtml += getSpecsItemHTML({
129
+            //         name:specificationname,id:specificationitemid,itemid,des:description
130
+            //     });
131
+            // }
132
+            
133
+        }
134
+  
135
+        $('.specContainerleft').html(leftHtml)
136
+        $('.specContainerRight').html(rightHtml)
137
+
138
+    }
139
+   
140
+
141
+    function getParentHTML(name,productid,id,isMain){
142
+        return `<div class="pb-2 $${name?.replace(" ",'')}-parent">
143
+        <h5 class="py-2 smallHeadingProductDetails">${name}</h5>
144
+        <div class="d-flex gap-2 flex-wrap ${id}container" data-tagid="${id}">
145
+           
146
+        </div>
147
+    </div>`;
148
+    }
149
+
150
+    function onClickHandler(e) {
151
+  
152
+        $(e).parent().find('.borderselector').removeClass('borderselector');
153
+    
154
+        $(e).addClass('borderselector')
155
+    
156
+    }
157
+
158
+    function getChildHTML(tagid,name,isTrue){
159
+        return `
160
+        <div  data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue?'borderselector':''} card small-font cursor-pointer p-3">
161
+            ${name}
162
+        </div>
163
+    `
164
+    }
165
+
166
+    function addeventlisteners(){
167
+      
168
+        $('.optiontaganwi').each(function (i,el){
169
+          $(el).click(function (e){
170
+            $('#quantity').val(1)
171
+            $(e.target).parent().find('.borderselector').removeClass('borderselector');
172
+            $(e.target).addClass('borderselector')
173
+           searchComb();
174
+            currentClick = e.target;
175
+           // getAllCombination();
176
+          })
177
+        });
178
+    }
179
+
180
+    function updateDetailsByObj(obj){
181
+        $('.productname').html(obj.itemname);
182
+        let  [currencySymbol, amount] = getCurrencySymbol(obj?.pricelist||0);
183
+        $('.price').html(obj.pricelist ?`${currencySymbol}${amount}`:'');
184
+        $('.price').attr('data-price',obj.pricelist);
185
+        appendSpecs(obj.itemid)
186
+        $('#skudetailitem').val(obj.sku)
187
+        $('.des_productdes').html(obj.itemdescription);
188
+        $('#addtocart').attr('data-qty',obj.quantity);
189
+
190
+        
191
+        let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl): `./dist/assets/imgs/nophoto.png`;
192
+console.log(obj.itemimageurl,'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
193
+
194
+        $('.productDetailsMain  > img').attr('src',defaultImg);
195
+
196
+        updateItemId(obj.itemid);
197
+debugger;
198
+        if (!obj.pricelist || !obj.quantity) {
199
+            $('.buynow').attr('disabled', true);
200
+            $('#addtocart').attr('disabled', true);
201
+        } else {
202
+            $('.buynow').attr('disabled', false);
203
+            $('#addtocart').attr('disabled', false);
204
+        }
205
+    }
206
+
207
+    function searchComb(){
208
+        let valuesSelected = [];
209
+ 
210
+        
211
+        $('#addtocart').removeClass('disabled');
212
+        $('.msgErrorDetailsItem').addClass('d-none');
213
+        $('.borderselector').each(function (i,el){
214
+            let val = $(el).html();
215
+            valuesSelected.push(val.trim());
216
+        });
217
+
218
+        let labelRecord = {};
219
+
220
+        for(let label in labels){
221
+            labelRecord[label] = false;
222
+        }
223
+
224
+        console.log(labelRecord);
225
+        specification_wrap_action.add();
226
+        console.log(group);
227
+        let unFiler = null;
228
+        for(let i=0;i<itemtagscombinationRes.length;i++){
229
+            const currItem = itemtagscombinationRes[i];
230
+            const {tagnames} = currItem;
231
+           
232
+
233
+                let isTrue = true;
234
+                let labelFilter = labelRecord;
235
+                
236
+                for(let i=0;i<valuesSelected.length;i++){
237
+                  
238
+                    if(!tagnames.includes(valuesSelected[i])){
239
+                        isTrue = false
240
+                        
241
+                        unFiler = labelFilter;
242
+                        break;
243
+                    }
244
+                    labelFilter[group[valuesSelected[i]]] = true;
245
+                }
246
+    
247
+                if(isTrue){
248
+                    console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
249
+                    const {quantity} = itemtagscombinationRes[i];
250
+                    if(quantity>=$('#quantity').val() && quantity>=1){
251
+                        currentComb = itemtagscombinationRes[i];
252
+                        // $('.productname').html(itemtagscombinationRes[i].itemname)
253
+                        // $('.price').html(itemtagscombinationRes[i].pricelist);
254
+                        // location.hash = itemtagscombinationRes[i].itemname.trim();
255
+                        // appendSpecs(itemtagscombinationRes[i].itemid)
256
+                        history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
257
+
258
+                        // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
259
+                        // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
260
+                        updateDetailsByObj(itemtagscombinationRes[i]);
261
+                    }else{
262
+                      
263
+                        let name = itemtagscombinationRes[i].itemname.split('-')[0];
264
+                        $('#addtocart').addClass('disabled');
265
+                        $('.buynow').attr('disabled', true);
266
+                        let itemsName = name;
267
+                        $('.borderselector').each(function (i,e){
268
+                            itemsName += ` ${$(e).html().trim()}`;
269
+                        });
270
+
271
+                        updateItemId(null);
272
+
273
+                       specification_wrap_action.remove();
274
+                        $('#skudetailitem').val(-1)
275
+                         $('.productname').html(itemsName)
276
+                         history.replaceState(null, null, `#`);
277
+                         
278
+                         $('.msgErrorDetailsItem').removeClass('d-none');
279
+                         $('.des_productdes').html('');
280
+                        $('.price').html('');
281
+                    }
282
+                  
283
+                    initAddToCart()
284
+                    return;
285
+                  
286
+                }
287
+            
288
+        }
289
+
290
+        let name = itemtagscombinationRes[0].itemname.split('-')[0];
291
+        let itemsName = name;
292
+        $('.borderselector').each(function (i,e){
293
+            itemsName += `- ${$(e).html().trim()}`;
294
+        })
295
+        specification_wrap_action.remove();
296
+            $('.productname').html(itemsName)
297
+            $('#skudetailitem').val(-1)
298
+        $('.price').html('');
299
+        $('#addtocart').addClass('disabled');
300
+        $('.buynow').attr('disabled', true);
301
+        $('.msgErrorDetailsItem').removeClass('d-none');
302
+        
303
+        initAddToCart()
304
+    }
305
+
306
+    function getAllCombination(){
307
+     const currClickAttr =  $(currentClick).html().trim();
308
+
309
+     let isThere = [];
310
+     for(let item in isThereInLabel){
311
+        let {tagnames} = isThereInLabel[item];
312
+        if(tagnames.includes(currClickAttr)){
313
+            isThere.push( isThereInLabel[item])
314
+        }
315
+     }
316
+        let selected = [];
317
+        $('.borderselector').each(function (i,e){
318
+            selected.push($(e).html().trim())
319
+        });
320
+        
321
+        // console.log(selected);
322
+        // console.log(isThere);
323
+
324
+        let ishashObj = {};
325
+
326
+        for(let i=0;i<isThere.length;i++){
327
+            let  {tagnames,tagids} = isThere[i];
328
+            tagnames = tagnames.split('|');
329
+            tagids = tagids.split('|');
330
+
331
+            for(let j=0;j<tagnames.length;j++){
332
+                if(!ishashObj[tagnames[j]]){
333
+                    ishashObj[tagnames[j]] = tagids[j];
334
+                }
335
+            }
336
+        }
337
+
338
+        // console.log(ishashObj);
339
+
340
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
341
+            
342
+        // }
343
+    
344
+    }
345
+
346
+
347
+    async function getProductDetails(id){
348
+        
349
+ 
350
+
351
+        // let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
352
+  
353
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`,true);
354
+console.log(resData,'resDataresDataresDataresDataresData');
355
+        if(resData.isError){
356
+            loadingActions.removeLoader();
357
+            alert(resData.errorMsg.message);
358
+            return;
359
+        }
360
+
361
+        let res = resData.response;
362
+            
363
+        res = JSON.parse(res.result);
364
+        // console.log(res);
365
+
366
+      if(!res) {
367
+        loadingActions.removeLoader();
368
+        return;
369
+      };
370
+
371
+        
372
+       
373
+
374
+        let html = '';
375
+     
376
+        for(let i=0;i<res.length;i++){
377
+            const currItem = res[i];
378
+            // parenttagid means under what label
379
+            // tag id means it know unquie id
380
+            const {parentattribute,parenttagid,tagid,attribute,productid} = currItem;
381
+
382
+            if(labels[parentattribute]){
383
+                labels[parentattribute].items.push({
384
+                    attribute,
385
+                    tagid:tagid
386
+                });
387
+            }else{
388
+                labels[parentattribute] = {
389
+                    id:parenttagid,
390
+                    items:[{
391
+                        attribute,
392
+                        tagid:tagid
393
+                    }]
394
+                };
395
+                html += getParentHTML(parentattribute,productid,parenttagid,i==0);
396
+            }
397
+
398
+        }
399
+        $('#spec-container-details').html(html);
400
+       
401
+
402
+        // console.log(labels,'labels');
403
+
404
+        let childIds = [];
405
+
406
+        for(let item in labels){
407
+            let {id,items} = labels[item];
408
+            // $(`[data-tagid=${id}]`)
409
+            let html = '';
410
+          
411
+            for(let i=0;i<items.length;i++){
412
+                const {attribute,tagid} = items[i]
413
+                childIds.push(tagid);
414
+                group[attribute] = item;
415
+                html +=  getChildHTML(tagid,attribute,i==0);
416
+            }
417
+            $(`[data-tagid="${id}"]`).html(html);
418
+        }
419
+
420
+        // itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`pis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`,true); 
421
+        itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`,true); 
422
+
423
+        itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
424
+         console.log(itemtagscombinationRes);
425
+
426
+        let valuesSelected = [];
427
+
428
+        $('.borderselector').each(function (i,el){
429
+        
430
+            let val = $(el).html();
431
+            valuesSelected.push(val.trim());
432
+        });
433
+    
434
+        let searchParams = window.location.search.split("&");
435
+        let skuId = window.location.hash.split('#')[1].split('=')[1];
436
+        // skuId = skuId.split('=')[1]
437
+        let isGo = true;
438
+        for(let i=0;i<itemtagscombinationRes.length;i++){
439
+            const currItem = itemtagscombinationRes[i];
440
+           
441
+            const {tagnames,sku,itemid} = currItem;
442
+          
443
+            isThereInLabel[tagnames] = itemtagscombinationRes[i];
444
+
445
+
446
+            let isTrue = true;
447
+            if(isGo){
448
+                // for(let i=0;i<valuesSelected.length;i++){
449
+                //     if(!tagnames.includes(valuesSelected[i])){
450
+                //         isTrue = false
451
+                //     }
452
+                // }
453
+                if(skuId != itemid){
454
+                    isTrue = false
455
+                }
456
+    
457
+                if(isTrue){
458
+                    
459
+                    console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
460
+
461
+
462
+                    currentComb = itemtagscombinationRes[i];
463
+                   // location.hash = itemtagscombinationRes[i].itemname.trim();
464
+
465
+                    // $('.productname').html(itemtagscombinationRes[i].itemname);
466
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
467
+                    // $('.price').html(itemtagscombinationRes[i].pricelist)
468
+               
469
+                    // appendSpecs(itemtagscombinationRes[i].itemid);
470
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
471
+
472
+                    updateDetailsByObj(itemtagscombinationRes[i]);
473
+
474
+
475
+
476
+                    isGo = false;
477
+                    let {tagnames,tagids,pricelist} = itemtagscombinationRes[i];
478
+                        tagids = tagids.split('|');
479
+                        tagnames = tagnames.split('|');
480
+                        $('.optiontaganwi').removeClass('borderselector');
481
+             
482
+                        for(let i=0;i<tagids.length;i++){
483
+                        
484
+                            $(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
485
+                        } 
486
+                   // tagiditem
487
+                }
488
+            }
489
+        }
490
+
491
+
492
+        if(isGo){
493
+            if(itemtagscombinationRes.length === 0){
494
+                loadingActions.removeLoader();
495
+                toasterHelper("error","Something went wrong!",`toast-top-right`)
496
+                return;
497
+            }
498
+            console.log(itemtagscombinationRes[0]);
499
+            let {tagnames,tagids,pricelist} = itemtagscombinationRes[0];
500
+            tagids = tagids.split('|');
501
+            tagnames = tagnames.split('|');
502
+            $('.optiontaganwi').removeClass('borderselector');
503
+            currentComb = itemtagscombinationRes[0];
504
+           // updateItemId(itemtagscombinationRes[0].itemid);
505
+            
506
+            for(let i=0;i<tagids.length;i++){
507
+             
508
+                $(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
509
+            }
510
+
511
+            // $('.price').html(pricelist);
512
+            // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
513
+            // appendSpecs(itemtagscombinationRes[0].itemid);
514
+
515
+            updateDetailsByObj(itemtagscombinationRes[0]);
516
+            //console.log(childIds);
517
+            // 
518
+          
519
+        }
520
+      
521
+        //getAllCombination(valuesSelected)
522
+
523
+      
524
+        
525
+        // for(let i=0;i<itemtagscombinationRes.length;i++){
526
+        //     const {tagnames} = itemtagscombinationRes[i];
527
+            
528
+        // }
529
+
530
+        $('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
531
+
532
+        addeventlisteners();
533
+        loadingActions.removeLoader();
534
+        return;
535
+        // let resTwo = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`);
536
+            
537
+      
538
+        //let html = '';
539
+        let attributesObj = {};
540
+        for(let i=0;i<res.length;i++){
541
+            const {parentattribute,tagid,productid} = res[i];
542
+            // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
543
+            // attributesObj[tagid] = JSON.parse(attributes.data.result);
544
+            // console.log(attributes.data.result,tagid);
545
+            html += getParentHTML(parentattribute,productid,tagid,i==0);
546
+        }
547
+
548
+        $('#spec-container-details').html(html);
549
+
550
+       
551
+        // let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
552
+        return;
553
+        for(let attr in attributesObj){
554
+            const arr = attributesObj[attr];
555
+           
556
+            let html = '';
557
+            for(let i=0;i<arr.length;i++){
558
+                const {attribute,tagid} = arr[i];
559
+                html += getChildHTML(tagid,attribute,i==0);
560
+            }
561
+
562
+            
563
+            $(`[data-tagid="${attr}"]`).html(html);
564
+
565
+
566
+        }
567
+
568
+        let defaultValues = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/sellableitemlist/productid/${id}`);
569
+        defaultValues = JSON.parse(defaultValues.data.result);
570
+        let {itemname,price} = defaultValues[0];
571
+        $('.productname').html(itemname);
572
+        $('.price').html(price)
573
+
574
+        $('#spec-container-details').children().slice(1).find('.specsmallcard').removeClass('specsmallcard');
575
+
576
+
577
+        
578
+
579
+       // getQuantityById(id)
580
+       
581
+    
582
+
583
+    }
584
+
585
+    
586
+}
587
+
588
+startDetails();
589
+

+ 243
- 0
dist/js/productdetails_old.js View File

@@ -0,0 +1,243 @@
1
+const mainPhoto = $('.productDetailsMain > img');
2
+let currentTypeModal = null;
3
+
4
+function onClickHandler(e) {
5
+    $(e).parent().find('.borderselector').removeClass('borderselector');
6
+
7
+    $(e).addClass('borderselector')
8
+
9
+}
10
+
11
+
12
+function setProductData(data) {
13
+    if (!data) return;
14
+    const productname = data.displayName;
15
+
16
+    $('.productname').html(data.displayName)
17
+
18
+    const type = data.productType;
19
+    switch (type) {
20
+        case 'ram':
21
+            // setRamProduct(data.type)
22
+             setProductRam_new(data.type)
23
+            break;
24
+
25
+        default:
26
+            break;
27
+    }
28
+}
29
+
30
+// new
31
+
32
+function setProductRam_new(data){
33
+    const {name,specs} = data;
34
+
35
+    $('.productname').html(name);
36
+    let parent = $('.memory-parent').find('.borderselector').html();
37
+    let ramTech =  parent.trim().toLowerCase()
38
+    genrateChildMem(ramTech);
39
+
40
+}
41
+
42
+function getChildHTML(name,isTrue,attr){
43
+    let data_attr = attr;
44
+    if(data_attr == undefined){
45
+        return ` <div data-${attr}="${attr}" type="button" onclick="onClickHandler(this)" class="specsmallcard-mini ${isTrue?'borderselector':''} card small-font p-3" data-version="${name}">
46
+        ${name}
47
+    </div>`;
48
+    }else{
49
+        return ` <div data-${attr}="${attr}" type="button" onclick="onClickHandler(this)" class="specsmallcard-mini ${isTrue?'borderselector':''} card small-font p-3" data-gb="${name}">
50
+        ${name}
51
+    </div>`;
52
+    }
53
+
54
+}
55
+
56
+function computerSizeClick(obj){
57
+    $(`[data-computersize="computersize"]`).off().click(function (e){
58
+        let size = $(e.target).html().trim().toLowerCase();
59
+       
60
+        setPrice(size);
61
+        // if(size == '16gb'){
62
+        //     const str = './dist/assets/imgs/Home_new/Home_Carousel_2.png';
63
+        //     $('.productDetailsMain > img').attr('src',str);
64
+
65
+        // }
66
+    })
67
+
68
+    // console.log($($(`[data-computersize="computersize"]`)[0]).html().trim().toLowerCase());
69
+    function setPrice(size){
70
+        let namehelper = $('.ramtech').find('.borderselector').html().trim().toLowerCase();
71
+        let devHelper = $('.memorycontainer').find('.borderselector').html().trim().toLowerCase();
72
+        let name = '';
73
+        let realName = '';
74
+        let imgURL = '';
75
+        if(namehelper === 'ddr4' &&  devHelper === 'desktop'){
76
+            name = 'priceddr4d'
77
+       
78
+        }else if(namehelper === 'ddr5' &&  devHelper === 'desktop'){
79
+            name = 'priceddr5d'
80
+        }else if(namehelper === 'ddr4' &&  devHelper === 'laptop'){
81
+            name = 'priceddr4l'
82
+        }else {
83
+            name = 'priceddr5l'
84
+        }
85
+    if(size == '16gb'){
86
+        $('.price').html(obj[name][1]);
87
+        $('.productname').html(obj[`${name}name`][1]);
88
+        $('.productDetailsMain img').attr('src',obj[`${name}img`][1])
89
+    }else if(size == '32gb'){
90
+        $('.price').html(obj[name][2]);
91
+        $('.productname').html(obj[`${name}name`][2]);
92
+        $('.productDetailsMain img').attr('src',obj[`${name}img`][2])
93
+    }else{
94
+        $('.price').html(obj[name][0]);
95
+        $('.productname').html(obj[`${name}name`][0]);
96
+        $('.productDetailsMain img').attr('src',obj[`${name}img`][0]);
97
+    }
98
+    }
99
+
100
+    let size = $($(`[data-computersize="computersize"]`)[0]).html().trim().toLowerCase();
101
+    setPrice(size);
102
+}
103
+
104
+function genrateChildMem(ramTech,attr){
105
+    let remTechArr = obj[ramTech];
106
+    let items = '';
107
+    for(let i=0;i<remTechArr.length;i++){
108
+        items += getChildHTML(remTechArr[i],i==0,attr); 
109
+    }
110
+
111
+    $('.ramtech').html(items);
112
+    $(`[data-${attr}="${attr}"]`).off().click(function (e){
113
+        let ram = $(e.target).html().trim().toLowerCase();
114
+        const ans = obj[ram];
115
+        let html ='';
116
+        for(let i=0;i<ans.length;i++){
117
+            html += getChildHTML(ans[i],i==0,'computersize')
118
+        }
119
+        $('.computersize').html(html);
120
+        computerSizeClick(obj);
121
+    })  
122
+
123
+    const ans = obj[remTechArr[0].toLowerCase()];
124
+    let html ='';
125
+    for(let i=0;i<ans.length;i++){
126
+        html += getChildHTML(ans[i],i==0,'computersize')
127
+    }
128
+    $('.computersize').html(html);
129
+
130
+    computerSizeClick(obj);
131
+
132
+
133
+}
134
+
135
+$('.memorycontainer').click(function (e){
136
+    const type = $(e.target).data('type');
137
+    if(type !== 'memory-desktop' && type !== 'memory-laptop') return;
138
+
139
+    $(e.target).parent().find('.borderselector').removeClass('borderselector');
140
+    $(e.target).addClass('borderselector');
141
+
142
+    if(type == 'memory-desktop'){
143
+        debugger;
144
+        genrateChildMem('desktop','ramtech');
145
+    }else{
146
+        genrateChildMem('laptop','ramtech');
147
+    }
148
+})
149
+
150
+
151
+
152
+// new end
153
+
154
+function init() {
155
+    $('.product-item-gallery > img').each(function (i, el) {
156
+        $(el).click(function (e) {
157
+            $('.product-item-gallery.active-gallery-img').removeClass('active-gallery-img');
158
+            let src = $(e.target).attr('src');
159
+
160
+            $(e.target).parent().addClass('active-gallery-img');
161
+            mainPhoto.attr('src', src);
162
+        })
163
+    })
164
+
165
+
166
+    // const data = getDataProduct();
167
+    setProductRam_new(obj);
168
+
169
+    // setProductItemData(rams);
170
+
171
+}
172
+
173
+
174
+
175
+let obj = {
176
+    name:'ORA3',
177
+    desktop:['DDR4','DDR5'],
178
+    laptop:['DDR4','DDR5'],
179
+    ddr4:['8GB','16GB','32GB'],
180
+    ddr5:['8GB','16GB','32GB'],
181
+    priceddr4l:[2990, 4750, 8450],
182
+     priceddr5l:[5150, 7800, 13900],
183
+     priceddr4d:[2990, 4750, 9450],
184
+     priceddr5d:[5800, 7600, 15500],
185
+     priceddr4lname:['ORA 8GB DDR4 3200MHz Laptop RAM','ORA 16GB DDR4 3200MHz Laptop RAM','ORA 32GB DDR4 3200MHz Laptop RAM'],
186
+     priceddr5lname:['ORA 8GB DDR5 4800MHz Laptop RAM','ORA 16GB DDR5 4800MHz Laptop RAM','ORA 32GB DDR5 4800MHz Laptop RAM'], 
187
+
188
+     priceddr4dname:['ORA 8GB DDR4 3200MHz Desktop RAM','ORA 16GB DDR4 3200MHz Desktop RAM','ORA 32GB DDR4 3200MHz Desktop RAM'],
189
+     priceddr5dname:['ORA 8GB DDR5 4800MHz Desktop RAM','ORA 16GB DDR5 4800MHz Desktop RAM','ORA 32GB DDR5 4800MHz Desktop RAM'],
190
+   
191
+
192
+    priceddr4limg:['../dist/assets/imgs/accessiories/ram/ddr4-laptop.jpg','../dist/assets/imgs/accessiories/ram/ddr4-laptop.jpg', '../dist/assets/imgs/accessiories/ram/ddr4-laptop.jpg'],
193
+    priceddr5limg:['../dist/assets/imgs/accessiories/ram/ddr5-laptop.jpg', '../dist/assets/imgs/accessiories/ram/ddr5-laptop.jpg', '../dist/assets/imgs/accessiories/ram/ddr5-laptop.jpg'], 
194
+
195
+    priceddr4dimg:['../dist/assets/imgs/accessiories/ram/ddr4-desktop.jpg', '../dist/assets/imgs/accessiories/ram/ddr4-desktop.jpg','../dist/assets/imgs/accessiories/ram/ddr4-desktop.jpg'],
196
+    priceddr5dimg:['../dist/assets/imgs/accessiories/ram/ddr5-desktop.jpg','../dist/assets/imgs/accessiories/ram/ddr5-desktop.jpg','../dist/assets/imgs/accessiories/ram/ddr5-desktop.jpg'],
197
+}
198
+
199
+
200
+
201
+init();
202
+
203
+
204
+// function startDetails(){
205
+
206
+//     let productId = window.location.search.split('=')[1];
207
+//     console.log(productId);
208
+//     getProductDetails(productId);
209
+
210
+//     function getParentHTML(name,productid,id){
211
+//         return `<div class="pb-2 $${name?.replace(" ",'')}-parent">
212
+//         <h5 class="py-2 smallHeadingProductDetails">${name}</h5>
213
+//         <div class="d-flex gap-2 ${id}container" data-tagid="${id}">
214
+           
215
+//         </div>
216
+//     </div>`;
217
+//     }
218
+
219
+
220
+//     async function getProductDetails(id){
221
+//         let res = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/producttagname/productid/${id}`);
222
+//         res = JSON.parse(res.data.result);
223
+//         console.log(res);
224
+//         let html = '';
225
+
226
+//         for(let i=0;i<res.length;i++){
227
+//             const {parentattribute,tagid,productid} = res[i];
228
+//             debugger;
229
+//             html += getParentHTML(parentattribute,productid,tagid);
230
+//         }
231
+
232
+//         $('#spec-container-details').html(html);
233
+
234
+
235
+
236
+
237
+
238
+
239
+//     }
240
+// }
241
+
242
+// startDetails();
243
+

+ 188
- 0
dist/js/products/accessories.js View File

@@ -0,0 +1,188 @@
1
+function initAcc(){
2
+    INIT();
3
+    async function INIT(){
4
+        const productsIds =  await getProductIds(['SSD ORA',"RAM ORA"]);
5
+        appendWithIds(productsIds);
6
+    }
7
+
8
+    async function appendWithIds(productsIds){
9
+        let html = '';
10
+        for(let i=0;i<productsIds.length;i++){
11
+            let productId = productsIds[i];
12
+            let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${productId}`,true);
13
+
14
+            if(res.isError){
15
+                alert("something went wrong");
16
+                return;
17
+            }
18
+
19
+            res = JSON.parse(res.response.result);
20
+            console.log(res);
21
+
22
+            
23
+            for(let j=0;j<res.length;j++){
24
+                html += getRamCardHTML(res[j]);
25
+            }
26
+        }
27
+
28
+        $('.product_card_section').html(html)
29
+    }
30
+
31
+    async function getProductIds(productsIdReqArr){
32
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true);
33
+        
34
+        if(resData.isError){
35
+            alert("Something went wrong");
36
+            return;
37
+        }
38
+
39
+        resData = JSON.parse(resData.response.result);
40
+
41
+        let productsIds = [];
42
+
43
+        for(let i=0;i<resData.length;i++){
44
+            let curr = resData[i];
45
+            let productname = curr.productname;
46
+            if(productsIdReqArr.includes(productname)){
47
+                productsIds.push(curr.productid)
48
+            }
49
+        }
50
+        console.log(productsIds);
51
+
52
+        console.log(resData);
53
+        return productsIds;
54
+
55
+    }
56
+
57
+    function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid}){
58
+        let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
59
+        let tags = itemname.split('-');
60
+        let ramTech = tags[tags.length-2];
61
+        let gb =  tags[tags.length-1];
62
+        const [currencySymbol,amount] = getCurrencySymbol(pricelist);
63
+        let priceAmt = `${currencySymbol} ${amount}`;
64
+
65
+        let detailPageName;
66
+        let addSearch = '?';
67
+        if (window.location.href.includes('laptops')) {
68
+            detailPageName = 'laptopdetails';
69
+            let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
70
+            addSearch = `?${name}`;
71
+        } else {
72
+            detailPageName = 'productdetails';
73
+        };
74
+      
75
+        debugger;
76
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
77
+            <div class="card border bg-gray-3 rounded-3 p-1 h-100">
78
+            
79
+            <a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class=""><img  src="${img}" alt="${itemname}" class="w-100 h-100 p-5"></a>
80
+                <div class="card-body">
81
+                    <a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class="">
82
+                        <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
83
+                        </a>
84
+                </div>
85
+                <hr>
86
+                <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
87
+                    <li class="border-0 py-0">
88
+                        <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
89
+                    </li>
90
+                    <li class="border-0 py-0">
91
+                        <span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
92
+                    </li>
93
+                </ul>
94
+                <div class="card-body text-center">
95
+                    <a href="/${detailPageName}.html?productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
96
+                    </a>
97
+                </div>
98
+        
99
+            </div>
100
+        </div>`
101
+        
102
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
103
+        <div class="card border bg-gray-3 rounded-3 p-1 h-100">
104
+        
105
+        <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
106
+            <div class="card-body">
107
+            <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
108
+                <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
109
+                </a>
110
+            </div>
111
+            <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
112
+                <li class="border-0 py-0">
113
+                    <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
114
+                </li>
115
+                <li class="border-0 py-0">
116
+                    <span class="satoshi_font"><h6>${priceAmt}</h6></span>
117
+                </li>
118
+            </ul>
119
+            <div class="card-body text-center">
120
+                <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
121
+                </a>
122
+            </div>
123
+    
124
+        </div>
125
+    </div>`;
126
+
127
+        //abhi anna design
128
+        return ` 
129
+        
130
+            <!--desktop--->
131
+            <div class="col-sm-4 p-3">
132
+                <div class="product_card_3 shadow ram_card">
133
+                    <div class="card-item-header">
134
+                        <div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
135
+                        <img src="${img}" class="w-100 h-100"></a>
136
+                        </div>
137
+                    </div>
138
+                    <div class="card-item-body">
139
+                      <h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" >  ${itemname} </a></h3>
140
+                      <hr>
141
+                        <h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
142
+                        <div class="py-2 card_product_footer">
143
+                            <button   data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM "  data_version="DDR4" data_device="Desktop" data_gb="8GB"   data_price="2900">Details </button>
144
+                        </div>
145
+                    </div>
146
+                </div>
147
+         </div>
148
+           `;
149
+        return `<div class="col-lg-3 col-md-6 ram_card">
150
+        <div class="card shadow border-0 p-1 h-100">
151
+            <a href="#">
152
+                <img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
153
+            </a>
154
+            <div class="card-body">
155
+                <a href="#" class="text-decoration-none text-dark">
156
+                    <h5 class="card-title satoshi_font mb-0">
157
+                        ${itemname}
158
+                    </h5>
159
+                </a>
160
+            </div>
161
+            <ul class="list-group list-group-flush">
162
+                <li class="list-group-item border-0 py-0">
163
+                    <span class="satoshi_font">${gb} ${ramTech}</span>
164
+                </li>
165
+                <li class="list-group-item border-0 py-0">
166
+                    <span class="satoshi_font">3200 Mhz</span>
167
+                </li>
168
+            </ul>
169
+            <div class="card-body d-none">
170
+                <button class="btn--md btn-primary w-100 card-link">
171
+                    <span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
172
+                </button>
173
+            </div>
174
+            <div class="card-body text-center">
175
+                <div  data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
176
+                    Memory, oering 3200 MHz speed in 8, 16,
177
+                    and 32 GB capacities. Experience enhanced
178
+                    thermal performance, increased longevity,
179
+                    and superior performance with our
180
+                    innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
181
+                </div>
182
+            </div>
183
+        </div>
184
+    </div>`
185
+    }
186
+}
187
+
188
+initAcc();

+ 316
- 0
dist/js/products/allinoneproduct.js View File

@@ -0,0 +1,316 @@
1
+function ramProductsInit(){
2
+    let RAM_ID =  '';
3
+  
4
+    async function init(){
5
+        let id 
6
+        if(location.search==''&&(location.href.includes('laptops')||location.href.includes('allinones'))){
7
+            id = await  getallproductsFun();
8
+        }else{
9
+            id = await getProductIdService();
10
+        }
11
+        getRamData(id)
12
+    }
13
+
14
+    async function getProductsIds(nameArr){
15
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
16
+        if(resData.isError){
17
+            toasterHelper("error","Something went wrong!")
18
+            return;
19
+        }
20
+
21
+        let res = resData.response;
22
+                
23
+        res = JSON.parse(res.result);
24
+        let ids = [];
25
+
26
+        for(let i=0;i<nameArr.length;i++){
27
+            const currName = nameArr[i];
28
+            let id = res.find((item)=>{
29
+                if(currName === item.productname){
30
+                    return item.productid;
31
+                }
32
+            })
33
+            if(id){
34
+                ids.push(id);
35
+            }
36
+        }
37
+
38
+        return ids;
39
+
40
+    }
41
+
42
+    async function getallproductsFun(){
43
+        let laptopStr = ['FYRO Flagship','Zeno Dualbook','Zeno Sleekbook'];
44
+        let allInOnesStr = ['AIO Zeno','AIO Fyro']; 
45
+
46
+        
47
+
48
+        let name = window.location.href;
49
+
50
+        name = name.includes('laptops') ?laptopStr : allInOnesStr;
51
+
52
+        const ids = await getProductsIds(name);
53
+
54
+        console.log(ids);
55
+
56
+        return ids;
57
+
58
+    }
59
+
60
+    function getProductIdService(){
61
+        return new Promise(async (reslove,reject)=>{
62
+            
63
+            let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
64
+           if(resData.isError){
65
+                alert(resData.errorMsg.message);
66
+                return;
67
+            }
68
+
69
+            let res = resData.response;
70
+                
71
+            res = JSON.parse(res.result);
72
+
73
+            console.log(res);
74
+
75
+            let searchName = window.location.search.split('?')[1];
76
+            let urlPathName = window.location.pathname; 
77
+            let searchTerm = '';
78
+             if(urlPathName.includes('ram')){
79
+                searchTerm = "RAM ORA";
80
+            }else if(urlPathName.includes('storage')){
81
+                searchTerm = `SSD ORA`;
82
+            }else{
83
+                searchTerm = searchName.replaceAll('%20',' ');
84
+            }
85
+            let resultItem = [];
86
+            
87
+            if(searchTerm.toLowerCase() === 'zeno'){
88
+                for(let i=0;i<res.length;i++){
89
+                    if(res[i].productname.includes("Zeno Sleekbook")||res[i].productname.includes("Zeno Dualbook")){
90
+                        resultItem.push( res[i])
91
+                        
92
+                    }
93
+                }
94
+                
95
+                return reslove(resultItem)
96
+            }else if(searchTerm.toLowerCase() === 'fyro'){
97
+                for(let i=0;i<res.length;i++){
98
+                    if(res[i].productname.includes("FYRO Flagship")){
99
+                        resultItem.push( res[i]);
100
+                        return reslove(resultItem)
101
+                    }
102
+                }
103
+            }else{
104
+                for(let i=0;i<res.length;i++){
105
+                    if(res[i].productname.includes(searchTerm)){
106
+                        resultItem.push( res[i])
107
+                        
108
+                    }
109
+                }
110
+         
111
+                return reslove(resultItem)
112
+            }
113
+
114
+            
115
+
116
+        });
117
+    }
118
+
119
+    async function getRamData(ids){
120
+        let resData;
121
+        let res
122
+        let data = [];
123
+       let windowSearch = window.location.href;
124
+        for(let i=0;i<ids.length;i++){
125
+            let id = ids[i].productid;
126
+            if (windowSearch.includes('laptops')||windowSearch.includes('allinones')) {
127
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
128
+            }
129
+            else {
130
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`, true);
131
+            }
132
+            if(resData.isError){
133
+                alert(resData.errorMsg.message);
134
+                return;
135
+            }
136
+    
137
+            res = resData.response;
138
+            
139
+            res = JSON.parse(res.result);
140
+            data = [...data,...res];
141
+        }
142
+        
143
+        
144
+        
145
+       
146
+
147
+        console.log(data);
148
+        let html = '';
149
+
150
+        for(let i=0;i<data.length;i++){
151
+            if(data[i].itemname.includes('AIO Fyro - 32')) continue;
152
+            html += getRamCardHTML(data[i]);
153
+        }
154
+
155
+        $('.product_card_section').html(html);
156
+
157
+        if(window.location.href.includes("?AIO%20Fyro")){
158
+            $(".processor_name").text("i7 / i9");
159
+            $('.product_card_section div.ram_card').addClass("d-none");
160
+            $('.product_card_section div.ram_card:nth-child(1)').removeClass("d-none");
161
+        }
162
+        if(window.location.href.includes("?AIO%20Zeno")){
163
+             $('.product_card_section div.ram_card').addClass("d-none");
164
+             $('.product_card_section div.ram_card:nth-child(14)').removeClass("d-none");
165
+             $('.product_card_section div.ram_card:nth-child(15)').removeClass("d-none");
166
+        }
167
+        // $('.ramcard').click(function(e){
168
+     
169
+        //     let sku = $(e.target).data('itemid');
170
+        //     let itemid = $(e.target).data('itemid');
171
+   
172
+        //     window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
173
+
174
+        // })
175
+    }
176
+
177
+    function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid}){
178
+        let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
179
+        let tags = itemname.split('-');
180
+        let ramTech = tags[tags.length-2];
181
+        let gb =  tags[tags.length-1];
182
+        const [currencySymbol,amount] = getCurrencySymbol(pricelist);
183
+        let priceAmt = `${currencySymbol} ${amount}`;
184
+
185
+        let detailPageName;
186
+        debugger;
187
+        let addSearch = '';
188
+        if (window.location.href.includes('laptops')||window.location.href.includes('allinones')) {
189
+            detailPageName = 'laptopdetails';
190
+            let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
191
+            addSearch = `?${name}`;
192
+        } else {
193
+            // detailPageName = 'productdetails';
194
+           detailPageName = 'laptopdetails';
195
+        };
196
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
197
+            <div class="card border bg-gray-3 rounded-3 p-1 h-100">
198
+            
199
+            <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class=""><img loading="lazy" src="${img}" alt="${itemname}" class="w-100 h-100 p-5"></a>
200
+                <div class="card-body">
201
+                    <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
202
+                        <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
203
+                        </a>
204
+                </div>
205
+                <hr>
206
+                <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
207
+                    <li class="mb-0 processor_name">i3 / 15 / i7</li>
208
+                </ul>
209
+                <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
210
+                    <li class="border-0 py-0">
211
+                        <span class="satoshi_font">
212
+                            <h6>${gb}</h6> 
213
+                            <h6 class="d-none">${ramTech}</h6>
214
+                        </span>
215
+                    </li>
216
+                    <li class="border-0 py-0">
217
+                        <span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
218
+                    </li>
219
+                </ul>
220
+                <div class="card-body text-center">
221
+                    <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
222
+                    </a>
223
+                </div>
224
+        
225
+            </div>
226
+        </div>`
227
+        
228
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
229
+        <div class="card border bg-gray-3 rounded-3 p-1 h-100">
230
+        
231
+        <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
232
+            <div class="card-body">
233
+            <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
234
+                <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
235
+                </a>
236
+            </div>
237
+            <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
238
+                <li class="border-0 py-0">
239
+                    <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
240
+                </li>
241
+                <li class="border-0 py-0">
242
+                    <span class="satoshi_font"><h6>${priceAmt}</h6></span>
243
+                </li>
244
+            </ul>
245
+            <div class="card-body text-center">
246
+                <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
247
+                </a>
248
+            </div>
249
+    
250
+        </div>
251
+    </div>`;
252
+
253
+        //abhi anna design
254
+        return ` 
255
+        
256
+            <!--desktop--->
257
+            <div class="col-sm-4 p-3">
258
+                <div class="product_card_3 shadow ram_card">
259
+                    <div class="card-item-header">
260
+                        <div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
261
+                        <img src="${img}" class="w-100 h-100"></a>
262
+                        </div>
263
+                    </div>
264
+                    <div class="card-item-body">
265
+                      <h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" >  ${itemname} </a></h3>
266
+                      <hr>
267
+                        <h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
268
+                        <div class="py-2 card_product_footer">
269
+                            <button   data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM "  data_version="DDR4" data_device="Desktop" data_gb="8GB"   data_price="2900">Details </button>
270
+                        </div>
271
+                    </div>
272
+                </div>
273
+         </div>
274
+           `;
275
+        return `<div class="col-lg-3 col-md-6 ram_card">
276
+        <div class="card shadow border-0 p-1 h-100">
277
+            <a href="#">
278
+                <img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
279
+            </a>
280
+            <div class="card-body">
281
+                <a href="#" class="text-decoration-none text-dark">
282
+                    <h5 class="card-title satoshi_font mb-0">
283
+                        ${itemname}
284
+                    </h5>
285
+                </a>
286
+            </div>
287
+            <ul class="list-group list-group-flush">
288
+                <li class="list-group-item border-0 py-0">
289
+                    <span class="satoshi_font">${gb} ${ramTech}</span>
290
+                </li>
291
+                <li class="list-group-item border-0 py-0">
292
+                    <span class="satoshi_font">3200 Mhz</span>
293
+                </li>
294
+            </ul>
295
+            <div class="card-body d-none">
296
+                <button class="btn--md btn-primary w-100 card-link">
297
+                    <span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
298
+                </button>
299
+            </div>
300
+            <div class="card-body text-center">
301
+                <div  data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
302
+                    Memory, oering 3200 MHz speed in 8, 16,
303
+                    and 32 GB capacities. Experience enhanced
304
+                    thermal performance, increased longevity,
305
+                    and superior performance with our
306
+                    innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
307
+                </div>
308
+            </div>
309
+        </div>
310
+    </div>`
311
+    }
312
+
313
+    init();
314
+}
315
+
316
+ramProductsInit();

+ 419
- 0
dist/js/products/laptopproduct.js View File

@@ -0,0 +1,419 @@
1
+function ramProductsInit(){
2
+    let RAM_ID =  '';
3
+  
4
+    async function init(){
5
+        let id 
6
+        if(location.search==''&&(location.href.includes('laptops')||location.href.includes('allinones'))){
7
+            id = await  getallproductsFun();
8
+        }else{
9
+            id = await getProductIdService();
10
+        }
11
+        getRamData(id)
12
+    }
13
+
14
+    async function getProductsIds(nameArr){
15
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
16
+        if(resData.isError){
17
+            toasterHelper("error","Something went wrong!")
18
+            return;
19
+        }
20
+
21
+        let res = resData.response;
22
+                
23
+        res = JSON.parse(res.result);
24
+        let ids = [];
25
+
26
+        for(let i=0;i<nameArr.length;i++){
27
+            const currName = nameArr[i];
28
+            let id = res.find((item)=>{
29
+                if(currName === item.productname){
30
+                    return item.productid;
31
+                }
32
+            })
33
+            if(id){
34
+                ids.push(id);
35
+            }
36
+        }
37
+
38
+        return ids;
39
+
40
+    }
41
+
42
+    async function getallproductsFun(){
43
+        let laptopStr = ['FYRO Flagship','Zeno Dualbook','Zeno Sleekbook'];
44
+        let allInOnesStr = ['AIO Zeno','AIO Fyro']; 
45
+
46
+        
47
+
48
+        let name = window.location.href;
49
+
50
+        name = name.includes('laptops') ?laptopStr : allInOnesStr;
51
+
52
+        const ids = await getProductsIds(name);
53
+
54
+        console.log(ids);
55
+
56
+        return ids;
57
+
58
+    }
59
+
60
+    function getProductIdService(){
61
+        return new Promise(async (reslove,reject)=>{
62
+            
63
+            let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
64
+           if(resData.isError){
65
+                alert(resData.errorMsg.message);
66
+                return;
67
+            }
68
+
69
+            let res = resData.response;
70
+                
71
+            res = JSON.parse(res.result);
72
+
73
+            // console.log(res);
74
+
75
+            let searchName = window.location.search.split('?')[1];
76
+            let urlPathName = window.location.pathname; 
77
+            let searchTerm = '';
78
+             if(urlPathName.includes('ram')){
79
+                searchTerm = "RAM ORA";
80
+            }else if(urlPathName.includes('storage')){
81
+                searchTerm = `SSD ORA`;
82
+            }else{
83
+                searchTerm = searchName.replaceAll('%20',' ');
84
+            }
85
+            let resultItem = [];
86
+            
87
+            if(searchTerm.toLowerCase() === 'zeno'){
88
+                for(let i=0;i<res.length;i++){
89
+                    if(res[i].productname.includes("Zeno Sleekbook")||res[i].productname.includes("Zeno Dualbook")){
90
+                        resultItem.push( res[i])
91
+                        
92
+                    }
93
+                }
94
+                
95
+                return reslove(resultItem)
96
+            }else if(searchTerm.toLowerCase() === 'fyro'){
97
+                for(let i=0;i<res.length;i++){
98
+                    if(res[i].productname.includes("FYRO Flagship")){
99
+                        resultItem.push(res[i]);
100
+                        return reslove(resultItem)
101
+                    }
102
+                }
103
+            }else{
104
+                for(let i=0;i<res.length;i++){
105
+                    if(res[i].productname.includes(searchTerm)){
106
+                        resultItem.push(res[i])
107
+                        
108
+                    }
109
+                }
110
+         
111
+                return reslove(resultItem)
112
+            }
113
+
114
+            
115
+
116
+        });
117
+    }
118
+
119
+    async function getRamData(ids){
120
+        let resData;
121
+        let res
122
+        let data = [];
123
+       let windowSearch = window.location.href;
124
+        for(let i=0;i<ids.length;i++){
125
+            let id = ids[i].productid;
126
+            if (windowSearch.includes('laptops')||windowSearch.includes('allinones')) {
127
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
128
+            }
129
+            else {
130
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`, true);
131
+            }
132
+            if(resData.isError){
133
+                alert(resData.errorMsg.message);
134
+                return;
135
+            }
136
+    
137
+            res = resData.response;
138
+            
139
+            res = JSON.parse(res.result);
140
+            data = [...data,...res];
141
+        }
142
+        
143
+        
144
+        
145
+       
146
+
147
+        console.log(data);
148
+        let html = '';
149
+
150
+        for(let i=0;i<data.length;i++){
151
+            console.log(data[i].tagids);
152
+            let tags_id = data[i].tagids;
153
+            let tags_filter = tags_id.includes("106631360000087");
154
+            let tags_filter_2 = tags_id.includes("106631360000088");
155
+            let tags_filter_3 = tags_id.includes("106631360000089");
156
+            
157
+            if(tags_filter == false && tags_filter_2 == false && tags_filter_3 == false){
158
+                        if(data[i].itemname.includes('AIO Fyro - 32')) continue;
159
+                        html += getRamCardHTML(data[i]);
160
+            }
161
+            else{
162
+                let data_name = tags_id.includes("106631360000087");
163
+                let name_id = data[i].tagids.includes("106631360000087");
164
+                if(data_name === true && name_id === true){
165
+                    for(let j=0;j<data.length;j++){
166
+                        if(j==0){
167
+                            if(data[j].itemname.includes('AIO Fyro - 32')) continue;
168
+                            html += getRamCardHTML(data[i]);
169
+                        }
170
+                    }
171
+                   
172
+                } 
173
+            } 
174
+        }
175
+        $('.product_card_section').html(html);
176
+        if(window.location.href.includes("?Zeno")){
177
+            $('.product_card_section div.ram_card:nth-child(1)').addClass("d-none");
178
+            $('.product_card_section div.ram_card:nth-child(6)').addClass("d-none");
179
+        }
180
+        if(window.location.href.includes("?FYRO")){
181
+             $('.product_card_section div.ram_card:nth-child(3)').addClass("d-none");
182
+             $('.product_card_section div.ram_card:nth-child(7)').addClass("d-none");
183
+             $('.product_card_section div.ram_card:nth-child(8)').addClass("d-none");
184
+        }
185
+        // $('.ramcard').click(function(e){
186
+     
187
+        //     let sku = $(e.target).data('itemid');
188
+        //     let itemid = $(e.target).data('itemid');
189
+   
190
+        //     window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
191
+
192
+        // })
193
+    }
194
+
195
+    function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid,tagnames}){
196
+        let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
197
+        let tags = itemname.split('-');
198
+        let ramTech = tags[tags.length-2];
199
+        let tag_name = tagnames.split('|');
200
+       
201
+        let gb =  tags[tags.length-1];
202
+        const [currencySymbol,amount] = getCurrencySymbol(pricelist);
203
+        let priceAmt = `${currencySymbol} ${amount}`;
204
+
205
+        let detailPageName;
206
+        let addSearch = '';
207
+        if (window.location.href.includes('laptops')) {
208
+            detailPageName = 'laptopdetails';
209
+            let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
210
+            addSearch = `?${name}`;
211
+        } else {
212
+            detailPageName = 'productdetails';
213
+            
214
+        };
215
+
216
+        let color_name = tag_name[tag_name.length-1].trim();
217
+        let processor_name1 = tagnames.includes("i7");
218
+        let processor_name2 = tagnames.includes("i5");
219
+        let processor_name3 = tagnames.includes("i3");
220
+        let dul_core = itemname.includes("Zeno Dualbook");
221
+       
222
+    
223
+        let processor;
224
+        if( processor_name1 === true){
225
+            if(dul_core === true){
226
+                processor = `i7`
227
+            }else{
228
+                processor = `i5 / i7`
229
+            }
230
+           
231
+        }else if( processor_name2 === true){
232
+            if(dul_core === true){
233
+                processor = `i7`
234
+            }else{
235
+                processor = `i5 / i7`
236
+            }
237
+        }else if( processor_name3 === true){
238
+            processor = `i3`
239
+        }
240
+        else if(itemname.includes("I7") || itemname.includes("i7")){
241
+            let fyro_data_2 = itemname.includes("RTX 4060");
242
+            if(fyro_data_2 === true){
243
+                processor = `i5 / i7 / i9`
244
+            }else{
245
+                processor = `i5 / i7`
246
+            }
247
+           
248
+        }else if(itemname.includes("I9") || itemname.includes("i9")){
249
+            let fyro_data_1 = itemname.includes("RTX 4050");
250
+            let fyro_data_2 = itemname.includes("RTX 4060");
251
+            if(fyro_data_1 === true || fyro_data_2 === true){
252
+                processor = `i5 / i7 / i9`
253
+            }else{
254
+                processor = `i9`
255
+            }
256
+          
257
+        }else if(itemname.includes("I5") || itemname.includes("i5")){
258
+            let fyro_data = itemname.includes("RTX 4060");
259
+            if(fyro_data === true){
260
+                processor = `i5 / i7 / i9`
261
+            }
262
+            else{
263
+                processor = `i5 / i7 / i9`
264
+            }
265
+           
266
+        }
267
+
268
+       
269
+        let item_color_1;
270
+        let item_color_2;
271
+        let item_color_3;
272
+        let item_color_4;
273
+        if(color_name == "Eucalyptus Green" || color_name == "Desert Brown"){
274
+            item_color_1 = `#5e7975`;
275
+            item_color_2 = `#624839`;
276
+            item_color_3 = `#253746`;
277
+        }else if( color_name == "Deep Sea Blue"){
278
+            item_color_1 = `#5e7975`;
279
+            item_color_2 = `#624839`;
280
+            item_color_3 = `#253746`;
281
+        }
282
+        else{
283
+            if(color_name.length <=14){
284
+                item_color_4 = ``;
285
+            }else{
286
+                item_color_4 = `#0d0a08`;
287
+            }
288
+        }
289
+        debugger;
290
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
291
+            <div class="card border bg-gray-3 rounded-3 p-1 h-100">
292
+            
293
+            <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
294
+            <img  src="${img}" alt="${itemname}" class="p-5" style="width:350px;height:300px"></a>
295
+                <div class="card-body">
296
+                    <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
297
+                        <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
298
+                        </a>
299
+                </div>
300
+                <hr>
301
+                <ul class="border-0 mb-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
302
+                    <li class="processor_name"><img src="../dist/assets/imgs/processor.svg" class="w-20p pe-1"/><span class="pt-1">${processor?processor:""}</span></li>
303
+                    <li class="d-flex justify-content-between">
304
+                        <p item_color=${item_color_1} class="colors mb-0 me-1" ${item_color_1?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_1}"`:''}></p>
305
+                        <p item_color=${item_color_2} class="mb-0 me-1" ${item_color_2?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_2}"`:''}></p>
306
+                        <p item_color=${item_color_3} class="mb-0" ${item_color_3?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_3}"`:''}></p>
307
+                        <p item_color=${item_color_4} class="mb-0" ${item_color_4?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_4}"`:''}></p>
308
+                    </li>
309
+                </ul>
310
+                <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
311
+                   
312
+                    <li class="border-0 py-0">
313
+                        <span class="satoshi_font">
314
+                            <h6><img src="../dist/assets/imgs/laptop-icon.png" class="w-20p pe-1"/>${gb}</h6>
315
+                        </span>
316
+                    </li>
317
+                    <li class="border-0 py-0">
318
+                        <span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
319
+                    </li>
320
+                </ul>
321
+                <div class="card-body text-center">
322
+                    <a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
323
+                    </a>
324
+                </div>
325
+        
326
+            </div>
327
+        </div>`;
328
+        
329
+        
330
+        
331
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
332
+        <div class="card border bg-gray-3 rounded-3 p-1 h-100">
333
+        
334
+        <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
335
+            <div class="card-body">
336
+            <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
337
+                <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
338
+                </a>
339
+            </div>
340
+            <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
341
+                <li class="border-0 py-0">
342
+                    <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
343
+                </li>
344
+                <li class="border-0 py-0">
345
+                    <span class="satoshi_font"><h6>${priceAmt}</h6></span>
346
+                </li>
347
+            </ul>
348
+            <div class="card-body text-center">
349
+                <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
350
+                </a>
351
+            </div>
352
+    
353
+        </div>
354
+    </div>`;
355
+
356
+        //abhi anna design
357
+        return ` 
358
+        
359
+            <!--desktop--->
360
+            <div class="col-sm-4 p-3">
361
+                <div class="product_card_3 shadow ram_card">
362
+                    <div class="card-item-header">
363
+                        <div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
364
+                        <img src="${img}" class="w-100 h-100"></a>
365
+                        </div>
366
+                    </div>
367
+                    <div class="card-item-body">
368
+                      <h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" >  ${itemname} </a></h3>
369
+                      <hr>
370
+                        <h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
371
+                        <div class="py-2 card_product_footer">
372
+                            <button   data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM "  data_version="DDR4" data_device="Desktop" data_gb="8GB"   data_price="2900">Details </button>
373
+                        </div>
374
+                    </div>
375
+                </div>
376
+         </div>
377
+           `;
378
+        return `<div class="col-lg-3 col-md-6 ram_card">
379
+        <div class="card shadow border-0 p-1 h-100">
380
+            <a href="#">
381
+                <img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
382
+            </a>
383
+            <div class="card-body">
384
+                <a href="#" class="text-decoration-none text-dark">
385
+                    <h5 class="card-title satoshi_font mb-0">
386
+                        ${itemname}
387
+                    </h5>
388
+                </a>
389
+            </div>
390
+            <ul class="list-group list-group-flush">
391
+                <li class="list-group-item border-0 py-0">
392
+                    <span class="satoshi_font">${gb} ${ramTech}</span>
393
+                </li>
394
+                <li class="list-group-item border-0 py-0">
395
+                    <span class="satoshi_font">3200 Mhz</span>
396
+                </li>
397
+            </ul>
398
+            <div class="card-body d-none">
399
+                <button class="btn--md btn-primary w-100 card-link">
400
+                    <span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
401
+                </button>
402
+            </div>
403
+            <div class="card-body text-center">
404
+                <div  data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
405
+                    Memory, oering 3200 MHz speed in 8, 16,
406
+                    and 32 GB capacities. Experience enhanced
407
+                    thermal performance, increased longevity,
408
+                    and superior performance with our
409
+                    innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
410
+                </div>
411
+            </div>
412
+        </div>
413
+    </div>`
414
+    }
415
+
416
+    init();
417
+}
418
+
419
+ramProductsInit();

+ 302
- 0
dist/js/products/products.js View File

@@ -0,0 +1,302 @@
1
+function ramProductsInit(){
2
+    let RAM_ID =  '';
3
+  
4
+    async function init(){
5
+        let id 
6
+        if(location.search==''&&(location.href.includes('laptops')||location.href.includes('allinones'))){
7
+            id = await  getallproductsFun();
8
+        }else{
9
+            id = await getProductIdService();
10
+        }
11
+        getRamData(id);
12
+
13
+        swapSectionsVideo();
14
+    }
15
+
16
+    async function getProductsIds(nameArr){
17
+        let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
18
+        if(resData.isError){
19
+            toasterHelper("error","Something went wrong!")
20
+            return;
21
+        }
22
+
23
+        let res = resData.response;
24
+                
25
+        res = JSON.parse(res.result);
26
+        let ids = [];
27
+
28
+        for(let i=0;i<nameArr.length;i++){
29
+            const currName = nameArr[i];
30
+            let id = res.find((item)=>{
31
+                if(currName === item.productname){
32
+                    return item.productid;
33
+                }
34
+            })
35
+            if(id){
36
+                ids.push(id);
37
+            }
38
+        }
39
+
40
+        return ids;
41
+
42
+    }
43
+
44
+    async function getallproductsFun(){
45
+        let laptopStr = ['FYRO Flagship','Zeno Dualbook','Zeno Sleekbook'];
46
+        let allInOnesStr = ['AIO Zeno','AIO Fyro']; 
47
+
48
+        
49
+
50
+        let name = window.location.href;
51
+
52
+        name = name.includes('laptops') ?laptopStr : allInOnesStr;
53
+
54
+        const ids = await getProductsIds(name);
55
+
56
+        console.log(ids);
57
+
58
+        return ids;
59
+
60
+    }
61
+
62
+    function getProductIdService(){
63
+        return new Promise(async (reslove,reject)=>{
64
+            
65
+            let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true); 
66
+           if(resData.isError){
67
+                alert(resData.errorMsg.message);
68
+                return;
69
+            }
70
+
71
+            let res = resData.response;
72
+                
73
+            res = JSON.parse(res.result);
74
+
75
+            console.log(res);
76
+
77
+            let searchName = window.location.search.split('?')[1];
78
+            let urlPathName = window.location.pathname; 
79
+            let searchTerm = '';
80
+             if(urlPathName.includes('ram')){
81
+                searchTerm = "RAM ORA";
82
+            }else if(urlPathName.includes('storage')){
83
+                searchTerm = `SSD ORA`;
84
+            }else{
85
+                searchTerm = searchName.replaceAll('%20',' ');
86
+            }
87
+            let resultItem = [];
88
+            
89
+            if(searchTerm.toLowerCase() === 'zeno'){
90
+                for(let i=0;i<res.length;i++){
91
+                    if(res[i].productname.includes("Zeno Sleekbook")||res[i].productname.includes("Zeno Dualbook")){
92
+                        resultItem.push( res[i])
93
+                        
94
+                    }
95
+                }
96
+                
97
+                return reslove(resultItem)
98
+            }else if(searchTerm.toLowerCase() === 'fyro'){
99
+                for(let i=0;i<res.length;i++){
100
+                    if(res[i].productname.includes("FYRO Flagship")){
101
+                        resultItem.push( res[i]);
102
+                        return reslove(resultItem)
103
+                    }
104
+                }
105
+            }else{
106
+                for(let i=0;i<res.length;i++){
107
+                    if(res[i].productname.includes(searchTerm)){
108
+                        resultItem.push( res[i])
109
+                        
110
+                    }
111
+                }
112
+         
113
+                return reslove(resultItem)
114
+            }
115
+
116
+            
117
+
118
+        });
119
+    }
120
+
121
+    async function getRamData(ids){
122
+        let resData;
123
+        let res
124
+        let data = [];
125
+       let windowSearch = window.location.href;
126
+        for(let i=0;i<ids.length;i++){
127
+            let id = ids[i].productid;
128
+            if (windowSearch.includes('laptops')||windowSearch.includes('allinones')) {
129
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
130
+            }
131
+            else {
132
+                resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`, true);
133
+            }
134
+            if(resData.isError){
135
+                alert(resData.errorMsg.message);
136
+                return;
137
+            }
138
+    
139
+            res = resData.response;
140
+            
141
+            res = JSON.parse(res.result);
142
+            data = [...data,...res];
143
+        }
144
+        
145
+        
146
+        
147
+       
148
+
149
+        console.log(data);
150
+        let html = '';
151
+
152
+        for(let i=0;i<data.length;i++){
153
+            if(data[i].itemname.includes('AIO Fyro - 32')) continue;
154
+            html += getRamCardHTML(data[i]);
155
+        }
156
+
157
+        $('.product_card_section').html(html);
158
+
159
+        // $('.ramcard').click(function(e){
160
+     
161
+        //     let sku = $(e.target).data('itemid');
162
+        //     let itemid = $(e.target).data('itemid');
163
+   
164
+        //     window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
165
+
166
+        // })
167
+    }
168
+
169
+    function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid}){
170
+        let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
171
+        let tags = itemname.split('-');
172
+        let ramTech = tags[tags.length-2];
173
+        let gb =  tags[tags.length-1];
174
+        const [currencySymbol,amount] = getCurrencySymbol(pricelist);
175
+        let priceAmt = `${currencySymbol} ${amount}`;
176
+
177
+        let detailPageName;
178
+        let addSearch = '?';
179
+        if (window.location.href.includes('laptops')) {
180
+            detailPageName = 'laptopdetails';
181
+            let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
182
+            addSearch = `?${name}`;
183
+        } else {
184
+            detailPageName = 'productdetails';
185
+        };
186
+      
187
+        debugger;
188
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
189
+            <div class="card border bg-gray-3 rounded-3 p-1 h-100">
190
+            
191
+            <a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class=""><img  src="${img}" alt="${itemname}" class="w-100 h-100 p-5"></a>
192
+                <div class="card-body">
193
+                    <a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class="">
194
+                        <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
195
+                        </a>
196
+                </div>
197
+                <hr>
198
+                <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
199
+                    <li class="border-0 py-0">
200
+                        <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
201
+                    </li>
202
+                    <li class="border-0 py-0">
203
+                        <span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
204
+                    </li>
205
+                </ul>
206
+                <div class="card-body text-center">
207
+                    <a href="/${detailPageName}.html?productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
208
+                    </a>
209
+                </div>
210
+        
211
+            </div>
212
+        </div>`
213
+        
214
+        return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
215
+        <div class="card border bg-gray-3 rounded-3 p-1 h-100">
216
+        
217
+        <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
218
+            <div class="card-body">
219
+            <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
220
+                <h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
221
+                </a>
222
+            </div>
223
+            <ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
224
+                <li class="border-0 py-0">
225
+                    <span class="satoshi_font">  <h6>${gb}</h6> <h6>${ramTech}</h6></span>
226
+                </li>
227
+                <li class="border-0 py-0">
228
+                    <span class="satoshi_font"><h6>${priceAmt}</h6></span>
229
+                </li>
230
+            </ul>
231
+            <div class="card-body text-center">
232
+                <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
233
+                </a>
234
+            </div>
235
+    
236
+        </div>
237
+    </div>`;
238
+
239
+        //abhi anna design
240
+        return ` 
241
+        
242
+            <!--desktop--->
243
+            <div class="col-sm-4 p-3">
244
+                <div class="product_card_3 shadow ram_card">
245
+                    <div class="card-item-header">
246
+                        <div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
247
+                        <img src="${img}" class="w-100 h-100"></a>
248
+                        </div>
249
+                    </div>
250
+                    <div class="card-item-body">
251
+                      <h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" >  ${itemname} </a></h3>
252
+                      <hr>
253
+                        <h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
254
+                        <div class="py-2 card_product_footer">
255
+                            <button   data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM "  data_version="DDR4" data_device="Desktop" data_gb="8GB"   data_price="2900">Details </button>
256
+                        </div>
257
+                    </div>
258
+                </div>
259
+         </div>
260
+           `;
261
+        return `<div class="col-lg-3 col-md-6 ram_card">
262
+        <div class="card shadow border-0 p-1 h-100">
263
+            <a href="#">
264
+                <img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
265
+            </a>
266
+            <div class="card-body">
267
+                <a href="#" class="text-decoration-none text-dark">
268
+                    <h5 class="card-title satoshi_font mb-0">
269
+                        ${itemname}
270
+                    </h5>
271
+                </a>
272
+            </div>
273
+            <ul class="list-group list-group-flush">
274
+                <li class="list-group-item border-0 py-0">
275
+                    <span class="satoshi_font">${gb} ${ramTech}</span>
276
+                </li>
277
+                <li class="list-group-item border-0 py-0">
278
+                    <span class="satoshi_font">3200 Mhz</span>
279
+                </li>
280
+            </ul>
281
+            <div class="card-body d-none">
282
+                <button class="btn--md btn-primary w-100 card-link">
283
+                    <span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
284
+                </button>
285
+            </div>
286
+            <div class="card-body text-center">
287
+                <div  data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
288
+                    Memory, oering 3200 MHz speed in 8, 16,
289
+                    and 32 GB capacities. Experience enhanced
290
+                    thermal performance, increased longevity,
291
+                    and superior performance with our
292
+                    innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
293
+                </div>
294
+            </div>
295
+        </div>
296
+    </div>`
297
+    }
298
+
299
+    init();
300
+}
301
+
302
+ramProductsInit();

+ 81
- 0
dist/js/ramproducts/ramproducts.js View File

@@ -0,0 +1,81 @@
1
+function ramProductsInit(){
2
+    const RAM_ID = 106633230000024;
3
+    function init(){
4
+        getRamData(RAM_ID)
5
+    }
6
+    async function getRamData(id){
7
+        let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`,true); 
8
+
9
+        if(resData.isError){
10
+            alert(resData.errorMsg.message);
11
+            return;
12
+        }
13
+
14
+        let res = resData.response;
15
+            
16
+        res = JSON.parse(res.result);
17
+
18
+        console.log(res);
19
+        let html = '';
20
+
21
+        for(let i=0;i<res.length;i++){
22
+            html += getRamCardHTML(res[i]);
23
+        }
24
+
25
+        $('.ramsContainer').html(html);
26
+
27
+        $('.ramcard').click(function(e){
28
+            let sku = $(e.target).data('sku');
29
+            let itemid = $(e.target).data('itemid');
30
+
31
+            window.location.href = `/productdetails.html?productId=${RAM_ID}?sku=${sku}`
32
+
33
+        })
34
+    }
35
+
36
+    function getRamCardHTML({itemname,pricelist,itemid,sku}){
37
+        let tags = itemname.split('-');
38
+        let ramTech = tags[tags.length-2];
39
+        let gb =  tags[tags.length-1];
40
+        return `<div class="col-lg-3 col-md-6 ram_card">
41
+        <div class="card shadow border-0 p-1 h-100">
42
+            <a href="#">
43
+                <img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
44
+            </a>
45
+            <div class="card-body">
46
+                <a href="#" class="text-decoration-none text-dark">
47
+                    <h5 class="card-title satoshi_font mb-0">
48
+                        ${itemname}
49
+                    </h5>
50
+                </a>
51
+            </div>
52
+            <ul class="list-group list-group-flush">
53
+                <li class="list-group-item border-0 py-0">
54
+                    <span class="satoshi_font">${gb} ${ramTech}</span>
55
+                </li>
56
+                <li class="list-group-item border-0 py-0">
57
+                    <span class="satoshi_font">3200 Mhz</span>
58
+                </li>
59
+            </ul>
60
+            <div class="card-body d-none">
61
+                <button class="btn--md btn-primary w-100 card-link">
62
+                    <span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
63
+                </button>
64
+            </div>
65
+            <div class="card-body text-center">
66
+                <div  data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
67
+                    Memory, oering 3200 MHz speed in 8, 16,
68
+                    and 32 GB capacities. Experience enhanced
69
+                    thermal performance, increased longevity,
70
+                    and superior performance with our
71
+                    innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
72
+                </div>
73
+            </div>
74
+        </div>
75
+    </div>`
76
+    }
77
+
78
+    init();
79
+}
80
+
81
+ramProductsInit();

+ 248
- 0
dist/js/shoppingcart/addtocart.js View File

@@ -0,0 +1,248 @@
1
+const CART_DATA = 'CART_DATA';
2
+
3
+let cartLength = 0;
4
+const CART_ADD = 'CART_ADD';
5
+function getCartData(){
6
+    const data = localStorage.getItem(CART_DATA);
7
+    if(data) return JSON.parse(data);
8
+    return null;
9
+}
10
+
11
+function removeCartData(){
12
+    localStorage.removeItem(CART_DATA);
13
+}
14
+
15
+function setCartData(data){
16
+    localStorage.setItem(CART_DATA,JSON.stringify(data));
17
+}
18
+
19
+function setLengthCart(){
20
+  const data =   getCartData();
21
+  if(!data) return;
22
+
23
+  
24
+  let length = 0;
25
+
26
+  for(let item in data){
27
+    let curr = data[item];
28
+    length += parseInt(curr.quantity);
29
+  }
30
+
31
+  if(length>0){
32
+    $('.cartnumcount').removeClass('d-none').html(length);
33
+  }else{
34
+    $('.cartnumcount').addClass('d-none').html(0);
35
+  }
36
+
37
+}
38
+
39
+
40
+function getQuantityById(id){
41
+   const data =  getCartData();
42
+   if(!data) return;
43
+
44
+   for(let item in data){
45
+        if(id == item){
46
+            $('#quantity').val(products[item].quantity);
47
+        }
48
+    }
49
+}
50
+
51
+function updateCartQuantity(id,val){
52
+    const data = getCartData();
53
+    if(!data) return;
54
+
55
+
56
+    data[id].quantity = val;
57
+
58
+    
59
+    setCartData(data);
60
+    updateSummaryPriceAdd();
61
+
62
+}
63
+
64
+function removeCartItem(id){
65
+  
66
+    let data = getCartData();
67
+    if(!data) return;
68
+
69
+    let newdata = {};
70
+   
71
+    for(let item in data){
72
+        if(item != id){
73
+            newdata[item] = data[item];
74
+        }
75
+    }
76
+
77
+    setCartData(newdata);
78
+    updateSummaryPriceAdd();
79
+
80
+    return Object.keys(newdata).length;
81
+}
82
+
83
+function updateSummaryPriceAdd(){
84
+    let data = getCartData();
85
+    let totalSummaryPrice = $('.totalSummaryPrice');
86
+    let totalPrice = $('.totalPrice');
87
+    let currecy = $('.currecy');
88
+    let noofitems = $('.noofitems');
89
+    if(!data) return;
90
+    let len = 0;
91
+    let totalAmt = 0;
92
+    for(let item in data) {
93
+        let {price,quantity} = data[item];
94
+        totalAmt += parseInt(price*quantity);
95
+        len += parseInt(quantity);
96
+    }
97
+    const [currencySymbol,amount] = getCurrencySymbol(totalAmt);
98
+    noofitems.html(len);
99
+
100
+    totalSummaryPrice.html(amount);
101
+    totalPrice.html(amount);
102
+    currecy.html(currencySymbol);
103
+
104
+
105
+}
106
+
107
+function initAddToCart(){
108
+
109
+    addEventListeners();
110
+
111
+    function addToCartFun(){
112
+        const data = getCartData();
113
+          
114
+        let id =  window.location.search.split('=')[1];
115
+        const qty = parseInt($('#addtocart').data('qty'));
116
+        if(!data){
117
+            
118
+            let cartObj = {};
119
+          
120
+      
121
+            cartObj[$('#skudetailitem').val()]  = {
122
+                name:$('.productname').html(),
123
+                price:$('.price').data('price'),
124
+                quantity:$('#quantity').val(),
125
+                img:$('.productDetailsMain img').attr('src'),
126
+                sku:$('#skudetailitem').val(),
127
+                totalQty:qty,
128
+                productid:$('#productidtag').val(),
129
+                itemid:$('#itemidtag').val()
130
+            }
131
+
132
+
133
+            addtoCart(cartObj);
134
+            //$('.cartnumcount').removeClass('d-none').html(1);
135
+            setLengthCart();
136
+           
137
+        }else{
138
+            //if(!data[id]) data['length']++;
139
+            let name = $('.productname').html();
140
+            let price = $('.price').data('price');
141
+            let quantity = $('#quantity').val();
142
+            let img = $('.productDetailsMain img').attr('src');
143
+            let sku = $('#skudetailitem').val();
144
+
145
+           
146
+       
147
+            if(data[$('#skudetailitem').val()]){
148
+                data[$('#skudetailitem').val()] = {
149
+                    name:name,
150
+                    price:price,
151
+                    quantity: parseInt(data[sku].quantity)+parseInt(quantity),
152
+                    img:img,
153
+                    sku:sku,
154
+                    totalQty:qty,
155
+                    productid:$('#productidtag').val(),
156
+                    itemid:$('#itemidtag').val()
157
+                }
158
+                addtoCart(data);
159
+            }else{
160
+                data[$('#skudetailitem').val()] = {
161
+                    name:name,
162
+                    price:price,
163
+                    quantity:parseInt(quantity),
164
+                    img:img,
165
+                    sku:sku,
166
+                    totalQty:qty,
167
+                    productid:$('#productidtag').val(),
168
+                    itemid:$('#itemidtag').val()
169
+                }
170
+                addtoCart(data);
171
+            }
172
+            
173
+        }
174
+
175
+        setLengthCart();
176
+
177
+    }
178
+    
179
+    function addEventListeners(){
180
+        $('#addtocart').html('Add to cart');
181
+        $('#addtocart').removeAttr('gotocart');
182
+        $('#addtocart').off('click').click((e)=>{
183
+     debugger
184
+            $('.insufficientqty').addClass('d-none');
185
+            const qty = parseInt($('#addtocart').data('qty'));
186
+      
187
+            if(parseInt($('#quantity').val())>qty){
188
+                $('.insufficientqty').removeClass('d-none');
189
+                return;
190
+            }
191
+            $('#addtocart').off().click(function (el){
192
+                window.location.href = '/shopping-cart.html';
193
+
194
+            });
195
+
196
+            addToCartFun();
197
+       
198
+            toasterHelper('success',"Item added to cart","toast-top-right");
199
+           
200
+           $('#addtocart').html('Go to cart');
201
+   
202
+           $('#addtocart').attr('gotocart',1);
203
+        });
204
+
205
+        // $('.quantityHTML #quantity').off('change').change(function (e){
206
+        //    let sku =  $('#skudetailitem').val();
207
+        //    let data = getCartData();
208
+        //    const qty = parseInt($('#addtocart').data('qty'));
209
+        //    let isCart =   $('#addtocart').attr('gotocart');
210
+        //    if(!isCart) return;
211
+        //    if(parseInt($('#quantity').val())>qty){
212
+        //     $('.insufficientqty').removeClass('d-none');
213
+        //     return;
214
+        // }
215
+        //    if(!data[sku]){
216
+        //     return;
217
+        //    }
218
+
219
+        //    data[sku].quantity =  $('.quantityHTML #quantity').val();
220
+        //    toasterHelper("success","Your item quantity was been updated","toast-top-right")
221
+        //    setCartData(data);
222
+        //    setLengthCart();
223
+        // })
224
+
225
+        $('.buynow').off('click').click(async (e)=>{
226
+            addToCartFun();
227
+            const res = await COOKIE_HELPER.validateToken();
228
+            if(!res.response){
229
+                localStorage.setItem(CART_ADD,true);
230
+                window.location.href = '/login.html';
231
+                
232
+                $('.checkoutbtn').find('span').removeClass('d-none');
233
+                $('.checkoutbtn').find('div').addClass('d-none');
234
+                 return;
235
+            }
236
+            window.location.href = '/selectdelivery.html';
237
+
238
+        }); 
239
+    }
240
+
241
+    function addtoCart(data){
242
+        const currData = getCartData();
243
+        let newData = {...currData,...data};
244
+        setCartData(newData);
245
+    }
246
+}
247
+
248
+initAddToCart();

+ 825
- 0
dist/js/shoppingcart/select_delivery.js View File

@@ -0,0 +1,825 @@
1
+function initSelectDevlivery() {
2
+    let editMode = false;
3
+    let countryId = null;
4
+    let currencyId = null;
5
+    let billingInfo = null;
6
+    let userName = null;
7
+    let stateArr = [];
8
+debugger;
9
+
10
+
11
+let Newuser =window.localStorage.getItem('isaccountCreated');
12
+        let Loginstatus =window.localStorage.getItem('Isloggedintoaster')
13
+        if(Newuser == 'true'){
14
+           
15
+            toasterHelper("success","Account Created Successfully");
16
+            window.localStorage.removeItem('isaccountCreated')
17
+            
18
+        }
19
+        if(Loginstatus == 'true'){
20
+            toasterHelper("success","Isloggedintoaster");
21
+            window.localStorage.removeItem('Isloggedintoaster')
22
+            
23
+        }
24
+
25
+    $('.mianselectdelivery').removeClass('d-none');
26
+    $('.containermaindev').removeClass('d-none');
27
+   
28
+    let orderBtnAction = {
29
+        removeOrdernowBtn() {
30
+            $('.ordernowbtn').parent().addClass('d-none');
31
+        },
32
+
33
+        addOrdernowBtn() {
34
+            $('.ordernowbtn').parent().removeClass('d-none');
35
+        }
36
+    }
37
+
38
+    let addresslistAction = {
39
+        removeAddressContainer(){
40
+            $('.addresslist').addClass('d-none');
41
+        },
42
+        addAddressContainer(){
43
+            $('.addresslist').removeClass('d-none');
44
+        }
45
+    }
46
+
47
+    let changeAddressBtnAction = {
48
+        removeChangeAddressBtn() {
49
+            $('.changeAddressBtn').addClass('d-none');
50
+        },
51
+        addChangeAddressBtn() {
52
+            $('.changeAddressBtn').removeClass('d-none');
53
+        }
54
+        
55
+    }
56
+
57
+    let changesaveCancelBtnAction = {
58
+        removeChangeCancelBtn() {
59
+            $('.saveanddeliverCanel').addClass('d-none');
60
+        },
61
+        addChangeCancelBtn() {
62
+            $('.saveanddeliverCanel').removeClass('d-none');
63
+        }
64
+        
65
+    }
66
+
67
+    let saveFormLoading = {
68
+        addSpinner(){
69
+            $('.saveanddeliver').find('.spinner-border').removeClass('d-none');
70
+            $('.saveanddeliver').find('span').addClass('d-none');
71
+        },
72
+
73
+        removeSpinner(){
74
+            $('.saveanddeliver').find('.spinner-border').addClass('d-none');
75
+            $('.saveanddeliver').find('span').removeClass('d-none');
76
+        },
77
+    }
78
+    let paymentgatewaypageAction = {
79
+        addPaymentgatewaypage(){
80
+            $('.paymentgatewaypage').removeClass('d-none');
81
+        },
82
+
83
+        removePaymentgatewaypage(){
84
+            $('.paymentgatewaypage').addClass('d-none');
85
+        }
86
+    }
87
+
88
+    let paymentContainerAction = {
89
+        paymentContainerAdd(){
90
+            $('.orderslist').parent().removeClass('d-none');
91
+        },
92
+
93
+        paymentContainerRemove(){
94
+            $('.orderslist').parent().addClass('d-none');
95
+        }
96
+    }
97
+
98
+    const {phonenumber_errorhandler,addressdes_errorhandler,zipcode_errorhandler,state_errorhandler} = factoryErrorControl();
99
+
100
+    function init() {
101
+        getAddressRes();
102
+        loadEvents();
103
+        updateSummaryPriceAdd();
104
+        // changeAddressBtnAction.removeChangeAddressBtn();
105
+
106
+    }
107
+
108
+    function removeAllFormError(){
109
+        phonenumber_errorhandler.removeError();
110
+        addressdes_errorhandler.removeError();
111
+        zipcode_errorhandler.removeError();
112
+        state_errorhandler.removeError();
113
+
114
+        $('.errMsgFormEdit').addClass('d-none');
115
+        $('.errMsgFormEdit').html('');
116
+
117
+    }
118
+
119
+    function clearAllInputs(){
120
+        // $("#state").select2({
121
+        //     placeholder: "Select a City",
122
+        //     allowClear: true
123
+        // });
124
+
125
+        $('#state').val(null);
126
+
127
+        $('#phonenumber').val(null);
128
+        $('#addressdes').val(null);
129
+        $('#zipcode').val(null);
130
+    }
131
+
132
+    async function appendFormDetails(){
133
+        let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
134
+        console.log(cookieRes);
135
+        const { errorMsg, isError, response } = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`);
136
+        let res = JSON.parse(response.result)[0];
137
+        debugger;
138
+        const {cityid, lobid,organizationname,addressline,cityname,phonenumber,zipcode,name } =res;
139
+
140
+        setAddressHeader({name:organizationname,phonenumber,addressline,cityname,zipcode});
141
+
142
+        $('#phonenumber').val(phonenumber);
143
+            $('#addressdes').val(addressline);
144
+            $('#zipcode').val(zipcode);
145
+            debugger;
146
+             $('#state').attr('data-id',cityid);
147
+            $('#state').val(cityname)
148
+            $('.userNamelogin').html(`${userName}`);
149
+
150
+        editMode = true;
151
+//        console.log(stateArr);
152
+        renderCustomStateDropdown(stateArr);
153
+        //renderStates(stateArr);
154
+
155
+    }
156
+
157
+    async function getAddressRes() {
158
+        let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
159
+        console.log(cookieRes);
160
+        const { errorMsg, isError, response } = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`);
161
+
162
+        let res = JSON.parse(response.result);
163
+        console.log(res, 'befores');
164
+        res = res[res.length - 1];
165
+
166
+        //createBillingForm();
167
+
168
+        const {cityid, lobid,organizationname,addressline,cityname,phonenumber,zipcode,name } =res;
169
+        billingInfo = res;
170
+        debugger;
171
+        console.log(res);
172
+        if (cityid != 0) {
173
+            $('.addnewAddressContainer').addClass('d-none');
174
+            $('.detailsAddressBg').removeClass('detailsAddressBg');
175
+            $('.ordersummaryheader').addClass('detailsAddressBg');
176
+            $('.displayadress').removeClass('d-none')
177
+            // $('.addresslist').removeClass('d-none');
178
+            loadShippingProducts();
179
+            userName = organizationname;
180
+            
181
+            setAddressHeader({name:organizationname,phonenumber,addressline,cityname,zipcode});
182
+            debugger;
183
+           
184
+            editMode = true;
185
+
186
+
187
+            // adding values
188
+
189
+            $('#phonenumber').val(phonenumber);
190
+            $('#addressdes').val(addressline);
191
+            $('#zipcode').val(zipcode);
192
+            debugger;
193
+             $('#state').attr('data-id',cityid);
194
+            $('#state').val(cityname);
195
+            $('.userNamelogin').html(`${userName}`);
196
+            changeAddressBtnAction.addChangeAddressBtn()
197
+            getCountryStateCurrency();
198
+        }else{
199
+            $('.userNamelogin').html(`${organizationname}`);
200
+            loadShippingProducts();
201
+            paymentContainerAction.paymentContainerRemove();
202
+            getCountryStateCurrency();
203
+            orderBtnAction.removeOrdernowBtn();
204
+            $('.detailsAddressBg').removeClass('detailsAddressBg');
205
+            $('.selectAddress').addClass('detailsAddressBg');
206
+        }
207
+    }
208
+
209
+    function setAddressHeader({name,phonenumber,addressline,cityname,zipcode}){
210
+        $('.innerDisplayAddress').html(`${phonenumber}, ${addressline}, ${cityname} - `);
211
+        $('.zipcodeAddress').html(`${zipcode}`);
212
+
213
+    }
214
+
215
+    function checkForm(){
216
+   
217
+        let number = $('#phonenumber').val();
218
+        let zipcode = $('#zipcode').val();
219
+        let state = $('#state').data('id');
220
+        let address = $('#addressdes').val();
221
+
222
+        let isTrue = false;
223
+        if(!number || number.length!=10){
224
+            isTrue = true;
225
+            phonenumber_errorhandler.addError();
226
+        }
227
+
228
+        if(zipcode.length<6 || zipcode.length>6){
229
+            isTrue = true;
230
+            zipcode_errorhandler.addError();
231
+        }
232
+
233
+        if(!state){
234
+            isTrue = true;
235
+            state_errorhandler.addError();
236
+        }
237
+
238
+        if(!address){
239
+            isTrue = true;
240
+            addressdes_errorhandler.addError();
241
+        }
242
+
243
+        return isTrue;
244
+
245
+
246
+    }
247
+
248
+    async function createBillingForm(){
249
+        debugger;
250
+        let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
251
+        let { userId, name } = cookieRes;
252
+        const ctyId =   await getCountryId();
253
+        
254
+        let stateId = parseInt($('#state').data('id'));
255
+         let payload = {
256
+                "cityid": stateId,
257
+                "CityName":$(`[data-id="${stateId}"`).html(),
258
+                "addressline1": $('#addressdes').val(),
259
+
260
+                "OrganizationType": 2,
261
+                "organizationname": name,
262
+                //"OrganizationId":,
263
+                "ContactName": name,
264
+                "ContactId": userId,
265
+                "countryname": 'india',
266
+                "countryid": ctyId,
267
+                "statename":$(`[data-id="${stateId}"`).html(),
268
+                "phonenumber": $('#phonenumber').val(),
269
+
270
+                "OrganizationId": userId,
271
+                "currencyid": 2,
272
+                "taxno": '0',
273
+                "BillingInfoExists": false,
274
+                "lobid": 0,
275
+                "lobname": "IT Products",
276
+                "gstindetailid": 0,
277
+                zipcode:$('#zipcode').val()
278
+            }
279
+            const res = await API_SERVICES_ACTIONS.postAPIService('apis/v4/bizgaze/crm/address/savebillinginfo', payload);
280
+            // http://localhost:3088/apis/v4/bizgaze/crm/address/savebillinginfo
281
+
282
+
283
+            setAddressHeader({name,phonenumber:$('#phonenumber').val(),addressline: $('#addressdes').val(),cityname:$('#state').val(),zipcode:$('#zipcode').val()});
284
+
285
+            return new Promise((reslove,reject) => {
286
+                reslove(res);
287
+            })
288
+        console.log(res);
289
+    }
290
+
291
+    async function saveForm() {
292
+        
293
+        let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
294
+        let { userId, name } = cookieRes;
295
+        const { errorMsg, isError, response } = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/anwiauth/getbillinginfo/contactid/${cookieRes.userId}`);
296
+
297
+        let resAnwi = JSON.parse(response.result);
298
+        console.log(resAnwi, 'befores');
299
+        resAnwi = resAnwi[resAnwi.length - 1];
300
+
301
+        let stateId = parseInt($('#state').data('id'));
302
+        let payload = {
303
+            ...resAnwi,
304
+            phonenumber:$('#phonenumber').val(),
305
+            addressline1:$('#addressdes').val(),
306
+            zipcode:$('#zipcode').val(),
307
+            cityid:stateId,
308
+            CityName:$('#state').val(),
309
+           
310
+        }
311
+
312
+        console.log(payload,"ertyuioghjkl");
313
+
314
+
315
+      
316
+        //
317
+        const res = await API_SERVICES_ACTIONS.postAPIService('apis/v4/bizgaze/crm/address/savebillinginfo', payload);
318
+
319
+        return new Promise((reslove,reject) => {
320
+            reslove(res);
321
+        })
322
+    }
323
+
324
+
325
+    function onChangeState(e){
326
+        let userItem = e.target.value.toLowerCase();
327
+        let limit = 10;
328
+        let results = [];
329
+        let maxLen = stateArr.length > 10 ? 10 :stateArr.length;
330
+        debugger
331
+        for(let i=0;i<stateArr.length;i++){
332
+            let currItem = stateArr[i];
333
+            let stateName = currItem.cityname.toLowerCase();
334
+            if(stateName.includes(userItem)){
335
+                results.push(currItem);
336
+                if(results.length>=10) break;
337
+            }
338
+        }
339
+
340
+        renderCustomStateDropdown(results);
341
+        loadDropdownStateEvents();
342
+
343
+
344
+    }
345
+
346
+    function loadDropdownStateEvents(){
347
+        $('#state').off().focus(function (){
348
+            $('.stateBox').removeClass('d-none');
349
+            $(document).off('click').click(closeDrop);
350
+
351
+           
352
+        })
353
+
354
+     
355
+        $(document).off().click(closeDrop);
356
+
357
+        function closeDrop(e){
358
+            let id = $(e.target).hasClass('stateoption');
359
+            if($(e.target).attr('id')==='state') return;
360
+            if(id) {
361
+                $('.stateBox').addClass('d-none');
362
+                $(document).off();
363
+            }else{
364
+                $('.stateBox').addClass('d-none');
365
+                $(document).off();
366
+            }
367
+
368
+        }
369
+
370
+        $('#state').keyup(debounce(function (event){
371
+            onChangeState(event)
372
+        })); 
373
+    }
374
+    
375
+
376
+    async function loadEvents() {
377
+
378
+        loadDropdownStateEvents();
379
+
380
+        $('.addnewAddressContainer').off('click').click(function (e) {
381
+            $('.addnewAddressContainer').addClass('d-none');
382
+            $('.addresslist').removeClass('d-none');
383
+            changeAddressBtnAction.removeChangeAddressBtn();
384
+            changesaveCancelBtnAction.addChangeCancelBtn();
385
+           
386
+        });
387
+
388
+        $('.saveanddeliverCanel').off('click').click(function (){
389
+           if(!editMode){
390
+            $('.addnewAddressContainer').removeClass('d-none');
391
+            $('.addresslist').addClass('d-none');
392
+            changeAddressBtnAction.removeChangeAddressBtn();
393
+            changesaveCancelBtnAction.removeChangeCancelBtn();
394
+           }else{
395
+            loadShippingProducts();
396
+            addresslistAction.removeAddressContainer()
397
+            changeAddressBtnAction.addChangeAddressBtn();
398
+            paymentContainerAction.paymentContainerAdd();
399
+            $('.displayadress').removeClass('d-none');
400
+           }
401
+
402
+           clearAllInputs();
403
+        });
404
+
405
+        $('.changeAddressBtn').off('click').click(function (e){
406
+            console.log(e.target);
407
+            //getAddressRes();
408
+            appendFormDetails();
409
+            removeOrderSummary();
410
+            changeAddressBtnAction.removeChangeAddressBtn();
411
+            $('.displayadress').addClass('d-none')
412
+        })
413
+
414
+        
415
+        $('.saveanddeliver').off('click').click(async function (e) {
416
+           debugger;
417
+            saveFormLoading.addSpinner()
418
+            let isErrorForm =  checkForm();
419
+
420
+            if(isErrorForm){ 
421
+                saveFormLoading.removeSpinner();
422
+                return;
423
+            }
424
+            let res;
425
+            if(editMode){
426
+                res = await saveForm();
427
+            }else{
428
+                res = await createBillingForm();
429
+            }
430
+            saveFormLoading.removeSpinner();
431
+
432
+       
433
+            const {isError,errorMsg,response} = res;
434
+            console.log(errorMsg);
435
+            if(isError){
436
+
437
+                $('.errMsgFormEdit').removeClass('d-none');
438
+                $('.errMsgFormEdit').html(`${errorMsg.message}`);
439
+
440
+
441
+
442
+                return;
443
+            }
444
+            debugger;
445
+            editMode = true;
446
+            let {name} = COOKIE_HELPER.getCookie();
447
+            // phonenumber:$('#phonenumber').val(),
448
+            // addressline1:$('#addressdes').val(),
449
+            // zipcode:$('#zipcode').val(),
450
+            // cityid:stateId,
451
+            // CityName:$(`[data-id="${stateId}"`).html(),
452
+            let stateId = parseInt($('#state').data('id'));
453
+            setAddressHeader({name,addressline:$('#addressdes').val(),cityname:$(`#state`).val(),phonenumber:$('#phonenumber').val(),zipcode:$('#zipcode').val()});
454
+
455
+
456
+            $('.errMsgFormEdit').html('');
457
+             loadShippingProducts();
458
+            addresslistAction.removeAddressContainer()
459
+            changeAddressBtnAction.addChangeAddressBtn();
460
+            paymentContainerAction.paymentContainerAdd();
461
+            $('.displayadress').removeClass('d-none');
462
+         
463
+
464
+        });
465
+       
466
+
467
+        $('.ordernowbtn').off().click(async function (e){
468
+            let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
469
+            let { userId, name } = cookieRes;
470
+           
471
+            paymentgatewaypageAction.addPaymentgatewaypage();
472
+            let payload = {
473
+                "OrganizationName": name,
474
+                "BranchId": 106632280000001,
475
+                "OrderItems": [
476
+                    {            
477
+                        "UnitPrice": 20,
478
+                        "Quantity": 1,
479
+                        "SKU": "11",
480
+                        "DiscountValue": 0,
481
+                        "DiscountPercent": 0
482
+                    }
483
+                ]
484
+            }
485
+            $('.paymentgatewaypage').removeClass('d-none');
486
+            const data = getCartData();
487
+       
488
+            let orderItems = [];
489
+            for(let i in data){
490
+                const {price,quantity,sku} = data[i];
491
+                let payload = {
492
+                    "UnitPrice": price,
493
+                    "Quantity": quantity,
494
+                    "SKU": sku,
495
+                    "DiscountValue": 0,
496
+                    "DiscountPercent": 0
497
+                }
498
+                orderItems.push(payload)
499
+            }
500
+
501
+            payload['OrderItems'] = orderItems;
502
+
503
+            debugger;
504
+            
505
+          try {
506
+            const res =  await API_SERVICES_ACTIONS.postAPIService(`apis/v4/bizgaze/integrations/salesorder/save`,payload);
507
+          console.log(res.response.result);;
508
+
509
+          if(!res.response.result){
510
+            paymentgatewaypageAction.removePaymentgatewaypage();
511
+          }
512
+
513
+
514
+         
515
+        //   `http://localhost:3088/apis/v4/bizgaze/transact/orders/getpaymentgatewaytransaction/refid/106633780000069`
516
+
517
+          let response =  await  API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/transact/orders/getpaymentgatewaytransaction/refid/${res.response.result}`);
518
+         let  {PaymentLink} = JSON.parse(response.response.result);
519
+         window.location.href = PaymentLink;
520
+          } catch (error) {
521
+            paymentgatewaypageAction.removePaymentgatewaypage();
522
+          }
523
+        });
524
+    }
525
+
526
+    function getItemProductHTML(item) {
527
+        const { img, name, price, quantity, sku, id } = item;
528
+
529
+        return ` <div class="align-items-center item-product-add d-flex w-100" data-id="${id}" data-sku="${sku}">
530
+        <div style="max-width: 100px;" class="">
531
+            <img class="w-100" src="${img}" alt="">
532
+        </div>
533
+       <div class="" style="margin-left:10px">
534
+        <div>
535
+            <div style="font-size:12px">${name}</div>
536
+        </div>
537
+        <div>
538
+            <span style="font-size:12px" class="font-weight-600">${getCurrencySymbol(price)}</span> <span>x <span class="qtyitem" style="font-size:12px">${quantity}</span></span>
539
+        </div>
540
+       </div>
541
+    </div>`;
542
+        return ` <div class="item-product-add" data-id="${id}" data-sku="${sku}">
543
+        <div class="row py-2">
544
+            <div class="col-sm-2">
545
+               <div class="w-100 d-flex justify-content-around">
546
+                <div class="d-flex flex-column align-items-baseline">
547
+                    <div class="px-4 py-2 selectaddressimgshow">
548
+                        <img class="w-100" src="${img}" alt="" class="w-100">
549
+                    </div>
550
+                    <div class="addresscontrol w-100 d-flex justify-content-center gap-1">
551
+                        <div class="rounded-contain btnminus">
552
+                            -
553
+                        </div>
554
+                        <div class="w-100p">
555
+                            <input class="qtyshowinput" disabled value="${quantity}" type="number">
556
+                        </div>
557
+                        <div class="rounded-contain btnplus">
558
+                            +
559
+                        </div>
560
+                    </div>
561
+                   </div>
562
+               </div>
563
+            </div>
564
+            <div class="col-sm-10">
565
+                <div class="row h-100">
566
+                   <div class="col-sm-8">
567
+                    <div class="h-100 d-flex flex-column justify-content-between">
568
+                        <div> ${name}</div>
569
+                        <div>
570
+                           <span>$</span> ${price} <span class="d-none">56% Off 2 offers applied</span>
571
+                        </div>
572
+                    <div class="d-flex gap-3">
573
+                        <span class="text-uppercase d-none">Save for later</span>
574
+                        <span class="text-uppercase cursor-pointer removecartItem">Remove</span>
575
+                    </div>
576
+                    </div>
577
+                   </div>
578
+                </div>
579
+            </div>
580
+        </div>
581
+      </div>`;
582
+    }
583
+
584
+    async function getCountryId(){
585
+        const countryRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/anwiauth/getcountry');;
586
+        
587
+        if (countryRes.isError) {
588
+            alert("something went wrong");
589
+            console.log(countryRes);
590
+            return;
591
+        }
592
+
593
+        let ctyId = 0
594
+        let countryData = JSON.parse(countryRes.response.result);
595
+
596
+        console.log(countryData);
597
+
598
+        for (let i = 0; i < countryData.length; i++) {
599
+            if (countryData[i].countryname.toLowerCase() === 'india') {
600
+                debugger;
601
+                countryId = countryData[i].countryid;
602
+                ctyId = countryId
603
+                countrynameData = countryData[i].countryname;
604
+                break;
605
+            }
606
+        }
607
+
608
+        return ctyId;
609
+
610
+    }
611
+
612
+    function renderStates(data){
613
+        $('#state').off('select2:select');
614
+        let html = '';
615
+        for (let i = 0; i < 10; i++) {
616
+            html += `<option value="${data[i].cityid}" data-id="${data[i].cityid}">${data[i].cityname}</option>`
617
+
618
+        }
619
+
620
+        $('#state').append(html);
621
+        $("#state").select2({
622
+            placeholder: "Select a City",
623
+            allowClear: true
624
+        });
625
+    }
626
+
627
+    async function getCountryStateCurrency() {
628
+        const countryRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/anwiauth/getcountry');;
629
+
630
+        if (countryRes.isError) {
631
+            alert("something went wrong");
632
+            console.log(countryRes);
633
+            return;
634
+        }
635
+
636
+
637
+        let countryData = JSON.parse(countryRes.response.result);
638
+
639
+        console.log(countryData);
640
+
641
+        for (let i = 0; i < countryData.length; i++) {
642
+            if (countryData[i].countryname.toLowerCase() === 'india') {
643
+                countryID = countryData[i].countryid;
644
+                countrynameData = countryData[i].countryname;
645
+                break;
646
+            }
647
+        }
648
+
649
+        //    const stateRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/unibase/platform/forms/autocomplete/docpropertyid/116631530005773/columnname/statusid/value/1%7C/formpropertyid/116631620000066/formid/116631640000040/bindeddata/undefined/term/h/authtoken/2cd31fdd-440b-4eea-9039-659ab090628a?term=h&type=GET`);
650
+        const stateRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/anwiauth/getcities/countryid/${countryID}`);
651
+
652
+        if (stateRes.isError) {
653
+            alert("something went wrong");
654
+            console.log(stateRes);
655
+            return;
656
+        }
657
+
658
+        let stateData = JSON.parse(stateRes.response.result);
659
+
660
+//        console.log(stateData, 'state');
661
+
662
+
663
+        $('#state').val(null);
664
+        console.log("start")
665
+        let html = '';
666
+        statesList = stateData;
667
+        stateArr = stateData;
668
+        renderCustomStateDropdown(stateArr);
669
+        //renderStates(stateArr)
670
+
671
+       
672
+
673
+        const currencyRes = await API_SERVICES_ACTIONS.getAPIService('apis/v4/bizgaze/integrations/anwiauth/getcurrencies');
674
+
675
+        if(currencyRes.isError){
676
+            alert("something went wrong");
677
+            console.log(currencyRes);
678
+            return;
679
+        }
680
+
681
+        let currencyData = JSON.parse(currencyRes.response.result);
682
+
683
+        console.log(currencyData,'currencyDatacurrencyDatacurrencyData');
684
+
685
+        for(let i=0;i<currencyData.length;i++){
686
+            const curr = currencyData[i];
687
+            if(curr.currencyname.toLowerCase().includes('india')){
688
+                currencyid = curr.currencyid;
689
+            }
690
+        }
691
+    }
692
+
693
+    function getCustomDropDownHTML({cityid,cityname,countryid}){
694
+        return ` <div class="bg-white stateoption px-2 border-bottom py-2 cursor-pointer" data-name="${cityname}" data-value="${cityid}">${cityname}</div>`;
695
+    }
696
+
697
+    function renderCustomStateDropdown(stateList){
698
+        let html = ``;
699
+        debugger;;
700
+        let maxLen = stateList.length > 10 ? 10 :stateList.length
701
+        for(let i=0;i<maxLen;i++){
702
+            let currItem = stateList[i];
703
+            html+=getCustomDropDownHTML(currItem);
704
+        }
705
+
706
+        $('.stateBox').html(html);
707
+
708
+        $('.stateoption').off().click(function(e){
709
+            debugger;
710
+            const name = $(e.target).data('name');
711
+            const id = $(e.target).data('value');
712
+            $('#state').val(name);
713
+            $('#state').attr('data-id',id);
714
+        })
715
+    }
716
+
717
+    function loadShippingProducts(){
718
+        $('.detailsAddressBg').removeClass('detailsAddressBg');
719
+        $('.ordersummaryheader ').addClass('detailsAddressBg')
720
+debugger;
721
+        const products = getCartData();
722
+        console.log(products);
723
+        if (Object.keys(products||{}).length) orderBtnAction.addOrdernowBtn();
724
+
725
+        let productsHTML = '';
726
+        for (let item in products) {
727
+            const currItem = products[item];
728
+            productsHTML += getItemProductHTML({ ...currItem, id: item })
729
+        }
730
+        $('.orderlistcart').html(productsHTML);
731
+        // $('.orderslist').html(productsHTML);
732
+        $('.orderslist').addClass("p-3")
733
+        $('.orderslist').html(` <label for="online">
734
+        <input checked data-op="online" name="payment" type="radio" class="paymentbtn   " id="online">
735
+        <span>Pay Via (Card, Net Banking, Wallet)</span>
736
+       
737
+    </label>
738
+    <label for="cod" class="d-none">
739
+        Cash on delivery
740
+        <input data-op="cod" name="payment" type="radio" class="paymentbtn  " id="cod">
741
+    </label>`);
742
+
743
+    $('.paymentbtn').off().click(function (e){
744
+        const data = $(e.target).data('op');
745
+        if(data == 'online'){
746
+            orderBtnAction.addOrdernowBtn();
747
+        }else{
748
+            orderBtnAction.removeOrdernowBtn();
749
+        }
750
+    })
751
+        $('.btnminus').each(function (i, el) {
752
+            $(el).off().click(function (elm) {
753
+                let id = $(elm.target).parents('.item-product-add').data('id');
754
+                let val = parseInt($(elm.target).parents('.item-product-add').find('.qtyshowinput').val());
755
+                if (val <= 1) return;
756
+                val--;
757
+                updateCartQuantity(id, val)
758
+                $(elm.target).parents('.item-product-add').find('.qtyshowinput').val(val)
759
+            });
760
+        })
761
+        $('.btnplus').each(function (i, el) {
762
+            $(el).off().click(function (elm) {
763
+                let id = $(elm.target).parents('.item-product-add').data('id');
764
+                let val = parseInt($(elm.target).parents('.item-product-add').find('.qtyshowinput').val());
765
+                if (val >= 11) return;
766
+                val++;
767
+                updateCartQuantity(id, val)
768
+                $(elm.target).parents('.item-product-add').find('.qtyshowinput').val(val);
769
+            });
770
+        })
771
+        $('.removecartItem').each(function (i, el) {
772
+            $(el).click(function (elm) {
773
+                let id = $(elm.target).parents('.item-product-add').data('id');
774
+
775
+                let len = removeCartItem(id);
776
+                $(`.item-product-add[data-id="${id}"]`).remove();
777
+                if (!len) {
778
+                    orderBtnAction.removeOrdernowBtn();
779
+                }
780
+            });
781
+
782
+
783
+        })
784
+    }
785
+
786
+    function removeOrderSummary(){
787
+        $('.detailsAddressBg').removeClass('detailsAddressBg');
788
+        $('.selectAddress').addClass('detailsAddressBg');
789
+        $('.orderslist').html('');
790
+        $('.orderslist').removeClass("p-3");
791
+        orderBtnAction.removeOrdernowBtn();
792
+
793
+       // $('.detailsAddressBtn').addClass('d-none');
794
+        addresslistAction.addAddressContainer();
795
+        $('.saveanddeliver').removeClass('d-none');
796
+        $('.saveanddeliverCanel').removeClass('d-none')
797
+    }
798
+
799
+    function factoryErrorControl(){
800
+        let inputsArr = ['phonenumber','addressdes','zipcode','state'];
801
+
802
+        let controls = {};
803
+        for(let i=0;i<inputsArr.length;i++){
804
+            const id =inputsArr[i];
805
+
806
+            controls[`${id}_errorhandler`] = {
807
+                addError(){
808
+                    debugger;
809
+                    $(`#${id}`).parents('.col-sm-6').find('.invalid-feedback').addClass('d-block');
810
+                },
811
+                removeError(){
812
+                    $(`#${id}`).parents('.col-sm-6').find('.invalid-feedback').addClass('d-block');
813
+                }
814
+            }
815
+
816
+        }
817
+
818
+        return controls;
819
+    }
820
+
821
+    init();
822
+
823
+}
824
+
825
+checkValidAuth(initSelectDevlivery);

+ 287
- 0
dist/js/shoppingcart/shoppingcart.js View File

@@ -0,0 +1,287 @@
1
+shoppingCartInit();
2
+
3
+function shoppingCartInit() {
4
+
5
+    shoppingCartAppend();
6
+    let DELETE_FILTER = null;
7
+
8
+    let insufficientQtyActions = {
9
+        moreQtyAdd(e) {
10
+            $(e.target).parents('.mainselectcontainer').find('.insufficientqty').removeClass('d-none');
11
+        },
12
+
13
+        moreQtyRemove(e) {
14
+            $(e.target).parents('.mainselectcontainer').find('.insufficientqty').addClass('d-none');
15
+        }
16
+
17
+    }
18
+
19
+    function shoppingCartAppend() {
20
+        let data = getCartData();
21
+
22
+        if (!data) {
23
+            $('.emptyShow').removeClass('d-none');
24
+            $('.checkoutbtn').addClass('d-none');
25
+            return;
26
+        };
27
+
28
+        let html = '';
29
+        let products = data;
30
+
31
+
32
+
33
+        // for(let i=0;i<products.length;i++){
34
+        //     const {img,name,price,quantity,total} = products[i];
35
+        //     debugger;
36
+        //     html += shoppingCartDesktopHTML(products[i]);
37
+        // }
38
+        if (Object.keys(data).length === 0) {
39
+            $('.checkoutbtn').addClass('d-none');
40
+            $('.emptyShow').removeClass('d-none');
41
+        }
42
+        setLengthCart();
43
+        console.log(products, 'products');
44
+        for (let product in products) {
45
+
46
+            html += shoppingCartDesktopHTML({ ...products[product], total: products[product].quantity * products[product].price, id: product });
47
+        }
48
+
49
+        $('.appendItems').html(html);
50
+
51
+
52
+        addEventListenerCart();
53
+
54
+    }
55
+
56
+    // event listeners
57
+    function addEventListenerCart() {
58
+
59
+        $('.quantitySelect').each(function (i, element) {
60
+            if (!$(element).hasClass('d-none')) {
61
+                $(element).off().change(function (e) {
62
+                    insufficientQtyActions.moreQtyRemove(e);
63
+                    let num = e.target.value;
64
+                    if (num == 5) {
65
+                        $(e.target).parents('.mainselectcontainer').find('.inputcartaddmore').removeClass('d-none');
66
+                        $(e.target).addClass('d-none');
67
+                        $(e.target).parents('.mainselectcontainer').find('.inputcartaddmore button').off().click(function (item) {
68
+                            const val = $(item.target).parent().find('input').val();
69
+                            debugger;
70
+                            let totalQty = $(this).parents('.mainselectcontainer').data('qty');
71
+
72
+                            if (val <= 0 || totalQty < val) {
73
+                                insufficientQtyActions.moreQtyAdd(e);
74
+                                return;
75
+                            }
76
+
77
+                            let id = $(item.target).parents('.mainselectcontainer').data('id');
78
+
79
+                            updateCartQuantity(id, val);
80
+                            //    $(item.target).parents('.mainselectcontainer').find('.inputcartaddmore').addClass('d-none');
81
+                            //    $(e.target).removeClass('d-none');
82
+                            setLengthCart();
83
+                            shoppingCartAppend();
84
+
85
+                        })
86
+                    } else {
87
+                        let totalQty = $(e.target).parents('.mainselectcontainer').data('qty');
88
+                        const val = $(e.target).parent().find('input').val();
89
+                        if (val <= 0 || totalQty < val) {
90
+                            insufficientQtyActions.moreQtyAdd(e);
91
+                            return;
92
+                        }
93
+                        let id = $(e.target).parents('.mainselectcontainer').data('id');
94
+                        updateCartQuantity(id, num);
95
+                        setLengthCart();
96
+                        shoppingCartAppend();
97
+                    }
98
+                });
99
+            } else {
100
+                $(element).parents('.mainselectcontainer').find('.inputcartaddmore button').off().click(function (item) {
101
+                    debugger;
102
+
103
+                    const val = $(item.target).parent().find('input').val()
104
+                    let totalQty = $(this).parents('.mainselectcontainer').data('qty');
105
+
106
+                    if (val <= 0 || totalQty < val) {
107
+                        insufficientQtyActions.moreQtyAdd(item);
108
+
109
+                        return;
110
+                    }
111
+
112
+                    let id = $(item.target).parents('.mainselectcontainer').data('id');
113
+                    updateCartQuantity(id, val);
114
+                    //    $(item.target).parents('.mainselectcontainer').find('.inputcartaddmore').addClass('d-none');
115
+                    //    $(e.target).removeClass('d-none');
116
+                    setLengthCart();
117
+                    shoppingCartAppend();
118
+
119
+                })
120
+            }
121
+        });
122
+
123
+        $('.removeitemcartmodal').off('click').click(function () {
124
+
125
+
126
+            setCartData(DELETE_FILTER);
127
+            setLengthCart();
128
+            shoppingCartAppend();
129
+
130
+            let len = Object.keys(DELETE_FILTER).length
131
+            if (!len) {
132
+
133
+                $('.checkoutbtn').addClass('d-none');
134
+                $('.emptyShow').removeClass('d-none');
135
+            } else {
136
+                $('.checkoutbtn').removeClass('d-none');
137
+                $('.emptyShow').addClass('d-none');
138
+            }
139
+
140
+
141
+        });
142
+
143
+        $('.btndeletecart').each(function (i, element) {
144
+            $(element).click(function (e) {
145
+                const cardId = $(e.target).data('cartid');
146
+                let data = getCartData();
147
+                console.log(data, 'cardId', cardId);
148
+                if (!data) return;
149
+                debugger;
150
+                const products = data;
151
+                const productsFilter = {};
152
+
153
+                $('#modalremovecart').html(products[cardId].name);
154
+                for (let product in products) {
155
+                    if (product != cardId) productsFilter[product] = products[product];
156
+                }
157
+
158
+
159
+                data = productsFilter;
160
+
161
+                console.log(data);
162
+                DELETE_FILTER = data;
163
+                // setCartData(data);
164
+                // setLengthCart();
165
+                // shoppingCartAppend();
166
+            });
167
+        });
168
+
169
+        $('.checkoutbtn').click(async function (e) {
170
+            $('.checkoutbtn').find('span').addClass('d-none');
171
+            $('.checkoutbtn').find('div').removeClass('d-none');
172
+            const res = await COOKIE_HELPER.validateToken();
173
+            if (!res.response) {
174
+                localStorage.setItem(CART_ADD, true);
175
+                window.location.href = '/login.html';
176
+
177
+                $('.checkoutbtn').find('span').removeClass('d-none');
178
+                $('.checkoutbtn').find('div').addClass('d-none');
179
+                return;
180
+            }
181
+            window.location.href = '/selectdelivery.html';
182
+            $('.checkoutbtn').find('span').removeClass('d-none');
183
+            $('.checkoutbtn').find('div').addClass('d-none');
184
+
185
+
186
+        });
187
+    }
188
+
189
+    function getQuantityHTML(value, totalQty, id) {
190
+        return `<div data-id="${id}" data-qty="${totalQty}" class="mainselectcontainer w-100">
191
+        <div class="w-50">
192
+       
193
+        <select  class="quantitySelect form-select ${value >= 5 ? 'd-none' : ''}" value="${value}">
194
+                <option ${value == 1 ? 'selected="selected"' : null} value="1">
195
+                    1
196
+                </option>
197
+                <option  ${value == 2 ? 'selected="selected"' : null} value="2">
198
+                    2
199
+                </option>
200
+                <option  ${value == 3 ? 'selected="selected"' : null} value="3">
201
+                    3
202
+                </option>
203
+                <option  ${value == 4 ? 'selected="selected"' : null} value="4">
204
+                    4
205
+                </option>
206
+                <option  ${value == 5 ? 'selected="selected"' : null} value="5">
207
+                    5+
208
+                </option>
209
+            </select>
210
+    </div>
211
+
212
+    <div class=" inputcartaddmore d-flex gap-2 ${value >= 5 ? '' : 'd-none'}">
213
+        <input min="1" class="form-control" style="max-width:100px" value="${value <= 5 ? '5' : value}" type="number" />
214
+        <button class="bg-gradient-anwi border-none btn text-white">Add</button>
215
+    </div>
216
+        <div class="text-danger pt-2 insufficientqty d-none">Insufficient quantity</div>
217
+        </div>`
218
+    }
219
+
220
+    function shoppingCartDesktopHTML({ id, img, name, price, description, quantity, total, totalQty, productid, itemid }) {
221
+        const [currencySymbol, amount] = getCurrencySymbol(price);
222
+        debugger;
223
+      let tamt = 0;
224
+        {
225
+            const [currencySymbol, amount] = getCurrencySymbol(total);
226
+            tamt = amount;
227
+        }
228
+        return `
229
+       <div class="d-none d-md-block">
230
+       
231
+       <div  class="row bg-white   border-bottom py-4 d-flex justify-content-center align-items-center">
232
+       <div class="col-md-2 text-center"><img src="${img}" alt="${name}" class="img-fluid"></div>
233
+       <div class="col-md-4 ">
234
+         
235
+           <a class="text-decoration-none text-blue fw-600 cursor-pointer" href="productdetails.html?productId=${productid}#itemid=${itemid}">${name}</a>
236
+           <small>${description || ''}</small>
237
+           <span class="badge d-none text-bg-warning">8 Offers ></span>   
238
+       </div>
239
+       <div class="col-md-2">
240
+           <p class="text-right m-0"><span>${currencySymbol}</span> ${amount}</p>
241
+       </div>
242
+       <div class="col-md-2 ">
243
+  
244
+           ${getQuantityHTML(quantity, totalQty, id)}
245
+       </div>
246
+       <div class="col-md-2 ">
247
+           <div class="d-flex justify-content-between w-100">
248
+               <p class="fw-bold m-0">
249
+                 ${currencySymbol}${tamt}</p>
250
+               <span class="btndeletecart cursor-pointer fw-500 text-danger" data-cartid="${id}" data-bs-toggle="modal" data-bs-target="#deletecartmodal">x</span>
251
+           </div>
252
+       </div>
253
+       
254
+   </div>
255
+
256
+       </div>
257
+    <div class="row d-block d-md-none smallcart py-3">
258
+    <div class="row bg-white py-5 m-0">
259
+    <div class="col-4 text-center">
260
+    <img src="${img}" alt="${name}" class="img-fluid">
261
+</div>
262
+<div class="col-8 position-relative d-flex flex-column gap-1">
263
+
264
+    <div class="">
265
+        <span>
266
+            <a class="text-decoration-none text-blue fw-600 cursor-pointer" href="productdetails.html?productId=${productid}#itemid=${itemid}"><span class="">${name}</span></a>
267
+        </span>
268
+    </div>
269
+    <div>
270
+    <p class="fw-bold m-0">
271
+    ${currencySymbol}${tamt}</p>
272
+    </div>
273
+    <div class="text-truncate d-none">
274
+            <small>${description || ''}</small>
275
+    </div>
276
+     <div class="">
277
+
278
+        ${getQuantityHTML(quantity, totalQty, id)}
279
+    </div>
280
+   
281
+    <span class="btndeletecart cursor-pointer fw-500 text-danger" data-cartid="${id}" data-bs-toggle="modal" data-bs-target="#deletecartmodal">x</span>
282
+    </div>
283
+    </div>
284
+</div>
285
+        `;
286
+    }
287
+}

+ 29
- 0
dist/js/support/supportticket.js View File

@@ -0,0 +1,29 @@
1
+function supportTicketNoInit(){
2
+    let ticketId = null;
3
+
4
+    INIT();
5
+
6
+    function INIT(){
7
+        ticketId = window.location.search.split("=")[1];
8
+        getTicketData(ticketId);
9
+    }
10
+
11
+    async function getTicketData(id){
12
+       let res =  await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/products/getticketdetails/ticketno/${id}`);
13
+
14
+       if(res.isError){
15
+        toasterHelper("error",res.errorMsg,`toast-top-right`);
16
+        return;
17
+       }
18
+
19
+       res = JSON.parse(res.response.result)[0];
20
+
21
+       $('.description_support').html(res['Description']);
22
+       $('.ticketidsupport').html(res['ticketno']);
23
+       $('.raiseddate').html(res['Raised Date']);
24
+
25
+       console.log(res);
26
+    } 
27
+}
28
+
29
+supportTicketNoInit();

+ 0
- 0
dist/js/utils/cookiehelper.js View File


+ 150
- 0
dist/js/utils/helpers.js View File

@@ -0,0 +1,150 @@
1
+
2
+const uid = function () {
3
+    return Date.now().toString(36) + Math.random().toString(36).substr(2);
4
+}
5
+
6
+function loadScript(src) {
7
+    return new Promise(function (resolve, reject) {
8
+        var s;
9
+        s = document.createElement('script');
10
+        s.src = src;
11
+        s.onload = resolve;
12
+        s.onerror = reject;
13
+        document.head.appendChild(s);
14
+    });
15
+}
16
+
17
+
18
+function shuffleArray(array) {
19
+    for (let i = array.length - 1; i > 0; i--) {
20
+        const j = Math.floor(Math.random() * (i + 1));
21
+        [array[i], array[j]] = [array[j], array[i]];
22
+    }
23
+}
24
+
25
+function debounce(func, delay=500) {
26
+    let timeoutId;
27
+    return function(...args) {
28
+      const context = this;
29
+      clearTimeout(timeoutId);
30
+      timeoutId = setTimeout(() => {
31
+        func.apply(context, args);
32
+      }, delay);
33
+    };
34
+  }
35
+
36
+function getCurrencySymbol(value = 0) {
37
+    let type = 'INR'
38
+    if (type) {
39
+        const ans = new Intl.NumberFormat('en-IN', { style: 'currency', currency: type }).format(value);;
40
+        const res = ans.split(/(\D+)/);
41
+        const currencySymbol = res[1];
42
+        const amount = res.slice(2, res.length).join('')
43
+
44
+
45
+        return [currencySymbol, amount]
46
+    } else {
47
+        console.log("errrrrrrrrrrrrrrrrrrrrrrrrr", type);
48
+        return ['', 0];
49
+    }
50
+}
51
+
52
+function toasterHelper(type, message, align = 'toast-top-center') {
53
+    // toasterOpts()
54
+    debugger;
55
+    toastr.clear()
56
+    toasterOpts(align);
57
+    Command: toastr[type](message);
58
+
59
+    function toasterOpts(align) {
60
+        toastr.options = {
61
+            "closeButton": true,
62
+            "debug": false,
63
+            "newestOnTop": true,
64
+            "progressBar": true,
65
+            "positionClass": align,
66
+            "preventDuplicates": true,
67
+            "onclick": null,
68
+            "showDuration": "300",
69
+            "hideDuration": "1000",
70
+            "timeOut": "5000",
71
+            "extendedTimeOut": "1000",
72
+            "showEasing": "swing",
73
+            "hideEasing": "linear",
74
+            "showMethod": "fadeIn",
75
+            "hideMethod": "fadeOut"
76
+        }
77
+    }
78
+}
79
+
80
+async function getMulFileToGetBase64(event) {
81
+    let files = event.target.files;
82
+    let filePromise = [];
83
+    for (let i = 0; i < files.length; i++) {
84
+      let currFile = files[i];
85
+      let currFilePromise = new Promise((resolve, reject) => {
86
+        const reader = new FileReader();
87
+        reader.readAsDataURL(currFile);
88
+        // Wait till complete
89
+        reader.onloadend = function () {
90
+          let base64String = reader.result
91
+            .toString()
92
+            .replace(/^data:.+;base64,/, "");
93
+          let fileReq = {
94
+            FileData: base64String,
95
+            FileName: currFile.name.split(".").slice(0, -1).join("."),
96
+            FileType: currFile.name.split(".").pop(),
97
+            RefId: 0,
98
+            "ByteData": null,
99
+            "FilePath": ""
100
+          };
101
+          resolve(fileReq);
102
+        };
103
+        // Make sure to handle error states
104
+        reader.onerror = function (e) {
105
+          reject(e);
106
+        };
107
+      });
108
+      filePromise.push(currFilePromise)
109
+    }
110
+  
111
+    return Promise.all(filePromise);
112
+}
113
+
114
+
115
+function containsSpecialCharsHelper(str) {
116
+    const specialChars = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
117
+    return specialChars.test(str);
118
+}
119
+const isUpperCaseHelper = (string) => /^(?=.*[A-Z])/.test(string);
120
+const isLowerCaseHelper = (string) => /^(?=.*[a-z])/.test(string);
121
+const isNumberContainsHelper = (string) => /\d/.test(string);
122
+
123
+function swapSectionsVideo(){
124
+    function swapSections() {
125
+        var sectionOne = document.querySelector('.section-one');
126
+        var sectionTwo = document.querySelector('.section-two');
127
+
128
+        let nextSibling = sectionOne.nextSibling;
129
+        var isMobile = window.matchMedia("(max-width: 768px)").matches;
130
+        if(!isMobile) return;
131
+
132
+        if(nextSibling){
133
+            sectionOne.insertAdjacentElement("beforeBegin",sectionTwo)
134
+        }else{
135
+            sectionOne.parentNode.insertBefore(sectionOne, sectionTwo);
136
+        }
137
+    
138
+       // sectionOne.parentNode.insertBefore(sectionOne, sectionTwo);
139
+    }
140
+    swapSections();
141
+    
142
+    // Call the swapSections function on load and resize
143
+    // window.addEventListener('load', swapSections);
144
+    window.addEventListener('resize', swapSections);
145
+    
146
+    setTimeout(function (){
147
+        document.querySelector('auth-loader').hide();   
148
+        $('.loading-main').removeClass('d-none');
149
+    },1000);
150
+}

+ 4
- 0
dist/js/validate.min.js
File diff suppressed because it is too large
View File


+ 6
- 0
dist/js/vendor/bootstrap.bundle.min.js
File diff suppressed because it is too large
View File


+ 6
- 0
dist/js/vendor/bootstrap.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
dist/js/vendor/jquery-migrate-v3.3.2.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
dist/js/vendor/jquery-v3.6.0.min.js
File diff suppressed because it is too large
View File


+ 3
- 0
dist/js/vendor/modernizr-3.11.7.min.js
File diff suppressed because it is too large
View File


+ 6
- 0
dist/js/vendor/popper.js
File diff suppressed because it is too large
View File


+ 34
- 0
dist/js/vendor/vendor.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/js/vendor/vendor.min.js
File diff suppressed because it is too large
View File


+ 187
- 0
dist/js/warranty.js View File

@@ -0,0 +1,187 @@
1
+function wattantyFunction() {
2
+  setLengthCart();
3
+  let order_card = `<div class=warranty_product><div class="py-3 warranty_productform"><div class=mb-3><label class=form-label for=Add_serial_number_inp>Enter Your Serial Number</label><input class=form-control id=Add_serial_number_inp  required><label class="form-label text-danger d-none error_serial_num" for=Add_serial_number_inp >Serial Number should not be empty</label></div><div class=mb-3><label class="form-label d-none Add_phonenumber_inp_label" for=Add_phonenumber_inp>Enter Your Phone Number</label> <input type="number" inputmode="tel" class="form-control d-none" pattern="[1-9]{1}[0-9]{9}^[0-9]*$" onKeyPress="if(this.value.length==10) return false;"maxlength="10"  id=Add_phonenumber_inp  required><label class="text-danger d-none form-label error_phonenumber" for=Add_phonenumber_inp>Enter Valid Phone Number</label></div><div class=mb-3><label class="form-label d-none Add_Contact_inp_label" for=Add_contactname_inp>Enter Your Contactname</label> <input class="form-control d-none" id=Add_contactname_inp required></div><div class="serial_submit text-end"><button class="btn btn-dark warranty_serialNumber_check" type="button">Submit</button><button class="btn btn-dark warranty_serialNumber_submit d-none" type="button">Submit</button></div></div></div>`;
4
+  $(".user_orders").append(order_card);
5
+  $(".add_serialNum").click(function () {
6
+    $(".warranty_productform").removeClass("d-none");
7
+    $(this).addClass("d-none");
8
+  });
9
+  $(".warranty_serialNumber_submit").click(async function () {
10
+    debugger 
11
+    let serial_no_inp = $("#Add_serial_number_inp").val();
12
+    let phonenumber_inp = $("#Add_phonenumber_inp").val();
13
+    let contactname_inp = $("#Add_contactname_inp").val();
14
+    if (serial_no_inp && phonenumber_inp != "") {
15
+      $(".error_serial_num").addClass("d-none");
16
+      $(".error_phonenumber").addClass("d-none");
17
+      $("#Add_serial_number_inp").removeClass("border-danger");
18
+      $("#Add_phonenumber_inp").removeClass("border-danger");
19
+      let port = SERVERNAME;
20
+      debugger;
21
+      let url = `${port}/apis/v4/Bizgaze/integrations/products/warrantyservice/serialno/${serial_no_inp}`;
22
+      console.log(url);
23
+      //const STAT = `05b2f2ca510344968c65e1ebf49a5595`;
24
+      const config = {
25
+        url,
26
+        method: "get",
27
+        headers: {
28
+          Authorization: `stat ${STAT}`,
29
+        },
30
+      };
31
+      let response = await axios(config);
32
+      debugger;
33
+      console.log(response);
34
+      let product_res = response.data.result;
35
+      debugger;
36
+      if (product_res != null) {
37
+        let warrenty_res = JSON.parse(product_res);
38
+        let new_arr = [warrenty_res];
39
+        $.each(new_arr, function (key, value) {
40
+          console.log(value);
41
+          if (response.data.result == "[]") {
42
+            $(".user_Warranty_details").html(
43
+              `<div class="text-danger d-flex align-items-center bg-dangerLite text-dark p-2 rounded-4 mb-3" style="background-color: #ffe2e0!important;display:block"><div class="mr-1 d-flex justify-content-center align-items-center" style="width: 30px; height: 10px;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.2646 3.41366C11.7212 3.15681 12.2788 3.15681 12.7354 3.41366L19.2354 7.06991C19.7077 7.33558 20 7.83536 20 8.37727V15.6227C20 16.1646 19.7077 16.6644 19.2354 16.9301L12.7354 20.5863C12.2788 20.8432 11.7212 20.8432 11.2646 20.5863L4.76461 16.9301C4.29229 16.6644 4 16.1646 4 15.6227V8.37727C4 7.83536 4.29229 7.33559 4.76461 7.06991L11.2646 3.41366Z" fill="#FF3A2E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 7.4C11 7.17909 11.1791 7 11.4 7H12.6C12.8209 7 13 7.17909 13 7.4V12.6C13 12.8209 12.8209 13 12.6 13H11.4C11.1791 13 11 12.8209 11 12.6V7.4Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16Z" fill="white"></path></svg></div><div class="d-flex justify-content-center align-items-center  font-12">Serial Number Not Found</div></div>`
44
+            );
45
+            setTimeout(function () {
46
+              $(".bg-dangerLite").hide();
47
+            }, 1000);
48
+            return;
49
+          } else {
50
+            const warrantyEnabled = value[0].warrantyenabled;
51
+            $(".warranty_status_main_container").addClass("d-none");
52
+            if (warrantyEnabled == false) {
53
+              let phonenumber_updated = Number(phonenumber_inp);
54
+              $(".user_Warranty_details").removeClass("d-none");
55
+              let Warrentypayload = {
56
+                sku: value[0].sku,
57
+                serialno: serial_no_inp,
58
+                phonenumber: phonenumber_updated,
59
+                contactname: contactname_inp,
60
+                warrantyfromdate: value[0].purchasedate,
61
+              };
62
+              warrentyService(Warrentypayload);
63
+            } else {
64
+             alert('warranty enabled')
65
+            }
66
+          }
67
+        });
68
+      }
69
+    } else {
70
+      if (serial_no_inp == "") {
71
+        $("#Add_serial_number_inp").addClass("border-danger");
72
+        $(".error_serial_num").removeClass("d-none");
73
+      } else if (phonenumber_inp == "") {
74
+        $("#Add_phonenumber_inp").addClass("border-danger");
75
+        $(".error_phonenumber").removeClass("d-none");
76
+      }
77
+    }
78
+  });
79
+  $(".warranty_serialNumber_check").click(async function () {
80
+    let serial_no_inp = $("#Add_serial_number_inp").val();
81
+    if (serial_no_inp != "") {
82
+      $(".error_serial_num").addClass("d-none");
83
+      $("#Add_serial_number_inp").removeClass("border-danger");
84
+      let port = SERVERNAME;
85
+      debugger;
86
+      let url = `${port}/apis/v4/Bizgaze/integrations/products/warrantyservice/serialno/${serial_no_inp}`;
87
+      console.log(url);
88
+      // const STAT = `05b2f2ca510344968c65e1ebf49a5595`;
89
+      const config = {
90
+        url,
91
+        method: "get",
92
+        headers: {
93
+          Authorization: `stat ${STAT}`,
94
+        },
95
+      };
96
+
97
+      let response = await axios(config);
98
+      debugger;
99
+      console.log(response);
100
+      let product_res = response.data.result;
101
+      debugger;
102
+      let warrenty_res = JSON.parse(product_res);
103
+      if (product_res != null) {
104
+        if (response.data.result == "[]") {
105
+          $(".bg-dangerLite").removeClass("d-none");
106
+          $(".user_Warranty_details").html(
107
+            `<div class="text-danger d-flex align-items-center bg-dangerLite text-dark p-2 rounded-4 mb-3" style="background-color: #ffe2e0!important;display:block"><div class="mr-1 d-flex justify-content-center align-items-center" style="width: 30px; height: 10px;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.2646 3.41366C11.7212 3.15681 12.2788 3.15681 12.7354 3.41366L19.2354 7.06991C19.7077 7.33558 20 7.83536 20 8.37727V15.6227C20 16.1646 19.7077 16.6644 19.2354 16.9301L12.7354 20.5863C12.2788 20.8432 11.7212 20.8432 11.2646 20.5863L4.76461 16.9301C4.29229 16.6644 4 16.1646 4 15.6227V8.37727C4 7.83536 4.29229 7.33559 4.76461 7.06991L11.2646 3.41366Z" fill="#FF3A2E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 7.4C11 7.17909 11.1791 7 11.4 7H12.6C12.8209 7 13 7.17909 13 7.4V12.6C13 12.8209 12.8209 13 12.6 13H11.4C11.1791 13 11 12.8209 11 12.6V7.4Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16Z" fill="white"></path></svg></div><div class="d-flex justify-content-center align-items-center  font-12">Serial Number Not Found</div></div>`
108
+          );
109
+          // );
110
+          setTimeout(function () {
111
+            $(".bg-dangerLite").hide();
112
+          }, 1000);
113
+          return;
114
+        }
115
+         else {
116
+          if (warrenty_res[0].warrantyenabled == true) {
117
+            
118
+            $(".backtoform").removeClass("d-none");
119
+            let new_arr = [warrenty_res];
120
+            $.each(new_arr, function (key, value) {
121
+              console.log(value);
122
+            let warrenty_date = value[0].warrantytodate;
123
+            let userwarrenty_product = `<div class="p-3 bg-white my-3 rounded warranty-card"id=warranty-card><div class="mb-3 card rounded-3 text-white"><div class="row align-items-center g-0 justify-content-between"><div class="col-md-3 text-center"><img alt=guarantee src=../dist/assets/imgs/guarantee.png class="h-50p img-fluid w-50p"></div><div class=col-md-9><div class=card-body><h5 class=card-title>Congratulations,</h5><p class=card-text><small>Thanks for registering with <span class=fw-bold>anwi systems </span>.You have successfully availed your warranty.</small></div></div></div></div><div class=col-md-12><h4>Here is your warranty Details</h4></div><div class="p-3 border rounded-3"><div class=row><div class=col-6><img alt=Warranty-product src="../dist/assets/imgs/anwi-logo-1.png" class="w-50"></div><div class=col-6><p class="mb-0 text-secondary"><small>Serail No</small><p class="mb-0 fs-9 serial_no_warrantynumber"><p class="fw-500">${value[0].serialno}</p><p class="mb-0 text-secondary"><small>Warranty will be applicable till</small><p class="mb-0 fs-9 rounded-2 warrenty_date"><small class="fw-500">${value[0].warrantytodate}</small></div></div><h6>Order details</h6><div class="row mb-3"><div class=col-6><p class="mb-0 text-secondary"><small>Sku</small><p class="mb-0 fs-9 rounded-2 warranty_sku"><small class="fw-500">${value[0].sku}</small></div><div class=col-6><p class="mb-0 text-secondary"><small>Itemname</small><p class="mb-0 fs-9 rounded-2 warranty_item_name"><small class="fw-500">${value[0].itemname}</small></div></div><h6>Warranty details</h6><div class=row><div class=col-6><p class="mb-0 text-secondary"><small>Warranty Start</small><p class="mb-0 fs-9  rounded-2"><small class="purchase_date fw-500" >${value[0].warrantyfromdate}</small></div><div class=col-6><p class="mb-0 text-secondary"><small>Warranty status</small><p class="mb-0 fs-9 text-secondary rounded-2"><small class="text-white bg-success is_warranty_enable p-1 rounded-pill">{value[0].warrantyenabled}</small></div></div></div><div class=guide-lines><p class=mb-0><small>Follow Below steps to request your warranty claim.</small><ol><small class=text-secondary><li class=text-secondary>Go to My account</small><small class=text-secondary><li class=text-secondary>Tap on request claim</small><small class=text-secondary><li class=text-secondary>Enter information and send claim request</small></ol></div></div>`;
124
+            let is_warranty_enable = value[0].warrantyenabled;
125
+            debugger;
126
+            $(".user_Warranty_details").html(userwarrenty_product);
127
+            $(".warranty_status_main_container").addClass("d-none");
128
+            if (is_warranty_enable == true) {
129
+              $(".is_warranty_enable").text("Activated");
130
+            } else {
131
+              $(".is_warranty_enable").text("Not Activated");
132
+            }
133
+            if (warrenty_date == "") {
134
+              $(".warrenty_date").addClass("d-none");
135
+            } else {
136
+              $(".warrenty_date").removeClass("d-none");
137
+            }
138
+            $("#Add_serial_number_inp").addClass("border-success");
139
+            $(".error_serial_num").addClass("d-none");
140
+            $(".add_serialNum").removeClass("d-none");
141
+            return
142
+          });
143
+          }
144
+           else {
145
+            $(".bg-dangerLite").addClass("d-none");
146
+            $(".Add_phonenumber_inp_label").removeClass("d-none");
147
+            $("#Add_phonenumber_inp").removeClass("d-none");
148
+            $(".Add_Contact_inp_label").removeClass("d-none");
149
+            $("#Add_contactname_inp").removeClass("d-none");
150
+            $(".warranty_serialNumber_submit").removeClass("d-none");
151
+            $(this).addClass("d-none");
152
+            $(".Serial_numb_notfound").addClass("d-none");
153
+          }
154
+         
155
+        }
156
+      }
157
+    } else {
158
+      if (serial_no_inp == "") {
159
+        $("#Add_serial_number_inp").addClass("border-danger");
160
+        $(".error_serial_num").removeClass("d-none");
161
+      }
162
+    }
163
+  });
164
+
165
+  async function warrentyService(Warrentypayload) {
166
+    const res = await postAPIServiceWarranty(
167
+      `apis/v4/bizgaze/transact/items/savewarrantyasync`,
168
+      Warrentypayload
169
+    );
170
+    console.log(res);
171
+    if (res.data.status == 2) {
172
+      $(".warranty_status_main_container").removeClass("d-none");
173
+      $(".bg-dangerLite").removeClass("d-none");
174
+      $(".user_Warranty_details").html(
175
+        `<div class="text-danger d-flex align-items-center bg-dangerLite text-dark p-2 rounded-4 mb-3" style="background-color: #ffe2e0!important;display:block"><div class="mr-1 d-flex justify-content-center align-items-center" style="width: 30px; height: 10px;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.2646 3.41366C11.7212 3.15681 12.2788 3.15681 12.7354 3.41366L19.2354 7.06991C19.7077 7.33558 20 7.83536 20 8.37727V15.6227C20 16.1646 19.7077 16.6644 19.2354 16.9301L12.7354 20.5863C12.2788 20.8432 11.7212 20.8432 11.2646 20.5863L4.76461 16.9301C4.29229 16.6644 4 16.1646 4 15.6227V8.37727C4 7.83536 4.29229 7.33559 4.76461 7.06991L11.2646 3.41366Z" fill="#FF3A2E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 7.4C11 7.17909 11.1791 7 11.4 7H12.6C12.8209 7 13 7.17909 13 7.4V12.6C13 12.8209 12.8209 13 12.6 13H11.4C11.1791 13 11 12.8209 11 12.6V7.4Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16Z" fill="white"></path></svg></div><div class="d-flex justify-content-center align-items-center  font-12">No Serial number found / Product not Delivered</div></div>`
176
+      );
177
+      setTimeout(function () {
178
+        $(".bg-dangerLite").hide();
179
+      }, 1000);
180
+    } else if (res.data.status == "0") {
181
+      $(".user_Warranty_details").html(
182
+        `<div class="text-danger d-flex align-items-center bg-dangerLite text-dark p-2 rounded-4 mb-3" style="background-color:#fff!important;display:block"><div class="mr-1 d-flex justify-content-center align-items-center" style="width: 30px; height: 10px;"><svg xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 48 48" width="48px" height="48px" baseProfile="basic"><circle cx="24" cy="24" r="20" fill="#6be3a2"/><path fill="#324561" d="M22.5,33c-0.226,0-0.446-0.076-0.625-0.219l-7.5-6c-0.431-0.345-0.501-0.974-0.156-1.405	c0.347-0.431,0.975-0.501,1.406-0.156l6.667,5.334l9.889-14.126c0.316-0.454,0.94-0.562,1.393-0.246	c0.453,0.317,0.562,0.94,0.246,1.393l-10.5,15c-0.158,0.227-0.403,0.377-0.677,0.417C22.595,32.997,22.547,33,22.5,33z"/></svg></div><div class="d-flex justify-content-center align-items-center font-12">${res.data.message}</div></div>`
183
+      );
184
+    }
185
+  }
186
+}
187
+wattantyFunction();

Loading…
Cancel
Save