reimplemented login system and added state list component.

This commit is contained in:
2023-05-05 12:08:51 +05:30
parent c564c38bf3
commit a826e188ed
20 changed files with 1797 additions and 2082 deletions
+20 -17
View File
@@ -1,14 +1,17 @@
//let SERVERNAME = 'https://anwi.bizgaze.app';
//let SERVERNAME = 'http://beta.bizgaze.com';
let SERVERNAME = 'https://qa.anwisystems.com';
let SERVERNAME = 'https://qa.anwisystems.com';
//let SERVERNAME = 'http://localhost:3088';
//template
const STAT = '8041f78ba55b4847bc4aacaeae9d24ef';
const STAT = 'd622a6ce4c8540ffadd0f885162ac8f4';
//live
//const STAT = '0c7ef2b000ca431290065753dfda56fe';
const USER_AUTH_OKAY = 'USER_AUTH_OKAY';
function imgServerNameBuild(path){
return `https://appassets.bizgaze.app/${path}`;
}
@@ -29,9 +32,10 @@ async function getStatAPIService(url,data={}){
return response;
}
async function getStatAPIService(url,data={}){
async function getAPIService(url,data={}){
debugger
const config = {
url,
url:`${SERVERNAME}/${url}`,
method: "get",
};
let response = await axios(config);
@@ -39,6 +43,18 @@ async function getStatAPIService(url,data={}){
return response;
}
async function postAPIService(url,data={}){
let config = {
url:`${SERVERNAME}/${url}`,
method:'post',
data:data,
}
let response = await axios(config);
return response;
}
async function postStatAPIService(url,data={}){
let config = {
url,
@@ -55,20 +71,7 @@ async function postStatAPIService(url,data={}){
}
async function postAPIService(url,data={}){
let config = {
url:`${SERVERNAME}/${url}`,
method:'post',
data:data,
// headers: {
// 'Authorization': `Basic b67607dd-283e-478e-b2cf-35736e8bad69`,
// 'Content-Type': 'application/json'
// },
}
let response = await axios(config);
return response;
}
async function postAPIServiceLocal(url,data={}){
+658 -737
View File
File diff suppressed because it is too large Load Diff
+10 -4
View File
@@ -26,7 +26,7 @@ $(document).ready(function () {
<div class="accordion-body pt-0">
<ul class="list-inline ">
<li class="fs-6">
<a href="./ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
<a href="/ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
</li>
<li class="fs-6">
<a href="./storageproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Storage</a>
@@ -229,7 +229,7 @@ $(document).ready(function () {
<h5 class="fw-bold">Products</h5>
<ul class="list-inline ">
<li class="fs-6">
<a href="./ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
<a href="/ramproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Memory</a>
</li>
<li class="fs-6">
<a href="./storageproducts.html" class="text-white fs-9 text-decoration-none satoshi_font">Storage</a>
@@ -274,8 +274,14 @@ $(document).ready(function () {
<div class="col-lg-3 last-col-footer">
<h5 class="fw-bold">Account</h5>
<ul class="list-inline">
<li>My Shopping Cart</li>
<li>My Account
<li>
<a href="/shopping-cart.html" class="text-white text-decoration-none satoshi_font"> My Shopping Cart</a>
</li>
<li>
<a href="/myaccount.html" class="text-white text-decoration-none satoshi_font"> My Account</a>
</li>
</li>
</ul>
<h5 class="fw-bold">Follow Us</h5>
+463 -459
View File
@@ -31,12 +31,12 @@
var scroll = win.scrollTop();
if (scroll < 100) {
header.removeClass('stick');
$("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
$("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
$("body.product_pg").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
$("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
$("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
// $('.header-bottom-flex').find('svg path').attr('fill','#fff');
$("body").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
$("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
$("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#fff");
if ($body_pg == true) {
$(".main-menu").find("nav ul li a").addClass("text-dark");
@@ -87,474 +87,478 @@
/*--------------------------------
Slider active 1
-----------------------------------*/
$('.slider-active-1').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: false,
arrows: true,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
sliders();
function sliders(){
if(window.location.href.includes('login')) return;
$('.slider-active-1').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: false,
arrows: true,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Slider active 2
-----------------------------------*/
$('.slider-active-2').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--
Slider active 3
-----------------------------------*/
$('.slider-active-3').slick({
arrows: false,
infinite: true,
slidesToShow: 1,
dots: true,
fade: true,
autoplay: false,
autoplaySpeed: 5000,
customPaging : function(slider, i) {
var thumb = $(slider.$slides[i]).data('thumb');
return '<button class="overlay"><img src="'+thumb+'"></button>';
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
responsive: [
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
settings: {
dots: true,
autoplay: false,
autoplaySpeed: 5000,
}
}
}
]
});
/*--------------------------------
Slider active 2
-----------------------------------*/
$('.slider-active-2').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
slider active 4
-----------------------------------*/
$('.slider-active-4').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Slider active 5
-----------------------------------*/
$('.slider-active-5').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
});
/*--------------------------------
Product slider active 1
-----------------------------------*/
$('.product-slider-active-1').slick({
slidesToShow: 3,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Product slider active 2
-----------------------------------*/
$('.product-slider-active-2').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Product slider active 3
-----------------------------------*/
$('.product-slider-active-3').slick({
slidesToShow: 2,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
}
]
});
/*--
Slider active 3
-----------------------------------*/
$('.slider-active-3').slick({
arrows: false,
infinite: true,
slidesToShow: 1,
dots: true,
fade: true,
autoplay: false,
autoplaySpeed: 5000,
customPaging : function(slider, i) {
var thumb = $(slider.$slides[i]).data('thumb');
return '<button class="overlay"><img src="'+thumb+'"></button>';
},
responsive: [
{
breakpoint: 767,
settings: {
dots: true,
autoplay: false,
autoplaySpeed: 5000,
]
});
/*--------------------------------
Product slider active 4
-----------------------------------*/
$('.product-slider-active-4').slick({
slidesToShow: 4,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
}
]
});
/*--------------------------------
slider active 4
-----------------------------------*/
$('.slider-active-4').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Brand logo active
-----------------------------------*/
$('.brand-logo-active , .brand-logo-active-2').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
]
});
/*--------------------------------
Brand logo active 3
-----------------------------------*/
$('.brand-logo-active-3').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: true,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Slider active 5
-----------------------------------*/
$('.slider-active-5').slick({
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
loop: true,
dots: true,
arrows: false,
prevArrow: '<span class="slider-icon slider-icon-prev"><i class="icofont-simple-left"></i></span>',
nextArrow: '<span class="slider-icon slider-icon-next"><i class="icofont-simple-right"></i></span>',
});
/*--------------------------------
Product slider active 1
-----------------------------------*/
$('.product-slider-active-1').slick({
slidesToShow: 3,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Product slider active 2
-----------------------------------*/
$('.product-slider-active-2').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Product slider active 3
-----------------------------------*/
$('.product-slider-active-3').slick({
slidesToShow: 2,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Product slider active 4
-----------------------------------*/
$('.product-slider-active-4').slick({
slidesToShow: 4,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Brand logo active
-----------------------------------*/
$('.brand-logo-active , .brand-logo-active-2').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: false,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
}
]
});
/*--------------------------------
Brand logo active 3
-----------------------------------*/
$('.brand-logo-active-3').slick({
slidesToShow: 6,
slidesToScroll: 1,
loop: true,
dots: true,
arrows: false,
responsive: [{
breakpoint: 1500,
settings: {
slidesToShow: 6,
slidesToScroll: 1,
}
},
{
breakpoint: 1199,
settings: {
slidesToShow: 5,
slidesToScroll: 1,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
}
},
{
breakpoint: 767,
settings: {
autoplay: false,
slidesToShow: 3,
slidesToScroll: 1,
}
},
{
breakpoint: 575,
settings: {
autoplay: false,
slidesToShow: 2,
slidesToScroll: 1,
}
}
]
});
]
});
}
/*---------------------
Countdown 1
+157 -87
View File
@@ -2,9 +2,64 @@ async function addressDetails() {
debugger;
// const user_addr_num =$("#Profile_Phone_num").val();
getbillinginfoBind();
let addr_phone=$('#phonenumber');
let addr_addrline =$('#addressdes');
let addr_zip =$('#zipcode');
let addr_phone = $('#phonenumber');
let addr_addrline = $('#addressdes');
let addr_zip = $('#zipcode');
let stateArr = [];
function getCustomDropDownHTML({ cityid, cityname, countryid }) {
return ` <div class="bg-white stateoption px-2 border-bottom py-2 cursor-pointer" data-name="${cityname}" data-value="${cityid}">${cityname}</div>`;
}
function renderCustomStateDropdown(stateList) {
let html = ``;
debugger;;
let maxLen = stateList.length > 10 ? 10 : stateList.length
for (let i = 0; i < maxLen; i++) {
let currItem = stateList[i];
html += getCustomDropDownHTML(currItem);
}
$('.stateBox').html(html);
$('.stateoption').off().click(function (e) {
debugger;
const name = $(e.target).data('name');
const id = $(e.target).data('value');
$('#state').val(name);
$('#state').attr('data-id', id);
})
}
function loadDropdownStateEvents() {
$('#state').off().focus(function () {
$('.stateBox').removeClass('d-none');
$(document).off('click').click(closeDrop);
})
$(document).off().click(closeDrop);
function closeDrop(e) {
let id = $(e.target).hasClass('stateoption');
if ($(e.target).attr('id') === 'state') return;
if (id) {
$('.stateBox').addClass('d-none');
$(document).off();
} else {
$('.stateBox').addClass('d-none');
$(document).off();
}
}
$('#state').keyup(debounce(function (event) {
onChangeState(event)
}));
}
function getbillinginfoBind() {
return new Promise(async (resolve, reject) => {
@@ -22,63 +77,67 @@ async function addressDetails() {
addr_phone.val(res.phonenumber);
$('#Profile_User_name').val(res.organizationname)
$('#Profile_Phone_num').val(res.phonenumber)
let Profileusername =$('#Profile_User_name').val()
let Profileuserphone=$('#Profile_Phone_num').val()
let Profileusername = $('#Profile_User_name').val()
let Profileuserphone = $('#Profile_Phone_num').val()
$('.overview_user_name').html(Profileusername);
$('.overview_user_phone').html(Profileuserphone);
$('.overview_user_phone').html(Profileuserphone);
if (res.cityid == "0") {
$(".profile_Address").html(
`<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>`
);
$(".address_edit").hide();
$(".create_address").on("click", function () {
debugger
$(this).hide();
$('.saveaddress').hide()
$(".addresslist").show();
$(".Createaddress").show();
getCountryStateCurrency();
});
$('.Createaddress').on('click',async function(){
if( addr_zip.val() == "" || addr_addrline.val() == ""){
// toastr.error('Required Feilds are Empty!');
// if(addr_phone.val() == '' || addr_phone.val().length <10){
// addr_phone.addClass("is-invalid");
// }
// else{
// addr_phone.removeClass("is-invalid");
// }
if(addr_zip.val() == '' || addr_zip.val().length < 6){
addr_zip.addClass("is-invalid");
}
else{
addr_zip.removeClass("is-invalid");
}
if(addr_addrline.val() == ''){
addr_addrline.addClass("is-invalid");
} else{
addr_addrline.removeClass("is-invalid");
}
}
else{
$(".addresslist").hide();
$(".profile_Address").show();
$(".address_edit").show();
$(".address_edit_cancel").hide();
await createBillingForm()
await getbillinginfoBind();
}
debugger
$(this).hide();
$('.saveaddress').hide()
$(".addresslist").show();
$(".Createaddress").show();
getCountryStateCurrency();
});
$('.Createaddress').on('click', async function () {
if (addr_zip.val() == "" || addr_addrline.val() == "") {
// toastr.error('Required Feilds are Empty!');
// if(addr_phone.val() == '' || addr_phone.val().length <10){
// addr_phone.addClass("is-invalid");
// }
// else{
// addr_phone.removeClass("is-invalid");
// }
if (addr_zip.val() == '' || addr_zip.val().length < 6) {
addr_zip.addClass("is-invalid");
}
else {
addr_zip.removeClass("is-invalid");
}
if (addr_addrline.val() == '') {
addr_addrline.addClass("is-invalid");
} else {
addr_addrline.removeClass("is-invalid");
}
}
else {
$(".addresslist").hide();
$(".profile_Address").show();
$(".address_edit").show();
$(".address_edit_cancel").hide();
await createBillingForm()
await getbillinginfoBind();
}
})
} else {
$(".profile_Address").html(
`<div class=User_address><address><p><strong class="text-capitalize">${res.organizationname}</strong><p>${res.addressline},${res.cityname}<br>${res.statename},${res.zipcode}<p>Mobile: ${res.phonenumber}</address></div>`
`<div class=User_address><address><p><strong class="">${res.organizationname}</strong><p>${res.addressline},${res.cityname},${res.zipcode}<p>Mobile: ${res.phonenumber}</address></div>`
);
$('#state').val(res.cityname)
$('#state').attr('data-id',res.cityid);
$('#zipcode').val(res.zipcode);
$('#addressdes').val(res.addressline);
}
resolve();
});
} debugger
} debugger
$(".address_edit").on("click", function () {
@@ -87,7 +146,7 @@ async function addressDetails() {
$(".addresslist").show();
$(".address_edit_cancel").show();
getCountryStateCurrency();
getbillinginfoBind()
getbillinginfoBind()
});
$(".address_edit_cancel").on("click", function () {
@@ -100,9 +159,9 @@ async function addressDetails() {
$(".saveaddress")
.off("click")
.click(async function () {
debugger
if(addr_zip.val() == "" || addr_addrline.val() == ""){
debugger
if (addr_zip.val() == "" || addr_addrline.val() == "") {
// toastr.error('Required Feilds are Empty!');
// if(addr_phone.val() == '' || addr_phone.val().length <10){
// addr_phone.addClass("is-invalid");
@@ -110,33 +169,56 @@ async function addressDetails() {
// else{
// addr_phone.removeClass("is-invalid");
// }
if(addr_zip.val() == '' || addr_zip.val().length < 6){
addr_zip.addClass("is-invalid");
}
else{
addr_zip.removeClass("is-invalid");
}
if(addr_addrline.val() == ''){
addr_addrline.addClass("is-invalid");
} else{
addr_addrline.removeClass("is-invalid");
}
}
else{
if (addr_zip.val() == '' || addr_zip.val().length < 6) {
addr_zip.addClass("is-invalid");
}
else {
addr_zip.removeClass("is-invalid");
}
if (addr_addrline.val() == '') {
addr_addrline.addClass("is-invalid");
} else {
addr_addrline.removeClass("is-invalid");
}
}
else {
$(".addresslist").hide();
$(".profile_Address").show();
$(".address_edit").show();
$(".address_edit_cancel").hide();
$('.spinner-border').removeClass('d-none')
$('.saveaddress').find('span').addClass('d-none')
await AddresssaveForm();
$('.spinner-border').addClass('d-none')
$('.saveaddress').find('span').removeClass('d-none')
await getbillinginfoBind();
}
await AddresssaveForm();
$('.spinner-border').addClass('d-none')
$('.saveaddress').find('span').removeClass('d-none')
await getbillinginfoBind();
}
});
function onChangeState(e){
let userItem = e.target.value.toLowerCase();
let limit = 10;
let results = [];
let maxLen = stateArr.length > 10 ? 10 :stateArr.length;
debugger
for(let i=0;i<stateArr.length;i++){
let currItem = stateArr[i];
let stateName = currItem.cityname.toLowerCase();
if(stateName.includes(userItem)){
results.push(currItem);
if(results.length>=10) break;
}
}
$('.stateBox').removeClass('d-none');
renderCustomStateDropdown(results);
loadDropdownStateEvents();
}
async function getCountryStateCurrency() {
const countryRes = await API_SERVICES_ACTIONS.getAPIService(
"apis/v4/bizgaze/integrations/anwiauth/getcountry"
);
@@ -169,22 +251,9 @@ async function addressDetails() {
let stateData = JSON.parse(stateRes.response.result);
console.log(stateData, "state");
$("#state").html("");
console.log("start");
let html = "";
statesList = stateData;
for (let i = 0; i < stateData.length; i++) {
html += `<option value="${stateData[i].cityid}" data-id="${stateData[i].cityid}">${stateData[i].cityname}</option>`;
}
$("#state").append(html);
$("#state").select2({
placeholder: "Select a City",
allowClear: true,
});
stateArr = stateData;
renderCustomStateDropdown(stateArr);
loadDropdownStateEvents();
const currencyRes = await API_SERVICES_ACTIONS.getAPIService(
"apis/v4/bizgaze/integrations/anwiauth/getcurrencies"
);
@@ -285,14 +354,15 @@ async function addressDetails() {
let resAnwi = JSON.parse(response.result);
console.log(resAnwi, "befores");
resAnwi = resAnwi[resAnwi.length - 1];
let stateId = parseInt($("#state").val());
let stateId = parseInt($("#state").data('id'));
let payload = {
...resAnwi,
phonenumber: $("#phonenumber").val(),
addressline1: $("#addressdes").val(),
zipcode: $("#zipcode").val(),
cityid: stateId,
CityName: $(`[data-id="${stateId}"`).html(),
CityName: $('#state').val(),
cityname: $('#state').val(),
};
console.log(payload, "addresssaave");
//
+24 -22
View File
@@ -20,20 +20,22 @@ function navINIT() {
}
async function loadCart(){
let files = ['./dist/js/shoppingcart/addtocart.js'];
await loadHelper();
for(let i=0;i<files.length;i++){
if ($(`script[src="${files[i]}"]`).length > 0) {
continue;
}
try {
await loadHelper(files[i])
console.log("done");
} catch (error) {
console.log(error);
return;
if(!window.location.href.includes('services/paymentmethod.html')){
let files = ['./dist/js/shoppingcart/addtocart.js'];
await loadHelper();
for(let i=0;i<files.length;i++){
if ($(`script[src="${files[i]}"]`).length > 0) {
continue;
}
try {
await loadHelper(files[i])
console.log("done");
} catch (error) {
console.log(error);
return;
}
}
}
@@ -45,7 +47,7 @@ function navINIT() {
}
let URLNAMENAV = window.location.href;
const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation');
const isTransparent = URLNAMENAV.includes('login')||URLNAMENAV.includes('orderconfirmation')|| URLNAMENAV.includes('services/paymentmethod.html');
let nav_html = `
<header class="header-area section-padding-1 transparent-bar" ${isTransparent ?'style="background:#0A1039"' :''}>
<div class="header-large-device">
@@ -55,7 +57,7 @@ function navINIT() {
<div class="logo-menu-wrap d-flex">
<div class="logo">
<a href="../index.html">
<img src="../dist/assets/imgs/anwi-logo-2.png" alt="logo" class="w-50">
<img src="/dist/assets/imgs/anwi-logo-2.png" alt="logo" class="w-50">
</a>
</div>
<div class="main-menu menu-lh-1 main-menu-padding-1">
@@ -200,13 +202,13 @@ function navINIT() {
</div>
<div class="header-action-wrap header-action-flex header-action-width header-action-mrg-1">
<div class="same-style">
<a href="./myaccount.html" class="my_avatar">
<a href="/myaccount.html" class="my_avatar">
<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>
</a>
</div>
<div class="same-style header-cart">
<a class="cart-active1 position-relative" href="./shopping-cart.html">
<a class="cart-active1 position-relative" href="/shopping-cart.html">
<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>
<span class="position-absolute cartnumcount d-none" >0</span>
@@ -231,7 +233,7 @@ function navINIT() {
</div>
<div class="mobile-logo mobile-logo-width ps-3">
<a href="../index.html">
<img alt="" src="../dist/assets/imgs/anwi-logo-1.png" class="w-50">
<img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-50">
</a>
</div>
</div>
@@ -239,10 +241,10 @@ function navINIT() {
<div class="col-6">
<div class="header-action-wrap header-action-flex header-action-mrg-1">
<div class="same-style">
<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>
<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>
</div>
<div class="same-style header-cart">
<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>
<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>
<span class="position-absolute cartnumcount d-none" style="top:-27%;right:-80%">0</span>
</a>
</div>
@@ -259,7 +261,7 @@ function navINIT() {
<div class="col-6">
<div class="mobile-logo mobile-logo-width">
<a href="../index.html">
<img alt="" src="../dist/assets/imgs/anwi-logo-1.png" class="w-75">
<img alt="" src="/dist/assets/imgs/anwi-logo-1.png" class="w-75">
</a>
</div>
</div>
+5 -4
View File
@@ -8,6 +8,7 @@ function ramProductsInit(){
function getProductIdService(){
return new Promise(async (reslove,reject)=>{
let resData =await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true);
if(resData.isError){
alert(resData.errorMsg.message);
@@ -56,7 +57,7 @@ function ramProductsInit(){
console.log(res);
let html = '';
debugger;
for(let i=0;i<res.length;i++){
html += getRamCardHTML(res[i]);
}
@@ -64,10 +65,10 @@ debugger;
$('.product_card_section').html(html);
$('.ramcard').click(function(e){
debugger;
let sku = $(e.target).data('itemid');
let itemid = $(e.target).data('itemid');
debugger;
window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
})
@@ -168,5 +169,5 @@ debugger;
init();
}
debugger;
ramProductsInit();
+109 -22
View File
@@ -117,10 +117,12 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
}
function clearAllInputs(){
$("#state").select2({
placeholder: "Select a City",
allowClear: true
});
// $("#state").select2({
// placeholder: "Select a City",
// allowClear: true
// });
$('#state').val(null);
$('#phonenumber').val(null);
$('#addressdes').val(null);
@@ -141,11 +143,14 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
$('#addressdes').val(addressline);
$('#zipcode').val(zipcode);
debugger;
$('#state').attr('data-id',cityid);
$('#state').val(cityname)
$('.userNamelogin').html(`${userName}`);
editMode = true;
console.log(stateArr);
renderStates(stateArr);
// console.log(stateArr);
renderCustomStateDropdown(stateArr);
//renderStates(stateArr);
}
@@ -185,6 +190,8 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
$('#addressdes').val(addressline);
$('#zipcode').val(zipcode);
debugger;
$('#state').attr('data-id',cityid);
$('#state').val(cityname);
$('.userNamelogin').html(`${userName}`);
changeAddressBtnAction.addChangeAddressBtn()
getCountryStateCurrency();
@@ -200,7 +207,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
}
function setAddressHeader({name,phonenumber,addressline,cityname,zipcode}){
$('.innerDisplayAddress').html(`${name}-${phonenumber}, ${addressline}, ${cityname} - `);
$('.innerDisplayAddress').html(`${phonenumber}, ${addressline}, ${cityname} - `);
$('.zipcodeAddress').html(`${zipcode}`);
}
@@ -209,7 +216,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
let number = $('#phonenumber').val();
let zipcode = $('#zipcode').val();
let state = $('#state').val();
let state = $('#state').data('id');
let address = $('#addressdes').val();
let isTrue = false;
@@ -244,7 +251,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
let { userId, name } = cookieRes;
const ctyId = await getCountryId();
let stateId = parseInt($('#state').val());
let stateId = parseInt($('#state').data('id'));
let payload = {
"cityid": stateId,
"CityName":$(`[data-id="${stateId}"`).html(),
@@ -273,7 +280,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
// http://localhost:3088/apis/v4/bizgaze/crm/address/savebillinginfo
setAddressHeader({name,phonenumber:$('#phonenumber').val(),addressline: $('#addressdes').val(),cityname:$(`[data-id="${stateId}"`).html(),zipcode:$('#zipcode').val()});
setAddressHeader({name,phonenumber:$('#phonenumber').val(),addressline: $('#addressdes').val(),cityname:$('#state').val(),zipcode:$('#zipcode').val()});
return new Promise((reslove,reject) => {
reslove(res);
@@ -291,14 +298,14 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
console.log(resAnwi, 'befores');
resAnwi = resAnwi[resAnwi.length - 1];
let stateId = parseInt($('#state').val());
let stateId = parseInt($('#state').data('id'));
let payload = {
...resAnwi,
phonenumber:$('#phonenumber').val(),
addressline1:$('#addressdes').val(),
zipcode:$('#zipcode').val(),
cityid:stateId,
CityName:$(`[data-id="${stateId}"`).html(),
CityName:$('#state').val(),
}
@@ -314,9 +321,62 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
})
}
function onChangeState(e){
let userItem = e.target.value.toLowerCase();
let limit = 10;
let results = [];
let maxLen = stateArr.length > 10 ? 10 :stateArr.length;
debugger
for(let i=0;i<stateArr.length;i++){
let currItem = stateArr[i];
let stateName = currItem.cityname.toLowerCase();
if(stateName.includes(userItem)){
results.push(currItem);
if(results.length>=10) break;
}
}
renderCustomStateDropdown(results);
loadDropdownStateEvents();
}
function loadDropdownStateEvents(){
$('#state').off().focus(function (){
$('.stateBox').removeClass('d-none');
$(document).off('click').click(closeDrop);
})
$(document).off().click(closeDrop);
function closeDrop(e){
let id = $(e.target).hasClass('stateoption');
if($(e.target).attr('id')==='state') return;
if(id) {
$('.stateBox').addClass('d-none');
$(document).off();
}else{
$('.stateBox').addClass('d-none');
$(document).off();
}
}
$('#state').keyup(debounce(function (event){
onChangeState(event)
}));
}
async function loadEvents() {
loadDropdownStateEvents();
$('.addnewAddressContainer').off('click').click(function (e) {
$('.addnewAddressContainer').addClass('d-none');
$('.addresslist').removeClass('d-none');
@@ -353,7 +413,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
$('.saveanddeliver').off('click').click(async function (e) {
debugger;
saveFormLoading.addSpinner()
let isErrorForm = checkForm();
@@ -365,7 +425,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
if(editMode){
res = await saveForm();
}else{
res = createBillingForm();
res = await createBillingForm();
}
saveFormLoading.removeSpinner();
@@ -389,8 +449,8 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
// zipcode:$('#zipcode').val(),
// cityid:stateId,
// CityName:$(`[data-id="${stateId}"`).html(),
let stateId = parseInt($('#state').val());
setAddressHeader({name,addressline:$('#addressdes').val(),cityname:$(`[data-id="${stateId}"`).html(),phonenumber:$('#phonenumber').val(),zipcode:$('#zipcode').val()});
let stateId = parseInt($('#state').data('id'));
setAddressHeader({name,addressline:$('#addressdes').val(),cityname:$(`#state`).val(),phonenumber:$('#phonenumber').val(),zipcode:$('#zipcode').val()});
$('.errMsgFormEdit').html('');
@@ -551,7 +611,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
function renderStates(data){
$('#state').off('select2:select');
let html = '';
for (let i = 0; i < data.length; i++) {
for (let i = 0; i < 10; i++) {
html += `<option value="${data[i].cityid}" data-id="${data[i].cityid}">${data[i].cityname}</option>`
}
@@ -585,6 +645,7 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
}
}
// 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`);
const stateRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/anwiauth/getcities/countryid/${countryID}`);
if (stateRes.isError) {
@@ -595,15 +656,16 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
let stateData = JSON.parse(stateRes.response.result);
console.log(stateData, 'state');
// console.log(stateData, 'state');
$('#state').html('');
$('#state').val(null);
console.log("start")
let html = '';
statesList = stateData;
stateArr = stateData;
renderStates(stateArr)
renderCustomStateDropdown(stateArr);
//renderStates(stateArr)
@@ -627,6 +689,30 @@ let Newuser =window.localStorage.getItem('isaccountCreated');
}
}
function getCustomDropDownHTML({cityid,cityname,countryid}){
return ` <div class="bg-white stateoption px-2 border-bottom py-2 cursor-pointer" data-name="${cityname}" data-value="${cityid}">${cityname}</div>`;
}
function renderCustomStateDropdown(stateList){
let html = ``;
debugger;;
let maxLen = stateList.length > 10 ? 10 :stateList.length
for(let i=0;i<maxLen;i++){
let currItem = stateList[i];
html+=getCustomDropDownHTML(currItem);
}
$('.stateBox').html(html);
$('.stateoption').off().click(function(e){
debugger;
const name = $(e.target).data('name');
const id = $(e.target).data('value');
$('#state').val(name);
$('#state').attr('data-id',id);
})
}
function loadShippingProducts(){
$('.detailsAddressBg').removeClass('detailsAddressBg');
$('.ordersummaryheader ').addClass('detailsAddressBg')
@@ -644,10 +730,11 @@ debugger;
// $('.orderslist').html(productsHTML);
$('.orderslist').addClass("p-3")
$('.orderslist').html(` <label for="online">
Online
<input checked data-op="online" name="payment" type="radio" class="paymentbtn " id="online">
<span>Pay Via (Card, Net Banking, Wallet)</span>
</label>
<label for="cod">
<label for="cod" class="d-none">
Cash on delivery
<input data-op="cod" name="payment" type="radio" class="paymentbtn " id="cod">
</label>`);
+106 -100
View File
@@ -6,14 +6,14 @@ function shoppingCartInit() {
let DELETE_FILTER = null;
let insufficientQtyActions = {
moreQtyAdd(e){
moreQtyAdd(e) {
$(e.target).parents('.mainselectcontainer').find('.insufficientqty').removeClass('d-none');
},
moreQtyRemove(e){
moreQtyRemove(e) {
$(e.target).parents('.mainselectcontainer').find('.insufficientqty').addClass('d-none');
}
}
function shoppingCartAppend() {
@@ -28,19 +28,19 @@ function shoppingCartInit() {
let html = '';
let products = data;
// for(let i=0;i<products.length;i++){
// const {img,name,price,quantity,total} = products[i];
// debugger;
// html += shoppingCartDesktopHTML(products[i]);
// }
if(Object.keys(data).length === 0) {
if (Object.keys(data).length === 0) {
$('.checkoutbtn').addClass('d-none');
$('.emptyShow').removeClass('d-none');
}
setLengthCart();
console.log(products,'products');
console.log(products, 'products');
for (let product in products) {
html += shoppingCartDesktopHTML({ ...products[product], total: products[product].quantity * products[product].price, id: product });
@@ -67,11 +67,11 @@ function shoppingCartInit() {
$(e.target).parents('.mainselectcontainer').find('.inputcartaddmore button').off().click(function (item) {
const val = $(item.target).parent().find('input').val();
debugger;
let totalQty = $(this).parents('.mainselectcontainer').data('qty');
let totalQty = $(this).parents('.mainselectcontainer').data('qty');
if(val<=0 || totalQty< val){
if (val <= 0 || totalQty < val) {
insufficientQtyActions.moreQtyAdd(e);
return;
return;
}
let id = $(item.target).parents('.mainselectcontainer').data('id');
@@ -84,11 +84,11 @@ function shoppingCartInit() {
})
} else {
let totalQty = $(e.target).parents('.mainselectcontainer').data('qty');
let totalQty = $(e.target).parents('.mainselectcontainer').data('qty');
const val = $(e.target).parent().find('input').val();
if(val<=0 || totalQty< val){
if (val <= 0 || totalQty < val) {
insufficientQtyActions.moreQtyAdd(e);
return;
return;
}
let id = $(e.target).parents('.mainselectcontainer').data('id');
updateCartQuantity(id, num);
@@ -99,16 +99,16 @@ function shoppingCartInit() {
} else {
$(element).parents('.mainselectcontainer').find('.inputcartaddmore button').off().click(function (item) {
debugger;
const val = $(item.target).parent().find('input').val()
let totalQty = $(this).parents('.mainselectcontainer').data('qty');
if(val<=0 || totalQty< val){
const val = $(item.target).parent().find('input').val()
let totalQty = $(this).parents('.mainselectcontainer').data('qty');
if (val <= 0 || totalQty < val) {
insufficientQtyActions.moreQtyAdd(item);
return;
return;
}
let id = $(item.target).parents('.mainselectcontainer').data('id');
updateCartQuantity(id, val);
// $(item.target).parents('.mainselectcontainer').find('.inputcartaddmore').addClass('d-none');
@@ -120,24 +120,24 @@ function shoppingCartInit() {
}
});
$('.removeitemcartmodal').off('click').click(function (){
setCartData( DELETE_FILTER );
setLengthCart();
shoppingCartAppend();
$('.removeitemcartmodal').off('click').click(function () {
setCartData(DELETE_FILTER);
setLengthCart();
shoppingCartAppend();
let len = Object.keys(DELETE_FILTER).length
if (!len) {
$('.checkoutbtn').addClass('d-none');
$('.emptyShow').removeClass('d-none');
} else {
$('.checkoutbtn').removeClass('d-none');
$('.emptyShow').addClass('d-none');
}
let len = Object.keys(DELETE_FILTER).length
if(!len){
$('.checkoutbtn').addClass('d-none');
$('.emptyShow').removeClass('d-none');
}else{
$('.checkoutbtn').removeClass('d-none');
$('.emptyShow').addClass('d-none');
}
});
$('.btndeletecart').each(function (i, element) {
@@ -149,44 +149,44 @@ function shoppingCartInit() {
debugger;
const products = data;
const productsFilter = {};
$('#modalremovecart').html(products[cardId].name);
for (let product in products) {
if (product != cardId) productsFilter[product] = products[product];
}
data = productsFilter;
data = productsFilter;
console.log(data);
DELETE_FILTER = data;
DELETE_FILTER = data;
// setCartData(data);
// setLengthCart();
// shoppingCartAppend();
});
});
$('.checkoutbtn').click(async function (e){
$('.checkoutbtn').click(async function (e) {
$('.checkoutbtn').find('span').addClass('d-none');
$('.checkoutbtn').find('div').removeClass('d-none');
const res = await COOKIE_HELPER.validateToken();
if(!res.response){
localStorage.setItem(CART_ADD,true);
if (!res.response) {
localStorage.setItem(CART_ADD, true);
window.location.href = '/login.html';
$('.checkoutbtn').find('span').removeClass('d-none');
$('.checkoutbtn').find('div').addClass('d-none');
return;
return;
}
window.location.href = '/selectdelivery.html';
$('.checkoutbtn').find('span').removeClass('d-none');
$('.checkoutbtn').find('div').addClass('d-none');
});
}
function getQuantityHTML(value,totalQty, id) {
function getQuantityHTML(value, totalQty, id) {
return `<div data-id="${id}" data-qty="${totalQty}" class="mainselectcontainer w-100">
<div class="w-50">
@@ -217,64 +217,70 @@ function shoppingCartInit() {
</div>`
}
function shoppingCartDesktopHTML({ id, img, name, price, description, quantity, total,totalQty,productid,itemid }) {
const [currencySymbol,amt] = getCurrencySymbol(price);
function shoppingCartDesktopHTML({ id, img, name, price, description, quantity, total, totalQty, productid, itemid }) {
const [currencySymbol, amt] = getCurrencySymbol(price);
let tamt = 0;
{
const [currencySymbol, amt] = getCurrencySymbol(total);
tamt = amt;
}
return `
<div class="row bg-white border-bottom py-4 d-flex justify-content-center align-items-center">
<div class="col-md-2 text-center"><img src="${img}" alt="${name}" class="img-fluid"></div>
<div class="col-md-4 ">
<a class="text-decoration-none text-blue fw-600 cursor-pointer" href="productdetails.html?productId=${productid}#itemid=${itemid}">${name}</a>
<small>${description||''}</small>
<span class="badge d-none text-bg-warning">8 Offers ></span>
</div>
<div class="col-md-2">
<p class="text-right m-0"><span>${currencySymbol}</span> ${amt}</p>
</div>
<div class="col-md-2 ">
<div class="d-none d-md-block">
<div class="row bg-white border-bottom py-4 d-flex justify-content-center align-items-center">
<div class="col-md-2 text-center"><img src="https://appassets.bizgaze.app/_files/documents/663/5f6dc634-ffba-47d3-90d2-63004d9d41b6/LAPTOP_DDR5_32GB.jpeg" alt="${name}" class="img-fluid"></div>
<div class="col-md-4 ">
<a class="text-decoration-none text-blue fw-600 cursor-pointer" href="productdetails.html?productId=${productid}#itemid=${itemid}">${name}</a>
<small>${description || ''}</small>
<span class="badge d-none text-bg-warning">8 Offers ></span>
</div>
<div class="col-md-2">
<p class="text-right m-0"><span>${currencySymbol}</span> ${amt}</p>
</div>
<div class="col-md-2 ">
${getQuantityHTML(quantity, totalQty, id)}
</div>
<div class="col-md-2 ">
<div class="d-flex justify-content-between w-100">
<p class="fw-bold m-0">
${currencySymbol}${tamt}</p>
<span class="btndeletecart cursor-pointer fw-500 text-danger" data-cartid="${id}" data-bs-toggle="modal" data-bs-target="#deletecartmodal">x</span>
</div>
</div>
</div>
</div>
<div class="row d-block d-md-none smallcart py-3">
<div class="row bg-white py-5 m-0">
<div class="col-4 text-center">
<img src="https://appassets.bizgaze.app/_files/documents/663/5f6dc634-ffba-47d3-90d2-63004d9d41b6/LAPTOP_DDR5_32GB.jpeg" alt="${name}" class="img-fluid">
</div>
<div class="col-8 position-relative d-flex flex-column gap-1">
<div class="">
<span>
<a class="text-decoration-none text-blue fw-600 cursor-pointer" href="productdetails.html?productId=${productid}#itemid=${itemid}"><span class="">${name}</span></a>
</span>
</div>
<div>
<p class="fw-bold m-0">
${currencySymbol}${tamt}</p>
</div>
<div class="text-truncate d-none">
<small>${description || ''}</small>
</div>
<div class="">
${getQuantityHTML(quantity, totalQty, id)}
</div>
${getQuantityHTML(quantity,totalQty, id)}
</div>
<div class="col-md-2 ">
<div class="d-flex justify-content-between w-100">
<p class="fw-bold m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-currency-rupee" viewBox="0 0 16 16">
<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"/>
</svg>${total}</p>
<span class="btndeletecart cursor-pointer fw-500 text-danger" data-cartid="${id}" data-bs-toggle="modal" data-bs-target="#deletecartmodal">x</span>
</div>
</div>
<div class="warrenty-sec px-3 sec-space-4 d-none">
<div class="row align-items-center border py-2 mx-4">
<div class="col-md-8">
<p class="mb-0 "> <img src="./dist/assets/imgs/Home/Anwi-cart-logo.png" alt="shopping-cart-item-img"> Anwi Extended Warranty 2 Year: Protect your Laptop for another 2 years Learn more </p>
</div>
<div class="col-md-3">
<p class="text-end mb-0"> ₹3,200 (2 year)
</p>
</div>
</div>
<div class="row align-items-center border py-2 mx-4 mt-3">
<div class="col-md-8">
<p class="mb-0"> <img src="./dist/assets/imgs/Home/Anwi-cart-logo-2.png" alt="shopping-cart-item-img"> Anwi Extended Warranty 2 Year: Protect your Laptop for another 2 years Learn more </p>
</div>
<div class="col-md-3">
<p class="text-end mb-0"> ₹2,900 (2 year)
</p>
</div>
</div>
</div>
<span class="btndeletecart cursor-pointer fw-500 text-danger" data-cartid="${id}" data-bs-toggle="modal" data-bs-target="#deletecartmodal">x</span>
</div>
<div class=" bg-white mt-3 rounded py-3 d-block d-sm-none ">
<div class="row">
<div class=""></div>
</div>
<div>
</div>
</div>
</div>
`;
}
}
+47 -27
View File
@@ -1,5 +1,5 @@
const uid = function(){
const uid = function () {
return Date.now().toString(36) + Math.random().toString(36).substr(2);
}
@@ -22,46 +22,66 @@ function shuffleArray(array) {
}
}
function getCurrencySymbol(value=0) {
function debounce(func, delay=500) {
let timeoutId;
return function(...args) {
const context = this;
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
func.apply(context, args);
}, delay);
};
}
function getCurrencySymbol(value = 0) {
let type = 'INR'
if (type) {
const ans = new Intl.NumberFormat('en-IN', { style: 'currency', currency: type }).format(value);;
const res = ans.split(/(\D+)/);
const currencySymbol = res[1];
const amount = res.slice(2,res.length).join('')
const amount = res.slice(2, res.length).join('')
return [currencySymbol,amount]
return [currencySymbol, amount]
} else {
console.log("errrrrrrrrrrrrrrrrrrrrrrrrr",type);
return ['',0];
console.log("errrrrrrrrrrrrrrrrrrrrrrrrr", type);
return ['', 0];
}
}
function toasterHelper(type,message,align='toast-top-center'){
function toasterHelper(type, message, align = 'toast-top-center') {
// toasterOpts()
debugger;
toastr.clear()
toasterOpts(align);
Command: toastr[type](message);
Command: toastr[type](message);
function toasterOpts(align){
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": align,
"preventDuplicates": true,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
function toasterOpts(align) {
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": align,
"preventDuplicates": true,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
}
}
}
}
function containsSpecialCharsHelper(str) {
const specialChars = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
return specialChars.test(str);
}
const isUpperCaseHelper = (string) => /^(?=.*[A-Z])/.test(string);
const isLowerCaseHelper = (string) => /^(?=.*[a-z])/.test(string);
const isNumberContainsHelper = (string) => /\d/.test(string);
+4 -2
View File
@@ -1541,7 +1541,8 @@ display: none;
/* Styles for verification */
.pswd_info {
position: absolute;
top: 100%;
top: -160px;
right: 0;
width: 250px;
padding: 10px;
background: #fefefe;
@@ -1555,13 +1556,14 @@ display: none;
.pswd_info::before {
content: "\25B2";
position: absolute;
top: -12px;
bottom: -12px;
left: 45%;
font-size: 14px;
line-height: 14px;
color: #ddd;
text-shadow: none;
display: block;
transform: rotate(180deg);
}
.pswd_invalid {
+36
View File
@@ -31822,4 +31822,40 @@ input[type=number]::-webkit-outer-spin-button {
#carouselExampleAutoplaying{
padding-top: 3rem;
}
.services.bg-gradient-anwi{
display: none;
}
}
.form-control.is-invalid, .was-validated .form-control:invalid{
background-image: none !important;
}
.authloginLoadingBtn,.otploading {
width: 20px;
height: 20px;
}
.btnForgotback{
cursor: pointer;
}
.smallcart .btndeletecart{
position: absolute;
top: -35%;
right: 0;
font-size: 25px;
}
.stateBoxParent{
position: relative;
}
.stateBox{
height: 170px;
position: absolute;
bottom: -170px;
width: 94%;
z-index: 1;
overflow-y: auto;
}