张延森 5 лет назад
Родитель
Сommit
03d7f863cd

+ 21
- 9
src/onlineSelling/components/RaiseCard/index.js Просмотреть файл

@@ -1,4 +1,4 @@
1
-import { View, Image, Text } from "@tarojs/components";
1
+import { View, Image, Text, Block } from "@tarojs/components";
2 2
 import { transferImage } from '@/utils/tools'
3 3
 import dayjs from 'dayjs'
4 4
 import copyImg from '../../assets/copy.png'
@@ -21,7 +21,7 @@ export default function RaiseCard(props) {
21 21
     buildingArea,
22 22
     insideArea,
23 23
     payStatus,
24
-    code,
24
+    houseId,
25 25
     buildingImgList = [],
26 26
   } = props.summary || {}
27 27
 
@@ -34,7 +34,7 @@ export default function RaiseCard(props) {
34 34
   const copyData = (e) => {
35 35
     e.stopPropagation()
36 36
     Taro.setClipboardData({
37
-      data: code,
37
+      data: houseId,
38 38
       onSuccess: (() => { }),
39 39
     })
40 40
   }
@@ -55,17 +55,29 @@ export default function RaiseCard(props) {
55 55
         {props.type == 'raiseMoney' && <Image src={closeImg} onClick={handleCancel} className="close-img"></Image>}
56 56
         <View onClick={props.handleCard}>
57 57
           {!props.type && <View className={payStatus == 'paid' ? 'raised badge' : payStatus == 'unpaid' ? 'unraise badge' : 'badge'}>{payStatus == 'paid' ? '已缴费' : payStatus == 'unpaid' ? '未缴费' : '已退费'}</View>}
58
-          {(props.type == 'raiseProfile' || props.type == 'houseResource') && houseLockingStatus == 'locked' && <View style="color:#FF3C3C" className='raised badge'>{mineLocked ? '已锁给我' : ''}</View>}
59
-          {props.type == 'raiseProfile' || props.type == 'raiseMoney' && <View style={props.type == 'raiseMoney' ? 'color:#BB9C79;font-size:30rpx' : 'color:#BB9C79;font-size:30rpx;margin-top:-20rpx'}>{apartmentName || ' '}</View>}
58
+          {(props.type == 'raiseProfile' || props.type == 'houseResource') && <View style="color:#FF3C3C" className='badge'>{mineLocked ? '已锁给我' : ' '}</View>}
59
+          {(props.type == 'raiseProfile' || props.type == 'raiseMoney') && <View style={props.type == 'raiseMoney' ? 'color:#BB9C79;font-size:30rpx' : 'color:#BB9C79;font-size:30rpx;margin-top:-20rpx'}>{apartmentName || ' '}</View>}
60 60
           {props.type == 'raiseMoney' && <View className="red-price">现价{Number(price) + 0}万</View>}
61
-          {props.type == 'houseResource' && <View style="color:#BB9C79;font-size:28rpx;margin:-40rpx 0 26rpx 0">{houseLockingStatus == 'locked' ? '已锁定' : '未锁定'}</View>}
61
+          {props.type == 'houseResource' && <View style="color:#BB9C79;font-size:28rpx;margin:-40rpx 0 12rpx 0">{houseLockingStatus == 'locked' ? '已锁定' : '未锁定'}</View>}
62 62
           <View className="title">{title}</View>
63 63
           {!props.type && <View className="meta">{showDT}</View>}
64 64
           {props.type == 'raiseProfile' && <View className="price">现价<Text className="red">{Number(price) + 0}</Text>万</View>}
65
-          {props.type == 'raiseProfile' || props.type == 'raiseMoney' && buildingArea && <View className="area">建筑面积约<Text className="red">{buildingArea}m²</Text></View>}
66
-          {props.type == 'raiseProfile' || props.type == 'raiseMoney' && insideArea && <View className="area">使用面积约<Text className="red">{insideArea}m²</Text></View>}
65
+          {(props.type == 'raiseProfile' || props.type == 'raiseMoney') &&
66
+            <Block>
67
+              {buildingArea ? <View className="area">建筑面积约 <Text className="red">{buildingArea}m²</Text>
68
+              </View> : <View className="area">建筑面积待定
69
+            </View>}
70
+            </Block>
71
+          }
72
+          {(props.type == 'raiseProfile' || props.type == 'raiseMoney') &&
73
+            <Block>
74
+              {insideArea ? <View className="area">使用面积约 <Text className="red">{insideArea}m²</Text>
75
+              </View> : <View className="area">使用面积待定
76
+            </View>}
77
+            </Block>
78
+          }
67 79
         </View>
68
-        {props.type == 'houseResource' && <View className="house-code" style="margin-top:26rpx">房源编号:{code}
80
+        {props.type == 'houseResource' && <View className="house-code" style="margin-top:14rpx">房源编号:{houseId}
69 81
           <Image src={copyImg} className="copy-img" onClick={copyData}></Image>
70 82
         </View>}
71 83
       </View>

+ 5
- 2
src/onlineSelling/pages/detail/index.js Просмотреть файл

@@ -15,7 +15,7 @@ import * as houseActions from '@/actions/house'
15 15
 
16 16
 @connect(
17 17
   ({ user, house }) => ({ ...user, house }),
18
-  {...houseActions}
18
+  { ...houseActions }
19 19
 )
20 20
 
21 21
 export default class Index extends Component {
@@ -148,6 +148,7 @@ export default class Index extends Component {
148 148
 
149 149
   render() {
150 150
     const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList = [], popVisiable } = this.state
151
+    const { taRaise } = this.state.houseDetail
151 152
     const { userInfo } = this.props
152 153
     const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
153 154
 
@@ -205,7 +206,9 @@ export default class Index extends Component {
205 206
                 <View className="date">
206 207
                   预选时间:{dayjs(houseDetail.preselectionStartTime).format('MM/DD HH:mm:ss')}--{dayjs(houseDetail.preselectionEndTime).format('MM/DD HH:mm:ss')}
207 208
                 </View>
208
-                <View className="date">认筹时间:2/12 12:23:33--2/13 12:23:34</View>
209
+                {taRaise && <View className="date">认筹时间:{dayjs(taRaise.raiseStartTime).format('MM/DD HH:mm:ss')}--{dayjs(taRaise.raiseEndTime).format('MM/DD HH:mm:ss')}
210
+                </View>}
211
+
209 212
               </View>
210 213
               <View className="num">
211 214
                 已有{houseDetail.realHeat + houseDetail.heat + 0}人预选此房源,快快预选认筹~

+ 46
- 18
src/onlineSelling/pages/raiseMoney/index.js Просмотреть файл

@@ -15,13 +15,12 @@ import { getCodeMessage } from '@/services/getCode'
15 15
 import { checkIDCard, isEmpty } from '@/utils/tools'
16 16
 import ContactConsultant from '../../components/ContactConsultant'
17 17
 
18
-const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId}) => {
18
+const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId }) => {
19 19
   const queryString = [
20 20
     `${raiseRecordId ? 'raiseRecordId=' + raiseRecordId : ''}`,
21 21
     `${salesBatchId ? 'salesBatchId=' + salesBatchId : ''}`,
22 22
     `${personId ? 'personId=' + personId : ''}`,
23 23
   ].filter(Boolean).join('&')
24
-  console.log('----------queryString-------------->', queryString)
25 24
 
26 25
   return fetch({ url: `${apis.API_RAISE_PROFILE}?${queryString}` })
27 26
 }
@@ -81,11 +80,10 @@ export default class raiseMoney extends Component {
81 80
   }
82 81
 
83 82
   loadInfo(salesBatchId, raiseRecordId) {
84
-    const { house } = this.props
83
+    const { userInfo, house } = this.props
84
+    const { personId } = userInfo.person
85 85
     const defaultRecord = this.initRecord()
86 86
 
87
-    console.log('----------this.props------------->', getRaiseProfile)
88
-
89 87
     // 请求认筹信息
90 88
     getRaiseProfile({ salesBatchId, raiseRecordId, personId }).then(res => {
91 89
       this.setState({ raiseProfile: res, record: res.record || defaultRecord })
@@ -320,15 +318,44 @@ export default class raiseMoney extends Component {
320 318
       </ScrollView >
321 319
     )
322 320
   }
323
-
321
+  toDecimal2 = (x) => {
322
+    var f = parseFloat(x);
323
+    if (isNaN(f)) {
324
+      return false;
325
+    }
326
+    var f = Math.round(x * 100) / 100;
327
+    var s = f.toString();
328
+    var rs = s.indexOf('.');
329
+    if (rs < 0) {
330
+      rs = s.length;
331
+      s += '.';
332
+    }
333
+    while (s.length <= rs + 2) {
334
+      s += '0';
335
+    }
336
+    return s;
337
+  }
338
+  regFenToYuan = (fen) => {
339
+    var num = fen;
340
+    num = fen * 0.01;
341
+    num += '';
342
+    var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
343
+    num = num.replace(reg, '$1');
344
+    num = this.toDecimal2(num)
345
+    return num
346
+  };
324 347
   renderMoney() {
348
+    const { raiseProfile = {} } = this.state
349
+
350
+
325 351
     return (
326 352
       <ScrollView scrollY className="container2" style="padding:0 30rpx">
327 353
         <View className="profile-flex">
328 354
           <View className="title">认筹金额</View>
329
-          <View className="price">1 元</View>
355
+          <View className="price">{this.regFenToYuan(raiseProfile.raisePrice)}元</View>
330 356
         </View>
331
-        <View className="center-title">线上选房协议</View>
357
+        <View className="center-title">线上缴费说明</View>
358
+        <RichText nodes={raiseProfile.payDescriptionOnline || ''} />
332 359
       </ScrollView >
333 360
     )
334 361
   }
@@ -344,17 +371,17 @@ export default class raiseMoney extends Component {
344 371
 
345 372
     if (record.raiseRecordId) {
346 373
       // 如果认筹单跟预选的房源不一致, 说明是新的认筹
347
-      let found = false
374
+      let found = true
348 375
       for (let inx in house.raiseCart) {
349
-        const has = (record.taHousingResourcesList || []).filter(x => houseId == house.raiseCart[inx].houseId)[0]
376
+        const has = (record.taHousingResourcesList || []).filter(x => x.houseId == house.raiseCart[inx].houseId)[0]
350 377
 
351
-        if (has) {
352
-          found = true;
378
+        if (!has) {
379
+          found = false;
353 380
           break;
354 381
         }
355 382
       }
356 383
 
357
-      if (found) {
384
+      if (!found) {
358 385
         const defaultRecord = this.initRecord()
359 386
         this.setState({ record: defaultRecord })
360 387
       }
@@ -462,13 +489,14 @@ export default class raiseMoney extends Component {
462 489
     })
463 490
 
464 491
   }
465
-  toRaiseProfile() {
466
-    const id = this.$router.params.raiseRecordId
492
+  toRaiseProfile(id) {
493
+
467 494
     Taro.navigateTo({
468 495
       url: `/onlineSelling/pages/raiseProfile/index?raiseRecordId=${id}`
469 496
     })
470 497
   }
471 498
   renderResult() {
499
+    const { raiseProfile = {} } = this.state
472 500
     return (
473 501
       <View className="result">
474 502
         <Image className="result-img" src={require('../../assets/success2.png')}></Image>
@@ -477,9 +505,9 @@ export default class raiseMoney extends Component {
477 505
 
478 506
         <View className="tip" style="margin-bottom:10rpx">详情请查看认筹单</View>
479 507
         <View className="tip">支付结果请留意微信支付通知</View>
480
-        {/* <ContactConsultant buildingId={buildingId} style=" position: absolute;bottom: 8vh;" /> */}
481
-        <ContactConsultant style=" position: absolute;bottom: 11vh;" />
482
-        <View className="look-btn" onClick={() => this.toRaiseProfile()}>查看认筹单</View>
508
+        <ContactConsultant buildingId={raiseProfile.buildingId} style=" position: absolute;bottom: 11vh;" />
509
+
510
+        <View className="look-btn" onClick={() => this.toRaiseProfile(raiseProfile.raiseId)}>查看认筹单</View>
483 511
       </View>
484 512
 
485 513
     );

+ 6
- 0
src/onlineSelling/pages/raiseMoney/index.scss Просмотреть файл

@@ -60,6 +60,7 @@
60 60
     font-size: 24px;
61 61
     color: #333;
62 62
     text-align: center;
63
+    line-height: 2;
63 64
   }
64 65
   .profile-box{
65 66
     padding: 0 30px;
@@ -106,6 +107,11 @@
106 107
       font-size: 24px;
107 108
       color: #BB9C79;
108 109
     }
110
+    .title{
111
+      font-size: 36px;
112
+      color: #333;
113
+      font-weight: 700;
114
+    }
109 115
     .price{
110 116
       color: #FF3C3C;
111 117
       font-size: 44px;

+ 15
- 43
src/onlineSelling/pages/raiseProfile/houseResource.js Просмотреть файл

@@ -2,59 +2,31 @@ import Taro, { Component } from '@tarojs/taro'
2 2
 import { View } from '@tarojs/components'
3 3
 import './index.scss'
4 4
 import RaiseCard from '../../components/RaiseCard'
5
+import { queryRaiseDetail } from '@/services/project'
5 6
 
6 7
 export default class HouseResource extends Component {
7 8
   config = {
8 9
     navigationBarTitleText: '房源清单'
9 10
   }
11
+  state = {
12
+    houseList: [],
13
+  }
10 14
 
11
-  render() {
12
-    const list = [
13
-      {
14
-        apartmentName: 'A户型',
15
-        blockName: "1栋",
16
-        buildingId: "9f021a59b2a714822894c23ccca8c2db",
17
-        buildingImgList: null,
18
-        buildingName: "万科安平园舍",
19
-        createDate: "2020-02-27T16:31:56",
20
-        floorName: "1楼",
21
-        houseId: "820",
22
-        preselectionRecordId: 205,
23
-        price: "111.00000000",
24
-        roomName: "1户",
25
-        saleBatchStatus: "1",
26
-        status: 1,
27
-        termname: "1期",
28
-        unitName: "2单元",
29
-        area1: '290',
30
-        area2: '270',
31
-        code: '2-09876545456'
32
-      }, {
33
-        apartmentName: 'B户型',
34
-        blockName: "1栋",
35
-        buildingId: "9f021a59b2a714822894c23ccca8c2db",
36
-        buildingImgList: null,
37
-        buildingName: "凤翔新城",
38
-        createDate: "2020-02-27T16:31:56",
39
-        floorName: "1楼",
40
-        houseId: "820",
41
-        preselectionRecordId: 206,
42
-        price: "111.00000000",
43
-        roomName: "1户",
44
-        saleBatchStatus: "1",
45
-        status: 1,
46
-        termname: "1期",
47
-        unitName: "2单元",
48
-        area1: '290',
49
-        area2: '270',
50
-        code: '2-09876545333'
51
-      },
52
-    ]
15
+  componentWillMount() {
16
+    const { raiseRecordId } = this.$router.params
17
+    queryRaiseDetail(raiseRecordId).then(res => {
18
+      this.setState({
19
+        houseList: res.houseList || [],
53 20
 
21
+      })
22
+    })
23
+  }
24
+  render() {
25
+    const { houseList } = this.state
54 26
     return (
55 27
       <View style="padding-top:30rpx">
56 28
         {
57
-          list.map(item => (
29
+          houseList.map(item => (
58 30
             <View key={item.raiseRecordId} >
59 31
               <RaiseCard type="houseResource" summary={item} />
60 32
             </View>

+ 4
- 3
src/onlineSelling/pages/raiseProfile/index.js Просмотреть файл

@@ -54,8 +54,9 @@ export default class Raise extends Component {
54 54
 
55 55
   // 查看所有认筹房源
56 56
   viewAllHouses = () => {
57
+    const { raiseRecordId } = this.$router.params
57 58
     Taro.navigateTo({
58
-      url: '/onlineSelling/pages/raiseProfile/houseResource'
59
+      url: `/onlineSelling/pages/raiseProfile/houseResource?raiseRecordId=${raiseRecordId}`
59 60
     })
60 61
   }
61 62
 
@@ -182,7 +183,7 @@ export default class Raise extends Component {
182 183
     // 缴费信息
183 184
     const payInfo = [
184 185
       { head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
185
-      { head: '实际支付费用', body: this.regFenToYuan(orderDetail.totalFee) },
186
+      { head: '实际支付费用', body: this.regFenToYuan(orderDetail.totalFee)+'元' },
186 187
       { head: '缴费成功时间', body: dayjs(orderDetail.payTime).format('YYYY/MM/DD HH:mm:ss') },
187 188
     ]
188 189
 
@@ -191,7 +192,7 @@ export default class Raise extends Component {
191 192
       { head: '退费状态', body: refundOrder.payStatus == 'refunded' ? '退费完成' : '退费中' },
192 193
       { head: '退费结果', body: refundOrder.payStatus == 'refunded' ? '成功' : '失败' },
193 194
       { head: '退费发起时间', body: dayjs(refundOrder.createDate).format('YYYY/MM/DD HH:mm:ss') },
194
-      { head: '实退费用', body: this.regFenToYuan(refundOrder.totalFee) },
195
+      { head: '实退费用', body: this.regFenToYuan(refundOrder.totalFee)+'元' },
195 196
       { head: '退费到账时间', body: dayjs(refundOrder.payTime).format('YYYY/MM/DD HH:mm:ss') },
196 197
       { head: '退费原因', desc: raiseDeatil.refundReason },
197 198
     ]

+ 2
- 6
src/onlineSelling/pages/screenHouse/index.js Просмотреть файл

@@ -18,11 +18,7 @@ export default class Index extends Component {
18 18
     priceCurrent: 0,
19 19
     startPrice: '100',
20 20
     endPrice: null,
21
-    apartmentList: [
22
-      // { apartmentName: 'A 户型', buildingArea: '149', area2: '131' },
23
-      // { apartmentName: 'B 户型', buildingArea: '95', area2: '84.7' },
24
-      // { apartmentName: 'C 户型', buildingArea: '95', area2: '84.7' },
25
-    ]
21
+    apartmentList: []
26 22
   }
27 23
 
28 24
   componentWillMount() {
@@ -118,7 +114,7 @@ export default class Index extends Component {
118 114
               <View className='construction__area'>
119 115
                 <Text>{apartmentItem.buildingArea ? '建筑面积约' + apartmentItem.buildingArea + 'm²' : '建筑面积待定'}</Text>
120 116
                 {
121
-                  apartmentItem.area2 ? <Text>使用面积约{apartmentItem.area2}m²</Text> : <Text>使用面积待定</Text>
117
+                  apartmentItem.insideArea ? <Text>使用面积约{apartmentItem.insideArea}m²</Text> : <Text>使用面积待定</Text>
122 118
                 }
123 119
               </View>
124 120
             </View>