This commit is contained in:
GaoHao
2025-01-13 09:34:04 +08:00
51 changed files with 7276 additions and 247 deletions

View File

@@ -7,7 +7,12 @@
<navigator class="more" url="/pages/watching_history/watching_history?type=3">更多</navigator>
</view>
<view class="list">
<view class="item" v-for="item in data.list1" :key="item.id">
<view
class="item"
v-for="item in data.list1"
:key="item.id"
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)"
>
<view class="cover">
<image class="img" :src="item.titleImg" mode="aspectFill"></image>
<view class="num">{{ item.courseDetailsName }}</view>
@@ -26,7 +31,12 @@
<navigator class="more" url="/pages/watching_history/watching_history?type=1">更多</navigator>
</view>
<view class="list">
<view class="item" v-for="item in data.list2" :key="item.id">
<view
class="item"
v-for="item in data.list2"
:key="item.id"
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)"
>
<div class="item-content">
<view class="cover">
<image class="img" :src="item.titleImg" mode="aspectFill"></image>
@@ -48,6 +58,7 @@
import { reactive } from 'vue';
import { selectByUserId } from '@/api/me/me.js';
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { linkTo } from '@/utils/app.js';
// 获取数据
async function selectByUserIdAjax() {

View File

@@ -25,11 +25,9 @@
})
function seVideo(item) {
// uni.navigateTo({
// url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
// '&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
// .dyEpisodeId
// })
uni.navigateTo({
url:"/pages/video/detail?courseId="+item.courseId+"&courseDetailsId="+item.courseDetailsId
})
}
</script>

View File

