更新
This commit is contained in:
parent
ff86838e55
commit
0a0ff61a25
File diff suppressed because one or more lines are too long
@ -1,11 +1,10 @@
|
|||||||
.joe_live {
|
.joe_live {
|
||||||
&__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 {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -18,17 +17,11 @@
|
|||||||
box-shadow: 2px 5px 10px rgba(49, 58, 70, 0.15);
|
box-shadow: 2px 5px 10px rgba(49, 58, 70, 0.15);
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
padding: 0 8px 0 12px;
|
padding: 0 12px;
|
||||||
border-radius: 2px 2px 2px 0;
|
border-radius: 2px 2px 2px 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
.icon {
|
|
||||||
width: 15px;
|
&::after {
|
||||||
height: 15px;
|
|
||||||
fill: #fff;
|
|
||||||
margin-left: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -10px;
|
bottom: -10px;
|
||||||
@ -39,6 +32,19 @@
|
|||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
&__type {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
&-title {
|
||||||
|
padding-right: 8px;
|
||||||
|
.icon {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
fill: #fff;
|
||||||
|
margin-left: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
&-list {
|
&-list {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
@ -231,4 +237,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&__pagination {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-top: 15px;
|
||||||
|
&-item {
|
||||||
|
user-select: none;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-left: 5px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
padding: 0 15px;
|
||||||
|
background: var(--background);
|
||||||
|
color: var(--main);
|
||||||
|
border-radius: 2px;
|
||||||
|
transition: background 0.35s, color 0.35s;
|
||||||
|
svg {
|
||||||
|
fill: var(--routine);
|
||||||
|
transition: fill 0.35s;
|
||||||
|
}
|
||||||
|
.next {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
&.active,
|
||||||
|
&:hover {
|
||||||
|
color: #fff;
|
||||||
|
background: var(--theme);
|
||||||
|
svg {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__play {
|
||||||
|
&-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 580px;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
*{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-520;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}iframe{display:block;border:none;margin:0 auto}textarea{resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}}
|
*{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-520;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}iframe{display:block;border:none;margin:0 auto;vertical-align:middle}textarea{resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}}
|
||||||
|
@ -48,6 +48,7 @@ iframe {
|
|||||||
display: block;
|
display: block;
|
||||||
border: none;
|
border: none;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -72,7 +72,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__list {
|
&__list {
|
||||||
margin-bottom: 15px;
|
|
||||||
&-item {
|
&-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
@ -201,6 +200,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
padding-top: 15px;
|
||||||
&-item {
|
&-item {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -72,7 +72,6 @@
|
|||||||
&__list {
|
&__list {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
margin-bottom: 15px;
|
|
||||||
.item {
|
.item {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
@ -139,6 +138,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
padding-top: 15px;
|
||||||
&-item {
|
&-item {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/* 全局公用JS */
|
|
||||||
console.time('Global.js执行时长');
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
/* 初始化昼夜模式 */
|
/* 初始化昼夜模式 */
|
||||||
{
|
{
|
||||||
@ -333,6 +330,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
/* 懒加载 */
|
/* 懒加载 */
|
||||||
new LazyLoad('.lazyload');
|
new LazyLoad('.lazyload');
|
||||||
|
|
||||||
console.timeEnd('Global.js执行时长');
|
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* 首页需要用到的JS */
|
|
||||||
console.time('Index.js执行时长');
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
/* 激活轮播图功能 */
|
/* 激活轮播图功能 */
|
||||||
{
|
{
|
||||||
@ -115,6 +113,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
const wow = $('.joe_index__list').attr('data-wow');
|
const wow = $('.joe_index__list').attr('data-wow');
|
||||||
if (wow !== 'off' && wow) new WOW({ boxClass: 'wow', animateClass: `animated ${wow}`, offset: 0, mobile: true, live: true, scrollContainer: null }).init();
|
if (wow !== 'off' && wow) new WOW({ boxClass: 'wow', animateClass: `animated ${wow}`, offset: 0, mobile: true, live: true, scrollContainer: null }).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('Index.js执行时长');
|
|
||||||
});
|
});
|
||||||
|
@ -1,32 +1,20 @@
|
|||||||
/* 直播页面需要用到JS */
|
|
||||||
console.time('Live.js执行时长');
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const p = new URLSearchParams(window.location.search);
|
const p = new URLSearchParams(window.location.search);
|
||||||
const gameId = p.get('gameId');
|
if (!p.get('profileRoom')) initLiveList();
|
||||||
if (gameId) {
|
|
||||||
} else {
|
|
||||||
initLiveList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 初始化直播列表 */
|
|
||||||
function initLiveList() {
|
function initLiveList() {
|
||||||
let queryData = {
|
let queryData = {
|
||||||
page: 1,
|
page: 1,
|
||||||
gameId: '',
|
gameId: '',
|
||||||
index: 0,
|
index: 0,
|
||||||
isLoading: false
|
isLoading: false,
|
||||||
|
totalPage: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 点击切换分类 */
|
|
||||||
$('.joe_live__type-title .icon').on('click', function () {
|
$('.joe_live__type-title .icon').on('click', function () {
|
||||||
if (queryData.isLoading) return;
|
if (queryData.isLoading) return;
|
||||||
if (queryData.index === 3) queryData.index = 0;
|
if (queryData.index === 3) queryData.index = 0;
|
||||||
queryData.index++;
|
queryData.index++;
|
||||||
renderLiveType();
|
renderLiveType();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 分类列表点击事件 */
|
|
||||||
$('.joe_live__type-list').on('click', '.item', function () {
|
$('.joe_live__type-list').on('click', '.item', function () {
|
||||||
if (queryData.isLoading) return;
|
if (queryData.isLoading) return;
|
||||||
$(this).addClass('active').siblings().removeClass('active');
|
$(this).addClass('active').siblings().removeClass('active');
|
||||||
@ -34,8 +22,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
queryData.gameId = $(this).attr('data-gameId');
|
queryData.gameId = $(this).attr('data-gameId');
|
||||||
renderLiveList();
|
renderLiveList();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 渲染分类 */
|
|
||||||
renderLiveType();
|
renderLiveType();
|
||||||
function renderLiveType() {
|
function renderLiveType() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -50,8 +36,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 渲染列表 */
|
|
||||||
function renderLiveList() {
|
function renderLiveList() {
|
||||||
queryData.isLoading = true;
|
queryData.isLoading = true;
|
||||||
$('.joe_live__list').html('');
|
$('.joe_live__list').html('');
|
||||||
@ -68,7 +52,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
let htmlStr = '';
|
let htmlStr = '';
|
||||||
res.data.datas.forEach(_ => {
|
res.data.datas.forEach(_ => {
|
||||||
htmlStr += `
|
htmlStr += `
|
||||||
<a target="_blank" rel="noopener noreferrer nofollow" class="joe_live__list-item animated bounceIn" href="#">
|
<a target="_blank" rel="noopener noreferrer nofollow" class="joe_live__list-item animated bounceIn" href="${window.location.href + '?profileRoom=' + _.profileRoom + '&title=' + _.nick}">
|
||||||
<div class="thumb">
|
<div class="thumb">
|
||||||
<i class="recommendTagName" style="display: ${_.recommendTagName ? '' : 'none'}">${_.recommendTagName}</i>
|
<i class="recommendTagName" style="display: ${_.recommendTagName ? '' : 'none'}">${_.recommendTagName}</i>
|
||||||
<img class="screenshot screenshot_lazyload" onerror="javascript: this.src = '${Joe.LAZY_LOAD}';" src="${Joe.LAZY_LOAD}" data-original="${_.screenshot}" alt="${_.introduction}" />
|
<img class="screenshot screenshot_lazyload" onerror="javascript: this.src = '${Joe.LAZY_LOAD}';" src="${Joe.LAZY_LOAD}" data-original="${_.screenshot}" alt="${_.introduction}" />
|
||||||
@ -95,16 +79,49 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
$('.joe_live__list').html(htmlStr);
|
$('.joe_live__list').html(htmlStr);
|
||||||
new LazyLoad('.screenshot_lazyload');
|
new LazyLoad('.screenshot_lazyload');
|
||||||
|
queryData.totalPage = res.data.totalPage;
|
||||||
|
initPagination();
|
||||||
},
|
},
|
||||||
complete: () => (queryData.isLoading = false)
|
complete: () => (queryData.isLoading = false)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function initPagination() {
|
||||||
|
let htmlStr = '';
|
||||||
|
if (queryData.page != 1) {
|
||||||
|
htmlStr += `
|
||||||
|
<li class="joe_live__pagination-item" data-page="1">首页</li>
|
||||||
|
<li class="joe_live__pagination-item" data-page="${queryData.page - 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_live__pagination-item" data-page="${queryData.page - 1}">${queryData.page - 1}</li>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
htmlStr += `<li class="joe_live__pagination-item active">${queryData.page}</li>`;
|
||||||
|
if (queryData.page != queryData.totalPage) {
|
||||||
|
htmlStr += `
|
||||||
|
<li class="joe_live__pagination-item" data-page="${queryData.page + 1}">${queryData.page + 1}</li>
|
||||||
|
<li class="joe_live__pagination-item" data-page="${queryData.page + 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.page < queryData.totalPage) htmlStr += `<li class="joe_live__pagination-item" data-page="${queryData.totalPage}">末页</li>`;
|
||||||
|
$('.joe_live__pagination').html(htmlStr);
|
||||||
|
}
|
||||||
|
$('.joe_live__pagination').on('click', '.joe_live__pagination-item', function () {
|
||||||
|
const page = $(this).attr('data-page');
|
||||||
|
if (!page || queryData.isLoading) return;
|
||||||
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
queryData.page = Number(page);
|
||||||
|
renderLiveList();
|
||||||
|
});
|
||||||
function parseNum(num = 0) {
|
function parseNum(num = 0) {
|
||||||
if (num >= 10000) return Math.round(num / 1000) / 10 + '万';
|
if (num >= 10000) return Math.round(num / 1000) / 10 + '万';
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('Live.js执行时长');
|
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/* 详情页和独立页面需要用到的JS */
|
|
||||||
console.time('Post&Page.js执行时长');
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
/* 当前页的CID */
|
/* 当前页的CID */
|
||||||
const cid = $('.joe_detail').attr('data-cid');
|
const cid = $('.joe_detail').attr('data-cid');
|
||||||
@ -144,8 +141,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('Post&Page.js执行时长');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 写在load事件里,为了解决图片未加载完成,滚动距离获取会不准确的问题 */
|
/* 写在load事件里,为了解决图片未加载完成,滚动距离获取会不准确的问题 */
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
/* 视频页面需要用到JS */
|
|
||||||
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');
|
const vod_id = p.get('vod_id');
|
||||||
@ -9,15 +6,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
} else {
|
} else {
|
||||||
initVideoList();
|
initVideoList();
|
||||||
}
|
}
|
||||||
/* 初始化列表页 */
|
|
||||||
function initVideoList() {
|
function initVideoList() {
|
||||||
/* 当前的分类id */
|
|
||||||
let queryData = { pg: '', t: '', wd: '' };
|
let queryData = { pg: '', t: '', wd: '' };
|
||||||
/* 总页数 */
|
|
||||||
let pagecount = '';
|
let pagecount = '';
|
||||||
/* 是否正在加载列表 */
|
|
||||||
let isLoading = false;
|
let isLoading = false;
|
||||||
/* 获取视频分类 */
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Joe.BASE_API,
|
url: Joe.BASE_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@ -31,7 +23,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
$('.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');
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
@ -43,7 +34,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
$('.joe_video__list-search input').val('');
|
$('.joe_video__list-search input').val('');
|
||||||
renderDom();
|
renderDom();
|
||||||
});
|
});
|
||||||
/* 渲染视频列表 */
|
|
||||||
function renderDom() {
|
function renderDom() {
|
||||||
$('.joe_video__list-item').css('display', '').html('');
|
$('.joe_video__list-item').css('display', '').html('');
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
@ -76,10 +66,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
complete: () => (isLoading = false)
|
complete: () => (isLoading = false)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/* 初始化分页 */
|
|
||||||
function initPagination() {
|
function initPagination() {
|
||||||
if(pagecount == 0) return $(".joe_video__pagination").hide()
|
if (pagecount == 0) return $('.joe_video__pagination').hide();
|
||||||
$(".joe_video__pagination").show()
|
$('.joe_video__pagination').show();
|
||||||
let htmlStr = '';
|
let htmlStr = '';
|
||||||
if (queryData.pg != 1) {
|
if (queryData.pg != 1) {
|
||||||
htmlStr += `
|
htmlStr += `
|
||||||
@ -106,7 +95,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
if (queryData.pg < pagecount) htmlStr += `<li class="joe_video__pagination-item" data-pg="${pagecount}">末页</li>`;
|
if (queryData.pg < pagecount) htmlStr += `<li class="joe_video__pagination-item" data-pg="${pagecount}">末页</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');
|
||||||
if (!pg || isLoading) return;
|
if (!pg || isLoading) return;
|
||||||
@ -114,7 +102,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
queryData.pg = Number(pg);
|
queryData.pg = Number(pg);
|
||||||
renderDom();
|
renderDom();
|
||||||
});
|
});
|
||||||
/* 搜索功能 */
|
|
||||||
const searchFn = () => {
|
const searchFn = () => {
|
||||||
const val = $('.joe_video__list-search input').val();
|
const val = $('.joe_video__list-search input').val();
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
@ -127,7 +114,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
$('.joe_video__list-search .button').on('click', searchFn);
|
$('.joe_video__list-search .button').on('click', searchFn);
|
||||||
$('.joe_video__list-search .input').on('keyup', e => e.keyCode === 13 && searchFn());
|
$('.joe_video__list-search .input').on('keyup', e => e.keyCode === 13 && searchFn());
|
||||||
}
|
}
|
||||||
/* 初始化播放页 */
|
|
||||||
function initVideoDetail() {
|
function initVideoDetail() {
|
||||||
const player = $('.joe_video__player-play').attr('data-player');
|
const player = $('.joe_video__player-play').attr('data-player');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -203,5 +189,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
return '暂无简介';
|
return '暂无简介';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.timeEnd('Video.js执行时长');
|
|
||||||
});
|
});
|
||||||
|
@ -1,71 +1,59 @@
|
|||||||
/* 壁纸页面需要用到的JS */
|
|
||||||
console.time('Wallpaper.js执行时长')
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
/* 是否正在请求 */
|
let isLoading = false;
|
||||||
let isLoading = false
|
let queryData = { cid: -999, start: -999, count: 30 };
|
||||||
/* 查询字段 */
|
let total = -999;
|
||||||
let queryData = { cid: -999, start: -999, count: 30 }
|
$.ajax({
|
||||||
/* 总页数 */
|
url: Joe.BASE_API,
|
||||||
let total = -999
|
type: 'POST',
|
||||||
/* 获取壁纸分类 */
|
data: { routeType: 'wallpaper_type' },
|
||||||
$.ajax({
|
success(res) {
|
||||||
url: Joe.BASE_API,
|
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>');
|
||||||
type: 'POST',
|
if (!res.data.length) return $('.joe_wallpaper__type-list').html(`<li class="error">暂无数据!</li>`);
|
||||||
data: { routeType: 'wallpaper_type' },
|
let htmlStr = '';
|
||||||
success(res) {
|
res.data.forEach(_ => (htmlStr += `<li class="item animated swing" data-cid="${_.id}">${_.name}</li>`));
|
||||||
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>')
|
$('.joe_wallpaper__type-list').html(htmlStr);
|
||||||
if (!res.data.length) return $('.joe_wallpaper__type-list').html(`<li class="error">暂无数据!</li>`)
|
$('.joe_wallpaper__type-list .item').first().click();
|
||||||
let htmlStr = ''
|
}
|
||||||
res.data.forEach(_ => (htmlStr += `<li class="item animated swing" data-cid="${_.id}">${_.name}</li>`))
|
});
|
||||||
$('.joe_wallpaper__type-list').html(htmlStr)
|
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
||||||
$('.joe_wallpaper__type-list .item').first().click()
|
const cid = $(this).attr('data-cid');
|
||||||
}
|
if (queryData.cid === cid || isLoading) return;
|
||||||
})
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
/* 切换类目 */
|
$(this).addClass('active').siblings().removeClass('active');
|
||||||
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
queryData.cid = cid;
|
||||||
const cid = $(this).attr('data-cid')
|
queryData.start = 0;
|
||||||
if (queryData.cid === cid || isLoading) return
|
renderDom();
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
});
|
||||||
$(this).addClass('active').siblings().removeClass('active')
|
function renderDom() {
|
||||||
queryData.cid = cid
|
$('.joe_wallpaper__list').html('');
|
||||||
queryData.start = 0
|
isLoading = true;
|
||||||
renderDom()
|
$.ajax({
|
||||||
})
|
url: Joe.BASE_API,
|
||||||
|
type: 'POST',
|
||||||
/* 渲染DOM */
|
data: {
|
||||||
function renderDom() {
|
routeType: 'wallpaper_list',
|
||||||
$('.joe_wallpaper__list').html('')
|
cid: queryData.cid,
|
||||||
isLoading = true
|
start: queryData.start,
|
||||||
$.ajax({
|
count: queryData.count
|
||||||
url: Joe.BASE_API,
|
},
|
||||||
type: 'POST',
|
success(res) {
|
||||||
data: {
|
if (res.code !== 1) return;
|
||||||
routeType: 'wallpaper_list',
|
let htmlStr = '';
|
||||||
cid: queryData.cid,
|
res.data.forEach(_ => {
|
||||||
start: queryData.start,
|
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>`;
|
||||||
count: queryData.count
|
});
|
||||||
},
|
$('.joe_wallpaper__list').html(htmlStr);
|
||||||
success(res) {
|
new LazyLoad('.wallpaper_lazyload');
|
||||||
if (res.code !== 1) return
|
total = res.total;
|
||||||
let htmlStr = ''
|
initPagination();
|
||||||
res.data.forEach(_ => {
|
},
|
||||||
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>`
|
complete: () => (isLoading = false)
|
||||||
})
|
});
|
||||||
$('.joe_wallpaper__list').html(htmlStr)
|
}
|
||||||
new LazyLoad('.wallpaper_lazyload')
|
function initPagination() {
|
||||||
total = res.total
|
let htmlStr = '';
|
||||||
initPagination()
|
if (queryData.start / queryData.count !== 0) {
|
||||||
},
|
htmlStr += `
|
||||||
complete: () => (isLoading = false)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 初始化分页 */
|
|
||||||
function initPagination() {
|
|
||||||
let htmlStr = ''
|
|
||||||
if (queryData.start / queryData.count !== 0) {
|
|
||||||
htmlStr += `
|
|
||||||
<li class="joe_wallpaper__pagination-item" data-start="0">首页</li>
|
<li class="joe_wallpaper__pagination-item" data-start="0">首页</li>
|
||||||
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}">
|
<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">
|
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="12" height="12">
|
||||||
@ -73,31 +61,27 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
</svg>
|
</svg>
|
||||||
</li>
|
</li>
|
||||||
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start - queryData.count}">${Math.ceil(queryData.start / queryData.count)}</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>`
|
htmlStr += `<li class="joe_wallpaper__pagination-item active">${Math.ceil(queryData.start / queryData.count) + 1}</li>`;
|
||||||
if (queryData.start != total - queryData.count) {
|
if (queryData.start != total - queryData.count) {
|
||||||
htmlStr += `
|
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}">${Math.ceil(queryData.start / queryData.count) + 2}</li>
|
||||||
<li class="joe_wallpaper__pagination-item" data-start="${queryData.start + queryData.count}">
|
<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">
|
<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>
|
<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>
|
</svg>
|
||||||
</li>
|
</li>
|
||||||
`
|
`;
|
||||||
}
|
}
|
||||||
if (queryData.start < total - queryData.count) htmlStr += `<li class="joe_wallpaper__pagination-item" data-start="${total - queryData.count}">末页</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').html(htmlStr);
|
||||||
}
|
}
|
||||||
|
$('.joe_wallpaper__pagination').on('click', '.joe_wallpaper__pagination-item', function () {
|
||||||
/* 切换分页 */
|
const start = $(this).attr('data-start');
|
||||||
$('.joe_wallpaper__pagination').on('click', '.joe_wallpaper__pagination-item', function () {
|
if (!start || isLoading) return;
|
||||||
const start = $(this).attr('data-start')
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
if (!start || isLoading) return
|
queryData.start = Number(start);
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
renderDom();
|
||||||
queryData.start = Number(start)
|
});
|
||||||
renderDom()
|
});
|
||||||
})
|
|
||||||
|
|
||||||
console.timeEnd('Wallpaper.js执行时长')
|
|
||||||
})
|
|
||||||
|
@ -26,7 +26,7 @@ function _parseContent($post, $login)
|
|||||||
function _parseCommentReply($text)
|
function _parseCommentReply($text)
|
||||||
{
|
{
|
||||||
$text = _parseReply($text);
|
$text = _parseReply($text);
|
||||||
$text = preg_replace('/\{!{(.*?)\}!}/', '<img src="$1" class="draw_image"/>', $text);
|
$text = preg_replace('/\{!{(.*?)\}!}/', '<img src="$1" class="draw_image" alt="画图"/>', $text);
|
||||||
echo $text;
|
echo $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
31
live.php
31
live.php
@ -24,18 +24,29 @@
|
|||||||
<?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_live__type">
|
<!-- 播放页 -->
|
||||||
<div class="joe_live__type-title">
|
<?php if (isset($_GET['profileRoom'])) : ?>
|
||||||
<div class="text">直播分类</div>
|
<div class="joe_live__contain joe_live__play">
|
||||||
<svg class="icon" viewBox="0 0 1229 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="15" height="15">
|
<div class="joe_live__contain-title joe_live__play-title">正在播放:<?php echo $_GET['title'] ?></div>
|
||||||
<path d="M292.64896 475.648a51.4048 51.4048 0 1 1-72.704 72.704l-204.8-204.8a51.2 51.2 0 0 1 0-72.704l204.8-204.8a51.4048 51.4048 0 1 1 72.704 72.704L123.68896 307.2l168.96 168.448zM51.49696 358.4a51.2 51.2 0 0 1 0-102.4h614.4a51.2 51.2 0 0 1 0 102.4h-614.4z m885.248 189.952a51.4048 51.4048 0 1 1 72.704-72.704l204.8 204.8a51.2 51.2 0 0 1 0 72.704l-204.8 204.8a51.4048 51.4048 0 1 1-72.704-72.704L1105.70496 716.8l-168.96-168.448zM1177.89696 665.6a51.2 51.2 0 1 1 0 102.4h-614.4a51.2 51.2 0 0 1 0-102.4h614.4z" p-id="12828"></path>
|
<?php ini_set('user_agent', 'Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'); ?>
|
||||||
</svg>
|
<iframe class="joe_live__play-player" src="<?php echo 'https://liveshare.huya.com/iframe/' . $_GET['profileRoom'] ?>"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<div class="joe_live__type-list">
|
<?php else : ?>
|
||||||
<li class="error">正在拼命加载中...</li>
|
<!-- 列表页 -->
|
||||||
|
<div class="joe_live__type joe_live__contain">
|
||||||
|
<div class="joe_live__type-title joe_live__contain-title">
|
||||||
|
<div class="text">直播分类</div>
|
||||||
|
<svg class="icon" viewBox="0 0 1229 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="15" height="15">
|
||||||
|
<path d="M292.64896 475.648a51.4048 51.4048 0 1 1-72.704 72.704l-204.8-204.8a51.2 51.2 0 0 1 0-72.704l204.8-204.8a51.4048 51.4048 0 1 1 72.704 72.704L123.68896 307.2l168.96 168.448zM51.49696 358.4a51.2 51.2 0 0 1 0-102.4h614.4a51.2 51.2 0 0 1 0 102.4h-614.4z m885.248 189.952a51.4048 51.4048 0 1 1 72.704-72.704l204.8 204.8a51.2 51.2 0 0 1 0 72.704l-204.8 204.8a51.4048 51.4048 0 1 1-72.704-72.704L1105.70496 716.8l-168.96-168.448zM1177.89696 665.6a51.2 51.2 0 1 1 0 102.4h-614.4a51.2 51.2 0 0 1 0-102.4h614.4z" p-id="12828"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="joe_live__type-list">
|
||||||
|
<li class="error">正在拼命加载中...</li>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="joe_live__list"></div>
|
||||||
<div class="joe_live__list"></div>
|
<ul class="joe_live__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