${_.recommendTagName}
@@ -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 += `
+
+
+
+ `;
+ }
+ htmlStr += ``;
+ if (queryData.page != queryData.totalPage) {
+ htmlStr += `
+
+
+ `;
+ }
+ if (queryData.page < queryData.totalPage) htmlStr += ``;
+ $('.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执行时长');
});
diff --git a/assets/js/joe.post&page.js b/assets/js/joe.post&page.js
index b730377..0081477 100644
--- a/assets/js/joe.post&page.js
+++ b/assets/js/joe.post&page.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事件里,为了解决图片未加载完成,滚动距离获取会不准确的问题 */
diff --git a/assets/js/joe.video.js b/assets/js/joe.video.js
index a0ee137..dfd65bf 100644
--- a/assets/js/joe.video.js
+++ b/assets/js/joe.video.js
@@ -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 += ``;
$('.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执行时长');
});
diff --git a/assets/js/joe.wallpaper.js b/assets/js/joe.wallpaper.js
index 3b5e53c..7ed8ef6 100644
--- a/assets/js/joe.wallpaper.js
+++ b/assets/js/joe.wallpaper.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('
壁纸抓取失败!请联系作者!')
- if (!res.data.length) return $('.joe_wallpaper__type-list').html(`
暂无数据!`)
- let htmlStr = ''
- res.data.forEach(_ => (htmlStr += `
${_.name}`))
- $('.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 += `
`
- })
- $('.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('
壁纸抓取失败!请联系作者!');
+ if (!res.data.length) return $('.joe_wallpaper__type-list').html(`
暂无数据!`);
+ let htmlStr = '';
+ res.data.forEach(_ => (htmlStr += `
${_.name}`));
+ $('.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 += `
`;
+ });
+ $('.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 += `
- `
- }
- htmlStr += ``
- if (queryData.start != total - queryData.count) {
- htmlStr += `
+ `;
+ }
+ htmlStr += ``;
+ if (queryData.start != total - queryData.count) {
+ htmlStr += `
- `
- }
- if (queryData.start < total - queryData.count) htmlStr += ``
- $('.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 += ``;
+ $('.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();
+ });
+});
diff --git a/core/parse.php b/core/parse.php
index 2cfeaa9..b8e384d 100644
--- a/core/parse.php
+++ b/core/parse.php
@@ -26,7 +26,7 @@ function _parseContent($post, $login)
function _parseCommentReply($text)
{
$text = _parseReply($text);
- $text = preg_replace('/\{!{(.*?)\}!}/', '
', $text);
+ $text = preg_replace('/\{!{(.*?)\}!}/', '
', $text);
echo $text;
}
diff --git a/live.php b/live.php
index 61393d6..3c701ef 100644
--- a/live.php
+++ b/live.php
@@ -24,18 +24,29 @@
need('public/header.php'); ?>
-
-
-
直播分类
-
+
+
+
-
-
+
+
+
need('public/aside.php'); ?>