panhui 3 years ago
parent
commit
2c6bb1029c
1 changed files with 21 additions and 21 deletions
  1. 21 21
      src/views/HomePage.vue

+ 21 - 21
src/views/HomePage.vue

@@ -190,27 +190,27 @@ function getSaleBatch() {
                 hotInfo: {}
             }
         })
-        // if (!res.empty) {
-        //     res.content.forEach((item, index) => {
-        //         http.post(
-        //             '/product/list',
-        //             {
-        //                 query: {
-        //                     batchId: item.id,
-        //                     status: 'IN_STOCK'
-        //                 },
-        //                 size: 1,
-        //                 sort: 'id,desc'
-        //             },
-        //             { body: 'json' }
-        //         ).then(res => {
-        //             saleBatches.value[index].empty = res.empty
-        //             if (!res.empty) {
-        //                 saleBatches.value[index].hotInfo = res.content[0]
-        //             }
-        //         })
-        //     })
-        // }
+        if (!res.empty) {
+            res.content.forEach((item, index) => {
+                http.post(
+                    '/product/list',
+                    {
+                        query: {
+                            batchId: item.id,
+                            status: 'IN_STOCK'
+                        },
+                        size: 1,
+                        sort: 'id,desc'
+                    },
+                    { body: 'json' }
+                ).then(res => {
+                    saleBatches.value[index].empty = res.empty
+                    if (!res.empty) {
+                        saleBatches.value[index].hotInfo = res.content[0]
+                    }
+                })
+            })
+        }
     })
 }