Yansen 5 vuotta sitten
vanhempi
commit
65a9e2c0d1

BIN
src/assets/trial/contact us.png Näytä tiedosto


BIN
src/assets/trial/count down.png Näytä tiedosto


BIN
src/assets/trial/operation manual.png Näytä tiedosto


+ 0
- 0
src/pages/Index/components/Concat.jsx Näytä tiedosto


src/pages/Index.jsx → src/pages/Index/components/Normal.jsx Näytä tiedosto

@@ -1,126 +1,106 @@
1
-import React, { Component, useState, useEffect } from 'react';
2
-import { Card, Typography, Alert, Row, Col, Button } from 'antd';
3
-import router from 'umi/router';
4
-import request from '../utils/request';
5
-import bgImg from '../assets/picture.png';
6
-import itemsImg from '../assets/items.png';
7
-import consultantImg from '../assets/consultantKPI.png';
8
-import projectImg from '../assets/project.png';
9
-import reportImg from '../assets/report.png';
10
-import customerImg from '../assets/customer.png';
11
-import statisticsImg from '../assets/statistics.png';
12
-import borderImg from '../assets/border.png';
13
-
14
-const index = (props) => {
15
-
16
-    const [data, setData] = useState([])
17
-
18
-
19
-    useEffect(() => {
20
-
21
-    }, [])
22
-    const list = [
23
-        {
24
-            title: '项目列表',
25
-            img: itemsImg,
26
-            path: '/building/list',
27
-            value: '1',
28
-        },
29
-        {
30
-            title: '客户列表',
31
-            img: customerImg,
32
-            path: '/customer/customerlist/list',
33
-            value: '2',
34
-        },
35
-        {
36
-            title: '数据报表',
37
-            img: reportImg,
38
-            path: '/statistical/monitor',
39
-            value: '3',
40
-        },
41
-
42
-        {
43
-            title: '项目统计',
44
-            img: projectImg,
45
-            path: '/statistical/building',
46
-            value: '4',
47
-        },
48
-        {
49
-            title: '活动统计',
50
-            img: statisticsImg,
51
-            path: '/statistical/activity',
52
-            value: '5',
53
-        },
54
-        {
55
-            title: '置业顾问KPI',
56
-            img: consultantImg,
57
-            path: '/statistical/consultant',
58
-            value: '6',
59
-        },
60
-
61
-    ]
62
-    const goNow = (path) => {
63
-        router.push({
64
-            pathname: path,
65
-        });
66
-    }
67
-
68
-
69
-
70
-    return (
71
-        <>
72
-            <div style={{
73
-                width: 'calc(100% + 48px)',
74
-                height: '0',
75
-                paddingBottom: 'calc(29.64% + 14.23px)',
76
-                position: 'relative',
77
-                top: '-24px',
78
-                left: '-24px',
79
-                backgroundImage: 'url(https://njcj.oss-cn-shanghai.aliyuncs.com/images/picture.png)',
80
-                backgroundRepeat: 'no-repeat',
81
-                backgroundSize: '100% 100%',
82
-            }} >
83
-            </div>
84
-            <div style={{
85
-                backgroundColor: '#fff',
86
-                margin: '-24px -24px 0.24rem -24px',
87
-                paddingBottom: '0.2rem',
88
-
89
-            }} >
90
-                <h2 style={{
91
-                    fontSize: '0.11rem',
92
-                    padding: '0.2rem 0 16px 24px'
93
-                }}>快捷入口</h2>
94
-                <Row style={{ textAlign: 'center' }}>
95
-                    {list.map(item => (
96
-                        <Col span={4} key={item.value} onClick={() => goNow(item.path)}>
97
-                            <div style={{
98
-                                width: '1.2rem',
99
-                                height: '0px',
100
-                                margin: '0 auto',
101
-                                paddingBottom: '0.66rem',
102
-                                position: 'relative',
103
-                                backgroundImage: 'url(https://njcj.oss-cn-shanghai.aliyuncs.com/images/border.png)',
104
-                                backgroundRepeat: 'no-repeat',
105
-                                backgroundSize: '100% 100%',
106
-                                paddingTop: '0.12rem'
107
-                            }}>
108
-                                <p style={{ color: '#FF7F49', fontSize: '0.11rem', letterSpacing: '0.026rem', fontWeight: '600', }}>{item.title}</p>
109
-                                <img style={{ position: 'absolute', left: '0.08rem', bottom: '0.1rem', width: '0.3rem' }} src={item.img} alt="" />
110
-                            </div>
111
-                        </Col>
112
-                    ))}
113
-
114
-
115
-
116
-                </Row>
117
-
118
-            </div>
119
-
120
-
121
-        </>
122
-    )
123
-
124
-}
125
-export default index
126
-
1
+import React from 'react';
2
+import { Row, Col } from 'antd';
3
+import router from 'umi/router';
4
+import itemsImg from '@/assets/items.png';
5
+import consultantImg from '@/assets/consultantKPI.png';
6
+import projectImg from '@/assets/project.png';
7
+import reportImg from '@/assets/report.png';
8
+import customerImg from '@/assets/customer.png';
9
+import statisticsImg from '@/assets/statistics.png';
10
+
11
+export default () => {
12
+    const list = [
13
+        {
14
+            title: '项目列表',
15
+            img: itemsImg,
16
+            path: '/building/list',
17
+            value: '1',
18
+        },
19
+        {
20
+            title: '客户列表',
21
+            img: customerImg,
22
+            path: '/customer/customerlist/list',
23
+            value: '2',
24
+        },
25
+        {
26
+            title: '数据报表',
27
+            img: reportImg,
28
+            path: '/statistical/monitor',
29
+            value: '3',
30
+        },
31
+
32
+        {
33
+            title: '项目统计',
34
+            img: projectImg,
35
+            path: '/statistical/building',
36
+            value: '4',
37
+        },
38
+        {
39
+            title: '活动统计',
40
+            img: statisticsImg,
41
+            path: '/statistical/activity',
42
+            value: '5',
43
+        },
44
+        {
45
+            title: '置业顾问KPI',
46
+            img: consultantImg,
47
+            path: '/statistical/consultant',
48
+            value: '6',
49
+        },
50
+
51
+    ]
52
+    const goNow = path => {
53
+        router.push({
54
+            pathname: path,
55
+        });
56
+    }
57
+
58
+    return (
59
+        <>
60
+            <div style={{
61
+                width: 'calc(100% + 48px)',
62
+                height: '0',
63
+                paddingBottom: 'calc(29.64% + 14.23px)',
64
+                position: 'relative',
65
+                top: '-24px',
66
+                left: '-24px',
67
+                backgroundImage: 'url(https://njcj.oss-cn-shanghai.aliyuncs.com/images/picture.png)',
68
+                backgroundRepeat: 'no-repeat',
69
+                backgroundSize: '100% 100%',
70
+            }} >
71
+            </div>
72
+            <div style={{
73
+                backgroundColor: '#fff',
74
+                margin: '-24px -24px 0.24rem -24px',
75
+                paddingBottom: '0.2rem',
76
+
77
+            }} >
78
+                <h2 style={{
79
+                    fontSize: '0.11rem',
80
+                    padding: '0.2rem 0 16px 24px',
81
+                }}>快捷入口</h2>
82
+                <Row style={{ textAlign: 'center' }}>
83
+                    {list.map(item => (
84
+                        <Col span={4} key={item.value} onClick={() => goNow(item.path)}>
85
+                            <div style={{
86
+                                width: '1.2rem',
87
+                                height: '0px',
88
+                                margin: '0 auto',
89
+                                paddingBottom: '0.66rem',
90
+                                position: 'relative',
91
+                                backgroundImage: 'url(https://njcj.oss-cn-shanghai.aliyuncs.com/images/border.png)',
92
+                                backgroundRepeat: 'no-repeat',
93
+                                backgroundSize: '100% 100%',
94
+                                paddingTop: '0.12rem',
95
+                            }}>
96
+                                <p style={{ color: '#FF7F49', fontSize: '0.11rem', letterSpacing: '0.026rem', fontWeight: '600' }}>{item.title}</p>
97
+                                <img style={{ position: 'absolute', left: '0.08rem', bottom: '0.1rem', width: '0.3rem' }} src={item.img} alt="" />
98
+                            </div>
99
+                        </Col>
100
+                    ))}
101
+
102
+                </Row>
103
+            </div>
104
+        </>
105
+    )
106
+}