@@ -54,166 +54,174 @@
</template>
<script setup>
import {
reactive,
watch
} from "vue";
import {
onShow, onReachBottom
} from '@dcloudio/uni-app'
const props = defineProps({
list: {
type: Array,
default: []
},
})
let datas = reactive({
arrListLeft: [], //左边数据
arrListRight: [], //右边数据
})
onShow(() => {
spliceArrayListr()
})
watch(() => props.list, () => {
spliceArrayListr()
})
function spliceArrayListr() {
datas.arrListRight = []
datas.arrListLeft = []
props.list.map((item, index) => {
if (index % 2 === 0) {
datas.arrListLeft.push(item)
} else {
datas.arrListRight.push(item)
}
import {
reactive,
watch
} from "vue";
import {
onShow,
onReachBottom
} from '@dcloudio/uni-app'
const props = defineProps({
list: {
type: Array,
default: []
},
})
}
let datas = reactive({
arrListLeft: [], //左边数据
arrListRight: [], //右边数据
})
onShow(() => {
spliceArrayListr()
})
watch(() => props.list, () => {
spliceArrayListr()
})
function clickItem(item) {
uni.navigateTo({
url: "/pages/video/detail?courseId=" + item.courseId + "&courseDetailsId=" + item.courseDetailsId
})
}
function spliceArrayListr() {
datas.arrListRight = []
datas.arrListLeft = []
props.list.map((item, index) => {
if (index % 2 === 0) {
datas.arrListLeft.push(item)
} else {
datas.arrListRight.push(item)
}
})
}
</script>
<style lang="scss">
.list {
width: 100%;
height: auto;
display: flex;
align-items: center;
justify-content: center;
.list-box {
width: 686rpx;
height: 100%;
.list {
width: 100%;
height: auto;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
align-items: center;
justify-content: center;
.list-box-ite {
width: calc((100% - 20rpx) / 2);
height: auto;
}
.list-box {
width: 686rpx;
height: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.list-box-ite-item {
width: 100%;
height: auto;
margin-bottom: 20rpx;
.list-box-ite {
width: calc((100% - 20rpx) / 2);
height: auto;
}
.list-box-ite-item-img {
.list-box-ite-item {
width: 100%;
border-radius: 24rpx 24rpx 0 0;
min-height: 300rpx;
position: relative;
height: auto;
margin-bottom: 20rpx;
image {
.list-box-ite-item-img {
width: 100%;
min-height: 300rpx;
border-radius: 24rpx 24rpx 0 0;
min-height: 300rpx;
position: relative;
image {
width: 100%;
min-height: 300rpx;
border-radius: 24rpx 24rpx 0 0;
}
.list-box-ite-item-img-t {
position: absolute;
bottom: 10rpx;
right: 0;
max-width: 80%;
border-radius: 10rpx;
background-color: rgba(51, 51, 51, 0.7);
color: #FFFFFF;
font-size: 22rpx;
padding: 10rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.list-box-ite-item-img-t {
position: absolute;
bottom: 10rpx;
right: 0;
max-width: 80%;
border-radius: 10rpx;
background-color: rgba(51, 51, 51, 0.7);
color: #FFFFFF;
.list-box-ite-item-txt {
padding: 10rpx 20rpx;
background-color: #ffffff;
border-radius: 0 0 24rpx 24rpx;
}
.list-box-ite-item-txt-t {
color: #333333;
font-size: 30rpx;
font-weight: bold;
}
.list-box-ite-item-txt-l {
color: #999999;
font-size: 22rpx;
padding: 10rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-top: 10rpx;
}
}
.list-box-ite-item-txt {
padding: 10rpx 20rpx;
.list-box-item {
width: calc((100% - 20rpx) / 2);
// height: 100%;
min-height: 320rpx;
border-radius: 24rpx;
background-color: #ffffff;
border-radius: 0 0 24rpx 24rpx;
margin-bottom: 20rpx;
}
.list-box-ite-item-txt-t {
color: #333333;
font-size: 30rpx;
font-weight: bold;
}
.list-box-ite-item-txt-l {
color: #999999;
font-size: 22rpx;
margin-top: 10rpx;
}
}
.list-box-item {
width: calc((100% - 20rpx) / 2);
// height: 100%;
min-height: 320rpx;
border-radius: 24rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
}
.list-box-item-img {
width: 100%;
height: 200rpx;
border-radius: 24rpx 24rpx 0 0;
image {
.list-box-item-img {
width: 100%;
height: 200rpx;
border-radius: 24rpx 24rpx 0 0;
image {
width: 100%;
height: 200rpx;
border-radius: 24rpx 24rpx 0 0;
}
}
}
.list-box-item-txt {
width: 100%;
// height: 120rpx;
padding: 20rpx 0;
border-radius: 0 0 24rpx 24rpx;
}
.list-box-item-txt {
width: 100%;
// height: 120rpx;
padding: 20rpx 0;
border-radius: 0 0 24rpx 24rpx;
}
.list-box-item-txt-t {
width: 100%;
padding: 0 20rpx;
color: #333333;
font-size: 30rpx;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.list-box-item-txt-t {
width: 100%;
padding: 0 20rpx;
color: #333333;
font-size: 30rpx;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
.list-box-item-txt-l {
color: #999999;
font-size: 22rpx;
margin-top: 10rpx;
padding: 0 20rpx;
}
}
.list-box-item-txt-l {
color: #999999;
font-size: 22rpx;
margin-top: 10rpx;
padding: 0 20rpx;
}
}
</style>

View File

@@ -54,7 +54,12 @@
</view>
</navigator>
<view class="history-list">
<view class="item" v-for="item in recordThree" :key="item.id">
<view
class="item"
v-for="item in recordThree"
:key="item.id"
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)"
>
<image class="cover" :src="item.titleImg" mode="aspectFill"></image>
<view class="name">{{ item.title }}</view>
<view class="t">看到{{ item.courseDetailsName }}</view>

View File

@@ -1,6 +1,7 @@
<template>
<view class="min-page">
<my-video-list @swiperChange="swiperChange" :list="state.list" :isCollect="state.isCollect" @share="share"
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
:info="state"
></my-video-list>
</view>
</template>
@@ -17,6 +18,9 @@
import {
slice
} from 'lodash'
const boxStyle={
height:'835px'
}
let options = {}
const state = reactive({
collect: 0,
@@ -26,9 +30,22 @@
title: ''
})
async function init() {
const res = await Api.getVideoDetail(options)
Object.assign(state, res)
state.list = res.list
try {
const res = await Api.getVideoDetail(options)
Object.assign(state, res)
state.list = res.list
} catch (error) {
// if(getCurrentPages().length>=2){
// uni.navigateBack()
// }else{
// uni.switchTab({
// url:'/pages/index/index'
// })
// }
}
}
function update({index,item}){
state.list[index]=item
}
onLoad((opt) => {
Object.assign(options, opt)
@@ -54,4 +71,8 @@
background-color: #000;
overflow: hidden;
}
.u-popup{
position: fixed;
}
</style>

93
pages/video/index.nvue Normal file
View File

@@ -0,0 +1,93 @@
<template>
<view class="min-page " >
<!-- <up-button @click="toDetail">toDetail</up-button> -->
<my-video-list isCommand isTabbar v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
:info="state"
></my-video-list>
</view>
</template>
<script setup>
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import * as Api from '@/api/video/index.js'
import {
computed,
reactive,
ref
} from 'vue'
import {
slice
} from 'lodash'
function toDetail() {
uni.navigateTo({
url: '/pages/video/detail?courseId=1208'
})
}
let options = {}
const state = reactive({
collect: 0,
current: {},
list: [],
price: 0,
title: ''
})
async function init() {
const res = await Api.tuijianVideo(options)
state.current = res.list[0]
Object.assign(state, res)
state.list = res.list
}
function update({
index,
item
}) {
state.list[index] = item
}
onLoad((opt) => {
Object.assign(options, opt)
init()
})
function swiperChange({
current,
direction,
data
}) {}
onShow(() => {
})
</script>
<style>
page{
height: calc(100vh - 50px);
overflow: hidden;
}
</style>
<style lang="scss" scoped>
.min-page {
/* #ifdef H5 */
height: calc(100vh - 50px);
/* #endif */
/* #ifdef APP */
height: 100vh;
/* #endif */
background-color: #000;
overflow: hidden;
flex: 1;
}
.u-popup {
position: fixed;
}
</style>

View File

@@ -1,16 +0,0 @@
<template>
<view class="u-p-60">
<up-button @click="toDetail">toDetail</up-button>
</view>
</template>
<script setup>
function toDetail(){
uni.navigateTo({
url:'/pages/video/detail'
})
}
</script>
<style>
</style>

View File

@@ -1,7 +1,8 @@
<template>
<view class="container">
<view class="list">
<view class="item" v-for="item in listData.list" :key="item.id">
<view class="item" v-for="item in listData.list" :key="item.id"
@click="linkTo(`/pages/video/detail?courseId=${item.courseId}&courseDetailsId=${item.courseDetailsId}`)">
<view class="cover">
<image class="img" :src="item.titleImg" mode="aspectFill"></image>
</view>
@@ -27,6 +28,7 @@
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import { linkTo } from '@/utils/app.js';
import { selectByUserId } from '@/api/me/me.js';