sachinganesh преди 2 години
родител
ревизия
6b500e2939
променени са 7 файла, в които са добавени 68 реда и са изтрити 60 реда
  1. 8
    0
      dist/Js/auth/login.js
  2. 1
    3
      dist/Js/navbar.js
  3. 43
    18
      dist/Js/productdetails/productdetails.js
  4. 2
    0
      dist/Js/shoppingcart/select_delivery.js
  5. 1
    0
      login.html
  6. 9
    11
      productdetails.html
  7. 4
    28
      selectdelivery.html

+ 8
- 0
dist/Js/auth/login.js Целия файл

@@ -138,6 +138,14 @@ function initLogin() {
138 138
         //window.localStorage.setItem("Userpassword", userPassword);
139 139
         window.localStorage.setItem("Isloggedintoaster", true);
140 140
         window.localStorage.setItem("Isloggedin", true);
141
+
142
+        const isCartAdded = localStorage.getItem(CART_ADD);
143
+        if(isCartAdded){
144
+          localStorage.removeItem(CART_ADD);
145
+          window.location.href = `/selectdelivery.html`;
146
+          return;
147
+        }
148
+
141 149
         window.location.href = `./index.html`;
142 150
       } else {
143 151
         toasterOpts();

+ 1
- 3
dist/Js/navbar.js Целия файл

@@ -1,9 +1,7 @@
1 1
 let nav_html = `
2 2
 <header class="header-area section-padding-1 transparent-bar">
3 3
             <div class="header-large-device">
4
-                <div class="header-bottom sticky-bar"  style="
5
-                background: #ed3838;
6
-            ">
4
+                <div class="header-bottom sticky-bar" >
7 5
                     <div class="container">
8 6
                         <div class="header-bottom-flex">
9 7
                             <div class="logo-menu-wrap d-flex">

+ 43
- 18
dist/Js/productdetails/productdetails.js Целия файл

@@ -110,6 +110,19 @@ function startDetails(){
110 110
         });
111 111
     }
112 112
 
113
+    function updateDetailsByObj(obj){
114
+        $('.productname').html(obj.itemname)
115
+        $('.price').html(obj.pricelist);
116
+        appendSpecs(obj.itemid)
117
+        $('#skudetailitem').val(obj.sku)
118
+        $('.des_productdes').html(obj.itemdescription);
119
+        
120
+        let defaultImg = obj.itemimageurl ? obj.itemimageurl: `./dist/assets/imgs/nophoto.png`;
121
+console.log(obj.itemimageurl,'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
122
+        $('.productDetailsMain  > img').attr('src',defaultImg);
123
+
124
+    }
125
+
113 126
     function searchComb(){
114 127
         let valuesSelected = [];
115 128
  
@@ -155,20 +168,15 @@ function startDetails(){
155 168
                     const {quantity} = itemtagscombinationRes[i];
156 169
                     if(quantity>=$('#quantity').val() && quantity>=1){
157 170
                         currentComb = itemtagscombinationRes[i];
158
-                        $('.productname').html(itemtagscombinationRes[i].itemname)
159
-                        $('.price').html(itemtagscombinationRes[i].pricelist);
171
+                        // $('.productname').html(itemtagscombinationRes[i].itemname)
172
+                        // $('.price').html(itemtagscombinationRes[i].pricelist);
160 173
                         // location.hash = itemtagscombinationRes[i].itemname.trim();
161
-                        appendSpecs(itemtagscombinationRes[i].itemid)
174
+                        // appendSpecs(itemtagscombinationRes[i].itemid)
162 175
                         history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
163
-                        let searchparms = location.search;
164
-                   debugger;
165
-                       
166
-                   
167
-
168
-//                         const regex = /sku="(\w+)"/g;
169
-// const newParams = searchparms.replace("sku", `$1${itemtagscombinationRes[i].sku}$2`);
170
-//                         location.search = newParams;
171
-                        $('#skudetailitem').val(itemtagscombinationRes[i].sku)
176
+
177
+                        // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
178
+                        // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
179
+                        updateDetailsByObj(itemtagscombinationRes[i]);
172 180
                     }else{
173 181
                         debugger;
174 182
                         let name = itemtagscombinationRes[i].itemname.split('-')[0];
@@ -184,6 +192,7 @@ function startDetails(){
184 192
                          history.replaceState(null, null, `#`);
185 193
                          
186 194
                          $('.msgErrorDetailsItem').removeClass('d-none');
195
+                         $('.des_productdes').html('');
187 196
                         $('.price').html('');
188 197
                     }
189 198
                   
