代码格式优化,去除多余的引入

This commit is contained in:
田岩
2025-09-01 10:54:27 +08:00
parent 828186c1d4
commit 4eebd75345
36 changed files with 100 additions and 250 deletions
+5 -17
View File
@@ -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)
-1
View File
@@ -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({
-8
View File
@@ -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) => {