1002884655 4 lat temu
rodzic
commit
bd0998c1af

+ 25
- 9
package-lock.json Wyświetl plik

@@ -9800,7 +9800,7 @@
9800 9800
     },
9801 9801
     "node-gyp": {
9802 9802
       "version": "7.1.2",
9803
-      "resolved": "https://registry.npm.taobao.org/node-gyp/download/node-gyp-7.1.2.tgz?cache=0&sync_timestamp=1602898478735&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-gyp%2Fdownload%2Fnode-gyp-7.1.2.tgz",
9803
+      "resolved": "https://registry.npm.taobao.org/node-gyp/download/node-gyp-7.1.2.tgz?cache=0&sync_timestamp=1602898543148&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-gyp%2Fdownload%2Fnode-gyp-7.1.2.tgz",
9804 9804
       "integrity": "sha1-IagQrrsYcSAlHDvOyXmvFYexiK4=",
9805 9805
       "requires": {
9806 9806
         "env-paths": "^2.2.0",
@@ -9815,18 +9815,34 @@
9815 9815
         "which": "^2.0.2"
9816 9816
       },
9817 9817
       "dependencies": {
9818
+        "lru-cache": {
9819
+          "version": "6.0.0",
9820
+          "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz?cache=0&sync_timestamp=1594427573763&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flru-cache%2Fdownload%2Flru-cache-6.0.0.tgz",
9821
+          "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=",
9822
+          "requires": {
9823
+            "yallist": "^4.0.0"
9824
+          }
9825
+        },
9818 9826
         "rimraf": {
9819 9827
           "version": "3.0.2",
9820
-          "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz",
9828
+          "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz",
9821 9829
           "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=",
9822 9830
           "requires": {
9823 9831
             "glob": "^7.1.3"
9824 9832
           }
9825 9833
         },
9826 9834
         "semver": {
9827
-          "version": "7.3.2",
9828
-          "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.2.tgz",
9829
-          "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg="
9835
+          "version": "7.3.4",
9836
+          "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.4.tgz?cache=0&sync_timestamp=1606854810932&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.3.4.tgz",
9837
+          "integrity": "sha1-J6qn0uTKdkUvmNOt0JOnLJQ+3Jc=",
9838
+          "requires": {
9839
+            "lru-cache": "^6.0.0"
9840
+          }
9841
+        },
9842
+        "yallist": {
9843
+          "version": "4.0.0",
9844
+          "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz",
9845
+          "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI="
9830 9846
         }
9831 9847
       }
9832 9848
     },
@@ -9881,7 +9897,7 @@
9881 9897
     },
