Browse Source

更新地址

lex 1 year ago
parent
commit
971ae07d4f

+ 28 - 7
src/student/download/index.tsx

@@ -7,6 +7,7 @@ import { browser } from '@/helpers/utils'
 import student from './images/student-center.png'
 import teacher from './images/teacher-center.png'
 import manage from './images/manage-center.png'
+import request from '@/helpers/request'
 
 // 唤起前缀
 // BandMusicTeam:// 管乐团
@@ -19,6 +20,7 @@ export default defineComponent({
 
     const state = reactive({
       wxStatus: false,
+      androidUrl: '',
       type: 'student',
       buttonText: '下载管乐团学员端'
     })
@@ -34,26 +36,26 @@ export default defineComponent({
       if (location.origin.indexOf('online.lexiaoya.cn') > -1) {
         if (state.type === 'student') {
           urlIos = 'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 '
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-student.apk'
+          urlAndroid = state.androidUrl //'https://oss.dayaedu.com/appstore/gyt-student.apk'
         } else if (state.type === 'teacher') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
+          urlAndroid = state.androidUrl //'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
         } else if (state.type === 'manage') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-manager.apk'
+          urlAndroid = state.androidUrl //'https://oss.dayaedu.com/appstore/gyt-manager.apk'
         }
       } else {
         if (state.type === 'student') {
           urlIos = 'https://www.pgyer.com/2Wg2'
-          urlAndroid = 'https://www.pgyer.com/9NBz'
+          urlAndroid = state.androidUrl //'https://www.pgyer.com/9NBz'
         } else if (state.type === 'teacher') {
           urlIos = 'https://www.pgyer.com/v5yB'
-          urlAndroid = 'https://www.pgyer.com/BQeE'
+          urlAndroid = state.androidUrl //'https://www.pgyer.com/BQeE'
         } else if (state.type === 'manage') {
           urlIos = 'https://www.pgyer.com/DGrR'
-          urlAndroid = 'https://www.pgyer.com/TEWv'
+          urlAndroid = state.androidUrl //'https://www.pgyer.com/TEWv'
         }
       }
 
@@ -66,15 +68,34 @@ export default defineComponent({
       }
     }
 
-    onMounted(() => {
+    onMounted(async () => {
       const type: any = route.query.type
       state.type = type ? type : 'student'
+      let platform = 'android-student'
       if (type === 'student') {
         state.buttonText = '下载管乐团学员端'
+        platform = 'android-student'
       } else if (type === 'teacher') {
         state.buttonText = '下载管乐团伴学端'
+        platform = 'android-teacher'
       } else if (type === 'manage') {
         state.buttonText = '下载管乐团管理端'
+        platform = 'android-school'
+      }
+
+      try {
+        const { data } = await request.get(
+          '/api-student/open/appVersionInfo/queryLatestByPlatform',
+          {
+            params: {
+              platform,
+              status: 'history'
+            }
+          }
+        )
+        state.androidUrl = data.downloadUrl
+      } catch {
+        //
       }
 
       document.title = state.buttonText

+ 25 - 8
src/student/download/transfer.tsx

@@ -8,6 +8,7 @@ import OSticky from '@/components/o-sticky'
 import student from './images/student-center.png'
 import teacher from './images/teacher-center.png'
 import manage from './images/manage-center.png'
+import request from '@/helpers/request'
 
 export default defineComponent({
   name: 'download-transfer',
@@ -15,34 +16,50 @@ export default defineComponent({
     return {
       wxStatus: false,
       type: 'student',
+      androidUrl: '',
       buttonText: '下载管乐团学员端'
     }
   },
-  mounted() {
+  async mounted() {
     const { pn, url, action, pageTag, ...rest } = this.$route.query
     const { origin, pathname } = location
     let tempPathname = pathname
     let beforeIos = 'BandMusicTeam://linkUrl='
     let beforeAndroid = 'orchestrastudent://html:8888/SplashActivity?url='
-
+    let platform = 'android-student'
     if (pn === 's') {
       this.type = 'student'
       this.buttonText = '下载管乐团学员端'
       tempPathname = '/orchestra-student/'
       beforeIos = 'BandMusicTeam://linkUrl='
       beforeAndroid = 'orchestrastudent://html:8888/SplashActivity?url='
+      platform = 'android-student'
     } else if (pn === 't') {
       this.type = 'teacher'
       this.buttonText = '下载管乐团伴学端'
       tempPathname = '/orchestra-teacher/'
       beforeIos = 'BandMusicTeamTeacher://linkUrl='
       beforeAndroid = 'orchestrateacher://html:8888/SplashActivity?url='
+      platform = 'android-student'
     } else if (pn === 'm') {
       this.type = 'manage'
       this.buttonText = '下载管乐团管理端'
       tempPathname = '/orchestra-school/'
       beforeIos = 'BandMusicTeamManager://linkUrl='
       beforeAndroid = 'orchestramanager://html:8888/SplashActivity?url='
+      platform = 'android-school'
+    }
+
+    try {
+      const { data } = await request.get('/api-student/open/appVersionInfo/queryLatestByPlatform', {
+        params: {
+          platform,
+          status: 'history'
+        }
+      })
+      this.androidUrl = data.downloadUrl
+    } catch {
+      //
     }
 
     document.title = this.buttonText
@@ -95,26 +112,26 @@ export default defineComponent({
       if (location.origin.indexOf('online.lexiaoya.cn') > -1) {
         if (this.type === 'student') {
           urlIos = 'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 '
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-student.apk'
+          urlAndroid = this.androidUrl // 'https://oss.dayaedu.com/appstore/gyt-student.apk'
         } else if (this.type === 'teacher') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
+          urlAndroid = this.androidUrl //'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
         } else if (this.type === 'manage') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-manager.apk'
+          urlAndroid = this.androidUrl //'https://oss.dayaedu.com/appstore/gyt-manager.apk'
         }
       } else {
         if (this.type === 'student') {
           urlIos = 'https://www.pgyer.com/2Wg2'
-          urlAndroid = 'https://www.pgyer.com/9NBz'
+          urlAndroid = this.androidUrl //'https://www.pgyer.com/9NBz'
         } else if (this.type === 'teacher') {
           urlIos = 'https://www.pgyer.com/v5yB'
-          urlAndroid = 'https://www.pgyer.com/BQeE'
+          urlAndroid = this.androidUrl // 'https://www.pgyer.com/BQeE'
         } else if (this.type === 'manage') {
           urlIos = 'https://www.pgyer.com/DGrR'
-          urlAndroid = 'https://www.pgyer.com/TEWv'
+          urlAndroid = this.androidUrl //'https://www.pgyer.com/TEWv'
         }
       }
 

+ 36 - 6
src/student/music-group/pre-goods-apply/success.tsx

@@ -5,6 +5,7 @@ import { Button, showToast } from 'vant'
 import { browser } from '@/helpers/utils'
 import { useRoute } from 'vue-router'
 import wxBg from '../../download/images/wx_bg.png'
+import request from '@/helpers/request'
 
 export default defineComponent({
   name: 'apply-success',
@@ -14,6 +15,7 @@ export default defineComponent({
     const state = reactive({
       wxStatus: false,
       type: 'student',
+      androidUrl: '',
       buttonText: '下载管乐团学员端',
       t: 'apply' as any
     })
@@ -36,26 +38,26 @@ export default defineComponent({
       if (location.origin.indexOf('online.lexiaoya.cn') > -1) {
         if (state.type === 'student') {
           urlIos = 'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 '
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-student.apk'
+          urlAndroid = state.androidUrl // 'https://oss.dayaedu.com/appstore/gyt-student.apk'
         } else if (state.type === 'teacher') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
+          urlAndroid = state.androidUrl // 'https://oss.dayaedu.com/appstore/gyt-teacher.apk'
         } else if (state.type === 'manage') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/gyt-manager.apk'
+          urlAndroid = state.androidUrl //'https://oss.dayaedu.com/appstore/gyt-manager.apk'
         }
       } else {
         if (state.type === 'student') {
           urlIos = 'https://www.pgyer.com/2Wg2'
-          urlAndroid = 'https://www.pgyer.com/9NBz'
+          urlAndroid = state.androidUrl //'https://www.pgyer.com/9NBz'
         } else if (state.type === 'teacher') {
           urlIos = 'https://www.pgyer.com/v5yB'
-          urlAndroid = 'https://www.pgyer.com/BQeE'
+          urlAndroid = state.androidUrl //'https://www.pgyer.com/BQeE'
         } else if (state.type === 'manage') {
           urlIos = 'https://www.pgyer.com/DGrR'
-          urlAndroid = 'https://www.pgyer.com/TEWv'
+          urlAndroid = state.androidUrl // 'https://www.pgyer.com/TEWv'
         }
       }
 
@@ -67,6 +69,34 @@ export default defineComponent({
         showToast('请用手机或移动设备打开')
       }
     }
+
+    onMounted(async () => {
+      let platform = 'android-student'
+      if (state.type === 'student') {
+        platform = 'android-student'
+      } else if (state.type === 'teacher') {
+        platform = 'android-teacher'
+      } else if (state.type === 'manage') {
+        platform = 'android-school'
+      }
+
+      try {
+        const { data } = await request.get(
+          '/api-student/open/appVersionInfo/queryLatestByPlatform',
+          {
+            params: {
+              platform,
+              status: 'history'
+            }
+          }
+        )
+        state.androidUrl = data.downloadUrl
+      } catch {
+        //
+      }
+
+      document.title = state.buttonText
+    })
     return () => (
       <div class={styles.successContainer}>
         <img src={iconSuccess} class={styles.iconSuccess} />