Browse Source

Merge branch 'master' of http://git.dayaedu.com/lex/orchestra-app

skyblued 2 years ago
parent
commit
171dbec658

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

@@ -22,7 +22,14 @@ const noLoginRouter = [
     meta: {
     meta: {
       title: '下载管乐团学生端'
       title: '下载管乐团学生端'
     }
     }
-  }
+  },
+  {
+    path: '/transfer',
+    component: () => import('@/student/download/transfer'),
+    meta: {
+      title: '管乐团'
+    }
+  },
 ]
 ]
 
 
 export default [
 export default [

+ 8 - 0
src/school/train-planning/component/course-preview/index.module.less

@@ -31,6 +31,9 @@
   }
   }
 }
 }
 
 
+.courseTabsContainer {
+  height: 50px;
+}
 .courseTabs {
 .courseTabs {
   :global {
   :global {
     .van-tabs__line {
     .van-tabs__line {
@@ -67,6 +70,11 @@
   }
   }
   .cellTeacher {
   .cellTeacher {
     padding: 10px 12px 15px;
     padding: 10px 12px 15px;
+    :global {
+      .van-button {
+        margin: 4px 0;
+      }
+    }
   }
   }
   .conflictGrouop {
   .conflictGrouop {
     padding: 0 12px;
     padding: 0 12px;

+ 30 - 19
src/school/train-planning/component/course-preview/index.tsx

@@ -1,7 +1,7 @@
 import OHeader from '@/components/o-header'
 import OHeader from '@/components/o-header'
 import OSticky from '@/components/o-sticky'
 import OSticky from '@/components/o-sticky'
 import { Button, Cell, CellGroup, Dialog, Icon, Image, showToast, Tab, Tabs, Tag } from 'vant'
 import { Button, Cell, CellGroup, Dialog, Icon, Image, showToast, Tab, Tabs, Tag } from 'vant'
-import { defineComponent, onMounted, reactive, ref } from 'vue'
+import { defineComponent, onMounted, reactive, ref, nextTick } from 'vue'
 import styles from './index.module.less'
 import styles from './index.module.less'
 import iconTimer from '../../images/icon-timer.png'
 import iconTimer from '../../images/icon-timer.png'
 import iconTeacher from '@common/images/icon_teacher.png'
 import iconTeacher from '@common/images/icon_teacher.png'
@@ -50,18 +50,24 @@ export default defineComponent({
             ? { orchestraId: forms.selectOrchestraId }
             ? { orchestraId: forms.selectOrchestraId }
             : forms.planList.orchestra[0]
             : forms.planList.orchestra[0]
           state.tabValue = selectOrchestra.orchestraId
           state.tabValue = selectOrchestra.orchestraId
+          console.log(forms.selectClassGroupId, forms.planList.classes[selectOrchestra.orchestraId])
           const selectClasses = forms.selectClassGroupId
           const selectClasses = forms.selectClassGroupId
             ? { classGroupId: forms.selectClassGroupId }
             ? { classGroupId: forms.selectClassGroupId }
             : forms.planList.classes[selectOrchestra.orchestraId]
             : forms.planList.classes[selectOrchestra.orchestraId]
             ? forms.planList.classes[selectOrchestra.orchestraId][0]
             ? forms.planList.classes[selectOrchestra.orchestraId][0]
             : {}
             : {}
-          state.courseValue = selectClasses.classGroupId
           state.selectClasses = forms.planList.classes[selectOrchestra.orchestraId] || []
           state.selectClasses = forms.planList.classes[selectOrchestra.orchestraId] || []
           state.selectCourse = forms.planList.course[selectClasses.classGroupId]
           state.selectCourse = forms.planList.course[selectClasses.classGroupId]
 
 
+          state.courseValue = selectClasses.classGroupId
+
+          console.log(selectClasses.classGroupId, 'selectClasses.classGroupId')
+
           // 判断是否有数据
           // 判断是否有数据
           forms.selectOrchestraId = null
           forms.selectOrchestraId = null
           forms.selectClassGroupId = null
           forms.selectClassGroupId = null
+
+          console.log(selectClasses.classGroupId, 'selectClasses.classGroupId 333333')
         }
         }
       } catch {
       } catch {
         //
         //
@@ -165,6 +171,9 @@ export default defineComponent({
       } catch {
       } catch {
         //
         //
         state.isClick = false
         state.isClick = false
+        setTimeout(() => {
+          getClasses()
+        }, 1100)
       }
       }
     }
     }
 
 
@@ -201,23 +210,25 @@ export default defineComponent({
             ))}
             ))}
           </Tabs>
           </Tabs>
 
 
