添加kg源评论图片展示

pull/1066/head
lyswhut 2022-11-29 09:32:19 +08:00
parent c695c00e76
commit c6087f577d
3 changed files with 26 additions and 8 deletions

View File

@ -22,6 +22,7 @@
- 添加kg源罗马音歌词的支持
- 支持打开波点音乐歌单(需在酷我源打开)
- 新增设置-基本设置-播放栏进度条样式设置(此版本默认使用迷你进度条样式,对于某些不喜欢该样式的人可以将其换成其他样式)
- 添加kg源评论图片展示感谢 彭狸花喵)
### 优化(界面/交互/功能)

View File

@ -8,13 +8,16 @@ div(:class="$style.container")
div(:class="$style.right")
div(:class="$style.info")
div.select(:class="$style.name") {{item.userName}}
time(:class="$style.time" v-if="item.timeStr") {{timeFormat(item.timeStr)}}
time(:class="$style.label" v-if="item.timeStr") {{timeFormat(item.timeStr)}}
div(:class="$style.label" v-if="item.location") {{item.location}}
div(:class="$style.likes" v-if="item.likedCount != null")
svg(:class="$style.likesIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512' space='preserve')
use(xlink:href='#icon-thumbs-up')
| {{item.likedCount}}
div.select(:class="$style.comment_text")
p(v-for="text in item.text") {{text}}
div(v-if="item.images?.length" :class="$style.comment_images")
img(v-for="url in item.images" :src="url")
comment-floor(v-if="item.reply && item.reply.length" :class="$style.reply_floor" :comments="item.reply")
</template>
@ -87,17 +90,19 @@ export default {
align-items: flex-end;
min-width: 0;
line-height: 1.3;
color: var(--color-font-label);
gap: 6px;
}
.name {
flex: 0 1 auto;
min-width: 0;
.mixin-ellipsis-1;
color: var(--color-400);
}
.time {
.label {
flex: none;
font-size: 11px;
margin-left: 5px;
font-size: 12px;
// margin-left: 5px;
color: var(--color-200);
}
.likes {
flex: 1 0 auto;
@ -122,6 +127,16 @@ export default {
overflow-wrap: break-word;
}
}
.comment_images {
display: flex;
flex-flow: row wrap;
gap: 5px;
margin-top: 5px;
img {
max-width: 240px;
}
}
.reply_floor {
padding: 0 0 0 @padding;

View File

@ -7,7 +7,7 @@ export default {
async getComment({ hash }, page = 1, limit = 20) {
if (this._requestObj) this._requestObj.cancelHttp()
const _requestObj = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getCommentWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&extdata=${hash}&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&appid=1001&kugouid=687373022`, {
const _requestObj = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getCommentWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&extdata=${hash}&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&appid=1001&kugouid=687373022&need_show_image=1`, {
headers: {
'User-Agent': 'Android712-AndroidPhone-8983-18-0-COMMENT-wifi',
},
@ -21,7 +21,7 @@ export default {
// console.log(songmid)
if (this._requestObj2) this._requestObj2.cancelHttp()
const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getCommentWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&extdata=${hash}&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&appid=1001&kugouid=687373022`, {
const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getCommentWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&extdata=${hash}&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&appid=1001&kugouid=687373022&need_show_image=1`, {
headers: {
'User-Agent': 'Android712-AndroidPhone-8983-18-0-COMMENT-wifi',
},
@ -39,7 +39,7 @@ export default {
? audioId.split('_')[0]
: songmid
const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getReplyWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&kugouid=687373022&appid=1001&childrenid=${songmid}&tid=${replyId}`, {
const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getReplyWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&kugouid=687373022&need_show_image=1&appid=1001&childrenid=${songmid}&tid=${replyId}`, {
headers: {
'User-Agent': 'Android712-AndroidPhone-8983-18-0-COMMENT-wifi',
},
@ -54,6 +54,8 @@ export default {
let data = {
id: item.id,
text: decodeName(item.content || '').split('\n'),
images: item.images ? item.images.map(i => i.url) : [],
location: item.location,
time: item.addtime,
timeStr: dateFormat2(new Date(item.addtime).getTime()),
userName: item.user_name,