-
{{ userInfo.username }}
+
{{ username }}
PLUS
@@ -20,9 +20,10 @@
+
diff --git a/src/views/customer/components/Operation.vue b/src/views/customer/components/Operation.vue
index 438aa4b89294cb1a7d513c346825b9445b94429a..1e9c16508cef2a1c132dea367f63864a57e37566 100644
--- a/src/views/customer/components/Operation.vue
+++ b/src/views/customer/components/Operation.vue
@@ -31,7 +31,7 @@ import { sendMessage } from '../../../apis/sendMessage';
import { ref, reactive, onMounted, watch } from 'vue';
import { useWebsocket } from '../../../apis/websockeet';
import { useRoute } from 'vue-router';
-import axios from 'axios'
+import axios from 'axios';
import { component as ckeditor } from '@ckeditor/ckeditor5-vue'; //ckeditor5组件插件
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'; //ckeditor5经典版
import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn'; //中文包
@@ -54,7 +54,7 @@ const state = reactive({
msg: '',
msglist: [],
});
-const imgSrc = ref('')
+const imgSrc = ref('');
/**
* 用户信息
* account:用户名
@@ -96,7 +96,9 @@ onMounted(() => {
// ws.value.close();
// }
if (props.user.item !== '') {
- convId.value = props.user.item.conversation.id;
+ console.log('operation中的User =================>');
+ console.log(props.user.item);
+ convId.value = props.user.item.convID;
// console.log('convId.value == ' + convId.value);
// // ws.value = useWebsocket(handleMessage, userInfo.userId);
// // 设置userId
@@ -157,12 +159,12 @@ const onEditorReady = () => {
const onEditorFocus = () => {
console.log('聚焦');
- isE.value = true
+ isE.value = true;
emit('focus');
};
const onEditorBlur = () => {
console.log('失去焦点');
- isE.value = false
+ isE.value = false;
emit('blur');
};
@@ -174,23 +176,22 @@ const onEditorDestroy = () => {
console.log('销毁');
emit('destroy');
};
-const isE = ref(false)
-watch(isE , (newVal) => {
+const isE = ref(false);
+watch(isE, (newVal) => {
console.log(newVal);
- if(newVal){
+ if (newVal) {
window.addEventListener('keydown', handleKeyDown);
- }else{
+ } else {
window.removeEventListener('keydown', handleKeyDown);
}
-})
+});
function handleKeyDown(event) {
- if (event.keyCode === 13 || event.key === 'Enter') {
- console.log('Enter键被按下');
- send()
- }
+ if (event.keyCode === 13 || event.key === 'Enter') {
+ console.log('Enter键被按下');
+ send();
+ }
}
-
/**
* 发送聊天消息
* @param {string} msg 消息内容
@@ -224,7 +225,7 @@ const send = () => {
msg: _msg,
};
console.log('aaaaaaaaaaaaaaaaa');
- console.log(MyAdapterPlugin)
+ console.log(MyAdapterPlugin);
console.log(param);
// sendMessage(param).then((res) => {
// console.log(res);
@@ -241,6 +242,7 @@ const send = () => {
// );
console.log('socket=======>');
console.log(socket.value);
+ console.log(convId.value);
socket.value.send(
JSON.stringify({
conversationId: convId.value,
@@ -251,6 +253,17 @@ const send = () => {
})
);
+ console.log('发送的消息 ================>');
+ console.log(
+ JSON.stringify({
+ conversationId: convId.value,
+ content: {
+ typeEnum: 'MESSAGE', // ONLINE
+ content: replacedMsg, // []
+ },
+ })
+ );
+
editorResult.value = '';
};
@@ -264,17 +277,16 @@ function MyUploadAdapter(loader) {
const file = await loader.file;
console.log('------------------');
console.log(file);
- const formData = new FormData()
- formData.append('file',file)
- const res = await axios.post('/api/conversation/img/save',formData,{
- headers:{
- 'Content-Type':'multipart/form-data'
- }
- })
- const imgUrl = `http://localhost:19000/${res.data.message}`
- imgSrc.value = imgUrl
- console.log('>>>>>>>>>>>>>>',imgUrl.value)
-
+ const formData = new FormData();
+ formData.append('file', file);
+ const res = await axios.post('/api/conversation/img/save', formData, {
+ headers: {
+ 'Content-Type': 'multipart/form-data',
+ },
+ });
+ const imgUrl = `http://localhost:19000/${res.data.message}`;
+ imgSrc.value = imgUrl;
+ console.log('>>>>>>>>>>>>>>', imgUrl.value);
},
abort: () => {
reader.abort();
@@ -284,15 +296,15 @@ function MyUploadAdapter(loader) {
// canvas生成的格式为base64,如果需要Blob格式可按如下进行转化
function dataURLtoBlob(dataurl) {
- const arr = dataurl.split(","),
- mime = arr[0].match(/:(.*?);/)[1],
- bstr = atob(arr[1]);
- let n = bstr.length;
- const u8arr = new Uint8Array(n);
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n);
- }
- return new Blob([u8arr], { type: mime });
+ const arr = dataurl.split(','),
+ mime = arr[0].match(/:(.*?);/)[1],
+ bstr = atob(arr[1]);
+ let n = bstr.length;
+ const u8arr = new Uint8Array(n);
+ while (n--) {
+ u8arr[n] = bstr.charCodeAt(n);
+ }
+ return new Blob([u8arr], { type: mime });
}
function MyAdapterPlugin(editor) {
diff --git a/src/views/customer/components/OrderItem.vue b/src/views/customer/components/OrderItem.vue
index ad76de7a0638ea1c44099bb81510a365f502f421..c75f9d940d503df5f4cc863a492e04446aa3118c 100644
--- a/src/views/customer/components/OrderItem.vue
+++ b/src/views/customer/components/OrderItem.vue
@@ -1,31 +1,64 @@
-
-
-
-
-
-
-
{{ goodsName }}
-
-
发送
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
{{ orderx.title }}
+
+
+
+
+
+
+
diff --git a/src/views/customer/components/OrderList.vue b/src/views/customer/components/OrderList.vue
index 90e15b8f047d4ec1f1d515d318e136f80e23b446..c2d415964fd3c420287ac97b63afe4f2e02c43b2 100644
--- a/src/views/customer/components/OrderList.vue
+++ b/src/views/customer/components/OrderList.vue
@@ -17,7 +17,8 @@
diff --git a/src/views/customer/components/consult.vue b/src/views/customer/components/consult.vue
index 82f817c301769b8d2a0234a5a80b8f897e68bd78..43f9dabf78be41cd97afa0f1bc7082b138f339a1 100644
--- a/src/views/customer/components/consult.vue
+++ b/src/views/customer/components/consult.vue
@@ -20,7 +20,7 @@
diff --git a/src/views/customer/components/text.vue b/src/views/customer/components/text.vue
index 6d386daf8d423b7d5a3e6a72ac237486b3c4b333..6f498a4f51fb106b6a9cb5de57ff4d0cb9cc5b6d 100644
--- a/src/views/customer/components/text.vue
+++ b/src/views/customer/components/text.vue
@@ -2,6 +2,7 @@
这是一个测试页面
+
携带参数跳转到商品详情或订单详情页面
{{ good.goodNO }}