diff --git a/api/task/index.js b/api/task/index.js new file mode 100644 index 0000000..8d99e6e --- /dev/null +++ b/api/task/index.js @@ -0,0 +1,17 @@ +import http from '@/http/http.js' + +// 获取任务列表 +export const announcement = (data) => { + return http.request({ + url: '/announcement', + data + }) +} +// 获取签到 +export const getUserSignData = (data) => { + return http.request({ + url: 'userSignRecord/getUserSignData', + data + }) +} + \ No newline at end of file diff --git a/components/emprty-card/emprty-card.vue b/components/emprty-card/emprty-card.vue new file mode 100644 index 0000000..09efd09 --- /dev/null +++ b/components/emprty-card/emprty-card.vue @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/pages.json b/pages.json index fe85ca4..ceee951 100644 --- a/pages.json +++ b/pages.json @@ -32,8 +32,7 @@ { "path": "pages/task/index", "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" + "navigationBarTitleText": "任务大厅" } }, { "path": "pages/chasingDrama/index", diff --git a/pages/chasingDrama/index.vue b/pages/chasingDrama/index.vue index 3e87028..33a131c 100644 --- a/pages/chasingDrama/index.vue +++ b/pages/chasingDrama/index.vue @@ -7,57 +7,18 @@ 更多 - + - - 第三集 + + {{ item.courseDetailsName }} - 我在八十年代当后妈 - 言情 - - - - - - 第三集 - - - 我在八十年代当后妈 - 言情 - - - - - - 第三集 - - - 我在八十年代当后妈 - 言情 - - - - - - 第三集 - - - 我在八十年代当后妈 - 言情 - - - - - - 第三集 - - - 我在八十年代当后妈 - 言情 + {{ item.title }} + {{ item.courseLabel }} + @@ -65,19 +26,20 @@ 更多 - + - - 第三集 + + {{ item.courseDetailsName }} - 我在八十年代当后妈 - 言情 + {{ item.title }} + {{ item.courseLabel }} + @@ -87,12 +49,13 @@ import { reactive } from 'vue'; import { selectByUserId } from '@/api/me/me.js'; import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'; +// 获取数据 async function selectByUserIdAjax() { try { const res1 = await selectByUserId({ page: 1, limit: 6, classify: 3 }); const res2 = await selectByUserId({ page: 1, limit: 6, classify: 6 }); - console.log(res1); - console.log(res2); + data.list1 = res1.records; + data.list2 = res2.records; } catch (error) { console.log(error); } diff --git a/pages/index/index.vue b/pages/index/index.vue index 42d848e..d593ca8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -25,19 +25,19 @@ - + 最新 - + 排行 - + 最热 - + 剧情 - + 飙升 @@ -58,13 +58,12 @@ import { reactive } from 'vue'; -import { announcement, messageselectMessage,courseselectCourse } from '@/api/index/index.js' +import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js' import { onLoad, onReachBottom } from '@dcloudio/uni-app' import contentlist from './components/contentlist.vue' -import http from '@/http/http.js' let datas = reactive({ noticeList: [], //公告列表 @@ -94,18 +93,10 @@ onReachBottom(() => { // 获取弹窗信息 async function getPop() { let res = await announcement() - if (res.code == 0) { - if (res.data && res.data.state == 1) { - datas.ruleShow = true - datas.rule_title = res.data.title - datas.rule_content = res.data.content - } - } else { - uni.showToast({ - title: res.msg, - duration: 1000, - icon: 'none' - }); + if (res.state == 1) { + datas.ruleShow = true + datas.rule_title = res.title + datas.rule_content = res.content } } // 搜索跳转 @@ -117,15 +108,7 @@ function moreVideo() { // 公告 async function getMsg() { let res = await messageselectMessage() - if (res.code == 0) { - datas.noticeList = res.data.list - } else { - uni.showToast({ - title: res.msg, - duration: 1000, - icon: 'none' - }); - } + datas.noticeList = res.list } //获取推荐视频 async function getrecomVideo(sort, active = 1) { @@ -140,19 +123,11 @@ async function getrecomVideo(sort, active = 1) { classifyId: '' }) - if (res.code == 0) { - if (datas.page == 1) { - datas.list = res.data.list + if (datas.page == 1) { + datas.list = res.list } else { - datas.list = [...datas.list, ...res.data.list] + datas.list = [...datas.list, ...res.list] } - } else { - uni.showToast({ - title: res.msg, - duration: 1000, - icon: 'none' - }); - } } @@ -225,6 +200,10 @@ async function getrecomVideo(sort, active = 1) { } +.navTop-active { + color: #cb5d68; +} + .navTop { display: flex; align-items: center; diff --git a/pages/index/search/index.vue b/pages/index/search/index.vue index 12816f4..312970a 100644 --- a/pages/index/search/index.vue +++ b/pages/index/search/index.vue @@ -2,47 +2,58 @@ - + @search="doSearch()"> - + 热搜 - - + + {{ keyword }} - - 当前搜热已隐藏 - + + + + + + + + + + \ No newline at end of file diff --git a/pages/task/index.vue b/pages/task/index.vue index b15bdca..2b5248e 100644 --- a/pages/task/index.vue +++ b/pages/task/index.vue @@ -1,11 +1,206 @@ - ios - anzhuo + + + + + + 新人好礼送不停 + + + + + + + 已连续签到 {{ datas.signDays }} 天 + + + + {{ item.status == 1 ? '已签到' : '待签到' }} + + {{ item.signDay.substr(5, 8) }} + + + + + + + + - diff --git a/pages/watching_history/watching_history.vue b/pages/watching_history/watching_history.vue index 2c601f9..04447a4 100644 --- a/pages/watching_history/watching_history.vue +++ b/pages/watching_history/watching_history.vue @@ -6,19 +6,21 @@ - - {{ item.title }} - - 看到{{ item.courseDetailsName }} - - - 更新{{ item.courseDetailsCount }} + + + {{ item.title }} + 看到{{ item.courseDetailsName }} + + + 更新{{ item.courseDetailsCount }}集 继续观看 + + @@ -43,7 +45,8 @@ const typeList = ref([ const listData = reactive({ list: [], page: 1, - size: 10 + size: 10, + status: 'loading' }); // 获取数据 @@ -54,9 +57,9 @@ async function selectByUserIdAjax() { limit: listData.size, classify: type.value }); - console.log(res); - if (res.code === 0) { - listData.list = res.data.records; + listData.list = res.records; + if (res.currPage >= res.totalPage) { + listData.status = 'nomore'; } } catch (error) { console.log(error); @@ -87,7 +90,7 @@ onLoad((e) => { } .list { .item { - padding: 28upx 0; + padding-bottom: 28upx; display: flex; .cover { width: 150upx; @@ -101,23 +104,31 @@ onLoad((e) => { } } .info { + flex: 1; display: flex; flex-direction: column; - gap: 4px; - .title { - font-size: 32upx; - font-weight: bold; - } - .record { - color: $uni-zj-color-primary; + justify-content: space-between; + .top { + .title { + font-size: 32upx; + font-weight: bold; + } + .record { + color: $uni-zj-color-primary; + } } .btm { display: flex; justify-content: space-between; + padding-top: 28upx; + .num { + color: #999; + } .btn { - padding: 4upx 12upx; + padding: 8upx 12upx; color: #fff; background: $uni-zj-color-primary; + border-radius: 10upx; } } } diff --git a/static/task/renwubg.png b/static/task/renwubg.png new file mode 100644 index 0000000..664accf Binary files /dev/null and b/static/task/renwubg.png differ diff --git a/static/task/task_bg.png b/static/task/task_bg.png new file mode 100644 index 0000000..80e4c66 Binary files /dev/null and b/static/task/task_bg.png differ diff --git a/static/task/task_icon1.png b/static/task/task_icon1.png new file mode 100644 index 0000000..510745c Binary files /dev/null and b/static/task/task_icon1.png differ diff --git a/static/task/task_icon2.png b/static/task/task_icon2.png new file mode 100644 index 0000000..8e2686e Binary files /dev/null and b/static/task/task_icon2.png differ diff --git a/static/task/xing (1).png b/static/task/xing (1).png new file mode 100644 index 0000000..8dad669 Binary files /dev/null and b/static/task/xing (1).png differ diff --git a/static/task/xing (2).png b/static/task/xing (2).png new file mode 100644 index 0000000..5a796e8 Binary files /dev/null and b/static/task/xing (2).png differ