From 810cfdb0964afee5ad08cf39b94d43460e462188 Mon Sep 17 00:00:00 2001 From: ananthvijay Date: Mon, 24 Apr 2023 11:10:08 +0530 Subject: [PATCH] changes in orderdetails and warranty and order summary pages --- dist/Js/myaccount/orderdetails.js | 31 +---- dist/Js/orderDetails/order_summary.js | 99 ++++++------- dist/Js/warranty.js | 191 ++++++++++++-------------- dist/css/main.css | 12 +- myaccount.html | 2 +- orderdetails.html | 90 +++++++----- 6 files changed, 197 insertions(+), 228 deletions(-) diff --git a/dist/Js/myaccount/orderdetails.js b/dist/Js/myaccount/orderdetails.js index 262c158..7ad8209 100644 --- a/dist/Js/myaccount/orderdetails.js +++ b/dist/Js/myaccount/orderdetails.js @@ -1,6 +1,5 @@ async function bindOrderDetails() { let user_number =$('.User_phoneum').text(); - debugger // validatesession() let port = "https://anwi.bizgaze.app"; // let port = "http://localhost:3088"; @@ -21,11 +20,6 @@ let port = "https://anwi.bizgaze.app"; console.log(new_arrr); $(".user_order_details").html(``) console.log('hello') -// $.each(new_arrr, function (key, value) { -// console.log("a", value); - -// $(".user_order_details").append(user_order_details); -// }); let user_order_details =``; let order_itemTotal = ''; let order_netTotal = '' ; @@ -38,33 +32,14 @@ let port = "https://anwi.bizgaze.app"; order_netTotal = current.nettotal; order_quantity =current.Quantity; order_taxAmount =current.taxamount; - user_order_details+= `
${order_itemTotal}${order_netTotal}${order_taxAmount} ${order_quantity}

ORDER PLACED

${current.OrderDate}

TOTAL

₹${updatedCurent_total}

Delivered TO

${current.OrganizationName}

ORDER NO: ${current.OrderNo}

View order details

Invoice

${current.itemname}
`; + user_order_details+= `
${order_itemTotal}${order_netTotal}${order_taxAmount} ${order_quantity}

ORDER PLACED

${current.OrderDate}

TOTAL

₹${updatedCurent_total}

Delivered TO

${current.OrganizationName}

ORDER NO: ${current.OrderNo}

View order details

Invoice

${current.itemname}
`; } $(".user_order_details").append(user_order_details); - // $('.order_details_main_container').click(function(){ - // window.localStorage.setItem("orderNumber", current.OrderNo); - // window.localStorage.setItem("orderDate", current.OrderNo); - // }); $('.order_details_main_container').click(function(){ - let current_order_date= $(this).find('.order_date').text(); let current_serial_no= $(this).find('.serial_no').text(); - let current_item_name= $(this).find('.order_item_name').text(); - let current_order_itemTotal =$(this).find('.order_itemTotal').text(); - let current_order_netTotal =$(this).find('.order_netTotal').text(); - let current_order_tax =$(this).find('.order_tax').text(); - let current_order_qty =$(this).find('.order_qty').text(); - let order_item_img= $('.order_item_name').attr('src'); - - window.localStorage.setItem('orderDate',current_order_date); + // window.localStorage.setItem('orderDate',current_order_date); window.localStorage.setItem('orderSerialno',current_serial_no); - window.localStorage.setItem('orderItemname',current_item_name); - window.localStorage.setItem('orderitemTotal',current_order_itemTotal); - window.localStorage.setItem('netTotal',current_order_netTotal) - window.localStorage.setItem('Qty',current_order_qty) - window.localStorage.setItem('tax',current_order_tax) - window.localStorage.setItem('imgsrc',order_item_img) - debugger; - // console.log(get_local_orderDate,get_local_orderSerialno) + window.localStorage.setItem('Userphonenumber',user_number); $(this).attr('href','./orderdetails.html') }) } diff --git a/dist/Js/orderDetails/order_summary.js b/dist/Js/orderDetails/order_summary.js index 9439d48..9f56a1f 100644 --- a/dist/Js/orderDetails/order_summary.js +++ b/dist/Js/orderDetails/order_summary.js @@ -1,62 +1,53 @@ -let current_orderDate =window.localStorage.getItem('orderDate') -let current_orderSerialDate =window.localStorage.getItem('orderSerialno') -let order_itemname =window.localStorage.getItem('orderItemname'); -let order_itemtotal =window.localStorage.getItem('orderitemTotal'); -let order_nettotal =window.localStorage.getItem('netTotal'); -let order_qty = window.localStorage.getItem('Qty') -let order_tax = window.localStorage.getItem('tax') -let order_img_src =window.localStorage.getItem('imgsrc') -let Local_keys_update =['tax','Qty','netTotal','orderitemTotal'] -let summary =`
-
-

Order${current_orderSerialDate} (${order_qty} items)

-

Order placed on ${current_orderDate}

-

Paid by Credit Card

-
`; +async function order_summary(){ +let current_orderSerialDate =window.localStorage.getItem('orderSerialno'); +let user_number =window.localStorage.getItem('Userphonenumber'); +let port = "https://anwi.bizgaze.app"; +// let port = "http://localhost:3088"; + let url = `${port}/apis/v4/bizgaze/integrations/products/salesorderdetailsbyphonenumber/phonenumber/${user_number}`; + const config = { + url, + method: "get", + headers: { + 'Authorization': `stat 05b2f2ca510344968c65e1ebf49a5595 `, + 'Content-Type': 'application/json' + } + }; + let res = await axios(config); + const orderDetailsres = JSON.parse(res.data.result); + console.log(orderDetailsres); + let new_arrr = orderDetailsres; + console.log(new_arrr) + let orderNumber = localStorage.getItem("orderSerialno"); +let filteredOrders = new_arrr.filter(function(order) { + return order.OrderNo === orderNumber; +}); -let deliverdCard=`
-
-
-
- -
- Delivered - Shipment 1 / 5-1 item (1 Delivered) -
-
-
Delivered on Sunday, 9 March Invoice
-
-
- -
-
-
- Shipping to -

Ashok Kumar

-
-
-
- -
-
-

${order_itemname}

-

- - - ${order_itemtotal} -

-

Return/Exchange window closed on Friday,24 March Why?

-
-
-
` +$.each(filteredOrders, function(index, order) { + console.log(order.OrderNo) + let Delivery_status =order.stageshortcode +let deliverdCard=`
Delivery Status :
Delivered To${order.OrganizationName}
${order.itemname} (${order.Quantity} items)${order.itemtotal}

Return/Exchange window closed on Friday,24 March Why?

`; $('.deliverd-card').append(deliverdCard) -$('.order_tax').html(order_tax) -$('.Order_total').html(order_nettotal) -$('.order-summary').html(summary); +if(Delivery_status == 'CMD'){ + $('.delivery_status').html('Deliverd') +} +if(Delivery_status == 'APL'){ + $('.delivery_status').html('Approval') +} +}); +console.log(filteredOrders) +let summary =`

Order${orderNumber} (${filteredOrders.length} items)

Order placed on ${filteredOrders[0].OrderDate}

`; + + $('.order_tax').html(filteredOrders[0].taxamount) + $('.Order_total').html(filteredOrders[0].nettotal) + $('.order_price').html(filteredOrders[0].itemtotal) + $('.order-summary').html(summary); $('.back_to_orders').click(function(){ + let Local_keys_update =['Userphonenumber','orderSerialno'] debugger for (key of Local_keys_update) { window.localStorage.removeItem(key); } $(this).attr('href','./myaccount.html') -}) \ No newline at end of file +}) +} +order_summary() \ No newline at end of file diff --git a/dist/Js/warranty.js b/dist/Js/warranty.js index 384c1ec..446bb85 100644 --- a/dist/Js/warranty.js +++ b/dist/Js/warranty.js @@ -1,13 +1,12 @@ function wattantyFunction() { - debugger; let order_card = `
`; - $(".user_orders").append(order_card); $(".add_serialNum").click(function () { $(".warranty_productform").removeClass("d-none"); $(this).addClass("d-none"); }); $(".warranty_serialNumber_submit").click(async function () { + debugger let serial_no_inp = $("#Add_serial_number_inp").val(); let phonenumber_inp = $("#Add_phonenumber_inp").val(); let contactname_inp = $("#Add_contactname_inp").val(); @@ -32,63 +31,37 @@ function wattantyFunction() { debugger; console.log(response); let product_res = response.data.result; + debugger; if (product_res != null) { let warrenty_res = JSON.parse(product_res); let new_arr = [warrenty_res]; $.each(new_arr, function (key, value) { console.log(value); if (response.data.result == "[]") { - // Command: toastr["error"]("Serial number not found !") - // toasterOpts(); - // $('#Add_serial_number_inp').addClass('border-danger'); - // $('.error_serial_num').removeClass('d-none') $(".user_Warranty_details").html( `
Serial Number Not Found
` ); - setTimeout(function(){ - $('.bg-dangerLite').hide() - }, 1000) - // $('.warranty_productform').addClass('d-none'); - // $('.add_serialNum').removeClass('d-none'); + setTimeout(function () { + $(".bg-dangerLite").hide(); + }, 1000); return; } else { - const warrantyEnabled = value[0].warrantyenabled; - $('.warranty_status_main_container').addClass('d-none') - if (warrantyEnabled == false) { - let phonenumber_updated = Number(phonenumber_inp); - $(".user_Warranty_details").removeClass("d-none"); - // let strDate = new Date(value[0].purchasedate).toISOString().slice(0, 10); - let Warrentypayload = { - sku: value[0].sku, - serialno: serial_no_inp, - phonenumber: phonenumber_updated, - contactname: contactname_inp, - warrantyfromdate: value[0].purchasedate, - }; - warrentyService(Warrentypayload); - } else { - $('.backtoform').removeClass('d-none') - // let warrantySerialnumber =$('.serial_no_warrantynumber').text() - let warrenty_date = value[0].warrantytodate; - // let userwarrenty_product = `
Warranty For : ${value[0].itemname}
Serail NO : ${value[0].serialno}
Warrenty Expiry Date : ${value[0].warrantytodate}
Warranty Start Date : ${value[0].warrantyfromdate}
Warranty Status : ${value[0].warrantyenabled}
`; - let userwarrenty_product = `
guarantee
Congratulations,

Thanks for registering with anwi systems .You have successfully availed your warranty.

Here is your warranty Details

Warranty-product

Serail No

${value[0].serialno}

Warranty will be applicable till

${value[0].warrantytodate}

Order details

Sku

${value[0].sku}

Itemname

${value[0].itemname}

Warranty details

Warranty Start

${value[0].warrantyfromdate}

Warranty status

{value[0].warrantyenabled}

Follow Below steps to request your warranty claim.

  1. Go to My account
  2. Tap on request claim
  3. Enter information and send claim request
`; - let is_warranty_enable = value[0].warrantyenabled; - debugger; - $(".user_Warranty_details").html(userwarrenty_product); - if (is_warranty_enable == true) { - $(".is_warranty_enable").text("Activated"); - } else { - $(".is_warranty_enable").text("Not Activated"); - } - if (warrenty_date == "") { - $(".warrenty_date").addClass("d-none"); - } else { - $(".warrenty_date").removeClass("d-none"); - } - $("#Add_serial_number_inp").addClass("border-success"); - $(".error_serial_num").addClass("d-none"); - $(".add_serialNum").removeClass("d-none"); - } + const warrantyEnabled = value[0].warrantyenabled; + $(".warranty_status_main_container").addClass("d-none"); + if (warrantyEnabled == false) { + let phonenumber_updated = Number(phonenumber_inp); + $(".user_Warranty_details").removeClass("d-none"); + let Warrentypayload = { + sku: value[0].sku, + serialno: serial_no_inp, + phonenumber: phonenumber_updated, + contactname: contactname_inp, + warrantyfromdate: value[0].purchasedate, + }; + warrentyService(Warrentypayload); + } else { + alert('warranty enabled') + } } }); } @@ -102,7 +75,7 @@ function wattantyFunction() { } } }); - $('.warranty_serialNumber_check').click(async function(){ + $(".warranty_serialNumber_check").click(async function () { let serial_no_inp = $("#Add_serial_number_inp").val(); if (serial_no_inp != "") { $(".error_serial_num").addClass("d-none"); @@ -124,29 +97,61 @@ function wattantyFunction() { debugger; console.log(response); let product_res = response.data.result; + debugger; + let warrenty_res = JSON.parse(product_res); if (product_res != null) { - if (response.data.result == "[]") { - $('.bg-dangerLite').removeClass('d-none') - $(".user_Warranty_details").html( - `
Serial Number Not Found
` - ); - - // ); - setTimeout(function(){ - $('.bg-dangerLite').hide() - }, 1000) - return; + if (response.data.result == "[]") { + $(".bg-dangerLite").removeClass("d-none"); + $(".user_Warranty_details").html( + `
Serial Number Not Found
` + ); + // ); + setTimeout(function () { + $(".bg-dangerLite").hide(); + }, 1000); + return; + } + else { + if (warrenty_res[0].warrantyenabled == true) { + + $(".backtoform").removeClass("d-none"); + let new_arr = [warrenty_res]; + $.each(new_arr, function (key, value) { + console.log(value); + let warrenty_date = value[0].warrantytodate; + let userwarrenty_product = `
guarantee
Congratulations,

Thanks for registering with anwi systems .You have successfully availed your warranty.

Here is your warranty Details

Warranty-product

Serail No

${value[0].serialno}

Warranty will be applicable till

${value[0].warrantytodate}

Order details

Sku

${value[0].sku}

Itemname

${value[0].itemname}

Warranty details

Warranty Start

${value[0].warrantyfromdate}

Warranty status

{value[0].warrantyenabled}

Follow Below steps to request your warranty claim.

  1. Go to My account
  2. Tap on request claim
  3. Enter information and send claim request
`; + let is_warranty_enable = value[0].warrantyenabled; + debugger; + $(".user_Warranty_details").html(userwarrenty_product); + $(".warranty_status_main_container").addClass("d-none"); + if (is_warranty_enable == true) { + $(".is_warranty_enable").text("Activated"); + } else { + $(".is_warranty_enable").text("Not Activated"); + } + if (warrenty_date == "") { + $(".warrenty_date").addClass("d-none"); + } else { + $(".warrenty_date").removeClass("d-none"); + } + $("#Add_serial_number_inp").addClass("border-success"); + $(".error_serial_num").addClass("d-none"); + $(".add_serialNum").removeClass("d-none"); + return + }); } - else{ - $('.bg-dangerLite').addClass('d-none') - $(".Add_phonenumber_inp_label").removeClass('d-none') - $("#Add_phonenumber_inp").removeClass('d-none') - $(".Add_Contact_inp_label").removeClass('d-none') - $("#Add_contactname_inp").removeClass('d-none') - $(".warranty_serialNumber_submit").removeClass('d-none') - $(this).addClass('d-none') - $(".Serial_numb_notfound").addClass('d-none') - } + else { + $(".bg-dangerLite").addClass("d-none"); + $(".Add_phonenumber_inp_label").removeClass("d-none"); + $("#Add_phonenumber_inp").removeClass("d-none"); + $(".Add_Contact_inp_label").removeClass("d-none"); + $("#Add_contactname_inp").removeClass("d-none"); + $(".warranty_serialNumber_submit").removeClass("d-none"); + $(this).addClass("d-none"); + $(".Serial_numb_notfound").addClass("d-none"); + } + + } } } else { if (serial_no_inp == "") { @@ -154,54 +159,28 @@ function wattantyFunction() { $(".error_serial_num").removeClass("d-none"); } } - }) + }); async function warrentyService(Warrentypayload) { - // let d = new Date(); - // // let strDate = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate(); - // let strDate = new Date().toISOString().slice(0, 10) - // console.log(strDate) - debugger; const res = await postAPIServiceWarranty( `apis/v4/bizgaze/transact/items/savewarrantyasync`, Warrentypayload ); - debugger; console.log(res); if (res.data.status == 2) { - // $('.warranty_productform').addClass('d-none'); - // $('.add_serialNum').removeClass('d-none'); - // Command: toastr["warning"](res.data.message) - // toasterOpts(); - $('.warranty_status_main_container').removeClass('d-none') - $('.bg-dangerLite').removeClass('d-none'); + $(".warranty_status_main_container").removeClass("d-none"); + $(".bg-dangerLite").removeClass("d-none"); $(".user_Warranty_details").html( - `
No Serial number found / Product not Delivered
` + `
No Serial number found / Product not Delivered
` ); - setTimeout(function(){ - $('.bg-dangerLite').hide() - }, 1000) + setTimeout(function () { + $(".bg-dangerLite").hide(); + }, 1000); } else if (res.data.status == "0") { - $(".user_Warranty_details").html(`
${res.data.message}
`); + $(".user_Warranty_details").html( + `
${res.data.message}
` + ); } } - // function toasterOpts() { - // toastr.options = { - // "closeButton": true, - // "debug": false, - // "newestOnTop": true, - // "progressBar": true, - // "positionClass": "toast-top-center", - // "preventDuplicates": true, - // "showDuration": "300", - // "hideDuration": "1000", - // "timeOut": "3000", - // "extendedTimeOut": "1000", - // "showEasing": "swing", - // "hideEasing": "linear", - // "showMethod": "fadeIn", - // "hideMethod": "fadeOut" - // } - // } } wattantyFunction(); diff --git a/dist/css/main.css b/dist/css/main.css index f3236e3..b223fd0 100644 --- a/dist/css/main.css +++ b/dist/css/main.css @@ -1091,7 +1091,7 @@ html,body{ /* ORDER DETAILS */ .bg-return{ - background-color: #f7f0e1 !important; + background-color: #d0f5ff !important; } .close_exchange{ bottom:10px; @@ -1106,7 +1106,7 @@ html,body{ font-size: 1rem !important; } .order-summary{ - background-color:#f3e2be !important; + background-color:#c8ebff !important; } .fs-7{ font-size: 0.7rem; @@ -1603,4 +1603,12 @@ background: linear-gradient(75deg, rgb(56 89 118) 51%, rgb(107 18 111) 89%) .fs-60 { font-size: 60px !important; padding: 40px 0px !important; +} +.Order_details_section{ + position: sticky; + top: 120px; +} +.primary_btn{ + background: #0A1039 !important; + color: #fff !important; } \ No newline at end of file diff --git a/myaccount.html b/myaccount.html index b2933ca..f64c725 100644 --- a/myaccount.html +++ b/myaccount.html @@ -229,7 +229,7 @@

Order Details

-
+
diff --git a/orderdetails.html b/orderdetails.html index bda8c71..fca6e46 100644 --- a/orderdetails.html +++ b/orderdetails.html @@ -35,41 +35,42 @@
-
-
- -
-
-
- +
+
+ -
-
-
- -
-
-
+
+
+ +
+
+
+
+ +
+

Order Payment Details

-
+
-

Order Amount

+

Order Amount

- - - 32,000 + + + + 32,000
@@ -77,12 +78,20 @@

Tax

-

-₹1000.00

+ + + + + +
-

Convenience Fee

+

Shipping Fee

Free

@@ -93,19 +102,23 @@

Order Total

- - + + +
-
+

Payment Method

-

Coupons

+

Coupons

₹100

@@ -129,7 +142,9 @@
+
+
@@ -139,7 +154,8 @@

Ashok Kumar

-

3-128,Srinivasa Nagar,Deepthi sri colony,Miyapur,

+

3-128,Srinivasa Nagar,Deepthi sri + colony,Miyapur,

HYDERABAD - TELENGANA

India - 500101

Phone : 9876543234

@@ -149,8 +165,8 @@
-
-
+
+
@@ -159,9 +175,9 @@ - + - +