Browse Source

fix: 修复考试流程bug

huangziyang 2 days ago
parent
commit
0f9a94e766

+ 51 - 107
App.vue

@@ -1,116 +1,60 @@
-<template>
-  <Container title="学习本">
-    <view class="header">
-      <view class="stats">
-        <text>10000/20000</text>
-        <text>正确率50%</text>
-      </view>
-      <view class="tabs">
-        <view class="tab active">法规</view>
-        <view class="tab">药一</view>
-        <view class="tab">药综</view>
-        <view class="tab">中药一</view>
-        <view class="tab">中药二</view>
-        <view class="tab">中药二</view>
-      </view>
-      <view class="sub-tabs">
-        <view class="sub-tab active">答案正确(2301)</view>
-        <view class="sub-tab">答案错误(2301)</view>
-      </view>
-    </view>
-    <view class="content">
-      <view class="question-card" v-for="(question, index) in questions" :key="index">
-        <view class="question-header">
-          <text class="question-type">单选题</text>
-          <text class="question-date">2025-03-20 20:30:20</text>
-        </view>
-        <view class="question-text">
-          根据中药七情配伍理论,属于相畏的药组是?
-        </view>
-        <view class="options">
-          <view class="option" v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']" :key="i">
-            <text>{{ option }}</text>
-            <text>选项内容</text>
-          </view>
-        </view>
-        <view class="footer">
-          <button class="button">查看解析与考点</button>
-        </view>
-      </view>
-    </view>
-  </Container>
-</template>
+<script>
+export default {
+  onLaunch: function () {
 
-<script setup>
-import Container from "@/components/Container/Container.vue";
-console.log(11);
-
-// 示例数据
-const questions = Array(2).fill({});
+    console.log("App Launch");
+  },
+  onShow: function () {
+    console.log("App Show");
+  },
+  onHide: function () {
+    console.log("App Hide");
+  },
+};
 </script>
 
