浏览代码

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into dev

张延森 5 年前
父节点
当前提交
d756d187bb

+ 2
- 0
src/constants/api.js 查看文件

62
 export const API_RAISE_PROFILE = resolvePath('taRaise')
62
 export const API_RAISE_PROFILE = resolvePath('taRaise')
63
 export const API_SAVE_RAISE_RECORD = resolvePath('taRaiseRecord')
63
 export const API_SAVE_RAISE_RECORD = resolvePath('taRaiseRecord')
64
 export const API_RATSE_RECORD = resolvePath('taRaiseRecord/list')
64
 export const API_RATSE_RECORD = resolvePath('taRaiseRecord/list')
65
+export const API_RATSE_DETAIL = resolvePath('taRaiseRecord')
66
+export const API_RATSE_ORDER = resolvePath('unifiedOrder')
65
 export const API_HOUSE_DETAIL = resolvePath('getHousingDetailById')
67
 export const API_HOUSE_DETAIL = resolvePath('getHousingDetailById')
66
 export const API_ADD_PRESELECTION = resolvePath('taPreselectionRecord')
68
 export const API_ADD_PRESELECTION = resolvePath('taPreselectionRecord')
67
 export const API_CANCEL_PRESELECTION = resolvePath('taPreselectionRecordCancel')
69
 export const API_CANCEL_PRESELECTION = resolvePath('taPreselectionRecordCancel')

+ 5
- 12
src/onlineSelling/components/RaiseCard/index.js 查看文件

23
     status = 1,
23
     status = 1,
24
     area1,
24
     area1,
25
     area2,
25
     area2,
26
+    payStatus,
26
     code,
27
     code,
27
     buildingImgList = [],
28
     buildingImgList = [],
28
   } = props.summary || {}
29
   } = props.summary || {}
32
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
33
   const showDT = dayjs(createDate).format('YYYY/MM/DD')
33
   const wanY = Number(price)
34
   const wanY = Number(price)
34
 
35
 
35
-  const toHouseDetail = () => {
36
-    if (housingStatus == '0' || saleBatchStatus == '0') {
37
-      Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
38
-    } else {
39
-      Taro.navigateTo({
40
-        url: `/onlineSelling/pages/detail/index?id=${houseId}`
41
-      })
42
-    }
43
-  }
36
+
44
   const copyData = (e) => {
37
   const copyData = (e) => {
45
     e.stopPropagation()
38
     e.stopPropagation()
46
     Taro.setClipboardData({
39
     Taro.setClipboardData({
55
     }
48
     }
56
   }
49
   }
57
   return (
50
   return (
58
-    <View className="housecard" style={props.style}>
59
-      <View className="head" onClick={toHouseDetail}>
51
+    <View className="housecard" style={props.style} onClick={props.handleCard}>
52
+      <View className="head">
60
         {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
53
         {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
61
           <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
54
           <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
62
         }
55
         }
64
       <View className="body">
57
       <View className="body">
65
         {props.type == 'raiseMoney' && <Image src={closeImg} onClick={handleCancel} className="close-img"></Image>}
58
         {props.type == 'raiseMoney' && <Image src={closeImg} onClick={handleCancel} className="close-img"></Image>}
66
         <View onClick={toHouseDetail}>
59
         <View onClick={toHouseDetail}>
67
-          {!props.type && <View className={status == '1' ? 'raised badge' : status == '2' ? 'unraise badge' : 'badge'}>{status == '1' ? '已缴费' : '未缴费'}</View>}
60
+          {!props.type && <View className={payStatus == 'paid' ? 'raised badge' : payStatus == 'unpaid' ? 'unraise badge' : 'badge'}>{payStatus == 'paid' ? '已缴费' : payStatus == 'unpaid' ? '未缴费' : '已退费'}</View>}
68
           {(props.type == 'raiseProfile' || props.type == 'houseResource') && <View style="color:#FF3C3C" className={status == '1' ? 'raised badge' : status == '2' ? 'unraise badge' : 'badge'}>{status == '1' ? '已锁给我' : '未缴费'}</View>}
61
           {(props.type == 'raiseProfile' || props.type == 'houseResource') && <View style="color:#FF3C3C" className={status == '1' ? 'raised badge' : status == '2' ? 'unraise badge' : 'badge'}>{status == '1' ? '已锁给我' : '未缴费'}</View>}
69
           {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>}
62
           {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>}
70
           {props.type == 'raiseMoney' && <View className="red-price">现价{Number(price) + 0}万</View>}
63
           {props.type == 'raiseMoney' && <View className="red-price">现价{Number(price) + 0}万</View>}

+ 61
- 11
src/onlineSelling/pages/raiseMoney/index.js 查看文件

10
 import NextStep from './NextStep'
10
 import NextStep from './NextStep'
11
 import { fetch, apis } from '@/utils/request'
11
 import { fetch, apis } from '@/utils/request'
12
 import Captcha from './Captcha'
12
 import Captcha from './Captcha'
13
+import { raiseOrder } from '@/services/project'
13
 
14
 
14
 const getRaiseProfile = ({raiseId, salesBatchId, personId}) => {
15
 const getRaiseProfile = ({raiseId, salesBatchId, personId}) => {
15
   const queryString = [
16
   const queryString = [
70
         })
71
         })
71
         return;
72
         return;
72
       }
73
       }
74
+      
75
+      if (this.$router.params.type == 'pay') {
76
+        this.setState({ current: 3 })
77
+      }
73
     })
