add changes

This commit is contained in:
2023-05-25 12:33:00 +05:30
parent 60ea1797f1
commit 3c8f09f209
56 changed files with 8654 additions and 0 deletions
+383
View File
@@ -0,0 +1,383 @@
function initLogin() {
let reg_name, reg_email, reg_number, reg_pwd, reg_otp_email;
let loginForm = $("#login_form");
let registerForm = $("#register_form");
// document.querySelector('#register_form .otp-input-group input.press').addEventListener("paste", function (p) {
// var data = p.clipboardData.getData('text');
// var dataLength = data.length;
// for (var i = 0; i < dataLength; i++) {
// var input = document.querySelector("#register_form .otp-input-group input[tabindex='" + (i + 1) + "']");
// input.value = data.charAt(i);
// if (input.value.length >= input.maxLength) {
// var nextInput = document.querySelector("#register_form .otp-input-group input[tabindex='" + (i + 2) + "']");
// if (nextInput) {
// nextInput.focus();
// }
// }
// }
// p.preventDefault();
// });
// document.querySelectorAll('#register_form .otp-input-group input[type="text"]').forEach(function (input) {
// input.addEventListener('keyup', function (e) {
// if (this.value.length >= this.maxLength) {
// if (e.keyCode !== 9 && e.keyCode !== 16) {
// var tabIndex = this.tabIndex + 1;
// document.querySelector("#register_form .otp-input-group input[tabindex='" + this.tabIndex + "']").value = this.value;
// document.querySelector("#register_form .otp-input-group input[tabindex='" + tabIndex + "']").focus();
// }
// } else {
// if (e.keyCode === 8) {
// var tabIndex = this.tabIndex - 1;
// document.querySelector("#register_form .otp-input-group input[tabindex='" + tabIndex + "']").focus();
// }
// }
// });
// });
$('#register_form .otp-input-group input.press').on('paste', function (p) {
var data = p.originalEvent.clipboardData.getData('text');
var dataLength = data.length;
for (var i = 0; i < dataLength; i++) {
var input = $('#register_form .otp-input-group input[tabindex="' + (i + 1) + '"]');
input.val(data.charAt(i));
if (input.val().length >= input.attr('maxlength')) {
var nextInput = $('#register_form .otp-input-group input[tabindex="' + (i + 2) + '"]');
if (nextInput) {
nextInput.focus();
}
}
}
p.preventDefault();
});
$('#register_form .otp-input-group input[type="text"]').on('keyup', function (e) {
if ($(this).val().length >= $(this).attr('maxlength')) {
if (e.keyCode !== 9 && e.keyCode !== 16) {
var tabIndex = parseInt($(this).attr('tabindex')) + 1;
$('#register_form .otp-input-group input[tabindex="' + $(this).attr('tabindex') + '"]').val($(this).val());
$('#register_form .otp-input-group input[tabindex="' + tabIndex + '"]').focus();
}
} else {
if (e.keyCode === 8) {
var tabIndex = parseInt($(this).attr('tabindex')) - 1;
$('#register_form .otp-input-group input[tabindex="' + tabIndex + '"]').focus();
}
}
});
loginForm.find("#User_Email,#User_password").keypress(function (e) {
if (e.which == 13)
document.getElementById("Login_btn").click();
});
$("#Login_btn").click(function () {
loginForm.find(".loader-btn").show();
$(this).hide();
let userEmail = loginForm.find("#User_Email").val();
let userPassword = loginForm.find("#User_password").val();
let emailInput = loginForm.find(".email-login-inputgroup");
let passwordInput = loginForm.find(".password-login-inputgroup");
if (userEmail == "") {
emailInput.find('#User_Email').addClass('is-invalid');
emailInput.find('.form-floating').addClass('is-invalid');
emailInput.find('.invalid-feedback').text('Please enter your email');
loginForm.find(".loader-btn").hide();
$(this).show();
}
if (userPassword == "") {
passwordInput.find('#User_password').addClass('is-invalid');
passwordInput.find('.form-floating').addClass('is-invalid');
loginForm.find(".loader-btn").hide();
$(this).show();
}
else {
emailInput.find('#User_Email').removeClass('is-invalid');
emailInput.find('.form-floating').removeClass('is-invalid');
passwordInput.find('#User_password').removeClass('is-invalid');
passwordInput.find('.form-floating').removeClass('is-invalid');
if (validateEmail(userEmail)) {
let port = SERVERNAME
// let port = "http://localhost:3088";
let url = `${port}/account/getuserbyphoneormail/${userEmail}/${userEmail}`;
getDataStatAxios(url, userEmail);
} else {
loginForm.find(".loader-btn").hide();
$(this).show();
emailInput.find('#User_Email').addClass('is-invalid');
emailInput.find('.form-floating').addClass('is-invalid');
emailInput.find('.invalid-feedback').text('Please enter a valid email');
}
}
});
async function getDataStatAxios(url, userEmail) {
const config = {
url,
method: "get",
};
let response = await axios(config);
if (response.data.result == null) {
$('.error-div').text(response.data.message);
}
else {
let userEmail = $("#User_Email").val();
let userPassword = $("#User_password").val();
const loginPayload = {
username: userEmail,
Password: userPassword,
UnibaseId: "",
RememberMe: false,
};
const res = await postAPIService(
`bizgaze/crm/webapi/crmuserlogin`,
loginPayload
);
debugger;
console.log(res);
if (res.data.message == "200") {
// Command: toastr["success"]("Logged in successfully")
// toasterOpts();
debugger;
COOKIE_HELPER_ACTIONS.setCookie({
token: res.data.result.sessionId,
userid: res.data.result.userId,
...res.data.result
})
// setInitLoginLocal();
// window.localStorage.setItem("Useremail", userEmail);
//window.localStorage.setItem("Userpassword", userPassword);
//window.localStorage.setItem("Isloggedin", true);
const isCartAdded = localStorage.getItem(CART_ADD);
if(isCartAdded){
localStorage.removeItem(CART_ADD);
window.location.href = `/selectdelivery.html`;
return;
}
window.location.href = `/index.html`;
} else {
$("#empt_num").removeClass("d-none text-success").text(res.data.message).addClass('text-danger');
$(".my_avatar").attr("href", "./login.html");
}
}
}
// this function will be triggered on new user registration
async function userRegistration() {
reg_form = $('#register_form');
// reg_name = $("#User_Name").val();
reg_email = reg_form.find("#User_Email").val();
// reg_otp_email = $("#User_otp_Email").val();
// reg_number = $("#user_number").val();
reg_pwd = reg_form.find("#User_password").val();
let userName = reg_email.split("@");
let otpRes = null;
const userRegistratioNPayload = {
organizationtypeid: "2",
organizationid: "0",
contactid: "0",
userid: "0",
username: "0",
users_phonenumber: "0",
password: reg_pwd,
users_emailaddress: "0",
emailaddress: reg_email,
contactname: userName[0],
phonenumber: "0",
branchid: "0",
tenantname: "Anwi Systems",
rolename: "Customer Admin",
currencyid: "0",
customerformuniqueid: "Bizgaze_Platform_Crm_RegisterCRMUser",
};
$('.spinner-border').removeClass('d-none');
const res = await postAPIService(
`bizgaze/crm/webapi/registercrmuser`,
userRegistratioNPayload
);
console.log(res, "register");
$('.spinner-border').addClass('d-none');
if (res.data.message == "User Already Exists!") {
$('.error-div').text('User Already Exists!');
// $(".useralready_exist").removeClass("d-none");
} else {
}
$("#proceed").click(async function () {
let userEnterOtp = "";
let userEmail = registerForm.find("#User_Email").val();
$('.otp-input-group input').each(function () {
let presVal = $(this).val();
userEnterOtp += presVal;
})
console.log(userEnterOtp);
debugger;
const userotppayload = {
email: userEmail,
otpid: res.data.result.OtpId,
userotp: userEnterOtp,
};
$('.spinner-border').removeClass('d-none');
otpRes = await postAPIService(
`bizgaze/crm/webapi/ValidateOtp`,
userotppayload
);
$('.spinner-border').addClass('d-none');
debugger;
console.log(otpRes, "otp");
const verifyotpStatus = otpRes.data.result;
debugger;
if (verifyotpStatus == "Otp verified successfully") {
alert("Account created successfully");
window.location.href = `/myaccount.html`;
} else {
alert("please enter valid otp");
}
});
}
// to validate password on keyup in password input field
function passwordValidate(pswd) {
if (pswd.length < 11) {
$('#chck_length').removeClass('pswd_valid').addClass('pswd_invalid');
} else {
$('#chck_length').removeClass('pswd_invalid').addClass('pswd_valid');
}
// validate uppercase letter
if (pswd.match(/[A-Z]/)) {
$('#chck_capital').removeClass('pswd_invalid').addClass('pswd_valid');
} else {
$('#chck_capital').removeClass('pswd_valid').addClass('pswd_invalid');
}
//validate special letter
if (pswd.match(/[!@#$%^&*]/)) {
$('#chck_special').removeClass('pswd_invalid').addClass('pswd_valid');
} else {
$('#chck_special').removeClass('pswd_valid').addClass('pswd_invalid');
}
let pswdVal = $('#register_form #User_password').val();
let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
if (pswdVal.match(pattern)) {
$('#pswd_info').hide()
}
else {
$('#pswd_info').show()
}
//validate number
if (pswd.match(/\d/)) {
$('#chck_number').removeClass('pswd_invalid').addClass('pswd_valid');
} else {
$('#chck_number').removeClass('pswd_valid').addClass('pswd_invalid');
}
};
//you have to use keyup, because keydown will not catch the currently entered value
$('#register_form #User_password').keyup(function () {
// set password variable
var pswd = $(this).val();
passwordValidate(pswd);
}).focus(function () {
let pswdVal = $('#register_form #User_password').val();
let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
if (pswdVal.match(pattern)) {
$('#pswd_info').hide()
}
else {
$('#pswd_info').show()
}
}).blur(function () {
$('#pswd_info').hide();
});
// function to validate user entered email
function validateEmail(userEmail) {
var pattern =
/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
return $.trim(userEmail).match(pattern) ? true : false;
}
// function to validate user entered password
function validatepassword(userPassword) {
var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
return $.trim(userPassword).match(pattern) ? true : false;
}
registerForm.find("#User_Email,#User_password").keypress(function (e) {
if (e.which == 13)
document.getElementById("register_btn").click();
});
// this will be triggered on clicking continue in signup form
$("#register_btn").click(function () {
registerForm.find(".loader-btn").show();
$(this).hide();
let userEmail = registerForm.find("#User_Email").val();
let userPassword = registerForm.find("#User_password").val();
let emailInput = registerForm.find(".email-login-inputgroup");
let passwordInput = registerForm.find(".password-login-inputgroup");
if (userEmail == "") {
emailInput.find('#User_Email').addClass('is-invalid');
emailInput.find('.form-floating').addClass('is-invalid');
emailInput.find('.invalid-feedback').text('Please enter your email');
registerForm.find(".loader-btn").hide();
$(this).show();
}
if (userPassword == "") {
passwordInput.find('#User_password').addClass('is-invalid');
passwordInput.find('.form-floating').addClass('is-invalid');
registerForm.find(".loader-btn").hide();
$(this).show();
}
else {
emailInput.find('#User_Email').removeClass('is-invalid');
emailInput.find('.form-floating').removeClass('is-invalid');
passwordInput.find('#User_password').removeClass('is-invalid');
passwordInput.find('.form-floating').removeClass('is-invalid');
if (validateEmail(userEmail)) {
$('#register_form .email-password-group').hide();
$('#register_form .otp-input-group').show();
$('#register_form .otp-input-group .otp-sent-email').text(userEmail);
userRegistration();
} else {
emailInput.find('#User_Email').addClass('is-invalid');
emailInput.find('.form-floating').addClass('is-invalid');
emailInput.find('.invalid-feedback').text('Please enter a valid email');
registerForm.find(".loader-btn").hide();
$(this).show();
}
}
});
$('#forgotPassword').click(function () {
$('.login-email-password-div').hide();
$('.login-forgot-passsword-div').show();
})
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"
}
}
}
initLogin();
+780
View File
@@ -0,0 +1,780 @@
function initLogin() {
// alert('as')
// Command: toastr["success"]("Logged in successfully")
// Command: toastr["success"]("My name is Inigo Montoya. You killed my father. Prepare to die!")
// toasterOpts();
let reg_name, reg_email, reg_number, reg_pwd, reg_otp_email;
let loginForm = $("#login_form");
let registerForm = $("#register_form");
$("#register_form .otp-input-group input.press").on("paste", function (p) {
var data = p.originalEvent.clipboardData.getData("text");
var dataLength = data.length;
for (var i = 0; i < dataLength; i++) {
var input = $(
'#register_form .otp-input-group input[tabindex="' + (i + 1) + '"]'
);
input.val(data.charAt(i));
if (input.val().length >= input.attr("maxlength")) {
var nextInput = $(
'#register_form .otp-input-group input[tabindex="' + (i + 2) + '"]'
);
if (nextInput) {
nextInput.focus();
}
}
}
p.preventDefault();
});
$('#register_form .otp-input-group input[type="text"]').on(
"keyup",
function (e) {
if ($(this).val().length >= $(this).attr("maxlength")) {
if (e.keyCode !== 9 && e.keyCode !== 16) {
var tabIndex = parseInt($(this).attr("tabindex")) + 1;
$(
'#register_form .otp-input-group input[tabindex="' +
$(this).attr("tabindex") +
'"]'
).val($(this).val());
$(
'#register_form .otp-input-group input[tabindex="' + tabIndex + '"]'
).focus();
}
} else {
if (e.keyCode === 8) {
var tabIndex = parseInt($(this).attr("tabindex")) - 1;
$(
'#register_form .otp-input-group input[tabindex="' + tabIndex + '"]'
).focus();
}
}
}
);
loginForm.find("#User_Email,#User_password").keypress(function (e) {
if (e.which == 13) $("#Login_btn").click();
});
$("#Login_btn").click(function () {
$('.error_msg').hide();
// loginForm.find(".loader-btn").show();
let userEmail = loginForm.find("#User_Email").val();
let userPassword = loginForm.find("#User_password").val();
let emailInput = loginForm.find(".email-login-inputgroup");
let passwordInput = loginForm.find(".password-login-inputgroup");
if (userEmail == "") {
emailInput.find("#User_Email").addClass("is-invalid");
emailInput.find(".form-floating").addClass("is-invalid");
emailInput.find(".invalid-feedback").text("Please enter your email");
loginForm.find(".loader-btn").hide();
$(this).show();
}
if (userPassword == "") {
passwordInput.find("#User_password").addClass("is-invalid");
passwordInput.find(".form-floating").addClass("is-invalid");
loginForm.find(".loader-btn").hide();
$(this).show();
} else {
emailInput.find("#User_Email").removeClass("is-invalid");
emailInput.find(".form-floating").removeClass("is-invalid");
passwordInput.find("#User_password").removeClass("is-invalid");
passwordInput.find(".form-floating").removeClass("is-invalid");
if (validateEmail(userEmail)) {
let port = SERVERNAME
// let port = "http://localhost:3088";
let url = `${port}/account/getuserbyphoneormail/${userEmail}/${userEmail}`;
getDataStatAxios(url, userEmail);
} else {
loginForm.find(".loader-btn").hide();
$(this).show();
emailInput.find("#User_Email").addClass("is-invalid");
emailInput.find(".form-floating").addClass("is-invalid");
emailInput.find(".invalid-feedback").text("Please enter a valid email");
}
}
});
async function getDataStatAxios(url, userEmail) {
const config = {
url,
method: "get",
};
let response = await axios(config);
if (response.data.result == null) {
$('.error_msg').show();
$('.error_msg .error_msg_res').html(`User doesn't exists with the email, <a href="#" class="alert-link register_sectionbtn" id="register_sectionbtn">Sign Up </a>`);
$(".register_sectionbtn").click(function(){
$(".login_section").css("display","none");
$(".register_section").css("display","block");
$(".login_section").find("#User_Email").removeClass("is-invalid");
$(".login_section").find(".form-floating").removeClass("is-invalid");
$(".login_section").find("#User_password").removeClass("is-invalid");
$(".login_section").find(".form-floating").removeClass("is-invalid");
$('.error_msg').hide();
});
// toasterOpts();
// Command: toastr["error"]("Please enter Valid email / password");
} else {
let userEmail = $("#User_Email").val();
let userPassword = $("#User_password").val();
const loginPayload = {
username: userEmail,
Password: userPassword,
UnibaseId: "",
RememberMe: false,
};
$("#Login_btn").hide();
$(".loader-btn").show();
const res = await postAPIService(
`bizgaze/crm/webapi/crmuserlogin`,
loginPayload
);
debugger;
console.log(res);
$(".loader-btn").hide();
$("#Login_btn").show();
if (res.data.message == "200") {
debugger;
// Command: toastr["success"]("Logged in successfully")
// toasterOpts();
COOKIE_HELPER_ACTIONS.setCookie({
token: res.data.result.sessionId,
userid: res.data.result.userId,
...res.data.result
});
// setInitLoginLocal();
window.localStorage.setItem("Useremail", userEmail);
//window.localStorage.setItem("Userpassword", userPassword);
window.localStorage.setItem("Isloggedintoaster", true);
window.localStorage.setItem("Isloggedin", true);
const isCartAdded = localStorage.getItem(CART_ADD);
if(isCartAdded){
localStorage.removeItem(CART_ADD);
window.location.href = `/selectdelivery.html`;
return;
}
window.location.href = `./index.html`;
} else {
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message + ' <a class="validate_mail text-danger"><b>Validate Email</b></a>');
// toasterOpts();
// Command: toastr["error"]()
/*Email validation*/
$('.validate_mail').click(function(){
$(".login_section").hide();
$(".email-validate-div").show();
$('.error_msg').hide();
})
}
}
}
// this function will be triggered on new user registration
async function userRegistration() {
reg_form = $("#register_form");
// reg_name = $("#User_Name").val();
reg_email = reg_form.find("#User_Email").val();
// reg_otp_email = $("#User_otp_Email").val();
// reg_number = $("#user_number").val();
reg_pwd = reg_form.find("#User_password").val();
let userName = reg_email.split("@");
let otpRes = null;
const userRegistratioNPayload = {
organizationtypeid: "2",
organizationid: "0",
contactid: "0",
userid: "0",
username: "0",
users_phonenumber: "0",
password: reg_pwd,
users_emailaddress: "0",
emailaddress: reg_email,
contactname: userName[0],
phonenumber: "0",
branchid: "0",
tenantname: "Anwi Systems",
rolename: "Customer Admin",
currencyid: "0",
customerformuniqueid: "Bizgaze_Platform_Crm_RegisterCRMUser",
};
debugger;
$('#register_btn').hide()
$(".loader-btn").show();
debugger;
const res = await postAPIService(
`bizgaze/crm/webapi/registercrmuser`,
userRegistratioNPayload
);
console.log(res, "register");
$(".loader-btn").hide();
$('#register_btn').show()
if (res.data.code == "404" ) {
// toasterOpts();
// Command: toastr["error"](res.data.message)
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message);
return;
}
else {
$("#register_form .email-password-group").hide();
$("#register_form .register_otp.otp-input-group").show();
}
$("#proceed").click(async function () {
let userEnterOtp = "";
let userEmail = registerForm.find("#User_Email").val();
$(".otp-input-group input").each(function () {
let presVal = $(this).val();
userEnterOtp += presVal;
});
console.log(userEnterOtp);
debugger;
const userotppayload = {
email: userEmail,
otpid: res.data.result.OtpId,
userotp: userEnterOtp,
};
$(".loader-btn").show();
$('#proceed').hide()
otpRes = await postAPIService(
`bizgaze/crm/webapi/ValidateOtp`,
userotppayload
);
$(".loader-btn").hide();
$('#proceed').show()
debugger;
console.log(otpRes, "otp");
const verifyotpStatus = otpRes.data.result;
if (verifyotpStatus == "Otp verified successfully") {
const loginPayload = {
username: reg_email,
Password: reg_pwd,
UnibaseId: "",
RememberMe: false,
};
const res = await postAPIService(
`bizgaze/crm/webapi/crmuserlogin`,
loginPayload
);
if (res.data.message == "200") {
debugger;
// Command: toastr["success"]("Logged in successfully")
// toasterOpts();
COOKIE_HELPER_ACTIONS.setCookie({
token: res.data.result.sessionId,
userid: res.data.result.userId,
...res.data.result
});
// setInitLoginLocal();
window.localStorage.setItem("Useremail", userEmail);
//window.localStorage.setItem("Userpassword", userPassword);
window.localStorage.setItem("isaccountCreated", true);
const isCartAdded = localStorage.getItem(CART_ADD);
if(isCartAdded){
localStorage.removeItem(CART_ADD);
window.location.href = `/selectdelivery.html`;
return;
}
window.location.href = `./index.html`;
} else {
// toasterOpts();
// Command: toastr["error"](res.data.message)
$('.error_msg').show();
$('.error_msg .error_msg_res').html(res.data.message);
}
} else {
// toasterOpts();
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
});
}
// to validate password on keyup in password input field
function passwordValidate(pswd) {
if (pswd.length < 8) {
$("#chck_length").removeClass("pswd_valid").addClass("pswd_invalid");
} else {
$("#chck_length").removeClass("pswd_invalid").addClass("pswd_valid");
}
// validate uppercase letter
if (pswd.match(/[A-Z]/)) {
$("#chck_capital").removeClass("pswd_invalid").addClass("pswd_valid");
} else {
$("#chck_capital").removeClass("pswd_valid").addClass("pswd_invalid");
}
//validate special letter
if (pswd.match(/[!@#$%^&*]/)) {
$("#chck_special").removeClass("pswd_invalid").addClass("pswd_valid");
} else {
$("#chck_special").removeClass("pswd_valid").addClass("pswd_invalid");
}
let pswdVal = $("#register_form #User_password").val();
let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/;
if (pswdVal.match(pattern)) {
$(".pswd_info").hide();
} else {
$(".pswd_info").show();
}
//validate number
if (pswd.match(/\d/)) {
$("#chck_number").removeClass("pswd_invalid").addClass("pswd_valid");
} else {
$("#chck_number").removeClass("pswd_valid").addClass("pswd_invalid");
}
}
//you have to use keyup, because keydown will not catch the currently entered value
$("#register_form #User_password")
.keyup(function () {
// set password variable
var pswd = $(this).val();
passwordValidate(pswd);
})
.focus(function () {
let pswdVal = $("#register_form #User_password").val();
let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{11,}$/;
if (pswdVal.match(pattern)) {
$(".pswd_info").hide();
} else {
$(".pswd_info").show();
}
})
.blur(function () {
$(".pswd_info").hide();
});
// function to validate user entered email
function validateEmail(userEmail) {
var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
// return $.trim(userEmail).test(pattern) ? true : false;
return pattern.test(userEmail) ? true : false;
}
// function to validate user entered password
function validatepassword(userPassword) {
var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
// return $.trim(userPassword).test(pattern) ? true : false;
return pattern.test(userPassword) ? true : false;
}
registerForm.find("#User_Email,#User_password").keypress(function (e) {
if (e.which == 13) $("#register_btn").click();
});
// this will be triggered on clicking continue in signup form
$("#register_btn").click(function () {
$('.error_msg').hide();
registerForm.find(".loader-btn").show();
$(this).hide();
let userEmail = registerForm.find("#User_Email").val();
let userPassword = registerForm.find("#User_password").val();
let emailInput = registerForm.find(".email-login-inputgroup");
let passwordInput = registerForm.find(".password-login-inputgroup");
if (userEmail == "") {
emailInput.find("#User_Email").addClass("is-invalid");
emailInput.find(".form-floating").addClass("is-invalid");
emailInput.find(".invalid-feedback").text("Please enter your email");
registerForm.find(".loader-btn").hide();
$(this).show();
}
if (userPassword == "") {
passwordInput.find("#User_password").addClass("is-invalid");
passwordInput.find(".form-floating").addClass("is-invalid");
registerForm.find(".loader-btn").hide();
$(this).show();
} else {
emailInput.find("#User_Email").removeClass("is-invalid");
emailInput.find(".form-floating").removeClass("is-invalid");
passwordInput.find("#User_password").removeClass("is-invalid");
passwordInput.find(".form-floating").removeClass("is-invalid");
let Email_valid = validateEmail(userEmail);
let Pwd_valid = validatepassword(userPassword);
if (Email_valid === true && Pwd_valid === true) {
userRegistration();
$("#register_form .otp-input-group .otp-sent-email").text(userEmail);
} else if(Email_valid === false) {
emailInput.find("#User_Email").addClass("is-invalid");
emailInput.find(".form-floating").addClass("is-invalid");
emailInput.find(".invalid-feedback").text("Please enter a valid email");
registerForm.find(".loader-btn").hide();
$(this).show();
}else if(Pwd_valid === false){
passwordInput.find("#User_password").addClass("is-invalid");
passwordInput.find(".form-floating").addClass("is-invalid");
passwordInput.find(".invalid-feedback").text("Please check the password!");
registerForm.find(".loader-btn").hide();
$(this).show();
}
}
});
$(".pswd_eye").click(function(){
let eyeClass = $(this).find('svg').hasClass("fa-eye-slash");
if(eyeClass == true){
$(this).find('svg').removeClass("fa-eye-slash");
$(this).find('svg').addClass("fa-eye");
$(this).siblings('input').attr('type','password')
}else{
$(this).find('svg').removeClass("fa-eye");
$(this).find('svg').addClass("fa-eye-slash");
$(this).siblings('input').attr('type','text')
}
})
$("#forgotPassword").click(function () {
$(".login-email-password-div").hide();
$(".login-forgot-password-div").show();
});
$("#forgot_Password_Back").click(function () {
$(".login-forgot-password-div").hide();
$(".login-email-password-div").show();
});
$("#forgot_password_submit").click(async function () {
let forgot_email = $("#forgot_User_Email").val();
if(forgot_email == ''){
$('#forgot_User_Email').addClass('is-invalid')
$('#forgot_User_Email').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
return
}
else{
debugger;
let port = SERVERNAME
// let port = "http://localhost:3088";
let url = `${port}/account/getuserbyphoneormail/${forgot_email}/${forgot_email}`;
const config = {
url,
method: "get",
};
$(".loader-btn").show();
$('#forgot_password_submit').hide()
let response = await axios(config);
debugger;
console.log(response);
$(".loader-btn").hide();
$('#forgot_password_submit').show()
if (response.data.result != null) {
debugger;
console.log(response.data);
const forgotpassPayload = {
firstname: "",
lastname: "",
contactnumber: "",
email: "",
tenantname: "",
contactoremail: response.data.result.email,
IsSignup: false,
IsRegisterUser: false,
IsForgotPswd: true,
UnibaseId: response.data.result.userName,
OtpId: 0,
UserOtp: "",
};
$('#forgot_password_submit').hide()
$(".loader-btn").show();
const forgetpassRes = await postAPIService(
`account/sendotp`,
forgotpassPayload
);
$(".loader-btn").hide();
console.log(forgetpassRes);
$(".email-validation").hide();
$('.user_email').html(forgot_email)
$(".otp-validation .otp-input-group").show();
$(".otp-validation .otp-input-group").on("paste", function (p) {
let data = p.originalEvent.clipboardData.getData("text");
let dataLength = data.length;
for (let i = 0; i < dataLength; i++) {
let input = $(
'.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
);
input.val(data.charAt(i));
if (input.val().length >= input.attr("maxlength")) {
let nextInput = $(
'.otp-validation .otp-input-group input[tabindex="' +
(i + 2) +
'"]'
);
if (nextInput) {
nextInput.focus();
}
}
}
p.preventDefault();
});
$('.otp-validation .otp-input-group input[type="text"]').on(
"keyup",
function (e) {
if ($(this).val().length >= $(this).attr("maxlength")) {
if (e.keyCode !== 9 && e.keyCode !== 16) {
let tabIndex = parseInt($(this).attr("tabindex")) + 1;
$(
'.otp-validation .otp-input-group input[tabindex="' +
$(this).attr("tabindex") +
'"]'
).val($(this).val());
$(
'.otp-validation .otp-input-group input[tabindex="' +
tabIndex +
'"]'
).focus();
}
} else {
if (e.keyCode === 8) {
let tabIndex = parseInt($(this).attr("tabindex")) - 1;
$(
'.otp-validation .otp-input-group input[tabindex="' +
tabIndex +
'"]'
).focus();
}
}
}
);
$("#Forgot_pass_proceed").click(async function () {
debugger;
let userotp='';
$(".otp-validation .otp-input-group input").each(function () {
let presVal = $(this).val();
userotp += presVal;
});
console.log(userotp);
const validateForgotpass = {
email: forgot_email,
otpid: forgetpassRes.data,
userotp: userotp,
};
$('#Forgot_pass_proceed').hide()
$(".loader-btn").show();
const forgetpassResotp = await postAPIService(
`hyperfusion/validateotp`,
validateForgotpass
);
$(".loader-btn").hide();
$('#Forgot_pass_proceed').show()
console.log(forgetpassResotp);
const Resotp = forgetpassResotp.data.result;
if (Resotp == "Otp verified successfully") {
$(".login-forgot-password-details-div").show();
$(".otp-validation .otp-input-group").hide();
} else {
// toasterOpts()
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
});
$("#forgot_password_details_submit").click(async function () {
debugger;
let pswdone =$("#forgot-password-input-one").val();
let pswdtwo =$("#forgot-password-input-two").val();
if(pswdone == pswdtwo) {
const forgotpassPayload = {
username: response.data.result.userName,
password: pswdtwo,
};
$("#forgot_password_details_submit").hide();
$(".loader-btn").show();
const forgetpassRes = await postAPIService(
`account/UpdatePassword`,
forgotpassPayload
);
console.log(forgetpassRes);
$(".loader-btn").hide();
$("#forgot_password_details_submit").show();
window.localStorage.setItem('Ispasswordupdate',true)
window.location.href = `./myaccount.html`;
}else {
$("#forgot-password-input-one").addClass('is-invalid');
$("#forgot-password-input-two").addClass('is-invalid')
$('.password_display').text('Passwords are not matched !').addClass('text-danger')
}
});
}
else{
$('#forgot_User_Email').addClass('is-invalid');
$('#forgot_User_Email').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
}
}
});
$(".user_pass")
.keyup(function () {
// set password variable
var pswd = $(this).val();
passwordValidate(pswd);
$('.pswd_info').hide();
$(this).parent().siblings('.pswd_info').show();
})
.focus(function () {
let pswdVal = $(this).val();
let pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/;
if (pswdVal.match(pattern)) {
$(this).parent().siblings('.pswd_info').hide();
} else {
$(this).parent().siblings('.pswd_info').show();
}
})
.blur(function () {
$(this).parent().siblings('.pswd_info').hide();
});
function toasterOpts(){
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": "toast-top-center",
"preventDuplicates": true,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
}
}
$("#email_validate_submit").click(async function () {
let vaidate_otp;
let validate_email = $("#email_validation_input").val();
if(validate_email == ''){
$('#email_validation_input').addClass('is-invalid')
$('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
return
}
else{
debugger;
let port = SERVERNAME;
// let port = "http://localhost:3088";
let url = `${port}/account/getuserbyphoneormail/${validate_email}/${validate_email}`;
const config = {
url,
method: "get",
};
$(".loader-btn").show();
$('#email_validate_submit').hide()
let response = await axios(config);
debugger;
console.log(response);
$(".loader-btn").hide();
$('#email_validate_submit').show()
if (response.data.result != null) {
debugger;
console.log(response.data);
const forgotpassPayload = {
firstname: "",
lastname: "",
contactnumber: "",
email: "",
tenantname: "",
contactoremail: response.data.result.email,
IsSignup: false,
IsRegisterUser: false,
IsForgotPswd: true,
UnibaseId: response.data.result.userName,
OtpId: 0,
UserOtp: "",
};
$('#email_validate_submit').hide()
$(".loader-btn").show();
const validate_email_res = await postAPIService(
`account/sendotp`,
forgotpassPayload
);
$(".loader-btn").hide();
vaidate_otp = validate_email_res.data;
console.log(validate_email_res);
$(".email-validation").hide();
$('.user_email').html(validate_email)
$(".otp-validation .otp-input-group").show();
$(".otp-validation .otp-input-group").on("paste", function (p) {
let data = p.originalEvent.clipboardData.getData("text");
let dataLength = data.length;
for (let i = 0; i < dataLength; i++) {
let input = $(
'.otp-validation .otp-input-group input[tabindex="' + (i + 1) + '"]'
);
input.val(data.charAt(i));
if (input.val().length >= input.attr("maxlength")) {
let nextInput = $(
'.otp-validation .otp-input-group input[tabindex="' +
(i + 2) +
'"]'
);
if (nextInput) {
nextInput.focus();
}
}
}
p.preventDefault();
});
}
else{
$('#email_validation_input').addClass('is-invalid');
$('#email_validation_input').after(`<div class="invalid-feedback">Please enter Valid email</div>`);
}
}
$("#email_validate_proceed").click(async function () {
debugger;
let userotp='';
let validate_email = $("#email_validation_input").val();
$(".email-validate-div .otp-validation .otp-input-group input").each(function () {
let presVal = $(this).val();
userotp += presVal;
});
if(userotp.length == 6){
const validateForgotpass = {
email: validate_email,
otpid: vaidate_otp,
userotp: userotp,
};
$('#email_validate_proceed').hide()
$(".loader-btn").show();
const validate_email_resopt = await postAPIService(
`hyperfusion/validateotp`,
validateForgotpass
);
$(".loader-btn").hide();
$('#email_validate_proceed').show()
const Resotp = validate_email_resopt.data.result;
if (Resotp == "Otp verified successfully") {
$(".login_section").show();
$(".otp-validation .otp-input-group").hide();
$("#email_validate_back").hide();
$('.error_msg').hide();
} else {
// toasterOpts()
// Command: toastr["error"]("Please enter Valid OTP");
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter Valid OTP");
}
}
else{
$('.error_msg').show();
$('.error_msg .error_msg_res').html("Please enter OTP");
}
});
});
initLogin();
+110
View File
@@ -0,0 +1,110 @@
class AccordionItem extends HTMLElement {
static get observedAttributes() {
return ['title'];
}
#title = '';
#collapsed = true;
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
this.update();
this.shadowRoot.addEventListener('click', this.toggle.bind(this));
}
attributeChangedCallback(name, oldValue, newValue) {
if (name === 'title') {
this.#title = newValue;
}
this.update();
}
toggle() {
this.#collapsed = !this.#collapsed;
this.update();
// Dispatch a custom event to notify the parent AccordionElement
const event = new CustomEvent('accordion-item-toggle', {
bubbles: true,
detail: {
collapsed: this.#collapsed,
item: this,
},
});
this.dispatchEvent(event);
}
update() {
this.shadowRoot.innerHTML = `
<style>
.accordion-item {
}
.accordion-title {
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
padding: 0.5rem;
background-color: white;
}
.accordion-title:hover {
background-color: white;
}
.accordion-title::after {
content: '${this.#collapsed ? '+' : ''}';
font-size: 1rem;
font-weight: bold;
color: #777;
margin-left: 0.5rem;
}
.accordion-content {
padding: 0.5rem;
display: ${this.#collapsed ? 'none' : 'block'};
}
</style>
<div class="accordion-item">
<div class="accordion-title">${this.#title}</div>
<div class="accordion-content">
<slot></slot>
</div>
</div>
`;
}
}
class AccordionElement extends HTMLElement {
#activeItem = null;
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = '<slot></slot>';
this.addEventListener('accordion-item-toggle', this.handleItemToggle.bind(this));
}
handleItemToggle(event) {
const { collapsed, item } = event.detail;
// If the active item is different from the toggled item, collapse the active item
if (this.#activeItem && this.#activeItem !== item && !collapsed) {
this.#activeItem.toggle();
}
// Update the active item
if (!collapsed) {
this.#activeItem = item;
} else if (this.#activeItem === item) {
this.#activeItem = null;
}
}
}
customElements.define('accordion-item', AccordionItem);
customElements.define('accordion-element', AccordionElement);
+79
View File
@@ -0,0 +1,79 @@
function supportTicketMain() {
// https://qa.anwisystems.com/apis/v4/anwisystems/integrations/products/getticket/contactid/{contactid}
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
let { userId } = cookieRes;
init()
function init() {
getTickets();
};
async function getTickets() {
let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/products/getticket/contactid/${userId}`);
if (res.isError) {
toasterHelper("error", res.errorMsg);
return;
}
res = JSON.parse(res.response.result);
if (!res.length) {
$('.nosupportticket').removeClass('d-none');
$('.headersupportlist').addClass('d-none');
return;
} else {
$('.nosupportticket').addClass('d-none');
$('.headersupportlist').removeClass('d-none');
}
let supportHTMLTicketList = '';
debugger
for (let i = 0; i < res.length; i++) {
supportHTMLTicketList += getTicketHTML(res[i]);
}
$('.support-list-container').html(supportHTMLTicketList);
console.log(res, "support");
}
function getTicketHTML(ticket) {
let color = '';
let prioityName = ticket[`Priority Name`];
if (prioityName.toLowerCase() === 'low') {
color = 'info';
} else if (prioityName.toLowerCase() === 'high') {
color = 'danger';
} else {
color = 'warning';
}
//<a href="#" data-bs-toggle="modal" data-bs-target="#supportmodalticket" class="supportlistview d-block
return `<a href="supportticket.html?ticketno=${ticket[`ticketno`]}" class="supportlistview d-block bg-gradient-anwi-outline btn-sm btn "><div class="p-2"><div class="card p-2">
<div class="row ">
<div class="col-sm-3">
${ticket[`Raised Date`]}
</div>
<div class="col-sm-3">
${ticket[`ticketno`]}
</div>
<div class="col-sm-3 text-center">
${ticket[`Stage Name`]}
</div>
<div class="col-sm-3 text-center">
<span class="badge badge-${color} text-bg-${color}">${prioityName}</span>
</div>
</div>
</div></div> </a>`;
}
}
+453
View File
@@ -0,0 +1,453 @@
navINIT();
function navINIT() {
if(!window.location.href.includes('orderconfirmation')&&!window.location.href.includes('/w/')){
loadCart();
}
function loadHelper(src = './dist/js/utils/helpers.js'){
if ($(`script[src="${src}"]`).length > 0) {
return new Promise((resolve) => resolve());
}
return new Promise(function (resolve, reject) {
var s;
s = document.createElement('script');
s.src = src;
s.onload = resolve;
s.onerror = reject;
document.head.appendChild(s);
});
}
async function loadCart(){
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;
}
}
}
setLengthCart();
//console.log("hello");
}
let URLNAMENAV = window.location.href;
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">
<div class="header-bottom sticky-bar">
<div class="container">
<div class="header-bottom-flex">
<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">
</a>
</div>
<div class="main-menu menu-lh-1 main-menu-padding-1">
<nav>
<ul class="mb-0 p-0">
<li class="hover_tab_1"><a href="./storageproducts.html" class="satoshi_font">STORAGE</a>
<ul class="py-3 px-3 rounded-bottom shadow">
<li class="d-flex">
<ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
<li class="nav-item">
<a class="nav-link active text-dark" data-bs-toggle="tab" href="#ora3">ORA 3</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" data-bs-toggle="tab" href="#ora4">ORA 4</a>
</li>
</ul>
<ul class="nav w-500">
<li>
<div class="tab-content">
<div id="ora3" class="container tab-pane active">
<div class="row">
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 512GB</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 1TB</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora3 M.2 NVMe 2TB</p>
</div>
</div>
</div>
</div>
<div id="ora4" class="container tab-pane fade">
<div class="row">
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora4 M.2 NVMe 512GB</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora4 M.2 NVMe 1TB</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora3_ram.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora4 M.2 NVMe 2TB</p>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li class="hover_tab_2"><a href="./ramproducts.html" class="satoshi_font">MEMORY</a>
<ul class="py-3 px-3 rounded-bottom shadow">
<li class="d-flex">
<ul class="nav nav-pills flex-column w-200 border-end" id="experienceTab" role="tablist">
<li class="nav-item">
<a class="nav-link active text-dark" data-bs-toggle="tab" href="#laptop">Laptop</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" data-bs-toggle="tab" href="#desktop">Desktop</a>
</li>
</ul>
<ul class="nav w-500">
<li>
<div class="tab-content">
<div id="laptop" class="container tab-pane active">
<div class="row">
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr4_laptop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 8GB DDR5</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 16GB DDR5</p>
</div>
</div>
<div class="col-4 ">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr5_laptop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 32GB DDR5</p>
</div>
</div>
</div>
</div>
<div id="desktop" class="container tab-pane fade">
<div class="row">
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 8GB DDR4</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 16GB DDR4</p>
</div>
</div>
<div class="col-4">
<div class="bg-gray-4 rounded-3 cursor-pointer">
<img src="./dist/assets/imgs/Navbar/ora_ddr4_desktop.png" alt="ora img" class=""/>
<p class="fs-7 fw-600 mb-0 text-a-color text-center pb-1">Ora 32GB DDR4</p>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="./support.html" class="satoshi_font">SUPPORT</a></li>
<li><a href="./press.html" class="satoshi_font">PRESS</a></li>
<li><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
<li><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
<li class="d-none"><a href="#" class="satoshi_font product_data" item_id="106633220000002">ACCESSORIES</a></li>
</ul>
</nav>
</div>
</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">
<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">
<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>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="header-small-device header-small-ptb sticky-bar py-md-2 py-2 bg-white">
<div class="container-fluid px-4">
<div class="row align-items-center">
<div class="col-6 header-action-wrap">
<div class="d-flex">
<div class="same-style header-info">
<button class="mobile-menu-button-active">
<span class="info-width-1"></span>
<span class="info-width-2"></span>
<span class="info-width-3"></span>
</button>
</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">
</a>
</div>
</div>
</div>
<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>
</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>
<span class="position-absolute cartnumcount d-none" style="top:-27%;right:-80%">0</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Mobile menu start -->
<div class="mobile-menu-active clickalbe-sidebar-wrapper-style-1">
<div class="clickalbe-sidebar-wrap">
<div class="row pb-2 border-bottom">
<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">
</a>
</div>
</div>
<div class="col-6 text-end pe-4">
<a class="sidebar-close"><i class="fa-solid fa-xmark"></i></a>
</div>
</div>
<div class="mobile-menu-content-area sidebar-content-100-percent pt-3">
<div class="mobile-search d-none">
<form class="search-form" action="#">
<input type="text" placeholder="Search here…" class="satoshi_font">
<button class="button-search"><i class="fa-solid fa-magnifying-glass"></i></button>
</form>
</div>
<div class="clickable-mainmenu-wrap clickable-mainmenu-style1">
<nav>
<ul class="pl-0">
<li class=""><a href="./ramproducts.html" class="satoshi_font">RAM</a></li>
<li class=""><a href="./storageproducts.html" class="satoshi_font">STORAGE</a></li>
<li class=""><a href="./support.html" class="satoshi_font" >SUPPORT</a></li>
<li class=""><a href="./press.html" class="satoshi_font">PRESS</a></li>
<li class=""><a href="./index1.html" class="satoshi_font">COMING SOON</a></li>
<li class=""><a href="./contact.html" class="satoshi_font">CONTACT</a></li>
</ul>
</nav>
</div>
<div class="mobile-curr-lang-wrap d-none">
<div class="single-mobile-curr-lang">
<a class="mobile-language-active" href="#">Language <i class="icofont-simple-down"></i></a>
<div class="lang-curr-dropdown lang-dropdown-active">
<ul>
<li><a href="#">English</a></li>
<li><a href="#">Spanish</a></li>
<li><a href="#">Hindi </a></li>
</ul>
</div>
</div>
</div>
<div class="aside-contact-info d-none">
<ul>
<li><i class="icofont-clock-time"></i>Monday - Friday: 9:00 - 19:00</li>
<li><i class="icofont-envelope"></i>Info@example.com</li>
<li><i class="icofont-stock-mobile"></i>(+55) 254. 254. 254</li>
<li><i class="icofont-home"></i>Helios Tower 75 Tam Trinh Hoang - Ha Noi - Viet Nam</li>
</ul>
</div>
</div>
</div>
</div>`;
$("#navbar-head").html(nav_html);
let width = $(window).width();
$(".menu-negative-mrg2,.menu-negative-mrg3,.menu-negative-mrg4").css("width", width);
let ele_page = $("body").hasClass("product_pg");
if (ele_page == true) {
$(".header-area").removeClass("bg-white");
$(".main-menu").find("nav ul li a").addClass("text-white");
$(".header-bottom.sticky-bar").removeClass("sticky-bar");
let src = `../dist/assets/imgs/anwi-logo-2.png`;
$(".logo-menu-wrap").find("a img").attr("src", src);
$(".main-body").find("iframe").attr("width", width);
if (width <= 575 && width >= 390) {
$(".main-body").find("iframe").attr({
width: width,
height: 236,
})
} else if (width <= 390 && width >= 270) {
$(".main-body").find("iframe").attr({
width: width,
height: 210,
});
} else if (width <= 998 && width > 575) {
$(".main-body").find("iframe").attr({
width: width,
height: 530,
});
} else if (width <= 2720 && width > 1920) {
$(".main-body").find("iframe").attr({
width: width,
height: 1440,
});
} else {
$(".main-body").find("iframe").attr({
width: width,
height: 860,
});
}
}
$("a.ram_data").click(function () {
let item_id = $(this).attr("accessories_id");
let loc_path = '/products.html'
if (window.location.pathname.includes(loc_path)) {
window.location.href = `?itemid=${item_id}`
}
else {
window.location.href = `/products.html#itemid=${item_id}`;
}
})
// $(".main-menu nav ul").find("li").each(function () {
// var current = window.location.pathname;
// var $this = $(this).find("a");
// if (current != "/") {
// if ($this.attr('href').indexOf(current) !== -1) {
// $(this).addClass('active_nav');
// }
// }
// })
// destroy localstorage data
let loc_path = '/productdetails.html';
if (window.location.pathname.includes(loc_path) === false) {
localStorage.removeItem("product_data");
localStorage.removeItem("top_data")
}
let loc_path1 = '/productcatloguedetails.html';
if (window.location.pathname.includes(loc_path1) === false) {
localStorage.removeItem("product_catlogue_obj");
}
//services pages links and sources
let $body_pg = $("body").hasClass("services_page");
let $hm_pg = "../index.html";
let $nav_img = "../dist/assets/imgs/anwi-logo-1.png";
let $footer_img = "../dist/assets/imgs/anwi-logo-2.png";
let $scrool_top_img = "../dist/assets/imgs/Home/rocket-footer.png";
let $about_pg = $("body").hasClass("about_page");
if($about_pg == true){
debugger
$(".main-menu").find("nav ul li a").addClass("text-dark");
let img_src = `./dist/assets/imgs/anwi-logo-1.png`;
$(".logo-menu-wrap").find("a img").attr("src",img_src);
$(".header-bottom").addClass("sticky-bar stick");
$("body.about_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
}
if ($body_pg == true) {
$(".header-large-device").find(".logo-menu-wrap .logo").find("a").attr("href", $hm_pg);
$(".header-large-device").find(".logo-menu-wrap .logo").find("a img").attr("src", $nav_img);
$(".mobile-logo").find("a").attr("href", $hm_pg);
$(".mobile-logo").find("a img").attr("src", $nav_img);
$("body.services_page").find(".header-large-device").find(".header-action-wrap").find(".same-style").find("svg").find("path").attr("fill","#000");
$(".main-menu").find("nav ul").find("li a").each(function () {
$(this).addClass("text-dark")
$(".header-bottom").addClass("sticky-bar stick");
let $arc = $(this).attr("href");
let $spcial_char = $arc.includes("./");
if ($spcial_char === true) {
let $refarence = `.${$arc}`
$(this).attr("href", $refarence);
}
});
$(".same-style").find("a").each(function () {
let $arc1 = $(this).attr("href");
let $spcial_char1 = $arc1.includes("./");
if ($spcial_char1 === true) {
let $refarence1 = `.${$arc1}`
$(this).attr("href", $refarence1);
}
})
$(".tab-content").find("img").each(function(){
let $img_src = $(this).attr("src");
let $img_src1 = $img_src.includes("./");
if ($img_src1 === true) {
let $refarenceimg1 = `.${$img_src}`;
$(this).attr("src", $refarenceimg1);
}
});
$(".clickable-mainmenu-wrap").find("nav ul").find("li a").each(function () {
let $arc_mbil = $(this).attr("href");
let $spcial_char_mbil = $arc_mbil.includes("./");
if ($spcial_char_mbil === true) {
let $refarence_mbil = `.${$arc_mbil}`
$(this).attr("href", $refarence_mbil);
}
});
}
setTimeout(()=>{
if(width<=600){
$('.same-style').find('svg path').attr('fill','#000')
}
},300)
}
+943
View File
@@ -0,0 +1,943 @@
function startDetails() {
// http://127.0.0.1:5502/productdetails.html?productId=106633230000024
if (window.location.search.split('=')[0] == '') {
window.location.href = "/notfound.html";
return;
}
let productId = window.location.hash.split('#')[1].split('=')[1];
// console.log(productId);
let itemtagscombinationRes = null;
let labels = {};
let isThereInLabel = {};
let currentComb = null;
let colorId = null;
let group = {};
let loadingActions = {
addLoader() {
$('.loadingCall').removeClass('d-none');
$('.mainContanierProduct').addClass('d-none');
},
removeLoader() {
$('.loadingCall').addClass('d-none');
$('.mainContanierProduct').removeClass('d-none');
}
}
let currentClick = null;
if (productId) {
swapSectionsVideo();
loadingActions.addLoader();
updateProductId(productId);
getProductDetails(productId);
appendSpecs(productId)
} else {
window.location.href = "/notfound.html"
}
function updateProductId(val) {
$('#productidtag').val(val);
}
function updateItemId(val) {
$('#itemidtag').val(val);
}
let specification_wrap_action = {
remove() {
$('.specification-wrap').addClass('d-none');
},
add() {
$('.specification-wrap').removeClass('d-none');
}
}
let description_action = {
addVal(value) {
$('.description-wrap > p').html(value);
},
removeVal(value) {
$('.description-wrap > p').html('');
}
}
function getSpecsItemHTML({ name, des, itemid, id }) {
let isMobile = $(window).width()<=600 ? '' : '';
let addPaddM = $(window).width()<=600 ? 'py-2' : 'py-4';
return `<div id="${id}" data-specitemid="${itemid}" >
<div class="row border-bottom">
<div class="col-sm-3 ${isMobile} font-weight-600 ${addPaddM} ">
${name}
</div>
<div class="col-sm-9 py-2 d-flex align-items-center">
${des}
</div>
</div>
</div>`;
}
// function getSpecsItemHTML({name,des,itemid,id}){
// return ` <tr id="${id}" data-specitemid="${itemid}">
// <td style="width:200px">${name}</td>
// <td class="">${des}</td>
// </tr>`;
// }
async function appendSpecs(id) {
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
if (resData.isError) {
$('.productdetailstabs').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
$('.productdetailstabs ').removeClass('d-none');
const res = resData.response;
// console.log(JSON.parse(res.result));
const data = JSON.parse(res.result);
// console.log(data);
let html = '';
let leftHtml = '';
let rightHtml = '';
if (data.length == 0) {
$('.productdetailstabs ').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
for (let i = 0; i < data.length; i++) {
const { specificationname, specificationitemid, itemid, description } = data[i];
if ((i + 1) % 2 == 0) {
rightHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
})
} else {
leftHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
});
}
}
$('.specContainerleft').html(leftHtml)
$('.specContainerRight').html(rightHtml)
}
function getParentHTML(name, productid, id, isMain) {
return `<div data-parentidgroup="${name?.replace(" ", '')}-parent" class="pb-2 groupingitems_search ${name?.replace(" ", '')}-parent">
<h5 class="py-2 smallHeadingProductDetails">${name}</h5>
<div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
</div>
</div>`;
}
function onClickHandler(e) {
$(e).parent().find('.borderselector').removeClass('borderselector');
$(e).addClass('borderselector')
}
function getChildHTML(tagid, name, isTrue,parentid) {
let blue = '#253746';
let greenLight = '#5e7975';
let brown = '#624839';
let bgColor = '';
if(name === 'Deep Sea Blue'){
bgColor = blue;
}else if(name == 'Desert Brown'){
bgColor = brown;
}else if(name == 'Eucalyptus Green'){
bgColor = greenLight;
}
if(colorId == parentid){
return `
<div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} colorselector card text-center small-font cursor-pointer ">
<span style="
height: 25px;
border-radius: 5px;
width:25px;
background: ${bgColor} !important;
pointer-events:none;
"></span>
</div> `
}
return `
<div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
${name}
</div> `
}
function addeventlisteners() {
$('.optiontaganwi').each(function (i, el) {
$(el).click(function (e) {
$('#quantity').val(1);
$(e.target).parent().find('.borderselector').removeClass('borderselector');
$(e.target).addClass('borderselector');
currentClick = e.target;
;
//searchComb();
// getAllCombination();
getandsetCombination();
})
});
}
function getandsetCombination(){
let keyOption = $(currentClick).data('tagiditem');
$('.disabled-option-item').removeClass('disabled-option-item');
let tagsNames = [];
let currOptionAvaIds = {};
$('.borderselector').each(function (i,e){
let id = $(e).data('tagiditem');
tagsNames.push(id);
});
for(let i=0;i<itemtagscombinationRes.length;i++){
let tagItems = itemtagscombinationRes[i].tagids;;
if(tagItems.includes(keyOption)){
let splitArr = tagItems.split('|');
for(let j=0;j<splitArr.length;j++){
if(keyOption){
currOptionAvaIds[splitArr[j]] = splitArr[j];
}
}
}
}
// console.log(currOptionAvaIds);
//console.log(itemtagscombinationRes);
let parentsArr = [];
$('.optiontaganwi').each(function (i,e){
let currParent = $(e).parents('.groupingitems_search');
if(currParent.find(`[data-tagiditem="${keyOption}"]`).length==0){
let currId = $(e).data('tagiditem');
if(!currOptionAvaIds[currId]){
if($(e).hasClass('borderselector')){
parentsArr.push(currParent);
$(e).removeClass('borderselector');
}
$(e).addClass('disabled-option-item');
}
}
});
for(let i=0;i<parentsArr.length;i++){
let currParent = parentsArr[i];
currParent.find('.optiontaganwi').each(function (j,e){
let isTrue = $(e).hasClass('disabled-option-item');
if(!isTrue){
$(e).addClass('borderselector');
return false;
}
});
}
// $('.optiontaganwi').addClass('disabled-option-item');
let parentId = $(currentClick).parents('.groupingitems_search');
let parentData = $(parentId).data('parentidgroup');
let parentArr = [];
$('.groupingitems_search').each(function (i,e){
const curParentId = $(e).data('parentidgroup');
if(parentData != curParentId){
let obj = {
name:$(e).find('.smallHeadingProductDetails').html(),
arr:[]
}
$(e).find('.optiontaganwi').each(function (j,evt){
let id = $(evt).data('tagiditem');
obj.arr.push(id);
});
parentArr.push(obj);
}
})
// console.log(parentArr);
let arrone = parentArr[0].arr;
let arrtwo = [];
if(parentArr.length>1){
arrtwo = parentArr[1]?.arr;
}
let currId = keyOption;
let ids = [];
for(let i=0;i<arrone.length;i++){
//let currEl = [currId,arrone[i]];
let currEl = ``
for(let j=0;j<arrtwo.length;j++){
currEl = `${currId}|${arrone[i]}|${arrtwo[j]}`;
ids.push(currEl);
currEl = '';
}
}
console.log(ids,'ids');
let findObj = [];
debugger
for(let i=0;i<ids.length;i++){
let curId = ids[i]
for(let j=0;j<itemtagscombinationRes.length;j++){
const currItem = itemtagscombinationRes[j].tagids.split('|');
let isTrue = true;
for(let k=0;k<currItem.length;k++){
if(!curId.includes(currItem[k])){
isTrue = false;
break;
}
}
if(isTrue){
findObj.push(itemtagscombinationRes[j]);
}
}
}
//console.log(findObj);
$('.optiontaganwi').addClass('disabled-option-item');
debugger;
for(let i=0;i<findObj.length;i++){
let item = findObj[i].tagids.split('|');
for(let j=0;j<item.length;j++){
$(`[data-tagiditem=${item[j]}]`).removeClass('disabled-option-item');
}
}
$(parentId).find('.optiontaganwi').each(function (i,e){
$(e).removeClass('disabled-option-item')
});
for(let i=0;i<itemtagscombinationRes.length;i++){
let currIds = itemtagscombinationRes[i].tagids;
let isTrue = true;
let isPro = false;
for(let j=0;j<tagsNames.length;j++){
if(tagsNames.join().includes('106631360000128')&&(tagsNames.join().includes('106631360000132')||tagsNames.join().includes('106631360000133'))){
isPro = true;
}
if(!currIds.includes(tagsNames[j])){
isTrue = false;
}
}
if(isTrue){
const { quantity } = itemtagscombinationRes[i];
if (true) {
currentComb = itemtagscombinationRes[i];
updateDetailsByObj(itemtagscombinationRes[i]);
if(isPro){
$(`[data-tagiditem="106631360000089"]`).addClass(' disabled-option-item')
$(`[data-tagiditem="106631360000088"]`).addClass(' disabled-option-item')
}
} else {
let name = itemtagscombinationRes[i].itemname.split('-')[0];
$('#addtocart').addClass('disabled');
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += ` ${$(e).html().trim()}`;
});
updateItemId(null);
let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
$('.productDetailsMain > img').attr('src', defaultImg);
specification_wrap_action.remove();
$('#skudetailitem').val(-1)
$('.productname').html(itemsName)
$('.msgErrorDetailsItem').removeClass('d-none');
$('.des_productdes').html('');
$('.price').html('');
}
initAddToCart()
return;
}
}
// return;
return;
let commonTags = [];
// $('.optiontaganwi').addClass('disabled-option-item')
for(let i=0;i<tagsNames.length;i++){
let currtagName = tagsNames[i];
let arr = currtagItemCom(currtagName);
commonTags.push(arr);
}
console.log(commonTags);
// for(let i=0;i<commonTags.length;i++){
// let currObj = commonTags[i];
// for(let item in currObj){
// console.log($(`[data-tagiditem="${item}"]`));
// $(`[data-tagiditem="${item}"]`).removeClass('disabled-option-item')
// }
// }
let finalAns = {};
let arra = [];
for(let i=0;i<commonTags.length;i++){
let currObj = commonTags[i];
for(let item in currObj){
let isTrue = true;
for(let j=0;j<commonTags.length;j++){
if(j!=i){
let currComb = commonTags[j];
if(!currComb[item]){
isTrue = false;
}
}
}
if(isTrue){
arra.push(currObj[item])
finalAns[currObj[item]] = currObj[item];
$(`[data-tagiditem="${item}"]`).removeClass('disabled-option-item')
}
}
}
// console.log(arra);
// for(let i=0;i<itemtagscombinationRes.length;i++){
// let tagItems = itemtagscombinationRes[i].tagids;;
// if(tagItems.includes(keyOption)){
// let splitArr = tagItems.split('|');
// for(let j=0;j<splitArr.length;j++){
// commonTags[splitArr[j]] = splitArr[j];
// }
// }
// }
// for(let i=0;i<currOptionAvaIds.length;i++){
// let currId = currOptionAvaIds[i];
// if(parentId.find(currId).length === 0){
// console.log(currId);
// }
// }
}
function currtagItemCom(keyOption){
debugger;
let arr = [];
let commonTags = {};
for(let i=0;i<itemtagscombinationRes.length;i++){
let tagItems = itemtagscombinationRes[i].tagids;;
if(tagItems.includes(keyOption)){
let splitArr = tagItems.split('|');
for(let j=0;j<splitArr.length;j++){
if(!commonTags[splitArr[j]]){
commonTags[splitArr[j]] = {
keyOption,
data:itemtagscombinationRes[i]
};
arr.push(splitArr[j]);
}
}
}
}
return commonTags;
}
function updateDetailsByObj(obj) {
$('.productname').html(obj.itemname);
$('.titleproductnav').html(obj.itemname);
let [currencySymbol, amount] = getCurrencySymbol(obj?.pricelist||0);
let commingSoonText = window.location.href.toLowerCase().includes('zeno')||window.location.href.toLowerCase().includes('fyro')
$('.price').html(obj.pricelist ? `<span class="font-w600">${currencySymbol}${amount}</span>${commingSoonText?'<span class="mx-1 badge bg-gradient-violet text-a-color">Coming Soon</span>':''}` : 'coming soon');
$('.price').attr('data-price',obj.pricelist);
appendSpecs(obj.itemid)
$('#skudetailitem').val(obj.sku)
$('.des_productdes').html(obj.itemdescription);
$('#addtocart').attr('data-qty', obj.quantity);
let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
// console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
debugger;
let productId = window.location.hash.split('#')[1]?.split('=')[1];
let itemId = window.location.hash.split('#')[2]?.split('=')[1];
history.replaceState(undefined, undefined, `#productId=${productId}#itemid=${obj.itemid}`)
$('.productDetailsMain > img').attr('src', defaultImg).attr('loading','lazy');
updateItemId(obj.itemid);
//console.log(obj,'objobjobj');
if (!obj.pricelist || !obj.quantity) {
$('.buynow').attr('disabled', true);
$('#addtocart').attr('disabled', true);
} else {
$('.buynow').attr('disabled', false);
$('#addtocart').attr('disabled', false);
}
}
function searchComb() {
let valuesSelected = [];
$('.optiontaganwi').removeClass('disabled-option-item')
$('#addtocart').removeClass('disabled');
$('.msgErrorDetailsItem').addClass('d-none');
$('.borderselector,border_selector').each(function (i, el) {
// console.log($(el).html())
let val = $(el).data('tagiditem');
valuesSelected.push(val);
});
let labelRecord = {};
for (let label in labels) {
labelRecord[label] = false;
}
specification_wrap_action.add();
let unFiler = null;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagids } = currItem;
let isTrue = true;
let labelFilter = labelRecord;
for (let i = 0; i < valuesSelected.length; i++) {
if (!tagids.includes(valuesSelected[i])) {
isTrue = false
unFiler = labelFilter;
break;
}
labelFilter[group[valuesSelected[i]]] = true;
}
if (isTrue) {
// console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
const { quantity } = itemtagscombinationRes[i];
if (quantity >= $('#quantity').val() && quantity >= 1) {
currentComb = itemtagscombinationRes[i];
// $('.productname').html(itemtagscombinationRes[i].itemname)
// $('.price').html(itemtagscombinationRes[i].pricelist);
// location.hash = itemtagscombinationRes[i].itemname.trim();
// appendSpecs(itemtagscombinationRes[i].itemid)
// history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
updateDetailsByObj(itemtagscombinationRes[i]);
} else {
let name = itemtagscombinationRes[i].itemname.split('-')[0];
$('#addtocart').addClass('disabled');
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += ` ${$(e).html().trim()}`;
});
updateItemId(null);
let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
// console.log(itemtagscombinationRes[i].itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
$('.productDetailsMain > img').attr('src', defaultImg);
specification_wrap_action.remove();
$('#skudetailitem').val(-1)
$('.productname').html(itemsName)
// history.replaceState(null, null, `#`);
$('.msgErrorDetailsItem').removeClass('d-none');
$('.des_productdes').html('');
$('.price').html('');
}
initAddToCart()
return;
}
}
alert("j");
let name = itemtagscombinationRes[0].itemname.split('-')[0];
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += `- ${$(e).html().trim()}`;
})
specification_wrap_action.remove();
$('.productname').html(itemsName)
$('#skudetailitem').val(-1)
$('.price').html('');
$('#addtocart').addClass('disabled');
$('.msgErrorDetailsItem').removeClass('d-none');
initAddToCart()
}
function getAllCombination() {
debugger;
const currClickAttr = $(currentClick).html().trim();
const optionId = $(currentClick).data('tagiditem');
let curr = $(currentClick).parents('.groupingitems_search').data('parentidgroup');
$('.groupingitems_search').each(function (i, e) {
const id = $(e).data('parentidgroup');
if (id != curr) {
$(e).find('.optiontaganwi').addClass('disabled-option-item');
$(e).find('.borderselector').removeClass('borderselector');
}
});
let ansArr = [];
let index = 0;
let comb = null;
for(let i=0;i<itemtagscombinationRes.length;i++){
let currIds = itemtagscombinationRes[i].tagids;
if(currIds.includes(optionId)){
currIds = currIds.split('|');
for(let j=0;j<currIds.length;j++){
debugger;
if(index==0 &&optionId != currIds[j] ) {
$(`[data-tagiditem="${currIds[j]}"]`).addClass('borderselector')
comb = itemtagscombinationRes[i];
index++;
}
$(`[data-tagiditem="${currIds[j]}"]`).removeClass('disabled-option-item');
// $().parents('[data-tagid]').find()
}
}
}
// console.log(comb,'comb tag');
updateDetailsByObj(comb);
let currentItem = comb.tagids.split('|');
for(let i=0;i<currentItem.length;i++){
$(`[data-tagiditem="${currentItem[i]}"]`).removeClass('disabled-option-item').addClass('borderselector');
}
// history.replaceState(null, null, `#${comb.itemname}`);
// window.location.href = `#${comb.itemname}`
console.log(itemtagscombinationRes,'gobal');
return;
};
async function getProductDetails(id) {
debugger;
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
if (resData.isError) {
loadingActions.removeLoader();
alert(resData.errorMsg.message);
return;
}
if(resData.response.result == '[]' || !resData.response.result){
$('.barbgnav').removeClass('d-none')
loadingActions.removeLoader();
toasterHelper("Something Went Wrong")
return;
}
let res = resData.response;
res = JSON.parse(res.result);
// console.log(res,'resDataresDataresDataresDataresData');
// console.log(res, 'productattributelist');
if (!res) {
loadingActions.removeLoader();
return;
};
let html = '';
for (let i = 0; i < res.length; i++) {
const currItem = res[i];
// parenttagid means under what label
// tag id means it know unquie id
const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
if (labels[parentattribute]) {
labels[parentattribute].items.push({
attribute,
tagid: tagid
});
} else {
labels[parentattribute] = {
id: parenttagid,
items: [{
attribute,
tagid: tagid
}]
};
if(parentattribute.toLowerCase() === 'colour'){
colorId = parenttagid;
}
html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
}
}
$('#spec-container-details').html(html);
console.log(labels,'labels');
let childIds = [];
for (let item in labels) {
let { id, items } = labels[item];
// $(`[data-tagid=${id}]`)
let html = '';
for (let i = 0; i < items.length; i++) {
const { attribute, tagid } = items[i]
childIds.push(tagid);
group[attribute] = item;
// console.log(attribute,colorId,"s");
html += getChildHTML(tagid, attribute, i == 0,id);
// console.log(attribute,"attributeattributeattributeattribute");
}
debugger;
$(`[data-tagid="${id}"]`).html(html);
}
itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
console.log(itemtagscombinationRes, "conductt");
let itemidSearch = window.location.hash.split('#')[2]?.split('=')[1];
if(!itemidSearch){
itemidSearch = itemtagscombinationRes[0].itemid
}
let valuesSelected = [];
$('.borderselector').each(function (i, el) {
let val = $(el).html();
valuesSelected.push(val.trim());
});
debugger;
// let searchParams = window.location.search.split("&");
// let skuId = window.location.hash.split('#')[2].split('=')[1];
// skuId = skuId.split('=')[1]
let isGo = true;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagnames, sku, itemid } = currItem;
isThereInLabel[tagnames] = itemtagscombinationRes[i];
let isTrue = true;
if (isGo) {
// for(let i=0;i<valuesSelected.length;i++){
// if(!tagnames.includes(valuesSelected[i])){
// isTrue = false
// }
// }
if (itemidSearch != itemid) {
isTrue = false
}
// if (i != 0) {
// isTrue = false
// }
if (isTrue) {
// console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
currentComb = itemtagscombinationRes[i];
updateDetailsByObj(itemtagscombinationRes[i]);
isGo = false;
let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
for (let i = 0; i < tagids.length; i++) {
$(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
}
break;
// tagiditem
}
}
}
if (isGo && itemtagscombinationRes.length != 0) {
// console.log(itemtagscombinationRes[0]);
let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
currentComb = itemtagscombinationRes[0];
// updateItemId(itemtagscombinationRes[0].itemid);
for (let i = 0; i < tagids.length; i++) {
$(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
// $(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
// $(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
// $(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
}
// $('.price').html(pricelist);
// $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
// appendSpecs(itemtagscombinationRes[0].itemid);
updateDetailsByObj(itemtagscombinationRes[0]);
//console.log(childIds);
//
}
//getAllCombination()
// for(let i=0;i<itemtagscombinationRes.length;i++){
// const {tagnames} = itemtagscombinationRes[i];
// }
$('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
//getting the first borderselector in first $('.groupingitems_search')[0]
let firstParentGroup = $('.groupingitems_search')[0];
debugger;
let optionId = $(firstParentGroup).find('.borderselector').data('tagiditem');
currentClick = $(firstParentGroup).find('.borderselector')
getandsetCombination();
addeventlisteners();
loadingActions.removeLoader();
return;
}
}
startDetails();
+606
View File
@@ -0,0 +1,606 @@
function startDetails() {
// http://127.0.0.1:5502/productdetails.html?productId=106633230000024
if (window.location.search.split('=')[0] == '') {
window.location.href = "/notfound.html";
return;
}
let productId = window.location.href.split('=')[1].split('&')[0].split('#')[0];
console.log(productId);
let itemtagscombinationRes = null;
let labels = {};
let isThereInLabel = {};
let currentComb = null;
let group = {};
let loadingActions = {
addLoader() {
$('.loadingCall').removeClass('d-none');
$('.mainContanierProduct').addClass('d-none');
},
removeLoader() {
$('.loadingCall').addClass('d-none');
$('.mainContanierProduct').removeClass('d-none');
}
}
let currentClick = null;
if (productId) {
loadingActions.addLoader();
updateProductId(productId);
getProductDetails(productId);
appendSpecs(productId)
} else {
window.location.href = "/notfound.html"
}
function updateProductId(val) {
$('#productidtag').val(val);
}
function updateItemId(val) {
$('#itemidtag').val(val);
}
let specification_wrap_action = {
remove() {
$('.specification-wrap').addClass('d-none');
},
add() {
$('.specification-wrap').removeClass('d-none');
}
}
let description_action = {
addVal(value) {
$('.description-wrap > p').html(value);
},
removeVal(value) {
$('.description-wrap > p').html('');
}
}
function getSpecsItemHTML({ name, des, itemid, id }) {
let isMobile = $(window).width()<=600 ? '' : '';
let addPaddM = $(window).width()<=600 ? 'py-2' : 'py-4';
return `<div id="${id}" data-specitemid="${itemid}" >
<div class="row border-bottom">
<div class="col-sm-3 ${isMobile} font-weight-600 ${addPaddM} ">
${name}
</div>
<div class="col-sm-9 py-2 d-flex align-items-center">
${des}
</div>
</div>
</div>`;
return `<div id="${id}" data-specitemid="${itemid}" class="">
<div class="row border-bottom">
<div class="col-sm-6 bg-gray-3 py-2">
${name}
</div>
<div class="col-sm-6 py-2">
${des}
</div>
</div>
</div>`;
}
// function getSpecsItemHTML({name,des,itemid,id}){
// return ` <tr id="${id}" data-specitemid="${itemid}">
// <td style="width:200px">${name}</td>
// <td class="">${des}</td>
// </tr>`;
// }
async function appendSpecs(id) {
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
if (resData.isError) {
$('.productdetailstabs').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
$('.productdetailstabs ').removeClass('d-none');
const res = resData.response;
console.log(JSON.parse(res.result));
const data = JSON.parse(res.result);
console.log(data);
let html = '';
let leftHtml = '';
let rightHtml = '';
if (data.length == 0) {
$('.productdetailstabs ').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
for (let i = 0; i < data.length; i++) {
const { specificationname, specificationitemid, itemid, description } = data[i];
if ((i + 1) % 2 == 0) {
rightHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
})
} else {
leftHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
});
}
}
$('.specContainerleft').html(leftHtml)
$('.specContainerRight').html(rightHtml)
}
function getParentHTML(name, productid, id, isMain) {
return `<div data-parentidgroup="${name?.replace(" ", '')}-parent" class="pb-2 groupingitems_search ${name?.replace(" ", '')}-parent">
<h5 class="py-2 smallHeadingProductDetails">${name}</h5>
<div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
</div>
</div>`;
}
function onClickHandler(e) {
$(e).parent().find('.borderselector').removeClass('borderselector');
$(e).addClass('borderselector')
}
function getChildHTML(tagid, name, isTrue) {
return `
<div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
${name}
</div> `
}
function addeventlisteners() {
$('.optiontaganwi').each(function (i, el) {
$(el).click(function (e) {
debugger;
$('#quantity').val(1);
$(e.target).parent().find('.borderselector').removeClass('borderselector');
$(e.target).addClass('borderselector');
searchComb();
currentClick = e.target;
getAllCombination();
})
});
}
function updateDetailsByObj(obj) {
$('.productname').html(obj.itemname)
let [currencySymbol, amount] = getCurrencySymbol(obj?.pricelist||0);
$('.price').html(obj.pricelist ?`${currencySymbol}${amount}'`:'');
$('.price').attr('data-price',obj.pricelist);
appendSpecs(obj.itemid)
$('#skudetailitem').val(obj.sku)
$('.des_productdes').html(obj.itemdescription);
$('#addtocart').attr('data-qty', obj.quantity);
debugger;
let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
$('.productDetailsMain > img').attr('src', defaultImg);
updateItemId(obj.itemid);
if (!obj.pricelist) {
$('.buynow').attr('disabled', true);
$('#addtocart').attr('disabled', true);
} else {
$('.buynow').attr('disabled', false);
$('#addtocart').attr('disabled', false);
}
}
function searchComb() {
let valuesSelected = [];
$('.optiontaganwi').removeClass('disabled-option-item')
$('#addtocart').removeClass('disabled');
$('.msgErrorDetailsItem').addClass('d-none');
$('.borderselector,border_selector').each(function (i, el) {
console.log($(el).html())
let val = $(el).data('tagiditem');
valuesSelected.push(val);
});
let labelRecord = {};
for (let label in labels) {
labelRecord[label] = false;
}
console.log(labelRecord);
specification_wrap_action.add();
console.log(group);
let unFiler = null;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagids } = currItem;
let isTrue = true;
let labelFilter = labelRecord;
for (let i = 0; i < valuesSelected.length; i++) {
if (!tagids.includes(valuesSelected[i])) {
isTrue = false
unFiler = labelFilter;
break;
}
labelFilter[group[valuesSelected[i]]] = true;
}
if (isTrue) {
console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
const { quantity } = itemtagscombinationRes[i];
if (quantity >= $('#quantity').val() && quantity >= 1) {
currentComb = itemtagscombinationRes[i];
// $('.productname').html(itemtagscombinationRes[i].itemname)
// $('.price').html(itemtagscombinationRes[i].pricelist);
// location.hash = itemtagscombinationRes[i].itemname.trim();
// appendSpecs(itemtagscombinationRes[i].itemid)
history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
updateDetailsByObj(itemtagscombinationRes[i]);
} else {
let name = itemtagscombinationRes[i].itemname.split('-')[0];
$('#addtocart').addClass('disabled');
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += ` ${$(e).html().trim()}`;
});
updateItemId(null);
let defaultImg = itemtagscombinationRes[i].itemimageurl ? imgServerNameBuild(itemtagscombinationRes[i].itemimageurl) : `./dist/assets/imgs/nophoto.png`;
console.log(itemtagscombinationRes[i].itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
$('.productDetailsMain > img').attr('src', defaultImg);
specification_wrap_action.remove();
$('#skudetailitem').val(-1)
$('.productname').html(itemsName)
history.replaceState(null, null, `#`);
$('.msgErrorDetailsItem').removeClass('d-none');
$('.des_productdes').html('');
$('.price').html('');
}
initAddToCart()
return;
}
}
alert("j");
let name = itemtagscombinationRes[0].itemname.split('-')[0];
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += `- ${$(e).html().trim()}`;
})
specification_wrap_action.remove();
$('.productname').html(itemsName)
$('#skudetailitem').val(-1)
$('.price').html('');
$('#addtocart').addClass('disabled');
$('.msgErrorDetailsItem').removeClass('d-none');
initAddToCart()
}
function getAllCombination() {
debugger;
const currClickAttr = $(currentClick).html().trim();
let isThere = [];
for (let item in isThereInLabel) {
let { tagnames } = isThereInLabel[item];
if (tagnames.includes(currClickAttr)) {
isThere.push(isThereInLabel[item])
}
}
if (!isThere.length) {
let curr = $(currentClick).parents('.groupingitems_search').data('parentidgroup');
$('.groupingitems_search').each(function (i, e) {
const id = $(e).data('parentidgroup');
if (id != curr) {
$(e).find('.optiontaganwi').addClass('disabled-option-item');
}
});
return;
}
let selected = [];
$('.borderselector').each(function (i, e) {
selected.push($(e).html().trim())
});
// console.log(selected);
// console.log(isThere);
let ishashObj = {};
for (let i = 0; i < isThere.length; i++) {
let { tagnames, tagids } = isThere[i];
tagnames = tagnames.split('|');
tagids = tagids.split('|');
for (let j = 0; j < tagnames.length; j++) {
if (!ishashObj[tagnames[j]]) {
ishashObj[tagnames[j]] = tagids[j];
}
}
}
console.log(ishashObj);
// for(let i=0;i<itemtagscombinationRes.length;i++){
// }
}
async function getProductDetails(id) {
debugger;
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
if (resData.isError) {
loadingActions.removeLoader();
alert(resData.errorMsg.message);
return;
}
let res = resData.response;
res = JSON.parse(res.result);
console.log(res, 'productattributelist');
if (!res) {
loadingActions.removeLoader();
return;
};
let html = '';
for (let i = 0; i < res.length; i++) {
const currItem = res[i];
// parenttagid means under what label
// tag id means it know unquie id
const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
if (labels[parentattribute]) {
labels[parentattribute].items.push({
attribute,
tagid: tagid
});
} else {
labels[parentattribute] = {
id: parenttagid,
items: [{
attribute,
tagid: tagid
}]
};
html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
}
}
$('#spec-container-details').html(html);
// console.log(labels,'labels');
let childIds = [];
for (let item in labels) {
let { id, items } = labels[item];
// $(`[data-tagid=${id}]`)
let html = '';
for (let i = 0; i < items.length; i++) {
const { attribute, tagid } = items[i]
childIds.push(tagid);
group[attribute] = item;
html += getChildHTML(tagid, attribute, i == 0);
}
$(`[data-tagid="${id}"]`).html(html);
}
itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
console.log(itemtagscombinationRes, "conductt");
let valuesSelected = [];
$('.borderselector').each(function (i, el) {
let val = $(el).html();
valuesSelected.push(val.trim());
});
let searchParams = window.location.search.split("&");
let skuId = window.location.hash.split('#')[1].split('=')[1];
// skuId = skuId.split('=')[1]
let isGo = true;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagnames, sku, itemid } = currItem;
isThereInLabel[tagnames] = itemtagscombinationRes[i];
let isTrue = true;
if (isGo) {
// for(let i=0;i<valuesSelected.length;i++){
// if(!tagnames.includes(valuesSelected[i])){
// isTrue = false
// }
// }
if (i != 0) {
isTrue = false
}
if (isTrue) {
console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
currentComb = itemtagscombinationRes[i];
updateDetailsByObj(itemtagscombinationRes[i]);
isGo = false;
let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
for (let i = 0; i < tagids.length; i++) {
$(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
}
// tagiditem
}
}
}
if (isGo && itemtagscombinationRes.length != 0) {
console.log(itemtagscombinationRes[0]);
let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
currentComb = itemtagscombinationRes[0];
// updateItemId(itemtagscombinationRes[0].itemid);
for (let i = 0; i < tagids.length; i++) {
$(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
// $(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
// $(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
// $(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
}
// $('.price').html(pricelist);
// $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
// appendSpecs(itemtagscombinationRes[0].itemid);
updateDetailsByObj(itemtagscombinationRes[0]);
//console.log(childIds);
//
}
//getAllCombination()
// for(let i=0;i<itemtagscombinationRes.length;i++){
// const {tagnames} = itemtagscombinationRes[i];
// }
$('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
addeventlisteners();
loadingActions.removeLoader();
return;
// let resTwo = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`);
//let html = '';
let attributesObj = {};
for (let i = 0; i < res.length; i++) {
const { parentattribute, tagid, productid } = res[i];
// let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
// attributesObj[tagid] = JSON.parse(attributes.data.result);
// console.log(attributes.data.result,tagid);
html += getParentHTML(parentattribute, productid, tagid, i == 0);
}
$('#spec-container-details').html(html);
// let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
return;
for (let attr in attributesObj) {
const arr = attributesObj[attr];
let html = '';
for (let i = 0; i < arr.length; i++) {
const { attribute, tagid } = arr[i];
html += getChildHTML(tagid, attribute, i == 0);
}
$(`[data-tagid="${attr}"]`).html(html);
}
let defaultValues = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/sellableitemlist/productid/${id}`);
defaultValues = JSON.parse(defaultValues.data.result);
let { itemname, price } = defaultValues[0];
$('.productname').html(itemname);
$('.price').html(price)
$('#spec-container-details').children().slice(1).find('.specsmallcard').removeClass('specsmallcard');
// getQuantityById(id)
}
}
startDetails();
+650
View File
@@ -0,0 +1,650 @@
function startDetails() {
// http://127.0.0.1:5502/productdetails.html?productId=106633230000024
if (window.location.search.split('=')[0] == '') {
window.location.href = "/notfound.html";
return;
}
let productId = window.location.href.split('=')[1].split('&')[0].split('#')[0];
console.log(productId);
let itemtagscombinationRes = null;
let labels = {};
let isThereInLabel = {};
let currentComb = null;
let group = {};
let loadingActions = {
addLoader() {
$('.loadingCall').removeClass('d-none');
$('.mainContanierProduct').addClass('d-none');
},
removeLoader() {
$('.loadingCall').addClass('d-none');
$('.mainContanierProduct').removeClass('d-none');
}
}
let currentClick = null;
if (productId) {
loadingActions.addLoader();
updateProductId(productId);
getProductDetails(productId);
appendSpecs(productId)
} else {
window.location.href = "/notfound.html"
}
function updateProductId(val) {
$('#productidtag').val(val);
}
function updateItemId(val) {
$('#itemidtag').val(val);
}
let specification_wrap_action = {
remove() {
$('.specification-wrap').addClass('d-none');
},
add() {
$('.specification-wrap').removeClass('d-none');
}
}
let description_action = {
addVal(value) {
$('.description-wrap > p').html(value);
},
removeVal(value) {
$('.description-wrap > p').html('');
}
}
function getSpecsItemHTML({ name, des, itemid, id }) {
return `<div id="${id}" data-specitemid="${itemid}" class="">
<div class="row border-bottom">
<div class="col-sm-6 bg-gray-3 py-2">
${name}
</div>
<div class="col-sm-6 py-2">
${des}
</div>
</div>
</div>`;
return ` <tr id="${id}" data-specitemid="${itemid}">
<td style="width:200px">${name}</td>
<td class="">${des}</td>
</tr>`;
}
// function getSpecsItemHTML({name,des,itemid,id}){
// return ` <tr id="${id}" data-specitemid="${itemid}">
// <td style="width:200px">${name}</td>
// <td class="">${des}</td>
// </tr>`;
// }
async function appendSpecs(id) {
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemspecifications/itemid/${id}`, true);
if (resData.isError) {
$('.productdetailstabs').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
$('.productdetailstabs ').removeClass('d-none');
const res = resData.response;
console.log(JSON.parse(res.result));
const data = JSON.parse(res.result);
console.log(data);
let html = '';
let leftHtml = '';
let rightHtml = '';
if (data.length == 0) {
$('.productdetailstabs ').addClass('d-none');
$('.specContainerleft').html('')
$('.specContainerRight').html('')
return;
}
for (let i = 0; i < data.length; i++) {
const { specificationname, specificationitemid, itemid, description } = data[i];
if ((i + 1) % 2 == 0) {
rightHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
})
} else {
leftHtml += getSpecsItemHTML({
name: specificationname, id: specificationitemid, itemid, des: description
});
}
}
$('.specContainerleft').html(leftHtml)
$('.specContainerRight').html(rightHtml)
}
function getParentHTML(name, productid, id, isMain) {
return `<div class="pb-2 $${name?.replace(" ", '')}-parent">
<h5 class="py-2 smallHeadingProductDetails">${name}</h5>
<div class="d-flex gap-2 flex-lg-row flex-wrap ${id}container" data-tagid="${id}">
</div>
</div>`;
}
function onClickHandler(e) {
$(e).parent().find('.borderselector').removeClass('borderselector');
$(e).addClass('borderselector')
}
function getChildHTML(tagid, name, isTrue) {
let item_color_1 = `#5e7975`;
let item_color_2 = `#624839`;
let item_color_3 = `#253746`;
if(name == "Eucalyptus Green"){
return `<p item_color=${item_color_1} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi fs-7 cursor-pointer text-white rounded mb-0 me-1 py-2 px-3" ${item_color_1 ? `style="background-color:${item_color_1}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
}else if(name == "Desert Brown"){
return `<p item_color=${item_color_2} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi mb-0 fs-7 cursor-pointer me-1 rounded text-white py-2 px-3" ${item_color_2 ? `style="background-color:${item_color_2}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
}else if(name == "Deep Sea Blue"){
return `<p item_color=${item_color_3} data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="optiontaganwi_color specsmallcard optiontaganwi mb-0 fs-7 text-white cursor-pointer rounded py-2 px-3 " ${item_color_3 ? `style="background-color:${item_color_3}"`:''}><span class="${isTrue ? 'border-bottom color' : 'color'}">${name}</span></p>`;
}
else{
return `
<div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue ? 'borderselector' : ''} card text-center small-font cursor-pointer p-3">
${name}
</div> `
}
}
function addeventlisteners() {
$('.optiontaganwi').each(function (i, el) {
$(el).click(function (e) {
$('#quantity').val(1);
debugger;
let ele_col = $(e.target).hasClass("color");
let ele_col1 = $(e.target).hasClass("optiontaganwi_color");
if(ele_col === true){
$(e.target).parent().find("span.color").removeClass('border-bottom');
$(e.target).parent().addClass("border_selector");
$(e.target).addClass("border-bottom");
$(e.target).parent().find("span.border-bottom").removeClass("border-bottom text-dark");
$(e.target).addClass("border_selector");
$(e.target).find("span.color").addClass("border-bottom text-dark");
$(e.target).parent().find('.borderselector').removeClass('borderselector');
// $(e.target).addClass('borderselector');
searchComb();
currentClick = e.target;
}else if(ele_col1 === true){
$(e.target).parent().find("span.text-dark").removeClass("text-dark border-bottom");
$(e.target).addClass("border_selector");
$(e.target).find("span.color").addClass("text-dark");
$(e.target).parent().find('.borderselector').removeClass('borderselector');
$(e.target).addClass('borderselector');
searchComb();
currentClick = e.target;
}else{
$(e.target).parent().find('.borderselector').removeClass('borderselector');
$(e.target).addClass('borderselector');
searchComb();
currentClick = e.target;
}
searchComb();
currentClick = e.target;
// getAllCombination();
})
});
// $('.optiontaganwi_color span.color').each(function (i, el) {
// $(el).click(function (e) {
// $('#quantity').val(1);
// $(e.target).parent().find("span.border-bottom").removeClass("border-bottom");
// $(e.target).addClass("border-bottom");
// searchComb();
// currentClick = e.target;
// // getAllCombination();
// })
// });
}
// function getChildHTML(tagid,name,isTrue){
// return `
// <div data-type="${tagid}-${name}" data-tagiditem="${tagid}" class="specsmallcard optiontaganwi ${isTrue?'borderselector':''} card small-font cursor-pointer p-3">
// ${name}
// </div>
// `
// }
// function addeventlisteners(){
// $('.optiontaganwi').each(function (i,el){
// $(el).click(function (e){
// $('#quantity').val(1)
// $(e.target).parent().find('.borderselector').removeClass('borderselector');
// $(e.target).addClass('borderselector')
// searchComb();
// currentClick = e.target;
// // getAllCombination();
// })
// });
// }
function updateDetailsByObj(obj) {
$('.productname').html(obj.itemname)
$('.price').html(obj.pricelist?obj.pricelist:'coming soon');
appendSpecs(obj.itemid)
$('#skudetailitem').val(obj.sku)
$('.des_productdes').html(obj.itemdescription);
$('#addtocart').attr('data-qty', obj.quantity);
let defaultImg = obj.itemimageurl ? imgServerNameBuild(obj.itemimageurl) : `./dist/assets/imgs/nophoto.png`;
console.log(obj.itemimageurl, 'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
$('.productDetailsMain > img').attr('src', defaultImg);
updateItemId(obj.itemid);
if(!obj.pricelist){
$('.buynow').attr('disabled',true);
$('#addtocart').attr('disabled',true);
}else{
$('.buynow').attr('disabled',false);
$('#addtocart').attr('disabled',false);
}
}
function searchComb() {
let valuesSelected = [];
$('#addtocart').removeClass('disabled');
$('.msgErrorDetailsItem').addClass('d-none');
$('.borderselector,border_selector').each(function (i, el) {
console.log($(el).html())
let val = $(el).html();
valuesSelected.push(val.trim());
});
let labelRecord = {};
for (let label in labels) {
labelRecord[label] = false;
}
console.log(labelRecord);
specification_wrap_action.add();
console.log(group);
let unFiler = null;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagnames } = currItem;
let isTrue = true;
let labelFilter = labelRecord;
for (let i = 0; i < valuesSelected.length; i++) {
if (!tagnames.includes(valuesSelected[i])) {
isTrue = false
unFiler = labelFilter;
break;
}
labelFilter[group[valuesSelected[i]]] = true;
}
if (isTrue) {
console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
const { quantity } = itemtagscombinationRes[i];
if (quantity >= $('#quantity').val() && quantity >= 1) {
currentComb = itemtagscombinationRes[i];
// $('.productname').html(itemtagscombinationRes[i].itemname)
// $('.price').html(itemtagscombinationRes[i].pricelist);
// location.hash = itemtagscombinationRes[i].itemname.trim();
// appendSpecs(itemtagscombinationRes[i].itemid)
history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
updateDetailsByObj(itemtagscombinationRes[i]);
} else {
let name = itemtagscombinationRes[i].itemname.split('-')[0];
$('#addtocart').addClass('disabled');
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += ` ${$(e).html().trim()}`;
});
updateItemId(null);
specification_wrap_action.remove();
$('#skudetailitem').val(-1)
$('.productname').html(itemsName)
history.replaceState(null, null, `#`);
$('.msgErrorDetailsItem').removeClass('d-none');
$('.des_productdes').html('');
$('.price').html('');
}
initAddToCart()
return;
}
}
let name = itemtagscombinationRes[0].itemname.split('-')[0];
let itemsName = name;
$('.borderselector').each(function (i, e) {
itemsName += `- ${$(e).html().trim()}`;
})
specification_wrap_action.remove();
$('.productname').html(itemsName)
$('#skudetailitem').val(-1)
$('.price').html('');
$('#addtocart').addClass('disabled');
$('.msgErrorDetailsItem').removeClass('d-none');
initAddToCart()
}
function getAllCombination() {
const currClickAttr = $(currentClick).html().trim();
let isThere = [];
for (let item in isThereInLabel) {
let { tagnames } = isThereInLabel[item];
if (tagnames.includes(currClickAttr)) {
isThere.push(isThereInLabel[item])
}
}
let selected = [];
$('.borderselector').each(function (i, e) {
selected.push($(e).html().trim())
});
// console.log(selected);
// console.log(isThere);
let ishashObj = {};
for (let i = 0; i < isThere.length; i++) {
let { tagnames, tagids } = isThere[i];
tagnames = tagnames.split('|');
tagids = tagids.split('|');
for (let j = 0; j < tagnames.length; j++) {
if (!ishashObj[tagnames[j]]) {
ishashObj[tagnames[j]] = tagids[j];
}
}
}
// console.log(ishashObj);
// for(let i=0;i<itemtagscombinationRes.length;i++){
// }
}
async function getProductDetails(id) {
// let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`, true);
if (resData.isError) {
loadingActions.removeLoader();
alert(resData.errorMsg.message);
return;
}
let res = resData.response;
res = JSON.parse(res.result);
console.log(res, 'productattributelist');
if (!res) {
loadingActions.removeLoader();
return;
};
let html = '';
for (let i = 0; i < res.length; i++) {
const currItem = res[i];
// parenttagid means under what label
// tag id means it know unquie id
const { parentattribute, parenttagid, tagid, attribute, productid } = currItem;
if (labels[parentattribute]) {
labels[parentattribute].items.push({
attribute,
tagid: tagid
});
} else {
labels[parentattribute] = {
id: parenttagid,
items: [{
attribute,
tagid: tagid
}]
};
html += getParentHTML(parentattribute, productid, parenttagid, i == 0);
}
}
$('#spec-container-details').html(html);
// console.log(labels,'labels');
let childIds = [];
for (let item in labels) {
let { id, items } = labels[item];
// $(`[data-tagid=${id}]`)
let html = '';
for (let i = 0; i < items.length; i++) {
const { attribute, tagid } = items[i]
childIds.push(tagid);
group[attribute] = item;
html += getChildHTML(tagid, attribute, i == 0);
}
$(`[data-tagid="${id}"]`).html(html);
}
itemtagscombinationRes = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
itemtagscombinationRes = JSON.parse(itemtagscombinationRes.response.result);
console.log(itemtagscombinationRes, "conductt");
let valuesSelected = [];
$('.borderselector').each(function (i, el) {
let val = $(el).html();
valuesSelected.push(val.trim());
});
let searchParams = window.location.search.split("&");
let skuId = window.location.hash.split('#')[1].split('=')[1];
// skuId = skuId.split('=')[1]
let isGo = true;
for (let i = 0; i < itemtagscombinationRes.length; i++) {
const currItem = itemtagscombinationRes[i];
const { tagnames, sku, itemid } = currItem;
isThereInLabel[tagnames] = itemtagscombinationRes[i];
let isTrue = true;
if (isGo) {
// for(let i=0;i<valuesSelected.length;i++){
// if(!tagnames.includes(valuesSelected[i])){
// isTrue = false
// }
// }
if (skuId != itemid) {
isTrue = false
}
if (isTrue) {
console.log(itemtagscombinationRes[i], 'itemtagscombinationRes[i]');
currentComb = itemtagscombinationRes[i];
// location.hash = itemtagscombinationRes[i].itemname.trim();
// $('.productname').html(itemtagscombinationRes[i].itemname);
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
// $('.price').html(itemtagscombinationRes[i].pricelist)
// appendSpecs(itemtagscombinationRes[i].itemid);
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
updateDetailsByObj(itemtagscombinationRes[i]);
isGo = false;
let { tagnames, tagids, pricelist } = itemtagscombinationRes[i];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
for (let i = 0; i < tagids.length; i++) {
$(`[data-tagiditem="${tagids[i]}"]`).addClass('borderselector');
}
// tagiditem
}
}
}
if (isGo && itemtagscombinationRes.length != 0) {
console.log(itemtagscombinationRes[0]);
let { tagnames, tagids, pricelist } = itemtagscombinationRes[0];
tagids = tagids.split('|');
tagnames = tagnames.split('|');
$('.optiontaganwi').removeClass('borderselector');
currentComb = itemtagscombinationRes[0];
// updateItemId(itemtagscombinationRes[0].itemid);
for (let i = 0; i < tagids.length; i++) {
$(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
$(`[data-type="${tagids[i]}-Eucalyptus Green"]`).removeClass('borderselector');
$(`[data-type="${tagids[i]}-Desert Brown"]`).removeClass('borderselector');
$(`[data-type="${tagids[i]}-Deep Sea Blue"]`).removeClass('borderselector');
}
// $('.price').html(pricelist);
// $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
// appendSpecs(itemtagscombinationRes[0].itemid);
updateDetailsByObj(itemtagscombinationRes[0]);
//console.log(childIds);
//
}
//getAllCombination(valuesSelected)
// for(let i=0;i<itemtagscombinationRes.length;i++){
// const {tagnames} = itemtagscombinationRes[i];
// }
$('#spec-container-details').children().find('.specsmallcard').removeClass('specsmallcard');
addeventlisteners();
loadingActions.removeLoader();
return;
// let resTwo = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`);
//let html = '';
let attributesObj = {};
for (let i = 0; i < res.length; i++) {
const { parentattribute, tagid, productid } = res[i];
// let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
// attributesObj[tagid] = JSON.parse(attributes.data.result);
// console.log(attributes.data.result,tagid);
html += getParentHTML(parentattribute, productid, tagid, i == 0);
}
$('#spec-container-details').html(html);
// let attributes = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/parenttagid/${tagid}`);
return;
for (let attr in attributesObj) {
const arr = attributesObj[attr];
let html = '';
for (let i = 0; i < arr.length; i++) {
const { attribute, tagid } = arr[i];
html += getChildHTML(tagid, attribute, i == 0);
}
$(`[data-tagid="${attr}"]`).html(html);
}
let defaultValues = await postStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/sellableitemlist/productid/${id}`);
defaultValues = JSON.parse(defaultValues.data.result);
let { itemname, price } = defaultValues[0];
$('.productname').html(itemname);
$('.price').html(price)
$('#spec-container-details').children().slice(1).find('.specsmallcard').removeClass('specsmallcard');
// getQuantityById(id)
}
}
startDetails();
+188
View File
@@ -0,0 +1,188 @@
function initAcc(){
INIT();
async function INIT(){
const productsIds = await getProductIds(['SSD ORA',"RAM ORA"]);
appendWithIds(productsIds);
}
async function appendWithIds(productsIds){
let html = '';
for(let i=0;i<productsIds.length;i++){
let productId = productsIds[i];
let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${productId}`,true);
if(res.isError){
alert("something went wrong");
return;
}
res = JSON.parse(res.response.result);
console.log(res);
for(let j=0;j<res.length;j++){
html += getRamCardHTML(res[j]);
}
}
$('.product_card_section').html(html)
}
async function getProductIds(productsIdReqArr){
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true);
if(resData.isError){
alert("Something went wrong");
return;
}
resData = JSON.parse(resData.response.result);
let productsIds = [];
for(let i=0;i<resData.length;i++){
let curr = resData[i];
let productname = curr.productname;
if(productsIdReqArr.includes(productname)){
productsIds.push(curr.productid)
}
}
console.log(productsIds);
console.log(resData);
return productsIds;
}
function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid}){
let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
let tags = itemname.split('-');
let ramTech = tags[tags.length-2];
let gb = tags[tags.length-1];
const [currencySymbol,amount] = getCurrencySymbol(pricelist);
let priceAmt = `${currencySymbol} ${amount}`;
let detailPageName;
let addSearch = '?';
if (window.location.href.includes('laptops')) {
detailPageName = 'laptopdetails';
let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
addSearch = `?${name}`;
} else {
detailPageName = 'productdetails';
};
debugger;
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100 p-5"></a>
<div class="card-body">
<a href="/${detailPageName}.html${addSearch}productId=${productid}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<hr>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font"> <h6>${gb}</h6> <h6>${ramTech}</h6></span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/${detailPageName}.html?productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
<div class="card-body">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font"> <h6>${gb}</h6> <h6>${ramTech}</h6></span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${priceAmt}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`;
//abhi anna design
return `
<!--desktop--->
<div class="col-sm-4 p-3">
<div class="product_card_3 shadow ram_card">
<div class="card-item-header">
<div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
<img src="${img}" class="w-100 h-100"></a>
</div>
</div>
<div class="card-item-body">
<h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" > ${itemname} </a></h3>
<hr>
<h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
<div class="py-2 card_product_footer">
<button data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM " data_version="DDR4" data_device="Desktop" data_gb="8GB" data_price="2900">Details </button>
</div>
</div>
</div>
</div>
`;
return `<div class="col-lg-3 col-md-6 ram_card">
<div class="card shadow border-0 p-1 h-100">
<a href="#">
<img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
</a>
<div class="card-body">
<a href="#" class="text-decoration-none text-dark">
<h5 class="card-title satoshi_font mb-0">
${itemname}
</h5>
</a>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">${gb} ${ramTech}</span>
</li>
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">3200 Mhz</span>
</li>
</ul>
<div class="card-body d-none">
<button class="btn--md btn-primary w-100 card-link">
<span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
</button>
</div>
<div class="card-body text-center">
<div data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
Memory, oering 3200 MHz speed in 8, 16,
and 32 GB capacities. Experience enhanced
thermal performance, increased longevity,
and superior performance with our
innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
</div>
</div>
</div>
</div>`
}
}
initAcc();
+316
View File
@@ -0,0 +1,316 @@
function ramProductsInit(){
let RAM_ID = '';
async function init(){
let id
if(location.search==''&&(location.href.includes('laptops')||location.href.includes('allinones'))){
id = await getallproductsFun();
}else{
id = await getProductIdService();
}
getRamData(id)
}
async function getProductsIds(nameArr){
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true);
if(resData.isError){
toasterHelper("error","Something went wrong!")
return;
}
let res = resData.response;
res = JSON.parse(res.result);
let ids = [];
for(let i=0;i<nameArr.length;i++){
const currName = nameArr[i];
let id = res.find((item)=>{
if(currName === item.productname){
return item.productid;
}
})
if(id){
ids.push(id);
}
}
return ids;
}
async function getallproductsFun(){
let laptopStr = ['FYRO Flagship','Zeno Dualbook','Zeno Sleekbook'];
let allInOnesStr = ['AIO Zeno','AIO Fyro'];
let name = window.location.href;
name = name.includes('laptops') ?laptopStr : allInOnesStr;
const ids = await getProductsIds(name);
console.log(ids);
return ids;
}
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);
return;
}
let res = resData.response;
res = JSON.parse(res.result);
console.log(res);
let searchName = window.location.search.split('?')[1];
let urlPathName = window.location.pathname;
let searchTerm = '';
if(urlPathName.includes('ram')){
searchTerm = "RAM ORA";
}else if(urlPathName.includes('storage')){
searchTerm = `SSD ORA`;
}else{
searchTerm = searchName.replaceAll('%20',' ');
}
let resultItem = [];
if(searchTerm.toLowerCase() === 'zeno'){
for(let i=0;i<res.length;i++){
if(res[i].productname.includes("Zeno Sleekbook")||res[i].productname.includes("Zeno Dualbook")){
resultItem.push( res[i])
}
}
return reslove(resultItem)
}else if(searchTerm.toLowerCase() === 'fyro'){
for(let i=0;i<res.length;i++){
if(res[i].productname.includes("FYRO Flagship")){
resultItem.push( res[i]);
return reslove(resultItem)
}
}
}else{
for(let i=0;i<res.length;i++){
if(res[i].productname.includes(searchTerm)){
resultItem.push( res[i])
}
}
return reslove(resultItem)
}
});
}
async function getRamData(ids){
let resData;
let res
let data = [];
let windowSearch = window.location.href;
for(let i=0;i<ids.length;i++){
let id = ids[i].productid;
if (windowSearch.includes('laptops')||windowSearch.includes('allinones')) {
resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
}
else {
resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`, true);
}
if(resData.isError){
alert(resData.errorMsg.message);
return;
}
res = resData.response;
res = JSON.parse(res.result);
data = [...data,...res];
}
console.log(data);
let html = '';
for(let i=0;i<data.length;i++){
if(data[i].itemname.includes('AIO Fyro - 32')) continue;
html += getRamCardHTML(data[i]);
}
$('.product_card_section').html(html);
if(window.location.href.includes("?AIO%20Fyro")){
$(".processor_name").text("i7 / i9");
$('.product_card_section div.ram_card').addClass("d-none");
$('.product_card_section div.ram_card:nth-child(1)').removeClass("d-none");
}
if(window.location.href.includes("?AIO%20Zeno")){
$('.product_card_section div.ram_card').addClass("d-none");
$('.product_card_section div.ram_card:nth-child(14)').removeClass("d-none");
$('.product_card_section div.ram_card:nth-child(15)').removeClass("d-none");
}
// $('.ramcard').click(function(e){
// let sku = $(e.target).data('itemid');
// let itemid = $(e.target).data('itemid');
// window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
// })
}
function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid}){
let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
let tags = itemname.split('-');
let ramTech = tags[tags.length-2];
let gb = tags[tags.length-1];
const [currencySymbol,amount] = getCurrencySymbol(pricelist);
let priceAmt = `${currencySymbol} ${amount}`;
let detailPageName;
debugger;
let addSearch = '';
if (window.location.href.includes('laptops')||window.location.href.includes('allinones')) {
detailPageName = 'laptopdetails';
let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
addSearch = `?${name}`;
} else {
// detailPageName = 'productdetails';
detailPageName = 'laptopdetails';
};
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class=""><img loading="lazy" src="${img}" alt="${itemname}" class="w-100 h-100 p-5"></a>
<div class="card-body">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<hr>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="mb-0 processor_name">i3 / 15 / i7</li>
</ul>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font">
<h6>${gb}</h6>
<h6 class="d-none">${ramTech}</h6>
</span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
<div class="card-body">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font"> <h6>${gb}</h6> <h6>${ramTech}</h6></span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${priceAmt}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`;
//abhi anna design
return `
<!--desktop--->
<div class="col-sm-4 p-3">
<div class="product_card_3 shadow ram_card">
<div class="card-item-header">
<div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
<img src="${img}" class="w-100 h-100"></a>
</div>
</div>
<div class="card-item-body">
<h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" > ${itemname} </a></h3>
<hr>
<h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
<div class="py-2 card_product_footer">
<button data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM " data_version="DDR4" data_device="Desktop" data_gb="8GB" data_price="2900">Details </button>
</div>
</div>
</div>
</div>
`;
return `<div class="col-lg-3 col-md-6 ram_card">
<div class="card shadow border-0 p-1 h-100">
<a href="#">
<img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
</a>
<div class="card-body">
<a href="#" class="text-decoration-none text-dark">
<h5 class="card-title satoshi_font mb-0">
${itemname}
</h5>
</a>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">${gb} ${ramTech}</span>
</li>
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">3200 Mhz</span>
</li>
</ul>
<div class="card-body d-none">
<button class="btn--md btn-primary w-100 card-link">
<span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
</button>
</div>
<div class="card-body text-center">
<div data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
Memory, oering 3200 MHz speed in 8, 16,
and 32 GB capacities. Experience enhanced
thermal performance, increased longevity,
and superior performance with our
innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
</div>
</div>
</div>
</div>`
}
init();
}
ramProductsInit();
+419
View File
@@ -0,0 +1,419 @@
function ramProductsInit(){
let RAM_ID = '';
async function init(){
let id
if(location.search==''&&(location.href.includes('laptops')||location.href.includes('allinones'))){
id = await getallproductsFun();
}else{
id = await getProductIdService();
}
getRamData(id)
}
async function getProductsIds(nameArr){
let resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/getallproducts`,true);
if(resData.isError){
toasterHelper("error","Something went wrong!")
return;
}
let res = resData.response;
res = JSON.parse(res.result);
let ids = [];
for(let i=0;i<nameArr.length;i++){
const currName = nameArr[i];
let id = res.find((item)=>{
if(currName === item.productname){
return item.productid;
}
})
if(id){
ids.push(id);
}
}
return ids;
}
async function getallproductsFun(){
let laptopStr = ['FYRO Flagship','Zeno Dualbook','Zeno Sleekbook'];
let allInOnesStr = ['AIO Zeno','AIO Fyro'];
let name = window.location.href;
name = name.includes('laptops') ?laptopStr : allInOnesStr;
const ids = await getProductsIds(name);
console.log(ids);
return ids;
}
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);
return;
}
let res = resData.response;
res = JSON.parse(res.result);
// console.log(res);
let searchName = window.location.search.split('?')[1];
let urlPathName = window.location.pathname;
let searchTerm = '';
if(urlPathName.includes('ram')){
searchTerm = "RAM ORA";
}else if(urlPathName.includes('storage')){
searchTerm = `SSD ORA`;
}else{
searchTerm = searchName.replaceAll('%20',' ');
}
let resultItem = [];
if(searchTerm.toLowerCase() === 'zeno'){
for(let i=0;i<res.length;i++){
if(res[i].productname.includes("Zeno Sleekbook")||res[i].productname.includes("Zeno Dualbook")){
resultItem.push( res[i])
}
}
return reslove(resultItem)
}else if(searchTerm.toLowerCase() === 'fyro'){
for(let i=0;i<res.length;i++){
if(res[i].productname.includes("FYRO Flagship")){
resultItem.push(res[i]);
return reslove(resultItem)
}
}
}else{
for(let i=0;i<res.length;i++){
if(res[i].productname.includes(searchTerm)){
resultItem.push(res[i])
}
}
return reslove(resultItem)
}
});
}
async function getRamData(ids){
let resData;
let res
let data = [];
let windowSearch = window.location.href;
for(let i=0;i<ids.length;i++){
let id = ids[i].productid;
if (windowSearch.includes('laptops')||windowSearch.includes('allinones')) {
resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/Bizgaze/integrations/products/getitemwithoutbranch/productid/${id}`, true);
}
else {
resData = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/bizgaze/integrations/products/itemtagscombination/productid/${id}`, true);
}
if(resData.isError){
alert(resData.errorMsg.message);
return;
}
res = resData.response;
res = JSON.parse(res.result);
data = [...data,...res];
}
console.log(data);
let html = '';
for(let i=0;i<data.length;i++){
console.log(data[i].tagids);
let tags_id = data[i].tagids;
let tags_filter = tags_id.includes("106631360000087");
let tags_filter_2 = tags_id.includes("106631360000088");
let tags_filter_3 = tags_id.includes("106631360000089");
if(tags_filter == false && tags_filter_2 == false && tags_filter_3 == false){
if(data[i].itemname.includes('AIO Fyro - 32')) continue;
html += getRamCardHTML(data[i]);
}
else{
let data_name = tags_id.includes("106631360000087");
let name_id = data[i].tagids.includes("106631360000087");
if(data_name === true && name_id === true){
for(let j=0;j<data.length;j++){
if(j==0){
if(data[j].itemname.includes('AIO Fyro - 32')) continue;
html += getRamCardHTML(data[i]);
}
}
}
}
}
$('.product_card_section').html(html);
if(window.location.href.includes("?Zeno")){
$('.product_card_section div.ram_card:nth-child(1)').addClass("d-none");
$('.product_card_section div.ram_card:nth-child(6)').addClass("d-none");
}
if(window.location.href.includes("?FYRO")){
$('.product_card_section div.ram_card:nth-child(3)').addClass("d-none");
$('.product_card_section div.ram_card:nth-child(7)').addClass("d-none");
$('.product_card_section div.ram_card:nth-child(8)').addClass("d-none");
}
// $('.ramcard').click(function(e){
// let sku = $(e.target).data('itemid');
// let itemid = $(e.target).data('itemid');
// window.location.href = `/productdetails.html?productId=${RAM_ID}#itemid=${itemid}`
// })
}
function getRamCardHTML({itemname,pricelist,itemid,sku,itemimageurl,productid,tagnames}){
let img = itemimageurl ? imgServerNameBuild(itemimageurl) : './dist/assets/imgs/nophoto.png'
let tags = itemname.split('-');
let ramTech = tags[tags.length-2];
let tag_name = tagnames.split('|');
let gb = tags[tags.length-1];
const [currencySymbol,amount] = getCurrencySymbol(pricelist);
let priceAmt = `${currencySymbol} ${amount}`;
let detailPageName;
let addSearch = '';
if (window.location.href.includes('laptops')) {
detailPageName = 'laptopdetails';
let name = itemname.toLowerCase().includes('zeno') ? 'Zeno' : 'Fyro';
addSearch = `?${name}`;
} else {
detailPageName = 'productdetails';
};
let color_name = tag_name[tag_name.length-1].trim();
let processor_name1 = tagnames.includes("i7");
let processor_name2 = tagnames.includes("i5");
let processor_name3 = tagnames.includes("i3");
let dul_core = itemname.includes("Zeno Dualbook");
let processor;
if( processor_name1 === true){
if(dul_core === true){
processor = `i7`
}else{
processor = `i5 / i7`
}
}else if( processor_name2 === true){
if(dul_core === true){
processor = `i7`
}else{
processor = `i5 / i7`
}
}else if( processor_name3 === true){
processor = `i3`
}
else if(itemname.includes("I7") || itemname.includes("i7")){
let fyro_data_2 = itemname.includes("RTX 4060");
if(fyro_data_2 === true){
processor = `i5 / i7 / i9`
}else{
processor = `i5 / i7`
}
}else if(itemname.includes("I9") || itemname.includes("i9")){
let fyro_data_1 = itemname.includes("RTX 4050");
let fyro_data_2 = itemname.includes("RTX 4060");
if(fyro_data_1 === true || fyro_data_2 === true){
processor = `i5 / i7 / i9`
}else{
processor = `i9`
}
}else if(itemname.includes("I5") || itemname.includes("i5")){
let fyro_data = itemname.includes("RTX 4060");
if(fyro_data === true){
processor = `i5 / i7 / i9`
}
else{
processor = `i5 / i7 / i9`
}
}
let item_color_1;
let item_color_2;
let item_color_3;
let item_color_4;
if(color_name == "Eucalyptus Green" || color_name == "Desert Brown"){
item_color_1 = `#5e7975`;
item_color_2 = `#624839`;
item_color_3 = `#253746`;
}else if( color_name == "Deep Sea Blue"){
item_color_1 = `#5e7975`;
item_color_2 = `#624839`;
item_color_3 = `#253746`;
}
else{
if(color_name.length <=14){
item_color_4 = ``;
}else{
item_color_4 = `#0d0a08`;
}
}
debugger;
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
<img src="${img}" alt="${itemname}" class="p-5" style="width:350px;height:300px"></a>
<div class="card-body">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<hr>
<ul class="border-0 mb-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="processor_name"><img src="../dist/assets/imgs/processor.svg" class="w-20p pe-1"/><span class="pt-1">${processor?processor:""}</span></li>
<li class="d-flex justify-content-between">
<p item_color=${item_color_1} class="colors mb-0 me-1" ${item_color_1?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_1}"`:''}></p>
<p item_color=${item_color_2} class="mb-0 me-1" ${item_color_2?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_2}"`:''}></p>
<p item_color=${item_color_3} class="mb-0" ${item_color_3?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_3}"`:''}></p>
<p item_color=${item_color_4} class="mb-0" ${item_color_4?`style="width:18px;height:18px;border-radius:0%;background-color:${item_color_4}"`:''}></p>
</li>
</ul>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font">
<h6><img src="../dist/assets/imgs/laptop-icon.png" class="w-20p pe-1"/>${gb}</h6>
</span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${pricelist?priceAmt:'Comming Soon'}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/${detailPageName}.html${addSearch}#productId=${productid}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`;
return `<div class="col-lg-4 col-md-6 mb-4 col-md-6 ram_card cursor-pointer">
<div class="card border bg-gray-3 rounded-3 p-1 h-100">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class=""><img src="${img}" alt="${itemname}" class="w-100 h-100"></a>
<div class="card-body">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="">
<h5 class="card-title satoshi_font mb-0 px-2 text-center font-weight-600">${itemname}</h5>
</a>
</div>
<ul class="border-0 d-flex h-100 justify-content-between px-md-3 px-4 list-group-flush p-0 text-secondary" style="list-style: none;">
<li class="border-0 py-0">
<span class="satoshi_font"> <h6>${gb}</h6> <h6>${ramTech}</h6></span>
</li>
<li class="border-0 py-0">
<span class="satoshi_font"><h6>${priceAmt}</h6></span>
</li>
</ul>
<div class="card-body text-center">
<a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="btn bg-white font-1-2 px-5 w-100">Details
</a>
</div>
</div>
</div>`;
//abhi anna design
return `
<!--desktop--->
<div class="col-sm-4 p-3">
<div class="product_card_3 shadow ram_card">
<div class="card-item-header">
<div class="card-header-sub-3"><a class=" py-md-1" href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}">
<img src="${img}" class="w-100 h-100"></a>
</div>
</div>
<div class="card-item-body">
<h3 cclass="mb-2"> <a href="/productdetails.html?productId=${RAM_ID}#itemid=${itemid}" class="" > ${itemname} </a></h3>
<hr>
<h6>${gb}</h6> <h6>${ramTech}</h6><h6>${priceAmt}</h6>
<div class="py-2 card_product_footer">
<button data-sku="${sku}" data-itemid="${itemid}" class="w-100 border-0 ramcard bg-transparent satoshi_font ram_btn" data_name="ORA 8GB DDR4 3200MHz Desktop RAM " data_version="DDR4" data_device="Desktop" data_gb="8GB" data_price="2900">Details </button>
</div>
</div>
</div>
</div>
`;
return `<div class="col-lg-3 col-md-6 ram_card">
<div class="card shadow border-0 p-1 h-100">
<a href="#">
<img src="../dist/assets/imgs/Navbar/ora_ddr5_laptop.png" class="card-img-top" alt="...">
</a>
<div class="card-body">
<a href="#" class="text-decoration-none text-dark">
<h5 class="card-title satoshi_font mb-0">
${itemname}
</h5>
</a>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">${gb} ${ramTech}</span>
</li>
<li class="list-group-item border-0 py-0">
<span class="satoshi_font">3200 Mhz</span>
</li>
</ul>
<div class="card-body d-none">
<button class="btn--md btn-primary w-100 card-link">
<span class="cost currency-symbol">₹</span><span class="cost product-price satoshi_font">${pricelist}</span>
</button>
</div>
<div class="card-body text-center">
<div data-sku="${sku}" data-itemid="${itemid}" class="bg-black ramcard btn font-1-2 px-5 text-white w-100 satoshi_font" data_des="Upgrade your laptop with DDR4 Laptop
Memory, oering 3200 MHz speed in 8, 16,
and 32 GB capacities. Experience enhanced
thermal performance, increased longevity,
and superior performance with our
innovative graphene sticker technology." data_name="ORA 8GB DDR4 3200MHz Laptop RAM ">Details
</div>
</div>
</div>
</div>`
}
init();
}
ramProductsInit();
+29
View File
@@ -0,0 +1,29 @@
function supportTicketNoInit(){
let ticketId = null;
INIT();
function INIT(){
ticketId = window.location.search.split("=")[1];
getTicketData(ticketId);
}
async function getTicketData(id){
let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/products/getticketdetails/ticketno/${id}`);
if(res.isError){
toasterHelper("error",res.errorMsg,`toast-top-right`);
return;
}
res = JSON.parse(res.response.result)[0];
$('.description_support').html(res['Description']);
$('.ticketidsupport').html(res['ticketno']);
$('.raiseddate').html(res['Raised Date']);
console.log(res);
}
}
supportTicketNoInit();
Binary file not shown.

After

Width:  |  Height:  |  Size: 740 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28.82 14.41">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g>
<path class="cls-1" d="M4.8,4.32c0-.07,.02-.15,.05-.22,.1-.2,.33-.3,.55-.24l6.6,1.76V3.36c0-.19,.11-.35,.28-.43s.37-.05,.51,.06l8.16,6.72c.17,.14,.23,.39,.12,.59-.1,.2-.33,.3-.55,.24l-6.6-1.76v2.26c0,.19-.11,.35-.28,.43s-.37,.05-.51-.06L4.98,4.69c-.11-.09-.17-.23-.17-.37Zm8.16,.06v1.86c0,.15-.07,.29-.19,.38-.12,.09-.27,.12-.42,.08l-5.07-1.35,5.67,4.67v-1.86c0-.15,.07-.29,.19-.38,.12-.09,.27-.12,.42-.08l5.07,1.35-5.67-4.67Z"/>
<path class="cls-1" d="M25.93,10.09V4.32c0-.27,.22-.48,.48-.48h1.92c.27,0,.48,.22,.48,.48v5.76c0,.27-.22,.48-.48,.48h-1.92c-.27,0-.48-.22-.48-.48Zm.96-5.28v4.8h.96V4.8h-.96Z"/>
<path class="cls-1" d="M0,12.57V1.84C0,.83,.83,0,1.84,0H25.05c1.01,0,1.84,.83,1.84,1.84V12.57c0,1.01-.83,1.84-1.84,1.84H1.84c-1.01,0-1.84-.83-1.84-1.84ZM25.93,1.84c0-.48-.39-.88-.88-.88H1.84c-.49,0-.88,.39-.88,.88V12.57c0,.49,.39,.88,.88,.88H25.05c.49,0,.88-.39,.88-.88V1.84h0Z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.56 26.8">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g>
<path class="cls-1" d="M25.56,20.53c0-1.05-.86-1.91-1.91-1.91h-3.75c-.33,0-.59,.26-.59,.59s.26,.59,.59,.59h3.75c.41,0,.73,.33,.73,.73v1.71c0,.41-.33,.73-.73,.73H1.91c-.41,0-.73-.33-.73-.73v-1.71c0-.41,.33-.73,.73-.73h15.23c.33,0,.59-.26,.59-.59s-.26-.59-.59-.59H1.91c-1.06,0-1.91,.86-1.91,1.91v1.71c0,.51,.2,.98,.53,1.32-.33,.34-.53,.81-.53,1.32,0,1.05,.86,1.91,1.91,1.91H23.65c1.06,0,1.91-.86,1.91-1.91,0-.51-.2-.98-.53-1.32,.33-.34,.53-.81,.53-1.32v-1.71Zm-1.91,5.09H1.91c-.41,0-.73-.33-.73-.73s.33-.73,.73-.73H23.65c.41,0,.73,.33,.73,.73s-.33,.73-.73,.73h0Z"/>
<g>
<path class="cls-1" d="M2.48,9.27c.86,.95,1.68,1.84,1.84,2.95,.35,2.51-1.76,4.56-1.78,4.58-.21,.2-.18,.5,.07,.67,.11,.07,.25,.11,.38,.11,.17,0,.33-.06,.45-.17,.1-.1,2.46-2.38,2.05-5.3-.19-1.37-1.14-2.4-2.06-3.41-.86-.94-1.67-1.83-1.77-2.91C1.36,2.53,3.88,.92,4,.85c.26-.16,.31-.45,.11-.66-.2-.21-.57-.25-.83-.09C3.15,.18,.13,2.07,.48,5.87c.12,1.35,1.08,2.39,2,3.4h0Z"/>
<path class="cls-1" d="M7.25,9.27c.86,.95,1.68,1.84,1.84,2.95,.35,2.51-1.76,4.56-1.78,4.58-.21,.2-.18,.5,.07,.67,.11,.07,.25,.11,.38,.11,.17,0,.33-.06,.45-.17,.1-.1,2.46-2.38,2.05-5.3-.19-1.37-1.14-2.4-2.06-3.41-.86-.94-1.67-1.83-1.77-2.91-.02-.26-.31-.46-.63-.44-.32,.02-.57,.25-.54,.51,.12,1.35,1.08,2.39,2,3.4h0Z"/>
<path class="cls-1" d="M12.02,9.27c.86,.95,1.68,1.84,1.84,2.95,.35,2.51-1.76,4.56-1.78,4.58-.21,.2-.18,.5,.07,.67,.11,.07,.25,.11,.38,.11,.17,0,.33-.06,.45-.17,.1-.1,2.46-2.38,2.05-5.3-.19-1.37-1.14-2.4-2.06-3.41-.86-.94-1.67-1.83-1.77-2.91-.3-3.27,2.24-4.88,2.34-4.95,.26-.16,.31-.45,.11-.66-.2-.21-.57-.25-.83-.09-.13,.08-3.15,1.97-2.8,5.77,.12,1.35,1.08,2.39,2,3.4h0Z"/>
<path class="cls-1" d="M16.79,9.27c.86,.95,1.68,1.84,1.84,2.95,.35,2.51-1.76,4.56-1.78,4.58-.21,.2-.18,.5,.07,.67,.11,.07,.25,.11,.38,.11,.17,0,.33-.06,.45-.17,.1-.1,2.46-2.38,2.05-5.3-.19-1.37-1.14-2.4-2.06-3.41-.86-.94-1.67-1.83-1.77-2.91-.3-3.26,2.22-4.87,2.34-4.95,.26-.16,.31-.45,.11-.66-.2-.21-.57-.25-.83-.09-.13,.08-3.15,1.97-2.8,5.77,.12,1.35,1.08,2.39,2,3.4h0Z"/>
<path class="cls-1" d="M22.73,9.74c-.28,.14-.36,.43-.19,.65,.51,.66,.78,1.24,.87,1.83,.35,2.51-1.76,4.56-1.78,4.58-.21,.2-.18,.5,.07,.67,.11,.07,.25,.11,.38,.11,.17,0,.33-.06,.45-.17,.1-.1,2.46-2.38,2.05-5.3-.1-.73-.43-1.44-1.03-2.22-.17-.22-.53-.29-.81-.15h0Z"/>
<path class="cls-1" d="M20.15,6.3s.03,0,.04,0c.32-.02,.57-.25,.54-.51-.3-3.27,2.23-4.88,2.34-4.95,.26-.16,.31-.45,.11-.66-.2-.21-.57-.25-.83-.09-.13,.08-3.15,1.97-2.8,5.77,.02,.25,.28,.44,.59,.44h0Z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28.94 28.94">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<path class="cls-1" d="M4.26,25.53H24.68c2.35,0,4.26-1.91,4.26-4.26V7.66c0-2.35-1.91-4.26-4.26-4.26H4.26C1.91,3.4,0,5.31,0,7.66v13.62c0,2.35,1.91,4.26,4.26,4.26h0ZM1.7,7.66c0-1.41,1.14-2.55,2.55-2.55H24.68c1.41,0,2.55,1.14,2.55,2.55v13.62c0,1.41-1.14,2.55-2.55,2.55H4.26c-1.41,0-2.55-1.14-2.55-2.55V7.66ZM24.68,28.94H4.26c-.47,0-.85-.38-.85-.85s.38-.85,.85-.85H24.68c.47,0,.85,.38,.85,.85s-.38,.85-.85,.85h0ZM24.68,0c.47,0,.85,.38,.85,.85s-.38,.85-.85,.85H4.26c-.47,0-.85-.38-.85-.85s.38-.85,.85-.85H24.68Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 794 B

+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43.76 34.53">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g>
<path class="cls-1" d="M42.91,18.8h-3.76v-.95c0-.47-.38-.85-.85-.85s-.85,.38-.85,.85v.95h-14.7v-.95c0-.47-.38-.85-.85-.85s-.85,.38-.85,.85v.95H6.33v-.95c0-.47-.38-.85-.85-.85s-.85,.38-.85,.85v.95H.85c-.47,0-.85,.38-.85,.85s.38,.85,.85,.85H42.91c.47,0,.85-.38,.85-.85s-.38-.85-.85-.85h0Z"/>
<path class="cls-1" d="M4.27,15.73H12.83v.95c0,.47,.38,.85,.85,.85s.85-.38,.85-.85v-.95h14.7v.95c0,.47,.38,.85,.85,.85s.85-.38,.85-.85v-.95h11.96c.47,0,.85-.38,.85-.85s-.38-.85-.85-.85H4.27c-.47,0-.85,.38-.85,.85s.38,.85,.85,.85h0Z"/>
<path class="cls-1" d="M.85,15.73c.22,0,.45-.09,.6-.25,.16-.16,.25-.38,.25-.6s-.09-.45-.25-.6c-.16-.16-.38-.25-.6-.25s-.45,.09-.6,.25c-.16,.16-.25,.38-.25,.6s.09,.45,.25,.6c.16,.16,.38,.25,.6,.25H.85Z"/>
<path class="cls-1" d="M21.28,11.37c.17,.17,.39,.25,.6,.25s.44-.08,.6-.25l1.9-1.9c.33-.33,.33-.88,0-1.21-.33-.33-.88-.33-1.21,0l-.44,.44V.85c0-.47-.38-.85-.85-.85s-.85,.38-.85,.85v7.85l-.44-.44c-.33-.33-.87-.33-1.21,0-.33,.33-.33,.88,0,1.21l1.9,1.9Z"/>
<path class="cls-1" d="M22.49,23.1c-.33-.33-.87-.33-1.21,0l-1.9,1.9c-.33,.33-.33,.87,0,1.21,.33,.33,.88,.33,1.21,0l.44-.44v4.49c0,.47,.38,.85,.85,.85s.85-.38,.85-.85v-4.49l.44,.44c.17,.17,.39,.25,.6,.25s.44-.08,.6-.25c.33-.33,.33-.88,0-1.21l-1.9-1.9Z"/>
<path class="cls-1" d="M21.88,32.82c-.22,0-.45,.09-.6,.25-.16,.16-.25,.38-.25,.6s.09,.45,.25,.6c.16,.16,.38,.25,.6,.25s.45-.09,.6-.25c.16-.16,.25-.38,.25-.6s-.09-.45-.25-.6c-.16-.16-.38-.25-.6-.25h0Z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28.16 28.16">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g id="Group_4475" data-name="Group 4475">
<path id="Path_11558" data-name="Path 11558" class="cls-1" d="M12.32,28.16c-.32,0-.59-.26-.59-.59v-4.69c0-.32,.26-.59,.59-.59,.32,0,.59,.26,.59,.59h0v4.69c0,.32-.26,.59-.59,.59"/>
<path id="Path_11559" data-name="Path 11559" class="cls-1" d="M15.84,28.16c-.32,0-.59-.26-.59-.59v-4.69c0-.32,.26-.59,.59-.59,.32,0,.58,.26,.59,.59v4.69c0,.32-.26,.59-.59,.59"/>
<path id="Path_11560" data-name="Path 11560" class="cls-1" d="M19.36,28.16H8.8c-.32,0-.59-.26-.59-.59,0-.32,.26-.59,.59-.59h10.56c.32,0,.59,.26,.59,.59,0,.32-.26,.58-.59,.59"/>
<path id="Path_11561" data-name="Path 11561" class="cls-1" d="M26.4,23.46H1.76c-.97,0-1.76-.79-1.76-1.76V6.45c0-.97,.79-1.76,1.76-1.76H6.45c.32,0,.59,.26,.59,.59s-.26,.59-.59,.59H1.76c-.32,0-.59,.26-.59,.59v15.25c0,.32,.26,.59,.59,.59H26.4c.32,0,.59-.26,.59-.59V6.45c0-.32-.26-.59-.59-.59h-1.17c-.32,0-.59-.26-.59-.59s.26-.59,.59-.59h1.17c.97,0,1.76,.79,1.76,1.76v15.25c0,.97-.79,1.76-1.76,1.76"/>
<path id="Path_11562" data-name="Path 11562" class="cls-1" d="M14.97,13.89c-.16,0-.3-.06-.42-.17l-4.22-4.22c-.22-.22-.23-.58-.02-.81l3.46-3.84C16.22,2.02,20.12,.06,23.45,0c.16,0,.32,.06,.43,.17,.11,.11,.17,.27,.17,.43-.06,3.33-2.02,7.23-4.86,9.69l-3.83,3.45c-.11,.1-.25,.15-.39,.15m-3.41-4.83l3.43,3.43,3.42-3.08c2.44-2.11,4.16-5.33,4.43-8.2-2.87,.27-6.09,1.99-8.19,4.42l-3.09,3.43Z"/>
<path id="Path_11563" data-name="Path 11563" class="cls-1" d="M16.55,16.67c-.05,0-.11,0-.16-.02-.2-.06-.36-.22-.41-.43l-.83-3.46c-.08-.32,.12-.63,.43-.71,.32-.08,.63,.12,.71,.43l.55,2.3c1.02-1.59,1.22-3.63,1.24-4.83,.02-.32,.28-.57,.6-.58,.32,0,.58,.27,.57,.6-.05,2.78-.86,5.09-2.29,6.52-.11,.11-.26,.17-.41,.17"/>
<path id="Path_11564" data-name="Path 11564" class="cls-1" d="M11.43,8.92s-.09,0-.14-.02l-3.46-.83c-.31-.07-.51-.39-.43-.7,.03-.11,.08-.2,.16-.28,1.43-1.43,3.74-2.24,6.52-2.29,.32,0,.58,.26,.6,.58,0,.32-.25,.59-.58,.6,0,0,0,0,0,0-1.19,.02-3.23,.22-4.83,1.24l2.3,.55c.32,.08,.51,.39,.43,.71-.06,.26-.3,.45-.57,.45"/>
<path id="Path_11565" data-name="Path 11565" class="cls-1" d="M7.04,17.6c-.32,0-.59-.26-.59-.58,0-.06,0-.12,.02-.17,.19-.65,1.2-3.92,1.99-4.7,.95-.95,2.5-.95,3.45,0s.95,2.5,0,3.45h0c-.79,.79-4.06,1.79-4.7,1.99-.05,.02-.11,.02-.17,.02m3.15-5c-.34,0-.66,.13-.89,.37-.33,.33-.91,1.8-1.35,3.14,1.34-.45,2.81-1.02,3.14-1.35,.49-.49,.49-1.29,0-1.79-.24-.24-.56-.37-.89-.37"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27.74 27.74">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g id="Group_4479" data-name="Group 4479">
<path id="Path_11569" data-name="Path 11569" class="cls-1" d="M10.63,18.95h-1.85v-1.85c0-.26-.21-.46-.46-.46h-1.85c-.26,0-.46,.21-.46,.46v1.85h-1.85c-.26,0-.46,.21-.46,.46v1.85c0,.26,.21,.46,.46,.46h1.85v1.85c0,.26,.21,.46,.46,.46h1.85c.26,0,.46-.21,.46-.46v-1.85h1.85c.26,0,.46-.21,.46-.46v-1.85c0-.26-.21-.46-.46-.46m-.46,1.85h-1.85c-.26,0-.46,.21-.46,.46v1.85h-.92v-1.85c0-.26-.21-.46-.46-.46h-1.85v-.92h1.85c.26,0,.46-.21,.46-.46v-1.85h.92v1.85c0,.26,.21,.46,.46,.46h1.85v.92Z"/>
<path id="Path_11570" data-name="Path 11570" class="cls-1" d="M27.69,19.49c-.35-3.19-3.35-6.17-6.53-6.51-.27-.03-.54-.05-.82-.05h-5.09v-1.85h-.92v-.92c0-1.02-.83-1.85-1.85-1.85h-2.31c-.51,0-.92-.43-.91-.94,0-.5,.41-.9,.91-.91h7.4c1.02,0,1.85-.83,1.85-1.85s-.83-1.85-1.85-1.85h-2.31c-.51,0-.92-.41-.92-.92h0V0h-.92V1.85c0,1.02,.83,1.85,1.85,1.85h2.31c.51,0,.93,.4,.94,.91,0,.51-.4,.93-.91,.94-.01,0-.02,0-.03,0h-7.4c-1.02,0-1.85,.83-1.85,1.85s.83,1.85,1.85,1.85h2.31c.51,0,.93,.41,.93,.92,0,0,0,0,0,0v.92h-.93v1.85H7.4c-.27,0-.55,.02-.82,.05C3.39,13.33,.4,16.31,.05,19.5c-.46,4.06,2.45,7.72,6.51,8.19,1.65,.19,3.32-.18,4.73-1.06,.61-.4,1.3-.64,2.03-.72,.36-.03,.72-.03,1.07,0,.74,.07,1.44,.32,2.06,.73,3.47,2.15,8.03,1.07,10.18-2.4,.87-1.41,1.25-3.08,1.06-4.73m-14.28-7.48h.92v.92h-.92v-.92Zm11.76,12.63c-2.09,2.34-5.56,2.84-8.22,1.19-.74-.48-1.6-.78-2.48-.86-.2-.01-.39-.02-.59-.02-.21,0-.42,0-.62,.02-.87,.08-1.71,.38-2.44,.85-3.04,1.88-7.03,.94-8.91-2.1-.77-1.24-1.09-2.7-.93-4.14,.3-2.74,2.97-5.4,5.71-5.69,.24-.03,.48-.04,.72-.04h12.94c.24,0,.48,.01,.72,.04,2.74,.29,5.41,2.95,5.71,5.69,.22,1.84-.37,3.68-1.61,5.06"/>
<path id="Path_11571" data-name="Path 11571" class="cls-1" d="M20.34,15.72c-1.02,0-1.85,.83-1.85,1.85s.83,1.85,1.85,1.85,1.85-.83,1.85-1.85h0c0-1.02-.83-1.85-1.85-1.85m0,2.77c-.51,0-.92-.41-.92-.92s.41-.92,.92-.92,.92,.41,.92,.92h0c0,.51-.41,.92-.92,.92h0"/>
<path id="Path_11572" data-name="Path 11572" class="cls-1" d="M20.34,21.26c-1.02,0-1.85,.83-1.85,1.85s.83,1.85,1.85,1.85,1.85-.83,1.85-1.85h0c0-1.02-.83-1.85-1.85-1.85m0,2.77c-.51,0-.92-.41-.92-.92s.41-.92,.92-.92,.92,.41,.92,.92h0c0,.51-.41,.92-.92,.92h0"/>
<path id="Path_11573" data-name="Path 11573" class="cls-1" d="M17.1,18.49c-1.02,0-1.85,.83-1.85,1.85s.83,1.85,1.85,1.85,1.85-.83,1.85-1.85h0c0-1.02-.83-1.85-1.85-1.85m0,2.77c-.51,0-.92-.41-.92-.92s.41-.92,.92-.92,.92,.41,.92,.92h0c0,.51-.41,.92-.92,.92h0"/>
<path id="Path_11574" data-name="Path 11574" class="cls-1" d="M23.58,18.49c-1.02,0-1.85,.83-1.85,1.85s.83,1.85,1.85,1.85,1.85-.83,1.85-1.85h0c0-1.02-.83-1.85-1.85-1.85m0,2.77c-.51,0-.92-.41-.92-.92s.41-.92,.92-.92,.92,.41,.92,.92h0c0,.51-.41,.92-.92,.92h0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 27.87 27.87">
<defs>
<style>
.cls-1 {
fill: #fff;
}
.cls-2 {
clip-path: url(#clippath);
}
.cls-3 {
fill: none;
}
</style>
<clipPath id="clippath">
<rect class="cls-3" width="27.87" height="27.87"/>
</clipPath>
</defs>
<g id="Layer_1-2" data-name="Layer 1">
<g id="Group_4492" data-name="Group 4492">
<g class="cls-2">
<g id="Group_4477" data-name="Group 4477">
<path id="Path_11566" data-name="Path 11566" class="cls-1" d="M10.22,22.69c.32,.23,.77,.2,1.05-.08l8.1-8.1c.32-.32,.32-.83,0-1.14-.09-.09-.2-.16-.32-.2l-3.97-1.33,2.82-5.65c.2-.4,.04-.89-.36-1.09-.31-.16-.69-.09-.93,.15L8.5,13.36c-.32,.32-.32,.83,0,1.14,.09,.09,.2,.16,.32,.2l3.97,1.33-2.82,5.65c-.18,.36-.07,.79,.25,1.02"/>
<path id="Path_11567" data-name="Path 11567" class="cls-1" d="M26.14,13.94c0,.45,.35,.82,.79,.83,.45,0,.82-.35,.83-.79,0-.01,0-.02,0-.03C27.78,6.32,21.62,.13,14.01,.11c-4.12-.01-8.03,1.82-10.66,5v-.89c0-.45-.35-.82-.79-.83-.45,0-.82,.35-.83,.79,0,.01,0,.02,0,.03v3.44c0,.77,1,.88,.81,.81h.05l3.24-.2c.45-.03,.79-.41,.76-.86-.03-.45-.41-.79-.86-.76l-1.64,.1C8.05,1.31,15.68,.11,21.12,4.07c3.16,2.3,5.02,5.97,5.02,9.87"/>
<path id="Path_11568" data-name="Path 11568" class="cls-1" d="M13.94,27.76c4.09-.03,7.96-1.86,10.58-5v.89c0,.45,.38,.8,.83,.79,.43,0,.78-.36,.79-.79v-3.44c-.02-.46-.4-.82-.86-.81l-3.24,.2c-.45,.03-.79,.41-.76,.86,.03,.44,.41,.78,.86,.76l1.64-.1c-3.96,5.44-11.59,6.65-17.03,2.68-3.16-2.3-5.02-5.97-5.02-9.87,0-.45-.35-.82-.79-.83-.45,0-.82,.35-.83,.79,0,.01,0,.02,0,.03,.03,7.62,6.2,13.79,13.82,13.82"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 444.462 444.462" xml:space="preserve">
<g>
<path d="M317.166,119.796H127.297c-4.143,0-7.5,3.358-7.5,7.5v189.869c0,4.142,3.357,7.5,7.5,7.5h189.869
c4.143,0,7.5-3.358,7.5-7.5V127.296C324.666,123.154,321.309,119.796,317.166,119.796z M309.666,309.666H134.797V134.796h174.869
V309.666z"/>
<path d="M185.887,266.076h72.689c4.143,0,7.5-3.358,7.5-7.5v-72.689c0-4.142-3.357-7.5-7.5-7.5h-72.689c-4.143,0-7.5,3.358-7.5,7.5
v72.689C178.387,262.718,181.744,266.076,185.887,266.076z M193.387,193.386h57.689v57.689h-57.689V193.386z"/>
<path d="M305.524,15c6.96,0,10.082-9.068,4.637-13.389c-5.408-4.292-13.535,0.832-11.948,7.579
C299.004,12.547,302.068,15,305.524,15z"/>
<path d="M143.104,430.73c-2.454-1.616-5.649-1.661-8.146-0.113c-2.891,1.792-4.211,5.471-3.135,8.698
c0.978,2.93,3.715,5.015,6.809,5.138c3.191,0.127,6.143-1.826,7.299-4.794C147.185,436.437,146,432.636,143.104,430.73z"/>
<path d="M436.962,188.086c4.143,0,7.5-3.358,7.5-7.5s-3.357-7.5-7.5-7.5h-82.296v-26.645h82.296c4.143,0,7.5-3.358,7.5-7.5
s-3.357-7.5-7.5-7.5h-82.296v-5.392c0-19.99-16.264-36.253-36.254-36.253h-5.392V31.6c0-4.142-3.357-7.5-7.5-7.5
s-7.5,3.358-7.5,7.5v58.196h-26.645V7.5c0-4.142-3.357-7.5-7.5-7.5s-7.5,3.358-7.5,7.5v82.296h-26.645V7.5
c0-4.142-3.357-7.5-7.5-7.5s-7.5,3.358-7.5,7.5v82.296h-26.646V7.5c0-4.142-3.357-7.5-7.5-7.5s-7.5,3.358-7.5,7.5v82.296h-26.645
V7.5c0-4.142-3.357-7.5-7.5-7.5s-7.5,3.358-7.5,7.5v82.296h-5.392c-19.99,0-36.253,16.263-36.253,36.253v5.392H7.5
c-4.143,0-7.5,3.358-7.5,7.5s3.357,7.5,7.5,7.5h82.297v26.645H7.5c-4.143,0-7.5,3.358-7.5,7.5s3.357,7.5,7.5,7.5h82.297v26.645H7.5
c-4.143,0-7.5,3.358-7.5,7.5s3.357,7.5,7.5,7.5h82.297v26.645H7.5c-4.143,0-7.5,3.358-7.5,7.5s3.357,7.5,7.5,7.5h82.297v26.645H7.5
c-4.143,0-7.5,3.358-7.5,7.5s3.357,7.5,7.5,7.5h82.297v5.392c0,19.99,16.263,36.253,36.253,36.253h5.392v58.197
c0,4.142,3.357,7.5,7.5,7.5s7.5-3.358,7.5-7.5v-58.197h26.645v82.296c0,4.142,3.357,7.5,7.5,7.5s7.5-3.358,7.5-7.5v-82.296h26.646
v82.296c0,4.142,3.357,7.5,7.5,7.5s7.5-3.358,7.5-7.5v-82.296h26.645v82.296c0,4.142,3.357,7.5,7.5,7.5s7.5-3.358,7.5-7.5v-82.296
h26.645v82.296c0,4.142,3.357,7.5,7.5,7.5s7.5-3.358,7.5-7.5v-82.296h5.392c19.99,0,36.254-16.263,36.254-36.253v-5.392h82.296
c4.143,0,7.5-3.358,7.5-7.5s-3.357-7.5-7.5-7.5h-82.296v-26.645h82.296c4.143,0,7.5-3.358,7.5-7.5s-3.357-7.5-7.5-7.5h-82.296
v-26.645h82.296c4.143,0,7.5-3.358,7.5-7.5s-3.357-7.5-7.5-7.5h-82.296v-26.645H436.962z M339.666,318.412
c0,11.719-9.534,21.253-21.254,21.253H126.05c-11.719,0-21.253-9.534-21.253-21.253V126.05c0-11.719,9.534-21.253,21.253-21.253
h192.362c11.72,0,21.254,9.534,21.254,21.253V318.412z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB