收藏夹功能开发完毕
This commit is contained in:
Binary file not shown.
@@ -231,4 +231,9 @@ export async function SendBiliPOST(url, body, type, content_type){
|
||||
export function GetCSRF(){
|
||||
console.log("Current CSRF: " + bili_jct)
|
||||
return bili_jct
|
||||
}
|
||||
|
||||
export async function GetVideoInfoByID(id){
|
||||
var ret = await SendBiliGET("https://api.bilibili.com/x/web-interface/view?aid=" + id,"json")
|
||||
return ret.data
|
||||
}
|
||||
@@ -53,6 +53,15 @@
|
||||
},
|
||||
"pages/textshow": {
|
||||
"component": "textshow"
|
||||
},
|
||||
"pages/myfolders": {
|
||||
"component": "myfolders"
|
||||
},
|
||||
"pages/foldercontent": {
|
||||
"component": "foldercontent"
|
||||
},
|
||||
"pages/history": {
|
||||
"component": "history"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="foldercontent-page">
|
||||
<div class="content" style="margin-top: 60px" @click="OpenFolderContent(0)">
|
||||
<image class="content_image" src="{{favlist.data.medias[0].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[0].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[0].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 200px" @click="OpenFolderContent(1)">
|
||||
<image class="content_image" src="{{favlist.data.medias[1].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[1].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[1].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 340px" @click="OpenFolderContent(2)">
|
||||
<image class="content_image" src="{{favlist.data.medias[2].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[2].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[2].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 480px" @click="OpenFolderContent(3)">
|
||||
<image class="content_image" src="{{favlist.data.medias[3].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[3].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[3].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 620px" @click="OpenFolderContent(4)">
|
||||
<image class="content_image" src="{{favlist.data.medias[4].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[4].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[4].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 760px" @click="OpenFolderContent(5)">
|
||||
<image class="content_image" src="{{favlist.data.medias[5].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[5].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[5].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 900px" @click="OpenFolderContent(6)">
|
||||
<image class="content_image" src="{{favlist.data.medias[6].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[6].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[6].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 1040px" @click="OpenFolderContent(7)">
|
||||
<image class="content_image" src="{{favlist.data.medias[7].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[7].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[7].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 1180px" @click="OpenFolderContent(8)">
|
||||
<image class="content_image" src="{{favlist.data.medias[8].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[8].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[8].upper.name}}</text>
|
||||
</div>
|
||||
<div class="content" style="margin-top: 1320px" @click="OpenFolderContent(9)">
|
||||
<image class="content_image" src="{{favlist.data.medias[9].cover}}@100w_80h" alt="/common/icons8-loading-96.png"></image>
|
||||
<text class="content_title">{{favlist.data.medias[9].title}}</text>
|
||||
<text class="content_up_name">UP: {{favlist.data.medias[9].upper.name}}</text>
|
||||
</div>
|
||||
<div class="pagecontrol">
|
||||
<input type="button" value="上一页" style="font-size: 22px; width: 90px; height: 40px" @click="BackPage()"></input>
|
||||
<text style="width: 30px;"> </text>
|
||||
<text style="color: white; font-size: 24px">{{pn}}/{{maxpn}}</text>
|
||||
<text style="width: 30px;"> </text>
|
||||
<input type="button" value="下一页" style="font-size: 22px; width: 90px; height: 40px" @click="NextPage()"></input>
|
||||
</div>
|
||||
<text style="height: 50px; margin-top: 1620px"></text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import prompt from '@system.prompt'
|
||||
import router from '@system.router'
|
||||
export default{
|
||||
public:{
|
||||
media_id: 0
|
||||
},
|
||||
private: {
|
||||
favlist: null,
|
||||
pn: 1,
|
||||
maxpn: 1,
|
||||
ifInterval: null,
|
||||
async UpdateFavList(){
|
||||
this.favlist = await this.$app.$def.bilirequest.SendBiliGET("https://api.bilibili.com/x/v3/fav/resource/list?" + "media_id=" + this.media_id + "&ps=10&pn=" + this.pn,"json")
|
||||
},
|
||||
BackPage(){
|
||||
if(this.pn < 2){
|
||||
prompt.showToast({
|
||||
message: "已经到头啦!"
|
||||
})
|
||||
}
|
||||
else{
|
||||
this.pn = this.pn - 1
|
||||
this.UpdateFavList()
|
||||
}
|
||||
},
|
||||
NextPage(){
|
||||
if(this.pn >= this.maxpn){
|
||||
prompt.showToast({
|
||||
message: "已经到底啦!"
|
||||
})
|
||||
}
|
||||
else{
|
||||
this.pn = this.pn + 1
|
||||
this.UpdateFavList()
|
||||
}
|
||||
},
|
||||
async OpenFolderContent(id){
|
||||
if(this.favlist.data.medias[id].type == 2){
|
||||
var vid_info = await this.$app.$def.bilirequest.GetVideoInfoByID(this.favlist.data.medias[id].id)
|
||||
router.push({
|
||||
uri: "pages/videodetail",
|
||||
params: {
|
||||
img_src: vid_info.pic,
|
||||
vid_title: vid_info.title,
|
||||
bv: vid_info.bvid,
|
||||
cid: vid_info.cid,
|
||||
up_mid: vid_info.owner.mid,
|
||||
id: vid_info.aid
|
||||
}
|
||||
})
|
||||
}
|
||||
else{
|
||||
prompt.showToast({
|
||||
message: "目标稿件不是视频稿件,目前暂不支持除视频外的稿件"
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
onInit(){
|
||||
this.UpdateFavList()
|
||||
this.ifInterval = setInterval(() => {
|
||||
if(this.favlist != null && this.favlist != undefined){
|
||||
if(this.favlist.data.info.media_count < 1){
|
||||
prompt.showToast({
|
||||
message: "该收藏夹为空!!!",
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
else if(this.favlist.data.info.media_count < 10){
|
||||
prompt.showToast({
|
||||
message: "收藏夹内容较少,如果在一条正常的收藏下发现接下来的所有收藏全部没加载出来,就是没东西啦!",
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
this.maxpn = Math.ceil(this.favlist.data.info.media_count / 10)
|
||||
clearInterval(this.ifInterval)
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.foldercontent-page{
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
}
|
||||
.content{
|
||||
background-color: rgba(255, 255, 255, 0.178);
|
||||
border-radius: 25px;
|
||||
width: 80%;
|
||||
height: 130px;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.content_image{
|
||||
margin-left: 25px;
|
||||
width: 100.6px;
|
||||
height: 80.6px;
|
||||
border-radius: 10px;
|
||||
min-width: 100.6px;
|
||||
min-height: 80.6px;
|
||||
}
|
||||
.content_title{
|
||||
width: 90%;
|
||||
height: 70%;
|
||||
font-size: 16px;
|
||||
color: white;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.content_up_name{
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
position: absolute;
|
||||
top: 102px;
|
||||
margin-left: 146px;
|
||||
}
|
||||
.pagecontrol{
|
||||
position: absolute;
|
||||
margin-top: 1440px;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div class="history-page">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.history-page{
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
@@ -18,7 +18,7 @@
|
||||
<text class="feature_text">观看历史</text>
|
||||
<text class="feature_arrow">></text>
|
||||
</div>
|
||||
<div class="feature" style="margin-top: 160px" @click="ShowWIP()">
|
||||
<div class="feature" style="margin-top: 160px" @click="OpenMyFoldersPage()">
|
||||
<div class="feature_icon_div">
|
||||
<image class="feature_icon" src="/common/icons8-star-96.png"></image>
|
||||
</div>
|
||||
@@ -97,6 +97,11 @@ export default {
|
||||
prompt.showToast({
|
||||
message: "该功能还未开发完毕,请更新版本后再来看看吧!"
|
||||
})
|
||||
},
|
||||
OpenMyFoldersPage(){
|
||||
router.push({
|
||||
uri: "pages/myfolders"
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="myfolders-page">
|
||||
<text style="margin-top: 70px; position:absolute; color:white; font-size: 28px;">收藏夹列表</text>
|
||||
<div class="folder" style="margin-top: 150px;" @click="OpenFolder(div1_showid)">
|
||||
<text class="folder_name">{{GetFolderByID(div1_showid).title}} ></text>
|
||||
</div>
|
||||
<div class="folder" style="margin-top: 260px;" show="{{show_div2}}" @click="OpenFolder(div2_showid)">
|
||||
<text class="folder_name">{{GetFolderByID(div2_showid).title}} ></text>
|
||||
</div>
|
||||
<div class="pagecontrol" show="{{show_page_control}}">
|
||||
<input type="button" value="上一页" style="font-size: 22px; width: 90px; height: 40px" @click="BackPage()"></input>
|
||||
<text style="width: 30px;"> </text>
|
||||
<text style="color: white; font-size: 24px">{{pn}}/{{maxpn}}</text>
|
||||
<text style="width: 30px;"> </text>
|
||||
<input type="button" value="下一页" style="font-size: 22px; width: 90px; height: 40px" @click="NextPage()"></input>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import prompt from '@system.prompt'
|
||||
import router from '@system.router'
|
||||
export default{
|
||||
private:{
|
||||
show_page_control: true,
|
||||
show_div2: true,
|
||||
pn: 1,
|
||||
maxpn: 1,
|
||||
div1_showid: 0,
|
||||
div2_showid: 1,
|
||||
SetVar(){
|
||||
if(this.$app.$def.folders_info.data.count < 3){
|
||||
this.show_page_control = false
|
||||
}
|
||||
this.maxpn = this.maxpn = Math.ceil(this.$app.$def.folders_info.data.count / 2)
|
||||
this.SetPageContent()
|
||||
},
|
||||
BackPage(){
|
||||
if(this.pn > 1){
|
||||
this.pn --
|
||||
this.div1_showid -= 2
|
||||
this.div2_showid -= 2
|
||||
this.SetPageContent()
|
||||
}
|
||||
else{
|
||||
prompt.showToast({
|
||||
message: "已经到头啦!"
|
||||
})
|
||||
}
|
||||
},
|
||||
NextPage(){
|
||||
if(this.pn < this.maxpn){
|
||||
this.pn ++
|
||||
this.div1_showid += 2
|
||||
this.div2_showid += 2
|
||||
this.SetPageContent()
|
||||
}
|
||||
else{
|
||||
prompt.showToast({
|
||||
message: "已经到底啦!"
|
||||
})
|
||||
}
|
||||
},
|
||||
OpenFolder(id){
|
||||
router.push({
|
||||
uri: "pages/foldercontent",
|
||||
params: {
|
||||
media_id: this.GetFolderByID(id).id
|
||||
}
|
||||
})
|
||||
},
|
||||
SetPageContent(){
|
||||
if(this.div2_showid == this.$app.$def.folders_info.data.count){
|
||||
this.show_div2 = false
|
||||
}
|
||||
else{
|
||||
this.show_div2 = true
|
||||
}
|
||||
},
|
||||
GetFolderByID(id){
|
||||
return this.$app.$def.folders_info.data.list[id]
|
||||
}
|
||||
},
|
||||
onInit(){
|
||||
this.SetVar()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.myfolders-page{
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
}
|
||||
.folder{
|
||||
height: 80px;
|
||||
width: 75%;
|
||||
background-color: rgba(255, 255, 255, 0.178);
|
||||
border-radius: 30px;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
}
|
||||
.folder_name{
|
||||
position: absolute;
|
||||
margin-left: 50px;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
}
|
||||
.pagecontrol{
|
||||
position: absolute;
|
||||
margin-top: 220px;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 370px;
|
||||
}
|
||||
</style>
|
||||
@@ -112,7 +112,7 @@ export default{
|
||||
if(this.sec_reply_info.data.page.count < 5 || this.sec_reply_info.data.page.size < 5){
|
||||
prompt.showToast({
|
||||
message: "评论条数较少,如果在一条正常的评论下发现接下来的所有评论全部没加载出来,就是没评论啦!",
|
||||
duration: 5000
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
this.maxpn = Math.ceil(this.sec_reply_info.data.page.count / 5)
|
||||
|
||||
@@ -31,7 +31,7 @@ export default{
|
||||
margin-top: 130px;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
width: 75%;
|
||||
color: white;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<script>
|
||||
export default{
|
||||
public:{
|
||||
img_src: "",
|
||||
bv: "",
|
||||
cid: "",
|
||||
up_mid: ""
|
||||
up_mid: "",
|
||||
haplink: false
|
||||
},
|
||||
private: {
|
||||
AI_TEXT: "加载中...若长时间未加载出来可以尝试重启应用程序",
|
||||
@@ -21,6 +21,9 @@ export default{
|
||||
SummaryTypeFXInterval: null,
|
||||
TypeFXIndex: 0,
|
||||
async MainInit(){
|
||||
if(this.haplink){
|
||||
await this.$app.$def.bilirequest.InitBiliRequest(false)
|
||||
}
|
||||
var ai_ret = await this.$app.$def.bilirequest.SendWbiGET("https://api.bilibili.com/x/web-interface/view/conclusion/get","json",{
|
||||
bvid: this.bv,
|
||||
cid: this.cid,
|
||||
|
||||
@@ -30,7 +30,8 @@ export default{
|
||||
bv: "",
|
||||
cid: "",
|
||||
up_mid: "",
|
||||
id: ""
|
||||
id: "",
|
||||
haplink: false
|
||||
},
|
||||
private: {
|
||||
likesrc: "/common/icons8-loading-96.png",
|
||||
@@ -71,7 +72,6 @@ export default{
|
||||
router.push({
|
||||
uri: "pages/videoaisummary",
|
||||
params: {
|
||||
img_src: this.img_src,
|
||||
bv: this.bv,
|
||||
cid: this.cid,
|
||||
up_mid: this.up_mid
|
||||
@@ -135,10 +135,16 @@ export default{
|
||||
}
|
||||
this.InitThirdClickBtn()
|
||||
},
|
||||
|
||||
onInit(){
|
||||
async AsyncInit(){
|
||||
if(this.haplink){
|
||||
await this.$app.$def.bilirequest.InitBiliRequest(false)
|
||||
}
|
||||
this.csrf = this.$app.$def.bilirequest.GetCSRF()
|
||||
this.InitThirdClickBtn()
|
||||
},
|
||||
|
||||
onInit(){
|
||||
this.AsyncInit()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -151,7 +151,7 @@ export default{
|
||||
if(this.reply_info.data.page.count < 10 || this.reply_info.data.page.size < 10){
|
||||
prompt.showToast({
|
||||
message: "评论条数较少,如果在一条正常的评论下发现接下来的所有评论全部没加载出来,就是没评论啦!",
|
||||
duration: 5000
|
||||
duration: 10000
|
||||
})
|
||||
}
|
||||
this.maxpn = Math.ceil(this.reply_info.data.page.acount / 10)
|
||||
|
||||
Reference in New Issue
Block a user