Browse Source

点击跳转详情调整

dxz1228 2 years ago
parent
commit
e3bd0160f9
1 changed files with 11 additions and 34 deletions
  1. 11 34
      src/components/ProductList/ProductList.vue

+ 11 - 34
src/components/ProductList/ProductList.vue

@@ -2,9 +2,9 @@
2
 
2
 
3
 import ProductCard from "~/components/ProductCard/ProductCard.vue";
3
 import ProductCard from "~/components/ProductCard/ProductCard.vue";
4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
4
 import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
5
-import {debounce} from "lodash-es";
6
-import {useThrottleFn} from "@vueuse/core";
7
-import {throttle} from "~/utils/throttle";
5
+import { debounce } from "lodash-es";
6
+import { useThrottleFn } from "@vueuse/core";
7
+import { throttle } from "~/utils/throttle";
8
 
8
 
9
 const props = defineProps({
9
 const props = defineProps({
10
   list: {
10
   list: {
@@ -18,45 +18,22 @@ const props = defineProps({
18
 
18
 
19
 function handleClickItem(item) {
19
 function handleClickItem(item) {
20
   // console.log(item)
20
   // console.log(item)
21
-  if (item.type === 5 || item.type === '5') {
22
-  // _.debounce(() => {
23
-  // debounce(() => {
24
-  // return useThrottleFn(() => {
25
-  //   uni.navigateTo({
26
-  //     url: `/pages/store/product/detail?id=${item.product_id}`
27
-  //   })
28
-  // }, 100)
29
-  //   throttle()
21
+  uni.navigateTo({
22
+    url: `/pages/store/product/detail?id=${item.product_id}`
23
+  })
30
 
24
 
31
-    uni.navigateTo({
32
-      url: `/pages/store/product/detail?id=${item.product_id}`
33
-    })
34
-    // throttle(() => {
35
-    //   uni.navigateTo({
36
-    //     url: `/pages/store/product/detail?id=${item.product_id}`
37
-    //   })
38
-    // })
39
-  // }, 200)
40
-
41
-  // })
42
-
43
-  }
44
-  // uni.navigateTo({
45
-  // })
46
 }
25
 }
47
 </script>
26
 </script>
48
 <template>
27
 <template>
49
   <!--  <scroll-view type="custom">-->
28
   <!--  <scroll-view type="custom">-->
50
-  <div  class="px-3" v-if="list && list.length > 0">
51
-    <grid-view type="masonry" cross-axis-count="2" 	cross-axis-gap="10px" main-axis-gap="10px">
52
-      <div v-for="(item, index) in list"
53
-           :key="index"
54
-      >
55
-        <ProductCard  :item="item" @click:item="handleClickItem"/>
29
+  <div class="px-3" v-if="list && list.length > 0">
30
+    <grid-view type="masonry" cross-axis-count="2" cross-axis-gap="10px" main-axis-gap="10px">
31
+      <div v-for="(item, index) in list" :key="index">
32
+        <ProductCard :item="item" @click:item="handleClickItem" />
56
       </div>
33
       </div>
57
     </grid-view>
34
     </grid-view>
58
 
35
 
59
   </div>
36
   </div>
60
-  <CXBEmpty v-else/>
37
+  <CXBEmpty v-else />
61
   <!--  </scroll-view>-->
38
   <!--  </scroll-view>-->
62
 </template>
39
 </template>