diff --git a/src/api/search.js b/src/api/search.js new file mode 100644 index 00000000..17666ef1 --- /dev/null +++ b/src/api/search.js @@ -0,0 +1,12 @@ +import request from '@/api/request' +const base_url = '/traapp' + +// 搜索 +export const appSearchCrsApi = (data) => { + return request({ + url: base_url + '/traSearchHis/appSearchCrs', + method: 'post', + toastErrors: true, + data + }); +}; diff --git a/src/pages/learningTasks/components/content-item.vue b/src/pages/learningTasks/components/content-item.vue index 6b08a68a..4922e5d5 100644 --- a/src/pages/learningTasks/components/content-item.vue +++ b/src/pages/learningTasks/components/content-item.vue @@ -10,13 +10,11 @@ {{ item.taskName }} - 起止时间: - {{ item.startTm?.substr(0, 10) }}至{{ item.endTm?.substr(0, 10) }} + 起止时间:{{ item.startTm?.substr(0, 10) }}至{{ item.endTm?.substr(0, 10) }} - 完成人数: - {{ item.taskFinishSums ?? 0 }}/{{ item.taskSums ?? 0 }} + 完成人数:{{ item.taskFinishSums ?? 0 }}/{{ item.taskSums ?? 0 }} 进度: @@ -94,7 +92,7 @@ } .item { height: 170rpx; - margin: 32rpx 22rpx; + margin-top: 32rpx; display: flex; .img_div { @@ -151,6 +149,7 @@ flex-wrap: nowrap; height: 23rpx; overflow: hidden; + white-space: nowrap; } .people_progress_div { diff --git a/src/pages/learningTasks/components/content.vue b/src/pages/learningTasks/components/content.vue index 6992c118..d84bc14b 100644 --- a/src/pages/learningTasks/components/content.vue +++ b/src/pages/learningTasks/components/content.vue @@ -83,5 +83,7 @@ height: calc(100vh - var(--status-bar-height) - 88rpx - 80rpx - 88rpx - 20rpx - 30rpx); background-color: #fff; border-radius: 16rpx; + padding: 0 12rpx 0 22rpx; + box-sizing: border-box; } diff --git a/src/pages/search/result.vue b/src/pages/search/result.vue index ebda95e9..f9feb838 100644 --- a/src/pages/search/result.vue +++ b/src/pages/search/result.vue @@ -90,7 +90,7 @@ 考试 - + 暂无数据 @@ -117,12 +117,17 @@ import TaskItem from '@/pages/learningTasks/components/content-item.vue'; import ExamItem from '@/pages/testingHall/components/content-item.vue'; import { onLoad } from '@dcloudio/uni-app'; + import { appSearchCrsApi } from '@/api/search.js' const fromType = ref('') onLoad((params) => { + inputValue.value = params.searchName fromType.value = params.from; }); + onShow(() => { + search() + }); // 静态样式配置 const fixedCustomStyles = { backgroundColor: "#ffffff", @@ -221,64 +226,7 @@ const testList = ref([]) const taskList = ref([]) const examList = ref([]) - const courseList = ref([{ - "crsId": "CRS0250640161302025082117515100000063160", - "crsNum": "CRS0220", - "crsName": "演示课程名称", - "tagId": "TRACRSCATALOG02506401613020250708174549000295707", - "prdLineId": "TRAPRDLINE02501812207220250714175204000007646", - "issuTm": "2025-08-21 17:54:41", - "imgId": "S3F0250181220722025082117505700000598881", - "imgThumbId": "S3T0250181220722025082117510000000485989", - "evalGrade": 10.00, - "mtTime": "2025-08-25 09:36:47", - "accmStdyCnt": 0, - "tagCataList": [ - { - "crsId": "CRS0250640161302025082117515100000063160", - "tagId": "TRATAGCATALOG02506401613020250616100038000091431", - "tagName": "子标签2", - "tagParentId": "TRATAGCATALOG02506401613020250616100022000071334", - "showOrder": 0 - }, - { - "crsId": "CRS0250640161302025082117515100000063160", - "tagId": "TRATAGCATALOG02501812207220250710091040000005889", - "tagName": "全员必学", - "tagParentId": "TRATAGCATALOG02506401613020250616104856000000355", - "showOrder": 0 - } - ] - }, - { - "crsId": "CRS0250640161302025082119435100000132546", - "crsNum": "CRS0224", - "crsName": "测试简答题mq", - "tagId": "TRACRSCATALOG02506401613020250708174532000241736", - "prdLineId": "TRAPRDLINE02501812207220250714175204000007646", - "issuTm": "2025-08-21 19:44:37", - "imgId": "S3F0250181220722025082119425800000658876", - "imgThumbId": "S3T0250181220722025082119430000000548197", - "evalGrade": 10.00, - "mtTime": "2025-08-25 09:31:34", - "accmStdyCnt": 0, - "tagCataList": [ - { - "crsId": "CRS0250640161302025082119435100000132546", - "tagId": "TRATAGCATALOG02506401613020250616100041000105085", - "tagName": "子标签3", - "tagParentId": "TRATAGCATALOG02506401613020250616100022000071334", - "showOrder": 0 - }, - { - "crsId": "CRS0250640161302025082119435100000132546", - "tagId": "TRATAGCATALOG02501812207220250710091040000005889", - "tagName": "全员必学", - "tagParentId": "TRATAGCATALOG02506401613020250616104856000000355", - "showOrder": 0 - } - ] - }]) + const courseList = ref([]) const changeTab = (item) => { if (!item) return @@ -308,9 +256,24 @@ common.navigateTo(item.path,item.params|| {}) } } + const pageInfo = ref({ + page: 1, + limit: 3 + }) const search = () => { searchValue.value = inputValue.value console.log('search', inputValue.value) + appSearchCrsApi({ + type: fromType.value === 'course'?'01':'00',//00 首页搜索 01课程搜索 + searchName: searchValue.value, + page: pageInfo.value.page, + limit: pageInfo.value.limit + }).then(res=>{ + console.log(res) + examList.value = res.body.traExamPapersExtVoList||[] + taskList.value = res.body.traTaskInfoExtVoList||[] + courseList.value = res.body.traCrsInfoVoList||[] + }) } const toCourseDetail = (item)=>{ console.log(item) @@ -353,13 +316,15 @@ height: 30rpx; } } - + &.ability-view{ + .view-list { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + } + } .view-list { - // overflow: hidden; - display: flex; - flex-wrap: wrap; - justify-content: space-between; - + overflow: hidden; .scroll-view-item { display: inline-block; @@ -372,6 +337,9 @@ &.course-list{ margin: 6rpx -20rpx 0; } + .exam-list{ + border:2rpx solid #e8e8e8; + } .course-item { display: flex; .left { diff --git a/src/pages/search/search.vue b/src/pages/search/search.vue index 63adc9c0..e11c66fe 100644 --- a/src/pages/search/search.vue +++ b/src/pages/search/search.vue @@ -6,9 +6,10 @@ - + + @@ -169,6 +170,9 @@ const measureRef = ref(null) const measureItems = ref([]) + const search=() => { + common.navigateTo('/pages/search/result?searchName='+ inputValue.value +'&from=') + }