78
     })
74
   }
79
   }
75
 
80
 
133
       <ScrollView scrollY className="container">
138
       <ScrollView scrollY className="container">
134
         {
139
         {
135
           raiseCart.map(item => (
140
           raiseCart.map(item => (
136
-              <View key={item.preselectionRecordId} >
141
+              <View key={item.houseId} >
137
                 <RaiseCard type="raiseMoney" summary={item} onCancel={this.handleCancel}/>
142
                 <RaiseCard type="raiseMoney" summary={item} onCancel={this.handleCancel}/>
138
               </View>
143
               </View>
139
             )
144
             )
188
 
193
 
189
   tochooseConsultant() {
194
   tochooseConsultant() {
190
     Taro.navigateTo({
195
     Taro.navigateTo({
191
-      url: 'onlineSelling/pages/chooseConsultant/index'
196
+      url: '/onlineSelling/pages/chooseConsultant/index'
192
     })
197
     })
193
   }
198
   }
194
   renderProfile() {
199
   renderProfile() {
248
       <ScrollView scrollY className="container2" style="padding:0 30rpx">
253
       <ScrollView scrollY className="container2" style="padding:0 30rpx">
249
         <View className="profile-flex">
254
         <View className="profile-flex">
250
           <View className="title">认筹金额</View>
255
           <View className="title">认筹金额</View>
251
-          <View className="price">30000 元</View>
256
+          <View className="price">1 元</View>
252
         </View>
257
         </View>
253
         <View className="center-title">线上选房协议</View>
258
         <View className="center-title">线上选房协议</View>
254
       </ScrollView >
259
       </ScrollView >
266
       })
271
       })
267
     })
272
     })
268
   }
273
   }
