张延森 4 years ago
parent
commit
c1455a57a4

+ 2
- 1
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
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
   mini: {
9
   mini: {
9
     debugReact: true
10
     debugReact: true

+ 2
- 2
src/components/WuYeBaoXiu/index.jsx View File

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

+ 21
- 0
src/components/WuYeFuWu/components/IconBlock.jsx View File

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 View File

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 View File

7
 import nav2detail from '@/utils/nav2detail'
7
 import nav2detail from '@/utils/nav2detail'
8
 import '@/assets/css/reset.less'
8
 import '@/assets/css/reset.less'
9
 import '@/assets/css/iconfont.less'
9
 import '@/assets/css/iconfont.less'
10
+import IconBlock from './components/IconBlock'
10
 import './index.less'
11
 import './index.less'
11
 
12
 
12
 export default function WuYeFuWu () {
13
 export default function WuYeFuWu () {
13
 
14
 
14
   const { user } = useModel('user')
15
   const { user } = useModel('user')
16
+  const [newsTypeId, setNewsTypeId] = useState()
15
   const [PageList, setPageList] = useState([])
17
   const [PageList, setPageList] = useState([])
16
   const [BannerList, setBannerList] = useState([])
18
   const [BannerList, setBannerList] = useState([])
19
+  const [typeList, setTypeList] = useState([])
17
   const [IsEmpty, setIsEmpty] = useState(false)
20
   const [IsEmpty, setIsEmpty] = useState(false)
18
 
21
 
19
   useEffect(() => {
22
   useEffect(() => {
20
     GetBanner()
23
     GetBanner()
24
+
25
+    request({...apis.getTpNewsList, params: {pageSize: 999}}).then(res => setTypeList(res || []))
21
   }, [])
26
   }, [])
22
 
27
 
23
   const GetBanner = (done = () => { }) => { // 获取轮播图
28
   const GetBanner = (done = () => { }) => { // 获取轮播图
53
           }
58
           }
54
         </view>
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
           <text>物业办事指南</text>
68
           <text>物业办事指南</text>
59
           <view className='flex-h'>
69
           <view className='flex-h'>
60
             <view className='Line'><view></view></view>
70
             <view className='Line'><view></view></view>
64
               <text>3、业主卡、住户卡办理</text>
74
               <text>3、业主卡、住户卡办理</text>
65
             </view>
75
             </view>
66
           </view>
76
           </view>
67
-        </view>
77
+        </view> */}
68
       </view>
78
       </view>
69
     )
79
     )
70
   }
80
   }
88
             </view>
98
             </view>
89
 
99
 
90
             {/* 物业办事指南 */}
100
             {/* 物业办事指南 */}
