提交 79476f75 作者: Hao

新增聊天

父级 06549bcf
NODE_ENV=development NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.120 VITE_USER_APP_API_URL=http://im.wei-it.com/api
VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
NODE_ENV=production NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.112 VITE_USER_APP_API_URL=http://im.wei-it.com/api
\ No newline at end of file VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
\ No newline at end of file
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
/> />
<img <img
src="../assets/icon_image_s1_01.png" src="../assets/icon_image_s1_01.png"
@click="upfile" @click="upImgfile"
class="icon emoji" class="icon emoji"
alt="" alt=""
/> />
<img <img
src="../assets/icon_folder_s1_01.png" src="../assets/icon_folder_s1_01.png"
@click="upfile" @click="upfile"
...@@ -53,11 +54,18 @@ ...@@ -53,11 +54,18 @@
<input <input
ref="file" ref="file"
style="display: none;" style="display: none;"
type="file"
@change="fileImgChange"
/>
<input
ref="imgFile"
style="display: none;"
accept="image/bmp,image/jpeg,image/jpg,image/png" accept="image/bmp,image/jpeg,image/jpg,image/png"
type="file" type="file"
@change="fileImgChange" @change="fileImgChange"
/> />
</div> </div>
<!-- accept="image/bmp,image/jpeg,image/jpg,image/png" -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import emotion from './IndexComponent.vue' import emotion from './IndexComponent.vue'
...@@ -67,11 +75,11 @@ import { upLoadFilesHander } from '../minxins/UploadMixin' ...@@ -67,11 +75,11 @@ import { upLoadFilesHander } from '../minxins/UploadMixin'
const inputVal = ref('') const inputVal = ref('')
const elAutocomplete = ref<any>(null) const elAutocomplete = ref<any>(null)
const file = ref<any>(null) const file = ref<any>(null)
const imgFile = ref<any>(null)
const imgShowWidth = ref<number>(50) const imgShowWidth = ref<number>(50)
const imgShowHeight = ref<number>(50) const imgShowHeight = ref<number>(50)
const showEmotion = ref<boolean>(false) const showEmotion = ref<boolean>(false)
const handleEmotion = (i: any) => { const handleEmotion = (i: any) => {
console.log(i, '打印')
elAutocomplete.value.innerHTML += i elAutocomplete.value.innerHTML += i
inputVal.value = elAutocomplete.value.innerHTML inputVal.value = elAutocomplete.value.innerHTML
showEmotion.value = false showEmotion.value = false
...@@ -80,6 +88,9 @@ const handleEmotion = (i: any) => { ...@@ -80,6 +88,9 @@ const handleEmotion = (i: any) => {
const upfile = () => { const upfile = () => {
file.value.click() file.value.click()
} }
const upImgfile = () => {
imgFile.value.click()
}
//上传的数据 //上传的数据
const fileImgChange = async () => { const fileImgChange = async () => {
var e: any = window.event || event var e: any = window.event || event
......
...@@ -331,11 +331,11 @@ ...@@ -331,11 +331,11 @@
type="file" type="file"
@change="fileImgChange" @change="fileImgChange"
/> --> /> -->
<!-- accept="image/bmp,image/jpeg,image/jpg,image/png" -->
<input <input
type="file" type="file"
ref="requireFile" ref="requireFile"
style="display: none;" style="display: none;"
accept="image/bmp,image/jpeg,image/jpg,image/png"
@change="fileImgChange" @change="fileImgChange"
/> />
<div <div
...@@ -491,7 +491,6 @@ const defaultStyle: { ...@@ -491,7 +491,6 @@ const defaultStyle: {
transition: 'all 0.6s linear', transition: 'all 0.6s linear',
} }
const requireFileOk = () => { const requireFileOk = () => {
console.log(requireFile.value, 'value')
requireFile.value.click() requireFile.value.click()
} }
const rules = reactive({ const rules = reactive({
...@@ -581,8 +580,6 @@ const connectMsg = () => { ...@@ -581,8 +580,6 @@ const connectMsg = () => {
}) })
let VUE_APP_API_URL = import.meta.env.VITE_USER_APP_API_URL let VUE_APP_API_URL = import.meta.env.VITE_USER_APP_API_URL
const toIp = `ws://${VUE_APP_API_URL}:8081?type=yk&code=${useUser.userInfo.username}&kf=${store.customerInfo.username}` const toIp = `ws://${VUE_APP_API_URL}:8081?type=yk&code=${useUser.userInfo.username}&kf=${store.customerInfo.username}`
console.log(toIp, 'toIpWS')
console.log(toIp, 'toIpWS001')
useUser.connect() useUser.connect()
initWebSocket(toIp) initWebSocket(toIp)
setTimeout(() => { setTimeout(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论