瀏覽代碼

添加跳转

lex 2 年之前
父節點
當前提交
89a5fe6ae7

+ 11 - 1
src/business-components/user-detail/index.tsx

@@ -53,6 +53,11 @@ export default defineComponent({
     border: {
       type: Boolean,
       default: false
+    },
+    onUserDetail: {
+      // 点击用户头像等信息
+      type: Function,
+      default: (item: any) => {}
     }
   },
   render() {
@@ -99,7 +104,12 @@ export default defineComponent({
                 />
               ),
               title: () => (
-                <div class={styles.name}>
+                <div
+                  class={styles.name}
+                  onClick={() => {
+                    this.onUserDetail(this.userInfo)
+                  }}
+                >
                   <div class={styles.username}>
                     {this.userInfo.username || `游客${this.userInfo.id || ''}`}
                     <div>

+ 17 - 1
src/student/live-class/live-detail.tsx

@@ -15,6 +15,7 @@ import ColShare from '@/components/col-share'
 import LiveItem from '@/views/live-class/live-item'
 import iconShare from '@/views/shop-mall/images/icon-share.svg'
 import { state } from '@/state'
+import { browser } from '@/helpers/utils'
 interface IProps {
   courseTime: string
   coursePlan: string
@@ -270,7 +271,22 @@ export default defineComponent({
             )
           }}
         />
-        <UserDetail userInfo={this.userInfo} showBuy={false} />
+        <UserDetail
+          userInfo={this.userInfo}
+          showBuy={false}
+          onUserDetail={(item: any) => {
+            console.log(item, '11')
+            if (state.platformType === 'STUDENT') {
+              this.$router.push({
+                path: '/teacherHome',
+                query: {
+                  teacherId: item.id,
+                  tabs: 'live'
+                }
+              })
+            }
+          }}
+        />
         <SectionDetail border>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
         </SectionDetail>

+ 16 - 1
src/student/video-class/video-detail.tsx

@@ -13,6 +13,7 @@ import iconShare from '@/views/shop-mall/images/icon-share.svg'
 import ColShare from '@/components/col-share'
 import LiveItem from '@/views/live-class/live-item'
 import { state } from '@/state'
+import { browser } from '@/helpers/utils'
 export default defineComponent({
   name: 'VideoDetail',
   data() {
@@ -181,7 +182,21 @@ export default defineComponent({
             )
           }}
         />
-        <UserDetail userInfo={this.userInfo} />
+        <UserDetail
+          userInfo={this.userInfo}
+          onUserDetail={(item: any) => {
+            console.log(item)
+            if (browser().isApp && state.platformType === 'STUDENT') {
+              this.$router.push({
+                path: '/teacherHome',
+                query: {
+                  teacherId: item.teacherId,
+                  tabs: 'video'
+                }
+              })
+            }
+          }}
+        />
         <SectionDetail border={false}>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
         </SectionDetail>

+ 20 - 3
src/views/music/music-detail/index.tsx

@@ -30,7 +30,7 @@ import { getRandomKey, musicBuy } from '../music'
 import { state } from '@/state'
 import { useEventTracking } from '@/helpers/hooks'
 import ColSticky from '@/components/col-sticky'
-import { moneyFormat } from '@/helpers/utils'
+import { browser, moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
 import iconShare from '@/views/music/album/icon_share.svg'
 import iconAlbum from '@/views/music/component/images/icon_album.png'
@@ -547,7 +547,7 @@ export default defineComponent({
               <iframe
                 id="containerPrint"
                 ref="print"
-                style="width: 100%;page-break-after:always; height: 0"
+                style="width: 540px;page-break-after:always; height: 0;"
                 src={accompanyUrl.value}
               />
               <p class={styles.musicTitle}>
@@ -584,7 +584,24 @@ export default defineComponent({
                 )}
 
                 <div class={[styles.collect, styles.collectCell]}>
-                  <div class={[styles.userInfo]}>
+                  <div
+                    class={[styles.userInfo]}
+                    onClick={() => {
+                      if (
+                        browser().isApp &&
+                        musicDetail.value?.sourceType === 'TEACHER' &&
+                        state.platformType === 'STUDENT'
+                      ) {
+                        router.push({
+                          path: '/teacherHome',
+                          query: {
+                            teacherId: musicDetail.value?.userId,
+                            tabs: 'music'
+                          }
+                        })
+                      }
+                    }}
+                  >
                     <img src={musicDetail.value?.userAvatar || iconTeacher} />
                     <span>{musicDetail.value?.userName}</span>
                   </div>