1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import Star from '@/components/Star/Star.jsx'
  2. import Taro from '@tarojs/taro'
  3. import pay from '@/assets/icons/housemantj/pay.png'
  4. import msTip from '@/assets/icons/housemantj/foodtip.png'
  5. import wz from '@/assets/icons/housemantj/location.png'
  6. import hongxin from '@/assets/icons/housemantj/已收藏.png'
  7. import baixin from '@/assets/icons/housemantj/收藏.png'
  8. import './style.less'
  9. import useSave from "@/utils/hooks/useSave"
  10. //套餐卡片
  11. export default (props) => {
  12. const { star, item, city } = props
  13. const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
  14. const Detail = () => {
  15. Taro.navigateTo({ url: `/pages/PayOrder/index?id=${item.packageId}&shopId=${item.shopId}` });
  16. }
  17. return (
  18. <view className='foodCard'>
  19. <view className='fCleft'>
  20. <view className='backMoney'>
  21. 返现¥{item.cashback}
  22. </view>
  23. <view className='appraise'>
  24. <Star star={star} />
  25. <text className='storezf'>{star}</text>
  26. </view>
  27. <view>
  28. <view className='contentImg'>
  29. <image src={item.poster} className='img1' ></image>
  30. <image src={msTip} className='mstip'></image>
  31. </view>
  32. <view className='neirong'>
  33. <view className='textword'>{item.description}</view>
  34. <view className='jiage'>
  35. <text className='rmb' >¥&nbsp;&nbsp;</text>
  36. <text className='p1'><text className='price' >{item.actualPrice}</text>元&nbsp;&nbsp;</text>
  37. <text className='p2'>门市价<text className='oldprice' >{item.standardPrice}</text>元</text>
  38. </view>
  39. <view className='address'>
  40. <image className='dw' src={wz} />
  41. <text className='wz'>{city.areaPName}/{city.areaName}</text>
  42. <view style={{ display: 'inline-block' }} onClick={toggleSave}>
  43. <image className='star' src={isSaved > 0 ? hongxin : baixin}></image>
  44. <text className='collection'>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view className='fCright' onClick={() => Detail()} >
  51. <image src={pay} />
  52. <view>支付</view>
  53. </view>
  54. <view className='columnLine'></view>
  55. </view>
  56. )
  57. }