瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/lyg_gn/gnyy_miniapp

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

+ 1
- 0
package.json 查看文件

@@ -41,6 +41,7 @@
41 41
     "@tarojs/react": "3.3.6",
42 42
     "@tarojs/runtime": "3.3.6",
43 43
     "@tarojs/taro": "3.3.6",
44
+    "dayjs": "^1.11.1",
44 45
     "react": "^17.0.0",
45 46
     "react-dom": "^17.0.0"
46 47
   },

+ 5
- 1
src/app.js 查看文件

@@ -1,4 +1,5 @@
1 1
 import { Component } from 'react'
2
+import { View } from '@tarojs/components';
2 3
 import '@antmjs/vantui/lib/index.less';
3 4
 import './app.less'
4 5
 
@@ -14,7 +15,10 @@ class App extends Component {
14 15
 
15 16
   // this.props.children 是将要会渲染的页面
16 17
   render () {
17
-    return this.props.children
18
+    return <View className='index'>
19
+      {this.props.children}
20
+    </View>
21
+
18 22
   }
19 23
 }
20 24
 

二進制
src/assets/barcodeimg.png 查看文件


+ 8
- 0
src/pages/DepartmentSelection/index.config.js 查看文件

@@ -0,0 +1,8 @@
1
+
2
+export default {
3
+  navigationBarTitleText: '选择科室',
4
+  disableScroll: true,
5
+  usingComponents: {
6
+  }
7
+
8
+}

+ 25
- 0
src/pages/DepartmentSelection/index.jsx 查看文件

@@ -0,0 +1,25 @@
1
+import { View, Text } from "@tarojs/components"
2
+import { useEffect, useState } from "react"
3
+import Taro, { useDidShow } from "@tarojs/taro"
4
+import { Button } from "@antmjs/vantui"
5
+
6
+// import BottomMoadl from '@/components/BottomMoadl/index'
7
+
8
+
9
+
10
+
11
+
12
+
13
+import './style.less'
14
+
15
+export default (props) => {
16
+
17
+
18
+
19
+  return (
20
+    <View className='page-index'>
21
+
22
+
23
+    </View>
24
+  )
25
+}

+ 59
- 0
src/pages/DepartmentSelection/style.less 查看文件

