浏览代码

Merge branch 'master' of http://git.ycjcjy.com/xiangsong/miniapp

张延森 4 年前
父节点
当前提交
7e5a51091a

+ 5
- 2
src/pages/WoDe/YeZhuBaoXiu/components/Item/index.jsx 查看文件

1
 import React, { useState } from 'react'
1
 import React, { useState } from 'react'
2
+import { PERSON_TYPE } from '@/utils/constants'
3
+import { useModel } from '@/store'
2
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
3
 import toolclass from '@/utils/toolclass.js'
5
 import toolclass from '@/utils/toolclass.js'
4
 import '@/assets/css/reset.less'
6
 import '@/assets/css/reset.less'
7
 
9
 
8
 export default function Item (props) {
10
 export default function Item (props) {
9
 
11
 
12
+  const { user } = useModel('user')
10
   const { Data } = props
13
   const { Data } = props
11
 
14
 
12
   // 随便一条
15
   // 随便一条
30
         <text className='Time'>{toolclass.FormatDate(Data.createDate)}</text>
33
         <text className='Time'>{toolclass.FormatDate(Data.createDate)}</text>
31
       </view>
34
       </view>
32
       <view className='Name flex-h'>
35
       <view className='Name flex-h'>
33
-        <view style={{flex: 1}}><text className='flex-item'>{Data.ticketTitle}</text></view>
36
+        <view className='flex-item'><text>{Data.ticketTitle}</text></view>
34
         {
37
         {
35
-          Data.status === '3' && <view className="Name-action" onClick={props.onAction}>完成</view>    
38
+          Data.status - 0 === 3 && user && user.personType === PERSON_TYPE.LIFE_CONSULTANT && <view className="Name-action" onClick={props.onAction}>完成</view>    
36
         }
39
         }
37
       </view>
40
       </view>
38
       <view className='Detail flex-h'>
41
       <view className='Detail flex-h'>

+ 2
- 2
src/pages/WoDe/index.jsx 查看文件

17
     { icon: 'iconrenzheng1', name: '业主认证', id: 1, router: '/pages/WoDe/WoDeRenZheng/index' },
17
     { icon: 'iconrenzheng1', name: '业主认证', id: 1, router: '/pages/WoDe/WoDeRenZheng/index' },
18
     { icon: 'iconjifenguize', name: '积分明细', id: 2, router: '/pages/FuLi/JiFenMingXi/index' },
18
     { icon: 'iconjifenguize', name: '积分明细', id: 2, router: '/pages/FuLi/JiFenMingXi/index' },
19
     { icon: 'iconjiaofei', name: '物业缴费', id: 3, router: '/pages/WoDe/WoDeJiaoFei/index' },
19
     { icon: 'iconjiaofei', name: '物业缴费', id: 3, router: '/pages/WoDe/WoDeJiaoFei/index' },
20
-    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/WoDeGongDan/index' },
20
+    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/WoDeGongDan/index' },
21
     // { icon: 'iconfuwu1', name: '业主工单', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index', personTypes: [PERSON_TYPE.LIFE_CONSULTANT] },
21
     // { icon: 'iconfuwu1', name: '业主工单', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index', personTypes: [PERSON_TYPE.LIFE_CONSULTANT] },
22
-    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index' },
22
+    { icon: 'iconfuwu1', name: '业报修', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index' },
23
   ],
23
   ],
24
   [
24
   [
25
     { icon: 'iconerweima', name: '推荐二维码', id: 5, router: '/pages/WoDe/TuiJianErWeiMa/index' },
25
     { icon: 'iconerweima', name: '推荐二维码', id: 5, router: '/pages/WoDe/TuiJianErWeiMa/index' },

+ 65
- 2
src/pages/WuYe/BaoXiuDetail/index.jsx 查看文件

21
   const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
21
   const [ShowPingJiaPopup, setShowPingJiaPopup] = useState(false)
22
   const [StarIndex, setStarIndex] = useState(0)
22
   const [StarIndex, setStarIndex] = useState(0)
23
   const [Comment, setComment] = useState(null)
23
   const [Comment, setComment] = useState(null)
24
+  const [ReplyContent, setReplyContent] = useState(null)
24
   const [DataLock, setDataLock] = useState(false)
25
   const [DataLock, setDataLock] = useState(false)
26
+  const [ShowReplyPopup, setShowReplyPopup] = useState(false)
27
+  const [CurrentReplyId, setCurrentReplyId] = useState(null)
25
 
28
 
26
   Taro.useShareAppMessage(() => {
29
   Taro.useShareAppMessage(() => {
27
     return getShareObject({
30
     return getShareObject({
35
     Init()
38
     Init()
36
   }, [])
39
   }, [])
37
 
40
 
41
+  useEffect(() => {
42
+    if (CurrentReplyId !== null) {
43
+      setReplyContent(null)
44
+      setShowReplyPopup(true)
45
+    }
46
+  }, [CurrentReplyId])
47
+
38
   const Init = () => {
48
   const Init = () => {
39
     request({ ...apis.getGongDanDetail, args: { orgId: user.orgId }, params: { ticketId: CurrnetBaoXiuId } }).then((res) => { // 获取工单详情
49
     request({ ...apis.getGongDanDetail, args: { orgId: user.orgId }, params: { ticketId: CurrnetBaoXiuId } }).then((res) => { // 获取工单详情
40
       setDetailInfo(res)
50
       setDetailInfo(res)
50
     }
60
     }
51
   }
61
   }
52
 
62
 
63
+  const ReplyChange = (e) => {
64
+    setReplyContent(e.detail.value)
65
+  }
66
+
53
   const CommentChange = (e) => {
67
   const CommentChange = (e) => {
54
     setComment(e.detail.value)
68
     setComment(e.detail.value)
55
   }
69
   }
56
 
70
 
71
+  const ToReply = () => {
72
+    if (DataLock) return
73
+    setDataLock(true)
74
+    request({ ...apis.ReplyTicket, args: { orgId: user.orgId }, data: { ticketId: CurrnetBaoXiuId, content: ReplyContent, ticketRecordCommentId: CurrentReplyId } }).then((res) => { // 获取工单详情
75
+      Taro.showToast({ title: '回复成功', icon: 'none' })
76
+      Init()
77
+      setDataLock(false)
78
+      setShowReplyPopup(false)
79
+    }).catch((res) => {
80
+      Taro.showToast({ title: res, icon: 'none' })
81
+      setDataLock(false)
82
+    })
83
+  }
84
+
57
   const ToPingJia = () => {
85
   const ToPingJia = () => {
58
     if (DataLock) return
86
     if (DataLock) return
59
     setDataLock(true)
87
     setDataLock(true)
68
     })
96
     })
69
   }
97
   }
70
 
98
 
99
+  const StepClick = (item) => {
100
+    return () => {
101
+      if (DetailInfo.status - 0 < 4) {
102
+        setCurrentReplyId(item.id)
103
+      }
104
+    }
105
+  }
106
+
71
   return (
107
   return (
72
     <Page>
108
     <Page>
73
       <view className='BaoXiuDetail'>
109
       <view className='BaoXiuDetail'>
100
                 {
136
                 {
101
                   DetailInfo !== null && DetailInfo.ticketRecordList !== null &&
137
                   DetailInfo !== null && DetailInfo.ticketRecordList !== null &&
102
                   DetailInfo.ticketRecordList.map((item, index) => (
138
                   DetailInfo.ticketRecordList.map((item, index) => (
103
-                    <view className='StepList' key={`StepList-${index}`}>
139
+                    <view className='StepList' key={`StepList-${index}`} onClick={StepClick(item)}>
104
                       <view className='Title flex-h'>
140
                       <view className='Title flex-h'>
105
                         <text className='flex-item Red'>{item.ticketStatusName}</text>
141
                         <text className='flex-item Red'>{item.ticketStatusName}</text>
106
                         <text>{toolclass.FormatDate(item.createDate)}</text>
142
                         <text>{toolclass.FormatDate(item.createDate)}</text>
107
                       </view>
143
                       </view>
108
                       <view className='Text'>{item.content}</view>
144
                       <view className='Text'>{item.content}</view>
145
+                      {
146
+                        item.ticketRecordCommentList.map((subItem, subIndex) => (
147
+                          <view className='ReplyList' key={`Reply-${subIndex}`}>
148
+                            <view className='flex-h'>
149
+                              <view>
150
+                                <text>{subItem.userName}</text>
151
+                              </view>
152
+                              <view className='flex-item'>
153
+                                <text>回复:</text>
154
+                              </view>
155
+                              <view>
156
+                                <text>{toolclass.FormatDate(subItem.createDate)}</text>
157
+                              </view>
158
+                            </view>
159
+                            <view className='ReplyContent'>
160
+                              <text>{subItem.content}</text>
161
+                            </view>
162
+                          </view>
163
+                        ))
164
+                      }
109
                       {/* <view className='Text'>您的报修正在分配物业处理人员,若长时间无人处理,请联系物业。<text className='Blue'>物业电话薄</text><text className='Blue iconfont iconjiantouright'></text></view> */}
165
                       {/* <view className='Text'>您的报修正在分配物业处理人员,若长时间无人处理,请联系物业。<text className='Blue'>物业电话薄</text><text className='Blue iconfont iconjiantouright'></text></view> */}
110
                       {/* <view className='ImgList'>
166
                       {/* <view className='ImgList'>
111
                       <view></view>
167
                       <view></view>
133
           {/* 更多操作 */}
189
           {/* 更多操作 */}
134
           <view className='BottomBtn active'>
190
           <view className='BottomBtn active'>
135
             {
191
             {
136
-              DetailInfo !== null && DetailInfo.status - 0 === 4 &&
192
+              DetailInfo !== null && DetailInfo.status - 0 === 4 && user && user.personType !== PERSON_TYPE.LIFE_CONSULTANT &&
137
               <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
193
               <text onClick={() => { setShowPingJiaPopup(true) }}>评价</text>
138
             }
194
             }
139
           </view>
195
           </view>
144
           </view>
200
           </view>
145
         </view>
201
         </view>
146
 
202
 
203
+        <SlidePopup Close={() => { setShowReplyPopup(false) }} Show={ShowReplyPopup}>
204
+          <view className='ReplyPopup'>
205
+            <Textarea placeholder='请输入您的回复' onInput={ReplyChange} value={ReplyContent}></Textarea>
206
+            <text className='Btn' onClick={ToReply}>回复</text>
207
+          </view>
208
+        </SlidePopup>
209
+
147
         <SlidePopup Close={() => { setShowPingJiaPopup(false) }} Show={ShowPingJiaPopup}>
210
         <SlidePopup Close={() => { setShowPingJiaPopup(false) }} Show={ShowPingJiaPopup}>
148
           <view className='PinJiaPopup'>
211
           <view className='PinJiaPopup'>
149
             <text className='Title'>请对此次服务进行评分</text>
212
             <text className='Title'>请对此次服务进行评分</text>

+ 42
- 1
src/pages/WuYe/BaoXiuDetail/index.less 查看文件

159
               }
159
               }
160
             }
160
             }
161
 
161
 
162
+            >.ReplyList {
163
+              margin-top: 20px;
164
+
165
+              >.flex-h {
166
+                align-items: center;
167
+
168
+                >view {
169
+                  margin-left: 10px;
170
+                  &:first-child {
171
+                    margin-left: 0;
172
+                    >text {
173
+                      color: #14DC05;
174
+                    }
175
+                  }
176
+
177
+                  >text {
178
+                    font-size: 24px;
179
+                    color: #666;
180
+                    line-height: 40px;
181
+                  }
182
+                }
183
+              }
184
+
185
+              >.ReplyContent {
186
+                >text {
187
+                  font-size: 24px;
188
+                  color: #333;
189
+                  line-height: 40px;
190
+                }
191
+              }
192
+            }
193
+
162
             >.ImgList {
194
             >.ImgList {
163
               font-size: 0;
195
               font-size: 0;
164
 
196
 
249
       }
281
       }
250
     }
282
     }
251
   }
283
   }
252
-  .PinJiaPopup {
284
+
285
+  .PinJiaPopup,
286
+  .ReplyPopup {
253
     padding: 0 30px;
287
     padding: 0 30px;
254
     position: relative;
288
     position: relative;
255
     overflow: hidden;
289
     overflow: hidden;
290
+
256
     >.Title {
291
     >.Title {
257
       display: block;
292
       display: block;
258
       font-size: 26px;
293
       font-size: 26px;
259
       color: #666;
294
       color: #666;
260
       line-height: 40px;
295
       line-height: 40px;
261
     }
296
     }
297
+
262
     textarea {
298
     textarea {
263
       font-size: 26px;
299
       font-size: 26px;
264
       line-height: 40px;
300
       line-height: 40px;
268
       border: 2px solid rgba(0, 0, 0, 0.08);
304
       border: 2px solid rgba(0, 0, 0, 0.08);
269
       margin-top: 60px;
305
       margin-top: 60px;
270
     }
306
     }
307
+
271
     >.StarLine {
308
     >.StarLine {
272
       font-size: 0;
309
       font-size: 0;
273
       white-space: nowrap;
310
       white-space: nowrap;
274
       text-align: center;
311
       text-align: center;
275
       margin-top: 20px;
312
       margin-top: 20px;
313
+
276
       text {
314
       text {
277
         display: inline-block;
315
         display: inline-block;
278
         vertical-align: middle;
316
         vertical-align: middle;
279
         font-size: 40px;
317
         font-size: 40px;
280
         color: #666;
318
         color: #666;
281
         margin-left: 20px;
319
         margin-left: 20px;
320
+
282
         &:first-child {
321
         &:first-child {
283
           margin-left: 0;
322
           margin-left: 0;
284
         }
323
         }
324
+
285
         &.active {
325
         &.active {
286
           color: #fcdc1e;
326
           color: #fcdc1e;
287
         }
327
         }
288
       }
328
       }
289
     }
329
     }
330
+
290
     >.Btn {
331
     >.Btn {
291
       font-size: 28px;
332
       font-size: 28px;
292
       line-height: 80px;
333
       line-height: 80px;

+ 1
- 0
src/pages/WuYe/BaoXiuFeiYong/index.jsx 查看文件

84
       success: res => {
84
       success: res => {
85
         if (res.confirm) {
85
         if (res.confirm) {
86
           WechatPay([BillInfo.id - 0]).then(() => {
86
           WechatPay([BillInfo.id - 0]).then(() => {
87
+            setShowPopup(false)
87
             Taro.showToast({
88
             Taro.showToast({
88
               title: '缴费成功',
89
               title: '缴费成功',
89
               icon: 'success'
90
               icon: 'success'

+ 4
- 0
src/utils/api.js 查看文件

1
 const prefix = `${HOST}/api/wx`
1
 const prefix = `${HOST}/api/wx`
2
 
2
 
3
 const $api = {
3
 const $api = {
4
+  ReplyTicket: { // 工单回复
5
+    method: 'post',
6
+    url: `${prefix}/ticket/reply/:orgId`
7
+  },
4
   PostGongDanPingJia: { // 工单评价
8
   PostGongDanPingJia: { // 工单评价
5
     method: 'post',
9
     method: 'post',
6
     url: `${prefix}/accessTicket/:orgId`
10
     url: `${prefix}/accessTicket/:orgId`