code added
此提交包含在:
+8
@@ -138,6 +138,14 @@ function initLogin() {
|
||||
//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 {
|
||||
toasterOpts();
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
let nav_html = `
|
||||
<header class="header-area section-padding-1 transparent-bar">
|
||||
<div class="header-large-device">
|
||||
<div class="header-bottom sticky-bar" style="
|
||||
background: #ed3838;
|
||||
">
|
||||
<div class="header-bottom sticky-bar" >
|
||||
<div class="container">
|
||||
<div class="header-bottom-flex">
|
||||
<div class="logo-menu-wrap d-flex">
|
||||
|
||||
+42
-17
@@ -110,6 +110,19 @@ function startDetails(){
|
||||
});
|
||||
}
|
||||
|
||||
function updateDetailsByObj(obj){
|
||||
$('.productname').html(obj.itemname)
|
||||
$('.price').html(obj.pricelist);
|
||||
appendSpecs(obj.itemid)
|
||||
$('#skudetailitem').val(obj.sku)
|
||||
$('.des_productdes').html(obj.itemdescription);
|
||||
|
||||
let defaultImg = obj.itemimageurl ? obj.itemimageurl: `./dist/assets/imgs/nophoto.png`;
|
||||
console.log(obj.itemimageurl,'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
|
||||
$('.productDetailsMain > img').attr('src',defaultImg);
|
||||
|
||||
}
|
||||
|
||||
function searchComb(){
|
||||
let valuesSelected = [];
|
||||
|
||||
@@ -155,20 +168,15 @@ function startDetails(){
|
||||
const {quantity} = itemtagscombinationRes[i];
|
||||
if(quantity>=$('#quantity').val() && quantity>=1){
|
||||
currentComb = itemtagscombinationRes[i];
|
||||
$('.productname').html(itemtagscombinationRes[i].itemname)
|
||||
$('.price').html(itemtagscombinationRes[i].pricelist);
|
||||
// $('.productname').html(itemtagscombinationRes[i].itemname)
|
||||
// $('.price').html(itemtagscombinationRes[i].pricelist);
|
||||
// location.hash = itemtagscombinationRes[i].itemname.trim();
|
||||
appendSpecs(itemtagscombinationRes[i].itemid)
|
||||
// appendSpecs(itemtagscombinationRes[i].itemid)
|
||||
history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
|
||||
let searchparms = location.search;
|
||||
debugger;
|
||||
|
||||
|
||||
|
||||
// const regex = /sku="(\w+)"/g;
|
||||
// const newParams = searchparms.replace("sku", `$1${itemtagscombinationRes[i].sku}$2`);
|
||||
// location.search = newParams;
|
||||
$('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
||||
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
||||
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
||||
updateDetailsByObj(itemtagscombinationRes[i]);
|
||||
}else{
|
||||
debugger;
|
||||
let name = itemtagscombinationRes[i].itemname.split('-')[0];
|
||||
@@ -184,6 +192,7 @@ function startDetails(){
|
||||
history.replaceState(null, null, `#`);
|
||||
|
||||
$('.msgErrorDetailsItem').removeClass('d-none');
|
||||
$('.des_productdes').html('');
|
||||
$('.price').html('');
|
||||
}
|
||||
|
||||
@@ -252,7 +261,7 @@ function startDetails(){
|
||||
|
||||
async function getProductDetails(id){
|
||||
|
||||
|
||||
debugger
|
||||
|
||||
// let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
|
||||
|
||||
@@ -358,12 +367,22 @@ function startDetails(){
|
||||
if(isTrue){
|
||||
debugger;
|
||||
console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
|
||||
|
||||
|
||||
currentComb = itemtagscombinationRes[i];
|
||||
$('.productname').html(itemtagscombinationRes[i].itemname);
|
||||
location.hash = itemtagscombinationRes[i].itemname.trim();
|
||||
$('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
||||
$('.price').html(itemtagscombinationRes[i].pricelist)
|
||||
appendSpecs(itemtagscombinationRes[i].itemid)
|
||||
|
||||
// $('.productname').html(itemtagscombinationRes[i].itemname);
|
||||
// $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
||||
// $('.price').html(itemtagscombinationRes[i].pricelist)
|
||||
// debugger;
|
||||
// appendSpecs(itemtagscombinationRes[i].itemid);
|
||||
// $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
||||
|
||||
updateDetailsByObj(itemtagscombinationRes[i]);
|
||||
|
||||
|
||||
|
||||
isGo = false;
|
||||
let {tagnames,tagids,pricelist} = itemtagscombinationRes[i];
|
||||
tagids = tagids.split('|');
|
||||
@@ -387,12 +406,18 @@ function startDetails(){
|
||||
tagnames = tagnames.split('|');
|
||||
$('.optiontaganwi').removeClass('borderselector');
|
||||
currentComb = itemtagscombinationRes[0];
|
||||
|
||||
|
||||
for(let i=0;i<tagids.length;i++){
|
||||
|
||||
$(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
|
||||
}
|
||||
|
||||
$('.price').html(pricelist);
|
||||
// $('.price').html(pricelist);
|
||||
// $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
|
||||
// appendSpecs(itemtagscombinationRes[0].itemid);
|
||||
|
||||
updateDetailsByObj(itemtagscombinationRes[0]);
|
||||
//console.log(childIds);
|
||||
//
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ function initSelectDevlivery() {
|
||||
let currencyId = null;
|
||||
let billingInfo = null;
|
||||
let userName = null;
|
||||
|
||||
$('.mianselectdelivery').removeClass('d-none');
|
||||
|
||||
let orderBtnAction = {
|
||||
removeOrdernowBtn() {
|
||||
|
||||
新增問題並參考
封鎖使用者