|
@@ -13,6 +13,7 @@ const CouponMedia = CouponCard.Media
|
13
|
13
|
const Action = CouponCard.Action
|
14
|
14
|
export default (props) => {
|
15
|
15
|
const { item, cardNavigateTo } = props
|
|
16
|
+ console.log("🚀 ~ file: index.jsx ~ line 16 ~ item", item)
|
16
|
17
|
|
17
|
18
|
const targetType = item.targetType
|
18
|
19
|
const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
|
|
@@ -20,9 +21,27 @@ export default (props) => {
|
20
|
21
|
|
21
|
22
|
|
22
|
23
|
const handleDetail = () => {
|
23
|
|
- targetType == "shop_package" ? Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })
|
24
|
|
- : targetType == "tourist" ? Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` })
|
25
|
|
- : Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
|
|
24
|
+ switch (targetType) {
|
|
25
|
+ case "shop_package":
|
|
26
|
+ Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })
|
|
27
|
+ break;
|
|
28
|
+ case "shop":
|
|
29
|
+ Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
|
|
30
|
+ break;
|
|
31
|
+ case "tourist":
|
|
32
|
+ Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` })
|
|
33
|
+ break;
|
|
34
|
+ case "note":
|
|
35
|
+ Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.targetId}` })
|
|
36
|
+ break;
|
|
37
|
+ default:
|
|
38
|
+ break;
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ // targetType == "shop_package" && Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })
|
|
42
|
+ // targetType == "shop" && Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
|
|
43
|
+ // targetType == "tourist" && Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` })
|
|
44
|
+ // targetType == "note" && Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.targetId}` })
|
26
|
45
|
}
|
27
|
46
|
|
28
|
47
|
const PayAction = <Action.Icon icon={SeeDetails} text='查看详情' onClick={handleDetail} />
|
|
@@ -44,7 +63,7 @@ export default (props) => {
|
44
|
63
|
<View className='cpn-card-text'>
|
45
|
64
|
{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
|
46
|
65
|
</View>
|
47
|
|
- <View className='cpn-card-text' style={{ lineHeight:'10px' }}>
|
|
66
|
+ <View className='cpn-card-text' style={{ lineHeight: '10px' }}>
|
48
|
67
|
<Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
|
49
|
68
|
<Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text>
|
50
|
69
|
</View>
|
|
@@ -58,7 +77,7 @@ export default (props) => {
|
58
|
77
|
)
|
59
|
78
|
}
|
60
|
79
|
{
|
61
|
|
- targetType !== "shop_package" && (
|
|
80
|
+ targetType === "shop" && (
|
62
|
81
|
<View style={{ margin: '15px 5px' }}>
|
63
|
82
|
<CouponCard action={PayAction}>
|
64
|
83
|
<CouponMedia>
|
|
@@ -70,7 +89,7 @@ export default (props) => {
|
70
|
89
|
<View className='cpn-card-text'>
|
71
|
90
|
{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
|
72
|
91
|
</View>
|
73
|
|
- <View className='cpn-card-text' style={{ lineHeight:'10px' }}>
|
|
92
|
+ <View className='cpn-card-text' style={{ lineHeight: '10px' }}>
|
74
|
93
|
<Text className='cpn-card-text_mn'>¥{`${formatPrice(item.averagePrice)}元`}</Text>
|
75
|
94
|
</View>
|
76
|
95
|
<View className='cpn-md-act'>
|
|
@@ -86,6 +105,65 @@ export default (props) => {
|
86
|
105
|
</View>
|
87
|
106
|
)
|
88
|
107
|
}
|
|
108
|
+
|
|
109
|
+ {
|
|
110
|
+ targetType === "tourist" && (
|
|
111
|
+ <View style={{ margin: '15px 5px' }}>
|
|
112
|
+ <CouponCard action={PayAction}>
|
|
113
|
+ <CouponMedia>
|
|
114
|
+ <CouponMedia.Header
|
|
115
|
+ image={compressImage(item.poster)}
|
|
116
|
+ badge={targetType}
|
|
117
|
+ />
|
|
118
|
+ <CouponMedia.Body >
|
|
119
|
+ <View className='cpn-card-text'>
|
|
120
|
+ {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
|
|
121
|
+ </View>
|
|
122
|
+ <View className='cpn-card-text' style={{ lineHeight: '10px' }}>
|
|
123
|
+ <Text className='cpn-card-text_mn'>¥{`${formatPrice(item.averagePrice)}元`}</Text>
|
|
124
|
+ </View>
|
|
125
|
+ <View className='cpn-md-act'>
|
|
126
|
+ <Location {...item} />
|
|
127
|
+ <view className='wdscbaozan'>
|
|
128
|
+ <image className='title-on' src={baozan} />
|
|
129
|
+ <text className='title-on-text'>爆赞 {item.likeNum}</text>
|
|
130
|
+ </view>
|
|
131
|
+ </View>
|
|
132
|
+ </CouponMedia.Body>
|
|
133
|
+ </CouponMedia>
|
|
134
|
+ </CouponCard>
|
|
135
|
+ </View>
|
|
136
|
+ )
|
|
137
|
+ }
|
|
138
|
+ {
|
|
139
|
+ targetType === 'note' && (
|
|
140
|
+ <View style={{ margin: '15px 5px' }}>
|
|
141
|
+ <CouponCard action={PayAction}>
|
|
142
|
+ <CouponMedia>
|
|
143
|
+ <CouponMedia.Header
|
|
144
|
+ image={compressImage(item.poster)}
|
|
145
|
+ badge={targetType}
|
|
146
|
+ />
|
|
147
|
+ <CouponMedia.Body >
|
|
148
|
+ <View className='cpn-card-text'>
|
|
149
|
+ {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
|
|
150
|
+ </View>
|
|
151
|
+ {/* <View className='cpn-card-text' style={{ lineHeight: '10px' }}>
|
|
152
|
+ <Text className='cpn-card-text_mn'>¥{`${formatPrice(item.averagePrice)}元`}</Text>
|
|
153
|
+ </View> */}
|
|
154
|
+ {/* <View className='cpn-md-act'>
|
|
155
|
+ <Location {...item} />
|
|
156
|
+ <view className='wdscbaozan'>
|
|
157
|
+ <image className='title-on' src={baozan} />
|
|
158
|
+ <text className='title-on-text'>爆赞 {item.likeNum}</text>
|
|
159
|
+ </view>
|
|
160
|
+ </View> */}
|
|
161
|
+ </CouponMedia.Body>
|
|
162
|
+ </CouponMedia>
|
|
163
|
+ </CouponCard>
|
|
164
|
+ </View>
|
|
165
|
+ )
|
|
166
|
+ }
|
89
|
167
|
</View>
|
90
|
168
|
)
|
91
|
169
|
}
|