274
+
275
+  makePay = () => {
276
+    const params = {
277
+      targetId: this.$router.params.id,
278
+      targetType: 'house'
279
+    }
280
+    
281
+    return new Promise((resolve, reject) => {
282
+      raiseOrder(params).then(res => {
283
+        Taro.requestPayment({
284
+          timeStamp: res.timeStamp,
285
+          nonceStr: res.noncestr,
286
+          package: `prepay_id=${res.prepayid}`,
287
+          signType: 'MD5',
288
+          paySign: res.sign,
269
   
289
   
290
+          success(res) {
291
+            // TODO 缴费成功
292
+
293
+            // 调用远程接口
294
+
295
+
296
+            // 最后
297
+            resolve()
298
+          },
299
+          fail(res) {
300
+            // TODO 缴费失败
301
+
302
+            // 然后
303
+            reject()
304
+          }
305
+        })
306
+      })
307
+    })
308
+
309
+  }
310
+
270
   nextStep(current) {
311
   nextStep(current) {
312
+    switch (current) {
313
+      // 认筹确认
314
+      case 2:
315
+        this.makeRaiseRecord().then(() => {
316
+          this.setState({
317
+            current: current + 1
318
+          })
319
+        })
320
+        return;
271
 
321
 
272
-    // 确定认筹
273
-    if (current === 2) {
274
-      this.makeRaiseRecord().then(() => {
322
+      // 缴费
323
+      case 3:
324
+        this.makePay()
325
+        return;
326
+
327
+      //
328
+      default:
275
         this.setState({
329
         this.setState({
276
           current: current + 1
330
           current: current + 1
277
         })
331
         })
278
-      })
279
-    } else {
280
-      this.setState({
281
-        current: current + 1
282
-      })
332
+
283
     }
333
     }
284
   }
334
   }
285
 
335
 

+ 20
- 16
src/onlineSelling/pages/raiseProfile/Cell.js 查看文件

1
-import { View } from '@tarojs/components'
1
+import { View, Block } from '@tarojs/components'
2
 import './index.scss'
2
 import './index.scss'
3
 import NamedIcon from '../../components/NamedIcon'
3
 import NamedIcon from '../../components/NamedIcon'
4
 
4
 
7
   console.log('------->', props)
7
   console.log('------->', props)
8
 
8
 
9
   return (
9
   return (
10
-    <View className={`raiseCell ${disable}`}>
11
-      <View className="row">
12
-        <View className="head">{props.head}</View>
13
-        <View className="body">{props.body}</View>
14
-        <View className="action" onClick={props.onActionClick}>
10
+    <Block>
11
+      {
12
+        !props.hide && <View className={`raiseCell ${disable}`}>
13
+          <View className="row">
14
+            <View className="head">{props.head}</View>
15
+            <View className="body">{props.body}</View>
16
+            <View className="action" onClick={props.onActionClick}>
17
+              {
18
+                props.action && (<NamedIcon name="copy" size={34} />)
19
+              }
20
+            </View>
21
+          </View>
15
           {
22
           {
16
-            props.action && (<NamedIcon name="copy" size={34} />)
23
+            props.desc &&
24
+            (
25
+              <View className="row desc">
26
+                <View className="desc">{props.desc}</View>
27
+              </View>
28
+            )
17
           }
29
           }
18
         </View>
30
         </View>
19
-      </View>
20
-      {
21
-        props.desc &&
22
-        (
23
-          <View className="row desc">
24
-            <View className="desc">{props.desc}</View>
25
-          </View>
26
-        )
27
       }
31
       }
28
-    </View>
32
+    </Block>
29
   )
33
   )
30
 }
34
 }

+ 1
- 0
src/onlineSelling/pages/raiseProfile/CellBlock.js 查看文件

22
               head={item.head}
22
               head={item.head}
23
               body={item.body}
23
               body={item.body}
24
               action={item.action}
24
               action={item.action}
25
+              hide={item.hide}
25
               desc={item.desc}
26
               desc={item.desc}
26
               onActionClick={handleActionClick.bind(this, item)}
27
               onActionClick={handleActionClick.bind(this, item)}
27
               />
28
               />

+ 1
- 1
src/onlineSelling/pages/raiseProfile/houseResource.js 查看文件

55
       <View style="padding-top:30rpx">
55
       <View style="padding-top:30rpx">
