Browse Source

fix: 修复富文本格式问题

huangziyang 1 week ago
parent
commit
19826a0ea3

+ 3 - 1
.gitignore

@@ -1,3 +1,5 @@
 unpackage
 
-.cursorrule
+.cursorrule
+
+.gitignore

+ 2 - 2
components/Container/Container.vue

@@ -111,6 +111,8 @@ onMounted(() => {
     .includes(getRoute().routeList[0].path);
 
   if (isTarbarPage) {
+    console.log(systemInfo);
+    
     // 高度再减掉tabbar高度
     safeArea.value.height -= 48;
   }
@@ -133,8 +135,6 @@ onMounted(() => {
   getRect({
     name: ".bottom-button",
     onSuccess(res) {
-      console.log(res);
-
       safeArea.value.footer = res;
       safeArea.value.height -= safeArea.value.footer?.height;
       safeArea.value.height += 22; // 剩余高度

+ 15 - 8
components/Topic/TopicExam.vue

@@ -123,21 +123,23 @@
 
           <!-- 底部按钮 -->
           <view class="button-group">
-            <button
+            <view
               v-if="parindex >= 1"
-              class="prev-btn"
+              class="prev-btn button"
               @tap="handlePage(item, parindex, 'prevPage')"
             >
               上一题
-            </button>
-            <button
+            </view>
+            <view
               v-if="parindex + 1 < total"
-              class="next-btn"
+              class="next-btn button"
               @tap="handlePage(item, parindex, 'nextPage')"
             >
               下一题
-            </button>
-            <button v-if="parindex + 1 === total" @click="examEnd">交卷</button>
+            </view>
+            <view class="button" v-if="parindex + 1 === total" @click="examEnd"
+              >交卷</view
+            >
           </view>
         </template>
       </template>
@@ -278,11 +280,16 @@ const props = defineProps({
 const onBeforePageChange = (index) => {
   // 保存用户答题
   const item = data.value[nowIndex.value];
+  if (!item.selectAns.length) {
+    nowIndex.value = index;
+    return;
+  }
   request(
     "api/question_bank/question_reception/real_topic/save_user_real_topic",
     {
+      user_real_paper_id: props.real_topic_id,
       catalogue_id: getRoute().params.id,
-      real_topic_id: props.real_topic_id,
+      real_topic_id: item.id,
       is_correct: item.isRight ? 1 : 0,
       answer: item.selectAns.join(","),
     },

+ 12 - 10
components/Topic/TopicPractice.vue

@@ -127,32 +127,34 @@
 
           <!-- 底部按钮 -->
           <view class="button-group">
-            <button
+            <view
               v-if="parindex >= 1 && item.showResult"
-              class="prev-btn"
+              class="prev-btn button"
               @tap="handlePage(item, parindex, 'prevPage')"
             >
               上一题
-            </button>
-            <button
+            </view>
+            <view
               v-if="parindex + 1 < total && item.showResult"
-              class="next-btn"
+              class="next-btn button"
               @tap="handlePage(item, parindex, 'nextPage')"
             >
               下一题
-            </button>
-            <button
+            </view>
+            <view
+              class="button"
               v-if="parindex + 1 === total && item.showResult"
               @click="emit('lookReport', data, submitter)"
             >
               查看报告
-            </button>
-            <button
+            </view>
+            <view
+              class="button"
               v-if="!item.showResult"
               @click="questionSubmit(item, parindex)"
             >
               提交
-            </button>
+            </view>
           </view>
         </template>
       </template>

+ 1 - 1
components/Tree/Tree.vue

@@ -99,7 +99,7 @@ const emit = defineEmits(["onChnage", "onClickButton"]);
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 0 20rpx 10rpx 0;
+  padding: 8rpx 20rpx 10rpx 0;
   .buttons {
     display: flex;
     gap: 10rpx;

+ 6 - 6
pages.json

@@ -156,12 +156,12 @@
         "selectedIconPath": "static/icons/home_select.png",
         "text": "首页"
       },
-      {
-        "pagePath": "pages/learn/index",
-        "iconPath": "static/icons/learn.png",
-        "selectedIconPath": "static/icons/learn_select.png",
-        "text": "学习本"
-      },
+      // {
+      //   "pagePath": "pages/learn/index",
+      //   "iconPath": "static/icons/learn.png",
+      //   "selectedIconPath": "static/icons/learn_select.png",
+      //   "text": "学习本"
+      // },
       {
         "pagePath": "pages/challenge/index",
         "iconPath": "static/icons/challenge.png",

+ 2 - 1
pages/index/index.vue

@@ -90,6 +90,7 @@
           </view>
         </uni-section>
       </view>
+      <view></view>
     </view>
   </Container>
 </template>
@@ -262,7 +263,6 @@ onMounted(async () => {
   display: flex;
   flex-direction: column;
   gap: 20rpx;
-
   .time {
     display: flex;
     align-items: center;
@@ -383,6 +383,7 @@ onMounted(async () => {
   gap: 16rpx;
   border-radius: 16rpx;
   height: 100%;
+  margin-bottom: 20rpx;
 }
 
 .flex {

+ 3 - 2
pages/real/index.vue

@@ -30,7 +30,8 @@
 </template>
 
 <script setup name="real">
-import { ref, onMounted } from "vue";
+import { ref } from "vue";
+import { onShow } from "@dcloudio/uni-app";
 import Container from "../../components/Container/Container.vue";
 import { getRoute, router } from "../../utils/router";
 import { arrayToTree } from "../../utils";
@@ -50,7 +51,7 @@ const clickClass = (item) => {
   });
 };
 
-onMounted(async () => {
+onShow(async () => {
   const params = getRoute().params;
   title.value = params.title;
   const res = await request(

+ 2 - 2
pages/regulations/index.vue

@@ -79,7 +79,7 @@
 import Tree from "../../components/Tree/Tree.vue";
 import Container from "../../components/Container/Container.vue";
 import Modal from "@/components/Modal/Modal.vue";
-import { ref, getCurrentInstance, onMounted } from "vue";
+import { ref, getCurrentInstance } from "vue";
 import { getRect, arrayToTree } from "../../utils";
 import { getRoute, router } from "../../utils/router";
 import { request } from "../../utils/request";
@@ -175,7 +175,7 @@ onShow(async () => {
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 0 20rpx 10rpx 40rpx;
+  padding: 8rpx 20rpx 10rpx 40rpx;
   .buttons {
     display: flex;
     gap: 10rpx;

+ 19 - 4
pages/regulations/learing.vue

@@ -93,10 +93,16 @@ onShow(() => {
   >
     <view>
       <view :key="item.id" v-for="(item, index) in context">
-        <view class="title">考 点{{ index + 1 }} {{ item.name }}</view>
+        <view
+          class="title"
+          :class="{
+            'mt-40': index !== 0,
+          }"
+          >考 点{{ index + 1 }} {{ item.name }}</view
+        >
         <uv-parse class="text" :content="item.context" selectable />
       </view>
-      <text class="button" @click="onSubmit">已学完, 开启练习模式</text>
+      <text class="button mt-30" @click="onSubmit">已学完, 开启练习模式</text>
     </view>
   </Container>
 </template>
@@ -106,10 +112,19 @@ onShow(() => {
   color: #703060;
   font-weight: bold;
   text-align: center;
-  margin: 10rpx 0;
+  margin: 28rpx 0;
+  font-size: 40rpx;
+}
+
+.mt-40 {
+  margin-top: 80rpx;
 }
 
 .text {
-  line-height: 1.7;
+  line-height: 2;
+}
+
+.mt-30 {
+  margin-top: 30rpx;
 }
 </style>

+ 6 - 6
pages/user/share.vue

@@ -100,19 +100,19 @@ onMounted(() => {
 <style scoped lang="scss">
 @import "@/uni.scss";
 .bg {
-  height: 1621rpx;
+  height: 1285rpx;
   width: 100%;
-  background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/L3YoluT87QrM2nbwXD1YwJyZVjd3C2LvSKtZ9dd4.png");
+  background: url("https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/Ahdg7M3KIES9pNSnFB55Mlm9NNf6wrGq8oltvNUB.png");
   background-size: cover;
   position: relative;
   .qr-code {
     position: absolute;
-    width: 448rpx;
-    height: 448rpx;
+    width: 322.14rpx;
+    height: 322.14rpx;
     border-radius: 24rpx;
-    border: 16rpx solid $primary;
+    border: 8rpx solid $primary;
     left: 50%;
-    top: 31.5%;
+    top: 36.5%;
     transform: translateX(-50%);
   }
 }

+ 2 - 2
uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue

@@ -211,10 +211,10 @@
 
 	.uni-nav-bar-text {
 		/* #ifdef APP-PLUS */
-		font-size: 34rpx;
+		font-size: 38rpx;
 		/* #endif */
 		/* #ifndef APP-PLUS */
-		font-size: 14px;
+		font-size: 16px;
 		/* #endif */
 	}