91
-            <view className='BanShiZhiNan'>
101
+            {/* <view className='BanShiZhiNan'>
92
               <text>物业办事指南</text>
102
               <text>物业办事指南</text>
93
               <view className='flex-h'>
103
               <view className='flex-h'>
94
                 <view className='Line'><view></view></view>
104
                 <view className='Line'><view></view></view>
98
                   <text>3、业主卡、住户卡办理</text>
108
                   <text>3、业主卡、住户卡办理</text>
99
                 </view>
109
                 </view>
100
               </view>
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
             </view>
125
             </view>
102
           </view>
126
           </view>
103
         }
127
         }

+ 8
- 0
src/components/WuYeFuWu/index.less View File

3
   height: 100%;
3
   height: 100%;
4
   position: relative;
4
   position: relative;
5
   overflow: hidden;
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
   .BigImg {
15
   .BigImg {
8
     width: 100%;
16
     width: 100%;

+ 10
- 1
src/pages.js View File

110
       event: 'detail',
110
       event: 'detail',
111
       eventType: 'property',
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
 const Activity = [
125
 const Activity = [

+ 22
- 5
src/pages/FuLi/ShangPinFilter/index.jsx View File

1
-import React, { useState, useEffect } from 'react'
1
+import React, { useState, useEffect, useCallback } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { Input } from '@tarojs/components'
3
 import { Input } from '@tarojs/components'
4
 import PrizeListItem from '@/components/PrizeListItem/index'
4
 import PrizeListItem from '@/components/PrizeListItem/index'
9
 import '@/assets/css/iconfont.less'
9
 import '@/assets/css/iconfont.less'
10
 import './index.less'
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
 export default function ShangPinFilter () {
24
 export default function ShangPinFilter () {
13
 
25
 
14
   const { user } = useModel('user')
26
   const { user } = useModel('user')
24
     setPageList(PageList.concat(e))
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
   const SearchConfirm = () => {
44
   const SearchConfirm = () => {
32
     setSearchKey(Key)
45
     setSearchKey(Key)
33
   }
46
   }
34
 
47
 
48
+  useEffect(() => {
49
+    setSearchKey(Key)
50
+  }, [Key])
51
+
35
   return (
52
   return (
36
     <Page>
53
     <Page>
37
       <view className='ShangPinFilter flex-v'>
54
       <view className='ShangPinFilter flex-v'>
44
           </view>
61
           </view>
45
         </view>
62
         </view>
46
         <view className='flex-item'>
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
             <view className='PirzeList'>
65
             <view className='PirzeList'>
49
               {
66
               {
50
                 PageList.map((item, index) => (
67
                 PageList.map((item, index) => (

+ 2
- 2
src/pages/FuLi/ShangPinXiangQing/index.jsx View File

37
       <view className='ShangPinXiangQing'>
37
       <view className='ShangPinXiangQing'>
38
         <view className='Info'>
38
         <view className='Info'>
39
           <view className='Img'>
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
           </view>
41
           </view>
42
           <view className='Title'>
42
           <view className='Title'>
43
             <text>{GoodsDetail === null ? '' : GoodsDetail.goodsName}</text>
43
             <text>{GoodsDetail === null ? '' : GoodsDetail.goodsName}</text>
54
             <view className='Line'></view>
54
             <view className='Line'></view>
55
             <text>产品详情</text>
55
             <text>产品详情</text>
56
           </view>
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
           <view className='BottomBtn'>
58
           <view className='BottomBtn'>
59
             <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/FuLi/ShangPinDuiHuan/index?id=${CurrnetId}` }) }}>立即兑换</text>
59
             <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/FuLi/ShangPinDuiHuan/index?id=${CurrnetId}` }) }}>立即兑换</text>
60
           </view>
60
           </view>

+ 6
- 6
src/pages/FuLi/ShangPinXiangQing/index.less View File

1
 .ShangPinXiangQing {
1
 .ShangPinXiangQing {
2
-  width: 100%;
2
+  width: calc(100% -32rpx);
3
   min-height: 100%;
3
   min-height: 100%;
4
   position: relative;
4
   position: relative;
5
   overflow: hidden;
5
   overflow: hidden;
6
   background: #f8f8f8;
6
   background: #f8f8f8;
7
+  padding: 0 16rpx;
7
 
8
 
8
   >.Info {
9
   >.Info {
9
     position: relative;
10
     position: relative;
12
 
13
 
13
     >.Img {
14
     >.Img {
14
       width: 100%;
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
       >image {
21
       >image {
21
         width: 100%;
22
         width: 100%;
22
-        height: 100%;
23
       }
23
       }
24
     }
24
     }
25
 
25
 

+ 17
- 9
src/pages/WuYe/BaoXiuQuYu/index.jsx View File

1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import Page from '@/layouts'
3
 import Page from '@/layouts'
4
+import request, { apis } from '@/utils/request'
4
 import '@/assets/css/reset.less'
5
 import '@/assets/css/reset.less'
5
 import '@/assets/css/iconfont.less'
6
 import '@/assets/css/iconfont.less'
6
 import './index.less'
7
 import './index.less'
7
 
8
 
8
 export default function WuYeBaoXiuQuYu () {
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
   return (
22
   return (
17
     <Page>
23
     <Page>
19
         {
25
         {
20
           TypeList.map((item, index) => (
26
           TypeList.map((item, index) => (
21
             <view key={`WuYeBaoXiuQuYu-${index}`}>
27
             <view key={`WuYeBaoXiuQuYu-${index}`}>
22
-              <view onClick={() => { Taro.redirectTo({ url: `/pages/WuYe/TianJiaBaoXiu/index?type=${item.id}` }) }}>
28
+              <view onClick={() => handleClick(item)}>
23
                 <view>
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
                 </view>
34
                 </view>
27
                 <text>{item.desc}</text>
35
                 <text>{item.desc}</text>
28
               </view>
36
               </view>

+ 6
- 6
src/pages/WuYe/BaoXiuQuYu/index.less View File

44
           font-weight: bold;
44
           font-weight: bold;
45
           line-height: 60px;
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 View File

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 View File

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 View File

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 View File

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 View File

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

+ 43
- 0
src/pages/WuYe/ShengHuoGuanJia/index.jsx View File

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 View File

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 View File

1
-import React, { useState } from 'react'
1
+import React, { useState, useEffect } from 'react'
2
 import Taro, { Current } from '@tarojs/taro'
2
 import Taro, { Current } from '@tarojs/taro'
3
 import { Input, Textarea } from '@tarojs/components'
3
 import { Input, Textarea } from '@tarojs/components'
4
 import request, { apis } from '@/utils/request'
4
 import request, { apis } from '@/utils/request'
5
 import Page from '@/layouts'
5
 import Page from '@/layouts'
6
+import { useModel } from '@/store'
6
 import '@/assets/css/reset.less'
7
 import '@/assets/css/reset.less'
7
 import '@/assets/css/iconfont.less'
8
 import '@/assets/css/iconfont.less'
8
 import './index.less'
9
 import './index.less'
12
   const [Title, setTitle] = useState('')
13
   const [Title, setTitle] = useState('')
13
   const [Desc, setDesc] = useState('')
14
   const [Desc, setDesc] = useState('')
14
   const [DataLock, setDataLock] = useState(false)
15
   const [DataLock, setDataLock] = useState(false)
15
-  const [CurrnetBaoXiuType] = useState(Current.router.params.type)
16
   const [PhotoUrl, setPhotoUrl] = useState(null)
16
   const [PhotoUrl, setPhotoUrl] = useState(null)
17
+  const [repairType, setRepairType] = useState()
18
+
19
+  const rpType = Current.router.params.type
17
 
20
 
18
   const TitleChange = (e) => {
21
   const TitleChange = (e) => {
19
     setTitle(e.detail.value)
22
     setTitle(e.detail.value)
28
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
31
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
29
       return false
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
     return true
38
     return true
36
   }
39
   }
37
 
40
 
44
         ticketTitle: Title,
47
         ticketTitle: Title,
45
         ticketContent: Desc,
48
         ticketContent: Desc,
46
         type: 2,
49
         type: 2,
47
-        repairType: [CurrnetBaoXiuType] - 0,
50
+        repairType: repairType.typeId,
48
         imageUrl: PhotoUrl
51
         imageUrl: PhotoUrl
49
       }
52
       }
50
     }).then((res) => {
53
     }).then((res) => {
82
     setPhotoUrl(null)
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
   return (
96
   return (
86
     <Page>
97
     <Page>
87
       <view className='WuYeTianJiaBaoXiu'>
98
       <view className='WuYeTianJiaBaoXiu'>
88
         <view className='Form'>
99
         <view className='Form'>
89
           {/* <Input placeholder='简述你的想法' onInput={TitleChange} value={Title}></Input> */}
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
           <view className='LabelList'>
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
           </view>