56
         {
56
         {
57
           list.map(item => (
57
           list.map(item => (
58
-            <View key={item.preselectionRecordId} >
58
+            <View key={item.raiseRecordId} >
59
               <RaiseCard type="houseResource" summary={item} />
59
               <RaiseCard type="houseResource" summary={item} />
60
             </View>
60
             </View>
61
           )
61
           )

+ 55
- 54
src/onlineSelling/pages/raiseProfile/index.js 查看文件

7
 import ConsultantItem from '../../components/ConsultantItem/index'
7
 import ConsultantItem from '../../components/ConsultantItem/index'
8
 import NamedIcon from '../../components/NamedIcon'
8
 import NamedIcon from '../../components/NamedIcon'
9
 import RaiseCard from '../../components/RaiseCard'
9
 import RaiseCard from '../../components/RaiseCard'
10
+import { queryRaiseDetail } from '@/services/project'
11
+
10
 
12
 
11
 import './index.scss'
13
 import './index.scss'
12
 import consultant from 'dist/components/consultant'
14
 import consultant from 'dist/components/consultant'
17
   }
19
   }
18
 
20
 
19
   state = {
21
   state = {
20
-    buildingId: '9f021a59b2a714822894c23ccca8c2db', // must change this
22
+    buildingId: '',
23
+    raiseDeatil: {},
24
+    houseList: [],
25
+    raiseOrder: {}
21
   }
26
   }
22
 
27
 
23
-  componentWillMount() { }
28
+  componentWillMount() {
29
+    const { raiseRecordId } = this.$router.params
30
+    queryRaiseDetail(raiseRecordId).then(res => {
31
+      this.setState({
32
+        buildingId: res.taRaiseRecord.buildingId,
33
+        raiseDeatil: res.taRaiseRecord || {},
34
+        houseList: res.houseList || [],
35
+        raiseOrder: res.taRaise || {},
36
+      })
37
+    })
38
+  }
24
 
39
 
25
   // 复制数据
40
   // 复制数据
26
   copyData(data) {
41
   copyData(data) {
30
     })
45
     })
31
   }
46
   }
32
 
47
 
33
-  // 跳转去交费
34
-  toPay = () => {
35
 
48
 
36
-  }
37
 
49
 
38
   // 查看所有认筹房源
50
   // 查看所有认筹房源
39
   viewAllHouses = () => {
51
   viewAllHouses = () => {
43
   }
55
   }
44
 
56
 
45
   renderHead() {
57
   renderHead() {
46
-    const item = {
47
-      apartmentId: null,
48
-      apartmentName: 'A户型',
49
-      avatarurl: null,
50
-      blockName: "1栋",
51
-      buildingId: "9f021a59b2a714822894c23ccca8c2db",
52
-      buildingImgList: null,
53
-      buildingName: "万科安平园舍",
54
-      createDate: "2020-02-27T16:31:56",
55
-      floorName: "1楼",
56
-      houseId: "820",
57
-      housingStatus: "1",
58
-      name: null,
59
-      nameOrnick: null,
60
-      orgId: 84,
61
-      personId: "899b8930e85125471f0981eec4a0de3c",
62
-      phone: null,
63
-      preselectionRecordId: 205,
64
-      price: "111.00000000",
65
-      roomName: "1户",
66
-      saleBatchStatus: "1",
67
-      status: 1,
68
-      termname: "1期",
69
-      unitName: "2单元",
70
-      area1: '290',
71
-      area2: '270',
72
-
73
-    }
58
+    const { houseList } = this.state
74
     return (
59
     return (
75
       <Block>
60
       <Block>
76
         <View className="head flexSpace">
61
         <View className="head flexSpace">
78
             <View className="title">认筹房源</View>
63
             <View className="title">认筹房源</View>
79
           </View>
64
           </View>
80
           <View className="flexSpace-fixed">
65
           <View className="flexSpace-fixed">
81
-            <View className="gray" onClick={this.viewAllHouses}>
82
-              <Text>查看全部(4)</Text>
66
+            {houseList.length > 1 && <View className="gray" onClick={this.viewAllHouses}>
67
+              <Text>查看全部({houseList.length})</Text>
83
               <Text className='at-icon at-icon-chevron-right'></Text>
68
               <Text className='at-icon at-icon-chevron-right'></Text>
84
-            </View>
69
+            </View>}
70
+
85
           </View>
71
           </View>
86
         </View>
72
         </View>
87
-        <RaiseCard summary={item} type="raiseProfile" style="height:280rpx" />
73
+        <RaiseCard summary={houseList[0]} type="raiseProfile" style="height:280rpx" />
88
       </Block>
74
       </Block>
89
     )
75
     )
90
   }
76
   }
