master
2023-01-11 18:24:18 +08:00
parent 73acb0bc09
commit 8ea3843d61
11 changed files with 103 additions and 134 deletions

View File

@ -1,7 +1,7 @@
<template>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card" :stretch=true>
<el-tab-pane :label="toUser.storeFlag ? '正在咨询' : '他的足迹'" name="history">
<div style="margin-left: 12px;" v-if="toUser.storeFlag">
<div style="margin-left: 12px;">
<GoodsLink :goodsDetail="goodsDetail" v-if="toUser.userId === goodsDetail.storeId"
@sendMessage="submitSendMessage" />
<FootPrint :list="footPrintList" @loadMore="loadMoreFootPrint()" :orderList="orderPrintList"
@ -71,7 +71,6 @@ export default {
},
mounted () {
localStorage.setItem('storeFlag', this.toUser.storeFlag)
console.log(this.toUser.storeFlag, 'this.toUser.storeFlag');
if (this.toUser.storeFlag) {
this.getStoreDetail()
} else {
@ -143,6 +142,7 @@ export default {
// this.orderPrintList.push(...res.result.records)
}
})
console.log("this.orderPrintListthis.orderPrintList", this.orderPrintList);
},
//

View File

@ -472,7 +472,6 @@ export default {
//
loadChatRecords () {
console.log(this.records.length, 'this.records.length ')
if (this.loadRecord.pageNumber === 0 || this.params.clickFlag) {
this.loadRecord.pageNumber = 1
this.params.clickFlag = false

View File

@ -7,7 +7,8 @@
<dd v-for="item in list" v-infinite-scroll="loadMore">
<div class="base">
<div>
<img style="width: 60px; height: 60px;" :src="item.thumbnail" class="image" />
<img style="width: 60px; height: 60px;margin-left: 40px;box-sizing: border-box;" :src="item.thumbnail"
class="image" />
</div>
<div class="recent_views">
<el-tooltip class="item" effect="dark" :content="item.goodsName" placement="top-start">
@ -17,13 +18,14 @@
<div style="display: flex;">
<div style="margin-top: 20px;">
<span style="color: red;">{{ item.price }}</span>
<div class="goods_store_button">
<el-button type="danger" v-if="item.btnHide == 1 && toUser.storeFlag" size="mini"
@click="submitSendGoodsMessage(item)" plain>发送</el-button>
</div>
</div>
</div>
</div>
<div>
<el-button class="goods_store_button" type="danger" v-if="item.btnHide == 1" size="mini"
@click="submitSendGoodsMessage(item)" plain>发送</el-button>
</div>
</div>
<div class="Underline"></div>
</dd>
@ -43,8 +45,8 @@
<span class="orderGoodsName" @click="linkToOrders(item.sn)"> {{ item.groupName }}</span>
</el-tooltip>
<div class="orderBtn">
<el-button type="danger" class="store-button" v-if="item.btnHide == 1" size="mini"
@click="submitSendOrderMessage(item, index)" plain>发送</el-button>
<el-button type="danger" class="store-button" v-if="item.btnHide == 1 && toUser.storeFlag"
size="mini" @click="submitSendOrderMessage(item, index)" plain>发送</el-button>
</div>
</div>
<div class="order_footer">
@ -85,7 +87,6 @@ export default {
...mapGetters(["talkItems"]),
...mapState({
id: (state) => state.user.id,
toUser: (state) => state.user.toUser,
}),
},
@ -163,10 +164,11 @@ export default {
orderList: {
type: Array,
default: []
}
},
},
mounted () {
console.log(this.orderList, 'orderList');
// state.user.toUser
console.log(this.$store.state.user.toUser, ' this.$store.state.user.toUser this.$store.state.user.toUser this.$store.state.user.toUser');
this.btnHide = localStorage.getItem('btnHide')
}
}
@ -185,6 +187,8 @@ export default {
.Underline {
border: 1px solid silver;
width: 90%;
margin: 0 auto;
}
.recent_views {
@ -322,12 +326,11 @@ export default {
}
.goods_store_button {
display: inline;
background-color: white;
border-color: #F56C6C;
margin-top: 10px;
position: relative;
right: 60%;
top: 45%;
position: absolute;
left: 70%;
}
.base {

View File

@ -11,7 +11,7 @@
<span style="color: red;">{{ goodsDetail.price }}</span>
</div>
<div v-if="hide">
<el-button class="store-button" type="danger" v-if="!sendFlag && btnHide == 1" size="mini"
<el-button class="store-button" type="danger" v-if="sendFlag && btnHide == 1 && toUser.storeFlag" size="mini"
@click="submitSendMessage()" plain>发送</el-button>
</div>
</div>
@ -169,7 +169,7 @@ export default {
.image {
height: 100px;
margin-top: 3px;
width: 100px
width: 100px;
}
}

View File

@ -33,99 +33,66 @@
<p class="tip-title">发起投票</p>
</li> -->
<!-- <p class="text-tips no-select">-->
<!-- <span>按Enter发送 / Shift+Enter 换行</span>-->
<!-- <el-popover placement="top-end" width="600" trigger="click">-->
<!-- <div class="editor-books">-->
<!-- <div class="books-title">编辑说明:</div>-->
<!-- <p>-->
<!-- 1.-->
<!-- 支持上传QQ及微信截图在QQ或微信中截图后使用Ctrl+v上传图片-->
<!-- </p>-->
<!-- <p>-->
<!-- 2.-->
<!-- 支持浏览器及Word文档中的图片复制上传复制后使用Ctrl+v上传图片-->
<!-- </p>-->
<!-- <p>3. 支持图片拖拽上传</p>-->
<!-- <p>4. 支持文件上传 ( 文件小于100M ) </p>-->
<!-- <p>5. 按Enter发送 / Shift+Enter 换行</p>-->
<!-- <p>-->
<!-- 6.-->
<!-- 注意当文件正在上传时请勿关闭网页或离开当前对话框否则将导致文件停止上传或上传失败-->
<!-- </p>-->
<!-- </div>-->
<!-- <i class="el-icon-info" slot="reference" />-->
<!-- </el-popover>-->
<!-- </p>-->
<!-- <p class="text-tips no-select">-->
<!-- <span>按Enter发送 / Shift+Enter 换行</span>-->
<!-- <el-popover placement="top-end" width="600" trigger="click">-->
<!-- <div class="editor-books">-->
<!-- <div class="books-title">编辑说明:</div>-->
<!-- <p>-->
<!-- 1.-->
<!-- 支持上传QQ及微信截图在QQ或微信中截图后使用Ctrl+v上传图片-->
<!-- </p>-->
<!-- <p>-->
<!-- 2.-->
<!-- 支持浏览器及Word文档中的图片复制上传复制后使用Ctrl+v上传图片-->
<!-- </p>-->
<!-- <p>3. 支持图片拖拽上传</p>-->
<!-- <p>4. 支持文件上传 ( 文件小于100M ) </p>-->
<!-- <p>5. 按Enter发送 / Shift+Enter 换行</p>-->
<!-- <p>-->
<!-- 6.-->
<!-- 注意当文件正在上传时请勿关闭网页或离开当前对话框否则将导致文件停止上传或上传失败-->
<!-- </p>-->
<!-- </div>-->
<!-- <i class="el-icon-info" slot="reference" />-->
<!-- </el-popover>-->
<!-- </p>-->
</ul>
<el-popover
ref="popoverEmoticon"
placement="top-start"
trigger="click"
width="300"
popper-class="no-padding el-popover-em"
>
<el-popover ref="popoverEmoticon" placement="top-start" trigger="click" width="300"
popper-class="no-padding el-popover-em">
<MeEditorEmoticon ref="editorEmoticon" @selected="selecteEmoticon" />
</el-popover>
<form
enctype="multipart/form-data"
style="display: none"
ref="fileFrom"
>
<input
type="file"
ref="restFile"
accept="image/*"
@change="uploadImageChange"
/>
<form enctype="multipart/form-data" style="display: none" ref="fileFrom">
<input type="file" ref="restFile" accept="image/*" @change="uploadImageChange" />
<input type="file" ref="restFile2" @change="uploadFileChange" />
</form>
</el-header>
<el-main class="no-padding textarea">
<textarea
ref="textarea"
v-paste="pasteImage"
v-drag="dragPasteImage"
v-model.trim="editorText"
rows="6"
placeholder="你想要的聊点什么呢 ..."
@keydown="keydownEvent($event)"
@input="inputEvent($event)"
/>
<textarea ref="textarea" v-paste="pasteImage" v-drag="dragPasteImage" v-model.trim="editorText" rows="6"
placeholder="你想要的聊点什么呢 ..." @keydown="keydownEvent($event)" @input="inputEvent($event)" />
</el-main>
</el-container>
<!-- 图片查看器 -->
<MeEditorImageView
ref="imageViewer"
v-model="imageViewer.isShow"
:file="imageViewer.file"
@confirm="confirmUploadImage"
/>
<MeEditorImageView ref="imageViewer" v-model="imageViewer.isShow" :file="imageViewer.file"
@confirm="confirmUploadImage" />
<MeEditorRecorder v-if="recorder" @close="recorder = false" />
<!-- 代码块编辑器 -->
<TalkCodeBlock
v-if="codeBlock.isShow"
:edit-mode="codeBlock.editMode"
@close="codeBlock.isShow = false"
@confirm="confirmCodeBlock"
/>
<TalkCodeBlock v-if="codeBlock.isShow" :edit-mode="codeBlock.editMode" @close="codeBlock.isShow = false"
@confirm="confirmCodeBlock" />
<!-- 文件上传管理器 -->
<MeEditorFileManage ref="filesManager" v-model="filesManager.isShow" />
<MeEditorVote
v-if="vote.isShow"
@close="
() => {
this.vote.isShow = false;
}
"
/>
<MeEditorVote v-if="vote.isShow" @close="
() => {
this.vote.isShow = false;
}
" />
</div>
</template>
@ -156,20 +123,20 @@ export default {
MeEditorVote,
},
computed: {
talkUser() {
talkUser () {
return this.$store.state.dialogue.index_name;
},
isGroupTalk() {
isGroupTalk () {
return this.$store.state.dialogue.talk_type == 2;
},
},
watch: {
talkUser(n_index_name) {
talkUser (n_index_name) {
this.$refs.filesManager.clear();
this.editorText = this.getDraftText(n_index_name);
},
},
data() {
data () {
return {
//
editorText: "",
@ -205,13 +172,13 @@ export default {
},
methods: {
// 稿
getDraftText(index_name) {
getDraftText (index_name) {
console.log("findTalk(index_name)", findTalk(index_name));
return findTalk(index_name)?.draft_text || "";
},
//
pasteImage(e) {
pasteImage (e) {
let files = getPasteImgs(e);
if (files.length == 0) return;
@ -219,19 +186,19 @@ export default {
},
//
dragPasteImage(e) {
dragPasteImage (e) {
let files = getDragPasteImg(e);
if (files.length == 0) return;
this.openImageViewer(files[0]);
},
inputEvent(e) {
inputEvent (e) {
this.$emit("keyboard-event", e.target.value);
},
//
keydownEvent(e) {
keydownEvent (e) {
if (e.keyCode == 13 && this.editorText == "") {
e.preventDefault();
}
@ -256,13 +223,13 @@ export default {
},
//
uploadImageChange(e) {
uploadImageChange (e) {
this.openImageViewer(e.target.files[0]);
this.$refs.restFile.value = null;
},
//
uploadFileChange(e) {
uploadFileChange (e) {
let maxsize = 100 * 1024 * 1024;
if (e.target.files.length == 0) {
return false;
@ -288,13 +255,13 @@ export default {
},
//
openImageViewer(file) {
openImageViewer (file) {
this.imageViewer.isShow = true;
this.imageViewer.file = file;
},
//
confirmCodeBlock(data) {
confirmCodeBlock (data) {
const { talk_type, receiver_id } = this.$store.state.dialogue;
ServeSendTalkCodeBlock({
talk_type,
@ -315,7 +282,7 @@ export default {
},
//
confirmUploadImage() {
confirmUploadImage () {
let fileData = new FormData();
fileData.append("file", this.imageViewer.file);
@ -340,7 +307,8 @@ export default {
},
//
selecteEmoticon(data) {
selecteEmoticon (data) {
console.log(data);
if (data.type == 1) {
let value = this.editorText;
let el = this.$refs.textarea;
@ -362,6 +330,8 @@ export default {
}
} else {
const { talk_type, receiver_id } = this.$store.state.dialogue;
console.log(talk_type);
console.log(receiver_id);
ServeSendEmoticon({
talk_type,
receiver_id,

View File

@ -2,7 +2,6 @@
<div class="welcome-box">
<div class="famous-box">
<img src="~@/assets/image/chat.png" width="300" />
</div>
</div>
</template>
@ -10,10 +9,10 @@
<script>
export default {
components: {},
data() {
data () {
return {}
},
created() {},
created () { },
methods: {},
}
</script>

View File

@ -46,9 +46,9 @@ class Talk extends Base {
this.resource = resource;
// 判断发送者消息是否在当前用户列表中
if(this.sender_id && !vm.$store.state.talks.items.find(item=>{
if (this.sender_id && !vm.$store.state.talks.items.find(item => {
return item.userId == this.sender_id
})){
})) {
// 没有当前用户,未在当前列表 进行重新加载
vm.loadUserSetting('update')
}
@ -58,7 +58,7 @@ class Talk extends Base {
* 判断消息发送者是否来自于我
* @returns
*/
isCurrSender() {
isCurrSender () {
// console.log("sender_id", this.sender_id);
return this.sender_id == this.getAccountId();
}
@ -68,7 +68,7 @@ class Talk extends Base {
*
* @return String
*/
getIndexName() {
getIndexName () {
if (this.talk_type == 2) {
return `${this.talk_type}_${this.receiver_id}`;
}
@ -83,7 +83,7 @@ class Talk extends Base {
*
* @returns
*/
getFloatType() {
getFloatType () {
let userId = this.resource.userId;
if (userId == 0) return "center";
@ -94,18 +94,21 @@ class Talk extends Base {
/**
* 获取聊天列表左侧的对话信息
*/
getTalkText() {
getTalkText () {
let text = this.resource.content || this.resource.text;
switch (this.resource.msg_type) {
case 'GOODS':
text = "[商品链接]";
break;
case 'ORDERS':
text = "[订单链接]";
break;
}
return text;
}
handle() {
handle () {
let store = this.getStoreInstance();
// console.log("触发handle");
// 判断当前是否在聊天页面
@ -131,7 +134,7 @@ class Talk extends Base {
* 显示消息提示
* @returns
*/
showMessageNocice() {
showMessageNocice () {
let avatar = this.resource.avatar;
let nickname = this.resource.nickname;
let talk_type = this.resource.talk_type;
@ -167,7 +170,7 @@ class Talk extends Base {
/**
* 加载对接节点
*/
addTalkItem() {
addTalkItem () {
let receiver_id = this.sender_id;
let talk_type = this.talk_type;
@ -188,7 +191,7 @@ class Talk extends Base {
/**
* 插入对话记录
*/
insertTalkRecord() {
insertTalkRecord () {
let store = this.getStoreInstance();
let record = this.resource;
// console.log("插入谈话记录", record);
@ -238,7 +241,7 @@ class Talk extends Base {
/**
* 更新对话列表记录
*/
updateTalkItem() {
updateTalkItem () {
let store = this.getStoreInstance();
store.commit("INCR_UNREAD_NUM");

View File

@ -65,7 +65,6 @@ class WsSocket {
*/
on (event, callBack) {
// 对应 socket-instance.js
console.log("事件绑定", event, callBack);
this.onCallBacks[event] = callBack;
return this;
}

View File

@ -21,7 +21,6 @@ const Talk = {
getters: {
// 过滤所有置顶对话列表
topItems: (state) => {
console.log(state.items, 'state.items');
return state.items.filter((item) => item.is_top == 1);
},
talkItems: (state) => {
@ -40,7 +39,6 @@ const Talk = {
mutations: {
// 设置对话列表
SET_TALK_ITEMS (state, resource) {
console.log("设置对话列表", resource.items);
Vue.set(state, 'items', resource.items)
},

View File

@ -10,7 +10,7 @@ const KEY_INDEX_NAME = "send_message_index_name";
*
* @param {String} index_name
*/
export function findTalkIndex(index_name) {
export function findTalkIndex (index_name) {
return store.state.talks.items.findIndex(
(item) => item.index_name == index_name
);
@ -21,7 +21,7 @@ export function findTalkIndex(index_name) {
*
* @param {String} index_name
*/
export function findTalk(index_name) {
export function findTalk (index_name) {
return store.state.talks.items.find((item) => item.index_name == index_name);
}
@ -30,8 +30,7 @@ export function findTalk(index_name) {
*
* @param {Object} params
*/
export function formatTalkItem(params) {
console.log(params);
export function formatTalkItem (params) {
let options = {
id: "",
disable: false,
@ -58,7 +57,7 @@ export function formatTalkItem(params) {
* @param {Integer} talk_type 对话类型[1:私聊;2:群聊;]
* @param {Integer} receiver_id 接收者ID
*/
export function toTalk(talk_type, receiver_id) {
export function toTalk (talk_type, receiver_id) {
ServeCreateTalkList(receiver_id).then(({ code, data }) => {
console.log("ServeCreateTalkList", data);
if (code == 200) {
@ -78,7 +77,7 @@ export function toTalk(talk_type, receiver_id) {
*
* @returns
*/
export function getCacheIndexName() {
export function getCacheIndexName () {
let index_name = sessionStorage.getItem(KEY_INDEX_NAME);
if (index_name) {
sessionStorage.removeItem(KEY_INDEX_NAME);

View File

@ -80,8 +80,8 @@
<div class="card-name">
<p class="nickname">
{{
item.remark_name ? item.remark_name : item.name
}}
item.remark_name ? item.remark_name : item.name
}}
</p>
<div v-show="item.unread" class="larkc-tag">
{{ item.unread }}条未读
@ -112,8 +112,8 @@
</div>
<div class="content">
<template v-if="
index_name != item.index_name && item.draft_text
">
index_name != item.index_name && item.draft_text
">
<span class="draft-color">[草稿]</span>
<span>{{ item.draft_text }}</span>
</template>
@ -424,7 +424,6 @@ export default {
this.$nextTick(() => {
if (id == this.index_name.split("_")[1]) {
console.log("已读");
this.$store.commit("UPDATE_TALK_ITEM", {
userId: id,
index_name: "MESSAGE_" + this.index_name.split("_")[1],