吃个甘蔗嚼一年 3 lat temu
rodzic
commit
3a89232840

+ 19
- 6
src/components/BossCard/index.jsx Wyświetl plik

@@ -11,7 +11,7 @@ import starOff from '@/assets/icons/housemantj/景点爆赞.png'
11 11
 import food from '@/assets/icons/ProCard/food.png'
12 12
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
13 13
 
14
-import { getQueryString} from '@/utils/index'
14
+import { getQueryString } from '@/utils/index'
15 15
 //入住指引--老板推荐
16 16
 
17 17
 
@@ -19,21 +19,34 @@ import { getQueryString} from '@/utils/index'
19 19
 import './style.less'
20 20
 
21 21
 export default (props) => {
22
-  const { item, cardNavigateTo,taRoomContent,trackClick } = props
22
+  const { item, cardNavigateTo, taRoomContent, trackClick } = props
23 23
   const { shopId, packageId } = props.item
24 24
   const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
25 25
   const [city, setCity] = useState({})
26 26
   const [detail, setDetail] = useState({})
27 27
 
28
-    
28
+  const [handelareaName, setHandelareaName] = useState()
29
+
30
+  const lareaName = () => {
31
+    if (city.areaPName == null) {
32
+      setHandelareaName(city.areaPName / city.areaName)
33
+    } else {
34
+      setHandelareaName(city.areaName)
35
+    }
36
+  }
37
+
38
+
39
+
40
+
29 41
 
30
-  
31 42
   const goFood = () => {
32
-     trackClick({ eventType: 'hotel_recommend_package', eventParams: getQueryString({ hotelId:taRoomContent.hotelId,shopId:shopId,packageId:packageId})  })
43
+    trackClick({ eventType: 'hotel_recommend_package', eventParams: getQueryString({ hotelId: taRoomContent.hotelId, shopId: shopId, packageId: packageId }) })
33 44
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
34 45
   }
35 46
 
36 47
   useEffect(() => {
48
+    lareaName()
49
+
37 50
     getShopDetail(item.shopId).then((res) => {
38 51
       setDetail(res)
39 52
       getShopcity(res.cityId).then((x) => {
@@ -66,7 +79,7 @@ export default (props) => {
66 79
             <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
67 80
             <view className='title-position-on'>
68 81
               <image className='title-position' src={position} />
69
-              <text className='title-position-image'>{city.areaPName}/{city.areaName}</text>
82
+              <text className='title-position-image'>{city.areaPName}/ {city.areaName}</text>
70 83
               <view style={{ display: 'inline-block' }} onClick={toggleSave}>
71 84
 
72 85
                 <image className='title-on' src={isSaved > 0 ? starOn : starOff} />

+ 19
- 3
src/components/CollectList/MyCollect/index.jsx Wyświetl plik

@@ -50,13 +50,18 @@ export default (props) => {
50 50
                 <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
51 51
                 <view className='title-position-on'>
52 52
                   <image className='title-position' src={position} />
53
-                  <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
53
+                  <text className='title-position-image'>
54
+                    {
55
+                      targetType === "shop_package" && (
56
+                        item.areaPName == '' ? item.areaPName / item.areaName : item.areaName
57
+                      )
58
+                    }
59
+                  </text>
54 60
                 </view>
55 61
               </view>
56 62
             </view>
57 63
             <view class='right-complete-two'>
58 64
               <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` }); }}>
59
-                {/* <view className='right-number'>×1</view> */}
60 65
                 <image className='right-image' src={SeeDetails} />
61 66
                 <view className='right-title'>查看详情</view>
62 67
               </view>
@@ -84,7 +89,17 @@ export default (props) => {
84 89
                   </view>
85 90
                   <view className='title-position-on'>
86 91
                     <image className='title-position' src={position} />
87
-                    <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
92
+                    <text className='title-position-image'>
93
+                      {
94
+                        targetType === "tourist" && (
95
+                          item.areaPName == '' ? item.areaPName / item.areaName : item.areaName
96
+                        )
97
+                      }
98
+                      {
99
+                        targetType === "shop" && (
100
+                          item.areaPName === null ? item.areaName : item.areaPName / item.areaName
101
+                        )
102
+                      }</text>
88 103
                   </view>
89 104
                 </view>
90 105
               </view>
@@ -98,6 +113,7 @@ export default (props) => {
98 113
             </view>
99 114
           )
100 115
         }
116
+
101 117
       </View>
102 118
     </View>
103 119