106
           </view>
99
         </view>
107
         </view>
100
         <view className='Photo'>
108
         <view className='Photo'>

+ 23
- 7
src/pages/WuYe/XiuGaiBaoXiu/index.jsx View File

15
   const [DetailInfo, setDetailInfo] = useState(null)
15
   const [DetailInfo, setDetailInfo] = useState(null)
16
   const [CurrnetId] = useState(Current.router.params.id)
16
   const [CurrnetId] = useState(Current.router.params.id)
17
   const [PhotoUrl, setPhotoUrl] = useState(null)
17
   const [PhotoUrl, setPhotoUrl] = useState(null)
18
+  const [repairType, setRepairType] = useState()
18
 
19
 
19
   useEffect(() => {
20
   useEffect(() => {
20
     Init()
21
     Init()
27
     })
28
     })
28
   }
29
   }
29
 
30
 
31
+  const handleTitleChange = ticketTitle => {
32
+    setDetailInfo({ ...DetailInfo, ticketTitle })
33
+  }
34
+
30
   const TitleChange = (e) => {
35
   const TitleChange = (e) => {
31
-    setDetailInfo({ ...DetailInfo, ticketTitle: e.detail.value })
36
+    handleTitleChange(e.detail.value)
32
   }
37
   }
33
 
38
 
34
   const DescChange = (e) => {
39
   const DescChange = (e) => {
40
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
45
       Taro.showToast({ title: `报修标题不能为空`, icon: 'none' })
41
       return false
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
     return true
52
     return true
48
   }
53
   }
49
 
54
 
94
     setPhotoUrl(null)
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
   return (
108
   return (
98
     <Page>
109
     <Page>
99
       <view className='WuYeXiuGaiBaoXiu'>
110
       <view className='WuYeXiuGaiBaoXiu'>
100
         <view className='Form'>
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
         </view>
119
         </view>
104
         <view className='Photo'>
120
         <view className='Photo'>
105
           <view className='Add' onClick={AddImg}>
121
           <view className='Add' onClick={AddImg}>

+ 22
- 0
src/pages/WuYe/XiuGaiBaoXiu/index.less View File

31
       margin-top: 20px;
31
       margin-top: 20px;
32
       width: 100%;
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
   >.Photo {
58
   >.Photo {

+ 1
- 1
src/store/models/index.js View File

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

+ 21
- 0
src/utils/api.js View File

17
     method: 'get',
17
     method: 'get',
18
     url: `${prefix}/user/info`
18
     url: `${prefix}/user/info`
19
   },
19
   },
20
+
21
+  getTpNewsList: {
22
+    method: 'get',
23
+    url: `${prefix}/tpNewsType/list`
24
+  },
25
+
20
   getWuYeFuWuDetail: { // 获取物业服务详情
26
   getWuYeFuWuDetail: { // 获取物业服务详情
21
     method: 'get',
27
     method: 'get',
22
     url: `${prefix}/property-news/:id`
28
     url: `${prefix}/property-news/:id`
97
     url: `${prefix}/wxUnifiedOrder/:outTradeNo`
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
   getGongDanList: { // 获取小区工单列表
121
   getGongDanList: { // 获取小区工单列表
101
     method: 'get',
122
     method: 'get',
102
     url: `${prefix}/tickets/list/:orgId`
123
     url: `${prefix}/tickets/list/:orgId`