|
@@ -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>
|