-<style scoped lang="scss">
-@import '@/uni.scss';
-
-.header {
-  padding: 16rpx;
-  background-color: #fff;
-  .stats {
-    display: flex;
-    justify-content: space-between;
-    margin-bottom: 8rpx;
-  }
-  .tabs, .sub-tabs {
-    display: flex;
-    margin-bottom: 8rpx;
-    .tab, .sub-tab {
-      padding: 8rpx 16rpx;
-      border-radius: 8rpx;
-      &.active {
-        background-color: $uni-primary;
-        color: #fff;
-      }
-    }
+<style lang="scss">
+@import "@/uni.scss";
+/*每个页面公共css */
+@import "@/uni_modules/uni-scss/index.scss";
+button {
+  background-color: $primary;
+  font-weight: 500;
+  font-size: 32rpx;
+  color: #fff;
+  margin: 0;
+  width: 100%;
+  &::after {
+    border: 0;
   }
 }
 
-.content {
-  padding: 16rpx;
-  .question-card {
-    background-color: #fff;
-    border-radius: 8rpx;
-    margin-bottom: 16rpx;
-    padding: 16rpx;
-    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
-    .question-header {
-      display: flex;
-      justify-content: space-between;
-      margin-bottom: 8rpx;
-      .question-type {
-        color: $uni-primary;
-      }
-    }
-    .options {
-      margin-top: 8rpx;
-      .option {
-        display: flex;
-        align-items: center;
-        margin-bottom: 4rpx;
-        text {
-          margin-right: 8rpx;
-        }
-      }
-    }
-    .footer {
-      margin-top: 8rpx;
-      .button {
-        background-color: $uni-primary;
-        color: #fff;
-        padding: 8rpx 16rpx;
-        border-radius: 8rpx;
-        text-align: center;
-      }
-    }
+.button {
+  background-color: $primary;
+  font-weight: 500;
+  font-size: 32rpx;
+  color: #fff;
+  margin: 0;
+  width: 100%;
+  border-radius: 20rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 20rpx 0;
+  &::after {
+    border: 0;
   }
 }
+
+.tip {
+  font-family: PingFang SC, PingFang SC;
+  font-weight: 400;
+  font-size: 24rpx;
+  color: #999999;
+}
+
+.button.plain {
+  background: $uni-primary-light;
+  color: $primary;
+}
 </style>

+ 22 - 25
components/Container/Container.vue

@@ -131,8 +131,10 @@ onMounted(() => {
     safeArea.value.height -= 50;
   }
 
-  // 24是内边距
-  safeArea.value.width -= 24;
+  if (props.scrollStyle?.padding === void 0) {
+    // 24是内边距
+    safeArea.value.width -= 24;
+  }
 
   const instance = getCurrentInstance();
   // 获取头部高度
@@ -140,11 +142,7 @@ onMounted(() => {
     name: ".title",
     onSuccess(res) {
       safeArea.value.title = res;
-      safeArea.value.height -= props.showTitle
-        ? isTarbarPage
-          ? safeArea.value.title?.height + safeArea.value.top
-          : safeArea.value.title?.height
-        : 0;
+      console.log(safeArea.value.title);
     },
     instance,
   });
@@ -153,8 +151,6 @@ onMounted(() => {
     name: ".bottom-button",
     onSuccess(res) {
       safeArea.value.footer = res;
-      safeArea.value.height -= safeArea.value.footer?.height;
-      safeArea.value.height += 22; // 剩余高度
     },
     instance,
   });
@@ -197,7 +193,7 @@ defineExpose({
     </view>
     <scroll-view
       enable-flex
-      show-scrollbar
+      :show-scrollbar="false"
       enable-back-to-top
       scroll-with-animation
       scroll-anchoring
@@ -205,22 +201,19 @@ defineExpose({
       :scroll-y="scrollY"
       :scroll-top="scrollTop"
       @scroll="onScroll"
+      :class="['scroll-view', scrollX ? 'topic-scroll' : '']"
+      :style="{
+        height: `calc(${
+          safeArea.height - safeArea.top - safeArea.title?.height - 100
+        }px - env(safe-area-inset-bottom))`,
+        width: safeArea.width + 'px',
+        whiteSpace: scrollX ? 'nowrap' : 'normal',
+        flex: 1,
+        ...scrollStyle,
+      }"
       v-if="!empty"
     >
-      <view
-        :class="['scroll-view', scrollX ? 'topic-scroll' : '']"
-        :style="{
-          height: `calc(100vh - ${
-            menuButtonInfo.top +
-            menuButtonInfo.height +
-            40
-          }px - env(safe-area-inset-bottom))`,
-          whiteSpace: scrollX ? 'nowrap' : 'normal',
-          ...scrollStyle,
-        }"
-      >
-        <slot></slot>
-      </view>
+      <slot></slot>
       <!-- 底部文字 -->
       <view v-if="showBottom && bottomText" class="bottom-text">
         {{ bottomText }}
@@ -246,7 +239,11 @@ defineExpose({
 
 <style lang="scss" scoped>
 @import "@/uni.scss";
-
+scroll-view ::-webkit-scrollbar {
+  width: 0;
+  height: 0;
+  background-color: transparent;
+}
 .title {
   position: sticky;
   top: 0;

+ 5 - 1
components/Topic/TopicExam.vue

@@ -269,6 +269,10 @@ const props = defineProps({
     type: Function,
     default: null,
   },
+  isEnd: {
+    type: Boolean,
+    default: false,
+  },
   total: {
     type: Number,
     default: 0,
@@ -313,7 +317,7 @@ const emit = defineEmits([
 
 const onBack = () =>
   new Promise((resolve) => {
-    if (!data.value.length) {
+    if (!data.value.length || props.isEnd) {
       resolve(true);
       return;
     }

+ 71 - 5
pages/challenge/index.vue

@@ -17,13 +17,79 @@
 
 <script setup>
 import Container from "../../components/Container/Container.vue";
+import { request } from "../../utils/request";
 import { router } from "../../utils/router";
+import { onShow } from "@dcloudio/uni-app";
+import { ref, getCurrentInstance } from "vue";
+import ext from "../../ext.json";
+const instance = getCurrentInstance();
+const isPay = ref(true);
 
-const toAdd = () => {
-  router.push({
-    url: "/pages/challenge/addContant",
-  })
-}
+const p = ref(0);
+onShow(async () => {
+  const res = request(
+    "api/question_bank/question_reception/challenge_registration_log/detail"
+  );
+  if (res.data) return;
+  isPay.value = false;
+  request(
+    "api/question_bank/question_reception/recharge_package/list",
+    {
+      package_type: 2,
+    },
+    "post"
+  ).then(async (res) => {
+    p.value = res.data.data[0].id;
+  });
+});
+
+const toAdd = async () => {
+  if (isPay.value) {
+    router.push({
+      url: "/pages/challenge/addContant",
+    });
+    return;
+  }
+  uni.login({
+    provider: instance.proxy.$mpPlatform.substring(3),
+    success: async ({ code }) => {
+      const package_id = p.value;
+      // 先调用新增订单再支付
+      const order = await request(
+        "api/question_bank/question_reception/orders/add",
+        {
+          package_id,
+        }
+      );
+      const e = await request(
+        "api/question_bank/question_reception/orders/wechat_pay",
+        {
+          code,
+          order_id: order.data.order_id,
+          app_id: ext.extAppid,
+        }
+      );
+
+      uni.requestPayment({
+        provider: "wxpay",
+        timeStamp: e.data.timeStamp, //时间戳
+        nonceStr: e.data.nonceStr, //随机字符串
+        package: e.data.package, //prepay_id
+        signType: e.data.signType, //签名算法MD5
+        paySign: e.data.paySign, //签名,
+        success(res) {
+          console.log(res);
+          router.push({
+            url: "/pages/challenge/addContant",
+          });
+        },
+        fail(err) {
+          console.log(err);
+        },
+      });
+    },
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 290 - 86
pages/learn/index.vue

@@ -1,126 +1,330 @@
 <template>
-  <Container title="学习本">
-    <view class="header">
-      <view class="stats">
-        <text>10000/20000</text>
-        <text>正确率50%</text>
-      </view>
-      <view class="tabs">
-        <view class="tab active">法规</view>
-        <view class="tab">药一</view>
-        <view class="tab">药综</view>
-        <!-- 其他标签 -->
-      </view>
-      <view class="sub-tabs">
-        <view class="sub-tab active">答案正确(2301)</view>
-        <view class="sub-tab">答案错误(2301)</view>
-      </view>
-    </view>
-    <view class="content">
-      <view class="question-card" v-for="(question, index) in questions" :key="index">
-        <view class="question-header">
-          <text class="question-type">单选题</text>
-          <text class="question-date">2025-03-20 20:30:20</text>
-        </view>
-        <view class="question-text">
-          根据中药七情配伍理论,属于相畏的药组是?
-        </view>
-        <view class="options">
-          <view class="option" v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']" :key="i">
-            <text>{{ option }}</text>
-            <text>选项内容</text>
-          </view>
-        </view>
-        <view class="footer">
-          <button class="explain-btn">查看解析与考点</button>
-        </view>
-      </view>
-    </view>
+  <Container
+    title="学习本"
+    bgColor="#f8f8f8"
+    :scrollStyle="{
+      padding: 0,
+    }"
+    headerColor="#fff"
+  >
+    <div class="top">
+      <div
+        class="item col left"
+        :class="currentIndex === 0 && 'select'"
+        @click="currentIndex = 0"
+      >
+        <span>
+          <span class="primary">{{ 10 }}</span
+          >/{{ 20 }}
+        </span>
+        <span
+          >正确率<span class="primary">{{ 50 }}%</span></span
+        >
+      </div>
+      <div
+        class="item"
+        :class="currentIndex === 1 && 'select'"
+        @click="currentIndex = 1"
+      >
+        考试记录(<span class="primary">{{ 1 }}</span
+        >)
+      </div>
+      <div
+        class="item right"
+        :class="currentIndex === 2 && 'select'"
+        @click="currentIndex = 2"
+      >
+        考试记录(<span class="primary">{{ 2 }}</span
+        >)
+      </div>
+    </div>
+    <div class="tab">
+      <scroll-view class="scroll" scroll-x>
+        <div class="box">
+          <div
+            v-for="item in 7"
+            class="item"
+            :class="{
+              select: item === currentTab,
+            }"
+            :key="item"
+            @click="currentTab = item"
+          >
+            法规{{ item }}
+          </div>
+        </div>
+      </scroll-view>
+      <div class="select-line" v-if="currentIndex === 0">
+        <div class="item" :class="{ select: isRight }" @click="isRight = true">
+          答案正确({{ 2301 }})
+        </div>
+        <div
+          class="item"
+          :class="{ select: !isRight }"
+          @click="isRight = false"
+        >
+          答案错误({{ 2301 }})
+        </div>
+      </div>
+    </div>
+    <div class="context">
+      <template v-if="currentIndex === 0">
+        <div class="card" v-for="item in 10" :key="item">
+          <div class="question-header">
+            <span class="question-type">单选题</span>
+            <span class="question-date">2025-03-20 20:30:20</span>
+          </div>
+          <div class="question-text">
+            根据中药七情配伍理论,属于相畏的药组是?
+          </div>
+          <div class="options">
+            <div
+              class="option"
+              v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']"
+              :key="i"
+            >
+              <span class="option-select">{{ option }}</span>
+              <span>选项内容</span>
+            </div>
+          </div>
+          <div class="footer">
+            <div class="c-primary">查看解析与考点</div>
+          </div>
+        </div>
+      </template>
+      <template v-if="currentIndex === 1">
+        <div class="card" v-for="item in 10" :key="item">
+          <div class="card-header">
+            <span class="title">2024年真题</span>
+            <span class="exam-count">已考试15次</span>
+          </div>
+          <div class="card-body">
+            <span>最低分:20分</span>
+            <span>最高分:98分</span>
+          </div>
+          <div class="footer">
+            <div class="c-primary">再考一次</div>
+          </div>
+        </div>
+      </template>
+      <template v-if="currentIndex === 2">
+        <div class="card" v-for="item in 10" :key="item">
+          <div class="question-header">
+            <span class="question-type">单选题</span>
+            <span class="question-date">2025-03-20 20:30:20</span>
+          </div>
+          <div class="question-text">
+            根据中药七情配伍理论,属于相畏的药组是?
+          </div>
+          <div class="options">
+            <div
+              class="option"
+              v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']"
+              :key="i"
+            >
+              <span class="option-select">{{ option }}</span>
+              <span>选项内容</span>
+            </div>
+          </div>
+          <div class="footer">
+            <div class="c-primary">查看解析与考点</div>
+          </div>
+        </div>
+      </template>
+    </div>
   </Container>
 </template>
 
 <script setup>
 import Container from "@/components/Container/Container.vue";
+import { ref } from "vue";
 
+const currentIndex = ref(2);
+const currentTab = ref(1);
+const isRight = ref(true);
 // 示例数据
-const questions = Array(2).fill({});
 </script>
 
 <style scoped lang="scss">
-@import '@/uni.scss';
+@import "@/uni.scss";
 
-.header {
-  padding: 16rpx;
-  background-color: #fff;
-  .stats {
+.primary {
+  color: $primary;
+}
+.top {
+  margin: 24rpx 32rpx 0;
+  display: grid;
+  grid-template-columns: repeat(3, 1fr);
+
+  .item {
+    border: 1px solid $primary;
     display: flex;
-    justify-content: space-between;
-    margin-bottom: 8rpx;
+    align-items: center;
+    justify-content: center;
+    height: 113rpx;
+    background-color: #fff;
+    font-weight: 500;
+    font-size: 24rpx;
+    color: #333333;
   }
-  .tabs, .sub-tabs {
-    display: flex;
-    margin-bottom: 8rpx;
-    .tab, .sub-tab {
-      padding: 8rpx 16rpx;
-      border-radius: 8rpx;
-      &.active {
-        background-color: $uni-primary;
-        color: #fff;
-      }
+  .item.col {
+    flex-direction: column;
+    gap: 12rpx;
+  }
+  .item.left {
+    border-top-left-radius: 24rpx;
+  }
+  .item.right {
+    border-top-right-radius: 24rpx;
+  }
+  .select {
+    border-color: #fff;
+  }
+}
+
+.tab {
+  background-color: #fff;
+
+  .select-line {
+    display: grid;
+    grid-template-columns: repeat(2, 1fr);
+    .item {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding: 28rpx;
+      border-bottom: 1px solid #fff;
+      font-weight: 500;
+      font-size: 32rpx;
+    }
+    .item.select {
+      color: $primary;
+      border-color: $primary;
     }
   }
 }
 
-.content {
-  padding: 16rpx;
-  .question-card {
-    background-color: #fff;
-    border-radius: 8rpx;
-    margin-bottom: 16rpx;
+.scroll {
+  white-space: nowrap;
+  font-weight: 500;
+  font-size: 32rpx;
+  color: #333333;
+  .box {
+    padding: 30rpx;
+  }
+
+  .item {
+    display: inline-flex;
+    padding: 8rpx 36rpx;
+  }
+
+  .item.select {
+    border-radius: 200rpx;
+    background-color: $primary;
+    color: #fff;
+  }
+}
+
+.context {
+  padding: 20rpx 32rpx;
+  display: flex;
+  flex-direction: column;
+  gap: 16rpx;
+
+  .card {
+    border-radius: 16rpx;
     padding: 16rpx;
+    background-color: #fff;
+    display: flex;
+    flex-direction: column;
+
     .question-header {
       display: flex;
       justify-content: space-between;
-      margin-bottom: 8rpx;
+      margin-bottom: 12rpx;
+      color: #999;
       .question-type {
-        color: $uni-primary;
+        font-weight: 500;
+        font-size: 32rpx;
+        color: #999999;
+        border-radius: 8rpx 8rpx 8rpx 8rpx;
+        border: 1rpx solid #dddddd;
+        padding: 0 10rpx;
+      }
+      .question-date {
+        color: #999;
+        font-size: 24rpx;
       }
     }
+    .question-text {
+      font-size: 28rpx;
+      color: #333;
+      margin-bottom: 16rpx;
+    }
     .options {
       margin-top: 8rpx;
       .option {
         display: flex;
         align-items: center;
-        margin-bottom: 4rpx;
-        text {
-          margin-right: 8rpx;
+        margin-bottom: 12rpx;
+        gap: 14rpx;
+
+        .option-select {
+          width: 51rpx;
+          height: 51rpx;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          border: 1rpx solid #dddddd;
+          border-radius: 50%;
         }
       }
     }
     .footer {
-      margin-top: 8rpx;
-      .explain-btn {
-        background-color: $uni-primary;
-        color: #fff;
-        padding: 8rpx 16rpx;
-        border-radius: 8rpx;
-        text-align: center;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+
+    .card-header {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 12rpx;
+      .title {
+        font-weight: bold;
+        font-size: 28rpx;
+        color: #333;
+      }
+      .exam-count {
+        color: #999;
+        font-size: 24rpx;
       }
     }
-  }
-}
 
-.bottom-nav {
-  display: flex;
-  justify-content: space-around;
-  padding: 16rpx 0;
-  background-color: #fff;
-  .nav-item {
-    flex: 1;
-    text-align: center;
-    &.active {
-      color: $uni-primary;
+    .card-body {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      font-weight: 500;
+      font-size: 28rpx;
+      color: #000000;
     }
   }
 }
-</style>
+
+.c-primary {
+  padding: 2rpx 10rpx;
+  border-radius: 4rpx;
+  border: 1rpx solid $primary;
+  color: $primary;
+  font-size: 24rpx;
+}
+
+.c-error {
+  padding: 2rpx 10rpx;
+  border-radius: 4rpx;
+  border: 1rpx solid $error;
+  color: $error;
+  font-size: 24rpx;
+}
+</style>

+ 41 - 24
pages/real/exam.vue

@@ -23,6 +23,7 @@ const correct = ref({
 
 const showReport = ref(false);
 const showShare = ref(false);
+const isEnd = ref(false);
 const submitter = ref({
   closeText: "直接退出",
   context: "您本次答题还未提交, 确定要退出答题吗?",
@@ -43,24 +44,29 @@ const real_topic_id = ref(0);
 
 const getList = async (params = {}) => {
   if (pageParams.value.page * pageParams.value.limit >= total.value) return;
-  const t = await request(
-    "api/question_bank/question_reception/real_topic/set_user_new_paper",
-    {
-      catalogue_id: getRoute().params.id,
-    }
-  );
-
-  real_topic_id.value = t.data;
+  const { catalogue_id, id } = getRoute().params;
+  if (!catalogue_id) {
+    const t = await request(
+      "api/question_bank/question_reception/real_topic/set_user_new_paper",
+      {
+        catalogue_id: getRoute().params.id,
+      }
+    );
+    real_topic_id.value = t.data;
+  } else {
+    real_topic_id.value = id;
+  }
 
   const res = await request(
     "api/question_bank/question_reception/real_topic/get_real_topic",
     {
       ...params,
-      catalogue_id: getRoute().params.id,
-      real_topic_id: real_topic_id.value,
+      catalogue_id: catalogue_id || getRoute().params.id,
+      user_real_paper_id: real_topic_id.value,
     }
   );
   total.value = res.data.total;
+  correct.value.not = total.value;
   data.value.push(
     ...res.data.data.map((item, ind) => {
       let questions = [];
@@ -89,15 +95,19 @@ const getList = async (params = {}) => {
         ...item,
         questions, // 题目
         ansList, // 正确答案
-        selectAns: [], // 选择的答案
-        showResult: false, // 是否展示答案
-        isRight: false, // 是否正确
+        selectAns: !item.user_answer ? [] : item.user_answer.split(","), // 选择的答案
+        showResult: !!catalogue_id, // 是否展示答案
+        isRight: !!item.is_correct, // 是否正确
         isImage: item.title.includes("<img"),
         ind,
       };
     })
   );
-  pageParams.value.page++;
+  console.log(data.value);
+
+  if (catalogue_id) {
+    lookReport(data.value, submitter.value);
+  }
 };
 
 const nextPage = (e) => {
@@ -109,16 +119,19 @@ const nextPage = (e) => {
 const lookReport = async (d, s) => {
   data.value = d;
   const totalTime = Time.end();
+  isEnd.value = true;
   // 提交试卷
-  await request(
-    "api/question_bank/question_reception/real_topic/user_submit_real_paper",
-    {
-      user_real_paper_id: real_topic_id.value,
-      catalogue_id: getRoute().params.id,
-      use_time: totalTime.totalTime,
-      use_time_str: totalTime.formatTime,
-    }
-  );
+  if (!getRoute().params.catalogue_id) {
+    await request(
+      "api/question_bank/question_reception/real_topic/user_submit_real_paper",
+      {
+        user_real_paper_id: real_topic_id.value,
+        catalogue_id: getRoute().params.id,
+        use_time: totalTime.totalTime,
+        use_time_str: totalTime.formatTime,
+      }
+    );
+  }
   showReport.value = true;
   submitter.value = {
     ...s,
@@ -138,6 +151,9 @@ const lookReport = async (d, s) => {
 onMounted(async () => {
   const params = getRoute().params;
   title.value = params.title;
+  if (params.catalogue_id) {
+    showReport.value = true;
+  }
   await getList(pageParams.value);
   Time.start();
 });
@@ -148,6 +164,7 @@ onMounted(async () => {
     :title="title"
     :total="total"
     mode="practice"
+    :isEnd="isEnd"
     :topics="data"
     @nextPage="nextPage"
     @lookReport="lookReport"
@@ -193,7 +210,7 @@ onMounted(async () => {
           <view
             class="item"
             :class="{
-              right: it.isRight && it.showResult,
+              right: it.isRight && it.showResult && it.selectAns.length,
               error: !it.isRight && it.showResult && it.selectAns.length,
             }"
             v-for="(it, index) in data"

+ 27 - 13
pages/real/history.vue

@@ -28,19 +28,30 @@
       >注:题型可能会含有单选题、多选题、配伍题、综合分析题;请注意考试时长,无论答题是否完全,到时自动交卷。</view
     >
 
-    <view class="title-exam">考试记录</view>
-    <view class="exam-history" v-if="list.length">
-      <view
-        class="i"
-        :class="index !== list.length - 1 && 'no-laster'"
-        v-for="(item, index) in list"
-      >
-        <view>2025-05-31</view>
-        <view>90分钟</view>
-        <view>50/100题</view>
-        <view class="score">100分<uni-icons type="right" /></view>
+    <template v-if="list.length">
+      <view class="title-exam">考试记录</view>
+      <view class="exam-history">
+        <view
+          class="i"
+          :class="index !== list.length - 1 && 'no-laster'"
+          v-for="(item, index) in list"
+          :id="item.id"
+          @click="
+            onClick({
+              id: item.id,
+              catalogue_id: item.catalogue_id,
+            })
+          "
+        >
+          <view>{{ util.timestampToString_day(item.begin_time) }}</view>
+          <view>{{ item.use_time_str?.split(":")?.[0] }}分钟</view>
+          <view>{{ item.complete }}/100题</view>
+          <view class="score"
+            >{{ item.score }}分<uni-icons type="right"
+          /></view>
+        </view>
       </view>
-    </view>
+    </template>
     <template #footer>
       <button @click="onClick">开始考试</button>
     </template>
@@ -53,6 +64,7 @@ import Container from "../../components/Container/Container.vue";
 import { getRoute, router } from "../../utils/router";
 import { request } from "../../utils/request";
 import { onShow } from "@dcloudio/uni-app";
+import util from "@/utils/common";
 
 const userInfo = ref({
   userpic: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
@@ -60,12 +72,13 @@ const userInfo = ref({
 });
 const list = ref([]);
 
-const onClick = () => {
+const onClick = (data = {}) => {
   router.push({
     url: "/pages/real/exam",
     params: {
       title: "考试",
       id: getRoute().params.id, // 考试id
+      ...data,
     },
   });
 };
@@ -124,6 +137,7 @@ onShow(async () => {
   font-weight: 500;
   font-size: 32rpx;
   color: #333333;
+  margin: 32rpx 0 16rpx;
 }
 
 .exam-history {

+ 0 - 2
pages/recharge/index.vue

@@ -110,8 +110,6 @@ const onSubmit = () => {
         }
       );
 
-      console.log(e.data);
-
       uni.requestPayment({
         provider: "wxpay",
         timeStamp: e.data.timeStamp, //时间戳

+ 1 - 2
pages/regulations/index.vue

@@ -33,7 +33,7 @@
           class="modal-mask"
           :style="{
             height: `${maskStyle.height}px`,
-            width: `${maskStyle.width}px`,
+            width: `100vw`,
           }"
           v-if="maskStyle.height > 0"
         >
@@ -118,7 +118,6 @@ const resolveHeight = () =>
       name: ".free-content",
       instance,
       onSuccess(res) {
-        maskStyle.value.width = safeArea.value?.source?.width || 0;
         maskStyle.value.height = safeArea.value.height - res.height;
       },
     });