更新
This commit is contained in:
parent
b90f32d4b0
commit
b7625a5e0c
File diff suppressed because one or more lines are too long
@ -1,11 +1,10 @@
|
|||||||
.joe_video {
|
.joe_video {
|
||||||
&__type {
|
&__contain {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
border-radius: var(--radius-wrap);
|
border-radius: var(--radius-wrap);
|
||||||
box-shadow: var(--box-shadow);
|
box-shadow: var(--box-shadow);
|
||||||
padding: 60px 15px 15px;
|
padding: 60px 15px 15px;
|
||||||
margin-bottom: 15px;
|
|
||||||
&-title {
|
&-title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
@ -30,6 +29,9 @@
|
|||||||
border-color: var(--theme) transparent transparent;
|
border-color: var(--theme) transparent transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
&__type {
|
||||||
|
margin-bottom: 15px;
|
||||||
&-list {
|
&-list {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
@ -70,36 +72,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__list {
|
&__list {
|
||||||
position: relative;
|
|
||||||
background: var(--background);
|
|
||||||
border-radius: var(--radius-wrap);
|
|
||||||
box-shadow: var(--box-shadow);
|
|
||||||
padding: 60px 15px 15px;
|
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
&-title {
|
|
||||||
position: absolute;
|
|
||||||
top: 15px;
|
|
||||||
left: -10px;
|
|
||||||
background: var(--theme);
|
|
||||||
color: #fff;
|
|
||||||
font-weight: 500;
|
|
||||||
box-shadow: 2px 5px 10px rgba(49, 58, 70, 0.15);
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
padding: 0 12px;
|
|
||||||
border-radius: 2px 2px 2px 0;
|
|
||||||
user-select: none;
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 10px;
|
|
||||||
bottom: -20px;
|
|
||||||
left: 0;
|
|
||||||
z-index: -1;
|
|
||||||
border-color: var(--theme) transparent transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-item {
|
&-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
@ -173,11 +146,15 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: var(--routine);
|
color: var(--routine);
|
||||||
background: var(--classD);
|
background: var(--classD);
|
||||||
height: 32px;
|
height: 34px;
|
||||||
line-height: 32px;
|
line-height: 34px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.error {
|
||||||
|
text-align: center;
|
||||||
|
color: var(--minor);
|
||||||
|
}
|
||||||
&:empty {
|
&:empty {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -228,4 +205,75 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&__detail {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
&-info {
|
||||||
|
display: flex;
|
||||||
|
border-top: 1px solid var(--classC);
|
||||||
|
padding-top: 15px;
|
||||||
|
.thumbnail {
|
||||||
|
position: relative;
|
||||||
|
width: 180px;
|
||||||
|
height: 250px;
|
||||||
|
min-width: 180px;
|
||||||
|
min-height: 180px;
|
||||||
|
margin-right: 15px;
|
||||||
|
.pic {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
.year {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
padding: 2px 5px;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
background: #ff6800;
|
||||||
|
color: #fff;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.description {
|
||||||
|
dt {
|
||||||
|
font-size: 24px;
|
||||||
|
color: var(--main);
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
dd {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 45px;
|
||||||
|
line-height: 24px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
.muted {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
color: var(--minor);
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
word-break: break-all;
|
||||||
|
color: var(--routine);
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
/*! autoprefixer: off */
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
/* autoprefixer: on */
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.error {
|
||||||
|
color: var(--minor);
|
||||||
|
margin: 0 auto;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -77,7 +77,8 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
&::before {
|
&::before {
|
||||||
|
@ -3,26 +3,21 @@ console.time('Video.js执行时长')
|
|||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const p = new URLSearchParams(window.location.search)
|
const p = new URLSearchParams(window.location.search)
|
||||||
/* 判断渲染详情页还是列表页 */
|
const vod_id = p.get('vod_id')
|
||||||
if (p.get('vod_id')) {
|
if (vod_id) {
|
||||||
initVideoDetail()
|
initVideoDetail()
|
||||||
} else {
|
} else {
|
||||||
initVideoList()
|
initVideoList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 初始化列表页 */
|
||||||
function initVideoList() {
|
function initVideoList() {
|
||||||
/* 当前的分类id */
|
/* 当前的分类id */
|
||||||
let queryData = {
|
let queryData = { pg: -999, t: -999 }
|
||||||
pg: 0,
|
|
||||||
t: -999
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 总页数 */
|
/* 总页数 */
|
||||||
let total = 0
|
let total = -999
|
||||||
|
|
||||||
/* 是否正在加载列表 */
|
/* 是否正在加载列表 */
|
||||||
let isLoading = false
|
let isLoading = false
|
||||||
|
|
||||||
/* 获取视频分类 */
|
/* 获取视频分类 */
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Joe.BASE_API,
|
url: Joe.BASE_API,
|
||||||
@ -30,13 +25,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
data: { routeType: 'maccms_list' },
|
data: { routeType: 'maccms_list' },
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code !== 1) return $('.joe_video__type-list').html(`<li class="error">${res.data}</li>`)
|
if (res.code !== 1) return $('.joe_video__type-list').html(`<li class="error">${res.data}</li>`)
|
||||||
|
if (!res.data.class.length) return $('.joe_video__type-list').html(`<li class="error">暂无数据!</li>`)
|
||||||
let htmlStr = '<li class="item" data-t="">全部</li>'
|
let htmlStr = '<li class="item" data-t="">全部</li>'
|
||||||
res.data.class.forEach(_ => (htmlStr += `<li class="item" data-t="${_.type_id}">${_.type_name}</li>`))
|
res.data.class.forEach(_ => (htmlStr += `<li class="item" data-t="${_.type_id}">${_.type_name}</li>`))
|
||||||
$('.joe_video__type-list').html(htmlStr)
|
$('.joe_video__type-list').html(htmlStr)
|
||||||
$('.joe_video__type-list .item').first().click()
|
$('.joe_video__type-list .item').first().click()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/* 点击切换分类 */
|
/* 点击切换分类 */
|
||||||
$('.joe_video__type-list').on('click', '.item', function () {
|
$('.joe_video__type-list').on('click', '.item', function () {
|
||||||
const t = $(this).attr('data-t')
|
const t = $(this).attr('data-t')
|
||||||
@ -47,22 +42,24 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
queryData.t = t
|
queryData.t = t
|
||||||
renderDom()
|
renderDom()
|
||||||
})
|
})
|
||||||
|
|
||||||
/* 渲染视频列表 */
|
/* 渲染视频列表 */
|
||||||
function renderDom() {
|
function renderDom() {
|
||||||
|
$('.joe_video__list-item').css('display', '').html('')
|
||||||
isLoading = true
|
isLoading = true
|
||||||
$('.joe_video__list-item').html('')
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Joe.BASE_API,
|
url: Joe.BASE_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: { routeType: 'maccms_list', t: queryData.t, pg: queryData.pg, ac: 'videolist' },
|
data: { routeType: 'maccms_list', t: queryData.t, pg: queryData.pg, ac: 'videolist' },
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code !== 1) return
|
if (res.code !== 1) return $('.joe_video__list-item').css('display', 'block').html('<p class="error">数据加载失败!请检查!</p>')
|
||||||
|
if (!res.data.list.length) {
|
||||||
|
$('.joe_video__list-item').css('display', 'block').html('<p class="error">当前分类暂无数据!</p>')
|
||||||
|
} else {
|
||||||
let htmlStr = ''
|
let htmlStr = ''
|
||||||
res.data.list.forEach(_ => {
|
res.data.list.forEach(_ => {
|
||||||
htmlStr += `
|
htmlStr += `
|
||||||
<a class="item animated bounceIn" href="${window.location.href + '?vod_id=' + _.vod_id}" target="_blank" rel="noopener noreferrer nofollow">
|
<a class="item animated bounceIn" href="${window.location.href + '?vod_id=' + _.vod_id}" target="_blank" rel="noopener noreferrer nofollow">
|
||||||
<i class="year" style="display: ${_.vod_year ? 'block' : 'none'}">${_.vod_year}</i>
|
<i class="year" style="display: ${_.vod_year && _.vod_year != 0 ? 'block' : 'none'}">${_.vod_year}</i>
|
||||||
<div class="thumb">
|
<div class="thumb">
|
||||||
<img onerror="javascript: this.src = '${Joe.LAZY_LOAD}'" class="pic video_lazyload" src="${Joe.LAZY_LOAD}" data-original="${_.vod_pic}" alt="${_.vod_name}">
|
<img onerror="javascript: this.src = '${Joe.LAZY_LOAD}'" class="pic video_lazyload" src="${Joe.LAZY_LOAD}" data-original="${_.vod_pic}" alt="${_.vod_name}">
|
||||||
</div>
|
</div>
|
||||||
@ -71,23 +68,41 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
})
|
})
|
||||||
$('.joe_video__list-item').html(htmlStr)
|
$('.joe_video__list-item').html(htmlStr)
|
||||||
new LazyLoad('.video_lazyload')
|
new LazyLoad('.video_lazyload')
|
||||||
isLoading = false
|
}
|
||||||
total = res.data.pagecount
|
total = res.data.pagecount
|
||||||
initPagination()
|
initPagination()
|
||||||
}
|
},
|
||||||
|
complete: () => (isLoading = false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 初始化分页 */
|
/* 初始化分页 */
|
||||||
function initPagination() {
|
function initPagination() {
|
||||||
let htmlStr = ''
|
let htmlStr = ''
|
||||||
if (queryData.pg !== 0) htmlStr += `<li class="joe_video__pagination-item" data-pg="${queryData.pg - 1}"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path></svg></li><li class="joe_video__pagination-item" data-pg="${queryData.pg - 1}">${queryData.pg}</li>`
|
if (queryData.pg !== 0) {
|
||||||
htmlStr += `<li class="active joe_video__pagination-item">${queryData.pg + 1}</li>`
|
htmlStr += `
|
||||||
if (queryData.pg != total) htmlStr += `<li class="joe_video__pagination-item" data-pg="${queryData.pg + 1}">${queryData.pg + 2}</li>`
|
<li class="joe_video__pagination-item" data-pg="0">首页</li>
|
||||||
if (queryData.pg < total) htmlStr += `<li class="joe_video__pagination-item" data-pg="${queryData.pg + 1}"><svg class="next" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path></svg></li>`
|
<li class="joe_video__pagination-item" data-pg="${queryData.pg - 1}">
|
||||||
|
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12">
|
||||||
|
<path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
<li class="joe_video__pagination-item" data-pg="${queryData.pg - 1}">${queryData.pg}</li>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
htmlStr += `<li class="joe_video__pagination-item active">${queryData.pg + 1}</li>`
|
||||||
|
if (queryData.pg != total) {
|
||||||
|
htmlStr += `
|
||||||
|
<li class="joe_video__pagination-item" data-pg="${queryData.pg + 1}">${queryData.pg + 2}</li>
|
||||||
|
<li class="joe_video__pagination-item" data-pg="${queryData.pg + 1}">
|
||||||
|
<svg class="next" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12">
|
||||||
|
<path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
if (queryData.pg < total) htmlStr += `<li class="joe_video__pagination-item" data-pg="${total}">末页</li>`
|
||||||
$('.joe_video__pagination').html(htmlStr)
|
$('.joe_video__pagination').html(htmlStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 切换分页 */
|
/* 切换分页 */
|
||||||
$('.joe_video__pagination').on('click', '.joe_video__pagination-item', function () {
|
$('.joe_video__pagination').on('click', '.joe_video__pagination-item', function () {
|
||||||
const pg = $(this).attr('data-pg')
|
const pg = $(this).attr('data-pg')
|
||||||
@ -98,7 +113,37 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function initVideoDetail() {}
|
/* 初始化播放页 */
|
||||||
|
function initVideoDetail() {
|
||||||
|
$.ajax({
|
||||||
|
url: Joe.BASE_API,
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
routeType: 'maccms_list',
|
||||||
|
ac: 'detail',
|
||||||
|
ids: vod_id
|
||||||
|
},
|
||||||
|
success(res) {
|
||||||
|
if (res.code !== 1) return $('.joe_video__detail-info').html(`<p class="error">${res.data}</p>`)
|
||||||
|
if (!res.data.list.length) return $('.joe_video__detail-info').html(`<p class="error">数据抓取异常!请检查!</p>`)
|
||||||
|
const item = res.data.list[0]
|
||||||
|
$('.joe_video__detail-info').html(`
|
||||||
|
<div class="thumbnail">
|
||||||
|
<img class="pic video_lazyload" onerror="javascript: this.src = '${Joe.LAZY_LOAD}'" src="${Joe.LAZY_LOAD}" data-original="${item.vod_pic}" alt="${item.vod_name}">
|
||||||
|
<i class="year" style="display: ${item.vod_year && item.vod_year != 0 ? 'block' : 'none'}">${item.vod_year}</i>
|
||||||
|
</div>
|
||||||
|
<dl class="description">
|
||||||
|
<dt>${item.vod_name + (item.vod_remarks ? ' - ' + item.vod_remarks : '')}</dt>
|
||||||
|
<dd><span class="muted">类型:</span><p class="text">${item.vod_class || '未知'}</p></dd>
|
||||||
|
<dd><span class="muted">主演:</span><p class="text">${item.vod_actor || '未知'}</p></dd>
|
||||||
|
<dd><span class="muted">导演:</span><p class="text">${item.vod_director || '未知'}</p></dd>
|
||||||
|
<dd><span class="muted">简介:</span><p class="text">${item.vod_content ? item.vod_content : item.vod_blurb}</p></dd>
|
||||||
|
</dl>
|
||||||
|
`)
|
||||||
|
new LazyLoad('.video_lazyload')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
console.timeEnd('Video.js执行时长')
|
console.timeEnd('Video.js执行时长')
|
||||||
})
|
})
|
||||||
|
@ -1,49 +1,42 @@
|
|||||||
/* 壁纸页面需要用到的JS */
|
/* 壁纸页面需要用到的JS */
|
||||||
console.time('Wallpaper.js执行时长');
|
console.time('Wallpaper.js执行时长')
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
/* 是否正在请求 */
|
/* 是否正在请求 */
|
||||||
let isLoading = false;
|
let isLoading = false
|
||||||
/* 查询字段 */
|
/* 查询字段 */
|
||||||
let queryData = {
|
let queryData = { cid: -999, start: -999, count: 30 }
|
||||||
cid: '',
|
|
||||||
start: 0,
|
|
||||||
count: 30
|
|
||||||
};
|
|
||||||
/* 总页数 */
|
/* 总页数 */
|
||||||
let total = 0;
|
let total = -999
|
||||||
|
|
||||||
/* 获取壁纸分类 */
|
/* 获取壁纸分类 */
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Joe.BASE_API,
|
url: Joe.BASE_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: { routeType: 'wallpaper_type' },
|
||||||
routeType: 'wallpaper_type'
|
|
||||||
},
|
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>');
|
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>')
|
||||||
let htmlStr = '';
|
if (!res.data.length) return $('.joe_wallpaper__type-list').html(`<li class="error">暂无数据!</li>`)
|
||||||
res.data.forEach(_ => (htmlStr += `<li class="item" data-cid="${_.id}">${_.name}</li>`));
|
let htmlStr = ''
|
||||||
$('.joe_wallpaper__type-list').html(htmlStr);
|
res.data.forEach(_ => (htmlStr += `<li class="item" data-cid="${_.id}">${_.name}</li>`))
|
||||||
$('.joe_wallpaper__type-list .item').first().click();
|
$('.joe_wallpaper__type-list').html(htmlStr)
|
||||||
|
$('.joe_wallpaper__type-list .item').first().click()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
/* 切换类目 */
|
/* 切换类目 */
|
||||||
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
||||||
const cid = $(this).attr('data-cid');
|
const cid = $(this).attr('data-cid')
|
||||||
if (queryData.cid === cid || isLoading) return;
|
if (queryData.cid === cid || isLoading) return
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||||
$(this).addClass('active').siblings().removeClass('active');
|
$(this).addClass('active').siblings().removeClass('active')
|
||||||
queryData.cid = cid;
|
queryData.cid = cid
|
||||||
queryData.start = 0;
|
queryData.start = 0
|
||||||
getList();
|
renderDom()
|
||||||
});
|
})
|
||||||
|
|
||||||
/* 渲染DOM */
|
/* 渲染DOM */
|
||||||
function getList() {
|
function renderDom() {
|
||||||
isLoading = true;
|
$('.joe_wallpaper__list').html('')
|
||||||
$('.joe_wallpaper__list').html('');
|
isLoading = true
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Joe.BASE_API,
|
url: Joe.BASE_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@ -54,41 +47,57 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
count: queryData.count
|
count: queryData.count
|
||||||
},
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code !== 1) return;
|
if (res.code !== 1) return
|
||||||
let htmlStr = '';
|
let htmlStr = ''
|
||||||
res.data.forEach(_ => {
|
res.data.forEach(_ => {
|
||||||
htmlStr += `
|
htmlStr += `<a class="item animated bounceIn" data-fancybox="gallery" href="${_.url}"><img onerror="javascript: this.src = '${Joe.LAZY_LOAD}'" class="wallpaper_lazyload" src="${Joe.LAZY_LOAD}" data-original="${_.img_1024_768 || _.url}" alt="壁纸"></a>`
|
||||||
<a class="item animated bounceIn" data-fancybox="gallery" href="${_.url}">
|
})
|
||||||
<img onerror="javascript: this.src = '${Joe.LAZY_LOAD}'" class="wallpaper_lazyload" src="${Joe.LAZY_LOAD}" data-original="${_.img_1024_768}" alt="壁纸">
|
$('.joe_wallpaper__list').html(htmlStr)
|
||||||
</a>`;
|
new LazyLoad('.wallpaper_lazyload')
|
||||||
});
|
total = res.total
|
||||||
$('.joe_wallpaper__list').html(htmlStr);
|
initPagination()
|
||||||
new LazyLoad('.wallpaper_lazyload');
|
},
|
||||||
total = res.total;
|
complete: () => (isLoading = false)
|
||||||
isLoading = false;
|
})
|
||||||
initPagination();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 初始化分页 */
|
/* 初始化分页 */
|
||||||
function initPagination() {
|
function initPagination() {
|
||||||
let htmlStr = '';
|
let htmlStr = ''
|
||||||
if (queryData.start / queryData.count !== 0) htmlStr += `<li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path></svg></li><li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}">${queryData.start / queryData.count}</li>`;
|
if (queryData.start / queryData.count !== 0) {
|
||||||
htmlStr += `<li class="active joe_wallpaper__pagination-item">${queryData.start / queryData.count + 1}</li>`;
|
htmlStr += `
|
||||||
if (queryData.start != total) htmlStr += `<li class="joe_wallpaper__pagination-item" data-start="${queryData.start + queryData.count}">${queryData.start / queryData.count + 2}</li>`;
|
<li class="joe_wallpaper__pagination-item" data-start="0">首页</li>
|
||||||
if (queryData.start < total) htmlStr += `<li class="joe_wallpaper__pagination-item" data-start="${queryData.start + queryData.count}"><svg class="next" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path></svg></li>`;
|
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}">
|
||||||
$('.joe_wallpaper__pagination').html(htmlStr);
|
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12">
|
||||||
|
<path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}">${Math.ceil(queryData.start / queryData.count)}</li>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
htmlStr += `<li class="joe_wallpaper__pagination-item active">${Math.ceil(queryData.start / queryData.count) + 1}</li>`
|
||||||
|
if (queryData.start != total - queryData.count) {
|
||||||
|
htmlStr += `
|
||||||
|
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start + queryData.count}">${Math.ceil(queryData.start / queryData.count) + 2}</li>
|
||||||
|
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start + queryData.count}">
|
||||||
|
<svg class="next" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12">
|
||||||
|
<path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z" fill="" p-id="9417"></path><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312 0.512zM181.248 877.056c0-3.584 0-7.68 0.512-11.264h-0.512V151.552h0.512c-0.512-3.584-0.512-7.168-0.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-0.512 11.264h0.512V865.792h-0.512c0.512 3.584 0.512 7.168 0.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"></path>
|
||||||
|
</svg>
|
||||||
|
</li>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
if (queryData.start < total - queryData.count) htmlStr += `<li class="joe_wallpaper__pagination-item" data-start="${total - queryData.count}">末页</li>`
|
||||||
|
$('.joe_wallpaper__pagination').html(htmlStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 切换分页 */
|
/* 切换分页 */
|
||||||
$('.joe_wallpaper__pagination').on('click', '.joe_wallpaper__pagination-item', function () {
|
$('.joe_wallpaper__pagination').on('click', '.joe_wallpaper__pagination-item', function () {
|
||||||
const start = $(this).attr('data-start');
|
const start = $(this).attr('data-start')
|
||||||
if (!start || isLoading) return;
|
if (!start || isLoading) return
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||||
queryData.start = Number(start);
|
queryData.start = Number(start)
|
||||||
getList();
|
renderDom()
|
||||||
});
|
})
|
||||||
|
|
||||||
console.timeEnd('Wallpaper.js执行时长');
|
console.timeEnd('Wallpaper.js执行时长')
|
||||||
});
|
})
|
||||||
|
20
core/api.php
20
core/api.php
@ -6,7 +6,10 @@ function _getRanking($self)
|
|||||||
header("HTTP/1.1 200 OK");
|
header("HTTP/1.1 200 OK");
|
||||||
$ranking_txt = Helper::options()->JAside_Ranking;
|
$ranking_txt = Helper::options()->JAside_Ranking;
|
||||||
$ranking_arr = explode("$", $ranking_txt);
|
$ranking_arr = explode("$", $ranking_txt);
|
||||||
$arrContextOptions = ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false,]];
|
$arrContextOptions = [
|
||||||
|
'ssl' => ['verify_peer' => false, 'verify_peer_name' => false],
|
||||||
|
'http' => ['method' => 'GET', 'timeout' => 5]
|
||||||
|
];
|
||||||
$json = file_get_contents("https://the.top/v1/{$ranking_arr[1]}/1/9", false, stream_context_create($arrContextOptions));
|
$json = file_get_contents("https://the.top/v1/{$ranking_arr[1]}/1/9", false, stream_context_create($arrContextOptions));
|
||||||
$res = json_decode($json, TRUE);
|
$res = json_decode($json, TRUE);
|
||||||
if ($res['code'] === 0) {
|
if ($res['code'] === 0) {
|
||||||
@ -173,7 +176,10 @@ function _pushRecord($self)
|
|||||||
function _getWallpaperType($self)
|
function _getWallpaperType($self)
|
||||||
{
|
{
|
||||||
header("HTTP/1.1 200 OK");
|
header("HTTP/1.1 200 OK");
|
||||||
$arrContextOptions = ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false,]];
|
$arrContextOptions = [
|
||||||
|
'ssl' => ['verify_peer' => false, 'verify_peer_name' => false],
|
||||||
|
'http' => ['method' => 'GET', 'timeout' => 5]
|
||||||
|
];
|
||||||
$json = file_get_contents("http://cdn.apc.360.cn/index.php?c=WallPaper&a=getAllCategoriesV2&from=360chrome", false, stream_context_create($arrContextOptions));
|
$json = file_get_contents("http://cdn.apc.360.cn/index.php?c=WallPaper&a=getAllCategoriesV2&from=360chrome", false, stream_context_create($arrContextOptions));
|
||||||
$res = json_decode($json, TRUE);
|
$res = json_decode($json, TRUE);
|
||||||
if ($res['errno'] == 0) {
|
if ($res['errno'] == 0) {
|
||||||
@ -196,7 +202,10 @@ function _getWallpaperList($self)
|
|||||||
$cid = $self->request->cid;
|
$cid = $self->request->cid;
|
||||||
$start = $self->request->start;
|
$start = $self->request->start;
|
||||||
$count = $self->request->count;
|
$count = $self->request->count;
|
||||||
$arrContextOptions = ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false,]];
|
$arrContextOptions = [
|
||||||
|
'ssl' => ['verify_peer' => false, 'verify_peer_name' => false],
|
||||||
|
'http' => ['method' => 'GET', 'timeout' => 5]
|
||||||
|
];
|
||||||
$json = file_get_contents(
|
$json = file_get_contents(
|
||||||
"http://wallpaper.apc.360.cn/index.php?c=WallPaper&a=getAppsByCategory&cid={$cid}&start={$start}&count={$count}&from=360chrome",
|
"http://wallpaper.apc.360.cn/index.php?c=WallPaper&a=getAppsByCategory&cid={$cid}&start={$start}&count={$count}&from=360chrome",
|
||||||
false,
|
false,
|
||||||
@ -229,7 +238,10 @@ function _getMaccmsList($self)
|
|||||||
$wd = $self->request->wd ? $self->request->wd : '';
|
$wd = $self->request->wd ? $self->request->wd : '';
|
||||||
|
|
||||||
if ($cms_api) {
|
if ($cms_api) {
|
||||||
$arrContextOptions = ['ssl' => ['verify_peer' => false, 'verify_peer_name' => false,]];
|
$arrContextOptions = [
|
||||||
|
'ssl' => ['verify_peer' => false, 'verify_peer_name' => false],
|
||||||
|
'http' => ['method' => 'GET', 'timeout' => 5]
|
||||||
|
];
|
||||||
$json = file_get_contents(
|
$json = file_get_contents(
|
||||||
$cms_api . '?ac=' . $ac . '&ids=' . $ids . '&t=' . $t . '&pg=' . $pg . '&wd=' . $wd,
|
$cms_api . '?ac=' . $ac . '&ids=' . $ids . '&t=' . $t . '&pg=' . $pg . '&wd=' . $wd,
|
||||||
false,
|
false,
|
||||||
|
19
video.php
19
video.php
@ -24,17 +24,28 @@
|
|||||||
<?php $this->need('public/header.php'); ?>
|
<?php $this->need('public/header.php'); ?>
|
||||||
<div class="joe_container">
|
<div class="joe_container">
|
||||||
<div class="joe_main">
|
<div class="joe_main">
|
||||||
<div class="joe_video__type">
|
|
||||||
<div class="joe_video__type-title">视频分类</div>
|
<?php if (isset($_GET['vod_id'])) : ?>
|
||||||
|
<div class="joe_video__detail joe_video__contain">
|
||||||
|
<div class="joe_video__contain-title">影片简介</div>
|
||||||
|
<div class="joe_video__detail-info">
|
||||||
|
<p class="error">正在拼命加载中...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<div class="joe_video__type joe_video__contain">
|
||||||
|
<div class="joe_video__contain-title">视频分类</div>
|
||||||
<ul class="joe_video__type-list">
|
<ul class="joe_video__type-list">
|
||||||
<li class="error">正在拼命加载中...</li>
|
<li class="error">正在拼命加载中...</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="joe_video__list">
|
<div class="joe_video__list joe_video__contain">
|
||||||
<div class="joe_video__list-title">视频列表</div>
|
<div class="joe_video__contain-title">视频列表</div>
|
||||||
<div class="joe_video__list-item"></div>
|
<div class="joe_video__list-item"></div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="joe_video__pagination"></ul>
|
<ul class="joe_video__pagination"></ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php $this->need('public/aside.php'); ?>
|
<?php $this->need('public/aside.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user