+ 39
- 0
src/pages/Index/components/StickyBtn.jsx Näytä tiedosto

@@ -0,0 +1,39 @@
1
+import React, { useState } from 'react';
2
+import router from 'umi/router';
3
+import { Modal, Space } from 'antd';
4
+import book from '@/assets/trial/operation manual.png';
5
+import contact from '@/assets/trial/contact us.png';
6
+import Styles from './style.less';
7
+
8
+const Btn = props => (
9
+  <div className={Styles['sticky-btn']} onClick={props.onClick}>
10
+    <div><img src={props.icon} alt=""/> </div>
11
+    {props.children}
12
+  </div>
13
+)
14
+
15
+export default props => {
16
+  const [visible, setVisible] = useState(false);
17
+  
18
+  const goto = path => {
19
+    if (path.indexOf('http') === 0) {
20
+      window.location.href = path
21
+    } else {
22
+      router.push(path)
23
+    }
24
+  }
25
+
26
+  return (
27
+    <div className={Styles['sticky-box']}>
28
+      <Btn icon={book} onClick={() => goto('https://easydoc.xyz/s/24703398/3SqDkJDw/4q8zspHR')}>操作手册</Btn>
29
+      <Btn icon={contact} onClick={() => setVisible(true)}>联系我们</Btn>
30
+      <Modal
31
+        title="联系我们"
32
+        width="600"
33
+        visible={visible}
34
+        onCancel={() => setVisible(false)}
35
+      >
36
+      </Modal>
37
+    </div>
38
+  )
39
+}

