李志伟 3 лет назад
Родитель
Сommit
76203049f7
2 измененных файлов: 2 добавлений и 21 удалений
  1. 0
    20
      src/components/foodCards/foodCards.jsx
  2. 2
    1
      src/pages/details/mjDetails/sceneryDetails.jsx

+ 0
- 20
src/components/foodCards/foodCards.jsx Просмотреть файл

1
 import useSave from "@/utils/hooks/useSave"
1
 import useSave from "@/utils/hooks/useSave"
2
-import { getShopDetail, getShopcity } from '@/services/home'
3
-import { useState, useEffect } from 'react'
4
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
5
 import Star from '@/components/Star/Star.jsx'
3
 import Star from '@/components/Star/Star.jsx'
6
 import pay from '@/assets/icons/housemantj/pay.png'
4
 import pay from '@/assets/icons/housemantj/pay.png'
17
   const { item,st,det } = props
15
   const { item,st,det } = props
18
   const { shopId } = props.item
16
   const { shopId } = props.item
19
   const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
17
   const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
20
-  // const [city, setCity] = useState({})
21
-  // const [detail, setDetail] = useState({})
22
-
23
-
24
-
25
 
18
 
26
   const goFood = () => {
19
   const goFood = () => {
27
     const page = Taro.getCurrentPages()
20
     const page = Taro.getCurrentPages()
34
 
27
 
35
     }
28
     }
36
   }
29
   }
37
-
38
-
39
-
40
-  // useEffect(() => {
41
-  //   getShopDetail(item.shopId).then((res) => {
42
-  //     setDetail(res)
43
-  //     getShopcity(res.cityId).then((res2) => {
44
-  //       setCity(res2)
45
-  //     })
46
-  //   })
47
-  // }, [])
48
-  // const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
49
-
50
   return (
30
   return (
51
     <view className='foodCard'>
31
     <view className='foodCard'>
52
       <view className='fCleft'>
32
       <view className='fCleft'>

+ 2
- 1
src/pages/details/mjDetails/sceneryDetails.jsx Просмотреть файл

156
             <view className='title'>
156
             <view className='title'>
157
               <image src={titlems} />老板推荐好吃的
157
               <image src={titlems} />老板推荐好吃的
158
             </view>
158
             </view>
159
-            {(recommend || []).map((item) => <Cards item={item} />)}
159
+            
160
+            {(recommend || []).map((item) => <Cards item={item} det={item} st={parseFloat(item.score.toFixed(1))}/>)}
160
           </view>
161
           </view>
161
           <view className='bottom'>已经到底了~</view>
162
           <view className='bottom'>已经到底了~</view>
162
         </scroll-view>
163
         </scroll-view>