Browse Source

更新下载地址

lex 1 year ago
parent
commit
37675702ba

+ 16 - 0
src/router/router-root.ts

@@ -87,6 +87,22 @@ export default [
     }
   },
   {
+    path: '/download',
+    name: 'download',
+    component: () => import('@/views/download/index'),
+    meta: {
+      title: '下载酷乐秀课堂乐器'
+    }
+  },
+  {
+    path: '/transfer',
+    name: 'transfer',
+    component: () => import('@/views/download/transfer'),
+    meta: {
+      title: '下载酷乐秀课堂乐器'
+    }
+  },
+  {
     path: '/help-center',
     name: 'help-center',
     component: () => import('@/views/information/help-center/index'),

BIN
src/views/download/images/download_bg.png


BIN
src/views/download/images/student-btn.png


BIN
src/views/download/images/student-center.png


BIN
src/views/download/images/wx_bg.png


+ 44 - 0
src/views/download/index.module.less

@@ -0,0 +1,44 @@
+.downloadContainer {
+  overflow: hidden;
+  background: url('./images/download_bg.png') no-repeat top center;
+  background-size: cover;
+  min-height: 100vh;
+  padding: 0 8px 0 23px;
+  text-align: center;
+
+  :global {
+    .van-image {
+      margin-top: 25px;
+    }
+  }
+}
+
+.buttonGroup {
+  text-align: center;
+  margin-top: 35px;
+  margin-bottom: 35px;
+}
+
+.btn {
+  width: 230px;
+  height: 45px;
+  line-height: 45px;
+  background: url('./images/student-btn.png') no-repeat center;
+  background-size: cover;
+  border: none;
+}
+
+.wxpopup {
+  width: 100%;
+  height: 100vh;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+
+  img {
+    width: 88%;
+    margin: 0 6%;
+  }
+}

+ 69 - 0
src/views/download/index.tsx

@@ -0,0 +1,69 @@
+import { Button, showToast, Image } from 'vant';
+import { defineComponent, reactive } from 'vue';
+import styles from './index.module.less';
+import wxBg from './images/wx_bg.png';
+import { browser } from '@/helpers/utils';
+import student from './images/student-center.png';
+
+// 唤起前缀
+export default defineComponent({
+  name: 'download',
+  setup() {
+    const state = reactive({
+      wxStatus: false
+    });
+
+    const onDownload = () => {
+      if (browser().weixin) {
+        state.wxStatus = true;
+        return;
+      }
+
+      let urlIos = '';
+      let urlAndroid = '';
+      if (location.origin.indexOf('online.lexiaoya.cn') > -1) {
+        urlIos =
+          'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 ';
+        urlAndroid =
+          'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-student.apk';
+      } else {
+        urlIos = 'https://www.pgyer.com/dzRRNN';
+        urlAndroid = 'https://www.pgyer.com/2meenh';
+      }
+
+      if (
+        browser().ios ||
+        /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
+      ) {
+        urlIos && (window.location.href = urlIos);
+      } else if (/(Android)/i.test(navigator.userAgent)) {
+        window.location.href = urlAndroid;
+      } else {
+        showToast('请用手机或移动设备打开');
+      }
+    };
+    return () => (
+      <div class={[styles.downloadContainer]}>
+        <Image src={student} />
+
+        <div class={styles.buttonGroup}>
+          <Button
+            round
+            size="large"
+            class={styles.btn}
+            onClick={onDownload}></Button>
+        </div>
+
+        {state.wxStatus && (
+          <div
+            class={styles.wxpopup}
+            onClick={() => {
+              state.wxStatus = false;
+            }}>
+            <img src={wxBg} alt="" />
+          </div>
+        )}
+      </div>
+    );
+  }
+});

+ 107 - 0
src/views/download/transfer.tsx

@@ -0,0 +1,107 @@
+import { browser } from '@/helpers/utils';
+import { Button, showToast, Image } from 'vant';
+import { defineComponent } from 'vue';
+import styles from './index.module.less';
+import wxBg from './images/wx_bg.png';
+import qs from 'query-string';
+import student from './images/student-center.png';
+import teacher from './images/teacher-center.png';
+import manage from './images/manage-center.png';
+
+export default defineComponent({
+  name: 'download-transfer',
+  data() {
+    return {
+      wxStatus: false
+    };
+  },
+  mounted() {
+    const { pn, url, action, pageTag, ...rest } = this.$route.query;
+    const { origin, pathname } = location;
+    let tempPathname = pathname;
+    let beforeIos = 'BandInstrumentTeam://linkUrl=';
+    let beforeAndroid = 'colexiukt://html:8888/SplashActivity?url=';
+
+    let str = origin + tempPathname + '#/';
+    // 判断是否有跳转连接, 如果连接和动作没有时, 则不跳转
+    if (!url && !action) {
+      return;
+    }
+
+    // 处理参数
+    const formatParams = qs.stringify({
+      ...rest
+    });
+    str += url + (formatParams ? '?' + formatParams : '');
+    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)) {
+      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;
+      }
+      let urlIos = '';
+      let urlAndroid = '';
+      if (location.origin.indexOf('online.lexiaoya.cn') > -1) {
+        urlIos =
+          'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2/id1671474346?uo=4 ';
+        urlAndroid =
+          'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-student.apk';
+      } else {
+        urlIos = 'https://www.pgyer.com/dzRRNN';
+        urlAndroid = 'https://www.pgyer.com/2meenh';
+      }
+
+      if (
+        browser().ios ||
+        /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
+      ) {
+        urlIos && (window.location.href = urlIos);
+      } else if (/(Android)/i.test(navigator.userAgent)) {
+        window.location.href = urlAndroid;
+      } else {
+        showToast('请用手机或移动设备打开');
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={[styles.downloadContainer]}>
+        <Image src={student} />
+
+        <div class={styles.buttonGroup}>
+          <Button
+            round
+            size="large"
+            class={styles.btn}
+            onClick={this.onDownload}></Button>
+        </div>
+
+        {this.wxStatus && (
+          <div
+            class={styles.wxpopup}
+            onClick={() => {
+              this.wxStatus = false;
+            }}>
+            <img src={wxBg} alt="" />
+          </div>
+        )}
+      </div>
+    );
+  }
+});

