瀏覽代碼

Merge branch 'liu-EventTracking' into dev

skyblued 2 年之前
父節點
當前提交
6c89a4f095

+ 1 - 1
src/components/col-share/share-item.tsx

@@ -111,7 +111,7 @@ export default defineComponent({
                 <p class={styles.name}>{this.getString}</p>
                 <p class={styles.titleTips}>
                   <span>{state.user.data.username}</span>
-                  酷乐秀入驻老师
+                  { state.platformType == 'TEACHER' ? " 酷乐秀入驻老师" : " 为您推荐"}
                 </p>
               </div>
             )

+ 8 - 8
src/router/routes-common.ts

@@ -204,14 +204,6 @@ export const router = [
     meta: {
       title: '优惠券'
     }
-  },
-  {
-    path: '/contactus',
-    name: 'contactus',
-    component: () => import('@/views/contactus/index'),
-    meta: {
-      title: '联系我们'
-    }
   }
 ]
 
@@ -282,5 +274,13 @@ export const rootRouter = [
     meta: {
       title: '乐理详情'
     }
+  },
+  {
+    path: '/contactus',
+    name: 'contactus',
+    component: () => import('@/views/contactus/index'),
+    meta: {
+      title: '联系我们'
+    }
   }
 ]

+ 1 - 1
src/router/routes-teacher.ts

@@ -293,7 +293,7 @@ export default [
       {
         path: '/mySheetMusic',
         component: () =>
-          import('@/teacher/my-sheetMusic/index'),
+          import('@/teacher/my-sheetMusic'),
         meta: {
           title: '我的乐谱',
         }

+ 8 - 0
src/student/live-class/live-detail.module.less

@@ -49,4 +49,12 @@
       }
     }
   }
+  .shareCourse {
+    margin: 0;
+    padding: 8px;
+    background: #fff;
+    :global(.itemTitle) {
+      max-width: 110px !important;
+    }
+  }
 }

+ 53 - 3
src/student/live-class/live-detail.tsx

@@ -3,7 +3,7 @@ import SectionDetail from '@/business-components/section-detail'
 import UserDetail from '@/business-components/user-detail'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
-import { Icon, Sticky, Button, Dialog, Toast } from 'vant'
+import { Icon, Sticky, Button, Dialog, Toast, Popup } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './live-detail.module.less'
 import iconTips from '@common/images/icon_tips.png'
@@ -11,6 +11,10 @@ import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
 import ColHeader from '@/components/col-header'
 import { postMessage } from '@/helpers/native-message'
 import ColSticky from '@/components/col-sticky'