@@ -252,7 +261,7 @@ function startDetails(){
252 261
 
253 262
     async function getProductDetails(id){
254 263
         
255
-   
264
+   debugger
256 265
 
257 266
         // let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
258 267
   
@@ -358,12 +367,22 @@ function startDetails(){
358 367
                 if(isTrue){
359 368
                     debugger;
360 369
                     console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
370
+
371
+
361 372
                     currentComb = itemtagscombinationRes[i];
362
-                    $('.productname').html(itemtagscombinationRes[i].itemname);
363 373
                     location.hash = itemtagscombinationRes[i].itemname.trim();
364
-                    $('#skudetailitem').val(itemtagscombinationRes[i].sku)
365
-                    $('.price').html(itemtagscombinationRes[i].pricelist)
366
-                    appendSpecs(itemtagscombinationRes[i].itemid)
374
+
375
+                    // $('.productname').html(itemtagscombinationRes[i].itemname);
376
+                    // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
377
+                    // $('.price').html(itemtagscombinationRes[i].pricelist)
378
+                    // debugger;
379
+                    // appendSpecs(itemtagscombinationRes[i].itemid);
380
+                    // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
381
+
382
+                    updateDetailsByObj(itemtagscombinationRes[i]);
383
+
384
+
385
+
367 386
                     isGo = false;
368 387
                     let {tagnames,tagids,pricelist} = itemtagscombinationRes[i];
369 388
                         tagids = tagids.split('|');
@@ -387,12 +406,18 @@ function startDetails(){
387 406
             tagnames = tagnames.split('|');
388 407
             $('.optiontaganwi').removeClass('borderselector');
389 408
             currentComb = itemtagscombinationRes[0];
409
+       
410
+            
390 411
             for(let i=0;i<tagids.length;i++){
391 412
              
392 413
                 $(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
393 414
             }
394 415
 
395
-            $('.price').html(pricelist);
416
+            // $('.price').html(pricelist);
417
+            // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
418
+            // appendSpecs(itemtagscombinationRes[0].itemid);
419
+
420
+            updateDetailsByObj(itemtagscombinationRes[0]);
396 421
             //console.log(childIds);
397 422
             // 
398 423
           

+ 2
- 0
dist/Js/shoppingcart/select_delivery.js Целия файл

@@ -4,6 +4,8 @@ function initSelectDevlivery() {
4 4
     let currencyId = null;
5 5
     let billingInfo = null;
6 6
     let userName = null;
7
+
8
+    $('.mianselectdelivery').removeClass('d-none');
7 9
    
8 10
     let orderBtnAction = {
9 11
         removeOrdernowBtn() {

+ 1
- 0
login.html Целия файл

@@ -563,6 +563,7 @@
563 563
     <script src="./libs/bootstrap/js/bootstrap.bundle.min.js"></script>
564 564
     <script src="./dist/js/jquery.min.js"></script>
565 565
     <script src="./libs/owlcarousel/js/owl.carousel.min.js"></script>
566
+    <script src="./dist/js/shoppingcart/addtocart.js"></script>
566 567
     <script src="./dist/js/auth/apiservice.js"></script>
567 568
     <script src="./libs/cookies.min.js"></script>
568 569
      <script src="./libs/axios.min.js"></script>

+ 9
- 11
productdetails.html Целия файл

@@ -97,10 +97,8 @@
97 97
                                 <input type="hidden" name="" id="skudetailitem">
98 98
                                 <h5 class="productname">ORA3, M.2 NVMe SSD </h5>
99 99
                             </div>
100
-                            <div class="small-font">Improve your system's responsiveness, run apps faster and multitask
101
-                                with ease. Compatibility assurance when using the Crucial System Scanner or Crucial
102
-                                Advisor Tool</div>
103
-                            <div>₹<span class="price">3000</span></div>
100
+                            <div class="small-font des_productdes"></div>
101
+                            <div>₹<span class="price"></span></div>
104 102
                             <div class="text-danger msgErrorDetailsItem d-none">Product out of stock</div>
105 103
                         </div>
106 104
 
@@ -258,9 +256,9 @@
258 256
                                 </div>
259 257
                             </div>
260 258
                         </div>
261
-                        <hr>
259
+                        <hr class="d-none">
262 260
                         <div>
263
-                            <ul>
261
+                            <ul class="d-none">
264 262
                                 <li class="small-font">No Cost EMI Available <a class="learnMoreA" href="">Learn
265 263
                                         More</a></li>
266 264
                                 <li class="small-font">Buy Anwi Extended Warranty 1 Year at ₹2,699 <a class="learnMoreA"
@@ -302,18 +300,18 @@
302 300
             
303 301
                 <div class="col-lg-12 ">
304 302
                     <div class="dec-review-topbar no-transition nav mb-65 productdetailstabs d-flex gap-4" role="tablist">
305
-                        <a class="active font-1-5 no-transition" data-bs-toggle="tab" href="#des-details1"  aria-selected="true" role="tab">Description</a>
303
+                        <!-- <a class="active font-1-5 no-transition" data-bs-toggle="tab" href="#des-details1"  aria-selected="true" role="tab">Description</a> -->
306 304
 
307
-                        <a data-bs-toggle="tab" href="#des-details2" aria-selected="false" role="tab" class="font-1-5 no-transition" tabindex="-1">Specification</a>
305
+                        <a data-bs-toggle="tab" href="#des-details2" aria-selected="false" role="tab" class="active font-1-5 no-transition" tabindex="-1">Specification</a>
308 306
                       
309 307
                     </div>
310 308
                     <div class="tab-content dec-review-bottom">
311
-                        <div id="des-details1" class="tab-pane active show" role="tabpanel">
309
+                        <!-- <div id="des-details1" class="tab-pane active show" role="tabpanel">
312 310
                             <div class="description-wrap wrap-content-product-tabs">
313 311
                                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Suscipit, recusandae! Alias tempore, molestias, architecto provident excepturi voluptate non repellendus, repellat a quis iusto consequuntur quas beatae fugit nisi totam ratione nesciunt reiciendis quod? Quae, consequuntur quasi. Laudantium, doloribus aliquam incidunt error qui itaque aperiam quia ducimus cupiditate, magnam aliquid iste molestiae eveniet? Eaque veniam illo hic, possimus dolorum quaerat ratione in ex voluptas itaque ullam, maiores iusto illum blanditiis sequi. Ex, ab nemo vero libero pariatur architecto culpa! Recusandae at fugiat itaque libero amet corporis exercitationem dolorum? Tenetur repellat tempora perspiciatis quibusdam maxime facilis necessitatibus eius sint corporis nihil! Accusantium.</p>
314 312
                             </div>
315
-                        </div>
316
-                        <div id="des-details2" class="tab-pane" role="tabpanel">
313
+                        </div> -->
314
+                        <div id="des-details2" class="tab-pane active show" role="tabpanel">
317 315
                             <div class="specification-wrap table-responsive">
318 316
                                 <table class="table table-bordered wrap-content-product-tabs">
319 317
                                     <tbody class="append-specs">

+ 4
- 28
selectdelivery.html Целия файл

@@ -36,12 +36,13 @@
36 36
     <div id="navbar-head"></div>
37 37
     <!-- end-navbar -->
38 38
     <!-- main-body -->
39
-    <div class="pt-5 mianselectdelivery">
39
+    <auth-loader payment="rtyui"></auth-loader>
40
+    <div class="pt-5 mianselectdelivery d-none">
40 41
         <div class="pt-5 container">
41 42
             <div class="row">
42 43
                 <div class="col-sm-8">
43 44
                     <div>
44
-                        <auth-loader payment="rtyui"></auth-loader>
45
+                      
45 46
                         <div class="card">
46 47
                             <div class=" p-3 gap-3 d-flex align-items-center ">
47 48
                                 <div class="info-numberbox">1</div>
@@ -197,32 +198,7 @@
197 198
                         <div class="card p-3 gap-3">
198 199
                             <div>Your Order</div>
199 200
                             <div class="orderlistcart">
200
-                                <div class="align-items-center d-flex justify-content-between">
201
-                                    <div style="max-width: 100px;" class="">
202
-                                        <img class="w-100" src="./dist/assets/imgs/Navbar/Accessiories-1.png" alt="">
203
-                                    </div>
204
-                                   <div>
205
-                                    <div>
206
-                                        <div>Jeans  with sequins</div>
207
-                                    </div>
208
-                                    <div>
209
-                                        <span>7000</span> <span>x <span class="qtyitem">02</span></span>
210
-                                    </div>
211
-                                   </div>
212
-                                </div>
213
-                                <div class="align-items-center border-top d-flex justify-content-between border-top">
214
-                                    <div style="max-width: 100px;" class="">
215
-                                        <img class="w-100" src="./dist/assets/imgs/Navbar/Accessiories-1.png" alt="">
216
-                                    </div>
217
-                                   <div>
218
-                                    <div>
219
-                                        <div>Jeans  with sequins</div>
220
-                                    </div>
221
-                                    <div>
222
-                                        <span>7000</span> <span>x <span class="qtyitem">02</span></span>
223
-                                    </div>
224
-                                   </div>
225
-                                </div>
201
+                             <!-- list goes here -->
226 202
                             </div>
227 203
                             <div class="border-top d-flex flex-column gap-1">
228 204
                                 <div class="d-flex justify-content-between">

Loading…
Отказ
Запис