lex 2 år sedan
förälder
incheckning
5d8153e82a

+ 2 - 1
src/components/col-video/index.tsx

@@ -6,6 +6,7 @@ import { Button, Icon } from 'vant'
 
 import iconVideoPlay from '@/common/images/icon_video_play.png'
 import { browser } from '@/helpers/utils'
+import { state } from '@/state'
 export default defineComponent({
   name: 'col-video',
   props: {
@@ -249,7 +250,7 @@ export default defineComponent({
                   size="small"
                   onClick={this.onBuy}
                 >
-                  立即购买
+                  {state.platformType === 'STUDENT' ? '立即购买' : '返回'}
                 </Button>
                 <div class={styles.replay} onClick={this.onReplay}>
                   <Icon

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

@@ -187,6 +187,14 @@ export const router = [
     meta: {
       title: '直播课'
     }
+  },
+  {
+    path: '/memberCenter',
+    name: 'memberCenter',
+    component: () => import('@/views/member-center/index'),
+    meta: {
+      title: '会员中心'
+    }
   }
 ]
 

+ 0 - 8
src/router/routes-student.ts

@@ -57,14 +57,6 @@ export default [
         }
       },
       {
-        path: '/memberCenter',
-        name: 'memberCenter',
-        component: () => import('@/student/member-center/index'),
-        meta: {
-          title: '会员中心'
-        }
-      },
-      {
         path: '/memberRecord',
         name: 'memberRecord',
         component: () => import('@/student/member-center/member-record'),

+ 109 - 3
src/teacher/income-consus/echarts.ts

@@ -20,7 +20,16 @@ export const lineChartOption = {
     type: 'category',
     axisLine: { lineStyle: { color: '#8C8C8C' } }
   },
-  color: ['#5B8FF9', '#2DC7AA', '#91DD1C', '#FFA92C'],
+  color: [
+    '#5B8FF9',
+    '#2DC7AA',
+    '#91DD1C',
+    '#FFA92C',
+    '#BE7E2E',
+    '#1C96DD',
+    '#D22CFF',
+    '#FF3C3C'
+  ],
   series: [
     {
       lineStyle: { width: 1 },
@@ -105,6 +114,90 @@ export const lineChartOption = {
       name: '乐谱',
       type: 'line',
       emphasis: { lineStyle: { width: 1 } }
+    },
+    {
+      lineStyle: { width: 1 },
+      data: [
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00'
+      ],
+      symbol: 'circle',
+      name: '小酷Ai推广',
+      type: 'line',
+      emphasis: { lineStyle: { width: 1 } }
+    },
+    {
+      lineStyle: { width: 1 },
+      data: [
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00'
+      ],
+      symbol: 'circle',
+      name: '直播课推荐',
+      type: 'line',
+      emphasis: { lineStyle: { width: 1 } }
+    },
+    {
+      lineStyle: { width: 1 },
+      data: [
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00'
+      ],
+      symbol: 'circle',
+      name: '视频课推荐',
+      type: 'line',
+      emphasis: { lineStyle: { width: 1 } }
+    },
+    {
+      lineStyle: { width: 1 },
+      data: [
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00',
+        '0.00'
+      ],
+      symbol: 'circle',
+      name: '商品推荐',
+      type: 'line',
+      emphasis: { lineStyle: { width: 1 } }
     }
   ],
   title: { show: false },
@@ -144,7 +237,11 @@ export const pieChartOption = {
         { name: '陪练课', value: '0.00' },
         { name: '直播课', value: '0.00' },
         { name: '视频课', value: '0.00' },
-        { name: '乐谱', value: '0.00' }
+        { name: '乐谱', value: '0.00' },
+        { name: '小酷Ai推广', value: '0.00' },
+        { name: '直播课推荐', value: '0.00' },
+        { name: '视频课推荐', value: '0.00' },
+        { name: '商品推荐', value: '0.00' }
       ],
       type: 'pie',
       radius: ['50%', '80%']
@@ -158,7 +255,16 @@ export const pieChartOption = {
     top: '0%'
   },
   toolbox: { feature: { saveAsImage: { show: false } } },
-  color: ['#5B8FF9', '#2DC7AA', '#91DD1C', '#FFA92C']
+  color: [
+    '#5B8FF9',
+    '#2DC7AA',
+    '#91DD1C',
+    '#FFA92C',
+    '#BE7E2E',
+    '#1C96DD',
+    '#D22CFF',
+    '#FF3C3C'
+  ]
 }
 
 // {

BIN
src/teacher/income-consus/images/icon_fly.png


BIN
src/teacher/income-consus/images/icon_user.png


+ 68 - 6
src/teacher/income-consus/index.module.less

@@ -71,6 +71,18 @@
   .color3 {
     background: linear-gradient(180deg, #ffc979 0%, #ffa92c 100%);
   }
+  .color4 {
+    background: linear-gradient(180deg, #e6c474 0%, #be7e2e 100%);
+  }
+  .color5 {
+    background: linear-gradient(180deg, #4bcdff 0%, #1c96dd 100%);
+  }
+  .color6 {
+    background: linear-gradient(180deg, #ee90ff 0%, #d22cff 100%);
+  }
+  .color7 {
+    background: linear-gradient(180deg, #ff6f6f 0%, #ff3c3c 100%);
+  }
 
   .type {
     span {
@@ -116,7 +128,8 @@
 }
 
 .pieSection {
-  padding: 18px 10px 20px 5px;
+  padding: 18px 0px 0px;
+  margin: 0 10px 20px;
   display: flex;
   align-items: center;
 }
@@ -125,6 +138,35 @@
   height: 160px;
 }
 
+.rateAll {
+  font-size: 14px;
+  color: #666;
+  line-height: 1;
+  display: flex;
+  align-items: flex-start;
+  flex-direction: column;
+
+  img {
+    width: 20px;
+    height: 20px;
+    margin-right: 4px;
+  }
+
+  & > div {
+    padding-bottom: 12px;
+    display: flex;
+    align-items: center;
+  }
+
+  .rate {
+    padding-left: 8px;
+    font-size: 14px;
+    font-weight: 600;
+    color: #333333;
+    line-height: 20px;
+  }
+}
+
 .pieData {
   font-size: 14px;
   color: #808080;
@@ -132,10 +174,18 @@
   padding-left: 20px;
   display: flex;
   align-items: flex-start;
-  flex-direction: column;
+  flex-wrap: wrap;
+  padding-bottom: 12px;
 
   & > div {
     padding-bottom: 12px;
+    flex-basis: 45%;
+    &:nth-child(2n + 2) {
+      flex-basis: 55%;
+      .pieTitle {
+        min-width: 90px;
+      }
+    }
   }
   & > div:last-child {
     padding-bottom: 0;
@@ -146,16 +196,28 @@
     width: 11px;
     height: 11px;
     border-radius: 50%;
-    background: linear-gradient(180deg, #b5c4ff 0%, #5b85f9 100%);
+    background: #5b8ff9;
   }
   .pieLive {
-    background: linear-gradient(166deg, #59e5d5 0%, #2dc7aa 100%);
+    background: #2dc7aa;
   }
   .pieVideo {
-    background: linear-gradient(163deg, #b9ff4b 0%, #91dd1c 100%);
+    background: #91dd1c;
   }
   .pieMusic {
-    background: linear-gradient(180deg, #ffc979 0%, #ffa92c 100%);
+    background: #ffa92c;
+  }
+  .pie1 {
+    background: #be7e2e;
+  }
+  .pie2 {
+    background: #1c96dd;
+  }
+  .pie3 {
+    background: #d22cff;
+  }
+  .pie4 {
+    background: #ff3c3c;
   }
   .pieTitle {
     display: inline-block;

+ 99 - 18
src/teacher/income-consus/index.tsx

@@ -73,6 +73,12 @@ import request from '@/helpers/request'
 import dayjs from 'dayjs'
 import { formatterDate, moneyFormat } from '@/helpers/utils'
 
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `./images/${fileName}`
+  const modules = import.meta.globEager('./images/*')
+  return modules[path].default
+}
+
 const yearColumns: any = []
 const year = dayjs().year()
 let defaultIndex = 10
@@ -245,6 +251,45 @@ export default defineComponent({
                 </div>
               </Col>
             </Row>
+
+            <Row class={styles.numberCount} style={{ paddingTop: '0' }}>
+              <Col span={6}>
+                <i class={styles.color4}></i>
+                <div class={styles.type}>
+                  <span>小酷Ai推广</span>
+                  <span class={styles.price}>
+                    {moneyFormat(this.moneyInfo.practiceAmount)}
+                  </span>
+                </div>
+              </Col>
+              <Col span={6}>
+                <i class={styles.color5}></i>
+                <div class={styles.type}>
+                  <span>直播课推荐</span>
+                  <span class={styles.price}>
+                    {moneyFormat(this.moneyInfo.liveAmount)}
+                  </span>
+                </div>
+              </Col>
+              <Col span={6}>
+                <i class={styles.color6}></i>
+                <div class={styles.type}>
+                  <span>视频课推荐</span>
+                  <span class={styles.price}>
+                    {moneyFormat(this.moneyInfo.videoAmount)}
+                  </span>
+                </div>
+              </Col>
+              <Col span={6}>
+                <i class={styles.color7}></i>
+                <div class={styles.type}>
+                  <span>商品推荐</span>
+                  <span class={styles.price}>
+                    {moneyFormat(this.moneyInfo.musicAmount)}
+                  </span>
+                </div>
+              </Col>
+            </Row>
           </div>
 
           <div id="incomeClass" class={styles.incomeLine}></div>
@@ -253,32 +298,68 @@ export default defineComponent({
             <i></i>收入结构
           </div>
 
-          <div class={styles.pieSection}>
+          <div class={[styles.pieSection, 'van-hairline--bottom']}>
             <div id="structrueClass" class={styles.pieIncome}></div>
 
-            <div class={styles.pieData}>
-              <div>
-                <i class={styles.piePractice}></i>
-                <span class={styles.pieTitle}>陪练课</span>
-                <span>{this.moneyInfo.practiceRate}%</span>
-              </div>
+            <div class={styles.rateAll}>
               <div>
-                <i class={styles.pieLive}></i>
-                <span class={styles.pieTitle}>直播课</span>
-                <span>{this.moneyInfo.liveRate}%</span>
+                <img src={getAssetsHomeFile('icon_user.png')} />
+                <span>个人收入总占比</span>
+                <span class={styles.rate}>80%</span>
               </div>
               <div>
-                <i class={styles.pieVideo}></i>
-                <span class={styles.pieTitle}>视频课</span>
-                <span>{this.moneyInfo.videoRate}%</span>
-              </div>
-              <div>
-                <i class={styles.pieMusic}></i>
-                <span class={styles.pieTitle}>乐谱</span>
-                <span>{this.moneyInfo.musicRate}%</span>
+                <img src={getAssetsHomeFile('icon_fly.png')} />
+                <span>推广收益总占比</span>
+                <span class={styles.rate}>80%</span>
               </div>
             </div>
           </div>
+
+          <div class={styles.pieData}>
+            <div>
+              <i class={styles.piePractice}></i>
+              <span class={styles.pieTitle}>陪练课</span>
+              <span>{this.moneyInfo.practiceRate}%</span>
+            </div>
+            <div>
+              <i class={styles.pie1}></i>
+              <span class={styles.pieTitle}>小酷Ai推广</span>
+              <span>{this.moneyInfo.practiceRate}%</span>
+            </div>
+
+            <div>
+              <i class={styles.pieLive}></i>
+              <span class={styles.pieTitle}>直播课</span>
+              <span>{this.moneyInfo.liveRate}%</span>
+            </div>
+            <div>
+              <i class={styles.pie2}></i>
+              <span class={styles.pieTitle}>直播课推荐</span>
+              <span>{this.moneyInfo.practiceRate}%</span>
+            </div>
+
+            <div>
+              <i class={styles.pieVideo}></i>
+              <span class={styles.pieTitle}>视频课</span>
+              <span>{this.moneyInfo.videoRate}%</span>
+            </div>
+            <div>
+              <i class={styles.pie3}></i>
+              <span class={styles.pieTitle}>视频课推荐</span>
+              <span>{this.moneyInfo.practiceRate}%</span>
+            </div>
+
+            <div>
+              <i class={styles.pieMusic}></i>
+              <span class={styles.pieTitle}>乐谱</span>
+              <span>{this.moneyInfo.musicRate}%</span>
+            </div>
+            <div>
+              <i class={styles.pie4}></i>
+              <span class={styles.pieTitle}>商品推荐</span>
+              <span>{this.moneyInfo.practiceRate}%</span>
+            </div>
+          </div>
         </div>
 
         <Popup

+ 11 - 0
src/teacher/main.ts

@@ -4,6 +4,7 @@ import dayjs from 'dayjs'
 import 'dayjs/locale/zh-cn'
 import router from '../router/index-teacher'
 import vueFilter from '@/helpers/vueFilter'
+import { postMessage } from '@/helpers/native-message'
 
 import 'normalize.css'
 
@@ -24,6 +25,16 @@ const app = createApp(App)
 //   }
 // });
 
+postMessage(
+  {
+    api: 'getVersion'
+  },
+  (res: any) => {
+    state.version = res.content.version
+    console.log(res, 'version')
+  }
+)
+
 // import Vconsole from 'vconsole'
 // const vconsole = new Vconsole()
 state.platformType = 'TEACHER'

BIN
src/views/member-center/images/1.png


BIN
src/views/member-center/images/2.png


BIN
src/views/member-center/images/3.png


BIN
src/views/member-center/images/4.png


BIN
src/views/member-center/images/5.png


BIN
src/views/member-center/images/6.png


BIN
src/views/member-center/images/7.png


BIN
src/views/member-center/images/8.png


BIN
src/views/member-center/images/icon_video.png


BIN
src/views/member-center/images/member_bg.png


BIN
src/views/member-center/images/record_bg.png


BIN
src/views/member-center/images/tip_bg.png


+ 0 - 0
src/student/member-center/index.module.less → src/views/member-center/index.module.less


+ 5 - 3
src/student/member-center/index.tsx → src/views/member-center/index.tsx

@@ -20,6 +20,8 @@ export default defineComponent({
   name: 'MemberCenter',
   data() {
     return {
+      apiSuffix:
+        state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher',
       agreeStatus: false,
       functionList: [],
       memberList: [],
@@ -46,7 +48,7 @@ export default defineComponent({
   async mounted() {
     try {
       const res = await request.post(
-        '/api-student/memberPriceSettings/vipPermissions'
+        `${this.apiSuffix}/memberPriceSettings/vipPermissions`
       )
       const result = res.data || []
       this.functionList = result.map((item: any) => {
@@ -57,7 +59,7 @@ export default defineComponent({
       })
 
       const setting = await request.post(
-        '/api-student/memberPriceSettings/list',
+        `${this.apiSuffix}/memberPriceSettings/list`,
         {
           data: {}
         }
@@ -90,7 +92,7 @@ export default defineComponent({
     onSubmit() {
       const member: any = this.selectMember
       // 判断是否有会员
-      let startTime = this.userInfo.memberRankSettingId
+      const startTime = this.userInfo.memberRankSettingId
         ? dayjs(this.userInfo.membershipEndTime).toDate()
         : new Date()
       let endTime = new Date()

+ 3 - 0
src/views/music/album/index.tsx

@@ -28,6 +28,9 @@ export default defineComponent({
       tempParams.version = state.version || '' // 处理ios审核版本
       tempParams.platform = 'ios-student'
     }
+    if (state.platformType === 'TEACHER') {
+      tempParams.myself = false
+    }
     const params = reactive({
       search: (route.query.search as string) || '',
       albumTagIds: route.query.tagids || '',

+ 16 - 7
src/views/music/list/index.tsx

@@ -53,6 +53,9 @@ export default defineComponent({
     const finished = ref(false)
     const isError = ref(false)
     const tagVisibility = ref(false)
+    const apiSuffix = ref(
+      state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
+    )
 
     const onSearch = (value: string) => {
       params.page = 1
@@ -67,16 +70,22 @@ export default defineComponent({
       }
       loading.value = true
       isError.value = false
+      const tempParams = {
+        ...params,
+        idAndName: params.search,
+        createBy: teacherId
+      }
+
+      if (state.platformType === 'TEACHER') {
+        params.myself = false
+      }
+
       try {
-        const res = await request.post('/api-student/music/sheet/list', {
-          data: {
-            ...params,
-            idAndName: params.search,
-            createBy: teacherId
-          }
+        const res = await request.post(`${apiSuffix.value}/music/sheet/list`, {
+          data: tempParams
         })
         if (data.value) {
-          let result = (data.value?.rows || []).concat(res.data.rows || [])
+          const result = (data.value?.rows || []).concat(res.data.rows || [])
           data.value.rows = result
         }
         data.value = data.value || res.data

+ 7 - 1
src/views/music/songbook/album.tsx

@@ -12,12 +12,18 @@ export default defineComponent({
   setup() {
     const route = useRoute()
     const params: any = {}
+    // 只有学生端才有version
     if (tempState.version) {
       params.version = tempState.version || '' // 处理ios审核版本
       params.platform = 'ios-student'
     }
+    const apiSuffix =
+      tempState.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
+    if (tempState.platformType === 'TEACHER') {
+      params.myself = false
+    }
     const { isLoading, state } = useAsyncState(
-      request.post('/api-student/music/album/list', {
+      request.post(`${apiSuffix}/music/album/list`, {
         data: {
           ...params
         }

+ 7 - 1
src/views/music/songbook/list.tsx

@@ -15,12 +15,18 @@ export default defineComponent({
     const router = useRouter()
     const route = useRoute()
     const params: any = {}
+    // 学生端才会有version
     if (tempState.version) {
       params.version = tempState.version || '' // 处理ios审核版本
       params.platform = 'ios-student'
     }
+    const apiSuffix =
+      tempState.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
+    if (tempState.platformType === 'TEACHER') {
+      params.myself = false
+    }
     const { isLoading, state } = useAsyncState(
-      request.post('/api-student/music/sheet/list', {
+      request.post(`${apiSuffix}/music/sheet/list`, {
         data: {
           ...params
         }

+ 2 - 2
src/views/order-detail/payment/index.tsx

@@ -104,7 +104,7 @@ export default defineComponent({
     async onSubmit() {
       // 支付...
       try {
-        let params = {
+        const params = {
           orderNo: this.orderInfo.orderNo,
           payChannel: this.payType,
           paymentClient: null as any
@@ -112,7 +112,7 @@ export default defineComponent({
         if (this.paymentType === 'goodsPay') {
           params.paymentClient = state.platformType
         }
-        let res = await request.post(urlType[this.paymentType].payUrl, {
+        const res = await request.post(urlType[this.paymentType].payUrl, {
           data: {
             ...params
           }