@@ -0,0 +1,59 @@
1
+.orders-listBox-RihtboxBoxOrderViewText:before {
2
+  content: "";
3
+  display: block;
4
+  position: absolute;
5
+  width: 100%;
6
+  bottom: -10px;
7
+  left: 0;
8
+  border-bottom: 20px dotted rgb(255, 255, 255);
9
+}
10
+
11
+.orders-listBox-RihtboxBoxOrderViewText {
12
+  width: 85vw;
13
+  margin: 35px auto 44px auto;
14
+  padding: 62px 30px 93px 30px;
15
+  background: #ffffff;
16
+  box-shadow: 0px 4px 40px 0px rgba(0, 0, 0, 0.12);
17
+  border-radius: 40px 40px 0px 0px;
18
+  position: relative;
19
+
20
+  .View-LiftTextTop {
21
+    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
22
+    padding-bottom: 20px;
23
+    padding-top: 0;
24
+  }
25
+  View:nth-child(6) {
26
+    padding-bottom: 40px;
27
+
28
+    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
29
+  }
30
+  > View {
31
+    padding: 15px 0;
32
+    font-size: 32px;
33
+    font-weight: bold;
34
+    color: #666666;
35
+    > Text {
36
+      color: #222222;
37
+    }
38
+
39
+    .feiyongStyle {
40
+      justify-content: space-between;
41
+      display: flex;
42
+      color: #222222;
43
+      &-charges {
44
+        background: linear-gradient(180deg, #fa7878 0%, #b61515 100%);
45
+        -webkit-background-clip: text;
46
+        -webkit-text-fill-color: transparent;
47
+      }
48
+      &-stateStyle {
49
+      }
50
+    }
51
+  }
52
+}
53
+
54
+.BottomtBut {
55
+  width: 99vw;
56
+  position: absolute;
57
+  bottom: 5vh;
58
+  display: flex;
59
+}

+ 15
- 17
src/pages/index/index.jsx 查看文件

@@ -1,7 +1,10 @@
1
-import { View, Text, Button } from '@tarojs/components'
1
+import { View, Text, Image } from '@tarojs/components'
2 2
 import { useEffect, useRef, useState } from 'react'
3
-
3
+import dayjs from 'dayjs'
4
+import { Icon } from "@antmjs/vantui";
5
+import Taro from '@tarojs/taro';
4 6
 // import userBck from '../../assets/userBck.png'
7
+import barcodeimg from '../../assets/barcodeimg.png'
5 8
 
6 9
 
7 10
 import './style.less'
@@ -12,18 +15,10 @@ export default (props) => {
12 15
 
13 16
   const [showTime, setShowTime] = useState("")
14 17
   const timer = useRef();
18
+  const userId = '320888800110023011';
15 19
   useEffect(() => {
16 20
     setInterval(() => {
17
-      const ymd = new Date()
18
-      const time = ymd.toTimeString().slice(0, 8)
19
-      var year = ymd.getFullYear();
20
-      var month = ymd.getMonth();
21
-      var day = ymd.getDate();
22
-      const times = `${year}-${month}-${day} ${time}`
23
-      // //获取时分秒
24
-      // var h = time.getHours();
25
-      // var m = time.getMinutes();
26
-      // var s = time.getSeconds();
21
+      const times = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss');
27 22
 
28 23
       setShowTime(times)
29 24
     }, 1000)
@@ -36,9 +31,9 @@ export default (props) => {
36 31
   const goUserInfo = () => {
37 32
 
38 33
     // 跳转到目的页面,在当前页面打开
39
-    // Taro.redirectTo({
40
-    //   url: '/pages/setUserInfo/index'
41
-    // })
34
+    Taro.redirectTo({
35
+      url: '/pages/setUserInfo/index'
36
+    })
42 37
 
43 38
   }
44 39
 
@@ -51,14 +46,17 @@ export default (props) => {
51 46
       <View className='index-UserQRcode-headerInfo' >
52 47
         <View className='index-UserQRcode-headerInfo-User'>
53 48
           <View className='index-UserQRcode-headerInfo-User-NameInfo'>姓名:鲍张抄</View>
54
-          <View className='index-UserQRcode-headerInfo-User-setNameInfo'>+修改信息</View>
49
+          <View onClick={goUserInfo} className='index-UserQRcode-headerInfo-User-setNameInfo'><Icon name='edit' />修改信息</View>
55 50
         </View>
56
-        <View className='index-UserQRcode-headerInfo-UserID'>身份证:320888800110023011</View>
51
+        <View className='index-UserQRcode-headerInfo-UserID'>身份证:{userId.replace(/^(\d{6})\d+(\d{4})$/, "$1******$2")}</View>
57 52
       </View>
58 53
       <View className='index-UserQRcode-cententQR'>
59 54
         <View className='index-UserQRcode-cententQR-Times'>
60 55
           {showTime}
61 56
         </View>
57
+        <View className='index-UserQRcode-cententQR-Barcode'>
58
+          <Image src={barcodeimg} />
59
+        </View>
62 60
       </View>
63 61
     </View>
64 62
   )

+ 17
- 2
src/pages/index/style.less 查看文件

@@ -1,6 +1,9 @@
1 1
 .index-UserQRcode {
2 2
   width: 100vw;
3
+  height: 100vh;
3 4
   margin: 0 auto;
5
+  background-color: #f2f1f6;
6
+
4 7
   &-headerInfo {
5 8
     color: white;
6 9
     height: 35vh;
@@ -30,17 +33,29 @@
30 33
 
31 34
   &-cententQR {
32 35
     width: 95%;
33
-    height: 40vh;
34
-    box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
36
+    height: 65vh;
37
+    // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
35 38
     border-radius: 15px;
36 39
     background-color: white;
37 40
     margin: 0 auto;
38 41
     position: relative;
39 42
     top: -15vh;
40 43
     &-Times {
44
+      padding-top: 3vh;
41 45
       text-align: center;
42 46
       font-weight: 800;
43 47
       font-size: 8vw;
44 48
     }
49
+    &-Barcode {
50
+      width: 80%;
51
+      height: 18vh;
52
+      margin: 0 auto;
53
+      position: relative;
54
+      top: 30%;
55
+      > Image {
56
+        width: 100%;
57
+        height: 100%;
58
+      }
59
+    }
45 60
   }
46 61
 }