张延森 4 år sedan
förälder
incheckning
28a537cc72

+ 9
- 0
src/pages.js Visa fil

@@ -129,6 +129,15 @@ const Property = [
129 129
       eventType: 'property',
130 130
     }
131 131
   },
132
+  {
133
+    name: '物业-业主报修',
134
+    page: 'pages/WoDe/YeZhuBaoXiu/index',
135
+    auth: ['avatar', 'phone', 'yezhu'],
136
+    track: {
137
+      event: 'detail',
138
+      eventType: 'property',
139
+    }
140
+  },
132 141
 ]
133 142
 
134 143
 const Activity = [

+ 53
- 0
src/pages/WoDe/YeZhuBaoXiu/components/Item/index.jsx Visa fil

@@ -0,0 +1,53 @@
1
+import React, { useState } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import toolclass from '@/utils/toolclass.js'
4
+import '@/assets/css/reset.less'
5
+import '@/assets/css/iconfont.less'
6
+import './index.less'
7
+
8
+export default function Item (props) {
9
+
10
+  const { Data } = props
11
+
12
+  // 随便一条
13
+  const verifyInfo = Data.userVerifyList[0] || {}
14
+  const ownerInfo = `业主信息: ${verifyInfo.ownerName} ${verifyInfo.phone}`
15
+  const roomInfo = `${verifyInfo.phaseName} ${verifyInfo.buildingName} ${verifyInfo.unitName} ${verifyInfo.roomNoName}`
16
+
17
+  const handleClick = () => {
18
+    if (verifyInfo.phone) {
19
+      Taro.makePhoneCall({
20
+        phoneNumber: verifyInfo.phone
21
+      })
22
+    }
23
+  }
24
+
25
+  return (
26
+    <view className='YeZhuBaoXiuItem'>
27
+      <view className='Title flex-h'>
28
+        <text className='iconfont icongonggongquyu'></text>
29
+        <text className='flex-item'>{Data.repairName}问题</text>
30
+        <text className='Time'>{toolclass.FormatDate(Data.createDate)}</text>
31
+      </view>
32
+      <view className='Name flex-h'>
33
+        <view style={{flex: 1}}><text className='flex-item'>{Data.ticketTitle}</text></view>
34
+        {
35
+          Data.status === '3' && <view className="Name-action" onClick={props.onAction}>完成</view>    
36
+        }
37
+      </view>
38
+      <view className='Detail flex-h'>
39
+        <view className='Line'><view></view></view>
40
+        <view className='flex-item' onClick={handleClick}>
41
+          <view className='flex-h'>
42
+            <view className='flex-item'><text>{Data.ticketStatusName}</text></view>
43
+            <view className='Time'><text>{toolclass.FormatDate(Data.ticketRecordDate)}</text></view>
44
+          </view>
45
+          <view className='Desc'>
46
+            <rich-text nodes={`${ownerInfo}<br />${roomInfo}`}></rich-text>
47
+          </view>
48
+          {/* <view className='Desc'>您的报修已经分配给物业处理人员<text className='Name'>郭培军</text>处理,联系方式<text className='Phone'>18266666666</text></view> */}
49
+        </view>
50
+      </view>
51
+    </view>
52
+  )
53
+}

+ 144
- 0
src/pages/WoDe/YeZhuBaoXiu/components/Item/index.less Visa fil

@@ -0,0 +1,144 @@
1
+.YeZhuBaoXiuItem {
2
+  position: relative;
3
+  background: #fff;
4
+  padding: 0 30px;
5
+
6
+  >.Title {
7
+    align-items: center;
8
+    padding-top: 10px;
9
+    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
10
+
11
+    >text {
12
+      font-size: 24px;
13
+      color: #999;
14
+      line-height: 88px;
15
+      margin-left: 10px;
16
+
17
+      &:first-child {
18
+        margin-left: 0;
19
+        font-size: 34px;
20
+        color: #F35844;
21
+      }
22
+
23
+      &.flex-item {
24
+        font-size: 24px;
25
+        font-weight: bold;
26
+        color: #333;
27
+        white-space: nowrap;
28
+      }
29
+    }
30
+  }
31
+
32
+  >.Name {
33
+    align-items: center;
34
+    margin-top: 20px;
35
+    display: flex;
36
+
37
+    .Name-action {
38
+      color: #F35844;
39
+      width: 128rpx;
40
+      flex: none;
41
+      border: 1px solid #F35844;
42
+      text-align: center;
43
+      border-radius: 8rpx;
44
+    }
45
+
46
+    >text {
47
+      font-size: 30px;
48
+      font-weight: bold;
49
+      line-height: 60px;
50
+      white-space: nowrap;
51
+      overflow: hidden;
52
+      text-overflow: ellipsis;
53
+
54
+      &.iconfont {
55
+        font-size: 40px;
56
+        color: #F35844;
57
+        margin-left: 20px;
58
+        font-weight: normal;
59
+      }
60
+    }
61
+  }
62
+
63
+  >.Detail {
64
+    position: relative;
65
+    margin-top: 40px;
66
+    padding-bottom: 30px;
67
+
68
+    >.Line {
69
+      width: 50px;
70
+      position: relative;
71
+      overflow: visible;
72
+      border-left: 2px dashed #F35844;
73
+
74
+      >view {
75
+        width: 14px;
76
+        height: 14px;
77
+        background: #F35844;
78
+        border-radius: 100%;
79
+        position: absolute;
80
+        left: -8px;
81
+        top: 30px;
82
+      }
83
+    }
84
+
85
+    >.flex-item {
86
+      position: relative;
87
+      overflow: visible;
88
+      background: rgba(243, 88, 68, 0.08);
89
+      padding: 20px;
90
+
91
+      &::after {
92
+        content: '';
93
+        width: 0;
94
+        height: 0;
95
+        display: block;
96
+        position: absolute;
97
+        left: -40px;
98
+        top: 16px;
99
+        border-color: transparent rgba(243, 88, 68, 0.08) transparent transparent;
100
+        border-style: solid dashed solid solid;
101
+        border-width: 20px;
102
+      }
103
+
104
+      >.flex-h {
105
+        align-items: center;
106
+
107
+        view {
108
+          text {
109
+            font-size: 24px;
110
+            color: #999;
111
+            line-height: 40px;
112
+          }
113
+
114
+          &:first-child {
115
+            text {
116
+              color: #F35844;
117
+            }
118
+          }
119
+        }
120
+      }
121
+
122
+      >.Desc {
123
+        font-size: 24px;
124
+        line-height: 40px;
125
+        color: #333;
126
+        margin-top: 10px;
127
+
128
+        >text {
129
+          &.Name {
130
+            color: #F35844;
131
+            font-size: 24px;
132
+            line-height: 40px;
133
+          }
134
+
135
+          &.Phone {
136
+            color: #14DC05;
137
+            font-size: 24px;
138
+            line-height: 40px;
139
+          }
140
+        }
141
+      }
142
+    }
143
+  }
144
+}

+ 21
- 2
src/pages/WoDe/YeZhuBaoXiu/index.jsx Visa fil

@@ -1,8 +1,10 @@
1 1
 import React, { useState } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import ScrollPageRefresh from '@/components/ScrollPageRefresh'
3
-import WuYeBaoXiuItem from '@/components/WuYeBaoXiuItem'
4 4
 import { useModel } from '@/store'
5 5
 import Page from '@/layouts'
6
+import Item from './components/Item'
7
+import request, { apis } from '@/utils/request'
6 8
 import '@/assets/css/reset.less'
7 9
 import '@/assets/css/iconfont.less'
8 10
 import './index.less'
@@ -26,6 +28,23 @@ export default function WoDeGongDan () {
26 28
     setPageList(PageList.concat(e))
27 29
   }
28 30
 
31
+  const handleItemAction = item => {
32
+    Taro.showModal({
33
+      title: '提示',
34
+      content: '确认结束当前工单?',
35
+      success: res => {
36
+        if (res.confirm) {
37
+          request({...apis.endTicket, data:{ticketId: item.id}}).then(x => {
38
+            Taro.showToast({
39
+              title: '结单成功',
40
+              icon: 'success'
41
+            })
42
+          })
43
+        }
44
+      }
45
+    })
46
+  }
47
+
29 48
   return (
30 49
     <Page>
31 50
       <view className='WoDeGongDan'>
@@ -34,7 +53,7 @@ export default function WoDeGongDan () {
34 53
             {
35 54
               PageList.map((item, index) => (
36 55
                 <view className='ListItem' key={`ActivityItem-${index}`}>
37
-                  <WuYeBaoXiuItem Data={item}></WuYeBaoXiuItem>
56
+                  <Item Data={item} onAction={() => handleItemAction(item)}></Item>
38 57
                 </view>
39 58
               ))
40 59
             }

+ 2
- 2
src/pages/WoDe/index.jsx Visa fil

@@ -18,8 +18,8 @@ const menuGroup = [
18 18
     { icon: 'iconjifenguize', name: '积分明细', id: 2, router: '/pages/FuLi/JiFenMingXi/index' },
19 19
     { icon: 'iconjiaofei', name: '物业缴费', id: 3, router: '/pages/WoDe/WoDeJiaoFei/index' },
20 20
     { icon: 'iconfuwu1', name: '物业报修', id: 4, router: '/pages/WoDe/WoDeGongDan/index' },
21
-    // { icon: 'iconfuwu1', name: '业主工单', id: 4, router: '/pages/WoDe/WoDeGongDan/index', personTypes: [PERSON_TYPE.LIFE_CONSULTANT] },
22
-    { 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] },
22
+    { icon: 'iconfuwu1', name: '业主报修', id: 4, router: '/pages/WoDe/YeZhuBaoXiu/index' },
23 23
   ],
24 24
   [
25 25
     { icon: 'iconerweima', name: '推荐二维码', id: 5, router: '/pages/WoDe/TuiJianErWeiMa/index' },

+ 6
- 0
src/utils/api.js Visa fil

@@ -138,6 +138,12 @@ const $api = {
138 138
     method: 'get',
139 139
     url: `${prefix}/ticket/schedule/:orgId`
140 140
   },
141
+
142
+  endTicket: {  // 管家结束工单
143
+    method: 'post',
144
+    url: `${prefix}/endTicket`
145
+  },
146
+
141 147
   getWuYePhone: { // 获取物业电话
142 148
     method: 'get',
143 149
     url: `${prefix}/tels`