JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_完成首页的两个列表

This commit is contained in:
田岩
2026-01-21 08:48:18 +08:00
parent d7f885b66c
commit 041642df1a
7 changed files with 78 additions and 39 deletions
+2 -2
View File
@@ -47,8 +47,8 @@ VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' # VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.154:9604' VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.154:9601'
VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.157:9603' #VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.157:9603'
+12
View File
@@ -16,6 +16,8 @@ export const getStatisticsData = (data) => {
}); });
}; };
// 最新课程查询接口 // 最新课程查询接口
export const queryCrsInfoByLastnew = (data) => { export const queryCrsInfoByLastnew = (data) => {
/** /**
@@ -89,3 +91,13 @@ export const queryCrsInfoByRecmd = (data) => {
// 新政新品
export const queryNewPolicyNewProducts = (data) => {
return request({
url: '/traapp/mycrs/queryNewPolicyNewProducts',
method: 'post',
data
});
};
+63 -36
View File
@@ -10,17 +10,21 @@
<view class="hot_class_div"> <view class="hot_class_div">
<scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false"> <scroll-view class="scroll-view" :scroll-x="true" :show-scrollbar="false">
<view class="scroll-view-item" v-for="(item, index) in class_list" :key="index"> <view class="scroll-view-item" v-for="(item, index) in class_list" :key="index">
<!-- 角标 -->
<view class="icon" v-if="item.type">
<image class="img_100" :src="item.type==='00'?kcIcon:plIcon" mode="widthFix" />
</view>
<view class="item_div"> <view class="item_div">
<uv-skeletons :loading="!item.crsNum" avatar avatar-shape="square" :title="false" :skeleton="skeleton"> <uv-skeletons :loading="!item.id" avatar avatar-shape="square" :title="false" :skeleton="skeleton">
<view class="item" @click="goto_course_detail(item.crsId)"> <view class="item" @click="goto_course_detail(item)">
<view class="title ellipsis-text"> <view class="title ellipsis-text">
{{ item.crsName }} {{ item.nama }}
</view> </view>
<view class="content"> <view class="content">
<view class="left"> <view class="left">
<image-preview <image-preview
class="img-box img" class="img-box img"
:imgId="item.imgId" :imgId="item.ossKey"
:isCache="true" :isCache="true"
:width="240" :width="240"
:height="160" :height="160"
@@ -28,7 +32,7 @@
</view> </view>
<view class="right"> <view class="right">
<view class="note ellipsis-text">更新{{ (item.mtTime || '').substr(0, 10) }}</view> <view class="note ellipsis-text">更新{{ (item.mtTime || '').substr(0, 10) }}</view>
<view class="note ellipsis-text">已学{{ item.accmStdyCnt }}人次</view> <view class="note ellipsis-text">已学{{ item.accmCnt }}</view>
<view class="button_div"> <view class="button_div">
<view class="button">去学习</view> <view class="button">去学习</view>
</view> </view>
@@ -44,11 +48,21 @@
<script setup> <script setup>
import { computed, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue'; import { computed, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
import { queryCrsInfoByLastnew, queryCrsInfoByPopular, queryCrsInfoByRecmd } from '@/api/index.js';
import {
queryCrsInfoByLastnew,
queryCrsInfoByPopular,
queryCrsInfoByRecmd,
queryNewPolicyNewProducts
} from '@/api/index.js';
import common from '@/common/common'; import common from '@/common/common';
import hostIcon from '@/static/images/index/hot.png'; import hostIcon from '@/static/images/index/hot.png';
import recommendIcon from '@/static/images/index/recommend.png'; import recommendIcon from '@/static/images/index/recommend.png';
import newIcon from '@/static/images/index/new.png'; import newIcon from '@/static/images/index/new.png';
import kcIcon from '@/static/images/index/kc_icon.png';
import plIcon from '@/static/images/index/pl_icon.png';
const props = defineProps({ const props = defineProps({
name: { name: {
type: String type: String
@@ -56,22 +70,16 @@
}); });
// 1. 先定义命名函数,明确函数用途 // 1. 先定义命名函数,明确函数用途
const getConfigByProps = () => { const getConfigByProps = () => {
if (props.name === 'hot_class') { if (props.name === 'recommend_class') {
return {
fetchFunction: queryCrsInfoByPopular,
title: '热门课程',
icon: hostIcon
};
} else if (props.name === 'recommend_class') {
return { return {
fetchFunction: queryCrsInfoByRecmd, fetchFunction: queryCrsInfoByRecmd,
title: '推荐课程', title: '精选推荐',
icon: recommendIcon icon: recommendIcon
}; };
} else if (props.name === 'new_class') { } else if (props.name === 'new_class') {
return { return {
fetchFunction: queryCrsInfoByLastnew, fetchFunction: queryNewPolicyNewProducts,
title: '最新课程', title: '新政新品',
icon: newIcon icon: newIcon
}; };
} }
@@ -79,21 +87,21 @@
// 2. 调用命名函数,解构赋值 // 2. 调用命名函数,解构赋值
const { fetchFunction, title, icon } = getConfigByProps(); // 调用函数,获取返回对象后解构 const { fetchFunction, title, icon } = getConfigByProps(); // 调用函数,获取返回对象后解构
const init_class_data = [ const init_class_data = [
{ {
crsNum: '', id: '',
img: '', ossKey: '',
crsName: '', nama: '',
issuTm: '', mtTime: '',
accmStdyCnt: '' accmCnt: ''
}, },
{ {
crsNum: '', id: '',
img: '', img: '',
crsName: '', nama: '',
issuTm: '', mtTime: '',
accmStdyCnt: '' accmCnt: ''
} }
]; ];
const class_list = ref([]); const class_list = ref([]);
@@ -129,8 +137,16 @@
defineExpose({ get_data }); defineExpose({ get_data });
// 进入课程详情页 // 进入课程详情页
const goto_course_detail = (crsId) => { const goto_course_detail = ({id, type}) => {
common.navigateTo('/pages/courseDetail/index?crsId=' + crsId); // 00课程 01陪练
if(type === '00') {
common.navigateTo('/pages/courseDetail/index?crsId=' + id);
} else if(type === '01') {
common.navigateTo('/pages/sparring/detail?traId=' + id);
}
// todo
//
}; };
</script> </script>
@@ -144,29 +160,40 @@
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
} }
.scroll-view-item { .scroll-view-item {
display: inline-block; display: inline-block;
margin-right: 30rpx; margin-right: 30rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 22rpx; border-radius: 22rpx;
box-shadow: #eaeaea 0 0 6rpx; box-shadow: #eaeaea 0 0 6rpx;
padding: 20rpx 20rpx 36rpx 34rpx; padding: 20rpx 20rpx 26rpx 34rpx;
position: relative;
overflow: hidden;
.icon {
position: absolute;
right: 0;
top: 0;
width: 76rpx;
height: 76rpx;
}
} }
.item_div { .item_div {
width: calc(562rpx + 56rpx); // width: calc(562rpx + 56rpx);
width: 562rpx;
} }
.item { .item {
display: flex; display: flex;
width: calc(562rpx + 56rpx); width: 562rpx;
flex-direction: column; flex-direction: column;
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
margin-bottom: 10rpx; margin-bottom: 10rpx;
padding-right: 30rpx;
width: 100%; width: 100%;
} }
.content { .content {
@@ -224,11 +251,11 @@
.module_title_div { .module_title_div {
display: flex; display: flex;
margin: 30rpx $bg-margin-left; margin: 20rpx $bg-margin-left;
align-items: center; align-items: center;
.icon { .icon {
margin-right: 6rpx; margin-right: 8rpx;
margin-top: 12rpx;
} }
.icon_1 { .icon_1 {
@@ -254,7 +281,7 @@
height: 31rpx; height: 31rpx;
} }
} }
.title { .title {
font-size: 34rpx; font-size: 34rpx;
color: #323e57; color: #323e57;
+1 -1
View File
@@ -153,7 +153,7 @@
</view> </view>
</view> </view>
</view> </view>
<classScroll :ref="(el) => (classScrollRef[0] = el)" name="hot_class"></classScroll> <!-- <classScroll :ref="(el) => (classScrollRef[0] = el)" name="hot_class"></classScroll> -->
<classScroll :ref="(el) => (classScrollRef[1] = el)" name="recommend_class"></classScroll> <classScroll :ref="(el) => (classScrollRef[1] = el)" name="recommend_class"></classScroll>
<classScroll :ref="(el) => (classScrollRef[2] = el)" name="new_class"></classScroll> <classScroll :ref="(el) => (classScrollRef[2] = el)" name="new_class"></classScroll>
<toDoCom></toDoCom> <toDoCom></toDoCom>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 881 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB