Merge branch 'test' of https://e.coding.net/g-cphe0354/duanju/new_app into gaohao
This commit is contained in:
@@ -4,87 +4,65 @@
|
||||
<view class="list-wrap">
|
||||
<view class="title-wrap">
|
||||
<view class="title">最近观看</view>
|
||||
<view class="more">更多</view>
|
||||
<navigator class="more" url="/pages/watching_history/watching_history?type=3">更多</navigator>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
<view class="item">
|
||||
<div class="item-content">
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="cover">
|
||||
<image class="img" src="https://img0.baidu.com/it/u=966333451,3199467079&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=714" mode="aspectFill"></image>
|
||||
<view class="num">第三集</view>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<view class="name">我在八十年代当后妈</view>
|
||||
<view class="t">言情</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-wrap">
|
||||
<view class="title-wrap">
|
||||
<view class="title">我的追剧</view>
|
||||
<view class="more">更多</view>
|
||||
<navigator class="more" url="/pages/watching_history/watching_history?type=1">更多</navigator>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
@@ -105,20 +83,37 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { selectByUserId } from '@/api/me/me.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
|
||||
async function selectByUserIdAjax() {
|
||||
try {
|
||||
const res = await selectByUserId();
|
||||
console.log(res);
|
||||
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);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
list1: [], // 最近观看
|
||||
list2: [] // 我的追剧
|
||||
});
|
||||
|
||||
// 滚动到底部
|
||||
onReachBottom(() => {});
|
||||
|
||||
// 监听下拉结束
|
||||
onPullDownRefresh(() => {
|
||||
selectByUserIdAjax();
|
||||
});
|
||||
|
||||
// 页面初始化
|
||||
onLoad(() => {
|
||||
selectByUserId();
|
||||
selectByUserIdAjax();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -155,44 +150,43 @@ page {
|
||||
grid-row-gap: 28upx;
|
||||
padding: 0 28upx;
|
||||
.item {
|
||||
.item-content {
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border-radius: 30upx;
|
||||
.cover {
|
||||
height: 200upx;
|
||||
position: relative;
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.num {
|
||||
padding: 4upx 16upx;
|
||||
border-radius: 8upx;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(5px);
|
||||
position: absolute;
|
||||
right: 8upx;
|
||||
bottom: 8upx;
|
||||
color: #fff;
|
||||
font-size: 24upx;
|
||||
}
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border-radius: 20upx;
|
||||
.cover {
|
||||
height: 200upx;
|
||||
position: relative;
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.intro-wrap {
|
||||
padding: 20upx;
|
||||
.name {
|
||||
width: 180upx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.t {
|
||||
color: #999;
|
||||
font-size: 24upx;
|
||||
margin-top: 8upx;
|
||||
}
|
||||
.num {
|
||||
padding: 4upx 16upx;
|
||||
border-radius: 8upx;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(5px);
|
||||
position: absolute;
|
||||
right: 8upx;
|
||||
bottom: 8upx;
|
||||
color: #fff;
|
||||
font-size: 24upx;
|
||||
}
|
||||
}
|
||||
.intro-wrap {
|
||||
padding: 20upx;
|
||||
.name {
|
||||
width: 180upx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.t {
|
||||
color: #999;
|
||||
font-size: 24upx;
|
||||
margin-top: 8upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template v-if="datas.noticeList.length > 0 ">
|
||||
<template v-if="datas.noticeList.length > 0">
|
||||
<view class="gongao">
|
||||
<view class="gongaoicon">
|
||||
公告
|
||||
@@ -44,7 +44,7 @@
|
||||
<contentlist :list='datas.list'></contentlist>
|
||||
<!-- <u-image v-if="isShowMoneyPay" @click="goMsg('/me/VjgyqAzklr/VjgyqAzklr')" :src="`../../static/red-pack-new.gif`"
|
||||
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;"></u-image> -->
|
||||
<u-modal :show="datas.ruleShow" v-if="datas.isExamine==0" confirm-text="知道了" @confirm='datas.ruleShow=false'
|
||||
<u-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" @confirm='datas.ruleShow = false'
|
||||
:title="datas.rule_title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
|
||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||
@@ -55,199 +55,186 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app'
|
||||
import contentlist from './components/contentlist.vue'
|
||||
import http from '@/http/http.js'
|
||||
let datas = reactive({
|
||||
noticeList: [], //公告列表
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
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: [], //公告列表
|
||||
|
||||
active: 1, // 最新、最热。。。切换顶部导航栏
|
||||
active: 1, // 最新、最热。。。切换顶部导航栏
|
||||
|
||||
list: [], // 底部短剧内容
|
||||
page: 1, // 首页推荐分页
|
||||
list: [], // 底部短剧内容
|
||||
page: 1, // 首页推荐分页
|
||||
|
||||
ruleShow: false,
|
||||
rule_title: '', // 首页弹窗标题
|
||||
rule_content: '', // 首页弹窗内容
|
||||
ruleShow: false,
|
||||
rule_title: '', // 首页弹窗标题
|
||||
rule_content: '', // 首页弹窗内容
|
||||
|
||||
//ios是否在审核 1是审核
|
||||
isExamine: uni.getStorageSync('isExamine')
|
||||
})
|
||||
onLoad(() => {
|
||||
getMsg()
|
||||
getrecomVideo()
|
||||
getPop()
|
||||
})
|
||||
//ios是否在审核 1是审核
|
||||
isExamine: uni.getStorageSync('isExamine')
|
||||
})
|
||||
onLoad(() => {
|
||||
getMsg()
|
||||
getrecomVideo()
|
||||
getPop()
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
++datas.page
|
||||
getrecomVideo()
|
||||
})
|
||||
onReachBottom(() => {
|
||||
++datas.page
|
||||
getrecomVideo()
|
||||
})
|
||||
|
||||
// 获取弹窗信息
|
||||
function getPop() {
|
||||
http.request({
|
||||
url: 'app/announcement',
|
||||
}).then(res => {
|
||||
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'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
// 搜索跳转
|
||||
function moreVideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/search/index'
|
||||
// 获取弹窗信息
|
||||
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'
|
||||
});
|
||||
}
|
||||
// 公告
|
||||
function getMsg() {
|
||||
http.request({
|
||||
url: 'app/message/selectMessage',
|
||||
data: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
state: 1
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
datas.noticeList = res.data.list
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
// 搜索跳转
|
||||
function moreVideo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/search/index'
|
||||
});
|
||||
}
|
||||
// 公告
|
||||
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'
|
||||
});
|
||||
}
|
||||
//获取推荐视频
|
||||
function getrecomVideo(sort, active = 1) {
|
||||
datas.active = active
|
||||
if (sort) {
|
||||
datas.page = 1
|
||||
}
|
||||
//获取推荐视频
|
||||
async function getrecomVideo(sort, active = 1) {
|
||||
datas.active = active
|
||||
if (sort) {
|
||||
datas.page = 1
|
||||
}
|
||||
let res = await courseselectCourse({
|
||||
page: datas.page,
|
||||
limit: 12,
|
||||
sort: sort,
|
||||
classifyId: ''
|
||||
})
|
||||
|
||||
if (res.code == 0) {
|
||||
if (datas.page == 1) {
|
||||
datas.list = res.data.list
|
||||
} else {
|
||||
datas.list = [...datas.list, ...res.data.list]
|
||||
}
|
||||
http.request({
|
||||
url: 'app/course/selectCourse',
|
||||
data: {
|
||||
page: datas.page,
|
||||
limit: 12,
|
||||
sort: sort,
|
||||
classifyId: ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (datas.page == 1) {
|
||||
datas.list = res.data.list
|
||||
} else {
|
||||
datas.list = [...datas.list, ...res.data.list]
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.indexStyle {
|
||||
.indexStyle {
|
||||
height: 555rpx;
|
||||
position: relative;
|
||||
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 555rpx;
|
||||
position: relative;
|
||||
|
||||
>image {
|
||||
width: 100%;
|
||||
height: 555rpx;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.indexStyleTwo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 88rpx 25rpx;
|
||||
|
||||
>image {
|
||||
width: 187rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
z-index: 50;
|
||||
width: 236rpx;
|
||||
line-height: 43rpx;
|
||||
background: rgba(255, 255, 255, 0.29);
|
||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.gongao {
|
||||
position: absolute;
|
||||
bottom: 75rpx;
|
||||
left: 70rpx;
|
||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||
width: 611rpx;
|
||||
height: 78rpx;
|
||||
background-color: rgba(255, 255, 255, .65);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.gongaoicon {
|
||||
color: #ffffff;
|
||||
width: 98rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
font-size: 25rpx;
|
||||
background-image: url('../../static/index/gonggaobg.png');
|
||||
background-size: 98rpx 50rpx;
|
||||
}
|
||||
|
||||
.swiperstyle {
|
||||
height: 78rpx;
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.navTop {
|
||||
.indexStyleTwo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
padding: 88rpx 25rpx;
|
||||
|
||||
>image {
|
||||
width: 187rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
background-color: #f0f0f0;
|
||||
margin-left: 20rpx;
|
||||
padding: 6rpx 20rpx
|
||||
z-index: 50;
|
||||
width: 236rpx;
|
||||
line-height: 43rpx;
|
||||
background: rgba(255, 255, 255, 0.29);
|
||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
||||
font-weight: 400;
|
||||
font-size: 21rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.gongao {
|
||||
position: absolute;
|
||||
bottom: 75rpx;
|
||||
left: 70rpx;
|
||||
border-radius: 21rpx 21rpx 21rpx 21rpx;
|
||||
width: 611rpx;
|
||||
height: 78rpx;
|
||||
background-color: rgba(255, 255, 255, .65);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.gongaoicon {
|
||||
color: #ffffff;
|
||||
width: 98rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
font-size: 25rpx;
|
||||
background-image: url('../../static/index/gonggaobg.png');
|
||||
background-size: 98rpx 50rpx;
|
||||
}
|
||||
|
||||
.swiperstyle {
|
||||
height: 78rpx;
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navTop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
|
||||
>view {
|
||||
background-color: #f0f0f0;
|
||||
margin-left: 20rpx;
|
||||
padding: 6rpx 20rpx
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,19 +3,20 @@
|
||||
<u-sticky :enable="true">
|
||||
<view class="search-box">
|
||||
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" :focus="true" :show-action="true"
|
||||
:animation="true" action-text="取消" @custom="goBack()" @search="doSearch(false)"></u-search>
|
||||
:animation="true" action-text="取消" v-model="datas.keyword" @custom="goBack()"
|
||||
@search="doSearch(false)"></u-search>
|
||||
</view>
|
||||
</u-sticky>
|
||||
</view>
|
||||
<view class="search-keyword">
|
||||
<view class="keyword-block" v-if="datas.hotKeywordList.length !=0">
|
||||
<view class="keyword-block" v-if="datas.hotKeywordList.length != 0">
|
||||
<view class="keyword-list-header">
|
||||
<view>热搜</view>
|
||||
</view>
|
||||
<view class="keyword" v-if="forbid==''">
|
||||
<view v-for="(keyword,index) in datas.hotKeywordList" @tap="doSearchs(keyword)" :key="index"
|
||||
<view class="keyword" v-if="forbid == ''">
|
||||
<view v-for="(keyword, index) in datas.hotKeywordList" @tap="doSearchs(keyword)" :key="index"
|
||||
v-if="keyword">
|
||||
{{keyword}}
|
||||
{{ keyword }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="hide-hot-tis" v-else>
|
||||
@@ -26,59 +27,76 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
let datas = reactive({
|
||||
hotKeywordList: [], //热搜
|
||||
})
|
||||
onShow(() => {
|
||||
getList()
|
||||
})
|
||||
import { selectCourseTitles } from '@/api/index/index.js'
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
let datas = reactive({
|
||||
hotKeywordList: [], //热搜
|
||||
keywordList: [],// 搜索列表
|
||||
keyword: "",// 搜索关键字
|
||||
})
|
||||
onShow(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
function getList() {
|
||||
if (uni.getStorageSync('moreSearch')) {
|
||||
datas.hotKeywordList = (uni.getStorageSync('moreSearch')).split(',')
|
||||
} else {
|
||||
datas.hotKeywordList = []
|
||||
}
|
||||
function getList() {
|
||||
if (uni.getStorageSync('moreSearch')) {
|
||||
datas.hotKeywordList = (uni.getStorageSync('moreSearch')).split(',')
|
||||
} else {
|
||||
datas.hotKeywordList = []
|
||||
}
|
||||
}
|
||||
// 搜索
|
||||
async function doSearch() {
|
||||
let res = await selectCourseTitles({
|
||||
title: datas.keyword,
|
||||
limit: 20,
|
||||
page: 1,
|
||||
})
|
||||
datas.keywordList = res.data.list
|
||||
}
|
||||
|
||||
// 取消返回首页
|
||||
function goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.search-box {
|
||||
width: 100%;
|
||||
/* background-color: rgb(242, 242, 242); */
|
||||
padding: 15upx 2.5%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// position: sticky;
|
||||
// top: 0;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.search-box {
|
||||
width: 100%;
|
||||
/* background-color: rgb(242, 242, 242); */
|
||||
padding: 15upx 2.5%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// position: sticky;
|
||||
// top: 0;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.search-keyword {
|
||||
width: 100%;
|
||||
}
|
||||
.search-keyword {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.keyword-block {
|
||||
padding: 10upx 0;
|
||||
}
|
||||
.keyword-block {
|
||||
padding: 10upx 0;
|
||||
}
|
||||
|
||||
.keyword-block .keyword-list-header {
|
||||
width: 94%;
|
||||
padding: 10upx 3%;
|
||||
font-size: 27upx;
|
||||
color: #333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.keyword-block .keyword-list-header {
|
||||
width: 94%;
|
||||
padding: 10upx 3%;
|
||||
font-size: 27upx;
|
||||
color: #333;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.keyword-block .keyword-list-header image {
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
}
|
||||
.keyword-block .keyword-list-header image {
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,9 @@
|
||||
<view class="content">
|
||||
<view class="user-info">
|
||||
<view class="logo-wrap">
|
||||
<view class="logo"></view>
|
||||
<view class="logo">
|
||||
<image class="img" src="/static/logo.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="quick-menu">
|
||||
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit"></image>
|
||||
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit"></image>
|
||||
@@ -137,7 +139,15 @@ page {
|
||||
.user-info {
|
||||
.logo-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.logo {
|
||||
width: 160upx;
|
||||
.img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.quick-menu {
|
||||
display: flex;
|
||||
gap: 20upx;
|
||||
@@ -151,6 +161,7 @@ page {
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 40upx;
|
||||
.avatar {
|
||||
$size: 94upx;
|
||||
width: $size;
|
||||
|
||||
126
pages/watching_history/watching_history.vue
Normal file
126
pages/watching_history/watching_history.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="list">
|
||||
<view class="item" v-for="item in listData.list" :key="item.id">
|
||||
<view class="cover">
|
||||
<image class="img" :src="item.titleImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<view class="record">看到{{ item.courseDetailsName }}</view>
|
||||
<view class="btm">
|
||||
<view class="num">
|
||||
<view v-if="item.courseDetailsCount">更新{{ item.courseDetailsCount }}</view>
|
||||
</view>
|
||||
<view class="btn">继续观看</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
||||
|
||||
import { selectByUserId } from '@/api/me/me.js';
|
||||
|
||||
const type = ref(1);
|
||||
const typeList = ref([
|
||||
{
|
||||
type: 1,
|
||||
label: '我的追剧'
|
||||
},
|
||||
{
|
||||
type: 3,
|
||||
label: '最近观看'
|
||||
}
|
||||
]);
|
||||
|
||||
const listData = reactive({
|
||||
list: [],
|
||||
page: 1,
|
||||
size: 10
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
async function selectByUserIdAjax() {
|
||||
try {
|
||||
const res = await selectByUserId({
|
||||
page: listData.page,
|
||||
limit: listData.size,
|
||||
classify: type.value
|
||||
});
|
||||
console.log(res);
|
||||
if (res.code === 0) {
|
||||
listData.list = res.data.records;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onReachBottom(() => {
|
||||
listData.page++;
|
||||
selectByUserIdAjax();
|
||||
});
|
||||
|
||||
onLoad((e) => {
|
||||
if (e.type) {
|
||||
type.value = e.type;
|
||||
uni.setNavigationBarTitle({
|
||||
title: typeList.value.find((item) => item.type == type.value).label
|
||||
});
|
||||
}
|
||||
selectByUserIdAjax();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 28upx;
|
||||
color: #333;
|
||||
font-size: 29upx;
|
||||
}
|
||||
.list {
|
||||
.item {
|
||||
padding: 28upx 0;
|
||||
display: flex;
|
||||
.cover {
|
||||
width: 150upx;
|
||||
height: 200upx;
|
||||
margin-right: 28upx;
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
border-radius: 20upx;
|
||||
}
|
||||
}
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.record {
|
||||
color: $uni-zj-color-primary;
|
||||
}
|
||||
.btm {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.btn {
|
||||
padding: 4upx 12upx;
|
||||
color: #fff;
|
||||
background: $uni-zj-color-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user