From 22e6e74a1fca3e10e773c62c186cf77ea9a58f6f Mon Sep 17 00:00:00 2001 From: zyronon Date: Mon, 13 Sep 2021 17:50:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Footer.vue | 12 ++-- src/components/Video.vue | 31 ++++----- src/config/index.js | 8 +-- src/pages/message/Message.vue | 115 +++++++++++++++++----------------- src/store/index.js | 62 +++++++++--------- src/utils/global-methods.js | 5 ++ 6 files changed, 115 insertions(+), 118 deletions(-) diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 86b6c73..5e13c7e 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -32,26 +32,22 @@ export default { } }, methods: { - stop() { - - }, tab(index) { - this.currentTab = index switch (index) { case 1: - this.$router.push('/') + this.$nav('/') break case 2: - this.$router.push('/attention') + this.$nav('/attention') break case 3: this.$nav('/publish') break case 4: - this.$router.push('/message') + this.$nav('/message') break case 5: - this.$router.push('/me') + this.$nav('/me') break } }, diff --git a/src/components/Video.vue b/src/components/Video.vue index 799752c..110d4b8 100644 --- a/src/components/Video.vue +++ b/src/components/Video.vue @@ -203,22 +203,17 @@ export default { }, methods: { dbClick(e) { - console.log('dbclick') + // console.log('dbclick') + let id = 'a' + Date.now() + let elWidth = 80 + let rotate = this.randomNum(0, 1) + let template = `` + let el = new Dom().create(template) + el.css({top: e.y - elWidth, left: e.x - elWidth / 2,}) + new Dom('#home-index').append(el) setTimeout(() => { - let id = 'a' + Date.now() - let elWidth = 80 - let rotate = this.randomNum(0, 1) - // let rotate = 1 - let template = `` - let el = new Dom().create(template) - el.css({top: e.y - elWidth, left: e.x - elWidth / 2,}) - // new Dom().find('#home-index').append(el) - document.querySelector('#home-index').appendChild(el.els[0]) - // - setTimeout(() => { - new Dom().find(`#${id}`).remove() - }, 1000) - }) + new Dom(`#${id}`).remove() + }, 1000) }, randomNum(minNum, maxNum) { switch (arguments.length) { @@ -234,7 +229,7 @@ export default { let checkTime = 400 if (this.isDbClick) { this.dbClick(e) - console.log('checkDbClick-dbclick1') + // console.log('checkDbClick-dbclick1') clearTimeout(this.dbClickTimer); this.dbClickTimer = setTimeout(() => { this.isDbClick = false @@ -243,7 +238,7 @@ export default { let nowTime = new Date().getTime(); if (nowTime - this.lastClickTime < checkTime) { this.dbClick(e) - console.log('checkDbClick-dbclick2') + // console.log('checkDbClick-dbclick2') this.lastClickTime = 0; this.clickTimer && clearTimeout(this.clickTimer); @@ -254,7 +249,7 @@ export default { } else { this.lastClickTime = nowTime; this.clickTimer = setTimeout(() => { - console.log('单击') + // console.log('单击') this.togglePlayVideo() }, checkTime); } diff --git a/src/config/index.js b/src/config/index.js index 930589f..2ed0b0f 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,8 +1,8 @@ export default { - baseUrl: 'http://192.168.0.103/index.php/v1', - filePreview:'http://192.168.0.103/static/uploads/', - // baseUrl: 'http://192.168.10.164/index.php/v1', - // filePreview:'http://192.168.10.164/static/uploads/' + // baseUrl: 'http://192.168.0.103/index.php/v1', + // filePreview:'http://192.168.0.103/static/uploads/', + baseUrl: 'http://192.168.10.164/index.php/v1', + filePreview:'http://192.168.10.164/static/uploads/' // baseUrl: 'http://localhost/index.php/v1', // filePreview:'http://localhost/static/uploads/' } \ No newline at end of file diff --git a/src/pages/message/Message.vue b/src/pages/message/Message.vue index 235c41c..c936165 100644 --- a/src/pages/message/Message.vue +++ b/src/pages/message/Message.vue @@ -11,11 +11,11 @@
+ v-for="item in friends.all">
- +
- ttenu + {{ item.name }}
@@ -97,8 +97,8 @@
Z
-
- +
+
{{ item.name }} @@ -142,6 +142,7 @@ import Footer from '../../components/Footer.vue' import Search from "../../components/Search"; import FromBottomDialog from '../../components/dialog/FromBottomDialog' import Check from "../../components/Check"; +import {mapState} from "_vuex@4.0.2@vuex"; export default { name: "Message", @@ -158,63 +159,63 @@ export default { createChatDialog: false, isShowText: false, text: 'AAAAAAAAA、BBBBBBBBBBBBB、CCCCCCCC', - friends: [ - { - avatar: '', - name: '11', - account: '173123141231qoqo', - select: false - }, - { - avatar: '', - name: 'Boooo', - account: '234242ooo', - select: false - }, - { - avatar: '', - name: '三分钟情、', - account: '3029342', - select: false - }, - { - avatar: '', - name: 'zzzzz', - account: '6034592', - select: false - }, - { - avatar: '', - name: 'zzzzz', - account: '6034592', - select: false - }, - { - avatar: '', - name: 'zzzzz', - account: '6034592', - select: false - }, - { - avatar: '', - name: 'zzzzz', - account: '6034592', - select: false - }, - { - avatar: '', - name: 'zzzzz', - account: '6034592', - select: false - }, - ], + // friends: [ + // { + // avatar: '', + // name: '11', + // account: '173123141231qoqo', + // select: false + // }, + // { + // avatar: '', + // name: 'Boooo', + // account: '234242ooo', + // select: false + // }, + // { + // avatar: '', + // name: '三分钟情、', + // account: '3029342', + // select: false + // }, + // { + // avatar: '', + // name: 'zzzzz', + // account: '6034592', + // select: false + // }, + // { + // avatar: '', + // name: 'zzzzz', + // account: '6034592', + // select: false + // }, + // { + // avatar: '', + // name: 'zzzzz', + // account: '6034592', + // select: false + // }, + // { + // avatar: '', + // name: 'zzzzz', + // account: '6034592', + // select: false + // }, + // { + // avatar: '', + // name: 'zzzzz', + // account: '6034592', + // select: false + // }, + // ], searchFriends: [] } }, computed: { + ...mapState(['friends']), selectFriends() { - let res = this.friends.filter(v => v.select) - return res.length + return this.friends.all.filter(v => v.select).length } }, watch: { diff --git a/src/store/index.js b/src/store/index.js index 69a21bd..88ab679 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -30,7 +30,7 @@ const store = Vuex.createStore({ "all": [ { "id": "224e9a00-ffa0-4bc1-bb07-c318c7b02fa5", - "avatar": "images/20210816/1.png", + "avatar": require('../assets/img/icon/avatar/1.png'), "name": "冒安志", "sex": "", "age": null, @@ -48,7 +48,7 @@ const store = Vuex.createStore({ }, { "id": "2b446aa8-5d31-429a-8e39-d4705eb4e900", - "avatar": "images/20210816/19.png", + "avatar": require('../assets/img/icon/avatar/19.png'), "name": "浅唱↘我们的歌", "sex": "", "age": null, @@ -66,7 +66,7 @@ const store = Vuex.createStore({ }, { "id": "2d8622b4-7112-4bc7-a0cf-00a268a85504", - "avatar": "images/20210816/25.png", + "avatar": require('../assets/img/icon/avatar/25.png'), "name": "‘心’之天空", "sex": "", "age": null, @@ -84,7 +84,7 @@ const store = Vuex.createStore({ }, { "id": "2e38900b-65f7-426a-8e8b-edb403df35fb", - "avatar": "images/20210816/18.png", + "avatar": require('../assets/img/icon/avatar/18.png'), "name": "◇、_保持微笑ゞ", "sex": "", "age": null, @@ -102,7 +102,7 @@ const store = Vuex.createStore({ }, { "id": "3cd53cb5-04f8-4439-ad2b-e57b3f9b8c73", - "avatar": "images/20210816/26.png", + "avatar": require('../assets/img/icon/avatar/26.png'), "name": "好◇°我会Yi直在●", "sex": "", "age": null, @@ -120,7 +120,7 @@ const store = Vuex.createStore({ }, { "id": "46c77017-9dc6-4a48-bf96-560c6e7db06f", - "avatar": "images/20210816/4.png", + "avatar": require('../assets/img/icon/avatar/4.png'), "name": "甫韦茹", "sex": "", "age": null, @@ -138,7 +138,7 @@ const store = Vuex.createStore({ }, { "id": "4df770d7-a414-4e02-8f9e-72ebd87eb93e", - "avatar": "images/20210816/12.png", + "avatar": require('../assets/img/icon/avatar/12.png'), "name": "幸福泡泡", "sex": "", "age": null, @@ -156,7 +156,7 @@ const store = Vuex.createStore({ }, { "id": "5ebb4d7a-c7ad-43c7-a830-9eb3ee423cb7", - "avatar": "images/20210816/3.png", + "avatar": require('../assets/img/icon/avatar/3.png'), "name": "蔡傲安", "sex": "", "age": null, @@ -174,7 +174,7 @@ const store = Vuex.createStore({ }, { "id": "7226092d-a2c5-4ffd-98d7-3b7ac814bca3", - "avatar": "images/20210816/16.png", + "avatar": require('../assets/img/icon/avatar/16.png'), "name": "心若向阳无谓伤悲", "sex": "", "age": null, @@ -192,7 +192,7 @@ const store = Vuex.createStore({ }, { "id": "72aef2a9-5573-4205-9288-706e19bccc7f", - "avatar": "images/20210816/10.png", + "avatar": require('../assets/img/icon/avatar/10.png'), "name": "A倒影着稚嫩的少年", "sex": "", "age": null, @@ -210,7 +210,7 @@ const store = Vuex.createStore({ }, { "id": "77c82d2e-9be1-45c2-a733-00445d2e7f2c", - "avatar": "images/20210816/22.png", + "avatar": require('../assets/img/icon/avatar/22.png'), "name": "一只喵的旅行。", "sex": "", "age": null, @@ -228,7 +228,7 @@ const store = Vuex.createStore({ }, { "id": "7b30566d-70eb-4a31-ae43-200917269a43", - "avatar": "images/20210816/14.png", + "avatar": require('../assets/img/icon/avatar/14.png'), "name": "℉阳光下的小情绪", "sex": "", "age": null, @@ -246,7 +246,7 @@ const store = Vuex.createStore({ }, { "id": "90c6ccd8-0653-4789-9348-28fba06d6ae3", - "avatar": "images/20210816/11.png", + "avatar": require('../assets/img/icon/avatar/11.png'), "name": "思念一直在", "sex": "", "age": null, @@ -264,7 +264,7 @@ const store = Vuex.createStore({ }, { "id": "a2c1310f-1a3c-430f-9b7c-557b9ccdd33d", - "avatar": "images/20210816/9.png", + "avatar": require('../assets/img/icon/avatar/9.png'), "name": "阎韶丽", "sex": "", "age": null, @@ -282,7 +282,7 @@ const store = Vuex.createStore({ }, { "id": "a7443b4f-b0fa-4409-a693-5f090aa763ee", - "avatar": "images/20210816/5.png", + "avatar": require('../assets/img/icon/avatar/5.png'), "name": "马佳婉清", "sex": "", "age": null, @@ -300,7 +300,7 @@ const store = Vuex.createStore({ }, { "id": "b49fd828-f8a7-4be0-a3bc-0a8fa312b2e8", - "avatar": "images/20210816/0.png", + "avatar": require('../assets/img/icon/avatar/0.png'), "name": "倒影着稚嫩的少年", "sex": "", "age": null, @@ -318,7 +318,7 @@ const store = Vuex.createStore({ }, { "id": "b632bffe-1cfb-408a-8255-b558e2faf49a", - "avatar": "images/20210816/8.png", + "avatar": require('../assets/img/icon/avatar/8.png'), "name": "买易槐", "sex": "", "age": null, @@ -336,7 +336,7 @@ const store = Vuex.createStore({ }, { "id": "c01f10dd-a270-42ab-876f-64a8beb22a69", - "avatar": "images/20210816/7.png", + "avatar": require('../assets/img/icon/avatar/7.png'), "name": "章昊苍", "sex": "", "age": null, @@ -354,7 +354,7 @@ const store = Vuex.createStore({ }, { "id": "d0bf11a3-a25b-4865-a047-c67de8e8af7b", - "avatar": "images/20210816/2.png", + "avatar": require('../assets/img/icon/avatar/2.png'), "name": "凌依晨", "sex": "", "age": null, @@ -372,7 +372,7 @@ const store = Vuex.createStore({ }, { "id": "d300b7a5-115d-41ba-a071-7d1781da331f", - "avatar": "images/20210816/23.png", + "avatar": require('../assets/img/icon/avatar/23.png'), "name": "为你锁住心", "sex": "", "age": null, @@ -390,7 +390,7 @@ const store = Vuex.createStore({ }, { "id": "deceba30-80fc-45c2-bd56-8d65091bb104", - "avatar": "images/20210816/13.png", + "avatar": require('../assets/img/icon/avatar/13.png'), "name": "原味青春", "sex": "", "age": null, @@ -408,7 +408,7 @@ const store = Vuex.createStore({ }, { "id": "e0c3d20d-5978-4339-962f-cffc6e29aff1", - "avatar": "images/20210816/24.png", + "avatar": require('../assets/img/icon/avatar/24.png'), "name": "一起走过的日子°", "sex": "", "age": null, @@ -426,7 +426,7 @@ const store = Vuex.createStore({ }, { "id": "e1fb6274-10fa-4d50-b9b1-6eefacfc2341", - "avatar": "images/20210816/15.png", + "avatar": require('../assets/img/icon/avatar/15.png'), "name": "看,熟悉旳风景", "sex": "", "age": null, @@ -444,7 +444,7 @@ const store = Vuex.createStore({ }, { "id": "eab1ef9b-70e6-4249-8d78-b4f6e1b0cb08", - "avatar": "images/20210816/20.png", + "avatar": require('../assets/img/icon/avatar/20.png'), "name": "dear°学会微笑", "sex": "", "age": null, @@ -462,7 +462,7 @@ const store = Vuex.createStore({ }, { "id": "ecb405e2-d057-4c85-a12b-a5fe9a7b8a05", - "avatar": "images/20210816/6.png", + "avatar": require('../assets/img/icon/avatar/6.png'), "name": "富察昕昕", "sex": "", "age": null, @@ -480,7 +480,7 @@ const store = Vuex.createStore({ }, { "id": "f09652a3-d6e1-4517-a15e-583a24a250e1", - "avatar": "images/20210816/17.png", + "avatar": require('../assets/img/icon/avatar/17.png'), "name": "蓝天下的迷彩?", "sex": "", "age": null, @@ -498,7 +498,7 @@ const store = Vuex.createStore({ }, { "id": "f676cc30-cc81-487a-9450-cbb1f3c5cde8", - "avatar": "images/20210816/21.png", + "avatar": require('../assets/img/icon/avatar/21.png'), "name": "伱的微笑", "sex": "", "age": null, @@ -518,7 +518,7 @@ const store = Vuex.createStore({ "recent": [ { "id": "3cd53cb5-04f8-4439-ad2b-e57b3f9b8c73", - "avatar": "images/20210816/26.png", + "avatar": require('../assets/img/icon/avatar/26.png'), "name": "好◇°我会Yi直在●", "sex": "", "age": null, @@ -536,7 +536,7 @@ const store = Vuex.createStore({ }, { "id": "77c82d2e-9be1-45c2-a733-00445d2e7f2c", - "avatar": "images/20210816/22.png", + "avatar": require('../assets/img/icon/avatar/22.png'), "name": "一只喵的旅行。", "sex": "", "age": null, @@ -556,7 +556,7 @@ const store = Vuex.createStore({ "eachOther": [ { "id": "2b446aa8-5d31-429a-8e39-d4705eb4e900", - "avatar": "images/20210816/19.png", + "avatar": require('../assets/img/icon/avatar/19.png'), "name": "浅唱↘我们的歌", "sex": "", "age": null, @@ -574,7 +574,7 @@ const store = Vuex.createStore({ }, { "id": "eab1ef9b-70e6-4249-8d78-b4f6e1b0cb08", - "avatar": "images/20210816/20.png", + "avatar": require('../assets/img/icon/avatar/20.png'), "name": "dear°学会微笑", "sex": "", "age": null, diff --git a/src/utils/global-methods.js b/src/utils/global-methods.js index 8e409ef..99e8e96 100644 --- a/src/utils/global-methods.js +++ b/src/utils/global-methods.js @@ -252,6 +252,11 @@ export default { }, $imgPreview(url) { if (!url) return + //本地图片 + if (url.includes('img')) { + return url + } + //网络,全路径图片 if (url.includes('http')) { return url }