+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'
 interface IProps {
   courseTime: string
   coursePlan: string
@@ -28,28 +32,36 @@ export default defineComponent({
       recomUserId: query.recomUserId, // 推荐人id
       groupId: query.groupId,
       courseId: query.classId,
-      live: {} as any
+      live: {} as any,
+      shareStatus: false,
+      shareUrl: '',
     }
   },
   computed: {
     userInfo() {
       const live = this.live as any
+      console.log('live', live)
       const planList = live.planList || []
       const startTime = planList[0]?.startTime || new Date()
       const endTime = planList[0]?.endTime || new Date()
       return {
+        avatar: live.avatar,
         headUrl: live.avatar,
         username: live.userName || `游客${live.teacherId || ''}`,
+        id: live.teacherId,
         startTime:
           `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(startTime).format(
             'HH:mm'
           )}~${dayjs(endTime).format('HH:mm')}` || '',
         buyNum: live.studentCount,
+        lessonId: live.courseGroupId,
         lessonPrice: live.coursePrice,
         lessonNum: live.courseNum,
         lessonDesc: live.courseIntroduce,
         lessonCoverUrl: live.backgroundPic || live.backgroundPicTemplate,
         lessonName: live.courseGroupName,
+        subjectName: live.subjectName,
+        courseStartTime: live.courseStartTime,
         auditVersion: live.auditVersion || 0,
         isDegree: live.degreeFlag ? true : false,
         isTeacher: live.teacherFlag ? true : false
@@ -96,6 +108,11 @@ export default defineComponent({
   },
   async mounted() {
     await this._init()
+    if (/(localhost|192)/g.test(location.origin)) {
+      this.shareUrl = `https://dev.colexiu.com/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}`
+    } else {
+      this.shareUrl = `${location.origin}/teacher/#/shareLive?recomUserId=${state.user.data?.userId}&groupId=${this.groupId}`
+    }
   },
   methods: {
     async _init() {
@@ -246,7 +263,11 @@ export default defineComponent({
   render() {
     return (
       <div class={[styles['live-detail'], 'mb12']}>
-        <ColHeader />
+        <ColHeader v-slots={{
+          right: () => (
+            <img src={iconShare} onClick={() => this.shareStatus = true} />
+          )
+        }} />
         <UserDetail userInfo={this.userInfo} showBuy={false} />
         <SectionDetail border>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
@@ -314,6 +335,35 @@ export default defineComponent({
             </div>
           </ColSticky>
         )}
+
+        <Popup
+          v-model:show={this.shareStatus}
+          style={{ background: 'transparent' }}
+        >
+          <ColShare
+            teacherId={this.userInfo.id}
+            shareUrl={this.shareUrl}
+            shareType="live"
+          >
+            <LiveItem
+              class={styles.shareCourse}
+              liveInfo={{
+                backgroundPic: this.userInfo.lessonCoverUrl,
+                courseGroupId: this.userInfo.lessonId,
+                courseGroupName: this.userInfo.lessonName,
+                courseNum: this.userInfo.lessonNum,
+                coursePrice: this.userInfo.lessonPrice,
+                teacherName: this.userInfo.username,
+                teacherId: this.userInfo.id,
+                avatar: this.userInfo.avatar,
+                studentCount: this.userInfo.buyNum,
+                courseStartTime: this.userInfo.courseStartTime,
+                existBuy: 0,
+                subjectName: this.userInfo.subjectName
+              }}
+            />
+          </ColShare>
+        </Popup>
       </div>
     )
   }

+ 13 - 0
src/student/video-class/video-detail.module.less

@@ -27,4 +27,17 @@
       }
     }
   }
+  .shareCourse {
+    margin: 0;
+    padding: 8px;
+    background: #fff;
+    :global(.itemTitle) {
+      max-width: 110px !important;
+    }
+  }
+
+  .coverClass {
+    width: 164px !important;
+    height: 92px !important;
+  }
 }

+ 47 - 3
src/student/video-class/video-detail.tsx

@@ -1,7 +1,7 @@
 import CourseVideoItem from '@/business-components/course-video-item'
 import SectionDetail from '@/business-components/section-detail'
 import UserDetail from '@/business-components/user-detail'
-import { Sticky, Button, Dialog } from 'vant'
+import { Sticky, Button, Dialog, Popup } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './video-detail.module.less'
 import request from '@/helpers/request'
@@ -9,6 +9,10 @@ import ColHeader from '@/components/col-header'
 import { onSubmitZero, orderStatus } from '@/views/order-detail/orderStatus'
 import { tradeOrder } from '../trade/tradeOrder'
 import ColSticky from '@/components/col-sticky'
+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'
 export default defineComponent({
   name: 'VideoDetail',
   data() {
@@ -19,11 +23,18 @@ export default defineComponent({
       recomUserId: query.recomUserId, // 推荐人id
       params: {
         groupId: query.groupId
-      }
+      },
+      shareStatus: false,
+      shareUrl: '',
     }
   },
   async mounted() {
     await this._init()
+    if (/(localhost|192)/g.test(location.origin)) {
+      this.shareUrl = `https://dev.colexiu.com/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}`
+    } else {
+      this.shareUrl = `${location.origin}/teacher#/shareVideo?recomUserId=${state.user.data?.userId}&groupId=${this.params.groupId}`
+    }
   },
   methods: {
     async _init() {
@@ -161,7 +172,11 @@ export default defineComponent({
   render() {
     return (
       <div class={[styles['video-detail']]}>
-        <ColHeader />
+        <ColHeader v-slots={{
+          right: () => (
+            <img src={iconShare} onClick={() => this.shareStatus = true} />
+          )
+        }} />
         <UserDetail userInfo={this.userInfo} />
         <SectionDetail border>
           <p class={styles.introduction}>{this.userInfo.lessonDesc}</p>
@@ -198,6 +213,35 @@ export default defineComponent({
             </div>
           </ColSticky>
         )}
+
+        <Popup
+          v-model:show={this.shareStatus}
+          style={{ background: 'transparent' }}
+        >
+          <ColShare
+            teacherId={this.userInfo.id}
+            shareUrl={this.shareUrl}
+            shareType="video"
+          >
+            <LiveItem
+              class={styles.shareCourse}
+              coverClass={styles.coverClass}
+              liveInfo={{
+                backgroundPic: this.userInfo.lessonCoverUrl,
+                courseGroupId: this.userInfo.lessonId,
+                courseGroupName: this.userInfo.lessonName,
+                courseNum: this.userInfo.lessonNum,
+                coursePrice: this.userInfo.lessonPrice,
+                teacherName: this.userInfo.username,
+                teacherId: this.userInfo.id,
+                avatar: this.userInfo.headUrl,
+                studentCount: this.userInfo.buyNum,
+                existBuy: 0,
+                subjectName: this.userInfo.lessonSubjectName
+              }}
+            />
+          </ColShare>
+        </Popup>
       </div>
     )
   }

二進制
src/views/contactus/image/iconUs.png


二進制
src/views/contactus/image/kefu1.png


二進制
src/views/contactus/image/kefu2.png


+ 51 - 0
src/views/contactus/index.module.less

@@ -0,0 +1,51 @@
+.container {
+  padding: 16px;
+  min-height: 100vh;
+  background-color: #fff;
+  box-sizing: border-box;
+}
+.topWrap {
+  display: flex;
+  background: linear-gradient(180deg, #ffbd8d 0%, #ff835d 100%);
+  border-radius: 8px;
+  margin-bottom: 16px;
+  .title {
+    font-size: 14px;
+    color: #ffffff;
+    line-height: 18px;
+    padding: 15px 0 15px 15px;
+  }
+  .img{
+    max-width: 88px;
+    align-self: flex-end;
+  }
+}
+.centerWrap{
+    display: flex;
+    justify-content: space-between;
+    padding: 14px 25px 0 25px;
+    border-radius: 8px;
+    background-color: #F6F8F9;
+    .item{
+        flex-shrink: 0;
+        img{
+            display: block;
+            width: 132px;
+        }
+    }
+    .name{
+        margin-bottom: 10px;
+        font-size: 14Px;
+        color: #666;
+    }
+    .btn{
+        padding: 14px 20px;
+    }
+}
+
+.tips{
+    padding: 20px 18px;
+    color:#999;
+    line-height: 18Px;
+    font-size: 13Px;
+}

+ 79 - 2
src/views/contactus/index.tsx

@@ -1,8 +1,85 @@
-import { defineComponent } from 'vue'
+import { defineComponent, ref } from 'vue'
+import styles from './index.module.less'
+import iconUs from './image/iconUs.png'
+import kefu1 from './image/kefu1.png'
+import kefu2 from './image/kefu2.png'
+import { Button, Toast } from 'vant'
+import { promisefiyPostMessage } from '@/helpers/native-message'
 
 export default defineComponent({
   name: 'contactus',
   setup(props, ctx) {
-    return () => <div>联系我们</div>
+    const loading = ref(false)
+    const users = [
+      { name: '客服人员 1', src: kefu1 },
+      { name: '客服人员 2', src: kefu2 }
+    ]
+    const onSaveImg = (src: string) => {
+      loading.value = true
+      fetch(src)
+        .then(response => response.blob())
+        .then(res => {
+          try {
+            const fileReader = new FileReader()
+            fileReader.readAsDataURL(res)
+            fileReader.onload = async () => {
+              await download(fileReader.result as string)
+              loading.value = false
+            }
+          } catch (error) {
+            loading.value = false
+          }
+        })
+        .catch(_ => (loading.value = false))
+    }
+
+    const download = async (base64: string) => {
+      const result = await promisefiyPostMessage({
+        api: 'savePicture',
+        content: {
+          base64
+        }
+      })
+      if (result?.content?.status === 'success') {
+        Toast.success('保存成功')
+      } else {
+        Toast.fail('保存失败')
+      }
+    }
+
+    return () => (
+      <div class={styles.container}>
+        <div class={styles.topWrap}>
+          <div class={styles.title}>
+            如您在使用酷乐秀学院时有任何问题或意见,可添加以下企业微信账号与我们取得联系,我们将竭诚为您服务。
+          </div>
+          <img class={styles.img} src={iconUs} />
+        </div>
+
+        <div class={styles.centerWrap}>
+          {users.map(n => (
+            <div class={styles.item}>
+              <div class={styles.name}>{n.name}</div>
+              <img src={n.src} />
+              <div class={styles.btn}>
+                <Button
+                  block
+                  round
+                  type="primary"
+                  size="small"
+                  onClick={() => onSaveImg(n.src)}
+                  disabled={loading.value}
+                >
+                  保存二维码
+                </Button>
+              </div>
+            </div>
+          ))}
+        </div>
+        <div class={styles.tips}>
+          提示:点击保存二维码后会自动下载到相册,打开企业微信扫一扫即可添加企业微信联系客服喔~
+        </div>
+      </div>
+    )
   }
 })

+ 6 - 7
src/views/member-center/index.tsx

@@ -210,13 +210,12 @@ export default defineComponent({
         <ColHeader
           background="#ffe5cc"
           v-slots={{
-            right: () =>
-              state.platformType === 'TEACHER' && (
-                <div class={styles.shareBtn} onClick={this.onShare}>
-                  <Image src={iconShare} />
-                  分享
-                </div>
-              )
+            right: () => (
+              <div class={styles.shareBtn} onClick={this.onShare}>
+                <Image src={iconShare} />
+                分享
+              </div>
+            )
           }}
         />
         <div class={styles.member_container}>

+ 1 - 1
src/views/music/component/song/index.tsx

@@ -165,7 +165,7 @@ export default defineComponent({
             </div>
           ))}
 
-          <Popup v-model:show={isMore.value} position="bottom" round>
+          <Popup v-model:show={isMore.value} position="bottom" round teleport='body'>
             <CellGroup border={false}>
               <Cell
                 center

+ 2 - 2
src/views/shop-mall/components/goods/index.tsx

@@ -46,7 +46,7 @@ export default defineComponent({
             </del> */}
             <p class={styles.goodsPrice}><span class={styles.pre}>¥</span>{moneyFormat(item.price)}</p>
 
-            {this.showAdd && (
+            {/* {this.showAdd && (
               <Icon
                 class={[
                   styles.addCart,
@@ -59,7 +59,7 @@ export default defineComponent({
                   item.stock > 0 && this.onBuyClick(item)
                 }}
               />
-            )}
+            )} */}
           </div>
         </div>
       </div>

+ 14 - 15
src/views/shop-mall/goods-detail/index.tsx

@@ -206,20 +206,15 @@ export default defineComponent({
       <div class={styles.goodsDetail}>
         <ColHeader
           v-slots={{
-            right: () => {
-              if (state.platformType === 'TEACHER' || this.$route.query.teacher) {
-                return (
-                  <div
-                    class={styles.shareBtn}
-                    onClick={() => (this.shareShow = true)}
-                  >
-                    <Icon name={iconShare} size={14} color="#666" />
-                    <span style={{ marginLeft: '3px' }}>分享</span>
-                  </div>
-                )
-              }
-              return null
-            }
+            right: () => (
+              <div
+                class={styles.shareBtn}
+                onClick={() => (this.shareShow = true)}
+              >
+                <Icon name={iconShare} size={14} color="#666" />
+                <span style={{ marginLeft: '3px' }}>分享</span>
+              </div>
+            )
           }}
         />
         <Swipe
@@ -404,7 +399,11 @@ export default defineComponent({
           >
             <div class={styles.shareWrap}>
               <div class={styles.shareLeft}>
-                <img crossorigin="anonymous" class={styles.sharePic} src={sharePic}></img>
+                <img
+                  crossorigin="anonymous"
+                  class={styles.sharePic}
+                  src={sharePic}
+                ></img>
               </div>
               <div class={styles.shareRight}>
                 <div class={styles.shareShopTitle}>{this.product.name}</div>