Yansen před 2 roky
rodič
revize
abb33d94c8

+ 19007
- 0
package-lock.json
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 8
- 7
package.json Zobrazit soubor

@@ -35,24 +35,25 @@
35 35
   ],
36 36
   "author": "",
37 37
   "dependencies": {
38
+    "@antmjs/vantui": "^2.3.5",
38 39
     "@babel/runtime": "^7.7.7",
39 40
     "@tarojs/components": "3.5.7",
40 41
     "@tarojs/helper": "3.5.7",
41
-    "@tarojs/plugin-platform-weapp": "3.5.7",
42
+    "@tarojs/plugin-framework-react": "3.5.7",
42 43
     "@tarojs/plugin-platform-alipay": "3.5.7",
43
-    "@tarojs/plugin-platform-tt": "3.5.7",
44
-    "@tarojs/plugin-platform-swan": "3.5.7",
45 44
     "@tarojs/plugin-platform-jd": "3.5.7",
46 45
     "@tarojs/plugin-platform-qq": "3.5.7",
46
+    "@tarojs/plugin-platform-swan": "3.5.7",
47
+    "@tarojs/plugin-platform-tt": "3.5.7",
48
+    "@tarojs/plugin-platform-weapp": "3.5.7",
49
+    "@tarojs/react": "3.5.7",
47 50
     "@tarojs/router": "3.5.7",
48 51
     "@tarojs/runtime": "3.5.7",
49 52
     "@tarojs/shared": "3.5.7",
50 53
     "@tarojs/taro": "3.5.7",
51 54
     "@tarojs/taro-h5": "3.5.7",
52
-    "@tarojs/plugin-framework-react": "3.5.7",
53
-    "@tarojs/react": "3.5.7",
54
-    "react-dom": "^18.0.0",
55
-    "react": "^18.0.0"
55
+    "react": "^18.0.0",
56
+    "react-dom": "^18.0.0"
56 57
   },
