更新
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 {
|
||||
&__type {
|
||||
&__contain {
|
||||
position: relative;
|
||||
background: var(--background);
|
||||
border-radius: var(--radius-wrap);
|
||||
box-shadow: var(--box-shadow);
|
||||
padding: 60px 15px 15px;
|
||||
margin-bottom: 15px;
|
||||
&-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -18,17 +17,11 @@
|
||||
box-shadow: 2px 5px 10px rgba(49, 58, 70, 0.15);
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 8px 0 12px;
|
||||
padding: 0 12px;
|
||||
border-radius: 2px 2px 2px 0;
|
||||
user-select: none;
|
||||
.icon {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
fill: #fff;
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
&::before {
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
@ -39,6 +32,19 @@
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
&__type {
|
||||
margin-bottom: 15px;
|
||||
&-title {
|
||||
padding-right: 8px;
|
||||
.icon {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
fill: #fff;
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
&-list {
|
||||
display: grid;
|
||||
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;
|
||||
border: none;
|
||||
margin: 0 auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
textarea {
|
||||
|
File diff suppressed because one or more lines are too long
@ -72,7 +72,6 @@
|
||||
}
|
||||
}
|
||||
&__list {
|
||||
margin-bottom: 15px;
|
||||
&-item {
|
||||
display: grid;
|
||||
gap: 15px;
|
||||
@ -201,6 +200,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding-top: 15px;
|
||||
&-item {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
|
File diff suppressed because one or more lines are too long
@ -72,7 +72,6 @@
|
||||
&__list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
margin-bottom: 15px;
|
||||
.item {
|
||||
position: relative;
|
||||
display: block;
|
||||
@ -139,6 +138,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding-top: 15px;
|
||||
&-item {
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
|
@ -1,6 +1,3 @@
|
||||
/* 全局公用JS */
|
||||
console.time('Global.js执行时长');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
/* 初始化昼夜模式 */
|
||||
{
|
||||
@ -333,6 +330,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
/* 懒加载 */
|
||||
new LazyLoad('.lazyload');
|
||||
|
||||
console.timeEnd('Global.js执行时长');
|
||||
});
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* 首页需要用到的JS */
|
||||
console.time('Index.js执行时长');
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
/* 激活轮播图功能 */
|
||||
{
|
||||
@ -115,6 +113,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
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();
|
||||
}
|
||||
|
||||
console.timeEnd('Index.js执行时长');
|
||||
});
|
||||
|
@ -1,32 +1,20 @@
|
||||
/* 直播页面需要用到JS */
|
||||
console.time('Live.js执行时长');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const p = new URLSearchParams(window.location.search);
|
||||
const gameId = p.get('gameId');
|
||||
if (gameId) {
|
||||
} else {
|
||||
initLiveList();
|
||||
}
|
||||
|
||||
/* 初始化直播列表 */
|
||||
if (!p.get('profileRoom')) initLiveList();
|
||||
function initLiveList() {
|
||||
let queryData = {
|
||||
page: 1,
|
||||
gameId: '',
|
||||
index: 0,
|
||||
isLoading: false
|
||||
isLoading: false,
|
||||
totalPage: 0
|
||||
};
|
||||
|
||||
/* 点击切换分类 */
|
||||
$('.joe_live__type-title .icon').on('click', function () {
|
||||
if (queryData.isLoading) return;
|
||||
if (queryData.index === 3) queryData.index = 0;
|
||||
queryData.index++;
|
||||
renderLiveType();
|
||||
});
|
||||
|
||||
/* 分类列表点击事件 */
|
||||
$('.joe_live__type-list').on('click', '.item', function () {
|
||||
if (queryData.isLoading) return;
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
@ -34,8 +22,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
queryData.gameId = $(this).attr('data-gameId');
|
||||
renderLiveList();
|
||||
});
|
||||
|
||||
/* 渲染分类 */
|
||||
renderLiveType();
|
||||
function renderLiveType() {
|
||||
$.ajax({
|
||||
@ -50,8 +36,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* 渲染列表 */
|
||||
function renderLiveList() {
|
||||
queryData.isLoading = true;
|
||||
$('.joe_live__list').html('');
|
||||
@ -68,7 +52,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
let htmlStr = '';
|
||||
res.data.datas.forEach(_ => {
|
||||
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">
|
||||
<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}" />
|
||||
@ -95,16 +79,49 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
$('.joe_live__list').html(htmlStr);
|
||||
new LazyLoad('.screenshot_lazyload');
|
||||
queryData.totalPage = res.data.totalPage;
|
||||
initPagination();
|
||||
},
|
||||
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) {
|
||||
if (num >= 10000) return Math.round(num / 1000) / 10 + '万';
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
console.timeEnd('Live.js执行时长');
|
||||
});
|
||||
|
@ -1,6 +1,3 @@
|
||||
/* 详情页和独立页面需要用到的JS */
|
||||
console.time('Post&Page.js执行时长');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
/* 当前页的CID */
|
||||
const cid = $('.joe_detail').attr('data-cid');
|
||||
@ -144,8 +141,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
console.timeEnd('Post&Page.js执行时长');
|
||||
});
|
||||
|
||||
/* 写在load事件里,为了解决图片未加载完成,滚动距离获取会不准确的问题 */
|
||||
|
@ -1,6 +1,3 @@
|
||||
/* 视频页面需要用到JS */
|
||||
console.time('Video.js执行时长');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const p = new URLSearchParams(window.location.search);
|
||||
const vod_id = p.get('vod_id');
|
||||
@ -9,15 +6,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
} else {
|
||||
initVideoList();
|
||||
}
|
||||
/* 初始化列表页 */
|
||||
function initVideoList() {
|
||||
/* 当前的分类id */
|
||||
let queryData = { pg: '', t: '', wd: '' };
|
||||
/* 总页数 */
|
||||
let pagecount = '';
|
||||
/* 是否正在加载列表 */
|
||||
let isLoading = false;
|
||||
/* 获取视频分类 */
|
||||
$.ajax({
|
||||
url: Joe.BASE_API,
|
||||
type: 'POST',
|
||||
@ -31,7 +23,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
$('.joe_video__type-list .item').first().click();
|
||||
}
|
||||
});
|
||||
/* 点击切换分类 */
|
||||
$('.joe_video__type-list').on('click', '.item', function () {
|
||||
const t = $(this).attr('data-t');
|
||||
if (isLoading) return;
|
||||
@ -43,7 +34,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
$('.joe_video__list-search input').val('');
|
||||
renderDom();
|
||||
});
|
||||
/* 渲染视频列表 */
|
||||
function renderDom() {
|
||||
$('.joe_video__list-item').css('display', '').html('');
|
||||
isLoading = true;
|
||||
@ -76,10 +66,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
complete: () => (isLoading = false)
|
||||
});
|
||||
}
|
||||
/* 初始化分页 */
|
||||
function initPagination() {
|
||||
if(pagecount == 0) return $(".joe_video__pagination").hide()
|
||||
$(".joe_video__pagination").show()
|
||||
if (pagecount == 0) return $('.joe_video__pagination').hide();
|
||||
$('.joe_video__pagination').show();
|
||||
let htmlStr = '';
|
||||
if (queryData.pg != 1) {
|
||||
htmlStr += `
|
||||
@ -106,7 +95,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (queryData.pg < pagecount) htmlStr += `<li class="joe_video__pagination-item" data-pg="${pagecount}">末页</li>`;
|
||||
$('.joe_video__pagination').html(htmlStr);
|
||||
}
|
||||
/* 切换分页 */
|
||||
$('.joe_video__pagination').on('click', '.joe_video__pagination-item', function () {
|
||||
const pg = $(this).attr('data-pg');
|
||||
if (!pg || isLoading) return;
|
||||
@ -114,7 +102,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
queryData.pg = Number(pg);
|
||||
renderDom();
|
||||
});
|
||||
/* 搜索功能 */
|
||||
const searchFn = () => {
|
||||
const val = $('.joe_video__list-search input').val();
|
||||
if (isLoading) return;
|
||||
@ -127,7 +114,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
$('.joe_video__list-search .button').on('click', searchFn);
|
||||
$('.joe_video__list-search .input').on('keyup', e => e.keyCode === 13 && searchFn());
|
||||
}
|
||||
/* 初始化播放页 */
|
||||
function initVideoDetail() {
|
||||
const player = $('.joe_video__player-play').attr('data-player');
|
||||
$.ajax({
|
||||
@ -203,5 +189,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
return '暂无简介';
|
||||
}
|
||||
}
|
||||
console.timeEnd('Video.js执行时长');
|
||||
});
|
||||
|
@ -1,71 +1,59 @@
|
||||
/* 壁纸页面需要用到的JS */
|
||||
console.time('Wallpaper.js执行时长')
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
/* 是否正在请求 */
|
||||
let isLoading = false
|
||||
/* 查询字段 */
|
||||
let queryData = { cid: -999, start: -999, count: 30 }
|
||||
/* 总页数 */
|
||||
let total = -999
|
||||
/* 获取壁纸分类 */
|
||||
$.ajax({
|
||||
url: Joe.BASE_API,
|
||||
type: 'POST',
|
||||
data: { routeType: 'wallpaper_type' },
|
||||
success(res) {
|
||||
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>')
|
||||
if (!res.data.length) return $('.joe_wallpaper__type-list').html(`<li class="error">暂无数据!</li>`)
|
||||
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 .item').first().click()
|
||||
}
|
||||
})
|
||||
/* 切换类目 */
|
||||
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
||||
const cid = $(this).attr('data-cid')
|
||||
if (queryData.cid === cid || isLoading) return
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
$(this).addClass('active').siblings().removeClass('active')
|
||||
queryData.cid = cid
|
||||
queryData.start = 0
|
||||
renderDom()
|
||||
})
|
||||
|
||||
/* 渲染DOM */
|
||||
function renderDom() {
|
||||
$('.joe_wallpaper__list').html('')
|
||||
isLoading = true
|
||||
$.ajax({
|
||||
url: Joe.BASE_API,
|
||||
type: 'POST',
|
||||
data: {
|
||||
routeType: 'wallpaper_list',
|
||||
cid: queryData.cid,
|
||||
start: queryData.start,
|
||||
count: queryData.count
|
||||
},
|
||||
success(res) {
|
||||
if (res.code !== 1) return
|
||||
let htmlStr = ''
|
||||
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>`
|
||||
})
|
||||
$('.joe_wallpaper__list').html(htmlStr)
|
||||
new LazyLoad('.wallpaper_lazyload')
|
||||
total = res.total
|
||||
initPagination()
|
||||
},
|
||||
complete: () => (isLoading = false)
|
||||
})
|
||||
}
|
||||
|
||||
/* 初始化分页 */
|
||||
function initPagination() {
|
||||
let htmlStr = ''
|
||||
if (queryData.start / queryData.count !== 0) {
|
||||
htmlStr += `
|
||||
let isLoading = false;
|
||||
let queryData = { cid: -999, start: -999, count: 30 };
|
||||
let total = -999;
|
||||
$.ajax({
|
||||
url: Joe.BASE_API,
|
||||
type: 'POST',
|
||||
data: { routeType: 'wallpaper_type' },
|
||||
success(res) {
|
||||
if (res.code !== 1) return $('.joe_wallpaper__type-list').html('<li class="error">壁纸抓取失败!请联系作者!</li>');
|
||||
if (!res.data.length) return $('.joe_wallpaper__type-list').html(`<li class="error">暂无数据!</li>`);
|
||||
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 .item').first().click();
|
||||
}
|
||||
});
|
||||
$('.joe_wallpaper__type-list').on('click', '.item', function () {
|
||||
const cid = $(this).attr('data-cid');
|
||||
if (queryData.cid === cid || isLoading) return;
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
queryData.cid = cid;
|
||||
queryData.start = 0;
|
||||
renderDom();
|
||||
});
|
||||
function renderDom() {
|
||||
$('.joe_wallpaper__list').html('');
|
||||
isLoading = true;
|
||||
$.ajax({
|
||||
url: Joe.BASE_API,
|
||||
type: 'POST',
|
||||
data: {
|
||||
routeType: 'wallpaper_list',
|
||||
cid: queryData.cid,
|
||||
start: queryData.start,
|
||||
count: queryData.count
|
||||
},
|
||||
success(res) {
|
||||
if (res.code !== 1) return;
|
||||
let htmlStr = '';
|
||||
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>`;
|
||||
});
|
||||
$('.joe_wallpaper__list').html(htmlStr);
|
||||
new LazyLoad('.wallpaper_lazyload');
|
||||
total = res.total;
|
||||
initPagination();
|
||||
},
|
||||
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="${queryData.start - queryData.count}">
|
||||
<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>
|
||||
</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 += `
|
||||
`;
|
||||
}
|
||||
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 () {
|
||||
const start = $(this).attr('data-start')
|
||||
if (!start || isLoading) return
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
queryData.start = Number(start)
|
||||
renderDom()
|
||||
})
|
||||
|
||||
console.timeEnd('Wallpaper.js执行时长')
|
||||
})
|
||||
`;
|
||||
}
|
||||
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 () {
|
||||
const start = $(this).attr('data-start');
|
||||
if (!start || isLoading) return;
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
queryData.start = Number(start);
|
||||
renderDom();
|
||||
});
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ function _parseContent($post, $login)
|
||||
function _parseCommentReply($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;
|
||||
}
|
||||
|
||||
|
31
live.php
31
live.php
@ -24,18 +24,29 @@
|
||||
<?php $this->need('public/header.php'); ?>
|
||||
<div class="joe_container">
|
||||
<div class="joe_main">
|
||||
<div class="joe_live__type">
|
||||
<div class="joe_live__type-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>
|
||||
<!-- 播放页 -->
|
||||
<?php if (isset($_GET['profileRoom'])) : ?>
|
||||
<div class="joe_live__contain joe_live__play">
|
||||
<div class="joe_live__contain-title joe_live__play-title">正在播放:<?php echo $_GET['title'] ?></div>
|
||||
<?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'); ?>
|
||||
<iframe class="joe_live__play-player" src="<?php echo 'https://liveshare.huya.com/iframe/' . $_GET['profileRoom'] ?>"></iframe>
|
||||
</div>
|
||||
<div class="joe_live__type-list">
|
||||
<li class="error">正在拼命加载中...</li>
|
||||
<?php else : ?>
|
||||
<!-- 列表页 -->
|
||||
<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 class="joe_live__list"></div>
|
||||
<div class="joe_live__list"></div>
|
||||
<ul class="joe_live__pagination"></ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php $this->need('public/aside.php'); ?>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user