107
       </Block>
93
       </Block>
108
     )
94
     )
109
   }
95
   }
110
-
96
+  // 跳转去交费
97
+  toPay = () => {
98
+    const { raiseDeatil: { raiseRecordId } } = this.state
99
+    Taro.navigateTo({
100
+      url: `/onlineSelling/pages/raiseMoney/index?type=pay&id=${raiseRecordId}`
101
+    })
102
+  }
111
   // 未交费提示
103
   // 未交费提示
112
   renderUnpayNotice() {
104
   renderUnpayNotice() {
105
+    const { raiseOrder } = this.state
113
     return (
106
     return (
114
       <Block>
107
       <Block>
115
         <View className="unpayNotice flexSpace" onClick={this.toPay}>
108
         <View className="unpayNotice flexSpace" onClick={this.toPay}>
119
           </View>
112
           </View>
120
           <View className="flexSpace-fixed">
113
           <View className="flexSpace-fixed">
121
             <Text className="a-line">认筹金额</Text>
114
             <Text className="a-line">认筹金额</Text>
122
-            <Text className="a-line price">30000元</Text>
115
+            <Text className="a-line price">{raiseOrder.raisePrice}元</Text>
123
           </View>
116
           </View>
124
         </View>
117
         </View>
125
         <View className="hr"></View>
118
         <View className="hr"></View>
128
   }
121
   }
129
 
122
 
130
   render() {
123
   render() {
131
-    const { buildingId } = this.state;
124
+    const { buildingId, raiseDeatil } = this.state;
132
 
125
 
133
     // 认筹信息
126
     // 认筹信息
134
     const raiseInfo = [
127
     const raiseInfo = [
135
-      { head: '认筹人', body: '姓名' },
136
-      { head: '身份证号', body: '412702199709215528' },
137
-      { head: '手机号', body: '17716241245' },
128
+      { head: '认筹人', body: `${raiseDeatil.name || ''}`, },
129
+      { head: '身份证号', body: `${raiseDeatil.idcard || ''}` },
130
+      { head: '手机号', body: `${raiseDeatil.tel || ''}` },
138
     ]
131
     ]
139
 
132
 
140
     // 缴费信息
133
     // 缴费信息
141
     const payInfo = [
134
     const payInfo = [
142
-      { head: '缴费方式', body: '线上缴费/线下缴费' },
135
+      { head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
143
       { head: '实际支付费用', body: '234元' },
136
       { head: '实际支付费用', body: '234元' },
144
       { head: '缴费成功时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
137
       { head: '缴费成功时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
145
     ]
138
     ]
157
     // 其他信息
150
     // 其他信息
158
     const otherInfo = [
151
     const otherInfo = [
159
       { head: '其他信息', body: '供核对数据使用' },
152
       { head: '其他信息', body: '供核对数据使用' },
160
-      { head: '认筹单编号', body: '234567890-09876545678', action: true },
161
-      { head: '缴费单编号', body: '234567890-09876543456', action: true },
162
-      { head: '退费单编号', body: '234567890-09876543423', action: true },
153
+      { head: '认筹单编号', body: `${raiseDeatil.raiseRecordId}`, action: true },
154
+      { head: '缴费单编号', body: '234567890-09876543456', action: true, hide: `${raiseDeatil.payStatus == 'paid' ? false : true}` },
155
+      { head: '退费单编号', body: '234567890-09876543423', action: true, hide: `${raiseDeatil.payStatus == 'refunded' ? false : true}` },
163
     ]
156
     ]
164
     const consultantInfo = {
157
     const consultantInfo = {
165
       name: '哈哈哈1',
158
       name: '哈哈哈1',
171
       <View className="raiseProfilePage">
164
       <View className="raiseProfilePage">
172
         <View className="main">
165
         <View className="main">
173
           {this.renderHead()}
166
           {this.renderHead()}
174
-          <View className="tip">注意:请在一个工作日内,到售楼处或项目现场办理认购手续。逾期未办理视为放弃购买。</View>
175
-          {this.renderCancelReason()}
176
-          {this.renderUnpayNotice()}
167
+          <View className="tip">{raiseDeatil.payDescription || ''}</View>
168
+          {raiseDeatil.status == '0' && this.renderCancelReason()}
169
+          {raiseDeatil.payStatus == 'unpaid' && this.renderUnpayNotice()}
177
           <View>
170
           <View>
178
             <CellBlock dataset={raiseInfo} />
171
             <CellBlock dataset={raiseInfo} />
179
             <ConsultantItem
172
             <ConsultantItem
183
               onClick={this.handleItemClick}>
176
               onClick={this.handleItemClick}>
184
             </ConsultantItem>
177
             </ConsultantItem>
185
             <View className="hr" />
178
             <View className="hr" />
186
-            <CellBlock dataset={payInfo} />
187
-            <View className="hr" />
188
-            <CellBlock dataset={refundInfo} />
189
-            <View className="hr" />
179
+            {raiseDeatil.payStatus == 'paid' &&
180
+              <Block>
181
+                <CellBlock dataset={payInfo} />
182
+                <View className="hr" />
183
+              </Block>}
184
+
185
+            {/* unpaid未缴费paid已缴费refunded已退费 */}
186
+            {raiseDeatil.payStatus == 'refunded' &&
187
+              <Block>
188
+                <CellBlock dataset={refundInfo} />
189
+                <View className="hr" />
190
+              </Block>}
190
             <CellBlock dataset={otherInfo} disable onActionClick={dt => this.copyData(dt.body)} />
191
             <CellBlock dataset={otherInfo} disable onActionClick={dt => this.copyData(dt.body)} />
191
           </View>
192
           </View>
192
           <View></View>
193
           <View></View>

+ 44
- 7
src/onlineSelling/pages/records/index.js 查看文件

3
 import HouseCard from '../../components/HouseCard'
3
 import HouseCard from '../../components/HouseCard'
4
 import RaiseCard from '../../components/RaiseCard'
4
 import RaiseCard from '../../components/RaiseCard'
5
 import { getItemList } from '@/services/item'
5
 import { getItemList } from '@/services/item'
6
-import { queryPreselectionRecord, queryRaiseRecord, querySalesList } from '@/services/project'
6
+import { queryPreselectionRecord, queryRaiseRecord, querySalesList, queryApartmentType } from '@/services/project'
7
 import { connect } from '@tarojs/redux'
7
 import { connect } from '@tarojs/redux'
8
 import ready from '@/utils/ready'
8
 import ready from '@/utils/ready'
9
 import Blank from '../../components/Blank'
9
 import Blank from '../../components/Blank'
37
     saleBatch: '',
37
     saleBatch: '',
38
     salesBatchId: '',
38
     salesBatchId: '',
39
 
39
 
40
+    apartmentList: [],
41
+    apartmentValue: '',
42
+    apartmentId: '',
43
+
40
     lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
44
     lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
41
     lockStatusValue: '',
45
     lockStatusValue: '',
42
     houseLockingStatus: '',
46
     houseLockingStatus: '',
145
       </Block>
149
       </Block>
146
     )
150
     )
147
   }
151
   }
152
+  toRaiseProfile(id) {
153
+    Taro.navigateTo({
154
+      url: `/onlineSelling/pages/raiseProfile/index?raiseRecordId=${id}`
155
+    })
156
+  }
148
   renderRaise() {
157
   renderRaise() {
149
     const { raiseList, noRaiseRecord } = this.state
158
     const { raiseList, noRaiseRecord } = this.state
150
     return (
159
     return (
155
             <ScrollView scrollY>
164
             <ScrollView scrollY>
156
               {
165
               {
157
                 raiseList.map(item => (
166
                 raiseList.map(item => (
158
-                  <View key={item.preselectionRecordId} >
159
-                    <RaiseCard summary={item} />
167
+                  <View key={item.raiseRecordId} >
168
+                    <RaiseCard handleCard={this.toRaiseProfile(item.raiseRecordId)} summary={item} />
160
                   </View>
169
                   </View>
161
                 )
170
                 )
162
                 )
171
                 )
163
               }
172
               }
164
             </ScrollView >
173
             </ScrollView >
165
         }
174
         }
166
-        <Statement />
175
+        <Statement styel="margin-top:80rpx" />
167
 
176
 
168
 
177
 
169
       </Block>
178
       </Block>
184
       saleBatch: salesList[e.detail.value].salesBatchName,
193
       saleBatch: salesList[e.detail.value].salesBatchName,
185
       salesBatchId: salesList[e.detail.value].salesBatchId,
194
       salesBatchId: salesList[e.detail.value].salesBatchId,
186
 
195
 
196
+    }, () => {
197
+      if (this.state.salesBatchId) {
198
+        console.log('hhhhhhhhhhhhhh')
199
+        this.loadAparamentType(this.state.salesBatchId)
200
+      } else {
201
+        console.log('hjjjjjjjjjjjhhhh')
202
+        this.setState({
203
+          apartmentList: [{ apartmentName: '请选择', apartmentId: '' }]
204
+        })
205
+      }
206
+    })
207
+  }
208
+  loadAparamentType(salesBatchId) {
209
+    queryApartmentType({ salesBatchId: salesBatchId }).then(res => {
210
+      res.unshift({ apartmentName: '请选择', apartmentId: '' })
211
+      this.setState({
212
+        apartmentList: res || []
213
+      })
187
     })
214
     })
188
   }
215
   }
189
   handleApartmentChange = e => {
216
   handleApartmentChange = e => {
190
 
217
 
218
+    const { apartmentList } = this.state
219
+
191
     this.setState({
220
     this.setState({
192
-      status: selector[e.detail.value].buildingTypeName
221
+      apartmentValue: apartmentList[e.detail.value].apartmentName,
222
+      apartmentId: apartmentList[e.detail.value].apartmentId,
193
     })
223
     })
224
+
194
   }
225
   }
195
   handleLockStatusChange = e => {
226
   handleLockStatusChange = e => {
196
     const { lockStatus } = this.state
227
     const { lockStatus } = this.state
216
       buildingId: '',
247
       buildingId: '',
217
       saleBatch: '',
248
       saleBatch: '',
218
       salesBatchId: '',
249
       salesBatchId: '',
250
+      apartmentValue: '',
251
+      apartmentId: '',
219
       lockStatusValue: '',
252
       lockStatusValue: '',
220
       houseLockingStatus: '',
253
       houseLockingStatus: '',
221
       lockCustomerValue: '',
254
       lockCustomerValue: '',
235
       screenVisible: false
268
       screenVisible: false
236
     })
269
     })
