代码格式优化,去除多余的引入
This commit is contained in:
+31
-31
@@ -10,11 +10,11 @@
|
||||
</view>
|
||||
<view class="input-view" @click="toSearchPage">
|
||||
<uv-input shape="circle"
|
||||
placeholderStyle='color:#999999;font-size:28rpx'
|
||||
placeholder="请输入课程名"
|
||||
placeholderStyle='color:#999999;font-size:28rpx'
|
||||
placeholder="请输入课程名"
|
||||
suffixIcon="search"
|
||||
:customStyle="customStyle"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:suffixIconStyle="suffixIconStyle"
|
||||
:readonly="true">
|
||||
</uv-input>
|
||||
</view>
|
||||
@@ -46,19 +46,19 @@
|
||||
</view>
|
||||
</view>
|
||||
<uv-scroll-list class="tags-view" :indicator="false">
|
||||
<uv-tags text="全部"
|
||||
shape="circle"
|
||||
plain
|
||||
class="tags-item"
|
||||
size="mini"
|
||||
<uv-tags text="全部"
|
||||
shape="circle"
|
||||
plain
|
||||
class="tags-item"
|
||||
size="mini"
|
||||
:type="activeTag.length === 0?'primary':'info'"
|
||||
@click="chooseTag({value:''})"
|
||||
></uv-tags>
|
||||
<uv-tags :text="item.label"
|
||||
v-for="item in tagsList"
|
||||
:key="item.value"
|
||||
shape="circle"
|
||||
plain
|
||||
<uv-tags :text="item.label"
|
||||
v-for="item in tagsList"
|
||||
:key="item.value"
|
||||
shape="circle"
|
||||
plain
|
||||
:type="activeTag.includes(item.value)?'primary':'info'"
|
||||
@click="chooseTag(item)"
|
||||
class="tags-item" size="mini"
|
||||
@@ -66,7 +66,7 @@
|
||||
</uv-scroll-list>
|
||||
<view class="course-list">
|
||||
<view class="left-type-list" v-if="'全部' === activeTab">
|
||||
<view
|
||||
<view
|
||||
v-for="item in courseTypeList"
|
||||
:key="item.value"
|
||||
:class="['type-item',activeCourseType == item.value ?'is-active':'']"
|
||||
@@ -76,7 +76,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="left-type-list" v-if="'生产线'===activeTab">
|
||||
<view
|
||||
<view
|
||||
v-for="item in coursePrdlineList"
|
||||
:key="item.value"
|
||||
:class="['type-item', activePrdlineType == item.value ?'is-active':'']"
|
||||
@@ -86,13 +86,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-course-list">
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="item in courseListTreeShow"
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="item in courseListTreeShow"
|
||||
:key="item.value"
|
||||
>
|
||||
<view
|
||||
class="type-title"
|
||||
<view
|
||||
class="type-title"
|
||||
v-if="item.courseList.length > 0 && showTypeName"
|
||||
>
|
||||
<!-- v-if="itemT.courseList.length>0 && " -->
|
||||
@@ -100,7 +100,7 @@
|
||||
{{item.label}}
|
||||
</view>
|
||||
<CourseItem v-for="itemC in item.courseList" :key="itemC.crsNum" :itemInfo="itemC" :activeTag="activeTag" @clickItem="toCourseDetail(itemC)"/>
|
||||
<view
|
||||
<view
|
||||
class="type-list"
|
||||
v-for="itemT in item.children"
|
||||
:key="itemT.value"
|
||||
@@ -141,7 +141,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
paddingTop: "5px",
|
||||
paddingBottom: "5px",
|
||||
border: "none"
|
||||
}
|
||||
}
|
||||
const suffixIconStyle = {
|
||||
color: "#2c8ef2",
|
||||
fontSize: "40rpx"
|
||||
@@ -164,16 +164,16 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
const courseTypeList = ref([])
|
||||
const coursePrdlineList = ref([])
|
||||
const tagsTree = ref([])
|
||||
|
||||
|
||||
const showFilterList = ref(false)
|
||||
const {
|
||||
statusBarHeight
|
||||
} = uni.getWindowInfo()
|
||||
|
||||
|
||||
const pageTopPadding = computed(() => statusBarHeight + 'px')
|
||||
|
||||
|
||||
const activeTagPop = ref([])
|
||||
|
||||
|
||||
const chooseTagPop = (item) => {
|
||||
if(!item.value){
|
||||
activeTagPop.value = []
|
||||
@@ -210,7 +210,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
}
|
||||
const showTypeName = computed(()=>{
|
||||
return (activeTab.value === '全部' && activeCourseType.value === '') || (activeTab.value === '生产线' && activePrdlineType.value === '')
|
||||
})
|
||||
})
|
||||
const tagsList = computed(()=>{
|
||||
let _arr = []
|
||||
tagsTree.value.forEach(t=>{
|
||||
@@ -221,7 +221,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
let _reqListN = _arr.filter(t=>t.required === "N")
|
||||
return _reqList.concat(_reqListN)
|
||||
})
|
||||
|
||||
|
||||
const courseListBase = ref([])
|
||||
const courseList = computed(()=>{
|
||||
if(activeTag.value.length > 0 && !!activeTag.value[0]){
|
||||
@@ -244,10 +244,10 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
})
|
||||
// 整理树形
|
||||
const courseListTree = computed(()=>{
|
||||
let _arr = activeTab.value === '全部'? courseTypeList.value
|
||||
let _arr = activeTab.value === '全部'? courseTypeList.value
|
||||
: activeTab.value === '生产线'? coursePrdlineList.value: []
|
||||
let _idKey = activeTab.value === '全部'? 'tagId': 'prdLineId'
|
||||
|
||||
|
||||
let _tree = _arr.map(t=>{
|
||||
let _children = t.children||[]
|
||||
return {
|
||||
@@ -397,7 +397,7 @@ import { onShow } from "@dcloudio/uni-app"
|
||||
}
|
||||
}
|
||||
.input-view{
|
||||
|
||||
|
||||
}
|
||||
.tabs-view{
|
||||
background: #ffffff;
|
||||
|
||||
@@ -121,9 +121,6 @@
|
||||
|
||||
const popup = ref(null);
|
||||
const popup_input_bottom = ref('0px');
|
||||
|
||||
const inputValue = ref('');
|
||||
const placeholder = ref('');
|
||||
const message_list = reactive([]);
|
||||
const status = ref(''); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
@@ -182,7 +179,7 @@
|
||||
};
|
||||
|
||||
const getData = (from = '') => {
|
||||
if (from == 'submit') {
|
||||
if (from === 'submit') {
|
||||
status.value = '';
|
||||
total.value = -1;
|
||||
page.value = 1;
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import common from '@/common/common';
|
||||
const props = defineProps({
|
||||
modelValue: Object
|
||||
});
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
modelValue: Object
|
||||
})
|
||||
const min_no_success_id = computed(() => {
|
||||
const find_item = props.modelValue?.pgrphData.find(res => (res.pgrphStdyStateName == '未学习' || res.pgrphStdyStateName == '学习中'))
|
||||
const find_item = props.modelValue?.pgrphData.find(res => (res.pgrphStdyStateName === '未学习' || res.pgrphStdyStateName === '学习中'))
|
||||
return find_item?.pgrphId || ''
|
||||
})
|
||||
|
||||
const toDetail = (item) => {
|
||||
if (item.pgrphStdyStateName == '已学习' || item.pgrphStdyStateName == '学习中' || min_no_success_id.value == item.pgrphId) {
|
||||
if (item.pgrphStdyStateName === '已学习' || item.pgrphStdyStateName === '学习中' || min_no_success_id.value === item.pgrphId) {
|
||||
emit('toStudyPrgh', item)
|
||||
} else {
|
||||
common.msg('请按顺序学习知识点')
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
</view>
|
||||
</uv-sticky>
|
||||
<!-- <swiper class="body-swiper" @change="swiper_change" :current="tabAct"><swiper-item> -->
|
||||
<view class="course-info" v-if="tabAct == 0">
|
||||
<view class="course-info" v-if="tabAct === 0">
|
||||
<introduceVue v-model="form"></introduceVue>
|
||||
</view>
|
||||
<!--</swiper-item><swiper-item>-->
|
||||
<view class="point" v-if="tabAct == 1">
|
||||
<view class="point" v-if="tabAct === 1">
|
||||
<knowledge v-model="form" @toStudyPrgh="toStudyPrgh"></knowledge>
|
||||
</view>
|
||||
<!--</swiper-item><swiper-item>-->
|
||||
<view class="evaluate" v-if="tabAct == 2 && form">
|
||||
<view class="evaluate" v-if="tabAct === 2 && form">
|
||||
<comment ref="commentRef" :crsId="crsId" :imgId="form.imgId"></comment>
|
||||
</view>
|
||||
<!--</swiper-item></swiper>-->
|
||||
@@ -120,7 +120,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { onShow, onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { getCourseDetailApi } from '@/api/courseDetail.js';
|
||||
import { startExamByCrs } from '@/api/examination.js';
|
||||
@@ -185,10 +185,6 @@
|
||||
scrollTop.value = e.detail.scrollTop;
|
||||
};
|
||||
|
||||
const swiper_change = (res) => {
|
||||
tabAct.value = res.detail.current;
|
||||
};
|
||||
|
||||
// 去考试
|
||||
const goto_examination = async () => {
|
||||
if (isPreview.value === 'preview') return common.msg('预览课程不允许考试');
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, nextTick } from 'vue';
|
||||
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { publishCrsEvaluation } from '@/api/courseDetail.js';
|
||||
import common from '@/common/common';
|
||||
@@ -92,7 +91,7 @@
|
||||
|
||||
const submit = () => {
|
||||
if (formData.bbsContent === '') {
|
||||
if (formData.bbsTag == 'SUG') {
|
||||
if (formData.bbsTag === 'SUG') {
|
||||
return common.msg('请输入你的建议');
|
||||
} else {
|
||||
return common.msg('请输入你的问题');
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, reactive, nextTick } from 'vue';
|
||||
import { computed, ref, reactive } from 'vue';
|
||||
import common from '@/common/common';
|
||||
import { queryCrsExamHisByExamId } from '@/api/courseRecord.js';
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
@@ -98,7 +98,6 @@
|
||||
// 跳转到详情
|
||||
const click_list_item = (list_item) => {
|
||||
console.log('list_item', list_item);
|
||||
const examLenTm = 666;
|
||||
const papersName = item.value.examName;
|
||||
|
||||
common.navigateTo(
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import itemVue from './examRecordItem.vue';
|
||||
import common from '@/common/common';
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { queryCrsExamRecordPaging } from '@/api/courseRecord.js';
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -48,15 +47,8 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const getStatusClass = (isFinish) => {
|
||||
// 00进行中、01已完成、02已超时
|
||||
if (isFinish === '00') return 'in_progress';
|
||||
if (isFinish === '01') return 'completed';
|
||||
return 'expired';
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
const scrolltolower = () => {
|
||||
getData();
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, reactive, nextTick } from 'vue';
|
||||
import { computed, ref, reactive } from 'vue';
|
||||
import common from '@/common/common';
|
||||
import { queryPracticeHis } from '@/api/courseRecord.js';
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import itemVue from './practiceRecordItem.vue';
|
||||
import common from '@/common/common';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { queryPracticeRecordPaging } from '@/api/courseRecord.js';
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -49,7 +48,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
const scrolltolower = () => {
|
||||
getData();
|
||||
};
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
}
|
||||
});
|
||||
const secondsToHours = (seconds) => {
|
||||
console.log('typeof seconds', typeof seconds);
|
||||
if (typeof seconds === 'number') {
|
||||
// 转换为小时并保留一位小数
|
||||
return (seconds / 3600).toFixed(1);
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import itemVue from './studyRecordItem.vue';
|
||||
import common from '@/common/common';
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive} from 'vue';
|
||||
import { queryStdyRecordPaging } from '@/api/courseRecord.js';
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -50,37 +49,11 @@
|
||||
});
|
||||
|
||||
};
|
||||
const getStatusClass = (isFinish) => {
|
||||
// 00进行中、01已完成、02已超时
|
||||
if (isFinish === '00') return 'in_progress';
|
||||
if (isFinish === '01') return 'completed';
|
||||
return 'expired';
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
|
||||
const scrolltolower = () => {
|
||||
getData();
|
||||
};
|
||||
|
||||
// 计算两个时间的时间差
|
||||
const formatDuration = (startTm, endTm) => {
|
||||
// 解析时间字符串为时间戳(毫秒)
|
||||
const startTime = new Date(startTm).getTime();
|
||||
const endTime = new Date(endTm).getTime();
|
||||
|
||||
// 计算时间差(秒),确保为正数
|
||||
const seconds = Math.abs(Math.floor((endTime - startTime) / 1000));
|
||||
|
||||
// 计算时、分、秒
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
const minutes = Math.floor((seconds % 3600) / 60);
|
||||
const remainingSeconds = seconds % 60;
|
||||
|
||||
// 补零格式化函数(统一处理所有单位)
|
||||
const formatNumber = (num) => num.toString().padStart(2, '0');
|
||||
|
||||
// 小时、分钟、秒均保持两位数格式
|
||||
return `${formatNumber(hours)}:${formatNumber(minutes)}:${formatNumber(remainingSeconds)}`;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getData
|
||||
});
|
||||
|
||||
@@ -19,15 +19,12 @@
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref, reactive, computed, onMounted, nextTick, getCurrentInstance } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import common from '@/common/common';
|
||||
import { queryPracticeRecordByExrId } from '@/api/courseRecord.js';
|
||||
|
||||
const exrId = ref('');
|
||||
const pass_status = ref(0);
|
||||
|
||||
const topicList = reactive([]);
|
||||
|
||||
const get_result = () => {
|
||||
|
||||
@@ -45,11 +45,9 @@
|
||||
import studyRecordList from './components/studyRecordList.vue';
|
||||
import practiceRecordList from './components/practiceRecordList.vue';
|
||||
import examRecordList from './components/examRecordList.vue';
|
||||
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
const listItemRefs = ref([]);
|
||||
const taskRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
const tabList = ref([
|
||||
{
|
||||
@@ -69,14 +67,10 @@
|
||||
const swiperChange = (item) => {
|
||||
tabAct.value = item.detail.current;
|
||||
};
|
||||
const search = (value) => {
|
||||
listItemRefs.value[tabAct.value]?.search(value);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
watch(
|
||||
tabAct,
|
||||
(newValue, oldValue) => {
|
||||
(newValue) => {
|
||||
typeof listItemRefs.value[newValue]?.getData === 'function' &&
|
||||
listItemRefs.value[newValue]?.getData('first');
|
||||
},
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
computed,
|
||||
onMounted,
|
||||
nextTick,
|
||||
} from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted, onUnmounted, nextTick } from 'vue';
|
||||
import { ref, reactive, onMounted, onUnmounted, nextTick } from 'vue';
|
||||
import { optionErrorIcon } from '@/common/imgSvg';
|
||||
import { saveTraQnsFeedback } from '@/api/examination.js';
|
||||
import common from '@/common/common';
|
||||
@@ -104,7 +104,7 @@
|
||||
await new Promise((resolve) => setTimeout(resolve, delayTime));
|
||||
}
|
||||
common.hideLoading();
|
||||
nextTick(() => {
|
||||
await nextTick(() => {
|
||||
feedbackInfo.type = [];
|
||||
feedbackInfo.text = '';
|
||||
feedbackInfo.qnsId = '';
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
mark: markList.includes(item.qnsId),
|
||||
completed: completedListStatus[index]
|
||||
}"
|
||||
@click="clikc_sheet_item(index)"
|
||||
@click="click_sheet_item(index)"
|
||||
>
|
||||
<view class="circle">
|
||||
{{ index + 1 }}
|
||||
@@ -143,16 +143,14 @@
|
||||
import Feedback from './components/feedback.vue';
|
||||
import Dialog from './components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import CharactersSubject from '@/components/examination/characters-subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive, computed} from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import common from '@/common/common';
|
||||
import { getPageCache } from '@/common/common';
|
||||
import { getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { optionErrorIcon, examinationSheetIcon } from '@/common/imgSvg';
|
||||
import { commitPaperExam, queryPaperExamScore, startExamByCrs, commitCrsExam } from '@/api/examination.js';
|
||||
|
||||
import { commitPaperExam, commitCrsExam } from '@/api/examination.js';
|
||||
const answerIsOver = ref(true);
|
||||
const feedbackRef = ref(null);
|
||||
const dialogRef = ref(null);
|
||||
@@ -215,8 +213,6 @@
|
||||
// 弹出框配置
|
||||
const dialogConfiguration = reactive({});
|
||||
|
||||
const activeVoiceId = ref('');
|
||||
|
||||
const swiperChange = (item) => {
|
||||
questionNumber.value = item.detail.current;
|
||||
};
|
||||
@@ -243,7 +239,7 @@
|
||||
const openSheet = (status) => (status ? popupRef.value.open('bottom') : popupRef.value.close());
|
||||
|
||||
// 点击答题卡按钮
|
||||
const clikc_sheet_item = (index) => {
|
||||
const click_sheet_item = (index) => {
|
||||
questionNumber.value = index;
|
||||
};
|
||||
|
||||
@@ -260,8 +256,6 @@
|
||||
}
|
||||
};
|
||||
|
||||
const voicePathValue = ref('');
|
||||
|
||||
// 录音按钮提交
|
||||
const touchBtnSubmit = (type, submitObj) => {
|
||||
const old_text = touchBtnRef.value?.clearinputText(); // 清除发送框数据
|
||||
@@ -317,24 +311,12 @@
|
||||
my_answer: []
|
||||
}))
|
||||
);
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 安全区域底部到屏幕底部的高度(即底部安全区域高度)
|
||||
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
|
||||
uni.onKeyboardHeightChange((res) => {
|
||||
let keyboardHeight = res.height;
|
||||
// 仅在iOS端补偿安全区域高度
|
||||
if (systemInfo.platform === 'ios') {
|
||||
keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数
|
||||
}
|
||||
popup_input_bottom.value = `${keyboardHeight}px`;
|
||||
console.log('端补偿安全区域高度', popup_input_bottom.value);
|
||||
});
|
||||
// #endif
|
||||
setupKeyboardHeightListener((height) => {
|
||||
popup_input_bottom.value = `${height}px`;
|
||||
})
|
||||
});
|
||||
|
||||
const result_click = ({ key }) => {
|
||||
console.log('res', key);
|
||||
if (key === 'hand_in_paper') {
|
||||
// 现在交卷
|
||||
hand_in_paper();
|
||||
@@ -406,7 +388,6 @@
|
||||
// 执行交卷
|
||||
const hand_in_paper = () => {
|
||||
const answerDtoList = topicList.map((res) => {
|
||||
console.log('resres', res);
|
||||
let answerItem = {
|
||||
examId: paperData.examId,
|
||||
papersId: paperData.papersId,
|
||||
@@ -430,12 +411,9 @@
|
||||
};
|
||||
}
|
||||
});
|
||||
console.log('提交的', answerDtoList);
|
||||
console.log('answerDtoList', answerDtoList);
|
||||
// 计算当前时间与开始时间的毫秒差值,再转换为整数秒
|
||||
const examLenTm = Math.floor((new Date().getTime() - examinationStartTime) / 1000);
|
||||
dialogRef.value.close();
|
||||
console.log('examLenTm', examLenTm);
|
||||
common.loading('正在提交');
|
||||
// 这里通过是否存在examId来判断是考试中心的考试还是课程的考试
|
||||
let func;
|
||||
@@ -457,7 +435,6 @@
|
||||
});
|
||||
}
|
||||
func.then((res) => {
|
||||
console.log('提交成功', res);
|
||||
// 判断是否需要查分
|
||||
if (res.body.flagQuery === 'Y') {
|
||||
// 需要查分
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import itemVue from './examRecordItem.vue';
|
||||
import common from '@/common/common';
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive } from 'vue';
|
||||
import { queryExamRecordPaging } from '@/api/courseRecord.js';
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -49,7 +48,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
const scrolltolower = (item) => {
|
||||
const scrolltolower = () => {
|
||||
getData();
|
||||
};
|
||||
|
||||
|
||||
@@ -9,40 +9,15 @@
|
||||
</view>
|
||||
<view class="detail-body">
|
||||
<examRecordList ref="listItemRef"></examRecordList>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import examRecordList from './components/examRecordList.vue';
|
||||
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
const listItemRef = ref(null);
|
||||
const taskRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
const tabList = ref([
|
||||
{
|
||||
name: '学习记录'
|
||||
},
|
||||
{
|
||||
name: '练习记录'
|
||||
},
|
||||
{
|
||||
name: '考试记录'
|
||||
}
|
||||
]);
|
||||
|
||||
const tabChange = (item) => {
|
||||
tabAct.value = item.index;
|
||||
};
|
||||
const swiperChange = (item) => {
|
||||
tabAct.value = item.detail.current;
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
listItemRef.value?.getData('first');
|
||||
});
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
</template>
|
||||
<script setup>
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive} from 'vue';
|
||||
import { queryTraPersonalCollectionCrsPaging, deleteTraPersonalCollectionById } from '@/api/favorites.js';
|
||||
import common from '@/common/common';
|
||||
const options = [
|
||||
@@ -57,7 +57,7 @@
|
||||
];
|
||||
const getData = (from = '') => {
|
||||
console.log('status.value', status.value);
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -108,10 +108,10 @@
|
||||
});
|
||||
});
|
||||
};
|
||||
const scrolltolower = (item) => {
|
||||
const scrolltolower = () => {
|
||||
getData();
|
||||
};
|
||||
const refreshData = (params) => {
|
||||
const refreshData = () => {
|
||||
total.value = -1;
|
||||
getData('first');
|
||||
};
|
||||
|
||||
@@ -47,13 +47,13 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive} from 'vue';
|
||||
import { queryTraPersonalCollectionTaskPaging,deleteTraPersonalCollectionById } from '@/api/favorites.js';
|
||||
import { setPageCache } from '@/common/common';
|
||||
import common from '@/common/common';
|
||||
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
];
|
||||
const getData = (from = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -104,7 +104,6 @@
|
||||
common.show('提示', '确认删除吗?').then((res) => {
|
||||
if (!res) return;
|
||||
common.loading();
|
||||
const collectId = '11';
|
||||
deleteTraPersonalCollectionById({ collectId: item.collectionId })
|
||||
.then(() => {
|
||||
data_list.splice(index, 1); // 从列表移除
|
||||
@@ -118,7 +117,6 @@
|
||||
|
||||
// 跳转到详情
|
||||
const click_item = (item) => {
|
||||
// tudo
|
||||
if (item.isTimeOut === '00') {
|
||||
common.msg('任务已结束');
|
||||
return;
|
||||
|
||||
@@ -45,11 +45,10 @@
|
||||
import FavoritesTask from './components/favoritesTask.vue';
|
||||
import FavoritesCourse from './components/favoritesCourse.vue';
|
||||
// 我的收藏
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { onShow, onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { LineBg } from '@/enum.js';
|
||||
import common from '@/common/common';
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
const courseRef = ref(null);
|
||||
const taskRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
@@ -180,7 +180,6 @@
|
||||
common.navigateTo('/pages/courseDetail/index?crsId=' + item.crsId);
|
||||
};
|
||||
const collect_click = async (id) => {
|
||||
console.log('学习', id);
|
||||
try {
|
||||
if (!id) {
|
||||
common.loading('收藏中');
|
||||
|
||||
@@ -44,10 +44,9 @@
|
||||
<script setup>
|
||||
import { LineBg } from '@/enum.js';
|
||||
import content from './components/content.vue';
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
const listItemRefs = ref([]);
|
||||
const taskRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
const tabList = ref([
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
];
|
||||
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
@@ -152,7 +152,6 @@
|
||||
const isLastTopic = computed(
|
||||
() => topicList.length === finishCurrent.value + 1 && finishCurrent.value === questionNumber.value
|
||||
);
|
||||
|
||||
const transition = (event) => {
|
||||
if (isTriggered.value) return;
|
||||
const dx = event.detail.dx;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
const status = ref('loading'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 15;
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
import common from '@/common/common';
|
||||
|
||||
@@ -34,20 +34,11 @@
|
||||
import PreviewAiSparring from './components/previewAiSparring.vue'
|
||||
import PreviewCourse from './components/previewCourse.vue'
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
computed,
|
||||
nextTick,
|
||||
onMounted,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
queryTraCrsBbsInfoByCrsId,
|
||||
replyTraCrsBbsInfo,
|
||||
qryChildTraCrsBbsInfo
|
||||
} from '@/api/courseDetail.js';
|
||||
import common from '@/common/common';
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
import {
|
||||
LineBg
|
||||
} from '@/enum.js'
|
||||
|
||||
@@ -102,7 +102,6 @@
|
||||
label: "否",
|
||||
}
|
||||
] // 性别
|
||||
const base_url = get_base_url()
|
||||
|
||||
// 去选择百禄
|
||||
const gotoMascot = () => {
|
||||
@@ -137,7 +136,7 @@
|
||||
}
|
||||
// 显示性别的计算属性
|
||||
const showGenderText = computed(() => {
|
||||
const item = sexOptions.find((item) => item.value == userInfo.value.gender)
|
||||
const item = sexOptions.find((item) => item.value === userInfo.value.gender)
|
||||
if (item) {
|
||||
return item.label
|
||||
} else {
|
||||
@@ -147,7 +146,7 @@
|
||||
|
||||
// 显示是否匿名的计算属性
|
||||
const showAnonymousText = computed(() => {
|
||||
const item = anonymousOptions.find((item) => item.value == userInfo.value?.anonymous)
|
||||
const item = anonymousOptions.find((item) => item.value === userInfo.value?.anonymous)
|
||||
if (item) {
|
||||
return item.label
|
||||
} else {
|
||||
|
||||
@@ -17,19 +17,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, nextTick, onMounted } from 'vue';
|
||||
import { ref, reactive} from 'vue';
|
||||
import { queryTraExamPapersPage } from '@/api/testingHall.js';
|
||||
import { queryTraCrsBbsInfoByCrsId } from '@/api/courseDetail.js';
|
||||
import itemVue from './content-item.vue';
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const total = ref(-1);
|
||||
const page = ref(0);
|
||||
const data_list = reactive([]);
|
||||
|
||||
const triggered = ref(false);
|
||||
const _freshing = ref(false);
|
||||
const offset = ref(0);
|
||||
const scrollRef = ref(null);
|
||||
const props = defineProps({
|
||||
index: {
|
||||
@@ -37,16 +32,9 @@
|
||||
default: 0
|
||||
}
|
||||
});
|
||||
const onRefresh = () => {
|
||||
if (_freshing.value) return;
|
||||
_freshing.value = true;
|
||||
setTimeout(() => {
|
||||
triggered.value = false;
|
||||
_freshing.value = false;
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const getData = (from = '', searchText = '') => {
|
||||
if (from == 'first') {
|
||||
if (from === 'first') {
|
||||
if (total.value !== -1) return;
|
||||
status.value = 'loading';
|
||||
total.value = -1;
|
||||
@@ -64,9 +52,9 @@
|
||||
page: page.value,
|
||||
limit: limit
|
||||
};
|
||||
if (props.index == 1) {
|
||||
if (props.index === 1) {
|
||||
params.examStat = 'Y';
|
||||
} else if (props.index == 2) {
|
||||
} else if (props.index === 2) {
|
||||
params.examStat = 'N';
|
||||
}
|
||||
queryTraExamPapersPage(params)
|
||||
|
||||
@@ -120,7 +120,6 @@
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { reactive, computed } from 'vue';
|
||||
import { startTraExamPapersInfo } from '@/api/examination.js';
|
||||
|
||||
import common from '@/common/common';
|
||||
import { setPageCache, getPageCache } from '@/common/common';
|
||||
const detailData = reactive({
|
||||
|
||||
@@ -65,13 +65,6 @@
|
||||
}]);
|
||||
|
||||
const contentRefs = ref([])
|
||||
const status = ref('loadmore') // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
const limit = 20;
|
||||
const total = ref(-1)
|
||||
const page = ref(0)
|
||||
const data_list = reactive([])
|
||||
|
||||
|
||||
const triggered = ref(false)
|
||||
const tabChange = (item) => {
|
||||
tabAct.value = item.index;
|
||||
@@ -80,7 +73,6 @@
|
||||
tabAct.value = item.detail.current;
|
||||
};
|
||||
const search = (value) => {
|
||||
console.log('value', value);
|
||||
contentRefs.value[tabAct.value]?.search(value);
|
||||
}
|
||||
const gotoDetails = (item) => {
|
||||
|
||||
@@ -40,7 +40,7 @@ const animationfinish = () => {
|
||||
indexNowNow.value = indexNow.value
|
||||
}
|
||||
const swiperTransition = (e) => {
|
||||
if (e.dx > 30 && indexNowNow.value == 2) {
|
||||
if (e.dx > 30 && indexNowNow.value === 2) {
|
||||
common.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,19 +79,17 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted, nextTick, onUnmounted } from 'vue';
|
||||
import { ref, reactive, computed, nextTick} from 'vue';
|
||||
import { onLoad, onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
|
||||
import Feedback from '@/pages/examination/components/feedback.vue';
|
||||
import Dialog from '@/pages/examination/components/dialog.vue';
|
||||
import Subject from '@/components/examination/subject.vue';
|
||||
import CharactersSubject from '@/components/examination/characters-subject.vue';
|
||||
import TouchBtn from '@/components/examination/touchBtn.vue';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache, getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import {getPageCache, setupKeyboardHeightListener } from '@/common/common';
|
||||
import { commonUploadVoiceFile } from '@/api/common.js';
|
||||
import { optionErrorIcon, examinationSheetIcon, practiceExitIcon } from '@/common/imgSvg';
|
||||
import { practiceAnswer, practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
|
||||
import {practiceExitIcon } from '@/common/imgSvg';
|
||||
import {practiceCommit, queryCrsPracticeAnswerResult } from '@/api/practice.js';
|
||||
|
||||
import { queryMistakesAnswerByMisId, mistakesCorrect } from '@/api/wrongQuestionRecord.js';
|
||||
const feedbackRef = ref(null);
|
||||
@@ -109,7 +107,6 @@
|
||||
const questionNumber = ref(0); // 题号
|
||||
|
||||
// 根据课程ID获取课程的题目 undefined为没有, 00为加载中, 02为加载失败
|
||||
|
||||
const topic = computed({
|
||||
get: () => topicList[questionNumber.value],
|
||||
set: (val) => (topicList[questionNumber.value] = val)
|
||||
|
||||
@@ -58,14 +58,13 @@
|
||||
// 我的收藏
|
||||
import { reactive, ref, computed, nextTick, onMounted, watch } from 'vue';
|
||||
import { LineBg } from '@/enum.js';
|
||||
import { queryMistakesAnswerByMisId, queryTraMistakesCollection } from '@/api/wrongQuestionRecord.js';
|
||||
import { queryTraMistakesCollection } from '@/api/wrongQuestionRecord.js';
|
||||
import common from '@/common/common';
|
||||
import { setPageCache } from '@/common/common';
|
||||
|
||||
const customStyle = {
|
||||
borderRadius: '16rpx'
|
||||
};
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
|
||||
const courseRef = ref(null);
|
||||
const correctRef = ref(null);
|
||||
|
||||
Reference in New Issue
Block a user