+ 58
- 0
src/pages/Index/components/TimeTicker.jsx Näytä tiedosto

@@ -0,0 +1,58 @@
1
+import React, { useEffect, useState } from 'react';
2
+import Link from 'umi/link';
3
+import { Button } from 'antd';
4
+import countDown from '@/assets/trial/count down.png';
5
+import Styles from './style.less';
6
+
7
+const BlockText = props => (
8
+  <span className={Styles['block-text']}>
9
+    {props.text}
10
+  </span>
11
+)
12
+
13
+export default props => {
14
+  const expDate = new Date('2020-06-23');
15
+  const [times, setTimes] = useState([0, 0, 0, 0]);
16
+
17
+  useEffect(() => {
18
+    const ticker = setInterval(() => {
19
+      const now = new Date();
20
+      let diff = expDate.getTime() - now.getTime()
21
+
22
+      if (diff <= 0) {
23
+        setTimes([0, 0, 0, 0]);
24
+        clearInterval(ticker);
25
+      }
26
+
27
+      const days = Math.floor(diff / (24 * 60 * 60 * 1000));
28
+      diff %= (24 * 60 * 60 * 1000);
29
+      const hours = Math.floor(diff / (60 * 60 * 1000));
30
+      diff %= (60 * 60 * 1000);
31
+      const minutes = Math.floor(diff / (60 * 1000));
32
+      diff %= (60 * 1000);
33
+      const seconds = Math.round(diff / 1000);
34
+
35
+      setTimes([days, hours, minutes, seconds]);
36
+    }, 1000);
37
+
38
+    return () => clearInterval(ticker);
39
+  }, [])
40
+
41
+  return (
42
+    <div className={Styles['time-ticker']}>
43
+      <div className={Styles['time-ticker-header']}> <img src={countDown} alt=""/> </div>
44
+      <div className={Styles['time-ticker-body']}>
45
+        <div>
46
+          剩余
47
+          <BlockText text={times[0]}/>天
48
+          <BlockText text={times[1]}/>时
49
+          <BlockText text={times[2]}/>分
50
+          <BlockText text={times[3]}/>秒
51
+        </div>
52
+        <div className={Styles['time-ticker-body-desc']}>
53
+          请再结束前 <Link to="/system/miniappSetMeal/index"><span style={{ color: '#1D74D9' }}>购买套餐</span></Link> , 到期后无法登录
54
+        </div>
55
+      </div>
56
+    </div>
57
+  )
58
+}

+ 28
- 0
src/pages/Index/components/Trial.jsx Näytä tiedosto

