浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
f5ae350ff8
共有 1 个文件被更改,包括 16 次插入5 次删除
  1. 16
    5
      src/subpackages/pages/marketing/components/ResidentListItem/index.jsx

+ 16
- 5
src/subpackages/pages/marketing/components/ResidentListItem/index.jsx 查看文件

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