Jacob
2026-10-12 504d4de23822309a42dc1de417277461d511eeaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<template>
   <view class='recommend'>
       <view class='title acea-row row-center-wrapper'>
           <text class='iconfont icon-zhuangshixian'></text>
           <text class='name'>热门推荐</text>
           <text class='iconfont icon-zhuangshixian lefticon'></text>
       </view>
       <view class='recommendList  cf'>
           <view class="list_column cfl">
               <block v-for="(item,index) in hostProduct" :key="gindex">
                   <GoodBlock v-if="index%2==0" :pageName="pageName" :moduleName="'热门推荐'"  :careBeanRate="careBeanRate" :size="'big'" :goodsInfo="item"></GoodBlock>
               </block>
           </view>
           <view class="list_column cfr">
               <block v-for="(item,index) in hostProduct" :key="gindex">
                   <GoodBlock v-if="index%2==1" :pageName="pageName" :moduleName="'热门推荐'"  :careBeanRate="careBeanRate" :size="'big'" :goodsInfo="item"></GoodBlock>
               </block>
           </view>
       </view>
   </view>
</template>
 
<script>
   import GoodBlock from "@/pages/goods_block/index.vue";
   import {mapGetters} from "vuex";
   import { goShopDetail } from '@/libs/order.js'
   export default {
   computed: mapGetters(['uid']),
       props: {
           pageName:{
               type: String,
               default: function() {
                   return '';
               }
           },
           moduleName:{
               type: String,
               default: function() {
                   return '';
               }
           },
           hostProduct: {
               type: Array,
               default: function() {
                   return [];
               }
           }
       },
       components: {
           GoodBlock
       },
       data() {
           return {
               careBeanRate:0
           };
       },
       mounted(){
           let that=this;
               if (!that.$store.getters.careBeanRate) {
                   console.log('has not get careBeanRate')
                   uni.$once('updateCareBeanRate', () => {
                       that.$nextTick(()=>{
                           that.$set(that,'careBeanRate',that.$store.getters.careBeanRate)
                           console.log('get updateCareBeanRate',that.$store.getters.careBeanRate,that.careBeanRate)
                       })
                   });
               } else {
                   that.$nextTick(()=>{
                       that.$set(that,'careBeanRate',that.$store.getters.careBeanRate)
                       console.log('has updateCareBeanRate',that.careBeanRate)
                   })
               }
       },
       methods: {
           goDetail(item){
               goShopDetail(item,this.uid).then(res=>{
                   uni.navigateTo({
                       url:`/pages/goods_details/index?id=${item.id}`
                   })
               })
           }
       }
   }
</script>
 
<style scoped lang="scss">
   // .recommend {
   //     background-color: #fff;
   // }
 
   .recommend .title {
       height: 135rpx;
       line-height: 135rpx;
       font-size: 28rpx;
       color: #282828;
   }
 
   .recommend .title .name {
       margin: 0 28rpx;
   }
 
   .recommend .title .iconfont {
       font-size: 170rpx;
       color: #454545;
   }
 
   .recommend .title .iconfont.lefticon {
   }
 
   .recommend .recommendList {
       width: 690rpx;
       margin: 0 auto;
   }
</style>