@@ -0,0 +1,28 @@
1
+import React from 'react';
2
+import TrialBanner from './TrialBanner';
3
+import TrialProcess from './TrialProcess';
4
+import StickyBtn from './StickyBtn';
5
+import TimeTicker from './TimeTicker';
6
+import Styles from './style.less';
7
+
8
+export default function() {
9
+  const bannerItem = [
10
+    {
11
+      src: 'https://njcj.oss-cn-shanghai.aliyuncs.com/images/admin-trial/banner.png',
12
+    },
13
+  ]
14
+
15
+  return (
16
+    <div className={Styles['trial-page']}>
17
+      <TrialBanner list={bannerItem} />
18
+
19
+      <div style={{ padding: '36px 200px' }}>
20
+        <TrialProcess />
21
+      </div>
22
+
23
+      <StickyBtn />
24
+
25
+      <TimeTicker />
26
+    </div>
27
+  );
28
+}

+ 32
- 0
src/pages/Index/components/TrialBanner.jsx Näytä tiedosto

@@ -0,0 +1,32 @@
1
+import React from 'react';
2
+import { Carousel } from 'antd';
3
+import classNames from 'classnames';
4
+import Styles from './style.less';
5
+
6
+export default function(props) {
7
+  const cls = classNames(Styles['scroll-banner-item']);
8
+  const list = props.list || []
9
+  const handleClick = item => {
10
+    if (props.onClick) {
11
+      props.onClick(item);
12
+    }
13
+  }
14
+
15
+  return (
16
+    <Carousel autoplay>
17
+      {
18
+        list.map((item, inx) => {
19
+          const key = `scroll-banner-${inx}`;
20
+
21
+          return (
22
+            <div key={key} className={cls} onClick={() => handleClick(item)}>
23
+              {
24
+                props.renderItem ? props.renderItem(item) : <img src={item.src} alt=""/>
25
+              }
26
+            </div>
27
+          );
28
+        })
29
+      }
30
+    </Carousel>
31
+  )
32
+}

+ 57
- 0
src/pages/Index/components/TrialProcess.jsx Näytä tiedosto

@@ -0,0 +1,57 @@
1
+import React, { useState } from 'react';
2
+import { Steps, Button } from 'antd';
3
+import Link from 'umi/Link';
4
+import qrImage from '@/assets/xiaochengxu.png';
5
+import Styles from './style.less';
6
+
7
+const btnColor = { color: '#1D74D9' };
8
+
9
+const TrailMiniApp = () => (
10
+  <div className={Styles['step-box']}>
11
+    <p><img src={qrImage} alt="" /></p>
12
+    <p><strong>使用微信扫码,体验橙蕉小程序</strong></p>
13
+    <p><span className={Styles.tip}>已扫码或不想扫码?可跳转下一步</span></p>
14
+  </div>
15
+)
16
+
17
+const AuthMiniApp = () => (
18
+  <div className={Styles['step-box']}>
19
+    <p><Link to=""><strong>授权小程序</strong></Link></p>
20
+    <p><span className={Styles.tip}>之前体验的小程序是橙蕉公司自己的小程序 <br /> 想拥有贵公司自己的橙蕉小程序?点击进入!</span></p>
21
+    <p><span className={Styles.tip}>已扫码或不想扫码?可跳转下一步</span></p>
22
+  </div>
23
+)
24
+
25
+const AboutPackage = () => (
26
+  <div className={Styles['step-box']}>
27
+    <p><Button>了解套餐</Button></p>
28
+  </div>
29
+)
30
+
31
+export default function(props) {
32
+  const [current, setCurrent] = useState(0);
33
+
34
+  return (
35
+    <div className={Styles['trail-process']}>
36
+      <Steps labelPlacement="vertical" current={current} onChange={x => setCurrent(x)}>
37
+        <Steps.Step title="体验小程序"></Steps.Step>
38
+        <Steps.Step title="授权小程序"></Steps.Step>
39
+        <Steps.Step title="了解套餐"></Steps.Step>
40
+      </Steps>
41
+      <div style={{ marginTop: '30px' }}>
42
+        { current === 0 && <TrailMiniApp /> }
43
+        { current === 1 && <AuthMiniApp /> }
44
+        { current === 2 && <AboutPackage /> }
45
+
46
+        <div style={{ textAlign: 'center' }}>
47
+          {
48
+            current > 0 && <Button type="link" onClick={() => setCurrent(current - 1)} style={btnColor}>上一步</Button>
49
+          }
50
+          {
51
+            current < 2 && <Button type="link" onClick={() => setCurrent(current + 1)} style={btnColor}>下一步</Button>
52
+          }
53
+        </div>
54
+      </div>
55
+    </div>
56
+  );
57
+}

