JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_修改首页pk跳转bug

This commit is contained in:
田岩
2026-03-05 09:31:33 +08:00
parent d6f7847e69
commit c5be86b02d
3 changed files with 70 additions and 76 deletions
+2 -2
View File
@@ -5,11 +5,11 @@ ENV = 'development'
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' #VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' #VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# DEV # DEV
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# sit # sit
#VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786' #VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
+1
View File
@@ -49,6 +49,7 @@
searchKey: 'comName', searchKey: 'comName',
fetchFunction: queryTraCompetitionInfoPaging fetchFunction: queryTraCompetitionInfoPaging
}); });
// 去竞赛页
const goto_competition = (item) => { const goto_competition = (item) => {
if (item.type !== '00') { if (item.type !== '00') {
if(item.type === '01') common.msg('竞赛未开始'); if(item.type === '01') common.msg('竞赛未开始');
+66 -73
View File
@@ -9,8 +9,12 @@
<!-- {{activeDate}} --> <!-- {{activeDate}} -->
<calendarCom @change="changeDate" /> <calendarCom @change="changeDate" />
<view class="table-list"> <view class="table-list">
<todoItem v-for="(item, index) in tableData" :dataInfo="item" <todoItem
:class="index === tableData.length -1 ?'last-item':''" @click="handleDetail(item)"></todoItem> v-for="(item, index) in tableData"
:dataInfo="item"
:class="index === tableData.length - 1 ? 'last-item' : ''"
@click="handleDetail(item)"
></todoItem>
<view class="empty-box" v-show="tableData.length === 0">暂无数据</view> <view class="empty-box" v-show="tableData.length === 0">暂无数据</view>
</view> </view>
<view class="more-btn" v-show="showMoreBtn" @click="getMoreData">点击加载更多</view> <view class="more-btn" v-show="showMoreBtn" @click="getMoreData">点击加载更多</view>
@@ -18,80 +22,70 @@
</template> </template>
<script setup> <script setup>
import { import { ref, onMounted, computed } from 'vue';
ref, import calendarCom from './calendar.vue';
onMounted, import todoItem from './todo-item.vue';
computed import common from '@/common/common.js';
} from 'vue' import { queryHaveToDo } from '@/api/index';
import calendarCom from './calendar.vue' import { queryTraExamPapersByPapersId } from '@/api/examination.js';
import todoItem from './todo-item.vue' import { queryTestPapers, queryOrgTree } from '@/api/competition.js';
import common from '@/common/common.js' import { checkTraPartnerInfoById } from '@/api/sparring.js';
import {
queryHaveToDo
} from '@/api/index'
import {
queryTraExamPapersByPapersId
} from '@/api/examination.js';
import {
queryTestPapers
} from '@/api/competition.js';
import {
checkTraPartnerInfoById
} from '@/api/sparring.js'
import { queryTraUserAnonyByUserId } from '@/api/user.js'; import { queryTraUserAnonyByUserId } from '@/api/user.js';
const activeDate = ref('') const activeDate = ref('');
const tableData = ref([]) const tableData = ref([]);
const pageObj = ref({ const pageObj = ref({
totalNum: 0, totalNum: 0,
page: 1, page: 1,
limit: 10 limit: 10
}) });
const changeDate = (date) => { const changeDate = (date) => {
activeDate.value = date activeDate.value = date;
getDataList(date, 1) getDataList(date, 1);
} };
const showMoreBtn = computed(() => { const showMoreBtn = computed(() => {
return pageObj.value.totalNum > pageObj.value.page * pageObj.value.limit return pageObj.value.totalNum > pageObj.value.page * pageObj.value.limit;
}) });
const getMoreData = () => { const getMoreData = () => {
pageObj.value.page += 1 pageObj.value.page += 1;
getDataList(activeDate.value) getDataList(activeDate.value);
} };
const getDataList = (date, flag) => { const getDataList = (date, flag) => {
common.loading(); common.loading();
if (flag === 1) { if (flag === 1) {
tableData.value = [] tableData.value = [];
pageObj.value = { pageObj.value = {
totalNum: 0, totalNum: 0,
page: 1, page: 1,
limit: 10 limit: 10
} };
} }
queryHaveToDo({ queryHaveToDo({
date, date,
...pageObj.value ...pageObj.value
}).then(res => { })
let _arr = res.body || [] .then((res) => {
pageObj.value.totalNum = res.total let _arr = res.body || [];
tableData.value = tableData.value.concat(_arr) pageObj.value.totalNum = res.total;
}).finally(() => { tableData.value = tableData.value.concat(_arr);
common.hideLoading(); })
}); .finally(() => {
} common.hideLoading();
});
};
const handleDetail = (item) => { const handleDetail = (item) => {
console.log(item) console.log(item);
switch (item.type) { switch (item.type) {
case '00': case '00':
common.navigateTo('/pages/courseDetail/index?crsId=' + item.id) common.navigateTo('/pages/courseDetail/index?crsId=' + item.id);
break; break;
case '01': case '01':
toSparringDetail(item) toSparringDetail(item);
break; break;
case '02': case '02':
toPKDetail(item) toPKDetail(item);
break; break;
case '03': case '03':
toExaminationDetail(item) toExaminationDetail(item);
break; break;
case '04': case '04':
common.setPageCache('learning_tasks_details', { common.setPageCache('learning_tasks_details', {
@@ -104,38 +98,38 @@
default: default:
break; break;
} }
} };
// 去PK // 去PK
const toPKDetail = async (item) => { const toPKDetail = async (item) => {
const comId = item.id;
common.loading(); common.loading();
queryTestPapers({ const result = Promise.all([queryTestPapers({ comId }), queryTraUserAnonyByUserId(), queryOrgTree()]);
comId: item.id result
})
.then((res) => { .then((res) => {
const papersId = res[0].body;
common.setPageCache('competition_list', { common.setPageCache('competition_list', {
papersId: res.body.papersId, // 试卷id papersId: papersId, // 试卷id
isAnony: res.body.isAnony, // 是否匿名 Y是N否 isAnony: res[1].body.isAnony, // 是否匿名 Y是N否
ruleDesc: res.body.ruleDesc, // 规则说明 ruleDesc: item.ruleDesc, // 规则说明
comName: item.name, // 标题 comName: item.comName, // 标题
comId: item.id comId: comId
}); });
queryTraUserAnonyByUserId().then(res2=>{ common.setValue('orgTree', res[2].body ?? []);
common.setValue('orgTree', res2.body ?? []);
common.navigateTo(`/pages/competition/matching?papersId=${res.body.papersId}&comId=${item.id}`);
})
})
.finally(() => {
common.hideLoading(); common.hideLoading();
common.navigateTo(`/pages/competition/matching?papersId=${papersId}&comId=${comId}`);
})
.catch(() => {
common.msg('网络繁忙,请稍后再试!');
}); });
}; };
// 去考试 // 去考试
const toExaminationDetail = async (item) => { const toExaminationDetail = async (item) => {
common.loading(); common.loading();
queryTraExamPapersByPapersId({ queryTraExamPapersByPapersId({
papersId: item.id papersId: item.id
}) })
.then((res) => { .then((res) => {
common.setPageCache('testing_hall_details',res.body); common.setPageCache('testing_hall_details', res.body);
common.navigateTo('/pages/testingHall/details'); common.navigateTo('/pages/testingHall/details');
}) })
.catch(() => {}) .catch(() => {})
@@ -144,19 +138,19 @@
}); });
}; };
// 跳转 课程详情 // 跳转 课程详情
const toSparringDetail = item => { const toSparringDetail = (item) => {
if (item.id) { if (item.id) {
checkTraPartnerInfoById({ checkTraPartnerInfoById({
traId: item.id traId: item.id
}).then(res => { }).then((res) => {
if (res.body.inRange) { if (res.body.inRange) {
common.navigateTo('/pages/sparring/detail?traId=' + item.id) common.navigateTo('/pages/sparring/detail?traId=' + item.id);
} else { } else {
common.show('提示', res.body.message, false) common.show('提示', res.body.message, false);
} }
}) });
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -188,7 +182,6 @@
} }
.icon_3 { .icon_3 {
// margin-top: 10rpx; // margin-top: 10rpx;
.img { .img {
width: 38rpx; width: 38rpx;