57 58
   "devDependencies": {
58 59
     "@babel/core": "^7.8.0",

binární
src/assets/image/WeChat.png Zobrazit soubor


binární
src/assets/image/logo.png Zobrazit soubor


binární
src/assets/image/password.png Zobrazit soubor


binární
src/assets/image/user.png Zobrazit soubor


+ 42
- 19
src/pages/index/index.jsx Zobrazit soubor

@@ -1,24 +1,47 @@
1 1
 import { Component } from 'react'
2
-import { View, Text } from '@tarojs/components'
2
+import { View, Input, Image } from '@tarojs/components'
3
+import { Form, Button } from '@antmjs/vantui'
4
+import logo from '../../assets/image/logo.png';
5
+import user from '../../assets/image/user.png';
6
+import password from '../../assets/image/password.png';
7
+import WeChat from '../../assets/image/WeChat.png';
3 8
 import './index.less'
4 9
 
5
-export default class Index extends Component {
6
-
7
-  componentWillMount () { }
8
-
9
-  componentDidMount () { }
10
-
11
-  componentWillUnmount () { }
12
-
13
-  componentDidShow () { }
14
-
15
-  componentDidHide () { }
16
-
17
-  render () {
18
-    return (
19
-      <View className='index'>
20
-        <Text>Hello world!</Text>
10
+export default (props) => {
11
+  return (
12
+    <View className='index'>
13
+      <View className='index-2'>
14
+        <Image className='img-1'
15
+          src={logo}
16
+        />
17
+      </View>
18
+      <View className='index-txt'>欢迎登录霍山文明创城</View>
19
+      <Form className='form'>
20
+        <View className='index-3'>
21
+          <Image src={user} className='img-2' />账号<Input className='input-1' placeholder='请输入您的登录账号' />
22
+        </View>
23
+        <View className='index-3'>
24
+          <Image src={password} className='img-2' />密码<Input className='input-1' placeholder='请输入您的登录密码' />
25
+        </View>
26
+        <Button
27
+          className='btn-1'
28
+        >
29
+          忘记密码?
30
+        </Button>
31
+        <Button
32
+          type='primary'
33
+          className='btn-2'
34
+        >
35
+          登录
36
+        </Button>
37
+      </Form>
38
+      <View className='index-txt2'>——其他登录方式——</View>
39
+      <View className='index-4'>
40
+        <Image className='img-3'
41
+          src={WeChat}
42
+        />
21 43
       </View>
22
-    )
23
-  }
44
+      <View className='index-txt3'>微信登录</View>
45
+    </View>
46
+  )
24 47
 }

+ 77
- 4
src/pages/index/index.less Zobrazit soubor

@@ -1,4 +1,77 @@
1
-
2
-.index {
3
-  color: red;
4
-}
1
+.index {
2
+  margin-top: 60px;
3
+  .index-2 {
4
+    width: 235px;
5
+    height: 235px;
6
+    margin: 0 auto;
7
+    .img-1 {
8
+      width: 235px;
9
+      height: 235px;
10
+    }
11
+  }
12
+  .index-txt {
13
+    text-align: center;
14
+    margin-bottom: 100px;
15
+  }
16
+  .form {
17
+    width: 620px;
18
+    .index-3 {
19
+      display: flex;
20
+      border-bottom: 1px solid #e9eaea;
21
+      width: 600px;
22
+      margin: 26px auto;
23
+      padding-bottom: 30px;
24
+      margin-top: 60px;
25
+      .img-2 {
26
+        margin-right: 30px;
27
+        width: 42px;
28
+        height: 44px;
29
+      }
30
+      .input-1 {
31
+        color: rgb(174, 174, 174);
32
+        margin-left: 15px;
33
+        padding-left: 20px;
34
+        flex-direction: column;
35
+        border-left: 1px solid black;
36
+      }
37
+    }
38
+    .btn-1 {
39
+      width: 190px;
40
+      height: 66px;
41
+      font-size: 28px;
42
+      color: #1a7565;
43
+      float: right;
44
+      margin-right: 72px;
45
+      margin-bottom: 104px;
46
+    }
47
+    .btn-2 {
48
+      width: 666px;
49
+      margin: 80px auto;
50
+      background-color: rgb(26, 117, 100);
51
+      color: #fff;
52
+    }
53
+  }
54
+  .index-txt2 {
55
+    font-size: 30px;
56
+    color: rgb(174, 174, 174);
57
+    margin: 10px auto;
58
+    text-align: center;
59
+    margin-top: 110px;
60
+  }
61
+  .index-4 {
62
+    width: 100px;
63
+    height: 100px;
64
+    margin: 0 auto;
65
+    .img-3 {
66
+      width: 100px;
67
+      height: 100px;
68
+      margin-top: 8px;
69
+    }
70
+  }
71
+  .index-txt3 {
72
+    font-size: 25px;
73
+    color: rgb(174, 174, 174);
74
+    text-align: center;
75
+    margin: 30px auto;
76
+  }
77
+}

+ 53
- 0
src/routes.js Zobrazit soubor

@@ -0,0 +1,53 @@
1
+
2
+const routes = [
3
+
4
+  /**********************************
5
+   *  Tab 页面
6
+   *********************************/
7
+  {
8
+    name: '首页',
9
+    page: 'pages/index/index',
10
+    pkg: 'main',
11
+    isTab: true,
12
+    type: 'main',
13
+    shortcut: {
14
+      chat: false,
15
+      consultant: true,
16
+    },
17
+    // auth: ['phone', 'avatar']
18
+  },
19
+]
20
+
21
+/**
22
+ * 获取 app pages 列表
23
+ */
24
+function getPages () {
25
+  const grp = routes.reduce((g, r) => {
26
+    const { pkg, page } = r
27
+    const pg = g[pkg] || []
28
+
29
+    return Object.assign(g, {
30
+      [`${pkg}`]: pg.concat(page),
31
+    })
32
+  }, {});
33
+
34
+  const pages = grp.main;
35
+  const subPackages = Object.keys(grp).filter(x => x !== 'main').reduce(((pkg, key) => {
36
+    return pkg.concat({
37
+      root: key,
38
+      pages: grp[key],
39
+    })
40
+  }), [])
41
+
42
+
43
+  return {
44
+    pages,
45
+    subPackages,
46
+  }
47
+}
48
+
49
+// eslint-disable-next-line import/no-commonjs
50
+module.exports = {
51
+  routes,
52
+  getPages,
53
+};