From 0cdd737ca512c6aa8fa576d469a6ee9a73a8d3d2 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Mon, 6 Jan 2025 18:28:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 233 ++++++++++++------------ api/index/index.js | 35 ++++ api/init.js | 13 ++ http/http.js | 3 +- pages/index/index.vue | 331 +++++++++++++++++------------------ pages/index/search/index.vue | 120 +++++++------ 6 files changed, 393 insertions(+), 342 deletions(-) create mode 100644 api/index/index.js create mode 100644 api/init.js diff --git a/App.vue b/App.vue index fc89215..bcb01a2 100644 --- a/App.vue +++ b/App.vue @@ -1,124 +1,123 @@ \ No newline at end of file diff --git a/api/index/index.js b/api/index/index.js new file mode 100644 index 0000000..4d2f84a --- /dev/null +++ b/api/index/index.js @@ -0,0 +1,35 @@ +import http from '@/http/http.js' + +// 获取弹窗信息 +export const announcement = (data) => { + return http.request({ + url: '/announcement', + data + }) +} +// 获取公告 +export const messageselectMessage = (data) => { + return http.request({ + url: '/message/selectMessage', + data: { + page: 1, + limit: 5, + state: 1 + } + }) +} +// 获取推荐视频 +export const courseselectCourse = (data) => { + return http.request({ + url: '/course/selectCourse', + data + }) +} + +// 搜索 +export const selectCourseTitles = (data) => { + return http.request({ + url: '/course/selectCourseTitles', + data + }) +} \ No newline at end of file diff --git a/api/init.js b/api/init.js new file mode 100644 index 0000000..5a7398f --- /dev/null +++ b/api/init.js @@ -0,0 +1,13 @@ +import http from '@/http/http.js' + +export async function init() { + + //热搜词 + http.request({ + url: 'common/type/249', + }).then(res => { + if (res.code == 0) { + uni.setStorageSync('moreSearch', res.data.value) + } + }) +} \ No newline at end of file diff --git a/http/http.js b/http/http.js index 688facf..0e73e6b 100644 --- a/http/http.js +++ b/http/http.js @@ -13,8 +13,7 @@ const loadingShowTime = 200 function getHeader() { const headerObject = {} - headerObject["token"] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNjkyNSIsImlhdCI6MTczNTg4OTk5NCwiZXhwIjoxNzM2NDk0Nzk0fQ.j-KFEE1FHckmFCO8UA884RBWvpMv8MfEGj7GPGf3kVo6sHeORl043Yle_w7HdTZKPpQqSr2LQLCq_rUxG4qqwA' - // headerObject["token"] = uni.getStorageSync('token') + headerObject["token"] = uni.getStorageSync('token') return headerObject } diff --git a/pages/index/index.vue b/pages/index/index.vue index 660e22a..42d848e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -10,7 +10,7 @@ - \ No newline at end of file