first commit

This commit is contained in:
2024-12-10 12:20:05 +08:00
commit f866087c7e
37 changed files with 2080 additions and 0 deletions

35
js/serve/home.js Normal file
View File

@@ -0,0 +1,35 @@
class HomeServe {
// data 是接口请求的参数,默认为空对象,表示这个接口不需要参数
async homeHot (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.homeHot,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
async homeBanner (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.homeBanner,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
async homeList (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.homeList,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
}
let homeServe = new HomeServe

14
js/serve/info.js Normal file
View File

@@ -0,0 +1,14 @@
class InfoServe {
// data 是接口请求的参数,默认为空对象,表示这个接口不需要参数
async infoList (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.infoList,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
}
let infoServe = new InfoServe

28
js/serve/search.js Normal file
View File

@@ -0,0 +1,28 @@
class SearchServe {
// data 是接口请求的参数,默认为空对象,表示这个接口不需要参数
async searchHot (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.searchHot,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
async searchKey (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.searchKey,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
}
let searchServe = new SearchServe

43
js/serve/tag.js Normal file
View File

@@ -0,0 +1,43 @@
class TagServe {
// 简化我们的ajax请求过程
// 可以实现对接口返回数据的修改
// data 是接口请求的参数,默认为空对象,表示这个接口不需要参数
async tagList (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
let res = await http.get({
url: config.urlList.tagList,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
res.forEach(v => {
v.content = [];
v.totalPage = 0;
v.page = 1;
});
return res;
}
async tagInfo (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.tagInfo,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
async tagRecommend (data = {}) {
let http = new Ajax()
// suc的返回值ajax请求到的后端给我们的数据
return await http.get({
url: config.urlList.tagRecommend,
// data: data key 和 value 名字一样的时候,可以直接只写一个
data
})
}
}
let tagServe = new TagServe