瀏覽代碼

Merge branch 'share-member' into jenkins

lex 2 年之前
父節點
當前提交
45841b694b

+ 11 - 8
src/components/col-share/index.tsx

@@ -38,6 +38,7 @@ export default defineComponent({
       swiperIndex: 0,
       image: null as any,
       codeUrl: '',
+      copyCodeUrl: '',
       shareLoading: false,
       shareArray: tempArray || [],
       saveLoading: false,
@@ -46,13 +47,13 @@ export default defineComponent({
   },
   async mounted() {
     try {
-      // const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
-      //   requestType: 'form',
-      //   data: {
-      //     orginURL: this.shareUrl
-      //   }
-      // })
-      // this.codeUrl = shortRes.data
+      const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
+        requestType: 'form',
+        data: {
+          orginURL: this.shareUrl
+        }
+      })
+      this.copyCodeUrl = shortRes.data
       this.codeUrl = this.shareUrl
     } catch {
       //
@@ -151,7 +152,9 @@ export default defineComponent({
               desc: '',
               image,
               video: '',
-              type: 'image'
+              type: 'image',
+              button: ['copy'],
+              url: this.copyCodeUrl
             }
           },
           (res: any) => {

+ 20 - 4
src/teacher/piano-room/model/share/index.tsx

@@ -12,6 +12,7 @@ import iconLogo from '@/common/images/icon_logo.png'
 import iconTeacher from '@/common/images/icon_teacher.png'
 import logo from '../../images/logo.png'
 import { state } from '@/state'
+import request from '@/helpers/request'
 
 export default defineComponent({
   name: 'share',
@@ -23,12 +24,25 @@ export default defineComponent({
   data() {
     return {
       qrCode: '',
+      copyQrCode: '',
       image: null as any
     }
   },
-  mounted() {
-    this.qrCode =
-      location.origin + '/student/#/inviteTeacher?id=' + this.teacherId
+  async mounted() {
+    try {
+      this.qrCode =
+        location.origin + '/student/#/inviteTeacher?id=' + this.teacherId
+      const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
+        requestType: 'form',
+        data: {
+          orginURL: this.qrCode
+        }
+      })
+
+      this.copyQrCode = shortRes.data
+    } catch (e) {
+      //
+    }
 
     const canvas = document.getElementById('canvas')
     QRCode.toCanvas(
@@ -65,7 +79,9 @@ export default defineComponent({
               desc: '酷乐秀小酷Ai帮助我自主练习乐器,真的太好用啦!每天都要坚持练习哦~',
               image,
               video: '',
-              type: 'image'
+              type: 'image',
+              button: ['copy'],
+              url: this.copyQrCode
             }
           },
           (res: any) => {

+ 11 - 8
src/teacher/share-page/track-review-activity/share-model.tsx

@@ -28,6 +28,7 @@ export default defineComponent({
   data() {
     return {
       image: null as any,
+      copyCodeUrl: '',
       codeUrl: '',
       subjectUrl: ''
     }
@@ -38,13 +39,13 @@ export default defineComponent({
       this.subjectUrl =
         this.activeInfo.shareUrl + '@base@tag=imgScale&w=570?t=' + +new Date()
       console.log(this.shareUrl)
-      // const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
-      //   requestType: 'form',
-      //   data: {
-      //     orginURL: this.shareUrl
-      //   }
-      // })
-      // this.codeUrl = shortRes.data
+      const shortRes = await request.post('/api-teacher/sysConfig/shortURL', {
+        requestType: 'form',
+        data: {
+          orginURL: this.shareUrl
+        }
+      })
+      this.copyCodeUrl = shortRes.data
       this.codeUrl = this.shareUrl
     } catch {
       //
@@ -92,7 +93,9 @@ export default defineComponent({
                   desc: '',
                   image,
                   video: '',
-                  type: 'image'
+                  type: 'image',
+                  button: ['copy'],
+                  url: this.copyCodeUrl
                 }
               },
               (res: any) => {