diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..af9ba00 --- /dev/null +++ b/.env.development @@ -0,0 +1,8 @@ +# 页面标题 +VITE_APP_TITLE = 若依管理系统 + +# 开发环境配置 +VITE_APP_ENV = 'development' + +# 若依管理系统/开发环境 +VITE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..cbabf89 --- /dev/null +++ b/.env.production @@ -0,0 +1,11 @@ +# 页面标题 +VITE_APP_TITLE = 若依管理系统 + +# 生产环境配置 +VITE_APP_ENV = 'production' + +# 若依管理系统/生产环境 +VITE_APP_BASE_API = '/prod-api' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..b11336d --- /dev/null +++ b/.env.staging @@ -0,0 +1,11 @@ +# 页面标题 +VITE_APP_TITLE = 若依管理系统 + +# 生产环境配置 +VITE_APP_ENV = 'staging' + +# 若依管理系统/生产环境 +VITE_APP_BASE_API = '/stage-api' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/public/img/course/avatar/c-1.png b/public/img/course/avatar/c-1.png new file mode 100644 index 0000000..96e64a6 Binary files /dev/null and b/public/img/course/avatar/c-1.png differ diff --git a/public/img/course/avatar/c-2.png b/public/img/course/avatar/c-2.png new file mode 100644 index 0000000..0b2ac2e Binary files /dev/null and b/public/img/course/avatar/c-2.png differ diff --git a/public/img/course/list/list-1.png b/public/img/course/list/list-1.png new file mode 100644 index 0000000..b3e2957 Binary files /dev/null and b/public/img/course/list/list-1.png differ diff --git a/public/img/course/list/list-2.png b/public/img/course/list/list-2.png new file mode 100644 index 0000000..4eac751 Binary files /dev/null and b/public/img/course/list/list-2.png differ diff --git a/public/img/course/list/list-3.png b/public/img/course/list/list-3.png new file mode 100644 index 0000000..cbd1113 Binary files /dev/null and b/public/img/course/list/list-3.png differ diff --git a/public/img/course/teacher/c-1.png b/public/img/course/teacher/c-1.png new file mode 100644 index 0000000..d5a619d Binary files /dev/null and b/public/img/course/teacher/c-1.png differ diff --git a/public/img/course/teacher/c-2.png b/public/img/course/teacher/c-2.png new file mode 100644 index 0000000..418bd25 Binary files /dev/null and b/public/img/course/teacher/c-2.png differ diff --git a/src/net/index.js b/src/net/index.js new file mode 100644 index 0000000..9737cb9 --- /dev/null +++ b/src/net/index.js @@ -0,0 +1,11 @@ +import axios from "axios"; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +const request = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: import.meta.env.VITE_APP_BASE_API, + // 超时 + timeout: 10000 +}) + +export default request \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 6af7b75..0b80b8b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,6 +19,10 @@ const router = createRouter({ path: 'grid', name: 'course-grid', component: () => import('@/views/course/CourseGrid.vue') + }, { + path: 'detail/:id', + name: 'course-detail', + component: () => import('@/views/course/CourseDetail.vue') } ] } diff --git a/src/utils/data.js b/src/utils/data.js index 6997083..6069006 100644 --- a/src/utils/data.js +++ b/src/utils/data.js @@ -1,3 +1,20 @@ export function createRandomInt() { return Math.floor(Math.random() * 100) +} + +export function formatTime(seconds) { + // 计算小时数 + const hours = Math.floor(seconds / 3600); + // 计算剩余的分钟数 + const minutes = Math.floor((seconds % 3600) / 60); + // 计算剩余的秒数 + const secs = seconds % 60; + + // 格式化为两位数 + const formattedHours = String(hours).padStart(2, '0'); + const formattedMinutes = String(minutes).padStart(2, '0'); + const formattedSeconds = String(secs).padStart(2, '0'); + + // 返回格式化的时间字符串 + return `${formattedHours}小时 ${formattedMinutes}分 ${formattedSeconds}秒`; } \ No newline at end of file diff --git a/src/views/course/CourseDetail.vue b/src/views/course/CourseDetail.vue new file mode 100644 index 0000000..c315469 --- /dev/null +++ b/src/views/course/CourseDetail.vue @@ -0,0 +1,224 @@ + + + + + \ No newline at end of file diff --git a/src/views/course/CourseGrid.vue b/src/views/course/CourseGrid.vue index 1ce997c..aabe267 100644 --- a/src/views/course/CourseGrid.vue +++ b/src/views/course/CourseGrid.vue @@ -1,14 +1,13 @@