1007395918@qq.com 5 年之前
父節點
當前提交
c7ac7f122c
共有 2 個文件被更改,包括 14 次插入5 次删除
  1. 10
    5
      src/onlineSelling/components/HouseCard/index.js
  2. 4
    0
      src/onlineSelling/components/HouseCard/index.scss

+ 10
- 5
src/onlineSelling/components/HouseCard/index.js 查看文件

@@ -1,7 +1,7 @@
1 1
 import { View, Image, Text } from "@tarojs/components";
2 2
 import { transferImage } from '@/utils/tools'
3 3
 import dayjs from 'dayjs'
4
-import emptyImg  from '@/assets/empty.png'
4
+import emptyImg from '@/assets/empty.png'
5 5
 
6 6
 import './index.scss'
7 7
 
@@ -14,24 +14,29 @@ export default function HouseCard(props) {
14 14
     price,
15 15
     createDate,
16 16
     status,
17
-    buildingImgList=[],
17
+    buildingImgList = [],
18 18
   } = props.summary || {}
19 19
 
20 20
   const title = `${buildingName} ${blockName} ${unitName} ${roomName}`
21
-  const thumb = (buildingImgList || []).length ? transferImage((buildingImgList)[0].url) : emptyImg
21
+  const thumb = (buildingImgList || []).length
22
+  // const thumb = (buildingImgList || []).length ? transferImage((buildingImgList)[0].url) : emptyImg
22 23
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
24
+  const wanY = Number(price / 10000).toFixed(0)
23 25
 
24 26
   return (
25 27
     <View className="housecard">
26 28
       <View className="head">
27
-        <Image className="thumb" src={thumb} mode="aspectFit" />
29
+        {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
30
+          <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
31
+        }
32
+        {/* <Image className="thumb" src={thumb} mode="aspectFit" /> */}
28 33
       </View>
29 34
       <View className="body">
30 35
         <View className="badge">已预选</View>
31 36
         <View className="title">{title}</View>
32 37
         <View className="subtitle">
33 38
           <Text>现价</Text>
34
-          <Text className="red">{price || '待定'}</Text>
39
+          <Text className="red">{wanY+'万' || '待定'}</Text>
35 40
         </View>
36 41
         <View className="meta">{showDT}预选</View>
37 42
         <View className="sign bg-success"></View>

+ 4
- 0
src/onlineSelling/components/HouseCard/index.scss 查看文件

@@ -14,6 +14,10 @@
14 14
     flex: none;
15 15
     border-right: 2px solid rgba(0, 0, 0, 0.04);
16 16
     padding: 20px;
17
+    display: flex;
18
+    align-items: center;
19
+    justify-content: center;
20
+
17 21
 
18 22
     .thumb {
19 23
       width: 100%;