shmily1213 20 hodín pred
rodič
commit
3343e0b8e8

+ 5 - 1
src/components/ie-safe-toolbar/ie-safe-toolbar.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="min-h-62" :style="{ minHeight: minHeight + 'px' }">
     <view class="safe-area-inset-bottom fixed left-0 bottom-0 right-0 z-10 box-border" :class="{ 'shadow-box': shadow }"
-      :style="{ height: minHeight + 'px' }">
+      :style="{ height: minHeight + 'px', backgroundColor: bgColor }">
       <slot></slot>
     </view>
   </view>
@@ -22,6 +22,10 @@ const props = defineProps({
   shadow: {
     type: Boolean,
     default: true
+  },
+  bgColor: {
+    type: String,
+    default: '#FFFFFF'
   }
 });
 const minHeight = computed(() => {

+ 173 - 14
src/composables/useExam.ts

@@ -71,7 +71,7 @@ const cancelAnimFrame = (() => {
 export const decodeHtmlEntities = (str: string): string => {
   if (!str) return str;
 
-  // 音标和常用 HTML 实体映射表
+  // 标准 HTML 实体映射表
   const entityMap: Record<string, string> = {
     // 音标相关 - 锐音符 (acute)
     'aacute': 'á',
@@ -101,10 +101,9 @@ export const decodeHtmlEntities = (str: string): string => {
     'ntilde': 'ñ',
     'atilde': 'ã',
     'otilde': 'õ',
+    'aelig': 'æ',
+    'eth': 'ð',
     // 其他常用实体
-    'amp': '&',
-    'lt': '<',
-    'gt': '>',
     'quot': '"',
     'apos': "'",
     'nbsp': '\u00A0',
@@ -114,29 +113,188 @@ export const decodeHtmlEntities = (str: string): string => {
     'mdash': '—',
     'ndash': '–',
     'hellip': '…',
+    'darr': '↓',
+    'uarr': '↑',
+    'rarr': '→',
+    'larr': '←',
+    'harr': '↔',
+    'crarr': '↵',
+    'lArr': '⇐',
+    'rArr': '⇒',
+    'hArr': '⇔',
+    'laquo': '«',
+    'raquo': '»',
+    'ldquo': '“',
+    'rdquo': '”',
+    'lsquo': '‘',
+    'rsquo': '’',
+    'lsaquo': '‹',
+    'rsaquo': '›',
     // 数学符号
+    'amp': '&',
+    'minus': '−',
+    'plus': '+',
     'times': '×',
     'divide': '÷',
     'plusmn': '±',
+    'deg': '°',
+    'radic': '√',
+    'isin': '∈',
+    'infin': '∞',
+    'there4': '∴',
+    'because': '∵',
+    'forall': '∀',
+    'exists': '∃',
+    'nexists': '∄',
+    'notin': '∉',
+    'ni': '∋',
+    'empty': '∅',
+    'prod': '∏',
+    'sum': '∑',
+    'prop': '∝',
+    'sim': '∼',
+    'simeq': '≃',
+    'approx': '≈',
+    'asymp': '≈',
+    'neq': '≠',
+    'equiv': '≡',
+    'ne': '≠',
+    'le': '≤',
+    'ge': '≥',
+    'll': '≪',
+    'gg': '≫',
+    'prec': '≺',
+    'succ': '≻',
+    'preceq': '≼',
+    'succeq': '≽',
+    'sub': '⊂',
+    'sube': '⊆',
+    'subset': '⊂',
+    'subseteq': '⊆',
+    'sup': '⊃',
+    'supe': '⊇',
+    'supset': '⊃',
+    'supseteq': '⊇',
+    'perp': '⊥',
+    'parallel': '∥',
+    'wedge': '∧',
+    'vee': '∨',
+    'cap': '∩',
+    'cup': '∪',
+    'int': '∫',
+    'oint': '∮',
+    'angle': '∠',
+    'ang': '∠',
+    'mid': '∣',
+    'vdash': '⊢',
+    'dashv': '⊣',
+    'models': '⊨',
+    'vDash': '⊩',
+    'Vdash': '⊫',
+    'VDash': '⊬',
+    'Oslash': 'Ø',
+    'ordm': 'º',
+    'not': '¬',
+    'prime': '′',
+    // 排版符号
+    'middot': '·',
+    'bull': '•',
+    'sect': '§',
+    'para': '¶',
+    'macr': '¯',
+    'micro': 'µ',
+    // 货币符号
+    'yen': '¥',
+    'euro': '€',
+    'pound': '£',
+    'cent': '¢',
+    // 希腊字母
+    'alpha': 'α',
+    'beta': 'β',
+    'gamma': 'γ',
+    'delta': 'δ',
+    'epsilon': 'ε',
+    'zeta': 'ζ',
+    'eta': 'η',
+    'theta': 'θ',
+    'iota': 'ι',
+    'kappa': 'κ',
+    'lambda': 'λ',
+    'mu': 'μ',
+    'nu': 'ν',
+    'xi': 'ξ',
+    'omicron': 'ο',
+    'pi': 'π',
+    'rho': 'ρ',
+    'sigma': 'σ',
+    'tau': 'τ',
+    'upsilon': 'υ',
+    'phi': 'φ',
+    'chi': 'χ',
+    'psi': 'ψ',
+    'omega': 'ω',
+    'Omega': 'Ω',
+    'thetasym': 'ϑ',
+    'upsih': 'ϒ',
+    'piv': 'ϖ',
   };
 
-  // 处理命名实体(如 &iacute;)
-  // 使用 [a-z0-9] 以支持包含数字的实体名称
-  let result = str.replace(/&([a-z0-9]+);/gi, (match, entity) => {
+  let result = str;
+
+  // 清除所有的特殊空格实体
+  result = result.replaceAll("&zwj;", "")
+    .replaceAll("&nbsp;", "")
+    .replaceAll("&zwnj;", "")
+    .replaceAll("&thinsp;", "")
+    .replaceAll("&emsp;", "")
+    .replaceAll("&ensp;", "")
+    .replaceAll("&shy;", "")
+    .replaceAll("&#8203;", "");
+
+  // 0. 保护真正的 HTML 标签,转义文本中的 < 和 >
+  // 策略:< 后面如果不是字母或 /(标签开始),则转义为 &lt;
+  // 这样可以处理 x<2、1<x<5 等数学表达式
+  // result = result.replace(/<(?![a-zA-Z/])/g, '&lt;');  // < 后面不是字母或 / 的转义
+  // result = result.replace(/(?<![a-zA-Z0-9])>/g, '&gt;'); // > 前面不是字母数字的转义(避免破坏标签)
+
+  // 1. 处理非标准的上标实体:&sup数字; → <sup>数字</sup>
+  // 例如:&sup2; → <sup>2</sup>, &sup123; → <sup>123</sup>
+  result = result.replace(/&sup(\d+);/gi, (match, digits) => {
+    return `<sup>${digits}</sup>`;
+  });
+
+  // 2. 处理非标准的下标实体:&sub数字; → <sub>数字</sub>
+  // 例如:&sub2; → <sub>2</sub>, &sub123; → <sub>123</sub>
+  result = result.replace(/&sub(\d+);/gi, (match, digits) => {
+    return `<sub>${digits}</sub>`;
+  });
+
+  // 3. 处理标准命名实体(如 &iacute;、&there4;)
+  // 注意:正则需要支持字母和数字的组合
+  result = result.replace(/&([a-z0-9]+);/gi, (match, entity) => {
     const lowerEntity = entity.toLowerCase();
     if (entityMap[lowerEntity]) {
       return entityMap[lowerEntity];
     }
-    return match; // 如果找不到映射,保持原样
+    return match;
   });
 
-  // 处理数字实体(如 &#237; 或 &#xED;)
+  // 4. 处理十进制数字实体(如 &#178; → ²
   result = result.replace(/&#(\d+);/g, (match, num) => {
-    return String.fromCharCode(parseInt(num, 10));
+    const code = parseInt(num, 10);
+    if (!isNaN(code)) {
+      return String.fromCharCode(code);
+    }
+    return match;
   });
 
+  // 5. 处理十六进制数字实体(如 &#xB2; → ²)
   result = result.replace(/&#x([0-9a-f]+);/gi, (match, hex) => {
-    return String.fromCharCode(parseInt(hex, 16));
+    const code = parseInt(hex, 16);
+    if (!isNaN(code)) {
+      return String.fromCharCode(code);
+    }
+    return match;
   });
 
   return result;
@@ -403,7 +561,7 @@ export const useExam = () => {
   const isOptionCorrect = (question: Study.Question, option: Study.QuestionOption) => {
     const { answers, answer1, typeId } = question;
     if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(typeId)) {
-      return answer1?.includes(option.no);
+      return answer1?.trim() === answers[0];
     } else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(typeId)) {
       return answer1?.includes(option.no);
     } else {
@@ -625,6 +783,7 @@ export const useExam = () => {
     const transerQuestion = (item: Study.ExamineeQuestion, index: number): Study.Question => {
       return {
         ...item,
+        title: decodeHtmlEntities(item.title || ''),
         // 处理没有题型的大题,统一作为阅读题
         typeId: (item.typeId === null || item.typeId === undefined) ? EnumQuestionType.OTHER : item.typeId,
         answers: item.answers || [],
@@ -647,7 +806,8 @@ export const useExam = () => {
         virtualIndex: 0,
         duration: 0,
         activeSubIndex: 0,
-        hasSubQuestions: item.subQuestions?.length > 0
+        hasSubQuestions: item.subQuestions?.length > 0,
+        typeTitle: item.typeTitle
       } as Study.Question
     }
     questionList.value = transerQuestions(list.map((item, index) => transerQuestion(item, index)));
@@ -712,7 +872,6 @@ export const useExam = () => {
   watch([() => currentIndex.value, () => currentQuestion.value?.activeSubIndex], (val) => {
     const qs = questionList.value[val[0]];
     virtualCurrentIndex.value = qs.index + qs.offset + val[1];
-    console.log(virtualCurrentIndex.value, 777)
   }, {
     immediate: false
   });

+ 3 - 1
src/main.ts

@@ -50,7 +50,9 @@ export function createApp() {
         statusBarHeight: { default: 0 }
       },
       tabs: {
-        activeStyle: { default: () => ({ color: 'var(--primary-color)' }) }
+        activeStyle: { default: () => ({ color: 'var(--primary-color)' }) },
+        autoScroll: { default: true }, // current 改变时是否自动滚动到中间
+        animationEnabled: { default: true } // 滚动时是否带有动画
       },
       steps: {
         activeColor: { default: 'var(--primary-color)' }

+ 19 - 26
src/pagesStudy/pages/exam-start/components/exam-stats-card.vue

@@ -35,30 +35,23 @@
           <view class="popup-content">
             <view class="flex-1 min-h-1">
               <scroll-view class="h-full" scroll-y>
-                <view v-for="(item, i) in groupedQuestionList" :key="i" class="">
-                  <template v-if="item.list.length > 0">
-                    <view class="h-70 bg-back px-20 leading-70 text-fore-subcontent sticky top-0 z-1">
-                      {{ questionTypeDesc[item.type] }}
+                <view class="grid grid-cols-5 place-items-center gap-x-20 gap-y-30 p-30 relative z-0">
+                  <view v-for="(qs, j) in flatQuestionList" :key="j"
+                    class="aspect-square flex items-center justify-center" @click="hanadleNavigate(qs, qs.index)">
+                    <view
+                      class="w-74 h-74 rounded-full flex items-center justify-center bg-white border border-solid border-border relative"
+                      :class="{
+                        'is-done': !isViewMode && qs.isDone,
+                        'is-not-know': !isViewMode && qs.isNotKnow,
+                        'is-mark': !isViewMode && qs.isMark,
+                        'is-correct': isViewMode && qs.isCorrect,
+                        'is-incorrect': isViewMode && !qs.isCorrect,
+                      }">
+                      <text class="z-1 font-bold text-32">{{ qs.virtualIndex + 1 }}</text>
+                      <ie-image v-if="qs.isMark" src="/pagesStudy/static/image/icon-mark-active.png"
+                        custom-class="absolute -top-12 left-14 w-28 h-28 z-1" mode="aspectFill" />
                     </view>
-                    <view class="grid grid-cols-5 place-items-center gap-x-20 gap-y-30 p-30 relative z-0">
-                      <view v-for="(qs, j) in item.list" :key="j" class="aspect-square flex items-center justify-center"
-                        @click="hanadleNavigate(qs.question, qs.index)">
-                        <view
-                          class="w-74 h-74 rounded-full flex items-center justify-center bg-white border border-solid border-border relative"
-                          :class="{
-                            'is-done': !isViewMode && qs.question.isDone,
-                            'is-not-know': !isViewMode && qs.question.isNotKnow,
-                            'is-mark': !isViewMode && qs.question.isMark,
-                            'is-correct': isViewMode && qs.question.isCorrect,
-                            'is-incorrect': isViewMode && !qs.question.isCorrect,
-                          }">
-                          <text class="z-1 font-bold text-32">{{ qs.index + 1 }}</text>
-                          <ie-image v-if="qs.question.isMark" src="/pagesStudy/static/image/icon-mark-active.png"
-                            custom-class="absolute -top-12 left-14 w-28 h-28 z-1" mode="aspectFill" />
-                        </view>
-                      </view>
-                    </view>
-                  </template>
+                  </view>
                 </view>
               </scroll-view>
             </view>
@@ -89,7 +82,7 @@ const props = defineProps<{
   readonly?: boolean;
 }>();
 const examData = inject(EXAM_DATA) || {} as ReturnType<typeof useExam>;
-const { doneCount, virtualTotalCount, groupedQuestionList, questionTypeDesc, reset, startTiming, stopTiming, changeIndex } = examData;
+const { doneCount, virtualTotalCount, groupedQuestionList, flatQuestionList, questionTypeDesc, reset, startTiming, stopTiming, changeIndex } = examData;
 const examPageOptions = inject(EXAM_PAGE_OPTIONS) || {} as Transfer.ExamAnalysisPageOptions;
 const isViewMode = computed(() => {
   return examPageOptions?.readonly || false;
@@ -136,7 +129,7 @@ const hanadleNavigate = (question: Study.Question, index: number) => {
   if (question.isSubQuestion) {
     changeIndex(question.parentIndex || 0, question.subIndex || 0);
   } else {
-    changeIndex(index);
+    changeIndex(question.index);
   }
 }
 </script>
@@ -219,4 +212,4 @@ const hanadleNavigate = (question: Study.Question, index: number) => {
 .is-incorrect {
   @apply text-[#FF5B5C] border-[#FEEDE9] bg-[#FEEDE9];
 }
-</style>
+</style>

+ 52 - 26
src/pagesStudy/pages/exam-start/components/question-item.vue

@@ -7,19 +7,24 @@
       <question-parse :question="question" />
     </template>
     <view v-else class="mt-20">
-      <scroll-view class="w-full h-fit sticky top-0 py-10 z-1" scroll-x :scroll-into-view="scrollIntoView"
-        :scroll-left="scrollLeft">
-        <view class="flex items-center px-20 gap-x-20">
-          <view class="px-40 py-8 rounded-full" :id="`sub_question_${getNo(index)}`"
-            :class="[index === question.activeSubIndex ? 'bg-[#EBF9FF] text-primary font-bold' : 'bg-back']"
-            v-for="(subQuestion, index) in question.subQuestions" @click="setSubQuestionIndex(index)">
+      <uv-tabs ref="tabRef" :current="question.activeSubIndex" :autoScroll="autoScroll" keyName="label"
+        :animationEnabled="false" :itemStyle="tabItemStyle" :list="tabs" :scrollable="true" lineHeight="0"
+        @change="handleTabChange">
+        <template #default="{ data: { item, index } }">
+          <view class="px-40 py-8 rounded-full"
+            :class="[index === question.activeSubIndex ? 'bg-primary-light text-primary' : 'bg-back']">
             {{ getNo(index) }}
           </view>
+        </template>
+      </uv-tabs>
+      <view v-if="question.subQuestions.length" class="mt-20">
+        <view v-for="subQuestion in question.subQuestions" :key="subQuestion.subIndex">
+          <question-item v-show="subQuestion.subIndex === question.activeSubIndex" :question="subQuestion" />
         </view>
-      </scroll-view>
-      <view v-if="question.subQuestions[question.activeSubIndex]" class="mt-20">
-        <question-item :question="question.subQuestions[question.activeSubIndex]" />
       </view>
+      <!-- <view v-if="question.subQuestions[question.activeSubIndex]" class="mt-20">
+        <question-item :question="question.subQuestions[question.activeSubIndex]" />
+      </view> -->
     </view>
   </view>
 </template>
@@ -28,41 +33,62 @@ import QuestionTitle from './question-title.vue';
 import QuestionOptions from './question-options.vue';
 import questionResult from './question-result.vue';
 import QuestionParse from './question-parse.vue';
+import QuestionItem from './question-item.vue';
 import { EnumQuestionType, EnumReviewMode } from '@/common/enum';
 import { useExam } from '@/composables/useExam';
 import { Study, Transfer } from '@/types';
 import { EXAM_DATA, EXAM_PAGE_OPTIONS, EXAM_AUTO_SUBMIT } from '@/types/injectionSymbols';
 
+const props = defineProps<{
+  question: Study.Question;
+}>();
+
 const examPageOptions = inject(EXAM_PAGE_OPTIONS) || {} as Transfer.ExamAnalysisPageOptions;
 const examData = inject(EXAM_DATA) || {} as ReturnType<typeof useExam>;
-const { subQuestionIndex, setSubQuestionIndex } = examData;
+const { subQuestionIndex, setSubQuestionIndex, currentIndex } = examData;
 const examAutoSubmit = inject(EXAM_AUTO_SUBMIT);
 
 const scrollIntoView = ref('')
 const scrollLeft = ref(0);
-
-watch(subQuestionIndex, (val) => {
-  scrollIntoView.value = '';
-  nextTick(() => {
-    scrollIntoView.value = `sub_question_${val}`;
-    if (props.question.subQuestions && props.question.subQuestions.length > 0) {
-      if (props.question.subQuestions[0].subIndex === val) {
-        scrollLeft.value = -1;
-        setTimeout(() => {
-          scrollLeft.value = 0;
-        }, 0);
-      }
+const autoScroll = ref(false);
+const tabRef = ref();
+const tabs = computed(() => {
+  return props.question.subQuestions.map((item, index) => {
+    return {
+      label: props.question.index + props.question.offset + index + 1,
+      value: item.subIndex
     }
   });
+});
+const tabItemStyle = {
+  padding: '0 5px',
+};
+
+watch(() => props.question.activeSubIndex, (val) => {
+  if (currentIndex.value === props.question.index) {
+    autoScroll.value = true;
+  }
+}, {
+  immediate: false
+});
+watch(() => currentIndex.value, (val) => {
+  if (currentIndex.value === props.question.index) {
+    setTimeout(() => {
+      nextTick(() => {
+        tabRef.value?.init();
+      });
+    }, 0);
+  } else {
+    autoScroll.value = false;
+  }
 }, {
   immediate: false
 });
-
-const props = defineProps<{
-  question: Study.Question;
-}>();
 const getNo = (subIndex: number) => {
   return props.question.index + props.question.offset + subIndex + 1;
 }
+const handleTabChange = (e: any) => {
+  setSubQuestionIndex(e.index);
+}
 </script>
 <style lang="scss" scoped></style>

+ 3 - 3
src/pagesStudy/pages/exam-start/components/question-title.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="question-title">
     <view v-if="question.typeId && !isSubQuestion" class="question-type">
-      <text>{{ questionTypeDesc[question.typeId as EnumQuestionType] }}</text>
+      <text>{{ question.typeTitle || questionTypeDesc[question.typeId as EnumQuestionType] }}</text>
       <!-- 考试模式下显示分数 -->
       <text v-if="showScore">({{ getScore }}分)</text>
     </view>
@@ -48,8 +48,8 @@ const getScore = computed(() => {
 });
 const getQuestionTitle = () => {
   if (isSubQuestion.value) {
-    const prefix = questionTypeDesc[props.question.typeId as EnumQuestionType].slice(0, 2);
-    return `[${prefix}]`;
+    const prefix = questionTypeDesc[props.question.typeId as EnumQuestionType].slice(0, 3);
+    return `[${props.question.typeTitle || prefix}]`;
   }
   return '';
 };

+ 2 - 2
src/pagesStudy/pages/knowledge-practice-detail/knowledge-practice-detail.vue

@@ -1,5 +1,5 @@
 <template>
-  <ie-page bg-color="#F6F8FA" safe-area-inset-bottom-color="#FFFFFF" :fix-height="true">
+  <ie-page bg-color="#F6F8FA" :safe-area-inset-bottom="false" :fix-height="true">
     <ie-navbar :title="pageTitle" />
     <view v-if="examineeData" class="relative z-3 pt-30 pb-20 mx-30">
       <view class="bg-white rounded-15 px-20 pb-1">
@@ -25,7 +25,7 @@
       </view>
       <exam-stat :data="examineeData" :show-stats="false" @detail="handleQuestionDetail" />
     </view>
-    <ie-safe-toolbar :height="84" :shadow="false">
+    <ie-safe-toolbar :height="84" :shadow="false" bg-color="#FFFFFF">
       <view class="h-[84px] px-46 bg-white flex items-center justify-between gap-x-40">
         <view class="text-30 text-primary bg-back flex-1 py-22 rounded-full text-center h-fit" @click="handleStartPractice">
           继续刷题

+ 6 - 5
src/pagesStudy/pages/knowledge-practice-history/knowledge-practice-history.vue

@@ -15,7 +15,7 @@
             </view>
             <view class="mt-10 text-28">
               <text class=" text-fore-light">完成时间:</text>
-              <text class="text-fore-title">{{ item.endTime }}</text>
+              <text class="text-fore-title">{{ getTime(item.endTime) }}</text>
             </view>
           </view>
           <view class="text-24 text-white bg-primary w-fit px-40 py-12 rounded-full text-center"
@@ -34,6 +34,8 @@ import { getPracticeHistory } from '@/api/modules/study';
 import { Study } from '@/types';
 import { Transfer } from '@/types';
 import { EnumPaperType } from '@/common/enum';
+import { formatTime } from '@/utils/format';
+
 const { prevData, transferTo } = useTransferPage<{}, Transfer.PracticeResultPageOptions>();
 const { baseStickyTop } = useNavbar();
 const historyList = ref<Study.PracticeHistory[]>([]);
@@ -49,6 +51,9 @@ const handleViewHistory = (value: Study.PracticeHistory) => {
 }
 
 const pagingRef = ref();
+const getTime = (time: string) => {
+  return formatTime(time, 'yyyy-mm-dd hh:MM:ss');
+}
 const handleQuery = (pageNum: number, pageSize: number) => {
   getPracticeHistory({
     pageNum,
@@ -65,9 +70,5 @@ const handleQuery = (pageNum: number, pageSize: number) => {
     pagingRef.value.complete(false);
   });
 }
-onLoad(() => {
-  console.log(prevData.value)
-  // loadData();
-});
 </script>
 <style lang="scss" scoped></style>

+ 4 - 1
src/static/theme/theme.module.scss

@@ -1,3 +1,6 @@
+// 导入主题变量
+@import './var.scss';
+
 // 生成颜色阶梯的函数
 @function generate-color-scale($color) {
   $scale: ();
@@ -29,7 +32,7 @@
 
 @each $name, $color in $themes {
   $color-scale: generate-color-scale($color);
-  $light-color: map-get($themes, $name + '-light');
+  $light-color: map-get($theme-lights, $name);
   .theme-#{$name} {
     // 生成所有颜色阶梯的CSS变量
     @each $step, $value in $color-scale {

+ 10 - 2
src/static/theme/var.scss

@@ -1,5 +1,13 @@
 $ie: #31A0FC;
-$ie-light: #E5F1ED;
+$ie-light: #EBF9FF;
 
-$themes: map-merge((), ('ie': $ie));
+// 主题主色映射
+$themes: (
+  'ie': $ie
+);
+
+// 主题浅色映射
+$theme-lights: (
+  'ie': $ie-light
+);
 

+ 2 - 0
src/types/study.ts

@@ -185,6 +185,7 @@ export interface ExamineeQuestion {
   subQuestions: ExamineeQuestion[];
   parse?: string;
   totalScore: number;
+  typeTitle?: string;
 }
 export interface Examinee {
   examineeId: number;
@@ -296,6 +297,7 @@ export interface Question extends QuestionState {
   duration: number;
   // 是否有子题
   hasSubQuestions: boolean;
+  typeTitle?: string;
 }
 
 export interface SubjectListRequestDTO {

+ 2 - 2
src/uni_modules/mp-html/components/mp-html/node/node.vue

@@ -70,10 +70,10 @@
       
       <!-- 富文本 -->
       <!-- #ifdef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
-      <rich-text v-else-if="!n.c&&(n.l||!handler.isInline(n.name, n.attrs.style))" :id="n.attrs.id" :style="n.f" :user-select="opts[4]" :nodes="[n]" />
+      <rich-text v-else-if="!n.c&&(n.l||!handler.isInline(n.name, n.attrs.style))" style="display: inline-block;" :id="n.attrs.id" :style="n.f" :user-select="opts[4]" :nodes="[n]" />
       <!-- #endif -->
       <!-- #ifndef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
-      <rich-text v-else-if="!n.c" :id="n.attrs.id" :style="'display:inline;'+n.f" :preview="false" :selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
+      <rich-text v-else-if="!n.c" :id="n.attrs.id" :style="'display:inline;'+n.f"  style="display: inline-block;" :preview="false" :selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
       <!-- #endif -->
       <!-- 继续递归 -->
       <view v-else-if="n.c===2" :id="n.attrs.id" :class="'_block _'+n.name+' '+n.attrs.class" :style="n.f+';'+n.attrs.style">

+ 4 - 6
src/uni_modules/uv-tabs/components/uv-tabs/uv-tabs.vue

@@ -6,7 +6,7 @@
 				<scroll-view
 					:scroll-x="scrollable"
 					:scroll-left="scrollLeft"
-					scroll-with-animation
+					:scroll-with-animation="animationEnabled"
 					class="uv-tabs__wrapper__scroll-view"
 					:show-scrollbar="false"
 					ref="uv-tabs__wrapper__scroll-view"
@@ -138,7 +138,7 @@
 				immediate: true,
 				handler (newValue, oldValue) {
 					// 内外部值不相等时,才尝试移动滑块
-					if (newValue !== this.innerCurrent) {
+					if (this.autoScroll && newValue !== this.innerCurrent) {
 						this.innerCurrent = newValue
 						this.$nextTick(() => {
 							this.resize()
@@ -289,9 +289,7 @@
 					})
 					// 获取了tabs的尺寸之后,设置滑块的位置
 					this.setLineLeft()
-					if(this.innerCurrent !== 0 || this.innerCurrent === 0 && !this.firstTime) {
-						this.setScrollLeft()
-					}
+					this.setScrollLeft()
 				})
 			},
 			// 获取导航菜单的尺寸
@@ -393,4 +391,4 @@
 			}
 		}
 	}
-</style>
+</style>