Skip to content

Commit 78caf3a

Browse files
authored
Merge pull request #16 from misterpancn/feature-develop-buck
release v1.1.0
2 parents 39baa2f + 3ae72c5 commit 78caf3a

28 files changed

+1394
-144
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "VueChat",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"author": "[email protected]",
55
"description": "An electron-vue project",
66
"private": true,

src/main/index.js

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ if (process.env.NODE_ENV !== 'development') {
1515
let mainWindow
1616
let exit = false
1717
let winModal
18+
let videoModal
1819
const winURL = process.env.NODE_ENV === 'development'
1920
? `http://localhost:9080`
2021
: `file://${__dirname}/index.html`
2122
const winModalURL = process.env.NODE_ENV === 'development'
2223
? `http://localhost:9080/#/modelWindow`
2324
: `file://${__dirname}/index.html#modelWindow`
25+
const videoModalURl = process.env.NODE_ENV === 'development'
26+
? `http://localhost:9080/#/videoModal`
27+
: `file://${__dirname}/index.html#videoModal`
2428

2529
function createWindow () {
2630
/**
@@ -48,8 +52,7 @@ function createWindow () {
4852
modal: true,
4953
useContentSize: true,
5054
frame: false,
51-
show: false,
52-
alwaysOnTop: true
55+
show: false
5356
})
5457
winModal.loadURL(winModalURL)
5558
winModal.on('closed', () => {
@@ -134,19 +137,19 @@ function handleUpdate () {
134137
autoUpdater.autoInstallOnAppQuit = false
135138
autoUpdater.setFeedURL(config.downloadAddress);
136139
autoUpdater.on('error', (err) => {
137-
mainWindow.webContents.send('update-error', String(err))
140+
if (mainWindow) mainWindow.webContents.send('update-error', String(err))
138141
})
139142
autoUpdater.on('update-available', (info) => {
140-
mainWindow.webContents.send('update-available', info)
143+
if (mainWindow) mainWindow.webContents.send('update-available', info)
141144
})
142145
autoUpdater.on('update-not-available', (info) => {
143-
mainWindow.webContents.send('update-not-available', info)
146+
if (mainWindow) mainWindow.webContents.send('update-not-available', info)
144147
})
145148
autoUpdater.on('download-progress', (progress) => {
146-
mainWindow.webContents.send('update-download-progress', progress)
149+
if (mainWindow) mainWindow.webContents.send('update-download-progress', progress)
147150
})
148151
autoUpdater.on('update-downloaded', (info) => {
149-
mainWindow.webContents.send('update-downloaded', info)
152+
if (mainWindow) mainWindow.webContents.send('update-downloaded', info)
150153
})
151154
ipcMain.on('check-for-update', () => {
152155
autoUpdater.checkForUpdates()
@@ -169,3 +172,43 @@ function isShowExitNotify () {
169172
}
170173
return true;
171174
}
175+
176+
function createVideoModal (data) {
177+
videoModal = new BrowserWindow({
178+
parent: mainWindow,
179+
modal: true,
180+
useContentSize: true,
181+
frame: false,
182+
show: false
183+
})
184+
videoModal.loadURL(videoModalURl)
185+
videoModal.on('closed', () => {
186+
videoModal = null
187+
})
188+
videoModal.once('ready-to-show', () => {
189+
videoModal.show()
190+
videoModal.webContents.send('video-modal-data', data)
191+
})
192+
}
193+
ipcMain.on('show-video-modal', (e, data) => {
194+
createVideoModal(data)
195+
})
196+
ipcMain.on('close-video-modal', () => {
197+
if (videoModal) {
198+
videoModal.close()
199+
}
200+
})
201+
ipcMain.on('forwarded-message-to-video', (e, data) => {
202+
if (videoModal) {
203+
videoModal.webContents.send('forwarded-message-to-video', data)
204+
}
205+
})
206+
ipcMain.on('video-modal-full-screen', () => {
207+
if (videoModal) {
208+
if (videoModal.isMaximized()) {
209+
videoModal.unmaximize()
210+
} else {
211+
videoModal.maximize()
212+
}
213+
}
214+
})

src/renderer/App.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@
3333
ul {
3434
list-style: none;
3535
}
36+
37+
::-webkit-scrollbar
38+
{
39+
width: 5px; /*滚动条宽度*/
40+
height: 5px; /*滚动条高度*/
41+
}
42+
43+
/*定义滚动条轨道 内阴影+圆角*/
44+
::-webkit-scrollbar-track
45+
{
46+
border-radius: 2.5px; /*滚动条的背景区域的圆角*/
47+
background-color: #e6e6e6;/*滚动条的背景颜色*/
48+
}
49+
50+
/*定义滑块 内阴影+圆角*/
51+
::-webkit-scrollbar-thumb {
52+
border-radius: 2.5px; /*滚动条的圆角*/
53+
background-color: #A9A9A9; /*滚动条的颜色*/
54+
}
3655
#app {
3756
margin: auto;
3857
max-width: 100%;
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<script>
2+
import axios from '@/request'
3+
export default {
4+
props: [ 'group' ],
5+
data () {
6+
return {
7+
selectUser: [],
8+
loading: false
9+
}
10+
},
11+
computed: {
12+
show: {
13+
get: function () {
14+
if (this.$store.getters.getAddGroupUserShow) {
15+
this.$Spin.hide();
16+
}
17+
return this.$store.getters.getAddGroupUserShow
18+
},
19+
set: function (val) {
20+
this.$store.dispatch('addGroupUserShow', val)
21+
}
22+
},
23+
friendList () {
24+
let friendList = this.$store.getters.getUserList
25+
if (friendList && friendList.length > 0) {
26+
friendList.map((item) => {
27+
item.label = item.name
28+
item.key = item.id
29+
if (this.group.group_members) {
30+
for (let i = 0; i < this.group.group_members.length; i++) {
31+
if (item.id === this.group.group_members[i].user_id) {
32+
item.disabled = true
33+
}
34+
}
35+
}
36+
})
37+
return friendList
38+
} else {
39+
return []
40+
}
41+
}
42+
},
43+
methods: {
44+
close () {
45+
46+
},
47+
handleChange (newTargetKeys) {
48+
this.selectUser = newTargetKeys;
49+
},
50+
inviteToGroup () {
51+
if (this.selectUser) {
52+
this.loading = true;
53+
axios.inviteToGroup({users: this.selectUser, group_id: this.group.group_id}).then((r) => {
54+
this.$Message.warning({
55+
content: r.data.data,
56+
duration: 3
57+
});
58+
this.loading = false;
59+
}).catch((e) => {
60+
this.$Message.warning({
61+
content: e.response.data.data,
62+
duration: 3
63+
});
64+
this.loading = false;
65+
});
66+
}
67+
}
68+
}
69+
}
70+
</script>
71+
<template>
72+
<Modal v-model="show" :mask-closable="false" footer-hide @on-cancel="close">
73+
<p slot="header" style="text-align: center;">{{ $t('chat.inviteToGroup') }}</p>
74+
<div class="m-ui-content">
75+
<Transfer style="margin-left: 35px"
76+
:data="friendList"
77+
:target-keys="selectUser"
78+
:titles="[$t('chat.theFriendsList'), $t('chat.theSelected')]"
79+
filterable
80+
@on-change="handleChange"></Transfer>
81+
<p style="margin-top: 10px;text-align: center"><Button @click="inviteToGroup" :loading="loading">Submit</Button></p>
82+
</div>
83+
</Modal>
84+
</template>
85+
<style lang="less">
86+
.m-ui-content {
87+
position: relative;
88+
}
89+
</style>

src/renderer/components/Chat/Modal/addTo.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
},
5050
trimStr (data) {
5151
if (data.is_related) {
52-
console.log(data)
5352
return data.is_group ? this.$t('chat.alreadyInTheGroup') : this.$t('chat.hasBeenFriend')
5453
}
5554
},

0 commit comments

Comments
 (0)