Browse Source

add DEFnAME

[baozhangchao] 3 years ago
parent
commit
e513697767

+ 1
- 0
config/index.js View File

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

BIN
src/assets/water_logo.png View File


+ 4
- 1
src/components/barcode/index.jsx View File

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

+ 15
- 0
src/components/barcode/style.less View File

1
 .barcode-box {
1
 .barcode-box {
2
+  position: relative;
3
+
2
   .barcode-txt {
4
   .barcode-txt {
3
     display: flex;
5
     display: flex;
4
     justify-content: space-between;
6
     justify-content: space-between;
12
       flex: 1;
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 View File

4
 import { Button, Icon } from "@antmjs/vantui";
4
 import { Button, Icon } from "@antmjs/vantui";
5
 import Taro from '@tarojs/taro';
5
 import Taro from '@tarojs/taro';
6
 import BarCode from '@/components/barcode'
6
 import BarCode from '@/components/barcode'
7
+import logo from '@/assets/water_logo.png'
7
 import { useModel } from '../../store';
8
 import { useModel } from '../../store';
8
 
9
 
9
 import './style.less'
10
 import './style.less'
10
 
11
 
11
 export default (props) => {
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
   const goUserInfo = () => {
15
   const goUserInfo = () => {
17
-    // 跳转到目的页面,在当前页面打开
18
     Taro.redirectTo({
16
     Taro.redirectTo({
19
       url: '/pages/setUserInfo/index'
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
   return (
22
   return (
30
     <View className='index-UserQRcode'>
23
     <View className='index-UserQRcode'>

+ 9
- 0
src/pages/index/style.less View File

17
       justify-content: space-between;
17
       justify-content: space-between;
18
       letter-spacing: 1vw;
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
       &-NameInfo {
29
       &-NameInfo {
21
         font-weight: 600;
30
         font-weight: 600;
22
         font-size: 40px;
31
         font-size: 40px;