Browse Source

静态页面

1002884655 3 years ago
parent
commit
f5ae350ff8

+ 16
- 5
src/subpackages/pages/marketing/components/ResidentListItem/index.jsx View File

1
-
1
+import { useState, useEffect } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { Image, Block } from '@tarojs/components'
3
 import { Image, Block } from '@tarojs/components'
4
 import { formatDate } from '@/utils/chatDate'
4
 import { formatDate } from '@/utils/chatDate'
7
 import './index.scss'
7
 import './index.scss'
8
 
8
 
9
 export default function ResidentListItem (props) {
9
 export default function ResidentListItem (props) {
10
-  const { data = {}, change = () => { } } = props
10
+  const { data = {} } = props
11
+
12
+  const [Status, setStatus] = useState(null)
13
+
14
+  useEffect(() => {
15
+    setStatus(data.status)
16
+  }, [])
17
+
11
   const ToUnVisable = () => {
18
   const ToUnVisable = () => {
12
     Taro.showModal({
19
     Taro.showModal({
13
       title: '提示',
20
       title: '提示',
16
         if (res.confirm) {
23
         if (res.confirm) {
17
           fetch({ url: API_INVALID, method: 'put', payload: { type: data.type, id: data.id } }).then(() => {
24
           fetch({ url: API_INVALID, method: 'put', payload: { type: data.type, id: data.id } }).then(() => {
18
             Taro.showToast({ title: '审核成功', icon: 'none', duration: 2000 })
25
             Taro.showToast({ title: '审核成功', icon: 'none', duration: 2000 })
19
-            change()
26
+            setStatus(3)
20
           })
27
           })
21
         }
28
         }
22
       }
29
       }
34
           <text className='Status'>已报备</text>
41
           <text className='Status'>已报备</text>
35
         } */}
42
         } */}
36
         {
43
         {
37
-          data.customerStatus - 0 === 1 &&
44
+          data.customerStatus - 0 === 1 && Status - 0 !== 3 &&
38
           <text className='Status' onClick={() => { Taro.navigateTo({ url: `/subpackages/pages/marketing/sureVisit/index?id=${data.id}` }) }}>到访确认</text>
45
           <text className='Status' onClick={() => { Taro.navigateTo({ url: `/subpackages/pages/marketing/sureVisit/index?id=${data.id}` }) }}>到访确认</text>
39
         }
46
         }
40
       </view>
47
       </view>
98
           <text className='active' onClick={() => { Taro.navigateTo({ url: `/subpackages/pages/marketing/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}&channelId=${data.channelId}` }) }}>更新交易</text>
105
           <text className='active' onClick={() => { Taro.navigateTo({ url: `/subpackages/pages/marketing/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}&channelId=${data.channelId}` }) }}>更新交易</text>
99
         }
106
         }
100
         {
107
         {
101
-          data.type === 'report' && data.channelStatus - 0 === 1 &&
108
+          data.type === 'report' && data.channelStatus - 0 === 1 && Status - 0 !== 3 &&
102
           <text onClick={ToUnVisable}>无效</text>
109
           <text onClick={ToUnVisable}>无效</text>
103
         }
110
         }
111
+        {
112
+          data.type === 'report' && Status - 0 === 3 &&
113
+          <text>无效</text>
114
+        }
104
       </view>
115
       </view>
105
     </view>
116
     </view>
106
   )
117
   )