ananthvijay 2 lat temu
rodzic
commit
c014fd0b61

+ 130
- 0
dist/Js/components/authloader/authloader.js Wyświetl plik

@@ -0,0 +1,130 @@
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:10px solid #ebebeb;
23
+    border-bottom-color:#26B8BF;
24
+    width: 100px;
25
+    height: 100px;
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
+
104
+<div class="authloaderanwi">
105
+<div class='loader' id='lrd1'></div>
106
+</div>
107
+
108
+  </div>
109
+`
110
+
111
+class AuthLoader extends HTMLElement {
112
+    constructor() {
113
+      super();
114
+      this._shadowRoot = this.attachShadow({ 'mode': 'open' });
115
+      this._shadowRoot.appendChild(template.content.cloneNode(true));
116
+    }
117
+    
118
+
119
+    show(){
120
+        // $('.overlayanwiAuth').css('display','block');
121
+        this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "block";
122
+    }
123
+
124
+    hide(){
125
+        // $('.overlayanwiAuth').addClass('display','none');
126
+        this._shadowRoot.querySelector('.overlayanwiAuth').style.display = "none";
127
+    }
128
+}
129
+
130
+window.customElements.define('auth-loader', AuthLoader);

+ 7
- 0
dist/Js/myaccount/Myaccount.js Wyświetl plik

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

+ 158
- 0
dist/Js/myaccount/myaccount_warrenty.js Wyświetl plik

@@ -0,0 +1,158 @@
1
+function wattantyFunction(){
2
+
3
+debugger
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 = "https://anwi.bizgaze.app";
21
+    debugger
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
+    debugger
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
+                       debugger
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
+    debugger
121
+    const res = await postAPIServiceWarranty(`apis/v4/bizgaze/transact/items/savewarrantyasync`, Warrentypayload);
122
+    debugger
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
+}

+ 78
- 0
dist/Js/myaccount/orderdetails.js Wyświetl plik

@@ -0,0 +1,78 @@
1
+async function bindOrderDetails() {
2
+  debugger
3
+// validatesession()
4
+  const res = await getAPIServiceLocal(
5
+    "apis/v4/Bizgaze/integrations/products/salesorderdetailsbyphonenumber"
6
+  );
7
+  debugger;
8
+  console.log(res);
9
+  const orderDetailsres = JSON.parse(res.data.result);
10
+  console.log(orderDetailsres);
11
+  let new_arrr = orderDetailsres;
12
+  console.log(new_arrr);
13
+  $(".user_order_details").html(``)
14
+  console.log('hello')
15
+//   $.each(new_arrr, function (key, value) {
16
+//     console.log("a", value);
17
+   
18
+//     $(".user_order_details").append(user_order_details);
19
+//   });
20
+  let user_order_details =``;
21
+  let order_itemTotal = '';
22
+  let order_netTotal = '' ;
23
+  let order_quantity = '' ;
24
+  let order_taxAmount = '' ;
25
+  for(let i=0;i<new_arrr.length;i++){
26
+    let current=new_arrr[i]
27
+   let updatedCurent_total= current.nettotal.toLocaleString()
28
+   order_itemTotal = current.itemtotal;
29
+   order_netTotal = current.nettotal; 
30
+   order_quantity =current.Quantity;
31
+   order_taxAmount =current.taxamount;
32
+  user_order_details+= `<div class=" border-3 mb-3"> <a href="#" class="text-dark order_details_main_container"><div class="d-none hi"><span class="order_itemTotal">${order_itemTotal}</span><span class="order_netTotal">${order_netTotal}</span><span class="order_tax">${order_taxAmount}</span> <span class="order_qty">${order_quantity}</span></div> <div class="bg-gray-4 p-2 row g-0"> <div class="col-md-6 "> <div class="d-flex justify-content-between align-items-center"> <div> <p class="mb-1">ORDER PLACED</p><p class="mb-1 order_date">${current.OrderDate}</p></div><div> <p class="mb-1"> TOTAL</p><p class="mb-1 Current_netTotal"> ₹${updatedCurent_total}</p></div><div> <p class="mb-1">Delivered TO </p><p class="mb-1">${current.OrganizationName}</p></div></div></div><div class="col-md-4 ms-auto"> <div> <p class="mb-1 text-end">ORDER NO: <span class="text-secondary fs-9 serial_no">${current.OrderNo}</span> </p></div><div class="d-flex justify-content-between"> <p class="mb-1 text-info"> View order details </p><p class="mb-0 text-info">Invoice</p></div></div></div><div class="border-0 card rounded-0 order-cards py-2"> <div class="row align-items-center"> <div class="col-md-3"> <img src="${current.imageurl}" class="img-fluid w-75"/> </div><div class="col-md-9"> <div class="row align-items-center"> <div class="col-md-8"> <div class="order_item_name">${current.itemname}</div></div><div class="col-md-4"> <button type="button" class="btn btn-sm btn-warning rounded order_details_btn py-0 mb-3" onClick="event.preventDefault();">Track Package</button> <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> </div></div></div></div></div></div>`;
33
+}
34
+  $(".user_order_details").append(user_order_details);
35
+  // $('.order_details_main_container').click(function(){
36
+  //   window.localStorage.setItem("orderNumber", current.OrderNo);
37
+  //   window.localStorage.setItem("orderDate", current.OrderNo);
38
+  // });
39
+  $('.order_details_main_container').click(function(){
40
+    let current_order_date= $(this).find('.order_date').text();
41
+    let current_serial_no= $(this).find('.serial_no').text();
42
+    let current_item_name= $(this).find('.order_item_name').text();
43
+    let current_order_itemTotal =$(this).find('.order_itemTotal').text();
44
+    let current_order_netTotal =$(this).find('.order_netTotal').text();
45
+    let current_order_tax =$(this).find('.order_tax').text();
46
+    let current_order_qty =$(this).find('.order_qty').text();
47
+
48
+    window.localStorage.setItem('orderDate',current_order_date);
49
+     window.localStorage.setItem('orderSerialno',current_serial_no);
50
+     window.localStorage.setItem('orderItemname',current_item_name);
51
+     window.localStorage.setItem('orderitemTotal',current_order_itemTotal);
52
+     window.localStorage.setItem('netTotal',current_order_netTotal)
53
+     window.localStorage.setItem('Qty',current_order_qty)
54
+     window.localStorage.setItem('tax',current_order_tax)
55
+     debugger;
56
+    //  console.log(get_local_orderDate,get_local_orderSerialno)
57
+     $(this).attr('href','./orderdetails.html')
58
+ })
59
+}
60
+function toasterOpts(){
61
+  toastr.options = {
62
+    "closeButton": true,
63
+    "debug": false,
64
+    "newestOnTop": true,
65
+    "progressBar": true,
66
+    "positionClass": "toast-top-center",
67
+    "preventDuplicates": true,
68
+    "onclick": null,
69
+    "showDuration": "300",
70
+    "hideDuration": "1000",
71
+    "timeOut": "5000",
72
+    "extendedTimeOut": "1000",
73
+    "showEasing": "swing",
74
+    "hideEasing": "linear",
75
+    "showMethod": "fadeIn",
76
+    "hideMethod": "fadeOut"
77
+  }
78
+}

+ 26
- 0
dist/Js/orderDetails/order_summary.js Wyświetl plik

@@ -0,0 +1,26 @@
1
+let current_orderDate =window.localStorage.getItem('orderDate')
2
+let current_orderSerialDate =window.localStorage.getItem('orderSerialno')
3
+let order_itemname =window.localStorage.getItem('orderItemname');
4
+let order_itemtotal =window.localStorage.getItem('orderitemTotal');
5
+let order_nettotal =window.localStorage.getItem('netTotal');
6
+let order_qty = window.localStorage.getItem('Qty')
7
+let order_tax = window.localStorage.getItem('tax')
8
+let Local_keys_update =['tax','Qty','netTotal','orderitemTotal']
9
+let summary =` <div class="card-body">
10
+<div>
11
+    <p class="mb-0 fs-6 fw-500">Order<span>${current_orderSerialDate}</span></span><span class="text-secondary fs-9"> (${order_qty} items)</p>
12
+    <p class="mb-0 fs-6">Order placed on ${current_orderDate}</p>
13
+    <p class="mb-0 fs-9">Paid by Credit Card</p>
14
+</div>`;
15
+$('.order_price').html(order_itemtotal)
16
+$('.order_tax').html(order_tax)
17
+$('.Order_total').html(order_nettotal)
18
+$('.order_itemname').html(order_itemname)
19
+$('.order-summary').html(summary);
20
+$('.back_to_orders').click(function(){
21
+    debugger
22
+    for (key of Local_keys_update) {
23
+    window.localStorage.removeItem(key);
24
+    }
25
+    $(this).attr('href','./myaccount.html')
26
+})

+ 207
- 0
dist/Js/warranty.js Wyświetl plik

@@ -0,0 +1,207 @@
1
+function wattantyFunction() {
2
+  debugger;
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 class="form-control d-none "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
+
5
+  $(".user_orders").append(order_card);
6
+  $(".add_serialNum").click(function () {
7
+    $(".warranty_productform").removeClass("d-none");
8
+    $(this).addClass("d-none");
9
+  });
10
+  $(".warranty_serialNumber_submit").click(async function () {
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 = "https://anwi.bizgaze.app";
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
+      if (product_res != null) {
36
+        let warrenty_res = JSON.parse(product_res);
37
+        let new_arr = [warrenty_res];
38
+        $.each(new_arr, function (key, value) {
39
+          console.log(value);
40
+          if (response.data.result == "[]") {
41
+            // Command: toastr["error"]("Serial number not found !")
42
+            // toasterOpts();
43
+            // $('#Add_serial_number_inp').addClass('border-danger');
44
+            // $('.error_serial_num').removeClass('d-none')
45
+            $(".user_Warranty_details").html(
46
+              `<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>`
47
+            );
48
+            setTimeout(function(){
49
+              $('.bg-dangerLite').hide()
50
+            }, 1000)
51
+            // $('.warranty_productform').addClass('d-none');
52
+            // $('.add_serialNum').removeClass('d-none');
53
+            return;
54
+          } else {
55
+           const warrantyEnabled = value[0].warrantyenabled;
56
+           $('.warranty_status_main_container').addClass('d-none')
57
+           if (warrantyEnabled == false) {
58
+             let phonenumber_updated = Number(phonenumber_inp);
59
+             $(".user_Warranty_details").removeClass("d-none");
60
+             //  let  strDate =  new Date(value[0].purchasedate).toISOString().slice(0, 10);
61
+             let Warrentypayload = {
62
+               sku: value[0].sku,
63
+               serialno: serial_no_inp,
64
+               phonenumber: phonenumber_updated,
65
+               contactname: contactname_inp,
66
+               warrantyfromdate: value[0].purchasedate,
67
+             };
68
+             warrentyService(Warrentypayload);
69
+           } else {
70
+            $('.backtoform').removeClass('d-none')
71
+             // let warrantySerialnumber =$('.serial_no_warrantynumber').text()
72
+             let warrenty_date = value[0].warrantytodate;
73
+             // 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>`;
74
+             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>${value[0].contactname} 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><small>Serail No</small><p class="mb-0 fs-9 text-secondary serial_no_warrantynumber"><small>${value[0].serialno}</small><p class=mb-0><small>warranty will be applicable till</small><p class="mb-0 fs-9 text-secondary rounded-2 warrenty_date"><small>${value[0].warrantytodate}</small></div></div><h6>Order details</h6><div class="row mb-3"><div class=col-6><p class=mb-0><small>Sku</small><p class="mb-0 fs-9 text-secondary rounded-2 warranty_sku"><small>${value[0].sku}</small></div><div class=col-6><p class=mb-0><small>Itemname</small><p class="mb-0 fs-9 text-secondary rounded-2 warranty_item_name"><small>${value[0].itemname}</small></div></div><h6>Warranty details</h6><div class=row><div class=col-6><p class=mb-0><small>Warranty Start</small><p class="mb-0 fs-9 text-secondary rounded-2"><small class=purchase_date>${value[0].warrantyfromdate}</small></div><div class=col-6><p class=mb-0><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>`;
75
+             let is_warranty_enable = value[0].warrantyenabled;
76
+             debugger;
77
+             $(".user_Warranty_details").html(userwarrenty_product);
78
+             if (is_warranty_enable == true) {
79
+               $(".is_warranty_enable").text("Activated");
80
+             } else {
81
+               $(".is_warranty_enable").text("Not Activated");
82
+             }
83
+             if (warrenty_date == "") {
84
+               $(".warrenty_date").addClass("d-none");
85
+             } else {
86
+               $(".warrenty_date").removeClass("d-none");
87
+             }
88
+             $("#Add_serial_number_inp").addClass("border-success");
89
+             $(".error_serial_num").addClass("d-none");
90
+             $(".add_serialNum").removeClass("d-none");
91
+           }
92
+          }
93
+        });
94
+      }
95
+    } else {
96
+      if (serial_no_inp == "") {
97
+        $("#Add_serial_number_inp").addClass("border-danger");
98
+        $(".error_serial_num").removeClass("d-none");
99
+      } else if (phonenumber_inp == "") {
100
+        $("#Add_phonenumber_inp").addClass("border-danger");
101
+        $(".error_phonenumber").removeClass("d-none");
102
+      }
103
+    }
104
+  });
105
+  $('.warranty_serialNumber_check').click(async function(){
106
+    let serial_no_inp = $("#Add_serial_number_inp").val();
107
+    if (serial_no_inp != "") {
108
+      $(".error_serial_num").addClass("d-none");
109
+      $("#Add_serial_number_inp").removeClass("border-danger");
110
+      let port = "https://anwi.bizgaze.app";
111
+      debugger;
112
+      let url = `${port}/apis/v4/Bizgaze/integrations/products/warrantyservice/serialno/${serial_no_inp}`;
113
+      console.log(url);
114
+      const STAT = `05b2f2ca510344968c65e1ebf49a5595`;
115
+      const config = {
116
+        url,
117
+        method: "get",
118
+        headers: {
119
+          Authorization: `stat ${STAT}`,
120
+        },
121
+      };
122
+
123
+      let response = await axios(config);
124
+      debugger;
125
+      console.log(response);
126
+      let product_res = response.data.result;
127
+      if (product_res != null) {
128
+          if (response.data.result == "[]") {
129
+            $('.bg-dangerLite').removeClass('d-none')
130
+            $(".user_Warranty_details").html(
131
+              `<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>`
132
+              );
133
+              
134
+            // );
135
+            setTimeout(function(){
136
+              $('.bg-dangerLite').hide()
137
+            }, 1000)
138
+            return;
139
+          }
140
+    else{
141
+      $('.bg-dangerLite').addClass('d-none')
142
+        $(".Add_phonenumber_inp_label").removeClass('d-none')
143
+        $("#Add_phonenumber_inp").removeClass('d-none')
144
+        $(".Add_Contact_inp_label").removeClass('d-none')
145
+        $("#Add_contactname_inp").removeClass('d-none')
146
+        $(".warranty_serialNumber_submit").removeClass('d-none')
147
+        $(this).addClass('d-none')
148
+        $(".Serial_numb_notfound").addClass('d-none')
149
+    }
150
+      }
151
+    } else {
152
+      if (serial_no_inp == "") {
153
+        $("#Add_serial_number_inp").addClass("border-danger");
154
+        $(".error_serial_num").removeClass("d-none");
155
+      }
156
+    }
157
+  })
158
+
159
+  async function warrentyService(Warrentypayload) {
160
+    //       let d = new Date();
161
+    //     // let  strDate = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
162
+    //     let  strDate =  new Date().toISOString().slice(0, 10)
163
+    // console.log(strDate)
164
+    debugger;
165
+    const res = await postAPIServiceWarranty(
166
+      `apis/v4/bizgaze/transact/items/savewarrantyasync`,
167
+      Warrentypayload
168
+    );
169
+    debugger;
170
+    console.log(res);
171
+    if (res.data.status == 2) {
172
+      //   $('.warranty_productform').addClass('d-none');
173
+      //   $('.add_serialNum').removeClass('d-none');
174
+      // Command: toastr["warning"](res.data.message)
175
+      // toasterOpts();
176
+      $('.warranty_status_main_container').removeClass('d-none')
177
+      $('.bg-dangerLite').removeClass('d-none');
178
+      $(".user_Warranty_details").html(
179
+       `<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>`
180
+      );
181
+      setTimeout(function(){
182
+        $('.bg-dangerLite').hide()
183
+      }, 1000)
184
+    } else if (res.data.status == "0") {
185
+      $(".user_Warranty_details").html(`<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>`);
186
+    }
187
+  }
188
+  // function toasterOpts() {
189
+  //     toastr.options = {
190
+  //         "closeButton": true,
191
+  //         "debug": false,
192
+  //         "newestOnTop": true,
193
+  //         "progressBar": true,
194
+  //         "positionClass": "toast-top-center",
195
+  //         "preventDuplicates": true,
196
+  //         "showDuration": "300",
197
+  //         "hideDuration": "1000",
198
+  //         "timeOut": "3000",
199
+  //         "extendedTimeOut": "1000",
200
+  //         "showEasing": "swing",
201
+  //         "hideEasing": "linear",
202
+  //         "showMethod": "fadeIn",
203
+  //         "hideMethod": "fadeOut"
204
+  //     }
205
+  // }
206
+}
207
+wattantyFunction();

BIN
dist/assets/imgs/checked.png Wyświetl plik


BIN
dist/assets/imgs/guarantee.png Wyświetl plik


BIN
dist/assets/imgs/remove.png Wyświetl plik


+ 135
- 0
w/index.html Wyświetl plik

@@ -0,0 +1,135 @@
1
+
2
+<!DOCTYPE html>
3
+<html lang="en">
4
+
5
+<head>
6
+    <meta charset="UTF-8" />
7
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
9
+    <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.min.css" />
10
+    <link rel="stylesheet" href="../dist/css/main.css" />
11
+    <link rel="stylesheet" href="../style.css">
12
+    <link rel="stylesheet" href="../libs/owlcarousel/Css/owl.carousel.min.css">
13
+    <link rel="stylesheet" href="../libs/owlcarousel/Css/owl.theme.default.min.css">
14
+    <link rel="stylesheet" href="../dist/css/vendor/bootstrap.min.css">
15
+    <link rel="stylesheet" href="../dist/css/vendor/bootstrap.min.css">
16
+    <link rel="stylesheet" href="../dist/css/vendor/vandella.css">
17
+    <link rel="stylesheet" href="../dist/css/vendor/jellybelly.css">
18
+    <link rel="stylesheet" href="../dist/css/vendor/fontello.css">
19
+    <link rel="stylesheet" href="../dist/css/plugins/easyzoom.css">
20
+    <link rel="stylesheet" href="../dist/css/plugins/slick.css">
21
+    <link rel="stylesheet" href="../dist/css/plugins/nice-select.css">
22
+    <link rel="stylesheet" href="../dist/css/plugins/animate.css">
23
+    <link rel="stylesheet" href="../dist/css/plugins/magnific-popup.css">
24
+    <link rel="stylesheet" href="../dist/css/plugins/jquery-ui.css">
25
+    <link rel="stylesheet" href="../dist/css/style.css">
26
+    <link rel="stylesheet" href="../dist/css/fontawesome.all.min.css">
27
+    <link rel="stylesheet" href="../dist/css/fontawesome.min.css">
28
+    <link rel="stylesheet" href="../libs/toaster/toastr.css">
29
+    <title>Anwi</title>
30
+</head>
31
+
32
+<body class="my_account_page bg-gradient-violet">
33
+    <!-- navbar -->
34
+    <div id="navbar-head" class="bg-white"></div>
35
+    <!-- end-navbar -->
36
+    <!-- main-body -->
37
+    <main class="main-body">
38
+        <!-- <section class="warrenty_section d-none">
39
+            <div class="my-account-wrapper py-md-5">
40
+                <div class="container py-md-5">
41
+                    <div class="row">
42
+                        <div class="col-md-7 section-title-8">
43
+                            <h2 class="bold text-white">Warranty Registration</h2>
44
+                        </div>
45
+                        <div class="col-md-5 section-title-8">
46
+                            <div class="pb-3">
47
+                                <h4 class="bold text-white">Register Your Batteries and HUPS !</h4>
48
+                                <h5 class="text-white">It's simple, useful and Paperless !</h5>
49
+                            </div>
50
+                            <div>
51
+                                <p class="fs-md-8 text-white">Register your Exide Battery/HUPS online and view your Battery/HUPS
52
+                                    warranty details anytime, anywhere!</p>
53
+                            </div>
54
+                        </div>
55
+                    </div>
56
+                </div>
57
+            </div>
58
+        </section> -->
59
+        <section class="pt-5">
60
+            <div class="my-account-wrapper">
61
+                <div class="container py-md-5">
62
+                    <div class="product-area pt-160 pb-115">
63
+                        <div class="container">
64
+                            <div class="product-tab-list-1 tab-list-1-left nav mt-100 mb-65 justify-content-center">
65
+                                <a class="d-none" href="#activate_warranty" data-bs-toggle="tab">
66
+                                    Activate Warranty</a>
67
+                                <a href="#Warranty_check" data-bs-toggle="tab" class="active">Warranty</a>
68
+                            </div>
69
+                            <div class="tab-content jump ">
70
+                                <div id="Warranty_check" class="tab-pane  active">
71
+                                    <h5 class="mb-md-4">Enter Your Details Below :</h5>
72
+                                    <div class="row shadow warranty_row rounded-4">
73
+                                        <div class="col-md-12">
74
+                                            <form>
75
+                                                <div class="backtoform m-4 d-none">
76
+                                                <a href="./index.html"><i class="fa-solid fa-arrow-left fa-2x" ></i>  </a></div>
77
+                                                <div class="row align-items-center justify-content-center m-3 warranty_status_main_container">
78
+                                                    <div class="col-md-6 pb-4">
79
+                                                        <div class="user_orders">
80
+                                                        </div>
81
+                                                    </div>
82
+                                                </div>
83
+                                                <div class="row align-items-center justify-content-center ">                                                <div class="col-md-6 pb-4">
84
+                                                    <div class="user_Warranty_details">
85
+                                                    </div>
86
+                                                </div>
87
+                                            </div>
88
+
89
+                                            </form>
90
+                                        </div>
91
+                                    </div>
92
+                                </div>
93
+                            </div>
94
+                        </div>
95
+                    </div>
96
+                </div>
97
+            </div>
98
+        </section>
99
+    </main>
100
+    <!-- footer -->
101
+    <div id="footer-head"></div>
102
+    <!-- end-footer -->
103
+    <!-- <script src="./libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="./libs/bootstrap/js/bootstrap.bundle.min.js"></script> -->
104
+    <script src="../dist/js/jquery.min.js"></script>
105
+    <script src="../dist/js/navbar.js"></script>
106
+    <script src="../dist/js/footer.js"></script>
107
+    <!-- <script src="./dist/Js/components/authloader/authloader.js"></script> -->
108
+    <!-- <script src="../dist/js/toaster/toastr.js"></script> -->
109
+    <script src="../dist/js/axios.min.js"></script>
110
+    <script src="../dist/js/auth/apiservice.js"></script>   
111
+    <script src="../libs/cookies.min.js"></script>
112
+    <!-- <script src="../dist/js/utils/CookieHelper.js"></script> -->
113
+    <script src="../dist/js/fontawesome.all.js"></script>
114
+    <script src="../dist/js/fontawesome.min.js"></script>
115
+    <script src="../dist/js/vendor/modernizr-3.11.7.min.js"></script>
116
+    <script src="../dist/js/vendor/jquery-v3.6.0.min.js"></script>
117
+    <script src="../dist/js/vendor/jquery-migrate-v3.3.2.min.js"></script>
118
+    <script src="../dist/js/vendor/bootstrap.min.js"></script>
119
+    <script src="../dist/js/plugins/slick.js"></script>
120
+    <script src="../dist/js/plugins/wow.js"></script>
121
+    <script src="../dist/js/plugins/svg-injector.min.js"></script>
122
+    <script src="../dist/js/plugins/jquery.nice-select.min.js"></script>
123
+    <script src="../dist/js/plugins/mouse-parallax.js"></script>
124
+    <script src="../dist/js/plugins/images-loaded.js"></script>
125
+    <script src="../dist/js/plugins/isotope.js"></script>
126
+    <script src="../dist/js/plugins/jquery-ui.js"></script>
127
+    <script src="../dist/js/plugins/magnific-popup.js"></script>
128
+    <!-- Main JS -->
129
+    <!-- <script src="../dist/js/localstorage/loginauthlocal.js"></script> -->
130
+    <script src="../dist/js/warranty.js"></script>
131
+    <!-- <script src="../dist/js/myaccount/Myaccount.js"></script> -->
132
+    <script src="../dist/js/main.js"></script>
133
+</body>
134
+
135
+</html>

Ładowanie…
Anuluj
Zapisz