123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- import Taro from '@tarojs/taro'
- import useLike from "@/utils/hooks/useLike"
- import { View } from '@tarojs/components'
- import formatPrice from "@/utils/formatPrice";
- import Star from '@/components/Star/Star.jsx'
- import position from '@/assets/icons/GuideCheck/position_logo.png'
- import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
- import Attractions from '@/assets/icons/GuideCheck/Attractions.png'
- import baozan from '@/assets/icons/housemantj/bgood.png'
- import weibaozan from '@/assets/icons/housemantj/unLike.png'
- import food from '@/assets/icons/ProCard/food.png'
- import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
-
-
-
- import './style.less'
-
- export default (props) => {
- const { item, cardNavigateTo } = props
- // const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
- const [isLike, toggleLike] = useLike(item.isLike, 'tourist', item.targetId)
-
- const targetType = item.targetType
-
- const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
- return (
-
- <View className='View-box-LR'>
- <View className='left-View-box'>
- {
- targetType === "shop_package" && (
- <view class='wrapper'>
- <view class='left-complete-one' >
- <image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
- <view className='left-viewText' >
- 返现¥{formatPrice(item.cashback)}
- </view>
- {/* 评分 */}
- <view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
- <Star star={star} />
- <text className='card-star-text' >{star}</text>
- </view>
- <view className='title-image' >
- <image className='image-1' mode='scaleToFill' src={item.poster}></image>
- <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
- </view>
- <view className='title-content'>
- <view className='Pro-title' >
- <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
- </view>
- <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
- <view className='title-position-on'>
- <image className='title-position' src={position} />
- <text className='title-position-image'>
- {
- targetType === "shop_package" && (
- item.areaPName == null ? item.areaName : item.areaPName + '/' + item.areaName
- )
- }
- </text>
- </view>
- </view>
- </view>
- <view class='right-complete-two'>
- <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` }); }}>
- <image className='right-image' src={SeeDetails} />
- <view className='right-title'>查看详情</view>
- </view>
- </view>
- </view>
- )
- }
- </View>
- <View className='right-View-box'>
- {
- targetType !== "shop_package" && (
- <view class='wrapper'>
- <view class='left-complete-one' >
- <view className='title-image'>
- <image className='image-1' mode='scaleToFill' src={item.poster}></image>
- <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
- </view>
- <view className='title-content'>
- <view className='Pro-title' >
- <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
- </view>
- <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
- <view onClick={toggleLike}>
- <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
- <text className='title-on-text'>{isLike === 1 ? '已爆赞' : '爆赞'}</text>
- </view>
- <view className='title-position-on'>
- <image className='title-position' src={position} />
- <text className='title-position-image'>
- {
- targetType === "tourist" && (
- item.areaPName == null ? item.areaName : (item.areaPName + '/' + item.areaName)
- )
- }
- {
- targetType === "shop" && (
- item.areaPName === null ? item.areaName : (item.areaPName + '/' + item.areaName)
- )
- }</text>
- </view>
- </view>
- </view>
- <view class='right-complete-two'>
- <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` }) }}>
- <image className='right-image' src={SeeDetails} />
- <view className='right-title'>查看详情</view>
- </view>
- </view>
- </view>
- )
- }
- </View>
- </View>
- )
- }
|