|
@@ -8,12 +8,13 @@ import ConsultantItem from '../../components/ConsultantItem/index'
|
8
|
8
|
import NamedIcon from '../../components/NamedIcon'
|
9
|
9
|
import RaiseCard from '../../components/RaiseCard'
|
10
|
10
|
import { queryRaiseDetail } from '@/services/project'
|
11
|
|
-
|
12
|
|
-
|
|
11
|
+import { connect } from '@tarojs/redux'
|
|
12
|
+import * as noticeType from '@/constants/common.js'
|
13
|
13
|
import './index.scss'
|
14
|
|
-import consultant from 'dist/components/consultant'
|
15
|
14
|
|
16
|
|
-export default class extends Component {
|
|
15
|
+@connect(({ user }) => ({ user }))
|
|
16
|
+
|
|
17
|
+export default class Raise extends Component {
|
17
|
18
|
config = {
|
18
|
19
|
navigationBarTitleText: '认筹单',
|
19
|
20
|
}
|
|
@@ -22,7 +23,9 @@ export default class extends Component {
|
22
|
23
|
buildingId: '',
|
23
|
24
|
raiseDeatil: {},
|
24
|
25
|
houseList: [],
|
25
|
|
- raiseOrder: {}
|
|
26
|
+ raiseOrder: {},
|
|
27
|
+ orderDetail: {},
|
|
28
|
+ refundOrder: {},
|
26
|
29
|
}
|
27
|
30
|
|
28
|
31
|
componentWillMount() {
|
|
@@ -33,6 +36,8 @@ export default class extends Component {
|
33
|
36
|
raiseDeatil: res.taRaiseRecord || {},
|
34
|
37
|
houseList: res.houseList || [],
|
35
|
38
|
raiseOrder: res.taRaise || {},
|
|
39
|
+ orderDetail: res.taOrder || {},
|
|
40
|
+ refundOrder: res.refundOrder || {},
|
36
|
41
|
})
|
37
|
42
|
})
|
38
|
43
|
}
|
|
@@ -77,6 +82,7 @@ export default class extends Component {
|
77
|
82
|
|
78
|
83
|
// 取消认购原因
|
79
|
84
|
renderCancelReason() {
|
|
85
|
+ const { raiseDeatil } = this.state;
|
80
|
86
|
return (
|
81
|
87
|
<Block>
|
82
|
88
|
<View className="cancelReason flexSpace">
|
|
@@ -85,8 +91,7 @@ export default class extends Component {
|
85
|
91
|
</View>
|
86
|
92
|
<View className="flexSpace-item" style="margin-left: 20px">
|
87
|
93
|
<View>认筹单作废原因:</View>
|
88
|
|
- <View className="gray">认筹单作废原因作废原因原因认筹单作废原因作废原因原因
|
89
|
|
- 认筹单作废原因作废原因原因认筹单作废原因作废原因原因</View>
|
|
94
|
+ <View className="gray">{raiseDeatil.invalidReason}</View>
|
90
|
95
|
</View>
|
91
|
96
|
</View>
|
92
|
97
|
<View className="hr"></View>
|
|
@@ -112,53 +117,93 @@ export default class extends Component {
|
112
|
117
|
</View>
|
113
|
118
|
<View className="flexSpace-fixed">
|
114
|
119
|
<Text className="a-line">认筹金额</Text>
|
115
|
|
- <Text className="a-line price">{raiseOrder.raisePrice}元</Text>
|
|
120
|
+ <Text className="a-line price">{this.regFenToYuan(raiseOrder.raisePrice)}元</Text>
|
116
|
121
|
</View>
|
117
|
122
|
</View>
|
118
|
123
|
<View className="hr"></View>
|
119
|
124
|
</Block>
|
120
|
125
|
)
|
121
|
126
|
}
|
122
|
|
-
|
|
127
|
+ handleChatClick(item) {
|
|
128
|
+
|
|
129
|
+ const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
|
|
130
|
+ const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
|
|
131
|
+ wx.requestSubscribeMessage({
|
|
132
|
+ tmplIds: [tplId],
|
|
133
|
+ success(res) {
|
|
134
|
+ },
|
|
135
|
+ fail(res) {
|
|
136
|
+
|
|
137
|
+ },
|
|
138
|
+ complete() {
|
|
139
|
+ Taro.navigateTo({
|
|
140
|
+ url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.consultantPersonId}&receiverName=${encodeURIComponent(item.name || item.nickname || item.userName)}`
|
|
141
|
+ })
|
|
142
|
+ }
|
|
143
|
+ })
|
|
144
|
+ }
|
|
145
|
+ toDecimal2 = (x) => {
|
|
146
|
+ var f = parseFloat(x);
|
|
147
|
+ if (isNaN(f)) {
|
|
148
|
+ return false;
|
|
149
|
+ }
|
|
150
|
+ var f = Math.round(x * 100) / 100;
|
|
151
|
+ var s = f.toString();
|
|
152
|
+ var rs = s.indexOf('.');
|
|
153
|
+ if (rs < 0) {
|
|
154
|
+ rs = s.length;
|
|
155
|
+ s += '.';
|
|
156
|
+ }
|
|
157
|
+ while (s.length <= rs + 2) {
|
|
158
|
+ s += '0';
|
|
159
|
+ }
|
|
160
|
+ return s;
|
|
161
|
+ }
|
|
162
|
+ regFenToYuan = (fen) => {
|
|
163
|
+ var num = fen;
|
|
164
|
+ num = fen * 0.01;
|
|
165
|
+ num += '';
|
|
166
|
+ var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
|
|
167
|
+ num = num.replace(reg, '$1');
|
|
168
|
+ num = this.toDecimal2(num)
|
|
169
|
+ return num
|
|
170
|
+ };
|
123
|
171
|
render() {
|
124
|
|
- const { buildingId, raiseDeatil } = this.state;
|
|
172
|
+ const { buildingId, raiseDeatil, orderDetail, refundOrder } = this.state;
|
|
173
|
+
|
125
|
174
|
|
126
|
175
|
// 认筹信息
|
127
|
176
|
const raiseInfo = [
|
128
|
|
- { head: '认筹人', body: `${raiseDeatil.name || ''}`, },
|
129
|
|
- { head: '身份证号', body: `${raiseDeatil.idcard || ''}` },
|
130
|
|
- { head: '手机号', body: `${raiseDeatil.tel || ''}` },
|
|
177
|
+ { head: '认筹人', body: raiseDeatil.name || '', },
|
|
178
|
+ { head: '身份证号', body: raiseDeatil.idcard || '' },
|
|
179
|
+ { head: '手机号', body: raiseDeatil.tel || '' },
|
131
|
180
|
]
|
132
|
181
|
|
133
|
182
|
// 缴费信息
|
134
|
183
|
const payInfo = [
|
135
|
184
|
{ head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
|
136
|
|
- { head: '实际支付费用', body: '234元' },
|
137
|
|
- { head: '缴费成功时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
|
|
185
|
+ { head: '实际支付费用', body: this.regFenToYuan(orderDetail.totalFee) },
|
|
186
|
+ { head: '缴费成功时间', body: dayjs(orderDetail.payTime).format('YYYY/MM/DD HH:mm:ss') },
|
138
|
187
|
]
|
139
|
188
|
|
140
|
189
|
// 退费信息
|
141
|
190
|
const refundInfo = [
|
142
|
|
- { head: '退费状态', body: '退费中/退费完成' },
|
143
|
|
- { head: '退费结果', body: '成功/失败' },
|
144
|
|
- { head: '退费发起时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
|
145
|
|
- { head: '实退费用', body: '234元' },
|
146
|
|
- { head: '退费到账时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
|
147
|
|
- { head: '退费原因', desc: '无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因' },
|
|
191
|
+ { head: '退费状态', body: refundOrder.payStatus == 'refunded' ? '退费完成' : '退费中' },
|
|
192
|
+ { head: '退费结果', body: refundOrder.payStatus == 'refunded' ? '成功' : '失败' },
|
|
193
|
+ { head: '退费发起时间', body: dayjs(refundOrder.createDate).format('YYYY/MM/DD HH:mm:ss') },
|
|
194
|
+ { head: '实退费用', body: this.regFenToYuan(refundOrder.totalFee) },
|
|
195
|
+ { head: '退费到账时间', body: dayjs(refundOrder.payTime).format('YYYY/MM/DD HH:mm:ss') },
|
|
196
|
+ { head: '退费原因', desc: raiseDeatil.refundReason },
|
148
|
197
|
]
|
149
|
198
|
|
150
|
199
|
// 其他信息
|
151
|
200
|
const otherInfo = [
|
152
|
201
|
{ head: '其他信息', body: '供核对数据使用' },
|
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}` },
|
|
202
|
+ { head: '认筹单编号', body: raiseDeatil.raiseRecordId || '', action: true },
|
|
203
|
+ { head: '缴费单编号', body: orderDetail.tradeNo || '', action: true, hide: raiseDeatil.payStatus != 'paid' },
|
|
204
|
+ { head: '退费单编号', body: refundOrder.refundNo || '', action: true, hide: raiseDeatil.payStatus != 'refunded' },
|
156
|
205
|
]
|
157
|
|
- const consultantInfo = {
|
158
|
|
- name: '哈哈哈1',
|
159
|
|
- phone: '138541369741',
|
160
|
|
- avatar: 'http://img5.imgtn.bdimg.com/it/u=3299138037,391931528&fm=26&gp=0.jpg'
|
161
|
|
- }
|
|
206
|
+
|
162
|
207
|
|
163
|
208
|
return (
|
164
|
209
|
<View className="raiseProfilePage">
|
|
@@ -169,12 +214,12 @@ export default class extends Component {
|
169
|
214
|
{raiseDeatil.payStatus == 'unpaid' && this.renderUnpayNotice()}
|
170
|
215
|
<View>
|
171
|
216
|
<CellBlock dataset={raiseInfo} />
|
172
|
|
- <ConsultantItem
|
173
|
|
- data={consultantInfo}
|
|
217
|
+ {raiseDeatil.consultantInfo && <ConsultantItem
|
|
218
|
+ data={raiseDeatil.consultantInfo}
|
174
|
219
|
type="raiseProfile"
|
175
|
220
|
style="height:140rpx;margin-bottom:0rpx;width:690rpx"
|
176
|
|
- onClick={this.handleItemClick}>
|
177
|
|
- </ConsultantItem>
|
|
221
|
+ contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
|
|
222
|
+ />}
|
178
|
223
|
<View className="hr" />
|
179
|
224
|
{raiseDeatil.payStatus == 'paid' &&
|
180
|
225
|
<Block>
|