diff --git a/gym-manage-uniapp/api/main.js b/gym-manage-uniapp/api/main.js new file mode 100644 index 0000000..eb59c09 --- /dev/null +++ b/gym-manage-uniapp/api/main.js @@ -0,0 +1,50 @@ +import request from "@/utils/request.js" + +export function login(params) { + return request.post('/member/auth/miniapp/login', params) +} + +export function logout() { + return request.post('/member/auth/logout') +} + +export function getQRCode(options = { cache: true, cacheTime: 5 * 60 * 1000 }) { + return request.get('/checkIn/qrcode', {}, options) +} + +export function checkIn(params) { + return request.post('/checkIn/scan', params) +} + +export function getUserInfo(options = { cache: true, cacheTime: 30 * 60 * 1000 }) { + return request.get('/member/info', {}, options) +} + +export function updateUserInfo(params) { + return request.put('/member/info', params) +} + +export function getRecommendCourses(options = { cache: true, cacheTime: 10 * 60 * 1000 }) { + return request.get('/course/recommend', {}, options) +} + +export function getCourseDetail(id, options = { cache: true, cacheTime: 15 * 60 * 1000 }) { + return request.get(`/course/${id}`, {}, options) +} + +export function getGroupCoursePage(params = {}, options = { cache: true, cacheTime: 5 * 60 * 1000 }) { + const { page = 0, size = 10, sort = 'id', order = 'asc', keyword } = params + return request.post('/groupCourse/page', { page, size, sort, order, keyword }, options) +} + +export default { + login, + logout, + getQRCode, + checkIn, + getUserInfo, + updateUserInfo, + getRecommendCourses, + getCourseDetail, + getGroupCoursePage +} diff --git a/gym-manage-uniapp/common/constants/routes.js b/gym-manage-uniapp/common/constants/routes.js index fefa5e3..50300f5 100644 --- a/gym-manage-uniapp/common/constants/routes.js +++ b/gym-manage-uniapp/common/constants/routes.js @@ -3,7 +3,7 @@ /** 与 pages.json 保持一致 */ export const PAGE = { INDEX: '/pages/index/index', - COURSE: '/pages/groupCourse/list', + COURSE: '/pages/course/index', TRAIN: '/pages/train/index', DISCOVER: '/pages/discover/index', MEMBER: '/pages/memberInfo/memberInfo', diff --git a/gym-manage-uniapp/pages/checkIn/checkIn.vue b/gym-manage-uniapp/pages/checkIn/checkIn.vue index d11b815..09ec852 100644 --- a/gym-manage-uniapp/pages/checkIn/checkIn.vue +++ b/gym-manage-uniapp/pages/checkIn/checkIn.vue @@ -104,7 +104,7 @@ import { onLoad, onUnload } from '@dcloudio/uni-app' // 引入状态组件(路径与你保持一致) import QrStatus from '@/components/QRCode/StatusCard.vue' // 引入API封装 -import { getQRCode, checkIn as apiCheckIn } from '@/request_api/main.js' +import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js' let image = ref("") let width = ref(0) diff --git a/gym-manage-uniapp/static/tabBar/home.png b/gym-manage-uniapp/static/tabBar/home.png new file mode 100644 index 0000000..c4220cc Binary files /dev/null and b/gym-manage-uniapp/static/tabBar/home.png differ