张延森 3 年之前
父節點
當前提交
5d71da8132

+ 1
- 17
config/routes.js 查看文件

@@ -27,23 +27,7 @@ export default [
27 27
             path: '/welcome',
28 28
             name: 'welcome',
29 29
             icon: 'smile',
30
-            component: './Welcome',
31
-          },
32
-          {
33
-            path: '/admin',
34
-            name: 'admin',
35
-            icon: 'crown',
36
-            component: './Admin',
37
-            authority: ['admin'],
38
-            routes: [
39
-              {
40
-                path: '/admin/sub-page',
41
-                name: 'sub-page',
42
-                icon: 'smile',
43
-                component: './Welcome',
44
-                authority: ['admin'],
45
-              },
46
-            ],
30
+            component: './welcome',
47 31
           },
48 32
           {
49 33
             path: '/building',

二進制
src/assets/welcome/icon-activity.png 查看文件


二進制
src/assets/welcome/icon-building.png 查看文件


二進制
src/assets/welcome/icon-channel.png 查看文件


二進制
src/assets/welcome/icon-customer.png 查看文件


二進制
src/assets/welcome/icon-kpi.png 查看文件


二進制
src/assets/welcome/icon-report.png 查看文件


+ 0
- 73
src/pages/Welcome.jsx 查看文件

@@ -1,73 +0,0 @@
1
-import React, { useEffect } from 'react';
2
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import { Card, Typography, Alert } from 'antd';
5
-import styles from './Welcome.less';
6
-
7
-const CodePreview = ({ children }) => (
8
-  <pre className={styles.pre}>
9
-    <code>
10
-      <Typography.Text copyable>{children}</Typography.Text>
11
-    </code>
12
-  </pre>
13
-);
14
-
15
-export default (props) => {
16
-  // console.log('--------welcome-----', JSON.stringify(props))
17
-  // useEffect(() => {
18
-  //   console.log('------useEffect-------')
19
-  // }, [])
20
-  
21
-  return (
22
-    <PageHeaderWrapper>
23
-      <Card>
24
-        <Alert
25
-          message="umi ui 现已发布,点击右下角 umi 图标即可使用"
26
-          type="success"
27
-          showIcon
28
-          banner
29
-          style={{
30
-            margin: -12,
31
-            marginBottom: 24,
32
-          }}
33
-        />
34
-        <Typography.Text strong>
35
-          <a target="_blank" rel="noopener noreferrer" href="https://pro.ant.design/docs/block">
36
-            <FormattedMessage
37
-              id="app.welcome.link.block-list"
38
-              defaultMessage="基于 block 开发,快速构建标准页面"
39
-            />
40
-          </a>
41
-        </Typography.Text>
42
-        <CodePreview> npm run ui</CodePreview>
43
-        <Typography.Text
44
-          strong
45
-          style={{
46
-            marginBottom: 12,
47
-          }}
48
-        >
49
-          <a
50
-            target="_blank"
51
-            rel="noopener noreferrer"
52
-            href="https://pro.ant.design/docs/available-script#npm-run-fetchblocks"
53
-          >
54
-            <FormattedMessage id="app.welcome.link.fetch-blocks" defaultMessage="获取全部区块" />
55
-          </a>
56
-        </Typography.Text>
57
-        <CodePreview> npm run fetch:blocks</CodePreview>
58
-      </Card>
59
-      <p
60
-        style={{
61
-          textAlign: 'center',
62
-          marginTop: 24,
63
-        }}
64
-      >
65
-        Want to add more pages? Please refer to{' '}
66
-        <a href="https://pro.ant.design/docs/block-cn" target="_blank" rel="noopener noreferrer">
67
-          use block
68
-        </a>
69
-        。
70
-      </p>
71
-    </PageHeaderWrapper>
72
-  )
73
-};

+ 0
- 8
src/pages/Welcome.less 查看文件

@@ -1,8 +0,0 @@
1
-@import '~antd/lib/style/themes/default.less';
2
-
3
-.pre {
4
-  margin: 12px 0;
5
-  padding: 12px 20px;
6
-  background: @input-bg;
7
-  box-shadow: @card-shadow;
8
-}

+ 1
- 0
src/pages/user/login/style.less 查看文件

@@ -50,6 +50,7 @@
50 50
     background: #1548B6 !important;
51 51
     border-radius: 48px;
52 52
     border: none !important;
53
+    margin-top: 50px;
53 54
   }
54 55
 
