diff --git a/src/App.vue b/src/App.vue index 34f9dcc..c61ea6c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,6 +17,7 @@ export default { }, watch: { $route: function(to, from) { + console.log('from:',from,'to:',to) const path = to.path if (path.indexOf('/login') < 0) { if (path.indexOf('_m') > 0 && this.$pc) { diff --git a/src/components/SimpleUploader/globalUploader.vue b/src/components/SimpleUploader/globalUploader.vue index c483f99..59f970d 100755 --- a/src/components/SimpleUploader/globalUploader.vue +++ b/src/components/SimpleUploader/globalUploader.vue @@ -49,7 +49,7 @@
-
+
@@ -62,6 +62,8 @@ + +
@@ -127,8 +129,8 @@ export default { accept: '*' }, statusText: { - success: '成功了', - error: '出错了', + success: '上传成功', + error: '上传失败', uploading: '上传中', paused: '暂停中', waiting: '等待中' @@ -142,7 +144,8 @@ export default { netSpeed: 0, isUploading: false, filePanel: {}, - processAreaClass: {} + processAreaClass: {}, + pc: true } }, computed: { @@ -166,6 +169,13 @@ export default { } }) + Bus.$on('uploadFileListBack',() => { + console.log(this.process) + if(this.process !== -10 && this.process !== 100 && this.fileListLength !== 0){ + this.shrink() + } + }) + this.$nextTick(() => { window.uploader = this.$refs.uploader.uploader }) @@ -174,6 +184,7 @@ export default { destroyed() { Bus.$off('openUploader') Bus.$off('uploadFolder') + Bus.$off('uploadFileListBack') }, methods: { // onFileAdded(file) { @@ -204,10 +215,16 @@ export default { }).catch(e => {}) }) } + if(window.pc){ + this.pc = true + this.panelShow = true + }else{ + this.pc = false + this.shrink() + } files.forEach(file => { // 上传文件 console.log('上传->', file) - this.panelShow = true console.log(pathsLength) // this.computeMD5(file) // if (pathsLength < 1) { @@ -382,6 +399,9 @@ export default { }, // 展开球 expand() { + if(!pc){ + this.$router.push(`/upload/index_m`) + } this.filePanel = { 'width': '720px', 'height': '300px', @@ -396,6 +416,16 @@ export default { }, // 收缩成球 shrink(){ + let width = '92px'; + let height = '92px'; + let right = '20px'; + let bottom = '20px'; + if(!pc){ + width = '92px'; + height = '92px'; + right = '10px'; + bottom = '70px'; + } const that = this this.filePanel = { 'color': 'white', @@ -410,10 +440,10 @@ export default { setTimeout(function () { that.isShrink = true that.processAreaClass = { - 'right': '20px', - 'bottom': '20px', - 'width': '92px', - 'height': '92px', + 'right': right, + 'bottom': bottom, + 'width': width, + 'height': height, } that.filePanel = { 'color': 'white', diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index a942a83..fb51eee 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -45,8 +45,10 @@ export default { mounted() { if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { this.isShow = false + window.pc = false } else { this.isShow = true + window.pc = true } }, components: { diff --git a/src/main.js b/src/main.js index 7e1221e..df4546b 100644 --- a/src/main.js +++ b/src/main.js @@ -15,7 +15,7 @@ import router from './router' import VueWechatTitle from 'vue-wechat-title' // import WeVue from 'we-vue' // import 'we-vue/lib/style.css' -import { Button, Cell, CellGroup, Image, List, PullRefresh, SwipeCell, Col, Row, Divider, Sticky, NavBar, Icon, Tabbar, TabbarItem, ActionSheet} from 'vant'; +import { Button, Cell, CellGroup, Image, List, PullRefresh, SwipeCell, Col, Row, Divider, Sticky, NavBar, Icon, Tabbar, TabbarItem, ActionSheet, Dialog, Field} from 'vant'; import '@/icons' // icon import '@/permission' // permission control @@ -62,6 +62,9 @@ Vue.use(Icon); Vue.use(Tabbar); Vue.use(TabbarItem); Vue.use(ActionSheet); +Vue.use(Dialog); +Vue.use(Field); + Vue.use(uploader) Vue.use(EVueContextmenu) diff --git a/src/router/index.js b/src/router/index.js index f354cce..188d733 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -229,7 +229,7 @@ export const dynamicRouters = [ path: '', name: 'Home_m', component: () => import('@/views/home/mobile/index'), - meta: { title: '所有文件', icon: 'ziyuan' } + meta: { title: '所有文件' } }] }, { @@ -243,6 +243,16 @@ export const dynamicRouters = [ meta: { title: 'demo', icon: 'example' } } ] + }, + { + path: '/upload', + component: Layout, + children: [{ + path: 'index_m', + name: 'upload_m', + component: () => import('@/views/upload/mobile/index'), + meta: { title: '上传文件列表' } + }] } ] diff --git a/src/views/home/mobile/index.vue b/src/views/home/mobile/index.vue index 502d33f..72a16b6 100644 --- a/src/views/home/mobile/index.vue +++ b/src/views/home/mobile/index.vue @@ -9,7 +9,7 @@ @scroll="swipeUp" > - +
{{test}} {{diffTabbarTop}} {{lastTabbarOffsetTop}}
- +
+ @@ -61,58 +62,65 @@ +
-
- -
浏览
-
最近
-
收藏
-
设置
-
-
-
- -
浏览
-
最近
-
收藏
-
设置
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + - -
浏览
-
最近
-
收藏
-
设置
-
-
+ + + + + + + + + + + + + + @cancel="onCancel" + @select="selectActionsMenus"> + + + + +
+ diff --git a/src/views/upload/mobile/index.vue b/src/views/upload/mobile/index.vue new file mode 100644 index 0000000..a12fb68 --- /dev/null +++ b/src/views/upload/mobile/index.vue @@ -0,0 +1,82 @@ + + +