From 6f34d69a6e4be1a18d520e0ad4fc5756337525f1 Mon Sep 17 00:00:00 2001
From: Aicirou <2643053021@qq.com>
Date: Fri, 15 May 2020 03:20:11 +0800
Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90=E5=88=97=E8=A1=A8=E6=97=A0?=
=?UTF-8?q?=E9=99=90=E5=8A=A0=E8=BD=BD=EF=BC=8C=E7=BE=8E=E5=8C=96=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 5 +++
package.json | 1 +
src/assets/style/theme/acrou/index.scss | 9 ++++-
src/locales/en.json | 6 ++-
src/locales/zh-chs.json | 4 +-
src/locales/zh-cht.json | 4 +-
src/main.js | 2 +
src/views/common/Navbar.vue | 11 ++++--
src/views/page/GoList.vue | 50 +++++++++++++++++++------
9 files changed, 71 insertions(+), 21 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index de74c76..002f7ca 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12498,6 +12498,11 @@
}
}
},
+ "vue-infinite-scroll": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npm.taobao.org/vue-infinite-scroll/download/vue-infinite-scroll-2.0.2.tgz",
+ "integrity": "sha1-yjepH+ku4K07dKz4aCwAkXFEtxE="
+ },
"vue-loader": {
"version": "15.9.1",
"resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.1.tgz?cache=0&sync_timestamp=1584584267698&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-15.9.1.tgz",
diff --git a/package.json b/package.json
index 30dbc4d..febf5e4 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"vue-axios": "^2.1.5",
"vue-clipboard2": "^0.3.1",
"vue-i18n": "^8.17.3",
+ "vue-infinite-scroll": "^2.0.2",
"vue-router": "^3.1.6",
"vue2-ace-editor": "0.0.15",
"vuex": "^3.4.0"
diff --git a/src/assets/style/theme/acrou/index.scss b/src/assets/style/theme/acrou/index.scss
index 7b7b620..bb99d83 100644
--- a/src/assets/style/theme/acrou/index.scss
+++ b/src/assets/style/theme/acrou/index.scss
@@ -54,8 +54,8 @@ body {
td span {
vertical-align: middle;
}
- td .g2-file-desc{
- font-size:12px;
+ td .g2-file-desc {
+ font-size: 12px;
}
}
@@ -87,6 +87,11 @@ body {
}
}
+// 搜索框
+.search-input,.search-input::-webkit-input-placeholder {
+ color: whitesmoke;
+}
+
.golist {
min-height: 240px;
position: relative;
diff --git a/src/locales/en.json b/src/locales/en.json
index 85d924f..07180f1 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -23,10 +23,12 @@
"copy": "Copy link",
"newTab": "Open a new tab",
"download": "Download"
- }
+ },
+ "total": "Total",
+ "item": "item"
},
"search": {
- "placeholder": "Search or jump to…"
+ "placeholder": "Search resources..."
},
"page": {
"video": {
diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json
index f2db110..47bec7a 100644
--- a/src/locales/zh-chs.json
+++ b/src/locales/zh-chs.json
@@ -23,7 +23,9 @@
"copy": "复制链接",
"newTab": "打开新的标签页",
"download": "下载"
- }
+ },
+ "total": "共",
+ "item": "项"
},
"search": {
"placeholder": "搜索..."
diff --git a/src/locales/zh-cht.json b/src/locales/zh-cht.json
index 282827d..adf6529 100644
--- a/src/locales/zh-cht.json
+++ b/src/locales/zh-cht.json
@@ -23,7 +23,9 @@
"copy": "復制鏈接",
"newTab": "打開新的標簽頁",
"download": "下載"
- }
+ },
+ "total": "共",
+ "item": "項"
},
"search": {
"placeholder": "搜索..."
diff --git a/src/main.js b/src/main.js
index 7cb8518..9dede23 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,12 +11,14 @@ import i18n from './i18n'
// store
import store from '@/store/index'
import VueClipboard from 'vue-clipboard2'
+import infiniteScroll from 'vue-infinite-scroll'
import "@/assets/style/theme/register.scss"
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueAxios,axios)
Vue.use(VueClipboard)
+Vue.use(infiniteScroll)
new Vue({
router,
diff --git a/src/views/common/Navbar.vue b/src/views/common/Navbar.vue
index 8f59e76..dd9f404 100644
--- a/src/views/common/Navbar.vue
+++ b/src/views/common/Navbar.vue
@@ -44,16 +44,18 @@
-
+
-
-
+
+
+
@@ -105,6 +107,7 @@ export default {
currgd: {},
gds: [],
isActive: false,
+ eyes: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAA0CAYAAAAHSF9vAAAAAXNSR0IArs4c6QAACN5JREFUeAHtXG9oHGUaf95J0tj2sskmze4SsylCWiqlBZEiHp6atnJ+8FCx1OOgFUy1eKfXuwM9wdMPeoJ/QM8/3NHaCrYgXmn9g35QbI3W4+QohxARSxuQJrHsbppssrHtpcnO6/Ob7KYzs+/M7M7O7KZc3y+ZeZ7n9zzP+8sz77zv7LwjKIAmpWwaTWfXyAZaKyStkDq1kpAzfDyli4bvm5c1DCZaWjIBhArFRWp6OjZzPr9ek/lrpODcpWgWGk3x8VmRp2+749ETQojZIIILv06YZG04M7WJSN8upLxbEi1388UJf0Mk95N21ds9ncvPuNnWQjc8dq6L9P/9hkhs576sc4vJJJ2TQrxHpO3vibUe5b7obvZuuooJPyPlsrnMxOPstF9K6nJzrtLNJyuPcAeeWRlr/5fKJkzZ6czETVwgTzLRm1E0lcYSglAs+xpj7c91CXG+YnwlgNPpydtI6ru5Uq+pBKeyZeL5oqDdyxujf+7oEDmVTZCy8XEZOTeXfZ597mSiKy600lzE9yS0nSvjbZ+W6pwlZQXOZrNtuYvyVZJym7MrfxpUjKaJnd2d7R/58+CNGh2buEPX5W4/V6SndyEORJaI30ej0UlPWzbwJHw0l+vIX5j7lMm+rhyHfmwwzPBlvjOZ6NjrB++GGUmN7+Dhi8mufPhw82vRCfF1w9LG27ojkXGLXHHiOobh7q2fn/s8TLKRE8hgUvYMZyZ+p8jRtwj+4DdUsuc7cJ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3gBP+VsijXsK0niyl57M1sh7rU3h7nyNYkafk3CTDzfiLSRzNRm3vi0jcfJ/4vvpfBK9kAy1nqkmntCIHdvJt/0RSDRydssIpf/F4FEjmfxY0F/EchctFeOa8DAT7a2wdC+qrYdAAAAAElFTkSuQmCC'
};
},
methods: {
diff --git a/src/views/page/GoList.vue b/src/views/page/GoList.vue
index 0aff836..95a84ee 100644
--- a/src/views/page/GoList.vue
+++ b/src/views/page/GoList.vue
@@ -2,7 +2,12 @@
-
+
-->
{{ file.name }}
- {{ file.description }}
+ {{
+ file.description
+ }}
|
{{ file.modifiedTime }}
@@ -77,12 +84,18 @@
|
-
+
+
+
+ Loading...
+
+
+ {{ $t("list.total") }} {{ files.length }} {{ $t("list.item") }}
+
+
@@ -106,13 +119,13 @@ export default {
},
data: function() {
return {
+ busy: false,
page: {
page_token: null,
page_index: 0,
},
files: [],
loading: true,
- copyTooltip: "",
icon: {
"application/vnd.google-apps.folder": "icon-morenwenjianjia",
"video/mp4": "icon-mp",
@@ -168,7 +181,7 @@ export default {
return this.files.map((item) => {
var p = path + checkoutPath(item.name, item);
let isFolder = item.mimeType === "application/vnd.google-apps.folder";
- let size = isFolder ? this.$t("folder") : formatFileSize(item.size);
+ let size = isFolder ? '-' : formatFileSize(item.size);
return {
path: p,
...item,
@@ -183,11 +196,20 @@ export default {
this.render();
},
methods: {
- render() {
+ pageLoad() {
+ if (!this.page.page_token) return;
+ this.page.page_index++;
+ this.render("scroll");
+ },
+ render(scroll) {
+ if (scroll) {
+ this.busy = true;
+ } else {
+ this.loading = true;
+ }
this.headmd = { display: false, file: {}, path: "" };
this.readmemd = { display: false, file: {}, path: "" };
var path = this.$route.path;
- this.loading = true;
var password = localStorage.getItem("password" + path);
let q = this.$route.query.q;
var p = {
@@ -212,16 +234,22 @@ export default {
page_index: body.curPageIndex,
};
try {
- this.files = data.files;
+ if (scroll) {
+ this.files = this.files.concat(data.files);
+ } else {
+ this.files = data.files;
+ }
this.renderMd(data.files, path);
} catch (e) {
console.log(e);
}
}
this.loading = false;
+ this.busy = false;
})
.catch(() => {
this.loading = false;
+ this.busy = false;
this.$router.go(-1);
});
},