|
@@ -1,11 +1,19 @@
|
1
|
|
-import React, { useState, useEffect } from 'react'
|
|
1
|
+
|
2
|
2
|
import Taro from '@tarojs/taro'
|
3
|
|
-import { Image } from '@tarojs/components'
|
|
3
|
+import { Image, Block } from '@tarojs/components'
|
4
|
4
|
import { formatDate } from '@/utils/chatDate'
|
|
5
|
+import { fetch } from '@/utils/request'
|
|
6
|
+import { API_INVALID } from '@/constants/api'
|
5
|
7
|
import './index.scss'
|
6
|
8
|
|
7
|
9
|
export default function ResidentListItem (props) {
|
8
|
|
- const { data = {} } = props
|
|
10
|
+ const { data = {}, change = () => { } } = props
|
|
11
|
+ const ToUnVisable = () => {
|
|
12
|
+ fetch({ url: API_INVALID, method: 'put', payload: { type: data.type, id: data.id } }).then(() => {
|
|
13
|
+ Taro.showToast({ title: '审核成功', icon: 'none', duration: 2000 })
|
|
14
|
+ change()
|
|
15
|
+ })
|
|
16
|
+ }
|
9
|
17
|
return (
|
10
|
18
|
<view className='components ResidentListItem'>
|
11
|
19
|
<view className='flex-h'>
|
|
@@ -13,10 +21,10 @@ export default function ResidentListItem (props) {
|
13
|
21
|
<view className='flex-item'>
|
14
|
22
|
<text>{data.name}</text>
|
15
|
23
|
</view>
|
16
|
|
- {
|
|
24
|
+ {/* {
|
17
|
25
|
data.customerStatus - 0 === 1 &&
|
18
|
26
|
<text className='Status'>已报备</text>
|
19
|
|
- }
|
|
27
|
+ } */}
|
20
|
28
|
{
|
21
|
29
|
data.type === 'report' && (data.channelStatus - 0) === 1 &&
|
22
|
30
|
<text className='Status' onClick={() => { Taro.navigateTo({ url: `/pages/mine/sureVisit/index?id=${data.id}` }) }}>到访确认</text>
|
|
@@ -29,23 +37,38 @@ export default function ResidentListItem (props) {
|
29
|
37
|
</view>
|
30
|
38
|
{
|
31
|
39
|
data.customerStatus - 0 === 1 &&
|
32
|
|
- <text className='Type'>报备</text>
|
|
40
|
+ <Block>
|
|
41
|
+ <Image mode='heightFix' src={require('@/assets/mine-icon29.png')}></Image>
|
|
42
|
+ <text className='Type'>报备</text>
|
|
43
|
+ </Block>
|
33
|
44
|
}
|
34
|
45
|
{
|
35
|
46
|
data.customerStatus - 0 === 2 &&
|
36
|
|
- <text className='Type'>到访</text>
|
|
47
|
+ <Block>
|
|
48
|
+ <Image mode='heightFix' src={require('@/assets/mine-icon30.png')}></Image>
|
|
49
|
+ <text className='Type'>到访</text>
|
|
50
|
+ </Block>
|
37
|
51
|
}
|
38
|
52
|
{
|
39
|
53
|
data.customerStatus - 0 === 3 &&
|
40
|
|
- <text className='Type'>认筹</text>
|
|
54
|
+ <Block>
|
|
55
|
+ <Image mode='heightFix' src={require('@/assets/mine-icon33.png')}></Image>
|
|
56
|
+ <text className='Type'>认筹</text>
|
|
57
|
+ </Block>
|
41
|
58
|
}
|
42
|
59
|
{
|
43
|
60
|
data.customerStatus - 0 === 4 &&
|
44
|
|
- <text className='Type'>签约</text>
|
|
61
|
+ <Block>
|
|
62
|
+ <Image mode='heightFix' src={require('@/assets/mine-icon32.png')}></Image>
|
|
63
|
+ <text className='Type'>签约</text>
|
|
64
|
+ </Block>
|
45
|
65
|
}
|
46
|
66
|
{
|
47
|
67
|
data.customerStatus - 0 === 5 &&
|
48
|
|
- <text className='Type'>结佣</text>
|
|
68
|
+ <Block>
|
|
69
|
+ <Image mode='heightFix' src={require('@/assets/mine-icon31.png')}></Image>
|
|
70
|
+ <text className='Type'>结佣</text>
|
|
71
|
+ </Block>
|
49
|
72
|
}
|
50
|
73
|
{/* <Image mode='heightFix' src={require('@/assets/mine-icon27.png')}></Image> */}
|
51
|
74
|
</view>
|
|
@@ -63,12 +86,12 @@ export default function ResidentListItem (props) {
|
63
|
86
|
</view>
|
64
|
87
|
<view className='Opt'>
|
65
|
88
|
{
|
66
|
|
- !(data.type === 'report' && data.channelStatus === 3) &&
|
|
89
|
+ !(data.type === 'report' && data.channelStatus - 0 === 3) &&
|
67
|
90
|
<text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/mine/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}&channelId=${data.channelId}` }) }}>更新交易</text>
|
68
|
91
|
}
|
69
|
92
|
{
|
70
|
|
- data.type === 'report' && data.channelStatus === 3 &&
|
71
|
|
- <text>无效</text>
|
|
93
|
+ data.type === 'report' && data.channelStatus - 0 === 1 &&
|
|
94
|
+ <text onClick={ToUnVisable}>无效</text>
|
72
|
95
|
}
|
73
|
96
|
</view>
|
74
|
97
|
</view>
|