[baozhangchao] 3 år sedan
förälder
incheckning
e513697767

+ 1
- 0
config/index.js Visa fil

@@ -15,6 +15,7 @@ const config = {
15 15
   defineConstants: {
16 16
   },
17 17
   alias: {
18
+    '@/assets': path.resolve(__dirname, '..', 'src/assets'),
18 19
     '@/components': path.resolve(__dirname, '..', 'src/components'),
19 20
     '@/utils': path.resolve(__dirname, '..', 'src/utils'),
20 21
   },

Binär
src/assets/water_logo.png Visa fil


+ 4
- 1
src/components/barcode/index.jsx Visa fil

@@ -57,7 +57,10 @@ export default (props) => {
57 57
       <Canvas style={style} type='2d' id={id}></Canvas>
58 58
       {
59 59
         codeVisible && <CodeText code={code} />
60
-      }      
60
+      }
61
+      {
62
+        !code && <View className='no-barcode'>暂无条码</View>
63
+      }
61 64
     </View>
62 65
   )
63 66
 }

+ 15
- 0
src/components/barcode/style.less Visa fil

@@ -1,4 +1,6 @@
1 1
 .barcode-box {
2
+  position: relative;
3
+
2 4
   .barcode-txt {
3 5
     display: flex;
4 6
     justify-content: space-between;
@@ -12,4 +14,17 @@
12 14
       flex: 1;
13 15
     }
14 16
   }
17
+
18
+  .no-barcode {
19
+    position: absolute;
20
+    width: 100%;
21
+    height: 100%;
22
+    font-size: 2em;
23
+    color: rgba(0, 0, 0, .5);
24
+    line-height: 3em;
25
+    z-index: 100;
26
+    top: 0;
27
+    left: 0;
28
+    text-align: center;
29
+  }
15 30
 }

+ 3
- 10
src/pages/index/index.jsx Visa fil

@@ -4,27 +4,20 @@ import dayjs from 'dayjs'
4 4
 import { Button, Icon } from "@antmjs/vantui";
5 5
 import Taro from '@tarojs/taro';
6 6
 import BarCode from '@/components/barcode'
7
+import logo from '@/assets/water_logo.png'
7 8
 import { useModel } from '../../store';
8 9
 
9 10
 import './style.less'
10 11
 
11 12
 export default (props) => {
12
-  const { deptName, person, formValue } = useModel('userData')
13
-  const [useInfo, setUseInfo] = useState()
14
-
15
-
13
+  const { person, } = useModel('userData')
14
+  const today = useMemo(() => dayjs().format('YYYY-MM-DD'))
16 15
   const goUserInfo = () => {
17
-    // 跳转到目的页面,在当前页面打开
18 16
     Taro.redirectTo({
19 17
       url: '/pages/setUserInfo/index'
20 18
     })
21 19
   }
22
-  useEffect(() => {
23
-    console.log('person?.idNo', person?.idNo);
24 20
 
25
-  }, [person])
26
-
27
-  const today = useMemo(() => dayjs().format('YYYY-MM-DD'))
28 21
 
29 22
   return (
30 23
     <View className='index-UserQRcode'>

+ 9
- 0
src/pages/index/style.less Visa fil

@@ -17,6 +17,15 @@
17 17
       justify-content: space-between;
18 18
       letter-spacing: 1vw;
19 19
 
20
+      image {
21
+        position: absolute;
22
+        top: 0;
23
+        right: 0;
24
+        opacity: 0.2;
25
+        width: 500px;
26
+        height: 500px;
27
+      }
28
+
20 29
       &-NameInfo {
21 30
         font-weight: 600;
22 31
         font-size: 40px;