Преглед на файлове

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

zlisen преди 3 години
родител
ревизия
42ce5ae9c4
променени са 5 файла, в които са добавени 89 реда и са изтрити 7 реда
  1. 5
    0
      config/routes.js
  2. 0
    2
      src/pages/carouselFigure/customImg/list.jsx
  3. 5
    5
      src/pages/customer/Customer/style.less
  4. 67
    0
      src/pages/findRoom/setting/index.jsx
  5. 12
    0
      src/services/apis.js

+ 5
- 0
config/routes.js Целия файл

@@ -544,6 +544,11 @@ export default [
544 544
                 hideInMenu: true,
545 545
                 component: './findRoom/addedValueService/audit',
546 546
               },
547
+              {
548
+                path: '/findRoom/setting',
549
+                name: '回访设置',
550
+                component: './findRoom/setting',
551
+              },
547 552
               // {
548 553
               //   path: '/home/recommend/auditcopy',
549 554
               //   name: '回访确认',

+ 0
- 2
src/pages/carouselFigure/customImg/list.jsx Целия файл

@@ -27,10 +27,8 @@ function header(props) {
27 27
       } else {
28 28
         setData([
29 29
           { 'imgUrl': 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg', 'imgType': 'index', 'imgDesc': '小程序首页分享配图' },
30
-          { 'imgUrl': 'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png', 'imgType': 'indexNews', 'imgDesc': '首页资讯logo' }
31 30
         ])
32 31
       }
33
-
34 32
     })
35 33
   }
36 34
 

+ 5
- 5
src/pages/customer/Customer/style.less Целия файл

@@ -260,7 +260,7 @@
260 260
     position: relative;
261 261
   }
262 262
   .tit{
263
-    font-size:0.15rem;
263
+    // font-size:0.15rem;
264 264
     font-weight:600;
265 265
     color:#222;
266 266
     margin: 10px 0 0 0;
@@ -282,13 +282,13 @@
282 282
   }
283 283
   .infoItem{
284 284
     color:#666;
285
-    font-size: 0.1rem;
285
+    // font-size: 0.1rem;
286 286
     margin: 0 0 30px 0;
287 287
     
288 288
   }
289 289
   .rightItem{
290 290
     color:#666;
291
-    font-size: 0.1rem;
291
+    // font-size: 0.1rem;
292 292
     margin: 0 0 15px 0;
293 293
     display: flex;
294 294
   }
@@ -331,7 +331,7 @@
331 331
     min-width: 1.3rem;
332 332
     margin: 0 0 15px 0;
333 333
     color:#666;
334
-    font-size: 0.1rem;
334
+    // font-size: 0.1rem;
335 335
     padding-top: 0.3rem;
336 336
   }
337 337
 
@@ -344,7 +344,7 @@
344 344
     margin: 0 0 15px 0;
345 345
     padding-top: 0.3rem;
346 346
     color:#666;
347
-    font-size: 0.1rem;
347
+    // font-size: 0.1rem;
348 348
   }
349 349
   
350 350
 }

+ 67
- 0
src/pages/findRoom/setting/index.jsx Целия файл

@@ -0,0 +1,67 @@
1
+import React, { useEffect, useRef, useState } from 'react'
2
+import { Card, Descriptions, Input, message } from 'antd'
3
+import { fetch, apis } from '@/utils/request'
4
+
5
+const getSettings = fetch(apis.searchHouse.setting.get)
6
+const savePhone = fetch(apis.searchHouse.setting.phone)
7
+
8
+const EditableField = (props) => {
9
+  const [val, setVal] = useState()
10
+
11
+  const handleChange = (e) => {
12
+    setVal(e.target.value)
13
+  }
14
+
15
+  useEffect(() => {
16
+    setVal(props.value)
17
+  }, [props.value])
18
+
19
+  return (
20
+    <Input.Search
21
+      {...props}
22
+      enterButton="保存"
23
+      onSearch={props.onSubmit}
24
+      onChange={handleChange}
25
+      value={val}
26
+    />
27
+  )
28
+}
29
+
30
+export default (props) => {
31
+  const [loading, setLoading] = useState(false)
32
+  const [phone, setPhone] = useState()
33
+
34
+  const handlePhoneSubmit = (phone) => {
35
+    if (!phone) return;
36
+
37
+    setLoading(true)
38
+    savePhone({ urlData: { phone} }).then(() => {
39
+      setLoading(false)
40
+      setPhone(phone)
41
+      message.success('设置成功')
42
+    }).catch(() => {
43
+      setLoading(false)
44
+    })
45
+  }
46
+
47
+  useEffect(() => {
48
+    // 获取客服电话
49
+    setLoading(true)
50
+    getSettings().then((res) => {
51
+      setLoading(false)
52
+      setPhone(res.phone)
53
+    }).catch(() => {
54
+      setLoading(false)
55
+    })
56
+  }, [])
57
+
58
+  return (
59
+    <Card loading={loading}>
60
+      <Descriptions column={1} bordered size="middle" style={{maxWidth: '800px'}}>
61
+        <Descriptions.Item label="客服热线">
62
+          <EditableField value={phone} onSubmit={handlePhoneSubmit} />
63
+        </Descriptions.Item>
64
+      </Descriptions>
65
+    </Card>
66
+  )
67
+}

+ 12
- 0
src/services/apis.js Целия файл

@@ -338,6 +338,18 @@ export default {
338 338
       url: `${prefix}/reply/:id`,
339 339
       action: '',
340 340
     },
341
+    setting: {
342
+      get: {
343
+        method: 'GET',
344
+        url: `${prefix}/searchHouse/setting`,
345
+        action: 'admin.searchHouse.setting.get',
346
+      },
347
+      phone: {
348
+        method: 'PUT',
349
+        url: `${prefix}/searchHouse/setting/phone/:phone`,
350
+        action: 'admin.searchHouse.setting.phone.put',
351
+      },
352
+    }
341 353
   },
342 354
 
343 355
   customer: {