|
@@ -5,7 +5,7 @@ import useLike from "@/utils/hooks/useLike"
|
5
|
5
|
import { getShopDetail, getShopcity } from '@/services/home'
|
6
|
6
|
import { useState, useEffect } from 'react'
|
7
|
7
|
import { View } from '@tarojs/components'
|
8
|
|
-
|
|
8
|
+import formatPrice from "@/utils/formatPrice";
|
9
|
9
|
import Star from '@/components/Star/Star.jsx'
|
10
|
10
|
import position from '@/assets/icons/GuideCheck/position_logo.png'
|
11
|
11
|
import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
|
|
@@ -24,39 +24,11 @@ import './style.less'
|
24
|
24
|
|
25
|
25
|
export default (props) => {
|
26
|
26
|
const { item, cardNavigateTo } = props
|
27
|
|
- const shopId = props.item
|
28
|
|
- const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
|
29
|
|
- const [isLike, toggleLike] = useLike(item.isLike, 'shop', item.targetId)
|
|
27
|
+ // const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
|
|
28
|
+ const [isLike, toggleLike] = useLike(item.isLike, 'tourist', item.targetId)
|
30
|
29
|
|
31
|
|
- const [city, setCity] = useState({})
|
32
|
|
- const [detail, setDetail] = useState({})
|
33
|
|
- const [hotStyle, setHotStyle] = useState('none')
|
34
|
30
|
const targetType = item.targetType
|
35
|
|
- // item.targetType !== 'shop_package'
|
36
|
|
-
|
37
|
|
-
|
38
|
|
- const goFood = () => {
|
39
|
|
- // Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
|
40
|
|
- }
|
41
|
|
-
|
42
|
|
- // useEffect(() => {
|
43
|
|
- // if (shopId) {
|
44
|
|
- // getShopDetail(item.shopId).then((res) => {
|
45
|
|
- // setDetail(res)
|
46
|
|
- // getShopcity(res.cityId).then((x) => {
|
47
|
|
- // setCity(x)
|
48
|
|
- // })
|
49
|
|
- // })
|
50
|
|
- // }
|
51
|
|
-
|
52
|
|
- // }, [shopId, targetType])
|
53
|
31
|
|
54
|
|
- // useEffect(() => {
|
55
|
|
- // if (item.targetType !== 'shop_package') {
|
56
|
|
- // console.log(item.targetType);
|
57
|
|
- // }
|
58
|
|
-
|
59
|
|
- // }, [item.targetType])
|
60
|
32
|
|
61
|
33
|
|
62
|
34
|
|
|
@@ -69,22 +41,22 @@ export default (props) => {
|
69
|
41
|
<view class='left-complete-one' >
|
70
|
42
|
<image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
|
71
|
43
|
<view className='left-viewText' >
|
72
|
|
- 返现¥{(item.cashback / 100).toFixed(2)}
|
|
44
|
+ 返现¥{formatPrice(item.cashback)}
|
73
|
45
|
</view>
|
74
|
46
|
{/* 评分 */}
|
75
|
47
|
<view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
|
76
|
48
|
<Star star={star} />
|
77
|
49
|
<text className='card-star-text' >{star}</text>
|
78
|
50
|
</view>
|
79
|
|
- <view className='title-image' onClick={() => { goFood() }}>
|
|
51
|
+ <view className='title-image' >
|
80
|
52
|
<image className='image-1' mode='scaleToFill' src={item.poster}></image>
|
81
|
53
|
<image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
|
82
|
54
|
</view>
|
83
|
55
|
<view className='title-content'>
|
84
|
|
- <view className='Pro-title' onClick={() => { goFood() }} >
|
|
56
|
+ <view className='Pro-title' >
|
85
|
57
|
<view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
|
86
|
58
|
</view>
|
87
|
|
- <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
|
|
59
|
+ <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
|
88
|
60
|
<view className='title-position-on'>
|
89
|
61
|
<image className='title-position' src={position} />
|
90
|
62
|
<text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
|
|
@@ -92,7 +64,7 @@ export default (props) => {
|
92
|
64
|
</view>
|
93
|
65
|
</view>
|
94
|
66
|
<view class='right-complete-two'>
|
95
|
|
- <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` }); }}>
|
|
67
|
+ <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` }); }}>
|
96
|
68
|
{/* <view className='right-number'>×1</view> */}
|
97
|
69
|
<image className='right-image' src={SeeDetails} />
|
98
|
70
|
<view className='right-title'>查看详情</view>
|
|
@@ -106,30 +78,27 @@ export default (props) => {
|
106
|
78
|
targetType !== "shop_package" && (
|
107
|
79
|
<view class='wrapper-tourist'>
|
108
|
80
|
<view class='left-complete-one' >
|
109
|
|
- <view className='title-image' onClick={() => { goFood() }}>
|
|
81
|
+ <view className='title-image'>
|
110
|
82
|
<image className='image-1' mode='scaleToFill' src={item.poster}></image>
|
111
|
83
|
<image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
|
112
|
84
|
</view>
|
113
|
85
|
<view className='title-content'>
|
114
|
|
- <view className='Pro-title' onClick={() => { goFood() }} >
|
|
86
|
+ <view className='Pro-title' >
|
115
|
87
|
<view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
|
116
|
88
|
</view>
|
117
|
|
- <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
|
118
|
|
- <view onClick={toggleSave}>
|
119
|
|
- <image className='title-on' src={isLike > 0 ? baozan : weibaozan} />
|
120
|
|
- <text onClick={toggleLike} className='title-on-text'>{isLike > 0 ? '已爆赞' : '爆赞'}</text>
|
|
89
|
+ <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
|
|
90
|
+ <view onClick={toggleLike}>
|
|
91
|
+ <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
|
|
92
|
+ <text className='title-on-text'>{isLike === 1 ? '已爆赞' : '爆赞'}</text>
|
121
|
93
|
</view>
|
122
|
94
|
<view className='title-position-on'>
|
123
|
|
-
|
124
|
95
|
<image className='title-position' src={position} />
|
125
|
|
-
|
126
|
96
|
<text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
|
127
|
|
-
|
128
|
97
|
</view>
|
129
|
98
|
</view>
|
130
|
99
|
</view>
|
131
|
100
|
<view class='right-complete-two'>
|
132
|
|
- <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` }); }}>
|
|
101
|
+ <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` }); }}>
|
133
|
102
|
{/* <view className='right-number'>×1</view> */}
|
134
|
103
|
<image className='right-image' src={SeeDetails} />
|
135
|
104
|
<view className='right-title'>查看详情</view>
|