张延森 преди 4 години
родител
ревизия
c1455a57a4

+ 2
- 1
config/dev.js Целия файл

@@ -3,7 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://a.t.njyunzhi.com"'
6
+    // HOST: '"https://a.t.njyunzhi.com"'
7
+    HOST: '"http://127.0.0.1:6060"'
7 8
   },
8 9
   mini: {
9 10
     debugReact: true

+ 2
- 2
src/components/WuYeBaoXiu/index.jsx Целия файл

@@ -16,9 +16,9 @@ export default function WuYeBaoXiu () {
16 16
   const [BannerList, setBannerList] = useState([])
17 17
   const [IsEmpty, setIsEmpty] = useState(false)
18 18
 
19
-  useEffect(() => {
19
+  Taro.useDidShow(() => {
20 20
     GetBanner()
21
-  }, [])
21
+  })
22 22
 
23 23
   const GetBanner = (done = () => { }) => { // 获取轮播图
24 24
     request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageSize: 1 } }).then((res) => {

+ 21
- 0
src/components/WuYeFuWu/components/IconBlock.jsx Целия файл

@@ -0,0 +1,21 @@
1
+import React, { useEffect, useState } from 'react'
2
+import './style.less'
3
+
4
+export default props => {
5
+  const handleClick = e => {
6
+    if (props.onClick) {
7
+      props.onClick(e)
8
+    }
9
+  }
10
+
11
+  return (
12
+    <view className="fw-icon-block" onClick={handleClick} style={props.style || {}}>
13
+      <view>
14
+        <view className="fw-icon-block-icon">
15
+          <image mode="" src={props.icon} />
16
+        </view>
17
+        <view className="fw-icon-block-title">{props.title}</view>
18
+      </view>
19
+    </view>
20
+  )
21
+}

+ 29
- 0
src/components/WuYeFuWu/components/style.less Целия файл

@@ -0,0 +1,29 @@
1
+
2
+.fw-icon-block {
3
+  // 26vw 是保证每行排三个
4
+  width: 26vw;
5
+  height: 26vw;
6
+  background-color: #fff;
7
+  display: flex;
8
+  justify-content: center;
9
+  align-items: center;
10
+  overflow: hidden;
11
+
12
+  &-icon {
13
+    width: 64rpx;
14
+    height: 64rpx;
15
+    margin: 0 auto;
16
+
17
+    image {
18
+      width: 100%;
19
+      height: 100%;
20
+    }
21
+  }
22
+
23
+  &-title {
24
+    margin-top: 20rpx;
25
+    color: #333;
26
+    font-size: 30rpx;
27
+    text-align: center;
28
+  }
29
+}

+ 27
- 3
src/components/WuYeFuWu/index.jsx Целия файл

@@ -7,17 +7,22 @@ import request, { apis } from '@/utils/request'
7 7
 import nav2detail from '@/utils/nav2detail'
8 8
 import '@/assets/css/reset.less'
9 9
 import '@/assets/css/iconfont.less'
10
+import IconBlock from './components/IconBlock'
10 11
 import './index.less'
11 12
 
12 13
 export default function WuYeFuWu () {
13 14
 
14 15
   const { user } = useModel('user')
16
+  const [newsTypeId, setNewsTypeId] = useState()
15 17
   const [PageList, setPageList] = useState([])
16 18
   const [BannerList, setBannerList] = useState([])
19
+  const [typeList, setTypeList] = useState([])
17 20
   const [IsEmpty, setIsEmpty] = useState(false)
18 21
 
19 22
   useEffect(() => {
20 23
     GetBanner()
24
+
25
+    request({...apis.getTpNewsList, params: {pageSize: 999}}).then(res => setTypeList(res || []))
21 26
   }, [])
22 27
 
23 28
   const GetBanner = (done = () => { }) => { // 获取轮播图
@@ -53,8 +58,13 @@ export default function WuYeFuWu () {
53 58
           }
54 59
         </view>
55 60
 
61
+        <view style={{display: 'flex', justifyContent: 'space-between'}}>
62
+          <IconBlock title="办事指南" />
63
+          <IconBlock title="政策法规" />
64
+        </view>
65
+
56 66
         {/* 物业办事指南 */}
57
-        <view className='BanShiZhiNan'>
67
+        {/* <view className='BanShiZhiNan'>
58 68
           <text>物业办事指南</text>
59 69
           <view className='flex-h'>
60 70
             <view className='Line'><view></view></view>
@@ -64,7 +74,7 @@ export default function WuYeFuWu () {
64 74
               <text>3、业主卡、住户卡办理</text>
65 75
             </view>
66 76
           </view>
67
-        </view>
77
+        </view> */}
68 78
       </view>
69 79
     )
70 80
   }
@@ -88,7 +98,7 @@ export default function WuYeFuWu () {
88 98
             </view>
89 99
 
90 100
             {/* 物业办事指南 */}
91
-            <view className='BanShiZhiNan'>
101
+            {/* <view className='BanShiZhiNan'>
92 102
               <text>物业办事指南</text>
93 103
               <view className='flex-h'>
94 104
                 <view className='Line'><view></view></view>
@@ -98,6 +108,20 @@ export default function WuYeFuWu () {
98 108
                   <text>3、业主卡、住户卡办理</text>
99 109
                 </view>
100 110
               </view>
111
+            </view> */}
112
+            
113
+            <view className="fw-icon-row">
114
+              {
115
+                typeList.map((it, ix) => (
116
+                  <IconBlock
117
+                    key={it.newsTypeId}
118
+                    title={it.newsTypeName}
119
+                    icon={it.newsTypeImg}
120
+                    style={ix > 2 ? {marginTop: '20rpx'} : {}}
121
+                    onClick={() => setNewsTypeId(it.newsTypeId)}
122
+                  />
123
+                ))
124
+              }
101 125
             </view>
102 126
           </view>
103 127
         }

+ 8
- 0
src/components/WuYeFuWu/index.less Целия файл

@@ -3,6 +3,14 @@
3 3
   height: 100%;
4 4
   position: relative;
5 5
   overflow: hidden;
6
+  background-color: #f2f2f2;
7
+
8
+  .fw-icon-row {
9
+    display: flex;
10
+    justify-content: space-around;
11
+    flex-wrap: wrap;
12
+    margin-top: 45rpx;
13
+  }
6 14
 
7 15
   .BigImg {
8 16
     width: 100%;

+ 10
- 1
src/pages.js Целия файл

@@ -110,7 +110,16 @@ const Property = [
110 110
       event: 'detail',
111 111
       eventType: 'property',
112 112
     }
113
-  }
113
+  },
114
+  {
115
+    name: '物业-生活管家',
116
+    page: 'pages/WuYe/ShengHuoGuanJia/index',
117
+    auth: ['avatar', 'phone', 'yezhu'],
118
+    track: {
119
+      event: 'detail',
120
+      eventType: 'property',
121
+    }
122
+  },
114 123
 ]
