张延森 3 years ago
parent
commit
2c3ce5967c
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/pages/index/components/Card/index.jsx

+ 2
- 1
src/pages/index/components/Card/index.jsx View File

2
 import { useMemo } from 'react'
2
 import { useMemo } from 'react'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import useSave from "@/utils/hooks/useSave"
4
 import useSave from "@/utils/hooks/useSave"
5
+import { compressImage } from '@/utils'
5
 import msTip from '@/assets/icons/housemantj/foodtip.png'
6
 import msTip from '@/assets/icons/housemantj/foodtip.png'
6
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
7
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
7
 import location from '@/assets/icons/housemantj/location.png'
8
 import location from '@/assets/icons/housemantj/location.png'
39
     <view className={uqClass} style={{ overflow: 'hidden' }}>
40
     <view className={uqClass} style={{ overflow: 'hidden' }}>
40
       <view className='contentCard' style={style}>
41
       <view className='contentCard' style={style}>
41
         <view className='cardTop'>
42
         <view className='cardTop'>
42
-          <image mode='widthFix' onClick={Detail} src={item.poster} className='cCardimg' onLoad={handleLoad} />
43
+          <image mode='widthFix' onClick={Detail} src={compressImage(item.poster)} className='cCardimg' onLoad={handleLoad} />
43
           <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
44
           <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} />
44
           <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
45
           <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
45
         </view>
46
         </view>