浏览代码

Merge branch 'master' into lhd

natasha 1 年之前
父节点
当前提交
7ba7bf4d1e

+ 3 - 0
src/router/guard/index.js

@@ -1,4 +1,5 @@
 import { getSessionID, getConfig } from '@/utils/auth';
+import { setItem } from '@/utils/storage';
 
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
@@ -23,6 +24,8 @@ export function setupRouterGuard(router) {
       next();
     } else {
       // 其他无权访问的页面将重定向到登录页面
+      // 如果是要跳转到答题页或练习页,将临时链接存入本地,并跳转到登录页
+      if (['/answer', '/exercise'].includes(to.path)) setItem('temporary_link', `GCLS-Exercise/#${to.fullPath}`);
       if (process.env.NODE_ENV === 'production') {
         window.location.href = '/';
       } else {

+ 23 - 1
src/views/exercise_questions/answer/index.vue

@@ -38,7 +38,10 @@
     </main>
 
     <footer class="footer">
-      <div v-show="isAnnotations" class="annotations"><i class="el-icon-plus"></i>批注</div>
+      <el-popover placement="top-start" trigger="click">
+        <div>增加批注</div>
+        <div v-show="isAnnotations" slot="reference" class="annotations"><i class="el-icon-plus"></i>批注</div>
+      </el-popover>
 
       <div>
         <template
@@ -342,6 +345,7 @@ export default {
       column-gap: 8px;
       align-items: center;
       padding: 7px 16px;
+      font-size: 14px;
       cursor: pointer;
       background-color: $fill-color;
       border-radius: 20px;
@@ -353,3 +357,21 @@ export default {
   }
 }
 </style>
+
+<style lang="scss">
+.el-popover {
+  display: flex;
+  flex-direction: column;
+  row-gap: 8px;
+  padding: 8px 8px 14px;
+  font-size: 14px;
+
+  .title {
+    color: #000;
+  }
+
+  .score {
+    color: #999;
+  }
+}
+</style>

+ 1 - 1
src/views/exercise_questions/data/fill.js

@@ -2,7 +2,7 @@ import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption } fro
 
 export function handleToneValue(valItem) {
   let numList = [];
-  if (/[A-Za-z]+\d/g.test(valItem)) {
+  if (/[A-Za-zü]+\d/g.test(valItem)) {
     valItem.split('').forEach((item, i) => {
       if (/\d/.test(item)) {
         let numIndex = numList.length === 0 ? 0 : numList[numList.length - 1].index;

+ 1 - 1
src/views/exercise_questions/data/listenFill.js

@@ -2,7 +2,7 @@ import { stemTypeList, questionNumberTypeList, scoreTypeList, switchOption } fro
 
 export function handleToneValue(valItem) {
   let numList = [];
-  if (/[A-Za-z]+\d/g.test(valItem)) {
+  if (/[A-Za-zü]+\d/g.test(valItem)) {
     valItem.split('').forEach((item, i) => {
       if (/\d/.test(item)) {
         let numIndex = numList.length === 0 ? 0 : numList[numList.length - 1].index;

+ 13 - 8
src/views/share/ShareExercise.vue

@@ -4,6 +4,7 @@
 
 <script>
 import { GetShareRecordInfo } from '@/api/exercise';
+import { setItem } from '@/utils/storage';
 
 export default {
   name: 'ShareExercise',
@@ -30,14 +31,18 @@ export default {
     getShareRecordInfo() {
       GetShareRecordInfo({
         share_record_id: this.share_record_id,
-      }).then(({ share_record }) => {
-        if (share_record.access_popedom === 1) {
-          this.$router.push({ path: '/exercise', query: { id: share_record.exercise_id } });
-        }
-        if (share_record.access_popedom === 2) {
-          this.$router.push({ path: '/answer', query: { share_record_id: this.share_record_id } });
-        }
-      });
+      })
+        .then(({ share_record }) => {
+          if (share_record.access_popedom === 1) {
+            this.$router.push({ path: '/exercise', query: { id: share_record.exercise_id } });
+          }
+          if (share_record.access_popedom === 2) {
+            this.$router.push({ path: '/answer', query: { share_record_id: this.share_record_id } });
+          }
+        })
+        .catch(() => {
+          setItem('temporary_link', `GCLS-Exercise/#/open/share/exercise?share_record_id=${this.share_record_id}`);
+        });
     },
   },
 };