9882 9898
     "node-sass": {
9883 9899
       "version": "5.0.0",
9884
-      "resolved": "https://registry.npm.taobao.org/node-sass/download/node-sass-5.0.0.tgz?cache=0&sync_timestamp=1604150672615&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-sass%2Fdownload%2Fnode-sass-5.0.0.tgz",
9900
+      "resolved": "https://registry.npm.taobao.org/node-sass/download/node-sass-5.0.0.tgz?cache=0&sync_timestamp=1604150619472&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-sass%2Fdownload%2Fnode-sass-5.0.0.tgz",
9885 9901
       "integrity": "sha1-To85++87rI0txy6+O1OXEYg6eNI=",
9886 9902
       "requires": {
9887 9903
         "async-foreach": "^0.1.3",
@@ -9904,7 +9920,7 @@
9904 9920
       "dependencies": {
9905 9921
         "ansi-styles": {
9906 9922
           "version": "2.2.1",
9907
-          "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-2.2.1.tgz?cache=0&sync_timestamp=1601839122515&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-2.2.1.tgz",
9923
+          "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-2.2.1.tgz?cache=0&sync_timestamp=1606792266928&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-styles%2Fdownload%2Fansi-styles-2.2.1.tgz",
9908 9924
           "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
9909 9925
         },
9910 9926
         "chalk": {
@@ -9928,7 +9944,7 @@
9928 9944
     },
9929 9945
     "nopt": {
9930 9946
       "version": "5.0.0",
9931
-      "resolved": "https://registry.npm.taobao.org/nopt/download/nopt-5.0.0.tgz?cache=0&sync_timestamp=1597649892953&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnopt%2Fdownload%2Fnopt-5.0.0.tgz",
9947
+      "resolved": "https://registry.npm.taobao.org/nopt/download/nopt-5.0.0.tgz?cache=0&sync_timestamp=1597654519967&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnopt%2Fdownload%2Fnopt-5.0.0.tgz",
9932 9948
       "integrity": "sha1-UwlCu1ilEvzK/lP+IQ8TolNV3Ig=",
9933 9949
       "requires": {
9934 9950
         "abbrev": "1"
@@ -13775,7 +13791,7 @@
13775 13791
     },
13776 13792
     "tar": {
13777 13793
       "version": "6.0.5",
13778
-      "resolved": "https://registry.npm.taobao.org/tar/download/tar-6.0.5.tgz?cache=0&sync_timestamp=1597445351863&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftar%2Fdownload%2Ftar-6.0.5.tgz",
13794
+      "resolved": "https://registry.npm.taobao.org/tar/download/tar-6.0.5.tgz",
13779 13795
       "integrity": "sha1-vegVCG4Qs58dzSmOidWW4VNeIA8=",
13780 13796
       "requires": {
13781 13797
         "chownr": "^2.0.0",

+ 1
- 1
src/components/WuYeBaoXiu/index.jsx Wyświetl plik

@@ -42,7 +42,7 @@ export default function WuYeBaoXiu () {
42 42
           {
43 43
             PageList.map((item, index) => (
44 44
               <view key={`WuYeBaoXiuItem-${index}`}>
45
-                <WuYeBaoXiuItem Data={{ ...item, id: index }}></WuYeBaoXiuItem>
45
+                <WuYeBaoXiuItem Data={{ ...item }}></WuYeBaoXiuItem>
46 46
               </view>
47 47
             ))
48 48
           }

+ 14
- 10
src/components/WuYeBaoXiuItem/index.jsx Wyświetl plik

@@ -1,5 +1,6 @@
1 1
 import React, { useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3
+import toolclass from '@/utils/toolclass.js'
3 4
 import '@/assets/css/reset.less'
4 5
 import '@/assets/css/iconfont.less'
5 6
 import './index.less'
@@ -13,24 +14,27 @@ export default function WuYeBaoXiuItem (props) {
13 14
   }
14 15
 
15 16
   return (
16
-    <view className='WuYeBaoXiuItem' onClick={ItemClick}>
17
-      <view className='Title flex-h'>
17
+    <view className='WuYeBaoXiuItem'>
18
+      <view className='Title flex-h' onClick={ItemClick}>
18 19
         <text className='iconfont icongonggongquyu'></text>
19
-        <text className='flex-item'>公共区域问题</text>
20
-        <text className='Time'>2020/06/08 13:00</text>
20
+        <text className='flex-item'>{Data.repairName}问题</text>
21
+        <text className='Time'>{toolclass.FormatDate(Data.createDate)}</text>
21 22
       </view>
22 23
       <view className='Name flex-h'>
23
-        <text className='flex-item'>1栋3单元2楼-3楼走廊声控灯出现故障</text>
24
-        <text className='iconfont iconbianji'></text>
24
+        <text className='flex-item' onClick={ItemClick}>{Data.ticketTitle}</text>
25
+        <text className='iconfont iconbianji' onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/XiuGaiBaoXiu/index?id=${Data.id}` }) }}></text>
25 26
       </view>
26
-      <view className='Detail flex-h'>
27
+      <view className='Detail flex-h' onClick={ItemClick}>
27 28
         <view className='Line'><view></view></view>
28 29
         <view className='flex-item'>
29 30
           <view className='flex-h'>
30
-            <text className='flex-item'>正在处理</text>
31
-            <text className='Time'>2020/06/08 12:58</text>
31
+            <view className='flex-item'><text>{Data.ticketStatusName}</text></view>
32
+            <view className='Time'><text>{toolclass.FormatDate(Data.ticketRecordDate)}</text></view>
32 33
           </view>
33
-          <view className='Desc'>您的报修已经分配给物业处理人员<text className='Name'>郭培军</text>处理,联系方式<text className='Phone'>18266666666</text></view>
34
+          <view className='Desc'>
35
+            <text>{Data.ticketStatusContent}</text>
36
+          </view>
37
+          {/* <view className='Desc'>您的报修已经分配给物业处理人员<text className='Name'>郭培军</text>处理,联系方式<text className='Phone'>18266666666</text></view> */}
34 38
         </view>
35 39
       </view>
36 40
     </view>

+ 10
- 5
src/components/WuYeBaoXiuItem/index.less Wyświetl plik

@@ -94,13 +94,17 @@
94 94
       >.flex-h {
95 95
         align-items: center;
96 96
 
97
-        >text {
98
-          font-size: 24px;
99
-          color: #999;
100
-          line-height: 40px;
97
+        view {
98
+          text {
99
+            font-size: 24px;
100
+            color: #999;
101
+            line-height: 40px;
102
+          }
101 103
 
102 104
           &:first-child {
103
-            color: #F35844;
105
+            text {
106
+              color: #F35844;
107
+            }
104 108
           }
105 109
         }
106 110
       }
@@ -117,6 +121,7 @@
117 121
             font-size: 24px;
118 122
             line-height: 40px;
119 123
           }
124
+
120 125
           &.Phone {
121 126
             color: #14DC05;
122 127
             font-size: 24px;

+ 5
- 0
src/pages.js Wyświetl plik

@@ -48,6 +48,11 @@ const Property = [
48 48
     page: 'pages/WuYe/BaoXiuDetail/index',
49 49
     type: 'property',
50 50
   },
51
+  {
52
+    name: '物业-编辑报修',
53
+    page: 'pages/WuYe/XiuGaiBaoXiu/index',
54
+    type: 'property',
55
+  },
51 56
   {
52 57
     name: '物业-报修费用',
53 58
     page: 'pages/WuYe/BaoXiuFeiYong/index',

+ 224
- 21
src/pages/WoDe/YeZhuRenZheng/index.jsx Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import { Picker } from '@tarojs/components'
3
-import { AtList, AtListItem } from 'taro-ui'
2
+import { Input, Picker } from '@tarojs/components'
3
+import Taro from '@tarojs/taro'
4 4
 import request, { apis } from '@/utils/request'
5 5
 import { useModel } from '@/store'
6 6
 import '@/assets/css/reset.less'
@@ -10,6 +10,11 @@ import './index.less'
10 10
 export default function YeZhuRenZheng () {
11 11
 
12 12
   const { user } = useModel('user')
13
+  const [FormData, setFormData] = useState({ RealName: '', IdCard: '', Phone: '' })
14
+  const [PhoneCode, setPhoneCode] = useState('')
15
+  let CodeTimer = null
16
+  const [CodeTimerNum, setCodeTimerNum] = useState(60)
17
+  const [DataLock, setDataLock] = useState(false)
13 18
   const [Level1Value] = useState(user.orgId)
14 19
   const [Level2Value, setLevel2Value] = useState(null)
15 20
   const [Level2List, setLevel2List] = useState([])
@@ -19,48 +24,221 @@ export default function YeZhuRenZheng () {
19 24
   const [Level4List, setLevel4List] = useState([])
20 25
   const [Level5Value, setLevel5Value] = useState(null)
21 26
   const [Level5List, setLevel5List] = useState([])
27
+  const [Level6Value, setLevel6Value] = useState(null)
28
+  const [Level6List, setLevel6List] = useState([])
22 29
 
23 30
   useEffect(() => {
24 31
     GetLevel2List()
25 32
   }, [Level1Value])
26 33
 
27 34
   useEffect(() => {
28
-    GetLevel3List(Level2List)
35
+    GetLevel3List()
29 36
   }, [Level2Value])
30 37
 
38
+  useEffect(() => {
39
+    GetLevel4List()
40
+  }, [Level3Value])
41
+
42
+  useEffect(() => {
43
+    GetLevel5List()
44
+  }, [Level4Value])
45
+
46
+  useEffect(() => {
47
+    GetLevel6List()
48
+  }, [Level5Value])
49
+
50
+  useEffect(() => {
51
+    clearTimeout(CodeTimer)
52
+    if (CodeTimerNum > 0 && CodeTimerNum < 60) {
53
+      CodeTimer = setTimeout(() => {
54
+        setCodeTimerNum(CodeTimerNum - 1)
55
+      }, 1000)
56
+    } else {
57
+      clearTimeout(CodeTimer)
58
+      setCodeTimerNum(60)
59
+    }
60
+  }, [CodeTimerNum])
61
+
62
+  const CheckPhone = () => { // 校验手机号
63
+    return /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/g.test(FormData.Phone)
64
+  }
65
+
66
+  const ToGetPhoneCode = () => {
67
+    if (!CheckPhone()) {
68
+      Taro.showToast({ title: '手机号填写错误', icon: 'none' })
69
+      return false
70
+    }
71
+    if (CodeTimerNum - 0 === 60) {
72
+      request({ ...apis.getPhoneCode, params: { tel: FormData.Phone } }).then(() => {
73
+        Taro.showToast({ title: '验证码已发送', icon: 'none' })
74
+        clearTimeout(CodeTimer)
75
+        setCodeTimerNum(59)
76
+      }).catch((res) => {
77
+        Taro.showToast({ title: res, icon: 'none' })
78
+        clearTimeout(CodeTimer)
79
+        setCodeTimerNum(60)
80
+      })
81
+    }
82
+  }
83
+
84
+  const CheckForm = () => { // 表单校验
85
+    if (FormData.RealName === '') {
86
+      Taro.showToast({ title: '请填写姓名', icon: 'none' })
87
+      return false
88
+    }
89
+    if (FormData.IdCard === '') {
90
+      Taro.showToast({ title: '请填写身份证', icon: 'none' })
91
+      return false
92
+    }
93
+    if (FormData.Phone === '') {
94
+      Taro.showToast({ title: '请填写手机号', icon: 'none' })
95
+      return false
96
+    }
97
+    return true
98
+  }
99
+
100
+  const Submit = () => {
101
+    if (DataLock) return
102
+    setDataLock(true)
103
+    if (PhoneCode === '') {
104
+      Taro.showToast({ title: '请填写验证码', icon: 'none' })
105
+      setDataLock(false)
106
+      return false
107
+    }
108
+    if (!CheckForm()) {
109
+      setDataLock(false)
110
+      return false
111
+    }
112
+    request({ ...apis.checkPhoneCode, params: { captcha: PhoneCode, tel: FormData.Phone } }).then(() => {
113
+      request({
114
+        ...apis.addOwnerVerify,
115
+        data: {
116
+          phaseId: Level2List[Level2Value].id,
117
+          buildingId: Level3List[Level3Value].id,
118
+          unitId: Level4List[Level4Value].id,
119
+          levelId: Level5List[Level5Value].id,
120
+          roomNoId: Level6List[Level6Value].id,
121
+          phone: FormData.Phone,
122
+          ownerName: FormData.RealName,
123
+          idCard: FormData.IdCard
124
+        }
125
+      }).then(() => {
126
+        Taro.showToast({ title: '添加认证成功', icon: 'none' })
127
+        setDataLock(false)
128
+      }).catch((res) => {
129
+        Taro.showToast({ title: res, icon: 'none' })
130
+        setDataLock(false)
131
+      })
132
+    }).catch((res) => {
133
+      Taro.showToast({ title: res, icon: 'none' })
134
+      setDataLock(false)
135
+    })
136
+  }
137
+
31 138
   const GetLevel2List = () => {
32 139
     request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId } }).then((res) => {
33 140
       setLevel2List(res || [])
34 141
       if (res !== null && res.length > 0) {
35 142
         setLevel2Value(0)
143
+      } else {
144
+        setLevel2Value(null)
145
+        setLevel2List([])
36 146
       }
37 147
     })
38 148
   }
39 149
 
40
-  const GetLevel3List = (list = []) => {
150
+  const GetLevel3List = () => {
41 151
     if (Level2Value !== null) {
42
-      request({ ...apis.getRenZhengAddressList, params: { phaseId: list[Level2Value].id } }).then((res) => {
152
+      request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id } }).then((res) => {
43 153
         setLevel3List(res || [])
44 154
         if (res !== null && res.length > 0) {
45 155
           setLevel3Value(0)
156
+        } else {
157
+          setLevel3Value(null)
158
+          setLevel3List([])
46 159
         }
47 160
       })
161
+    } else {
162
+      setLevel3Value(null)
163
+      setLevel3List([])
164
+    }
165
+  }
166
+
167
+  const GetLevel4List = () => {
168
+    if (Level3Value !== null) {
169
+      request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id } }).then((res) => {
170
+        setLevel4List(res || [])
171
+        if (res !== null && res.length > 0) {
172
+          setLevel4Value(0)
173
+        } else {
174
+          setLevel4Value(null)
175
+          setLevel4List([])
176
+        }
177
+      })
178
+    } else {
179
+      setLevel4Value(null)
180
+      setLevel4List([])
181
+    }
182
+  }
183
+
184
+  const GetLevel5List = () => {
185
+    if (Level4Value !== null) {
186
+      request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id } }).then((res) => {
187
+        setLevel5List(res || [])
188
+        if (res !== null && res.length > 0) {
189
+          setLevel5Value(0)
190
+        } else {
191
+          setLevel5Value(null)
192
+          setLevel5List([])
193
+        }
194
+      })
195
+    } else {
196
+      setLevel5Value(null)
197
+      setLevel5List([])
198
+    }
199
+  }
200
+
201
+  const GetLevel6List = () => {
202
+    if (Level5Value !== null) {
203
+      request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id, levelId: Level5List[Level5Value].id } }).then((res) => {
204
+        setLevel6List(res || [])
205
+        if (res !== null && res.length > 0) {
206
+          setLevel6Value(0)
207
+        } else {
208
+          setLevel6Value(null)
209
+          setLevel6List([])
210
+        }
211
+      })
212
+    } else {
213
+      setLevel6Value(null)
214
+      setLevel6List([])
48 215
     }
49 216
   }
50 217
 
51 218
   const Level2Change = (e) => {
52
-    console.log(e)
219
+    setLevel2Value(e.detail.value - 0)
220
+  }
221
+
222
+  const Level3Change = (e) => {
223
+    setLevel3Value(e.detail.value - 0)
224
+  }
225
+
226
+  const Level4Change = (e) => {
227
+    setLevel4Value(e.detail.value - 0)
228
+  }
229
+
230
+  const Level5Change = (e) => {
231
+    setLevel5Value(e.detail.value - 0)
232
+  }
233
+
234
+  const Level6Change = (e) => {
235
+    setLevel6Value(e.detail.value - 0)
53 236
   }
54 237
 
55 238
   return (
56 239
     <view className='YeZhuRenZheng'>
57 240
       <view className='Form'>
58
-        <Picker mode='selector' range={Level2List} onChange={Level2Change}>
59
-          <AtList>
60
-            <AtListItem title='期号' />
61
-          </AtList>
62
-        </Picker>
63
-        {/* <view className='flex-h'>
241
+        <view className='flex-h'>
64 242
           <text className='iconfont iconxingming'></text>
65 243
           <Input className='flex-item' placeholder='请输入您的姓名' value={FormData.RealName} onInput={(e) => { setFormData({ ...FormData, RealName: e.detail.value }) }}></Input>
66 244
         </view>
@@ -74,26 +252,51 @@ export default function YeZhuRenZheng () {
74 252
         </view>
75 253
         <view className='flex-h'>
76 254
           <text className='iconfont iconyanzhengma'></text>
77
-          <Input type='idcard' className='flex-item' placeholder='请输入验证码'></Input>
78
-          <text className='active'>获取验证码</text>
255
+          <Input type='idcard' className='flex-item' placeholder='请输入验证码' value={PhoneCode} onInput={(e) => { setPhoneCode(e.detail.value) }}></Input>
256
+          <text className={CodeTimerNum - 0 === 60 ? 'active' : ''} onClick={ToGetPhoneCode}>{CodeTimerNum - 0 === 60 ? `获取验证码` : `${CodeTimerNum > 9 ? `${CodeTimerNum}s后再次获取` : `0${CodeTimerNum}s后再次获取`}`}</text>
79 257
         </view>
80 258
         <view className='flex-h'>
81
-          <Input className='flex-item' placeholder='请输入小区名称' value={FormData.OrgName} onInput={(e) => { setFormData({ ...FormData, OrgName: e.detail.value }) }}></Input>
259
+          <text>期号</text>
260
+          <view className='flex-item'>
261
+            <Picker value={Level2Value} range-key='name' range={Level2List} onChange={Level2Change}>
262
+              <view className='PickerText'>{Level2List.length > 0 && Level2Value !== null ? Level2List[Level2Value].name : '请选择期号'}</view>
263
+            </Picker>
264
+          </view>
82 265
         </view>
83 266
         <view className='flex-h'>
84
-          <Input className='flex-item' placeholder='请输入期号' value={FormData.Stages} onInput={(e) => { setFormData({ ...FormData, Stages: e.detail.value }) }}></Input>
267
+          <text>楼栋</text>
268
+          <view className='flex-item'>
269
+            <Picker value={Level3Value} range-key='name' range={Level3List} onChange={Level3Change}>
270
+              <view className='PickerText'>{Level3List.length > 0 && Level3Value !== null ? Level3List[Level3Value].name : '请选择楼栋'}</view>
271
+            </Picker>
272
+          </view>
85 273
         </view>
86 274
         <view className='flex-h'>
87
-          <Input className='flex-item' placeholder='请输入楼栋号' value={FormData.BuildingNum} onInput={(e) => { setFormData({ ...FormData, BuildingNum: e.detail.value }) }}></Input>
275
+          <text>单元</text>
276
+          <view className='flex-item'>
277
+            <Picker value={Level4Value} range-key='name' range={Level4List} onChange={Level4Change}>
278
+              <view className='PickerText'>{Level4List.length > 0 && Level4Value !== null ? Level4List[Level4Value].name : '请选择单元'}</view>
279
+            </Picker>
280
+          </view>
88 281
         </view>
89 282
         <view className='flex-h'>
90
-          <Input className='flex-item' placeholder='请输入单元号' value={FormData.UnitNum} onInput={(e) => { setFormData({ ...FormData, UnitNum: e.detail.value }) }}></Input>
283
+          <text>楼层</text>
284
+          <view className='flex-item'>
285
+            <Picker value={Level5Value} range-key='name' range={Level5List} onChange={Level5Change}>
286
+              <view className='PickerText'>{Level5List.length > 0 && Level5Value !== null ? Level5List[Level5Value].name : '请选择楼层'}</view>
287
+            </Picker>
288
+          </view>
91 289
         </view>
92 290
         <view className='flex-h'>
93
-          <Input className='flex-item' placeholder='请输入户号' value={FormData.RoomNum} onInput={(e) => { setFormData({ ...FormData, RoomNum: e.detail.value }) }}></Input>
94
-        </view> */}
291
+          <text>房号</text>
292
+          <view className='flex-item'>
293
+            <Picker value={Level6Value} range-key='name' range={Level6List} onChange={Level6Change}>
294
+              <view className='PickerText'>{Level6List.length > 0 && Level6Value !== null ? Level6List[Level6Value].name : '请选择房号'}</view>
295
+            </Picker>
296
+          </view>
297
+        </view>
95 298
       </view>
96
-      <view className='BottomBtn'>
299
+      <view className='BottomBtn' onClick={Submit}>
97 300
         <text>提交</text>
98 301
       </view>
99 302
     </view>

+ 14
- 1
src/pages/WoDe/YeZhuRenZheng/index.less Wyświetl plik

@@ -20,12 +20,16 @@
20 20
         color: #333;
21 21
         line-height: 100px;
22 22
 
23
-        &:first-child {
23
+        &.iconfont {
24 24
           font-size: 50px;
25 25
           color: #F35844;
26 26
           width: 80px;
27 27
         }
28 28
 
29
+        &:first-child {
30
+          min-width: 80px;
31
+        }
32
+
29 33
         &:last-child {
30 34
           line-height: 60px;
31 35
           padding: 0 20px;
@@ -40,6 +44,15 @@
40 44
         }
41 45
       }
42 46
 
47
+      >.flex-item {
48
+        .PickerText {
49
+          width: 100%;
50
+          text-align: right;
51
+          font-size: 28px;
52
+          color: #666;
53
+        }
54
+      }
55
+
43 56
       >input {
44 57
         font-size: 28px;
45 58
         color: #333;

+ 15
- 3
src/pages/WoDe/index.jsx Wyświetl plik

@@ -1,14 +1,26 @@
1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2 2
 import NavHeader from '@/components/NavHeader/index'
3 3
 import Taro from '@tarojs/taro'
4
+import request, { apis } from '@/utils/request'
5
+import { useModel } from '@/store'
4 6
 import '@/assets/css/reset.less'
5 7
 import '@/assets/css/iconfont.less'
6 8
 import './index.less'
7 9
 
8 10
 export default function WoDe (props) {
9 11
 
12
+  const { user } = useModel('user')
10 13
   const [IsPull, setIsPull] = useState(false)
11 14
 
15
+  useEffect(() => {
16
+    if (user !== null) {
17
+      request({ ...apis.getOwnerVerifyList }).then(() => {
18
+      }).catch((res) => {
19
+        Taro.showToast({ title: res, icon: 'none' })
20
+      })
21
+    }
22
+  }, [])
23
+
12 24
   const [UserTab, setUserTab] = useState([
13 25
     { icon: 'iconrenzheng1', name: '业主认证', id: 1, router: '/pages/WoDe/YeZhuRenZheng/index' },
14 26
     { icon: 'iconjifenguize', name: '积分明细', id: 2, router: null },
@@ -45,8 +57,8 @@ export default function WoDe (props) {
45 57
                 <image mode='aspectFill' src={null} class='centerLabel'></image>
46 58
               </view>
47 59
               <view className='flex-item' onClick={() => { Taro.navigateTo({ url: '/pages/WoDe/GeRenXinXi/index' }) }}>
48
-                <text>徐慧慧</text>
49
-                <text>13613949434</text>
60
+                <text>{user.nickname || '暂未授权用户信息'}</text>
61
+                <text>{user.phone || '暂未授权手机号'}</text>
50 62
               </view>
51 63
               <text>签到</text>
52 64
             </view>

+ 25
- 26
src/pages/WuYe/BaoXiuDetail/index.jsx Wyświetl plik

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'
2 2
 import Taro, { Current } from '@tarojs/taro'
3 3
 import request, { apis } from '@/utils/request'
4 4
 import { useModel } from '@/store'
5
+import toolclass from '@/utils/toolclass.js'
5 6
 import '@/assets/css/reset.less'
6 7
 import '@/assets/css/iconfont.less'
7 8
 import './index.less'
@@ -18,7 +19,6 @@ export default function BaoXiuDetail () {
18 19
 
19 20
   const Init = () => {
20 21
     request({ ...apis.getGongDanDetail, args: { orgId: user.orgId }, params: { ticketId: CurrnetBaoXiuId } }).then((res) => {
21
-      console.log(JSON.stringify(res))
22 22
       setDetailInfo(res)
23 23
     })
24 24
   }
@@ -31,16 +31,16 @@ export default function BaoXiuDetail () {
31 31
       {/* 概况 */}
32 32
       <view className='TopInfo'>
33 33
         <view className='flex-h'>
34
-          <text className='flex-item'>1栋3单元2楼-3楼走廊声控灯已坏</text>
34
+          <text className='flex-item'>{DetailInfo === null ? null : DetailInfo.ticketTitle}</text>
35 35
           <text className='iconfont iconjiantouright'></text>
36 36
         </view>
37 37
         <view className='flex-h'>
38 38
           <text className='flex-item'>报修单号</text>
39
-          <text>201810120010</text>
39
+          <text>{DetailInfo === null ? null : DetailInfo.id}</text>
40 40
         </view>
41 41
         <view className='flex-h'>
42 42
           <text className='flex-item'>报修时间</text>
43
-          <text>2018-10-12  18:00</text>
43
+          <text>{DetailInfo === null ? null : toolclass.FormatDate(DetailInfo.createDate)}</text>
44 44
         </view>
45 45
       </view>
46 46
 
@@ -51,28 +51,27 @@ export default function BaoXiuDetail () {
51 51
           <view className='Line'><view></view></view>
52 52
           <view className='flex-item'>
53 53
             <view>
54
-              <view className='StepList'>
55
-                <view className='Title flex-h'>
56
-                  <text className='flex-item Red'>待分配</text>
57
-                  <text>12:58</text>
58
-                </view>
59
-                <view className='Text'>您的报修正在分配物业处理人员,若长时间无人处理,请联系物业。<text className='Blue'>物业电话薄</text><text className='Blue iconfont iconjiantouright'></text></view>
60
-                <view className='ImgList'>
61
-                  <view></view>
62
-                  <view></view>
63
-                  <view></view>
64
-                  <view></view>
65
-                  <view></view>
66
-                  <view></view>
67
-                </view>
68
-              </view>
69
-              <view className='StepList'>
70
-                <view className='Title flex-h'>
71
-                  <text className='flex-item'>待分配</text>
72
-                  <text>12:58</text>
73
-                </view>
74
-                <view className='Text'>经评估,您本次报修产生费用<text className='Red'>150</text>元</view>
75
-              </view>
54
+              {
55
+                DetailInfo !== null && DetailInfo.ticketRecordList !== null &&
56
+                DetailInfo.ticketRecordList.map((item, index) => (
57
+                  <view className='StepList' key={`StepList-${index}`}>
58
+                    <view className='Title flex-h'>
59
+                      <text className='flex-item Red'>{item.ticketStatusName}</text>
60
+                      <text>{toolclass.FormatDate(item.createDate)}</text>
61
+                    </view>
62
+                    <view className='Text'>{item.content}</view>
63
+                    {/* <view className='Text'>您的报修正在分配物业处理人员,若长时间无人处理,请联系物业。<text className='Blue'>物业电话薄</text><text className='Blue iconfont iconjiantouright'></text></view> */}
64
+                    {/* <view className='ImgList'>
65
+                      <view></view>
66
+                      <view></view>
67
+                      <view></view>
68
+                      <view></view>
69
+                      <view></view>
70
+                      <view></view>
71
+                    </view> */}
72
+                  </view>
73
+                ))
74
+              }
76 75
             </view>
77 76
           </view>
78 77
         </view>

+ 3
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.config.js Wyświetl plik

@@ -0,0 +1,3 @@
1
+export default {
2
+  navigationBarTitleText: '编辑报修'
3
+}

+ 102
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.css Wyświetl plik

@@ -0,0 +1,102 @@
1
+.WuYeTianJiaBaoXiu {
2
+  width: 100%;
3
+  position: relative;
4
+  background: #f8f8f8;
5
+  overflow: hidden;
6
+  min-height: 100%;
7
+  padding-bottom: 160px;
8
+}
9
+.WuYeTianJiaBaoXiu > .Form {
10
+  position: relative;
11
+  overflow: hidden;
12
+  padding: 0 30px;
13
+  background-color: #fff;
14
+  padding-bottom: 30px;
15
+}
16
+.WuYeTianJiaBaoXiu > .Form > input {
17
+  width: 100%;
18
+  display: block;
19
+  font-size: 32px;
20
+  color: #333;
21
+  line-height: 98px;
22
+  height: 98px;
23
+  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
24
+}
25
+.WuYeTianJiaBaoXiu > .Form > textarea {
26
+  display: block;
27
+  font-size: 28px;
28
+  color: #999;
29
+  line-height: 40px;
30
+  margin-top: 20px;
31
+  width: 100%;
32
+}
33
+.WuYeTianJiaBaoXiu > .Photo {
34
+  padding: 30px;
35
+  padding-bottom: 10px;
36
+  position: relative;
37
+  overflow: hidden;
38
+  margin-top: 30px;
39
+  background-color: #fff;
40
+  font-size: 0;
41
+}
42
+.WuYeTianJiaBaoXiu > .Photo > view {
43
+  display: inline-block;
44
+  vertical-align: middle;
45
+  width: 150px;
46
+  height: 150px;
47
+  position: relative;
48
+  overflow: hidden;
49
+  margin-right: 20px;
50
+  margin-bottom: 20px;
51
+}
52
+.WuYeTianJiaBaoXiu > .Photo > view.Add > view {
53
+  width: 100%;
54
+}
55
+.WuYeTianJiaBaoXiu > .Photo > view.Add > view > text {
56
+  display: block;
57
+  text-align: center;
58
+  width: 100%;
59
+  font-size: 28px;
60
+  color: #999;
61
+  line-height: 40px;
62
+}
63
+.WuYeTianJiaBaoXiu > .Photo > view.Add > view > text:first-child {
64
+  font-size: 60px;
65
+  line-height: 80px;
66
+}
67
+.WuYeTianJiaBaoXiu > .Photo > view.PhotoItem {
68
+  background-color: #f8f8f8;
69
+}
70
+.WuYeTianJiaBaoXiu > .Photo > view.PhotoItem > image {
71
+  width: 100%;
72
+  height: 100%;
73
+  position: relative;
74
+  z-index: 1;
75
+}
76
+.WuYeTianJiaBaoXiu > .Photo > view.PhotoItem > text {
77
+  display: inline-block;
78
+  position: absolute;
79
+  z-index: 2;
80
+  right: 0px;
81
+  top: 0px;
82
+  font-size: 40px;
83
+  color: red;
84
+}
85
+.WuYeTianJiaBaoXiu > .Btn {
86
+  position: fixed;
87
+  left: 30px;
88
+  right: 30px;
89
+  z-index: 10;
90
+  overflow: hidden;
91
+  bottom: 30px;
92
+}
93
+.WuYeTianJiaBaoXiu > .Btn > text {
94
+  width: 100%;
95
+  display: block;
96
+  font-size: 34px;
97
+  color: #fff;
98
+  line-height: 98px;
99
+  text-align: center;
100
+  border-radius: 98px;
101
+  background-color: #F35844;
102
+}

+ 90
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.jsx Wyświetl plik

@@ -0,0 +1,90 @@
1
+import React, { useState, useEffect } from 'react'
2
+import Taro, { Current } from '@tarojs/taro'
3
+import { Input, Textarea } from '@tarojs/components'
4
+import request, { apis } from '@/utils/request'
5
+import { useModel } from '@/store'
6
+import '@/assets/css/reset.less'
7
+import '@/assets/css/iconfont.less'
8
+import './index.less'
9
+
10
+export default function WuYeXiuGaiBaoXiu () {
11
+
12
+  const { user } = useModel('user')
13
+  const [DataLock, setDataLock] = useState(false)
14
+  const [DetailInfo, setDetailInfo] = useState(null)
15
+  const [CurrnetId] = useState(Current.router.params.id)
16
+
17
+  useEffect(() => {
18
+    Init()
19
+  }, [CurrnetId])
20
+
21
+  const Init = () => {
22
+    request({ ...apis.getGongDanDetail, args: { orgId: user.orgId }, params: { ticketId: CurrnetId } }).then((res) => {
23
+      setDetailInfo(res)
24
+    })
25
+  }
26
+
27
+  const TitleChange = (e) => {
28
+    setDetailInfo({ ...DetailInfo, ticketTitle: e.detail.value })
29
+  }
30
+
31
+  const DescChange = (e) => {
32
+    setDetailInfo({ ...DetailInfo, ticketContent: e.detail.value })
33
+  }
34
+
35
+  const CheckForm = () => { // 校验报修单
36
+    if (DetailInfo.ticketTitle === '') {
37
+      Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
38
+      return false
39
+    }
40
+    if (DetailInfo.ticketContent === '') {
41
+      Taro.showToast({ title: `报修描述不能为空`, icon: 'none' })
42
+      return false
43
+    }
44
+    return true
45
+  }
46
+
47
+  const Send = () => { // 提交报修
48
+    if (DataLock || !CheckForm()) return
49
+    setDataLock(true)
50
+    request({
51
+      ...apis.editGongDan,
52
+      args: { id: CurrnetId },
53
+      data: {
54
+        ticketTitle: DetailInfo.ticketTitle,
55
+        ticketContent: DetailInfo.ticketContent,
56
+        type: 2
57
+      }
58
+    }).then((res) => {
59
+      Taro.showToast({ title: '报修修改成功', icon: 'none' })
60
+      Taro.redirectTo({ url: `/pages/WuYe/BaoXiuDetail/index?id=${res.id}` })
61
+      setDataLock(false)
62
+    }).catch((res) => {
63
+      Taro.showToast({ title: res, icon: 'none' })
64
+      setDataLock(false)
65
+    })
66
+  }
67
+
68
+  return (
69
+    <view className='WuYeXiuGaiBaoXiu'>
70
+      <view className='Form'>
71
+        <Input placeholder='简述你的想法' onInput={TitleChange} value={DetailInfo === null ? null : DetailInfo.ticketTitle}></Input>
72
+        <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={DescChange} value={DetailInfo === null ? null : DetailInfo.ticketContent}></Textarea>
73
+      </view>
74
+      <view className='Photo'>
75
+        <view className='Add'>
76
+          <view className='centerLabel'>
77
+            <text className='iconfont iconxiangji'></text>
78
+            <text>添加图片</text>
79
+          </view>
80
+        </view>
81
+        <view className='PhotoItem'>
82
+          <text className='iconfont iconshanchu'></text>
83
+        </view>
84
+      </view>
85
+      <view className='Btn'>
86
+        <text onClick={Send}>确认修改</text>
87
+      </view>
88
+    </view>
89
+  )
90
+}

+ 118
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.less Wyświetl plik

@@ -0,0 +1,118 @@
1
+.WuYeXiuGaiBaoXiu {
2
+  width: 100%;
3
+  position: relative;
4
+  background: #f8f8f8;
5
+  overflow: hidden;
6
+  min-height: 100%;
7
+  padding-bottom: 160px;
8
+
9
+  >.Form {
10
+    position: relative;
11
+    overflow: hidden;
12
+    padding: 0 30px;
13
+    background-color: #fff;
14
+    padding-bottom: 30px;
15
+
16
+    >input {
17
+      width: 100%;
18
+      display: block;
19
+      font-size: 32px;
20
+      color: #333;
21
+      line-height: 98px;
22
+      height: 98px;
23
+      border-bottom: 2px solid rgba(0, 0, 0, 0.08);
24
+    }
25
+
26
+    >textarea {
27
+      display: block;
28
+      font-size: 28px;
29
+      color: #999;
30
+      line-height: 40px;
31
+      margin-top: 20px;
32
+      width: 100%;
33
+    }
34
+  }
35
+
36
+  >.Photo {
37
+    padding: 30px;
38
+    padding-bottom: 10px;
39
+    position: relative;
40
+    overflow: hidden;
41
+    margin-top: 30px;
42
+    background-color: #fff;
43
+    font-size: 0;
44
+
45
+    >view {
46
+      display: inline-block;
47
+      vertical-align: middle;
48
+      width: 150px;
49
+      height: 150px;
50
+      position: relative;
51
+      overflow: hidden;
52
+      margin-right: 20px;
53
+      margin-bottom: 20px;
54
+
55
+      &.Add {
56
+
57
+        >view {
58
+          width: 100%;
59
+
60
+          >text {
61
+            display: block;
62
+            text-align: center;
63
+            width: 100%;
64
+            font-size: 28px;
65
+            color: #999;
66
+            line-height: 40px;
67
+
68
+            &:first-child {
69
+              font-size: 60px;
70
+              line-height: 80px;
71
+            }
72
+          }
73
+        }
74
+      }
75
+
76
+      &.PhotoItem {
77
+        background-color: #f8f8f8;
78
+
79
+        >image {
80
+          width: 100%;
81
+          height: 100%;
82
+          position: relative;
83
+          z-index: 1;
84
+        }
85
+
86
+        >text {
87
+          display: inline-block;
88
+          position: absolute;
89
+          z-index: 2;
90
+          right: 0px;
91
+          top: 0px;
92
+          font-size: 40px;
93
+          color: red;
94
+        }
95
+      }
96
+    }
97
+  }
98
+
99
+  >.Btn {
100
+    position: fixed;
101
+    left: 30px;
102
+    right: 30px;
103
+    z-index: 10;
104
+    overflow: hidden;
105
+    bottom: 30px;
106
+
107
+    >text {
108
+      width: 100%;
109
+      display: block;
110
+      font-size: 34px;
111
+      color: #fff;
112
+      line-height: 98px;
113
+      text-align: center;
114
+      border-radius: 98px;
115
+      background-color: #F35844;
116
+    }
117
+  }
118
+}

+ 20
- 0
src/utils/api.js Wyświetl plik

@@ -1,6 +1,22 @@
1 1
 const prefix = `${HOST}/api/wx`
2 2
 
3 3
 const $api = {
4
+  getOwnerVerifyList: { // 获取业主认证列表
5
+    method: 'get',
6
+    url: `${prefix}/user/verify/list`
7
+  },
8
+  addOwnerVerify: { // 添加业主认证
9
+    method: 'post',
10
+    url: `${prefix}/user/verify/add`
11
+  },
12
+  checkPhoneCode: { // 校验手机验证码
13
+    method: 'post',
14
+    url: `${prefix}/check/captcha`
15
+  },
16
+  getPhoneCode: { // 获取手机验证码
17
+    method: 'post',
18
+    url: `${prefix}/captcha`
19
+  },
4 20
   getRenZhengAddressList: { // 获取认证业主房产选择联动列表
5 21
     method: 'get',
6 22
     url: `${prefix}/building/select/address`
@@ -13,6 +29,10 @@ const $api = {
13 29
     method: 'get',
14 30
     url: `${prefix}/tickets/list/:orgId`
15 31
   },
32
+  editGongDan: { // 修改工单
33
+    method: 'post',
34
+    url: `${prefix}/updateTicket/:id`
35
+  },
16 36
   AddGongDan: { // 添加工单
17 37
     method: 'post',
18 38
     url: `${prefix}/addtpTicket`