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
 import { View, Image, Text } from "@tarojs/components";
1
 import { View, Image, Text } from "@tarojs/components";
2
 import { transferImage } from '@/utils/tools'
2
 import { transferImage } from '@/utils/tools'
3
 import dayjs from 'dayjs'
3
 import dayjs from 'dayjs'
4
-import emptyImg  from '@/assets/empty.png'
4
+import emptyImg from '@/assets/empty.png'
5
 
5
 
6
 import './index.scss'
6
 import './index.scss'
7
 
7
 
14
     price,
14
     price,
15
     createDate,
15
     createDate,
16
     status,
16
     status,
17
-    buildingImgList=[],
17
+    buildingImgList = [],
18
   } = props.summary || {}
18
   } = props.summary || {}
19
 
19
 
20
   const title = `${buildingName} ${blockName} ${unitName} ${roomName}`
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
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
23
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
24
+  const wanY = Number(price / 10000).toFixed(0)
23
 
25
 
24
   return (
26
   return (
25
     <View className="housecard">
27
     <View className="housecard">
26
       <View className="head">
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
       </View>
33
       </View>
29
       <View className="body">
34
       <View className="body">
30
         <View className="badge">已预选</View>
35
         <View className="badge">已预选</View>
31
         <View className="title">{title}</View>
36
         <View className="title">{title}</View>
32
         <View className="subtitle">
37
         <View className="subtitle">
33
           <Text>现价</Text>
38
           <Text>现价</Text>
34
-          <Text className="red">{price || '待定'}</Text>
39
+          <Text className="red">{wanY+'万' || '待定'}</Text>
35
         </View>
40
         </View>
36
         <View className="meta">{showDT}预选</View>
41
         <View className="meta">{showDT}预选</View>
37
         <View className="sign bg-success"></View>
42
         <View className="sign bg-success"></View>

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

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