+ 143
- 0
src/pages/Index/components/style.less Näytä tiedosto

@@ -0,0 +1,143 @@
1
+.trial-page {
2
+  background-color: #fff;
3
+  position: relative;
4
+
5
+  width: calc(100% + 48px);
6
+  top: -24px;
7
+  left: -24px;
8
+}
9
+
10
+.scroll-banner {
11
+  &-item {
12
+    width: 100%;
13
+    overflow: hidden;
14
+
15
+    img {
16
+      width: 100%;
17
+      height: 100%;
18
+    }
19
+  }
20
+}
21
+
22
+.trail-process {
23
+  :global {
24
+    .ant-steps-item-active, .ant-steps-item-finish {
25
+      .ant-steps-item-tail::after {
26
+        background-color: #FF7E48 !important;
27
+      }
28
+
29
+      .ant-steps-item-icon {
30
+        border-color: #FF7E48;
31
+        background: #FF7E48;
32
+
33
+        .ant-steps-icon {
34
+          color: #FFF !important;
35
+        }
36
+      }
37
+
38
+      .ant-steps-item-title {
39
+        color: #FF7E48 !important;
40
+      }
41
+    }
42
+  }
43
+
44
+  .step-box {
45
+    text-align: center;
46
+    
47
+    img {
48
+      width: 120px;
49
+      height: 120px;
50
+      background:rgba(255,255,255,1);
51
+      border:1px solid rgba(151,151,151,1);
52
+    }
53
+
54
+    p {
55
+      color: #666;
56
+      font-size: 20px;
57
+      line-height: 1.8em;
58
+    }
59
+
60
+    .tip {
61
+      color: #999;
62
+    }
63
+  }
64
+}
65
+
66
+.sticky-box {
67
+  position: fixed;
68
+  bottom: 300px;
69
+  right: 0;
70
+  background-color: #fff;
71
+  box-shadow:0px 4px 7px 2px rgba(0,0,0,0.12);
72
+  border-radius:4px 4px 0px 0px;
73
+}
74
+
75
+.sticky-btn {
76
+  font-size: 14px;
77
+  color: #FF7E48;
78
+  line-height: 1.4em;
79
+  padding: 12px;
80
+  text-align: center;
81
+  cursor: pointer;
82
+
83
+  img {
84
+    width: 48px;
85
+    height: 48px;
86
+  }
87
+
88
+  & + .sticky-btn {
89
+    border-top: 1px solid rgba(0,0,0,0.06);
90
+  }
91
+}
92
+
93
+.time-ticker {
94
+  position: absolute;
95
+  right: 0;
96
+  bottom: 0;
97
+  background:rgba(255,255,255,1);
98
+  box-shadow:0px 4px 7px 2px rgba(0,0,0,0.12);
99
+  border-radius:4px 0px 0px 4p;
100
+  padding: 14px 20px;
101
+
102
+  display: flex;
103
+  align-items: center;
104
+
105
+  &-header {
106
+    flex: none;
107
+    width: 48px;
108
+    height: 48px;
109
+
110
+    overflow: hidden;
111
+    img {
112
+      width: 100%;
113
+      height: 100%;
114
+    }
115
+  }
116
+
117
+  &-body {
118
+    flex: auto;
119
+    margin-left: 12px;
120
+
121
+    font-size: 16px;
122
+    line-height: 2em;
123
+    color: #666;
124
+
125
+    &-desc {
126
+      font-size: 12px;
127
+      line-height: 1.4em;
128
+    }
129
+  }
130
+    
131
+  .block-text {
132
+    display: inline-block;
133
+    background:rgba(0,0,0,0.5);
134
+    color: #fff;
135
+    font-size: 14px;
136
+    line-height: 1.4em;
137
+    padding: 2px;
138
+    text-align: center;
139
+    min-width: 24px;
140
+    margin: 0 4px;
141
+  }
142
+}
143
+

+ 11
- 0
src/pages/Index/index.jsx Näytä tiedosto

@@ -0,0 +1,11 @@
1
+import React from 'react'
2
+import Normal from './components/Normal';
3
+import Trial from './components/Trial';
4
+
5
+export default function() {
6
+  return (
7
+    <div>
8
+      <Trial />
9
+    </div>
10
+  )
11
+}