115 124
 
116 125
 const Activity = [

+ 22
- 5
src/pages/FuLi/ShangPinFilter/index.jsx Целия файл

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect } from 'react'
1
+import React, { useState, useEffect, useCallback } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { Input } from '@tarojs/components'
4 4
 import PrizeListItem from '@/components/PrizeListItem/index'
@@ -9,6 +9,18 @@ import '@/assets/css/reset.less'
9 9
 import '@/assets/css/iconfont.less'
10 10
 import './index.less'
11 11
 
12
+const debounce = (fn, delay) => {
13
+  let t
14
+
15
+  return (...args) => {
16
+    clearTimeout(t)
17
+
18
+    t = setTimeout(() => {
19
+      fn(...args)
20
+    }, delay)
21
+  }
22
+}
23
+
12 24
 export default function ShangPinFilter () {
13 25
 
14 26
   const { user } = useModel('user')
@@ -24,14 +36,19 @@ export default function ShangPinFilter () {
24 36
     setPageList(PageList.concat(e))
25 37
   }
26 38
 
27
-  const KeyChange = (e) => {
28
-    setKey(e.detail.value)
29
-  }
39
+  const KeyChange = useCallback(
40
+    debounce(e => {
41
+      setKey(e.detail.value)
42
+    }, 500), [])
30 43
 
31 44
   const SearchConfirm = () => {
32 45
     setSearchKey(Key)
33 46
   }
34 47
 
48
+  useEffect(() => {
49
+    setSearchKey(Key)
50
+  }, [Key])
51
+
35 52
   return (
36 53
     <Page>
37 54
       <view className='ShangPinFilter flex-v'>
@@ -44,7 +61,7 @@ export default function ShangPinFilter () {
44 61
           </view>
45 62
         </view>
46 63
         <view className='flex-item'>
47
-          <ScrollPageRefresh SearchKey={SearchKey} RequestParams={{key: SearchKey}} ApiName={`getGoodsList`} Refresh={Refresh} Push={Push}>
64
+          <ScrollPageRefresh SearchKey={SearchKey} RequestParams={{goodsName: SearchKey}} ApiName={`getGoodsList`} Refresh={Refresh} Push={Push}>
48 65
             <view className='PirzeList'>
49 66
               {
50 67
                 PageList.map((item, index) => (

+ 2
- 2
src/pages/FuLi/ShangPinXiangQing/index.jsx Целия файл

@@ -37,7 +37,7 @@ export default function ShangPinXiangQing () {
37 37
       <view className='ShangPinXiangQing'>
38 38
         <view className='Info'>
39 39
           <view className='Img'>
40
-            <image mode='aspectFill' src={GoodsDetail === null ? null : GoodsDetail.imgUrl} className='centerLabel'></image>
40
+            <image mode='aspectFit' src={GoodsDetail === null ? null : GoodsDetail.imgUrl}></image>
41 41
           </view>
42 42
           <view className='Title'>
43 43
             <text>{GoodsDetail === null ? '' : GoodsDetail.goodsName}</text>
@@ -54,7 +54,7 @@ export default function ShangPinXiangQing () {
54 54
             <view className='Line'></view>
55 55
             <text>产品详情</text>
56 56
           </view>
57
-          <image mode='widthFix' src={GoodsDetail === null ? null : GoodsDetail.detailImgUrl} style={{ width: `100%` }}></image>
57
+          <image mode='aspectFit' src={GoodsDetail === null ? null : GoodsDetail.detailImgUrl} style={{ width: `100%` }}></image>
58 58
           <view className='BottomBtn'>
59 59
             <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/FuLi/ShangPinDuiHuan/index?id=${CurrnetId}` }) }}>立即兑换</text>
60 60
           </view>

+ 6
- 6
src/pages/FuLi/ShangPinXiangQing/index.less Целия файл

@@ -1,9 +1,10 @@
1 1
 .ShangPinXiangQing {
2
-  width: 100%;
2
+  width: calc(100% -32rpx);
3 3
   min-height: 100%;
4 4
   position: relative;
5 5
   overflow: hidden;
6 6
   background: #f8f8f8;
7
+  padding: 0 16rpx;
7 8
 
8 9
   >.Info {
9 10
     position: relative;
@@ -12,14 +13,13 @@
12 13
 
13 14
     >.Img {
14 15
       width: 100%;
15
-      padding-bottom: 50%;
16
-      background: #ccc;
17
-      position: relative;
18
-      overflow: hidden;
16
+      // padding-bottom: 50%;
17
+      // background: #ccc;
18
+      // position: relative;
19
+      // overflow: hidden;
19 20
 
20 21
       >image {
21 22
         width: 100%;
22
-        height: 100%;
23 23
       }
24 24
     }
25 25
 

+ 17
- 9
src/pages/WuYe/BaoXiuQuYu/index.jsx Целия файл

@@ -1,17 +1,23 @@
1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import Page from '@/layouts'
4
+import request, { apis } from '@/utils/request'
4 5
 import '@/assets/css/reset.less'
5 6
 import '@/assets/css/iconfont.less'
6 7
 import './index.less'
7 8
 
8 9
 export default function WuYeBaoXiuQuYu () {
10
+  const [TypeList, setTypeList] = useState([])
9 11
 
10
-  const [TypeList] = useState([
11
-    { icon: 'icongonggongquyu', name: '公共区域问题', desc: '如绿植被破坏、楼道灯不亮等问题', id: 1 },
12
-    { icon: 'iconfangwuzhiliang', name: '房屋质量问题', desc: '如家中墙体开裂、墙皮脱落等问题', id: 2 },
13
-    { icon: 'iconhuneisheshi', name: '户内设施问题', desc: '如通浴室下水道、保洁等可能需要收费的项目', id: 3 }
14
-  ])
12
+  const handleClick = item => {
13
+    Taro.redirectTo({ url: `/pages/WuYe/TianJiaBaoXiu/index?type=${item.typeId}` })
14
+  }
15
+  
16
+  useEffect(() => {
17
+    request({...apis.getRepairTypeList, params: {pageSize: 999}}).then(res => {
18
+      setTypeList(res.records)
19
+    })
20
+  }, [])
15 21
 
16 22
   return (
17 23
     <Page>
@@ -19,10 +25,12 @@ export default function WuYeBaoXiuQuYu () {
19 25
         {
20 26
           TypeList.map((item, index) => (
21 27
             <view key={`WuYeBaoXiuQuYu-${index}`}>
22
-              <view onClick={() => { Taro.redirectTo({ url: `/pages/WuYe/TianJiaBaoXiu/index?type=${item.id}` }) }}>
28
+              <view onClick={() => handleClick(item)}>
23 29
                 <view>
24
-                  <text className={`iconfont ${item.icon}`}></text>
25
-                  <text>{item.name}</text>
30
+                  {
31
+                    item.icon && <image mode="aspectFit" src={item.icon} style={{width: '32rpx', height: '32rpx', verticalAlign: 'middle', marginRight: '16rpx'}} />
32
+                  }
33
+                  <text>{item.typeName}</text>
26 34
                 </view>
27 35
                 <text>{item.desc}</text>
28 36
               </view>

+ 6
- 6
src/pages/WuYe/BaoXiuQuYu/index.less Целия файл

@@ -44,12 +44,12 @@
44 44
           font-weight: bold;
45 45
           line-height: 60px;
46 46
 
47
-          &:first-child {
48
-            font-weight: normal;
49
-            font-size: 40px;
50
-            color: #F35844;
51
-            margin-right: 20px;
52
-          }
47
+          // &:first-child {
48
+          //   font-weight: normal;
49
+          //   font-size: 40px;
50
+          //   color: #F35844;
51
+          //   margin-right: 20px;
52
+          // }
53 53
         }
54 54
       }
55 55
 

+ 18
- 0
src/pages/WuYe/ShengHuoGuanJia/components/Btn.jsx Целия файл

@@ -0,0 +1,18 @@
1
+import React, { useEffect, useState } from 'react'
2
+import './style.less'
3
+
4
+export default props => {
5
+  // const [] = useState()
6
+
7
+
8
+  // useEffect(() => {
9
+
10
+  // }, [])
11
+
12
+
13
+  return (
14
+    <view className="gj-btn" onClick={props.onClick}>
15
+      {props.children}
16
+    </view>
17
+  )
18
+}

+ 45
- 0
src/pages/WuYe/ShengHuoGuanJia/components/Card.jsx Целия файл

@@ -0,0 +1,45 @@
1
+import React, { useEffect, useState } from 'react'
2
+import LR from './LR'
3
+import Btn from './Btn'
4
+import './style.less'
5
+
6
+export default props => {
7
+
8
+  const handleClick = () => {
9
+    if (props.onClick) {
10
+      props.onClick(props.dataSource)
11
+    }
12
+  }
13
+
14
+  const handleAction = () => {
15
+    if (props.onAction) {
16
+      props.onAction(props.dataSource)
17
+    }
18
+  }
19
+
20
+  const data = props.dataSource || {}
21
+
22
+  return (
23
+    <view className="gj-card">
24
+      <view className="gj-card-body" onClick={handleClick}>
25
+        <view className="gj-card-body-media">
26
+          <image mode="" src={data.photo} />
27
+        </view>
28
+        <view className="gj-card-content">
29
+          <LR title="管家姓名">{data.userName || ''}</LR>
30
+          <LR title="联系方式">{data.phone || ''}</LR>
31
+          <LR title="管家说明">{data.description || ''}</LR>
32
+          <LR title="综合评价"></LR>
33
+        </view>
34
+      </view>
35
+      <view className="gj-card-footer">
36
+        <view>
37
+          {`工号: ${data.jobNumber || ''}`}
38
+        </view>
39
+        <view className="gj-card-footer-action" style={{textAlign: 'right'}}>
40
+          <Btn onClick={handleAction}>评星</Btn>
41
+        </view>
42
+      </view>
43
+    </view>
44
+  )
45
+}

+ 19
- 0
src/pages/WuYe/ShengHuoGuanJia/components/LR.jsx Целия файл

@@ -0,0 +1,19 @@
1
+import React, { useEffect, useState } from 'react'
2
+import './style.less'
3
+
4
+export default props => {
5
+  // const [] = useState()
6
+
7
+
8
+  // useEffect(() => {
9
+
10
+  // }, [])
11
+
12
+
13
+  return (
14
+    <view className="gj-lr">
15
+      <view className="gj-lr-left">{`${props.title}: `}</view>
16
+      <view className="gj-lr-right">{props.children}</view>
17
+    </view>
18
+  )
19
+}

+ 77
- 0
src/pages/WuYe/ShengHuoGuanJia/components/style.less Целия файл

@@ -0,0 +1,77 @@
1
+
2
+.gj-card {
3
+  font-size: 28rpx;
4
+  padding: 0 30rpx;
5
+  background: #FFFFFF;
6
+  border-radius: 12rpx;
7
+
8
+  &-body {
9
+    padding-top: 30rpx;
10
+    display: flex;
11
+
12
+    &-media {
13
+      width: 210rpx;
14
+      height: 294rpx;
15
+      flex: none;
16
+      margin-right: 30rpx;
17
+
18
+      image {
19
+        width: 100%;
20
+        height: 100%;
21
+      }
22
+    }
23
+
24
+    &-content {
25
+      flex: auto;
26
+    }
27
+  }
28
+
29
+  &-footer {
30
+    padding-left: 30rpx;
31
+    line-height: 90rpx;
32
+    display: flex;
33
+    align-items: center;
34
+
35
+    view {
36
+      flex: auto;
37
+    }
38
+
39
+    &-action {
40
+      width: 150rpx;
41
+      flex: none;
42
+    }
43
+
44
+  }
45
+
46
+  & + .gj-card {
47
+    margin-top: 30rpx;
48
+  }
49
+}
50
+
51
+.gj-lr {
52
+  display: flex;
53
+  color: #333;
54
+  font-size: 28rpx;
55
+  line-height: 60rpx;
56
+
57
+  &-left {
58
+    width: 120rpx;
59
+    flex: none;
60
+  }
61
+
62
+  &-right {
63
+    flex: auto;
64
+  }
65
+}
66
+
67
+.gj-btn {
68
+  display: inline-block;
69
+  padding: 0 30rpx;
70
+  min-width: 65rpx;
71
+  color: #F35844;
72
+  font-size: 30rpx;
73
+  line-height: 60rpx;
74
+  text-align: center;
75
+  border: 1px solid #F35844;
76
+  border-radius: 30px;
77
+}

+ 4
- 0
src/pages/WuYe/ShengHuoGuanJia/index.config.js Целия файл

@@ -0,0 +1,4 @@
1
+export default {
2
+  navigationBarTitleText: '生活管家',
3
+  // enablePullDownRefresh: true
4
+}

+ 43
- 0
src/pages/WuYe/ShengHuoGuanJia/index.jsx Целия файл

@@ -0,0 +1,43 @@
1
+import React, { useEffect, useState } from 'react'
2
+import Taro from '@tarojs/taro'
3
+import Page from '@/layouts/index'
4
+import Card from './components/Card'
5
+import { useModel } from '@/store'
6
+import request, { apis } from '@/utils/request'
7
+import './index.less'
8
+
9
+export default props => {
10
+  // const [loading, setLoading] = useState(false)
11
+  const [listData, setListData] = useState([])
12
+  const [queryParams, setQueryParams] = useState({pageNum:1, pageSize: 10})
13
+  const { user } = useModel('user')
14
+
15
+  // 要获取新数据
16
+  // 只需要更新 queryParams 即可
17
+  Taro.usePullDownRefresh(() => {
18
+    setQueryParams({
19
+      ...queryParams,
20
+      pageNum: 1,
21
+      pageSize: 10
22
+    })
23
+  })
24
+
25
+  useEffect(() => {
26
+    if (user && user.personId && !listData.length) {
27
+      request({...apis.getShengHuoGuanJiaList, params: queryParams}).then(res => {
28
+        const { records } = res
29
+        setListData(records || [])
30
+      })
31
+    }
32
+  }, [user, queryParams])
33
+
34
+  return (
35
+    <Page>
36
+      <view className="shgj">
37
+      {
38
+        listData.map(item => <Card key={item.userId} dataSource={item} />)
39
+      }
40
+      </view>
41
+    </Page>
42
+  )
43
+}

+ 6
- 0
src/pages/WuYe/ShengHuoGuanJia/index.less Целия файл

@@ -0,0 +1,6 @@
1
+.shgj {
2
+  width: calc(100vw - 60rpx);
3
+  height: calc(100vh - 60rpx);
4
+  background-color: #f2f2f2;
5
+  padding: 30rpx;
6
+}

+ 22
- 14
src/pages/WuYe/TianJiaBaoXiu/index.jsx Целия файл

@@ -1,8 +1,9 @@
1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2 2
 import Taro, { Current } from '@tarojs/taro'
3 3
 import { Input, Textarea } from '@tarojs/components'
4 4
 import request, { apis } from '@/utils/request'
5 5
 import Page from '@/layouts'
6
+import { useModel } from '@/store'
6 7
 import '@/assets/css/reset.less'
7 8
 import '@/assets/css/iconfont.less'
8 9
 import './index.less'
@@ -12,8 +13,10 @@ export default function WuYeTianJiaBaoXiu () {
12 13
   const [Title, setTitle] = useState('')
13 14
   const [Desc, setDesc] = useState('')
14 15
   const [DataLock, setDataLock] = useState(false)
15
-  const [CurrnetBaoXiuType] = useState(Current.router.params.type)
16 16
   const [PhotoUrl, setPhotoUrl] = useState(null)
17
+  const [repairType, setRepairType] = useState()
18
+
19
+  const rpType = Current.router.params.type
17 20
 
18 21
   const TitleChange = (e) => {
19 22
     setTitle(e.detail.value)
@@ -28,10 +31,10 @@ export default function WuYeTianJiaBaoXiu () {
28 31
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
29 32
       return false
30 33
     }
31
-    if (Desc === '') {
32
-      Taro.showToast({ title: `报修描述不能为空`, icon: 'none' })
33
-      return false
34
-    }
34
+    // if (Desc === '') {
35
+    //   Taro.showToast({ title: `报修描述不能为空`, icon: 'none' })
36
+    //   return false
37
+    // }
35 38
     return true
36 39
   }
37 40
 
@@ -44,7 +47,7 @@ export default function WuYeTianJiaBaoXiu () {
44 47
         ticketTitle: Title,
45 48
         ticketContent: Desc,
46 49
         type: 2,
47
-        repairType: [CurrnetBaoXiuType] - 0,
50
+        repairType: repairType.typeId,
48 51
         imageUrl: PhotoUrl
49 52
       }
50 53
     }).then((res) => {
@@ -82,19 +85,24 @@ export default function WuYeTianJiaBaoXiu () {
82 85
     setPhotoUrl(null)
83 86
   }
84 87
 
88
+  useEffect(() => {
89
+    if (rpType) {
90
+      request({...apis.getRepairTypeDetail, args: {id: rpType}}).then(res => {
91
+        setRepairType(res)
92
+      })
93
+    }
94
+  }, [rpType])
95
+
85 96
   return (
86 97
     <Page>
87 98
       <view className='WuYeTianJiaBaoXiu'>
88 99
         <view className='Form'>
89 100
           {/* <Input placeholder='简述你的想法' onInput={TitleChange} value={Title}></Input> */}
90
-          <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={DescChange} value={Desc}></Textarea>
101
+          <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={TitleChange} value={Title}></Textarea>
91 102
           <view className='LabelList'>
92
-            <text>问题</text>
93
-            <text>问题</text>
94
-            <text>问题</text>
95
-            <text>问题</text>
96
-            <text>问题</text>
97
-            <text>问题</text>
103
+            {
104
+              (repairType || {tags: ''}).tags.split(',').map(tag => <text key={tag} onClick={() => setTitle(tag)}>{tag}</text>)
105
+            }
98 106
           </view>
99 107
         </view>
100 108
         <view className='Photo'>

+ 23
- 7
src/pages/WuYe/XiuGaiBaoXiu/index.jsx Целия файл

@@ -15,6 +15,7 @@ export default function WuYeXiuGaiBaoXiu () {
15 15
   const [DetailInfo, setDetailInfo] = useState(null)
16 16
   const [CurrnetId] = useState(Current.router.params.id)
17 17
   const [PhotoUrl, setPhotoUrl] = useState(null)
18
+  const [repairType, setRepairType] = useState()
18 19
 
19 20
   useEffect(() => {
20 21
     Init()
@@ -27,8 +28,12 @@ export default function WuYeXiuGaiBaoXiu () {
27 28
     })
28 29
   }
29 30
 
31
+  const handleTitleChange = ticketTitle => {
32
+    setDetailInfo({ ...DetailInfo, ticketTitle })
33
+  }
34
+
30 35
   const TitleChange = (e) => {
31
-    setDetailInfo({ ...DetailInfo, ticketTitle: e.detail.value })
36
+    handleTitleChange(e.detail.value)
32 37
   }
33 38
 
34 39
   const DescChange = (e) => {
@@ -40,10 +45,10 @@ export default function WuYeXiuGaiBaoXiu () {
40 45
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
41 46
       return false
42 47
     }
43
-    if (DetailInfo.ticketContent === '') {
44
-      Taro.showToast({ title: `报修描述不能为空`, icon: 'none' })
45
-      return false
46
-    }
48
+    // if (DetailInfo.ticketContent === '') {
49
+    //   Taro.showToast({ title: `报修描述不能为空`, icon: 'none' })
50
+    //   return false
51
+    // }
47 52
     return true
48 53
   }
49 54
 
@@ -94,12 +99,23 @@ export default function WuYeXiuGaiBaoXiu () {
94 99
     setPhotoUrl(null)
95 100
   }
96 101
 
102
+  useEffect(() => {
103
+    if (DetailInfo && DetailInfo.repairType) {
104
+      request({...apis.getRepairTypeDetail, args: {id: DetailInfo.repairType}}).then(res => setRepairType(res))
105
+    }
106
+  }, [DetailInfo])
107
+
97 108
   return (
98 109
     <Page>
99 110
       <view className='WuYeXiuGaiBaoXiu'>
100 111
         <view className='Form'>
101
-          <Input placeholder='简述你的想法' onInput={TitleChange} value={DetailInfo === null ? null : DetailInfo.ticketTitle}></Input>
102
-          <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={DescChange} value={DetailInfo === null ? null : DetailInfo.ticketContent}></Textarea>
112
+          {/* <Input placeholder='简述你的想法' onInput={TitleChange} value={DetailInfo === null ? null : DetailInfo.ticketTitle}></Input> */}
113
+          <Textarea placeholder='描述问题详情,以便我们更好的相处' onInput={TitleChange} value={DetailInfo === null ? null : DetailInfo.ticketTitle}></Textarea>
114
+          <view className='LabelList'>
115
+            {
116
+              (repairType || {tags: ''}).tags.split(',').map(tag => <text key={tag} onClick={() => handleTitleChange(tag)}>{tag}</text>)
117
+            }
118
+          </view>
103 119
         </view>
104 120
         <view className='Photo'>
105 121
           <view className='Add' onClick={AddImg}>

+ 22
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.less Целия файл

@@ -31,6 +31,28 @@
31 31
       margin-top: 20px;
32 32
       width: 100%;
33 33
     }
34
+    
35
+    >.LabelList {
36
+      width: 100%;
37
+      position: relative;
38
+      overflow: hidden;
39
+      font-size: 0;
40
+      border-top: 2px solid rgba(0, 0, 0, 0.08);
41
+      padding-top: 10px;
42
+
43
+      >text {
44
+        font-size: 24px;
45
+        color: #666;
46
+        line-height: 48px;
47
+        border: 2px solid rgba(0, 0, 0, 0.08);
48
+        padding: 0 20px;
49
+        border-radius: 6px;
50
+        margin-right: 10px;
51
+        margin-top: 10px;
52
+        display: inline-block;
53
+        vertical-align: middle;
54
+      }
55
+    }
34 56
   }
35 57
 
36 58
   >.Photo {

+ 1
- 1
src/store/models/index.js Целия файл

@@ -7,7 +7,7 @@ const models = {
7 7
   'appParams': useAppParams,
8 8
   'sys': useSystem,
9 9
   'user': useUser,
10
-  'screen': useScreen
10
+  'screen': useScreen,
11 11
 }
12 12
 
13 13
 export default models

+ 21
- 0
src/utils/api.js Целия файл

@@ -17,6 +17,12 @@ const $api = {
17 17
     method: 'get',
18 18
     url: `${prefix}/user/info`
19 19
   },
20
+
21
+  getTpNewsList: {
22
+    method: 'get',
23
+    url: `${prefix}/tpNewsType/list`
24
+  },
25
+
20 26
   getWuYeFuWuDetail: { // 获取物业服务详情
21 27
     method: 'get',
22 28
     url: `${prefix}/property-news/:id`
@@ -97,6 +103,21 @@ const $api = {
97 103
     url: `${prefix}/wxUnifiedOrder/:outTradeNo`
98 104
   },
99 105
 
106
+  getRepairTypeList: {
107
+    method: 'get',
108
+    url: `${prefix}/tpRepairType`
109
+  },
110
+  
111
+  getRepairTypeDetail: {
112
+    method: 'get',
113
+    url: `${prefix}/tpRepairType/:id`
114
+  },
115
+
116
+  getShengHuoGuanJiaList: {
117
+    method: 'get',
118
+    url: `${prefix}/life-consultant/list`
119
+  },
120
+
100 121
   getGongDanList: { // 获取小区工单列表
101 122
     method: 'get',
102 123
     url: `${prefix}/tickets/list/:orgId`