소스 검색

二维码

1
mo 1 년 전
부모
커밋
1335a24c3d

+ 3 - 2
src/components/TheQrCode/index.tsx

@@ -1,5 +1,6 @@
 import { defineComponent } from 'vue';
 import { AwesomeQR } from 'vue-qr/src/lib/awesome-qr';
+import { px2vw } from '@/utils/index'
 function toBoolean(val: any): boolean {
   if (val === '') return val;
   return val === 'true' || val == '1';
@@ -205,9 +206,9 @@ export default defineComponent({
   },
   render() {
     return (
-      <>
+      < >
         {this.bindElement && this.imgUrl && (
-          <img style="display: inline-block" src={this.imgUrl} />
+          <img style={{ width: px2vw(this.size), height: px2vw(this.size), display: 'inline-block', zIndex: 1000 }} src={this.imgUrl} />
         )}
       </>
     );

+ 2 - 0
src/utils/index.ts

@@ -320,3 +320,5 @@ export const getTimes = (
   }
   return {};
 };
+
+export const px2vw = (px: number): string => `${(px / 1920) * 100}vw`;

+ 19 - 4
src/views/setting/components/schoolInfo/index.module.less

@@ -355,18 +355,33 @@
         }
 
         .codewrap {
-          width: 147Px;
-          height: 145Px;
-          background: url(../../images/cordWrap.png) no-repeat;
+          width: 147px;
+          height: 145px;
+          // background: url(./images/cordWrap.png) no-repeat;
           position: relative;
-          background-size: 147px 145px;
+          // background-size: 147px 145px;
           margin: 16px 0 18px;
           display: flex;
           flex-direction: column;
           align-items: center;
           justify-content: center;
+
+          .codewrapBg {
+            width: 147px !important;
+            height: 145px !important;
+            top: 0;
+            left: 0;
+            position: absolute;
+          }
+
+          // img {
+
+          // }
+
+
         }
 
+
         .codewrapSubmit {
           width: 213px;
           height: 35px;

+ 4 - 1
src/views/setting/modal/addteacherModel.tsx

@@ -17,9 +17,11 @@ import TheQrCode from '/src/components/TheQrCode';
 import { vaildUrl } from '@/utils/urlUtils';
 import logo from '@/common/images/logo.png';
 import studentTitle from '../images/studentTitle.png';
-import studentInfo from '@/views/studentList/images/strudentCore.png';
+import studentInfo from '@/views/studentList/images/teacherCore.png';
+import codewrap from '@/views/studentList/images/cordWrap.png'
 import btnBg from '@/views/studentList/images/btnBg.png';
 import html2canvas from 'html2canvas';
+
 export default defineComponent({
   props: {
     activeRow: {
@@ -149,6 +151,7 @@ export default defineComponent({
                 <span>数字化乐器课堂音乐老师</span>
               </p>
               <div class={styles.codewrap}>
+                <img src={codewrap} class={styles.codewrapBg} alt="" />
                 <TheQrCode margin={0} logoSrc={logo} text={registerUrl()} size={119} />
               </div>
               <div class={styles.codewrapSubmit}>

BIN
src/views/studentList/images/teacherCore.png


+ 18 - 4
src/views/studentList/index.module.less

@@ -389,16 +389,30 @@
         }
 
         .codewrap {
-          width: 147Px;
-          height: 145Px;
-          background: url(./images/cordWrap.png) no-repeat;
+          width: 147px;
+          height: 145px;
+          // background: url(./images/cordWrap.png) no-repeat;
           position: relative;
-          background-size: 147px 145px;
+          // background-size: 147px 145px;
           margin: 16px 0 18px;
           display: flex;
           flex-direction: column;
           align-items: center;
           justify-content: center;
+
+          .codewrapBg {
+            width: 147px !important;
+            height: 145px !important;
+            top: 0;
+            left: 0;
+            position: absolute;
+          }
+
+          // img {
+
+          // }
+
+
         }
 
         .codewrapSubmit {

+ 1 - 1
src/views/studentList/index.tsx

@@ -42,7 +42,7 @@ export default defineComponent({
       },
       tableList: [] as any,
       classList: [],
-      addStudentVisible: true
+      addStudentVisible: false
     });
     const route = useRoute();
     const router = useRouter();

+ 3 - 1
src/views/studentList/modals/addStudentModel.tsx

@@ -20,6 +20,7 @@ import studentTitle from '../images/studentTitle.png';
 import studentInfo from '../images/strudentCore.png';
 import btnBg from '../images/btnBg.png';
 import html2canvas from 'html2canvas';
+import codewrap from '../images/cordWrap.png'
 export default defineComponent({
   props: {
     activeRow: {
@@ -146,7 +147,8 @@ export default defineComponent({
                 <span>数字化乐器课堂</span>
               </p>
               <div class={styles.codewrap}>
-                <TheQrCode margin={0} logoSrc={logo} text={url.value} size={119} />
+                <img src={codewrap} class={styles.codewrapBg} alt="" />
+                <TheQrCode margin={0} logoSrc={logo} class={styles.codewrapImg} text={url.value} size={119} />
               </div>
               <div class={styles.codewrapSubmit}>
                 <NImage previewDisabled src={btnBg}></NImage>