55 56
   :global {

+ 18
- 0
src/pages/welcome/components/IconText/index.jsx 查看文件

@@ -0,0 +1,18 @@
1
+import React from 'react'
2
+import styles from './style.less'
3
+
4
+const noop = x => x
5
+
6
+export default (props) => {
7
+  const { name, onClick = noop } = props
8
+  const file = require(`@/assets/welcome/icon-${name}.png`)
9
+
10
+  return (
11
+    <div className={styles['icon-text']} onClick={onClick}>
12
+      <img src={file} alt="" className={styles['icon-img']} />
13
+      <div>
14
+        {props.children}
15
+      </div>
16
+    </div>
17
+  )
18
+}

+ 16
- 0
src/pages/welcome/components/IconText/style.less 查看文件

@@ -0,0 +1,16 @@
1
+.icon-text {
2
+  color: #fff;
3
+  font-size: 25px;
4
+  line-height: 35px;
5
+  letter-spacing: 3px;
6
+  font-weight: bold;
7
+  display: inline-block;
8
+  box-sizing: border-box;
9
+
10
+  .icon-img {
11
+    width: 88px;
12
+    height: 88px;
13
+    display: block;
14
+    border: none;
15
+  }
16
+}

+ 70
- 0
src/pages/welcome/index.jsx 查看文件

@@ -0,0 +1,70 @@
1
+import React, { useCallback, useEffect, useState } from 'react';
2
+// import { Row, Col } from 'antd'
3
+import Link from 'umi/link'
4
+import IconText from './components/IconText'
5
+import styles from './style.less';
6
+
7
+export default (props) => {
8
+  const [containerStyle, setContainerStyle] = useState({})
9
+
10
+  const computeStyle = useCallback(() => {
11
+    const body = document.body
12
+    const header = document.getElementsByClassName('ant-pro-global-header')[0]
13
+
14
+    const style = {
15
+      width: header.offsetWidth,
16
+      height: body.offsetHeight - header.offsetHeight,
17
+    }
18
+
19
+    setContainerStyle(style)
20
+  }, [setContainerStyle])
21
+
22
+  useEffect(() => {
23
+    computeStyle()
24
+
25
+    window.addEventListener('resize', computeStyle)
26
+    return () => window.removeEventListener('resize', computeStyle)
27
+  }, [computeStyle])
28
+  
29
+  return (
30
+    <div className={styles.welcome} style={containerStyle}>
31
+      <div className={styles['action-list']}>
32
+        <div>
33
+          <Link to="/building/list">
34
+            <IconText name='building'>项目列表</IconText>
35
+          </Link>
36
+        </div>
37
+
38
+        <div>
39
+          <Link to="/statistical/consultant">
40
+            <IconText name='kpi'>置业顾问KPI</IconText>
41
+          </Link>
42
+        </div>
43
+        
44
+        <div>
45
+          <Link to="/statistical/activity">
46
+            <IconText name='activity'>活动统计</IconText>
47
+          </Link>
48
+        </div>
49
+        
50
+        <div>
51
+          <Link to="/customer/customer/list">
52
+            <IconText name='customer'>客户列表</IconText>
53
+          </Link>
54
+        </div>
55
+        
56
+        <div>
57
+          {/* <Link to="/customer/customer/list"> */}
58
+            <IconText name='report'>数据报表</IconText>
59
+          {/* </Link> */}
60
+        </div>
61
+        
62
+        <div>
63
+          {/* <Link to="/customer/customer/list"> */}
64
+            <IconText name='channel'>渠道统计</IconText>
65
+          {/* </Link> */}
66
+        </div>
67
+      </div>
68
+    </div>
69
+  )
70
+};

+ 22
- 0
src/pages/welcome/style.less 查看文件

@@ -0,0 +1,22 @@
1
+@import '~antd/lib/style/themes/default.less';
2
+
3
+.welcome {
4
+  background: url(https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/background.png) no-repeat;
5
+  background-size: 100% 100%;
6
+  position: absolute;
7
+  left: -24px;
8
+  top: -24px;
9
+
10
+  .action-list {
11
+    display: flex;
12
+    width: 100%;
13
+    position: absolute;
14
+    left: 0;
15
+    bottom: 200px;
16
+
17
+    & > div {
18
+      flex: auto;
19
+      text-align: center;
20
+    }
21
+  }
22
+}

+ 2
- 2
src/utils/request.js 查看文件

@@ -46,8 +46,8 @@ request.interceptors.request.use((url, options) => {
46 46
 
47 47
   return (
48 48
     {
49
-      url: 'https://xlk.njyz.tech' + apiURL,
50
-      // url: apiURL,
49
+      // url: 'https://xlk.njyz.tech' + apiURL,
50
+      url: apiURL,
51 51
       options: {
52 52
         ...opts,
53 53
         headers: {