lex 3 anni fa
parent
commit
18c7db69e5

+ 21 - 18
src/teacher/piano-room/account-recharge-timer/index.tsx

@@ -41,35 +41,38 @@ export default defineComponent({
         const item: any = this.list[0]
         this.selectItem = item
       }
-      useEventListener(document, 'scroll', evt => {
-        const { y } = useWindowScroll()
-        if (y.value > 30) {
-          this.background = '#fff'
-          this.color = '#333'
-          postMessage({
-            api: 'backIconChange',
-            content: { iconStyle: 'black' }
-          })
-        } else {
-          this.background = 'transparent'
-          this.color = '#fff'
-          postMessage({
-            api: 'backIconChange',
-            content: { iconStyle: 'white' }
-          })
-        }
-      })
+      document.addEventListener('scroll', this.scrollInit, false)
     } catch {}
   },
   unmounted() {
     this.background = '#fff'
     this.color = '#333'
+    // this.documentDom = document.body as any
     postMessage({
       api: 'backIconChange',
       content: { iconStyle: 'black' }
     })
+    document.removeEventListener('scroll', this.scrollInit)
   },
   methods: {
+    scrollInit() {
+      const { y } = useWindowScroll()
+      if (y.value > 30) {
+        this.background = '#fff'
+        this.color = '#333'
+        postMessage({
+          api: 'backIconChange',
+          content: { iconStyle: 'black' }
+        })
+      } else {
+        this.background = 'transparent'
+        this.color = '#fff'
+        postMessage({
+          api: 'backIconChange',
+          content: { iconStyle: 'white' }
+        })
+      }
+    },
     async _init() {
       try {
         const res = await request.get(

+ 1 - 1
src/teacher/video-class/video-detail.tsx

@@ -218,7 +218,7 @@ export default defineComponent({
                 coursePrice: this.userInfo.lessonPrice,
                 teacherName: this.userInfo.username,
                 teacherId: this.userInfo.id,
-                avatar: this.userInfo.avatar,
+                avatar: this.userInfo.headUrl,
                 studentCount: this.userInfo.buyNum,
                 existBuy: 0,
                 subjectName: this.userInfo.lessonSubjectName