237
     const { userInfo: { person: { personId } } } = this.props
270
     const { userInfo: { person: { personId } } } = this.props
238
-    const { buildingId, salesBatchId, houseLockingStatus, customerLocked } = this.state
271
+    const { buildingId, salesBatchId, houseLockingStatus, apartmentId, customerLocked } = this.state
239
 
272
 
240
     if (this.state.current == '0') {
273
     if (this.state.current == '0') {
241
 
274
 
245
         pageSize: 999,
278
         pageSize: 999,
246
         buildingId,
279
         buildingId,
247
         salesBatchId,
280
         salesBatchId,
281
+        apartmentId,
248
         houseLockingStatus,
282
         houseLockingStatus,
249
         customerLocked
283
         customerLocked
250
       }
284
       }
267
   }
301
   }
268
 
302
 
269
   renderPreselectScreen() {
303
   renderPreselectScreen() {
270
-    const { current, buildingValue, buildingList, saleBatch, salesList, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
304
+    const { current, buildingValue, buildingList, saleBatch, salesList, apartmentList, apartmentValue, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
271
 
305
 
272
     const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
306
     const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
273
 
307
 
276
       <View className="base-con">
310
       <View className="base-con">
277
         <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
311
         <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
278
         <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
312
         <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
313
+        {current == '0' && <PickerComponent title="选择户型" selector={apartmentList} keyValue={"apartmentName"} currentValue={apartmentValue || ''} handleChange={this.handleApartmentChange} />}
279
         <PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
314
         <PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
280
         {current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
315
         {current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
281
 
316
 
307
       buildingId: '',
342
       buildingId: '',
308
       saleBatch: '',
343
       saleBatch: '',
309
       salesBatchId: '',
344
       salesBatchId: '',
345
+      apartmentValue: '',
346
+      apartmentId: '',
310
       lockStatusValue: '',
347
       lockStatusValue: '',
311
       houseLockingStatus: '',
348
       houseLockingStatus: '',
312
       lockCustomerValue: '',
349
       lockCustomerValue: '',

+ 18
- 5
src/services/project.js 查看文件

9
   API_CANCEL_PRESELECTION,
9
   API_CANCEL_PRESELECTION,
10
   API_APARTMENT_TYPE,
10
   API_APARTMENT_TYPE,
11
   API_NOTICE_INFO,
11
   API_NOTICE_INFO,
12
-  API_SALES_BATCH
12
+  API_SALES_BATCH,
13
+  API_RATSE_DETAIL,
14
+  API_RATSE_ORDER
15
+
13
 } from '@/constants/api'
16
 } from '@/constants/api'
14
 
17
 
15
 
18
 
23
  * 获取房源分享信息
26
  * 获取房源分享信息
24
  * @param {*} id
27
  * @param {*} id
25
  */
28
  */
26
-export const querySalesInfo = id => fetch({ url: `${API_SALES_BATCH}/${id}`})
29
+export const querySalesInfo = id => fetch({ url: `${API_SALES_BATCH}/${id}` })
30
+/**
31
+ * 获取认筹单详情
32
+ * @param {*} id
33
+ */
34
+export const queryRaiseDetail = id => fetch({ url: `${API_RATSE_DETAIL}/${id}` })
27
 /**
35
 /**
28
  * 获取房源列表滚动提示
36
  * 获取房源列表滚动提示
29
  * @param {*} id
37
  * @param {*} id
30
  */
38
  */
31
-export const queryNoticeInfo = id => fetch({ url: `${API_NOTICE_INFO}/${id}`})
39
+export const queryNoticeInfo = id => fetch({ url: `${API_NOTICE_INFO}/${id}` })
32
 
40
 
33
 /**
41
 /**
34
  * 预选房源
42
  * 预选房源
39
  * 取消预选房源
47
  * 取消预选房源
40
  * @param {*} payload
48
  * @param {*} payload
41
  */
49
  */
42
-export const cancelPreselection = payload => fetch({ url: `${API_CANCEL_PRESELECTION}?${'houseId='+payload.houseId}&${'personId='+payload.personId}`, method: 'DELETE' })
50
+export const cancelPreselection = payload => fetch({ url: `${API_CANCEL_PRESELECTION}?${'houseId=' + payload.houseId}&${'personId=' + payload.personId}`, method: 'DELETE' })
43
 /**
51
 /**
44
  * 获取房源详情
52
  * 获取房源详情
45
  * @param {*} payload
53
  * @param {*} payload
65
  * 获取某销售批次下所有房源户型
73
  * 获取某销售批次下所有房源户型
66
  * @param {*} payload
74
  * @param {*} payload
67
  */
75
  */
68
-export const queryApartmentType= payload => fetch({ url: API_APARTMENT_TYPE, payload })
76
+export const queryApartmentType = payload => fetch({ url: API_APARTMENT_TYPE, payload })
77
+/**
78
+ *认筹下单接口
79
+ * @param {*} payload
80
+ */
81
+export const raiseOrder = payload => fetch({ url: API_RATSE_ORDER, payload, method: 'POST' })
69
 
82
 
70
 
83
 
71
 
84