+ 14 - 0
src/views/knowledge-library/error-question-mode/index.module.less

@@ -20,9 +20,23 @@
     padding-bottom: 12px;
 
     .questionNum {
+      display: flex;
+      align-items: center;
+
       span {
         color: #FF5A56;
       }
+
+      .pointName {
+        padding-right: 6px;
+        color: #1CACF1;
+        font-weight: 600;
+        font-size: 14px;
+        max-width: 150px;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
     }
 
     .questionType {

+ 15 - 18
src/views/knowledge-library/error-question-mode/index.tsx

@@ -369,8 +369,8 @@ export default defineComponent({
 
       resizeSwipeItemHeight();
 
-      // window.history.pushState(null, '', document.URL);
-      // window.addEventListener('popstate', onBack, false);
+      window.history.pushState(null, '', document.URL);
+      window.addEventListener('popstate', onBack, false);
     });
 
     onUnmounted(() => {
@@ -416,12 +416,11 @@ export default defineComponent({
                       title: () => (
                         <div class={styles.questionTitle}>
                           <div class={styles.questionNum}>
+                            <p class={styles.pointName}>
+                              {item.knowledgePointName}
+                            </p>
                             <span>{state.currentIndex + 1}</span>/{state.total}
                           </div>
-                          {/* <div class={styles.questionType}>
-                            <i></i>
-                            <span>{item.knowledgePointName}</span>
-                          </div> */}
                           <Button
                             round
                             plain
@@ -449,12 +448,12 @@ export default defineComponent({
                       title: () => (
                         <div class={styles.questionTitle}>
                           <div class={styles.questionNum}>
+                            <p class={styles.pointName}>
+                              {item.knowledgePointName}
+                            </p>
                             <span>{state.currentIndex + 1}</span>/{state.total}
                           </div>
-                          {/* <div class={styles.questionType}>
-                            <i></i>
-                            <span>{item.knowledgePointName}</span>
-                          </div> */}
+
                           <Button
                             round
                             plain
@@ -489,12 +488,11 @@ export default defineComponent({
                       title: () => (
                         <div class={styles.questionTitle}>
                           <div class={styles.questionNum}>
+                            <p class={styles.pointName}>
+                              {item.knowledgePointName}
+                            </p>
                             <span>{state.currentIndex + 1}</span>/{state.total}
                           </div>
-                          {/* <div class={styles.questionType}>
-                            <i></i>
-                            <span>{item.knowledgePointName}</span>
-                          </div> */}
                           <Button
                             round
                             plain
@@ -521,12 +519,11 @@ export default defineComponent({
                       title: () => (
                         <div class={styles.questionTitle}>
                           <div class={styles.questionNum}>
+                            <p class={styles.pointName}>
+                              {item.knowledgePointName}
+                            </p>
                             <span>{state.currentIndex + 1}</span>/{state.total}
                           </div>
-                          {/* <div class={styles.questionType}>
-                            <i></i>
-                            <span>{item.knowledgePointName}</span>
-                          </div> */}
                           <Button
                             round
                             plain

+ 4 - 8
src/views/knowledge-library/examination-mode/index.tsx

@@ -70,7 +70,7 @@ export default defineComponent({
     const getExamDetails = async () => {
       try {
         const { data } = await request.post(
-          '/edu-app/studentUnitExamination/queryPracticeModeExam',
+          '/edu-app/studentUnitExamination/mockExamination',
           {
             data: {
               lessonCoursewareId: state.lessonCoursewareId
@@ -112,7 +112,7 @@ export default defineComponent({
         });
 
         const { data } = await request.post(
-          '/edu-app/studentUnitExamination/submitTrainingAnswer',
+          '/edu-app/studentUnitExamination/submitAnswer',
           {
             hideLoading: true,
             data: result
@@ -217,10 +217,6 @@ export default defineComponent({
       });
     };
 
-    const onConfirmExam = () => {
-      //
-    };
-
     const onConfirmResult = () => {
       if (state.visiableInfo.operationType === 'RESULT') {
         state.visiableInfo.show = false;
@@ -318,8 +314,8 @@ export default defineComponent({
 
       resizeSwipeItemHeight();
 
-      window.history.pushState(null, '', document.URL);
-      window.addEventListener('popstate', onBack, false);
+      // window.history.pushState(null, '', document.URL);
+      // window.addEventListener('popstate', onBack, false);
     });
 
     onUnmounted(() => {

+ 18 - 20
src/views/knowledge-library/index.tsx

@@ -55,32 +55,30 @@ export default defineComponent({
     };
 
     // 练习模式
-    const onGotoModel = async () => {
+    const onGotoModel = async (type: string) => {
       try {
-        await request.post(
+        const { data } = await request.get(
           '/edu-app/studentUnitExamination/checkKnowledgePointIds',
           {
-            data: {
+            params: {
               lessonCoursewareId: forms.cid
             }
           }
         );
-        router.push({
-          path: '/practice-mode',
-          query: { lessonCoursewareId: route.query.detailId }
-        });
-      } catch {
-        //
-      }
-    };
+        if (!data) return;
 
-    // 模拟测试
-    const onExaminatoinModel = async () => {
-      try {
-        router.push({
-          path: '/examination-mode',
-          query: { lessonCoursewareId: route.query.detailId }
-        });
+        if (type === 'TEST') {
+          // 模拟测试
+          router.push({
+            path: '/examination-mode',
+            query: { lessonCoursewareId: forms.cid }
+          });
+        } else {
+          router.push({
+            path: '/practice-mode',
+            query: { lessonCoursewareId: forms.cid }
+          });
+        }
       } catch {
         //
       }
@@ -122,11 +120,11 @@ export default defineComponent({
           <Button
             class={styles.btnPractice}
             round
-            onClick={onGotoModel}></Button>
+            onClick={() => onGotoModel('PRACTICE')}></Button>
           <Button
             class={styles.btnTest}
             round
-            onClick={onExaminatoinModel}></Button>
+            onClick={() => onGotoModel('TEST')}></Button>
         </div>
 
         <div class={[styles.containerSection, styles.librarySection]}>

+ 8 - 6
src/views/knowledge-library/unit-detail.tsx

@@ -37,18 +37,20 @@ export default defineComponent({
 
     const onGotoModel = async () => {
       try {
-        await request.post(
+        const { data } = await request.get(
           '/edu-app/studentUnitExamination/checkKnowledgePointIds',
           {
-            data: {
+            params: {
               lessonCoursewareId: forms.detailId
             }
           }
         );
-        router.push({
-          path: '/practice-mode',
-          query: { lessonCoursewareId: route.query.detailId }
-        });
+        if (data) {
+          router.push({
+            path: '/practice-mode',
+            query: { lessonCoursewareId: route.query.detailId }
+          });
+        }
       } catch {
         //
       }

+ 11 - 1
src/views/knowledge-library/wroing-book/ai-exam/index.tsx

@@ -15,6 +15,8 @@ import {
 import iconBook from './images/icon-book.png';
 import request from '@/helpers/request';
 import MEmpty from '@/components/m-empty';
+import { browser } from '@/helpers/utils';
+import { postMessage } from '@/helpers/native-message';
 
 export default defineComponent({
   name: 'wroing-book',
@@ -70,7 +72,15 @@ export default defineComponent({
               content: () => (
                 <div class={styles.woringHeader}>
                   <i
-                    onClick={() => router.back()}
+                    onClick={() => {
+                      if (browser().isApp) {
+                        postMessage({
+                          api: 'goBack'
+                        });
+                      } else {
+                        router.back();
+                      }
+                    }}
                     class={[
                       'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
                       styles.leftArrow

+ 11 - 1
src/views/knowledge-library/wroing-book/index.tsx

@@ -8,6 +8,8 @@ import AiExam from './images/ai-exam.png';
 import WoringPractice from './images/woring-practice.png';
 import WoringStat from './images/woring-stat.png';
 import request from '@/helpers/request';
+import { browser } from '@/helpers/utils';
+import { postMessage } from '@/helpers/native-message';
 
 export default defineComponent({
   name: 'wroing-book',
@@ -49,7 +51,15 @@ export default defineComponent({
               content: () => (
                 <div class={styles.woringHeader}>
                   <i
-                    onClick={() => router.back()}
+                    onClick={() => {
+                      if (browser().isApp) {
+                        postMessage({
+                          api: 'goBack'
+                        });
+                      } else {
+                        router.back();
+                      }
+                    }}
                     class={[
                       'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
                       styles.leftArrow

+ 11 - 1
src/views/knowledge-library/wroing-book/woring-stat/index.tsx

@@ -14,6 +14,8 @@ import icon3 from './images/icon-3.png';
 import icon4 from './images/icon-4.png';
 import icon5 from './images/icon-5.png';
 import { useEventListener, useWindowScroll } from '@vueuse/core';
+import { browser } from '@/helpers/utils';
+import { postMessage } from '@/helpers/native-message';
 
 import * as echarts from 'echarts/core';
 import { BarChart, LineChart } from 'echarts/charts';
@@ -162,7 +164,15 @@ export default defineComponent({
               content: () => (
                 <div class={styles.woringHeader}>
                   <i
-                    onClick={() => router.back()}
+                    onClick={() => {
+                      if (browser().isApp) {
+                        postMessage({
+                          api: 'goBack'
+                        });
+                      } else {
+                        router.back();
+                      }
+                    }}
                     class={[
                       'van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow',
                       styles.leftArrow

+ 1 - 1
src/views/student-register/index.tsx

@@ -514,7 +514,7 @@ export default defineComponent({
         />
 
         {/* 是否在微信中打开 */}
-        {/* <OWxTip /> */}
+        <OWxTip />
       </div>
     );
   }