diff --git a/themes/yilia/layout/_partial/live2d.ejs b/themes/yilia/layout/_partial/live2d.ejs
index 9523cf0..bae93c9 100644
--- a/themes/yilia/layout/_partial/live2d.ejs
+++ b/themes/yilia/layout/_partial/live2d.ejs
@@ -4,6 +4,7 @@
+
diff --git a/themes/yilia/layout/_partial/search.ejs b/themes/yilia/layout/_partial/search.ejs
index 051899a..92ee9d0 100644
--- a/themes/yilia/layout/_partial/search.ejs
+++ b/themes/yilia/layout/_partial/search.ejs
@@ -10,16 +10,15 @@
\ No newline at end of file
diff --git a/themes/yilia/layout/_partial/tools.ejs b/themes/yilia/layout/_partial/tools.ejs
index 7f7e1bb..2d559f2 100644
--- a/themes/yilia/layout/_partial/tools.ejs
+++ b/themes/yilia/layout/_partial/tools.ejs
@@ -26,7 +26,7 @@
-
+
diff --git a/themes/yilia/source-src/config/waifu-tip.json b/themes/yilia/source-src/config/waifu-tip.json
index 5dd7cc5..ac3477a 100644
--- a/themes/yilia/source-src/config/waifu-tip.json
+++ b/themes/yilia/source-src/config/waifu-tip.json
@@ -9,6 +9,7 @@
"weibo": "发现主人出没地点!",
"rss": "订阅就可以看到最新的文章啦",
"mail": "这里是主人的联系方式",
+ "tools.search": "在这里搜索所有文章",
"tools.eye": "深夜时要爱护眼睛呀",
"tools.chart": "猜猜我要说些什么",
"tools.photo": "你要给我拍照呀,一二三~茄子~~",
diff --git a/themes/yilia/source-src/css/waifu.scss b/themes/yilia/source-src/css/waifu.scss
index 399a486..8e6ce0a 100644
--- a/themes/yilia/source-src/css/waifu.scss
+++ b/themes/yilia/source-src/css/waifu.scss
@@ -56,7 +56,7 @@
}
.waifu-tool {
color: $colorA;
- top: 100px;
+ top: 80px;
right: 60px;
font-size: 14px;
position: absolute;
diff --git a/themes/yilia/source-src/js/slider.js b/themes/yilia/source-src/js/slider.js
index 9e0c65e..e6dfbf5 100644
--- a/themes/yilia/source-src/js/slider.js
+++ b/themes/yilia/source-src/js/slider.js
@@ -15,7 +15,7 @@ function setScrollZero() {
})
}
var waifuTipTimer = null, fullTextSearchTimer = null
-new Vue({
+const vm = new Vue({
el: '#container',
data: {
isCtnShow: false,
@@ -31,10 +31,12 @@ new Vue({
fullTextSearch: {
pageNum: 1,
limit: 10,
+ isLoading: false,
+ tip: undefined,
+ hasMore: false
},
fullTextSearchWords: null,
fullTextSearchItems: [],
- fullTextSearchTip: undefined,
waifu: {
tip: null, // 提示语文字
tipOpacity: 0, // 提示语框透明度
@@ -96,23 +98,26 @@ new Vue({
},
loadSearchResult() {
this.fullTextSearch.pageNum ++
- this.fullTextSearchItems.isLoading = true
- this.fullTextSearchTip = undefined
- let params = Object.assign({}, this.fullTextSearch)
- params.words = this.fullTextSearchWords
+ this.fullTextSearch.isLoading = true
+ this.fullTextSearch.tip = undefined
+ let params = {
+ pageNum: this.fullTextSearch.pageNum,
+ limit: this.fullTextSearch.limit,
+ words: this.fullTextSearchWords
+ }
axios.get(window.themeConfig.root + 'api/common/search', {params}).then(res => {
- this.fullTextSearchItems.isLoading = false
+ this.fullTextSearch.isLoading = false
fullTextSearchTimer = null
let result = res.data
if(!Array.isArray(result.data) || !result.data.length) {
- this.fullTextSearchTip = '未搜索到匹配文章'
+ this.fullTextSearch.tip = '未搜索到匹配文章'
} else {
this.fullTextSearchItems.push(...result.data)
}
this.fullTextSearchItems.hasMore = (result.total > this.fullTextSearch.pageNum * this.fullTextSearch.limit)
}).catch(err => {
- this.fullTextSearchTip = '加载失败, 请刷新重试'
- this.fullTextSearchItems.isLoading = false
+ this.fullTextSearch.tip = '加载失败, 请刷新重试'
+ this.fullTextSearch.isLoading = false
throw err
})
},
@@ -156,7 +161,7 @@ new Vue({
fullTextSearchWords (newVal, oldVal) {
this.fullTextSearchItems.hasMore = false
this.fullTextSearchItems.isLoading = false
- this.fullTextSearchTip = undefined
+ this.fullTextSearch.tip = undefined
this.fullTextSearchItems.splice(0, this.fullTextSearchItems.length)
if(fullTextSearchTimer) {
clearTimeout(fullTextSearchTimer)
@@ -274,6 +279,10 @@ const waifuTools = {
axios.get(`${window.themeConfig.root}api/common/hitokoto?length=40&format=json`).then(res => {
this.showMessage(res.data.hitokoto + (res.data.from?` ——${res.data.from}`:''))
})
+ },
+ 'tools.search'() {
+ // 打开全文检索Modal
+ vm.openFullTextSearch()
}
}