-          {/* {state.courseValue && ( */}
-          <Tabs
-            swipeThreshold={3}
-            class={styles.courseTabs}
-            v-model:active={state.courseValue}
-            lineHeight={0}
-            shrink
-            ref={courseTabsRef}
-            onChange={(val: any) => {
-              state.selectCourse = forms.planList.course[val]
-            }}
-          >
-            {state.selectClasses.map((item: any) => (
-              <Tab title={item.className} name={item.classGroupId}></Tab>
-            ))}
-          </Tabs>
-          {/* )} */}
+          <div class={styles.courseTabsContainer}>
+            {state.courseValue && (
+              <Tabs
+                swipeThreshold={3}
+                class={styles.courseTabs}
+                v-model:active={state.courseValue}
+                lineHeight={0}
+                shrink
+                ref={courseTabsRef}
+                onChange={(val: any) => {
+                  state.selectCourse = forms.planList.course[val]
+                }}
+              >
+                {state.selectClasses.map((item: any) => (
+                  <Tab title={item.className} name={item.classGroupId}></Tab>
+                ))}
+              </Tabs>
+            )}
+          </div>
         </OSticky>
         </OSticky>
 
 
         {state.selectCourse.map((item: any) => (
         {state.selectCourse.map((item: any) => (

+ 5 - 1
src/school/train-planning/modal/practice-class/index.tsx

@@ -180,7 +180,11 @@ export default defineComponent({
           >
           >
             <CheckboxGroup class={[styles.gridContainer, styles.gridClass]} v-model={forms.check}>
             <CheckboxGroup class={[styles.gridContainer, styles.gridClass]} v-model={forms.check}>
               {forms.list.map((item: any) => (
               {forms.list.map((item: any) => (
-                <CellGroup class={styles.classCellGroup} onClick={() => onSelect(item.id)}>
+                <CellGroup
+                  class={styles.classCellGroup}
+                  onClick={() => onSelect(item.id)}
+                  border={false}
+                >
                   <Cell center titleStyle={{ flex: '0 auto' }} valueClass={styles.classCheckbox}>
                   <Cell center titleStyle={{ flex: '0 auto' }} valueClass={styles.classCheckbox}>
                     {{
                     {{
                       icon: () => <Image src={iconTeacher} class={styles.img} />,
                       icon: () => <Image src={iconTeacher} class={styles.img} />,

+ 112 - 0
src/student/download/transfer.tsx

@@ -0,0 +1,112 @@
+import { browser } from '@/helpers/utils'
+import { Button, showToast } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './index.module.less'
+import wxBg from './images/wx_bg.png'
+import qs from 'query-string'
+
+export default defineComponent({
+  name: 'download-transfer',
+  data() {
+    return {
+      wxStatus: false,
+      type: 'student',
+      buttonText: '下载管乐团学生端'
+    }
+  },
+  mounted() {
+    const { pn, url, action, pageTag, ...rest } = this.$route.query
+    const { origin, pathname } = location
+    let tempPathname = pathname
+    let beforeIos = 'BandMusicTeam://linkUrl='
+    let beforeAndroid = 'colexiustudent://html:8888/SplashActivity?url='
+
+    if (pn === 's') {
+      tempPathname = '/orchestra-student/'
+      beforeIos = 'BandMusicTeam://linkUrl='
+      beforeAndroid = 'orchestrastudent://html:8888/SplashActivity?url='
+    } else if (pn === 't') {
+      tempPathname = '/orchestra-teacher/'
+      beforeIos = 'BandMusicTeamTeacher://linkUrl='
+      beforeAndroid = 'orchestrateacher://html:8888/SplashActivity?url='
+    } else if (pn === 'm') {
+      tempPathname = '/orchestra-school/'
+      beforeIos = 'BandMusicTeamManager://linkUrl='
+      beforeAndroid = 'orchestramanager://html:8888/SplashActivity?url='
+    }
+
+    let str = origin + tempPathname + '#/'
+    // 判断是否有跳转连接, 如果连接和动作没有时, 则不跳转
+    if (!url && !action) {
+      return
+    }
+    str +=
+      url +
+      qs.stringify({
+        ...rest
+      })
+
+    const query = {
+      url: str,
+      action: action || 'h5', // app, h5
+      pageTag: pageTag || 1 // 页面标识
+      // params: {}
+    } as any
+    const iosStr = encodeURIComponent(JSON.stringify(query))
+    console.log(query, 'iosStr')
+    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
+      /*  
+        唤起前缀 IOS
+        BandMusicTeam:// 管乐团
+        BandMusicTeamTeacher://
+        BandMusicTeamManager:// */
+      /* 
+        唤起前缀 ANDROID
+        orchestrastudent://html:8888/SplashActivity?url=
+        orchestrateacher://html:8888/SplashActivity?url=
+        orchestramanager://html:8888/SplashActivity?url=
+       */
+      window.location.href = beforeIos + iosStr
+    } else if (/(Android)/i.test(navigator.userAgent)) {
+      window.location.href = beforeAndroid + iosStr
+    } else {
+      showToast('请用手机或移动设备打开')
+    }
+  },
+  methods: {
+    onDownload() {
+      if (browser().weixin) {
+        this.wxStatus = true
+        return
+      }
+
+      if (browser().ios || /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
+        window.location.href = 'https://itunes.apple.com/cn/app/id1626971695?mt=8'
+      } else if (/(Android)/i.test(navigator.userAgent)) {
+        window.location.href = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-student-domain.apk'
+      } else {
+        showToast('请用手机或移动设备打开')
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={[styles.student]}>
+        <Button round size="large" color="#FF8057" class={styles.btn} onClick={this.onDownload}>
+          {this.buttonText}
+        </Button>
+
+        {this.wxStatus && (
+          <div
+            class={styles.wxpopup}
+            onClick={() => {
+              this.wxStatus = false
+            }}
+          >
+            <img src={wxBg} alt="" />
+          </div>
+        )}
+      </div>
+    )
+  }
+})

+ 1 - 1
src/styles/index.less

@@ -124,7 +124,7 @@ body {
 
 
 .btnGroup {
 .btnGroup {
   padding: 0 25px;
   padding: 0 25px;
-  padding-bottom: 24px;
+  padding-bottom: calc(20px + env(safe-area-inset-bottom));
   .van-button {
   .van-button {
     font-size: 16px !important;
     font-size: 16px !important;
     font-weight: 500;
     font-weight: 500;