From 57bae6101f4eb3fb7e747160e32c290c2afda9d4 Mon Sep 17 00:00:00 2001 From: Pwcong Date: Thu, 18 May 2017 11:00:28 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E5=89=8D=E7=AB=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=99=BB=E9=99=86=E6=B3=A8=E5=86=8C=E6=B3=A8=E9=94=80=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/component/ImageItem.vue | 37 ++++++++---- client/src/component/Tips.vue | 96 ++++++++++++++++++++++++++++++ client/src/store/index.js | 4 +- client/src/store/modules/tip.js | 36 +++++++++++ client/src/store/types.js | 4 +- client/src/view/App.vue | 50 ++++++++++++++-- client/src/view/Home.vue | 18 +++--- view/js/bundle.js | 2 +- 8 files changed, 217 insertions(+), 30 deletions(-) create mode 100644 client/src/component/Tips.vue create mode 100644 client/src/store/modules/tip.js diff --git a/client/src/component/ImageItem.vue b/client/src/component/ImageItem.vue index a68e483..85b96af 100644 --- a/client/src/component/ImageItem.vue +++ b/client/src/component/ImageItem.vue @@ -8,7 +8,6 @@ class="fa fa-upload" v-if="!uploading && !uploaded" @click="onUploadButtonClick" - :flag="flag" > +
+
+ + + {{ tipsContent }} +
+
+ + + + + diff --git a/client/src/store/index.js b/client/src/store/index.js index 6e01d9e..43f889c 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -3,13 +3,15 @@ import Vuex from 'vuex'; import img from './modules/img.js'; import user from './modules/user.js'; +import tip from './modules/tip.js'; Vue.use(Vuex); const store = new Vuex.Store({ modules: { img, - user + user, + tip } }); diff --git a/client/src/store/modules/tip.js b/client/src/store/modules/tip.js new file mode 100644 index 0000000..9073f78 --- /dev/null +++ b/client/src/store/modules/tip.js @@ -0,0 +1,36 @@ +import axios from 'axios'; + +import * as api from '../../api.js'; +import * as types from '../types.js'; + +const store = { + + state: { + content: '', + show: false, + type: 0 + }, + getters: { + + }, + mutations: { + + [types.MUTATION_TIP_SHOWTIPS](state, payload){ + state.content = payload.content; + state.type = payload.type; + state.show = true; + setTimeout(() => { + state.show = false; + }, 2000); + }, + + }, + actions: { + + + } + + +} + +export default store; \ No newline at end of file diff --git a/client/src/store/types.js b/client/src/store/types.js index 0f7afc3..07161b8 100644 --- a/client/src/store/types.js +++ b/client/src/store/types.js @@ -19,4 +19,6 @@ export const MUTATION_IMG_REMOVEOWNIMG = 'MUTATION_IMG_REMOVEOWNIMG'; export const ACTION_IMG_TOUPLOADIMG = 'ACTION_IMG_TOUPLOADIMG'; export const ACTION_IMG_TOUPLOADALLIMG = 'ACTION_IMG_TOUPLOADALLIMG'; export const ACTION_IMG_GETLIST = 'ACTION_IMG_GETLIST'; -export const ACTION_IMG_REMOVEOWN = 'ACTION_IMG_REMOVEOWN'; \ No newline at end of file +export const ACTION_IMG_REMOVEOWN = 'ACTION_IMG_REMOVEOWN'; + +export const MUTATION_TIP_SHOWTIPS = 'MUTATION_TIP_SHOWTIPS'; \ No newline at end of file diff --git a/client/src/view/App.vue b/client/src/view/App.vue index f0b15c0..a358763 100644 --- a/client/src/view/App.vue +++ b/client/src/view/App.vue @@ -21,6 +21,10 @@ v-if="loginOrRegisterBoxActive" /> +