@@ -163,7 +126,6 @@
import store from "../store";
import {computed, ref, onMounted} from "vue";
import {ElMessage} from "element-plus"
-import axios from "axios";
import HentaiSearch from "./HentaiSearch.vue";
//授权码相关
@@ -174,7 +136,6 @@ let newAuthCode = ref("")
let tempAuthCode = ref("")
let isQuerying = ref(false)
-let isViewingTag = ref(false)
let isConfig = ref(false)
let isDark = ref(false)
let keyword = ref("furry yaoi")
@@ -184,19 +145,15 @@ let lengthPerPage = ref(0)
//查询相关
let type = ref("link")
let param = ref("")
-let paramForTags = ref([]) //tidS
let targetResolution = ref("")
let targetDownloadMode = ref("")
-let tag = ref("")
-let tagKeyWord = ref("") //查询tag的关键字
let realAuthCode = computed(() => {
return store.state.AuthCode
})
let chosenGallery = computed(() => {
- paramForTags.value.splice(0)
param.value = ''
return store.state.chosenGallery
})
@@ -208,27 +165,8 @@ let loadComplete = computed(() => {
let weekUsed = computed(() => {
return store.state.weekUsed
})
-let tags = computed(() => {
- let tags = store.state.tags
- let result = []
- tags.forEach((tag) => {
- result.push(tag)
- })
-
- if(isViewingTag.value) { //正在查看标签
- if (tagKeyWord.value.trim() === '')
- return result
- else
- return result.filter((tag) => {
- return tag.tag.includes(tagKeyWord.value)
- })
- }
- return result
-})
let thumbnailGallery = computed(() => {
- if(store.state.thumbnailGallery.images === undefined)
- store.state.thumbnailGallery.images = []
return store.state.thumbnailGallery
})
@@ -236,18 +174,6 @@ let isLion = computed(() => {
return store.state.userId === 3
})
-function pullNewTag(){
- store.dispatch("loadTags")
-}
-
-function postTag(){
- store.dispatch("postTag", tag.value)
-}
-
-function deleteTag(tid){
- store.dispatch("deleteTag", tid)
-}
-
//修改授权码
function alterAuthCode(){
if(newAuthCode.value.trim() === "" || tempAuthCode.value.trim() === "" || newAuthCode.value !== tempAuthCode.value)
@@ -281,8 +207,7 @@ function postTask(){
store.dispatch("postGalleryTask",
{link: chosenGallery.value.link,
targetResolution: targetResolution.value,
- mode: targetDownloadMode.value,
- tags:tag.value})
+ mode: targetDownloadMode.value})
targetResolution.value = ""
}
@@ -304,44 +229,8 @@ function queryLocalTask(){
case "keyword":
store.commit("_searchLocalByKeyword", param.value)
break
- case "tag":
- store.commit("_searchLocalByTag", paramForTags.value)
- break
}
}
-let tagInput = ref({}) //用于查询
-let tagInputForSubmit = ref({}) //用于提交
-function completeQueryTag(keyWord, cb) {
- if(keyWord.includes(' ')) { //查询多个标签的时候
- let temp = keyWord.split(' ')
- keyWord = temp[temp.length - 1]
- }else{ //只有一个标签的时候
- keyWord = param.value
- }
- let result = []
- let skip
- let hit = false //用于检测是否有重复标签
- tags.value.forEach((tag) => {
- if(tag.tag.includes(keyWord)) {
- skip = false
- for (let id of paramForTags.value) { //跳过已选中的标签
- if(tag.id === id){
- if(!hit && tag.tag === keyWord){ //是否命中标签
- hit = true
- }
- skip = true
- break
- }
- }
- if(!skip)
- result.push({value: tag.tag, tid: tag.id})
- }
- })
- if(result.length === 0 && !keyWord.includes("#") && chosenGallery.value.gid !== undefined && !hit){ //未命中结果并且准备与下载任务一并提交
- result.push({value: '新建 #' + keyWord + ' 标签?', tag:keyWord})
- }
- cb(result)
-}
function removeQueryTag(tid){
for (let i=0; i
{
- if (res.data.result === 'success') {
- ElMessage('创建标签成功')
- paramForTags.value.push(parseInt(res.data.tid))
- tagInputForSubmit.value.blur()
- store.dispatch("loadTags", false).then()
- }
- else
- ElMessage(res.data.data)
- })}else{
- paramForTags.value.push(data.tid)
- console.log(chosenGallery)
- if(chosenGallery.value.gid === undefined){
- queryLocalTask()
- tagInput.value.blur()
- }else{
- tagInputForSubmit.value.blur()
- }
- }
- param.value = ''
-}
-
-function resetLocalQuery(){
- store.commit("_searchLocalByKeyword", "")
- store.commit("_searchLocalByTag", [''])
- param.value = ""
-}
-
//删除任务
function deleteGallery(){
store.dispatch("deleteGallery", chosenGallery.value.gid)
@@ -411,7 +260,7 @@ function validate(){
}
}
-//验证链接以及伪装链接
+//验证链接
function validateLink(rawLink){
if(rawLink.trim() === "")
return false
@@ -422,11 +271,8 @@ function validateLink(rawLink){
}
//打开面板以及在线阅读
-function openPanel(){
- store.commit("_openHistoryPanel")
-}
-function onlineGalleryReader(gid){
- store.dispatch("queryOnlineLinks", gid)
+function onlineGalleryReader(gallery){
+ store.dispatch("readOnlineGallery", gallery)
}
//重新给节点发送未完成任务
@@ -445,12 +291,6 @@ function toggleStyle(){
light()
}
-//显示缩略图
-function showThumbnail(gallery){
- store.commit("_changeThumbnailGallery", gallery)
- setTimeout(() => {document.querySelector(".preview > img").click()}, 1)
-}
-
onMounted(() => {
const auth = localStorage.getItem("auth")
adjustForStyle()
diff --git a/src/components/HentaiSearch.vue b/src/components/HentaiSearch.vue
index 7cd1d06..7caf0f7 100644
--- a/src/components/HentaiSearch.vue
+++ b/src/components/HentaiSearch.vue
@@ -14,7 +14,6 @@ let queryPage = ref({})
let galleries = ref([])
let param = ref()
let isShowUp = ref()
-let isLoading = ref()
watch(props, () => {
isShowUp.value = props.isQuerying
})
@@ -28,11 +27,11 @@ function queryGalleries(link){
tempParam = keyword.value
}
tempParam = tempParam.replace(" ", "+")
- isLoading = true
+ document.getElementById("loading").style.display = "inline-block";
axios.get("https://downloader.lionwebsite.xyz/query?keyword=" + tempParam)
.then((res) => {
- isLoading = false
+ document.getElementById("loading").style.display = "none";
if (res.data.result === "success") {
let tempGalleries = JSON.parse(res.data.data)
queryPage.value.first = 'first' in res.data ? res.data.first : undefined
@@ -44,6 +43,8 @@ function queryGalleries(link){
tempGalleries.forEach((gallery) => {
galleries.value.push(gallery)
})
+
+ scrollBar.value.setScrollTop(0)
}else {
ElMessage({message: res.data.data, type: "error"})
}
@@ -94,7 +95,7 @@ function adjustGalleryName(name, length) {
@@ -110,7 +111,10 @@ function adjustGalleryName(name, length) {
页数:{{gallery.page}}
类型:{{gallery.type}}
链接
-
下载
+
+ 在线看
+ 查看详情
+
@@ -135,7 +139,7 @@ function adjustGalleryName(name, length) {
border-top-color: #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
- display: inline-block;
+ display: none;
}
@keyframes spin {
diff --git a/src/components/OnlineReader.vue b/src/components/OnlineReader.vue
index d6bd406..dbea5f3 100644
--- a/src/components/OnlineReader.vue
+++ b/src/components/OnlineReader.vue
@@ -1,9 +1,6 @@