IM功能
commit
d371fd0146
|
@ -7,10 +7,6 @@ var BASE = {
|
|||
buyer: "https://buyer-api.pickmall.cn",
|
||||
seller: "https://store-api.pickmall.cn",
|
||||
manager: "https://admin-api.pickmall.cn"
|
||||
// common: "http://192.168.0.105:8890",
|
||||
// buyer: "http://192.168.0.105:8888",
|
||||
// seller: "http://192.168.0.105:8889",
|
||||
// manager: "http://192.168.0.105:8887"
|
||||
},
|
||||
API_PROD: {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
|
@ -18,4 +14,4 @@ var BASE = {
|
|||
seller: "https://store-api.pickmall.cn",
|
||||
manager: "https://admin-api.pickmall.cn"
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
<span class="mr_10" v-if="goodsMsg.data">
|
||||
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
|
||||
goodsMsg.data.storeName
|
||||
}}</router-link>
|
||||
}}</router-link>
|
||||
</span>
|
||||
<span @click="collect">
|
||||
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
||||
{{ storeCollected ? "已收藏店铺" : "收藏店铺" }}
|
||||
{{ storeCollected? "已收藏店铺": "收藏店铺" }}
|
||||
</span>
|
||||
<span class="ml_10" @click="IMService()">联系客服</span>
|
||||
</div>
|
||||
|
@ -92,6 +92,17 @@ export default {
|
|||
"&skuId=" +
|
||||
this.goodsMsg.data.id
|
||||
);
|
||||
// window.open(
|
||||
// 'http://192.168.0.139:8000/' +
|
||||
// "?token=" +
|
||||
// accessToken +
|
||||
// "&id=" +
|
||||
// this.goodsMsg.data.storeId +
|
||||
// "&goodsId=" +
|
||||
// this.goodsMsg.data.goodsId +
|
||||
// "&skuId=" +
|
||||
// this.goodsMsg.data.id
|
||||
// );
|
||||
},
|
||||
// 获取im信息
|
||||
async getIMDetailMethods () {
|
||||
|
|
5
im/.env
5
im/.env
|
@ -3,5 +3,8 @@ VUE_APP_PREVIEW=false
|
|||
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
||||
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
||||
VUE_APP_COMMON=https://common-api.pickmall.cn
|
||||
VUE_APP_BUYER=https://buyer-api.pickmall.cn
|
||||
VUE_APP_SELLER=https://seller-api.pickmall.cn
|
||||
VUE_APP_WEBSITE_NAME="LiLi IM"
|
||||
VUE_APP_PC_ORDER_URL=https://store-b2b2c.pickmall.cn
|
||||
VUE_APP_PC_URL=https://pc-b2b2c.pickmall.cn/
|
||||
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
|
@ -1,7 +1,10 @@
|
|||
NODE_ENV=development
|
||||
VUE_APP_PREVIEW=true
|
||||
VUE_APP_API_BASE_URL=http://192.168.0.113:8885
|
||||
VUE_APP_WEB_SOCKET_URL=ws://192.168.0.113:8885/lili/webSocket
|
||||
VUE_APP_COMMON=http://192.168.0.113:8890
|
||||
VUE_APP_PC_URL="http://192.168.0.113:10001"
|
||||
VUE_APP_PREVIEW=false
|
||||
VUE_APP_API_BASE_URL=https://im-api.pickmall.cn
|
||||
VUE_APP_WEB_SOCKET_URL=wss://im-api.pickmall.cn/lili/webSocket
|
||||
VUE_APP_COMMON=https://common-api.pickmall.cn
|
||||
VUE_APP_BUYER=https://buyer-api.pickmall.cn
|
||||
VUE_APP_SELLER=https://seller-api.pickmall.cn
|
||||
VUE_APP_WEBSITE_NAME="LiLi IM"
|
||||
VUE_APP_PC_URL=https://pc-b2b2c.pickmall.cn/
|
||||
VUE_APP_PC_STORE=https://store-b2b2c.pickmall.cn/
|
|
@ -1,30 +1,47 @@
|
|||
import { get } from "@/utils/request";
|
||||
import config from "@/config/config";
|
||||
|
||||
// 获取用户相关设置信息
|
||||
export const ServeGetUserSetting = () => {
|
||||
return get("/im/user");
|
||||
return get(`${config.BASE_BUYER}/buyer/passport/member`);
|
||||
};
|
||||
|
||||
// 获取店铺相关设置信息
|
||||
export const ServeGetStoreSetting = () => {
|
||||
return get("/im/user/store");
|
||||
return get(`${config.BASE_SELLER}/store/member/user`);
|
||||
};
|
||||
|
||||
// 获取用户相关设置信息
|
||||
export const ServeGetUserDetail = (memberId) => {
|
||||
return get(`/im/user/${memberId}`);
|
||||
return get(`${config.BASE_SELLER}/store/passport/member/${memberId}`);
|
||||
};
|
||||
|
||||
// 获取店铺相关设置信息
|
||||
export const ServeGetStoreDetail = (storeId) => {
|
||||
return get(`/im/user/store/${storeId}`);
|
||||
return get(`${config.BASE_BUYER}/buyer/store/store/store/${storeId}`);
|
||||
};
|
||||
|
||||
// 获取店铺相关设置信息
|
||||
// 获取用户历史足迹
|
||||
export const ServeGetFootPrint = (params) => {
|
||||
return get(`/im/user/history`,params);
|
||||
return get(`${config.BASE_BUYER}/buyer/member/footprint`,params);
|
||||
};
|
||||
// 获取订单列表信息
|
||||
|
||||
// 商家获取用户历史足迹
|
||||
export const ServeStoreGetFootPrint = (params) => {
|
||||
return get(`${config.BASE_SELLER}/store/member/footprint`,params);
|
||||
};
|
||||
|
||||
// 获取用户订单列表信息
|
||||
export const ServeGetOrderPrint = (params) => {
|
||||
return get(`/im/orders/orders`,params);
|
||||
return get(`${config.BASE_BUYER}/buyer/order/order`,params);
|
||||
};
|
||||
|
||||
// 商家获取用户订单列表信息
|
||||
export const ServeStoreGetOrderPrint = (params) => {
|
||||
return get(`${config.BASE_SELLER}/store/order/order`,params);
|
||||
};
|
||||
|
||||
// 获取商品信息
|
||||
export const ServeGetGoodsDetail = (data) => {
|
||||
return get(`${config.BASE_BUYER}/buyer/goods/goods/sku/${data.goodsId}/${data.skuId}`);
|
||||
};
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
<template>
|
||||
<div
|
||||
class="text-message"
|
||||
:class="{
|
||||
<div class="text-message" :class="{
|
||||
left: float == 'left',
|
||||
right: float == 'right',
|
||||
'max-width': !fullWidth,
|
||||
}"
|
||||
>
|
||||
}">
|
||||
<div v-if="arrow" class="arrow"></div>
|
||||
<pre v-html="html" />
|
||||
</div>
|
||||
|
@ -35,12 +32,12 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
html: "",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
const text = textReplaceLink(
|
||||
this.content,
|
||||
this.float == "right" ? "#ffffff" : "rgb(9 149 208)"
|
||||
|
|
|
@ -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"
|
||||
|
@ -18,8 +18,7 @@
|
|||
|
||||
<script>
|
||||
import { Tabs, TabPane } from 'element-ui'
|
||||
import { ServeGetStoreDetail, ServeGetUserDetail, ServeGetFootPrint, ServeGetOrderPrint } from '@/api/user'
|
||||
import { ServeGetGoodsDetail } from '@/api/goods'
|
||||
import { ServeGetStoreDetail, ServeGetUserDetail, ServeGetFootPrint, ServeGetOrderPrint, ServeGetGoodsDetail, ServeStoreGetFootPrint,ServeStoreGetOrderPrint } from '@/api/user'
|
||||
import StoreDetail from "@/components/chat/panel/template/storeDetail.vue";
|
||||
import FootPrint from "@/components/chat/panel/template/footPrint.vue";
|
||||
import GoodsLink from "@/components/chat/panel/template/goodsLink.vue";
|
||||
|
@ -53,6 +52,23 @@ export default {
|
|||
index_name: (state) => state.dialogue.index_name,
|
||||
}),
|
||||
},
|
||||
watch:{
|
||||
toUser(){
|
||||
localStorage.setItem('storeFlag', this.toUser.storeFlag)
|
||||
this.footPrintList = []
|
||||
this.orderPrintList = []
|
||||
if (this.toUser.storeFlag) {
|
||||
this.getStoreDetail()
|
||||
}
|
||||
// else {
|
||||
// this.getMemberDetail()
|
||||
// }
|
||||
this.getFootPrint()
|
||||
if (this.goodsParams && this.toUser.storeFlag == true) {
|
||||
this.getGoodsDetail()
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
activeName: 'history',
|
||||
|
@ -70,13 +86,15 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
localStorage.setItem('storeFlag', this.toUser.storeFlag)
|
||||
if (this.toUser.storeFlag) {
|
||||
this.getStoreDetail()
|
||||
} else {
|
||||
this.getMemberDetail()
|
||||
}
|
||||
// else {
|
||||
// this.getMemberDetail()
|
||||
// }
|
||||
this.getFootPrint()
|
||||
if (this.goodsParams) {
|
||||
if (this.goodsParams && this.toUser.storeFlag == true) {
|
||||
this.getGoodsDetail()
|
||||
}
|
||||
},
|
||||
|
@ -94,28 +112,26 @@ export default {
|
|||
this.getFootPrint()
|
||||
},
|
||||
handleClick () { },
|
||||
getMemberDetail () {
|
||||
ServeGetUserDetail(this.toUser.userId).then(res => {
|
||||
if (res.success) {
|
||||
this.memberInfo = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// getMemberDetail () {
|
||||
// ServeGetUserDetail(this.toUser.userId).then(res => {
|
||||
// if (res.success) {
|
||||
// this.memberInfo = res.result
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
getGoodsDetail () {
|
||||
if(this.toUser.storeFlag){
|
||||
ServeGetGoodsDetail(this.goodsParams).then(res => {
|
||||
if (res.success) {
|
||||
this.goodsDetail = res.result.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getFootPrint () {
|
||||
getFootPrint() {
|
||||
if (this.toUser.storeFlag) {
|
||||
this.footPrintParams.memberId = this.id
|
||||
this.footPrintParams.storeId = this.toUser.userId
|
||||
} else {
|
||||
this.footPrintParams.memberId = this.toUser.userId
|
||||
this.footPrintParams.storeId = this.id
|
||||
}
|
||||
ServeGetFootPrint(this.footPrintParams).then(res => {
|
||||
res.result.records.forEach((item, index) => {
|
||||
if (localStorage.getItem(item.goodsId)) {
|
||||
|
@ -129,6 +145,7 @@ export default {
|
|||
});
|
||||
this.footPrintList.push(...res.result.records)
|
||||
})
|
||||
|
||||
// 订单列表
|
||||
ServeGetOrderPrint(this.footPrintParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
@ -138,9 +155,35 @@ export default {
|
|||
btnHide: 1
|
||||
})
|
||||
})
|
||||
// this.orderPrintList.push(...res.result.records)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.footPrintParams.memberId = this.toUser.userId
|
||||
this.footPrintParams.storeId = this.id
|
||||
ServeStoreGetFootPrint(this.footPrintParams).then(res => {
|
||||
res.result.records.forEach((item, index) => {
|
||||
if (localStorage.getItem(item.goodsId)) {
|
||||
item.btnHide = 0
|
||||
} else {
|
||||
item.btnHide = 1
|
||||
}
|
||||
if (item.goodsId === this.goodsParams.goodsId) {
|
||||
res.result.records.splice(index, 1)
|
||||
}
|
||||
});
|
||||
this.footPrintList.push(...res.result.records)
|
||||
})
|
||||
ServeStoreGetOrderPrint(this.footPrintParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
res.result.records.forEach((item) => {
|
||||
this.orderPrintList.push({
|
||||
...item,
|
||||
btnHide: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 发送消息回调事件
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<div v-else class="message-box record-box" :class="{
|
||||
'direction-rt': item.float == 'right',
|
||||
'checkbox-border': multiSelect.isOpen === true,
|
||||
}">
|
||||
}">
|
||||
<aside v-show="multiSelect.isOpen" class="checkbox-column">
|
||||
<i class="el-icon-success" :class="{ selected: verifyMultiSelect(item.id) }"
|
||||
@click="triggerMultiSelect(item.id)" />
|
||||
|
@ -59,48 +59,63 @@
|
|||
{{ unixToDate(item.createTime, "MM月dd日 hh:mm") }}
|
||||
</span>
|
||||
<!-- 文本消息 -->
|
||||
<div v-if="item.messageType == 'MESSAGE'" class="text-message" :class="{
|
||||
<div v-if="item.messageType == 'MESSAGE'" style="background-color: #d0e9ff;color: black;"
|
||||
class="text-message" :class="{
|
||||
left: item.float == 'left',
|
||||
right: item.float == 'right',
|
||||
}">
|
||||
}">
|
||||
<div class="arrow"></div>
|
||||
|
||||
<pre v-html="item.text" />
|
||||
<pre v-if="!emojistwo.includes(item.text)" v-html="item.text" />
|
||||
<pre v-if="emojistwo.includes(item.text)" v-html="textReplaceEmoji(item.text)" />
|
||||
</div>
|
||||
|
||||
<div v-if="item.messageType == 'GOODS' && item.text != null" class="text-message" :class="{
|
||||
<div v-if="item.messageType == 'GOODS' && item.text != null" class="goodsStyle " :class="{
|
||||
left: item.float == 'left',
|
||||
right: item.float == 'right',
|
||||
}">
|
||||
}">
|
||||
<div class="base" @click="linkToGoods(item.text.goodsId, item.text.id)">
|
||||
<div>
|
||||
<img :src="item.text.thumbnail" class="image" />
|
||||
</div>
|
||||
<div style="margin-left: 13px">
|
||||
<a> {{ item.text.goodsName }} </a>
|
||||
<div>
|
||||
<span style="color: red;">¥{{ item.text.price }}</span>
|
||||
<div class="goods_name">
|
||||
<el-tooltip class="item" effect="dark" :content="item.text.goodsName" placement="top-start">
|
||||
<a> {{ item.text.goodsName }} </a>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span>¥{{ item.text.price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.messageType == 'ORDER' && item.text != null" class="text-message" :class="{
|
||||
<div v-if="item.messageType == 'ORDER' && item.text != null" class="oderStyle" :class="{
|
||||
left: item.float == 'left',
|
||||
right: item.float == 'right',
|
||||
}">
|
||||
}">
|
||||
<div class="oedersn">
|
||||
<el-tooltip class="item" effect="dark" :content="item.text.sn" placement="top-start">
|
||||
<a> 订单号:{{ item.text.sn }} </a>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="baseTwo">
|
||||
<img :src="item.text.groupImages" style="height: 100px;width: 100px;margin-top: 10px;" />
|
||||
<span class="orderGoodsName" @click="linkToOrders(item.text.sn)">{{ item.text.groupName }}</span>
|
||||
<span class="orderGoodsTime">{{ item.text.paymentTime }}</span>
|
||||
<span class="orderFlowPrice">
|
||||
订单金额:¥{{ item.text.flowPrice }}
|
||||
</span>
|
||||
<span class="order_status"
|
||||
:style="{ 'color': item.text.orderStatus == 'CANCELLED' || item.text.orderStatus == 'UNPAID' || item.text.orderStatus == ' TAKE' ? '#5a606b' : '#f23030' }">{{
|
||||
item.text.orderStatus == 'CANCELLED' ? '已取消' : item.text.orderStatus == 'UNPAID' ? '未付款' :
|
||||
item.text.orderStatus ==
|
||||
'PAID' ? '已付款' : item.text.orderStatus == 'UNDELIVERED' ? '待发货' : item.text.orderStatus ==
|
||||
'DELIVERED'
|
||||
? '已发货' : item.text.orderStatus == ' COMPLETED' ? '已完成' : item.text.orderStatus == ' TAKE' ?
|
||||
'待校验' : ''
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 图片消息 -->
|
||||
<!-- <image-message
|
||||
v-else-if="item.messageType == 2 && item.file.file_type == 1"
|
||||
:src="item.file.file_url"
|
||||
@contextmenu.native="onCopy(idx, item, $event)"
|
||||
/> -->
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
@ -152,7 +167,7 @@
|
|||
talk_type: params.talk_type,
|
||||
receiver_id: params.receiver_id,
|
||||
title: params.nickname,
|
||||
}" @close="findChatRecord = false" />
|
||||
}" @close="findChatRecord = false" />
|
||||
</transition>
|
||||
|
||||
<!-- 链接信息 -->
|
||||
|
@ -161,7 +176,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import { textReplaceLink } from "@/utils/functions";
|
||||
import { textReplaceEmoji } from "@/utils/emojis";
|
||||
import { textReplaceEmoji, emojistwo } from "@/utils/emojis";
|
||||
import OtherLink from "@/components/chat/panel/OtherLink.vue";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import TalkSearchRecord from "@/components/chat/TalkSearchRecord";
|
||||
|
@ -218,6 +233,7 @@ export default {
|
|||
return {
|
||||
// 记录加载相关参数
|
||||
textReplaceEmoji,
|
||||
emojistwo,
|
||||
textReplaceLink,
|
||||
loadRecord: {
|
||||
status: 0,
|
||||
|
@ -277,6 +293,7 @@ export default {
|
|||
mode: 0,
|
||||
};
|
||||
this.loadChatRecords();
|
||||
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
|
@ -372,7 +389,6 @@ export default {
|
|||
|
||||
// 回车键发送消息回调事件
|
||||
submitSendMessage (content) {
|
||||
console.log("发送", content);
|
||||
const record = {
|
||||
operation_type: "MESSAGE",
|
||||
to: this.params.receiver_id,
|
||||
|
@ -381,6 +397,9 @@ export default {
|
|||
context: content,
|
||||
talk_id: this.params.talkId,
|
||||
};
|
||||
// if (record.messageType == 'MESSAGE"') {
|
||||
// record.text = this.textReplaceEmoji(record.content)
|
||||
// }
|
||||
SocketInstance.emit("event_talk", record);
|
||||
|
||||
this.$store.commit("UPDATE_TALK_ITEM", {
|
||||
|
@ -400,8 +419,6 @@ export default {
|
|||
text: content,
|
||||
float: "right",
|
||||
};
|
||||
|
||||
console.log("insterChat", insterChat);
|
||||
// console.log("插入对话记录",'')
|
||||
// 插入对话记录
|
||||
this.$store.commit("PUSH_DIALOGUE", insterChat);
|
||||
|
@ -457,7 +474,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
|
||||
|
@ -486,6 +502,9 @@ export default {
|
|||
if (item.messageType == 'GOODS') {
|
||||
item.text = JSON.parse(item.text)
|
||||
}
|
||||
// if (item.messageType == 'MESSAGE"') {
|
||||
// item.text = this.textReplaceEmoji(item.text)
|
||||
// }
|
||||
if (item.messageType == 'ORDER') {
|
||||
item.text = JSON.parse(item.text)
|
||||
}
|
||||
|
@ -496,7 +515,8 @@ export default {
|
|||
? (this.loadRecord.status = 1)
|
||||
: (this.loadRecord.status = 2);
|
||||
this.$nextTick(() => {
|
||||
if (data.record_id == 0 || !data.record_id) {
|
||||
// if (data.record_id == 0 || !data.record_id) {
|
||||
if (data.record_id == 0 || data.pageNumber == 1) {
|
||||
el.scrollTop = el.scrollHeight
|
||||
} else {
|
||||
el.scrollTop = el.scrollHeight - scrollHeight
|
||||
|
@ -820,6 +840,67 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.order_status {
|
||||
height: 30px;
|
||||
width: 60px;
|
||||
background: #ffeded;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
margin-left: 15px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.oderStyle {
|
||||
border: 1px solid #f2f2f2;
|
||||
width: 330px;
|
||||
border-radius: 4px;
|
||||
|
||||
.oedersn {
|
||||
margin: 10px 0 10px 5px;
|
||||
width: 300px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.goodsStyle {
|
||||
border: 1px solid #f2f2f2;
|
||||
width: 300px;
|
||||
height: 120px;
|
||||
display: flex;
|
||||
border-radius: 4px;
|
||||
|
||||
.goods_name {
|
||||
color: black;
|
||||
width: 150px;
|
||||
font-size: 15px;
|
||||
color: #333333;
|
||||
margin-top: 30px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.image {
|
||||
height: 70px;
|
||||
margin-top: 3px;
|
||||
width: 70px;
|
||||
background-size: cover;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #999;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.base {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.orderSn {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
@ -830,7 +911,7 @@ export default {
|
|||
width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
// white-space: nowrap;
|
||||
position: absolute;
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
|
@ -838,9 +919,14 @@ export default {
|
|||
|
||||
.orderGoodsTime {
|
||||
margin-left: 10px;
|
||||
color: red;
|
||||
color: #999;
|
||||
position: absolute;
|
||||
margin-top: 35px;
|
||||
margin-top: 70px;
|
||||
}
|
||||
|
||||
.orderFlowPrice {
|
||||
color: #999;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.main-box {
|
||||
|
@ -904,26 +990,26 @@ export default {
|
|||
}
|
||||
|
||||
|
||||
.base {
|
||||
margin-top: 5px;
|
||||
height: 120px;
|
||||
display: flex;
|
||||
// .base {
|
||||
// margin-top: 5px;
|
||||
// height: 120px;
|
||||
// display: flex;
|
||||
|
||||
div {
|
||||
width: 100px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-top: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
// div {
|
||||
// width: 100px;
|
||||
// // overflow: hidden;
|
||||
// // text-overflow: ellipsis;
|
||||
// margin-top: 8px;
|
||||
// // white-space: nowrap;
|
||||
// }
|
||||
|
||||
.image {
|
||||
height: 100px;
|
||||
margin-top: 3px;
|
||||
width: 100px
|
||||
}
|
||||
// .image {
|
||||
// height: 100px;
|
||||
// margin-top: 3px;
|
||||
// width: 100px
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
.talk-bubble {
|
||||
position: absolute;
|
||||
|
@ -1101,7 +1187,7 @@ export default {
|
|||
}
|
||||
|
||||
@bg-left-color: #f5f5f5;
|
||||
@bg-right-color: #1ebafc;
|
||||
@bg-right-color: #ffffff;
|
||||
|
||||
.text-message {
|
||||
position: relative;
|
||||
|
|
|
@ -7,37 +7,60 @@
|
|||
<dd v-for="item in list" v-infinite-scroll="loadMore">
|
||||
<div class="base">
|
||||
<div>
|
||||
<img :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 style="margin-left: 13px">
|
||||
<div class="recent_views">
|
||||
<el-tooltip class="item" effect="dark" :content="item.goodsName" placement="top-start">
|
||||
<a class="goods_name" @click="linkToGoods(item.goodsId, item.id)">{{ item.goodsName }}</a>
|
||||
<div style="margin-top: 8px;">
|
||||
</el-tooltip>
|
||||
|
||||
<div style="display: flex;">
|
||||
<div style="margin-top: 20px;">
|
||||
<span style="color: red;">¥{{ item.price }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button class="store-button" type="danger" v-if="item.btnHide == 1" size="mini"
|
||||
<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>
|
||||
<div class="Underline"></div>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="订单列表" name="orders">
|
||||
<dl>
|
||||
<dd v-for="(item, index) in orderList" v-infinite-scroll="loadMore" :key="index">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<span class="orderSn">订单号:{{ item.sn }}</span>
|
||||
<img :src="item.groupImages" alt=""
|
||||
style="height: 100px; width: 100px;margin-top: 10px; vertical-align: middle; ">
|
||||
<span class="orderGoodsName" @click="linkToOrders(item.sn)"> {{ item.groupName }}</span>
|
||||
<span style="margin-left: 10px; color: red;">{{ item.paymentTime }}</span>
|
||||
<div class="orderBtn">
|
||||
<el-button type="danger" class="store-button" v-if="item.btnHide == 1" size="mini"
|
||||
@click="submitSendOrderMessage(item, index)" plain>发送</el-button>
|
||||
<div class="orderlist">
|
||||
<div class="order_top">
|
||||
<span class="order_sn">订单号:{{ item.sn }}</span>
|
||||
</div>
|
||||
<div class="order_section">
|
||||
<img :src="item.groupImages" alt="">
|
||||
<el-tooltip class="item" effect="dark" :content="item.groupName" placement="top-start">
|
||||
<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 && toUser.storeFlag"
|
||||
size="mini" @click="submitSendOrderMessage(item, index)" plain>发送</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order_footer">
|
||||
<span> 订单金额: <span style="color: red;">¥{{ item.orderItems[0].goodsPrice }}</span></span>
|
||||
<span class="order_status" v-if="item.orderStatus"
|
||||
:style="{ 'color': item.orderStatus == 'CANCELLED' || item.orderStatus == 'UNPAID' || item.orderStatus == 'TAKE' ? '#5a606b' : '#f23030' }">{{
|
||||
item.orderStatus == 'CANCELLED' ? '已取消' : item.orderStatus == 'UNPAID' ? '未付款' : item.orderStatus ==
|
||||
'PAID' ? '已付款' : item.orderStatus == 'UNDELIVERED' ? '待发货' : item.orderStatus == 'DELIVERED'
|
||||
? '已发货' : item.orderStatus == 'COMPLETED' ? '已完成' : item.orderStatus == 'TAKE' ? '待校验' : ''
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="Underline"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</el-tab-pane>
|
||||
|
@ -53,7 +76,7 @@ export default {
|
|||
directives: {
|
||||
"infinite-scroll": InfiniteScroll,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
activeName: 'goods',
|
||||
btnHide: undefined,
|
||||
|
@ -64,7 +87,6 @@ export default {
|
|||
...mapGetters(["talkItems"]),
|
||||
...mapState({
|
||||
id: (state) => state.user.id,
|
||||
|
||||
toUser: (state) => state.user.toUser,
|
||||
}),
|
||||
},
|
||||
|
@ -77,17 +99,17 @@ export default {
|
|||
methods: {
|
||||
//跳转订单列表
|
||||
|
||||
scrollBottom (e) {
|
||||
scrollBottom(e) {
|
||||
const { scrollTop, scrollHeight, clientHeight } = e.srcElement
|
||||
if (scrollTop + clientHeight >= scrollHeight) {
|
||||
this.$emit('loadMore')
|
||||
}
|
||||
},
|
||||
loadMore () {
|
||||
loadMore() {
|
||||
|
||||
},
|
||||
// 发送消息回调事件
|
||||
submitSendGoodsMessage (item) {
|
||||
submitSendGoodsMessage(item) {
|
||||
const context = {
|
||||
id: item.id,
|
||||
goodsId: item.goodsId,
|
||||
|
@ -108,12 +130,15 @@ export default {
|
|||
item.btnHide = 0
|
||||
},
|
||||
// 发送订单列表
|
||||
submitSendOrderMessage (item, index) {
|
||||
submitSendOrderMessage(item, index) {
|
||||
console.log(item, 'item');
|
||||
const context = {
|
||||
sn: item.sn,
|
||||
groupImages: item.groupImages,
|
||||
paymentTime: item.paymentTime,
|
||||
groupName: item.groupName,
|
||||
flowPrice: item.flowPrice,
|
||||
orderStatus: item.orderStatus
|
||||
}
|
||||
const record = {
|
||||
operation_type: "MESSAGE",
|
||||
|
@ -127,7 +152,7 @@ export default {
|
|||
localStorage.setItem(item.goodsId, 0)
|
||||
item.btnHide = 0
|
||||
},
|
||||
handleClick (tab, event) {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
},
|
||||
|
@ -139,10 +164,11 @@ export default {
|
|||
orderList: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
console.log(this.orderList, 'orderList');
|
||||
},
|
||||
mounted() {
|
||||
// state.user.toUser
|
||||
console.log(this.orderList, ' this.$store.state.user.toUser this.$store.state.user.toUser this.$store.state.user.toUser');
|
||||
this.btnHide = localStorage.getItem('btnHide')
|
||||
}
|
||||
}
|
||||
|
@ -150,6 +176,94 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.order_status {
|
||||
height: 25px;
|
||||
width: 60px;
|
||||
background: #ffeded;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.Underline {
|
||||
border: 1px solid silver;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.recent_views {
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 400px;
|
||||
|
||||
.top {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.left {
|
||||
float: left;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.right {
|
||||
float: right;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
.left .el-tooltip__popper,
|
||||
.right .el-tooltip__popper {
|
||||
padding: 8px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.Underline {
|
||||
// border: 5px solid red;
|
||||
}
|
||||
|
||||
.orderlist {
|
||||
margin-bottom: 10px;
|
||||
background: #fff;
|
||||
color: #5a606b;
|
||||
}
|
||||
|
||||
.order_top {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
|
||||
.order_sn {}
|
||||
}
|
||||
|
||||
.order_section {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
height: 100px;
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.order_footer {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.orderGoodsName {
|
||||
width: 200px;
|
||||
overflow: hidden;
|
||||
|
@ -158,6 +272,7 @@ export default {
|
|||
position: absolute;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.orderSn {
|
||||
|
@ -171,18 +286,13 @@ export default {
|
|||
justify-content: flex-end;
|
||||
margin-right: 15px;
|
||||
position: relative;
|
||||
bottom: 30px;
|
||||
bottom: 55px;
|
||||
}
|
||||
|
||||
.goods_name {
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
/deep/ .el-tabs__item.is-top:last-child {
|
||||
|
@ -215,9 +325,17 @@ export default {
|
|||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.goods_store_button {
|
||||
display: inline;
|
||||
background-color: white;
|
||||
border-color: #F56C6C;
|
||||
position: absolute;
|
||||
left: 70%;
|
||||
}
|
||||
|
||||
.base {
|
||||
margin-top: 5px;
|
||||
height: 120px;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
|
||||
.price {
|
||||
|
|
|
@ -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="btnHide == 1 && toUser.storeFlag" size="mini"
|
||||
@click="submitSendMessage()" plain>发送</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -27,7 +27,6 @@ import SocketInstance from "@/im-server/socket-instance";
|
|||
export default {
|
||||
data () {
|
||||
return {
|
||||
sendFlag: false,
|
||||
btnHide: undefined,
|
||||
hide: true
|
||||
}
|
||||
|
@ -169,7 +168,7 @@ export default {
|
|||
.image {
|
||||
height: 100px;
|
||||
margin-top: 3px;
|
||||
width: 100px
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
</div>
|
||||
<div style="margin-left: 13px">
|
||||
<div class="div-zoom">
|
||||
{{ storeInfo.storeName }}
|
||||
<el-tag type="danger" v-if="storeInfo.selfOperated" size="mini">自营</el-tag>
|
||||
<span class="title_left_name"> 店铺名称:</span> <span class="title_right_name">{{ storeInfo.storeName }}</span>
|
||||
<el-tag style="margin-left: 10px;" type="danger" v-if="storeInfo.selfOperated" size="mini">自营</el-tag>
|
||||
</div>
|
||||
<div>
|
||||
联系方式: {{ storeInfo.memberName }}
|
||||
<span class="title_left_name"> 联系方式:</span> <span class="title_right_name">{{ storeInfo.memberName }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button class="store-button" type="danger" @click="linkToStore(storeInfo.id)" size="mini"
|
||||
|
@ -19,22 +19,32 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr class="separate" />
|
||||
<div class="separate">店铺评分: <span>{{ storeInfo.serviceScore }}</span></div>
|
||||
<div class="separate">服务评分: <span>{{ storeInfo.descriptionScore }}</span></div>
|
||||
<div class="separate">物流评分: <span>{{ storeInfo.deliveryScore }}</span></div>
|
||||
|
||||
<div class="separate">店铺评分: <el-rate v-model="storeInfo.serviceScore" disabled show-score text-color="#ff9900"
|
||||
score-template="{value}">
|
||||
</el-rate></div>
|
||||
<div class="separate">服务评分: <el-rate v-model="storeInfo.descriptionScore" disabled show-score text-color="#ff9900"
|
||||
score-template="{value}">
|
||||
</el-rate></div>
|
||||
<div class="separate">物流评分: <el-rate v-model="storeInfo.deliveryScore" disabled show-score text-color="#ff9900"
|
||||
score-template="{value}">
|
||||
</el-rate></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Tag, button } from 'element-ui'
|
||||
import { Tag, button, rate } from 'element-ui'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
value: null,
|
||||
colors: ['#99A9BF', '#F7BA2A', '#FF9900']
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"el-tag": Tag,
|
||||
"el-button": button,
|
||||
"el-rate": rate
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
|
@ -49,6 +59,16 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.title_left_name {
|
||||
font-size: 12px;
|
||||
color: #a1a6af;
|
||||
}
|
||||
|
||||
.title_right_name {
|
||||
font-size: 12px;
|
||||
color: #343036;
|
||||
}
|
||||
|
||||
.store-button {
|
||||
background-color: white;
|
||||
border-color: #F56C6C;
|
||||
|
@ -73,5 +93,9 @@ export default {
|
|||
|
||||
.separate {
|
||||
margin-top: 8px;
|
||||
// display: inline;
|
||||
display: flex;
|
||||
font-size: 12px;
|
||||
color: #a1a6af;
|
||||
}
|
||||
</style>
|
|
@ -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="
|
||||
<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,7 @@ export default {
|
|||
},
|
||||
|
||||
// 选中表情包回调事件
|
||||
selecteEmoticon(data) {
|
||||
selecteEmoticon (data) {
|
||||
if (data.type == 1) {
|
||||
let value = this.editorText;
|
||||
let el = this.$refs.textarea;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -3,6 +3,8 @@ export default {
|
|||
BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "",
|
||||
BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "",
|
||||
BASE_COMMON: process.env.VUE_APP_COMMON || "",
|
||||
PC_URL: process.env.VUE_APP_PC_URL || "",
|
||||
STORE_URL:process.env.VUE_APP_PC_ORDER_URL || "http://192.168.0.139:10002",
|
||||
BASE_BUYER: process.env.VUE_APP_BUYER || "",
|
||||
BASE_SELLER: process.env.VUE_APP_SELLER || "",
|
||||
PC_URL: process.env.VUE_APP_PC_URL || "https://pc-b2b2c.pickmall.cn",
|
||||
PC_STORE: process.env.VUE_APP_PC_STORE || 'https://store-b2b2c.pickmall.cn',
|
||||
};
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -25,17 +25,27 @@ Vue.component('face', face)
|
|||
Vue.component('face-null', faceNull)
|
||||
|
||||
Vue.prototype.linkToGoods = function (goodsId, skuId) { // 跳转买家端商品
|
||||
console.log(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`)
|
||||
if (localStorage.getItem('storeFlag') == 'false') {
|
||||
window.open(`${config.PC_STORE}goods-operation-edit?id=${goodsId}`, '_blank')
|
||||
} else {
|
||||
window.open(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
|
||||
}
|
||||
};
|
||||
Vue.prototype.linkToStore = function (storeId) { // 跳转买家端商品
|
||||
Vue.prototype.linkToStore = function (storeId) { // 跳转商家端商品
|
||||
console.log(`${config.PC_URL}/Merchant?id=${storeId}`)
|
||||
window.open(`${config.PC_URL}/Merchant?id=${storeId}`, '_blank')
|
||||
};
|
||||
// 订单跳转商家订单页面
|
||||
Vue.prototype.linkToOrders = function (sn) { // 跳转买家端订单
|
||||
window.open(`${config.STORE_URL}/order-detail?sn=${sn}`, '_blank')
|
||||
Vue.prototype.linkToOrders = function (sn) {
|
||||
if (localStorage.getItem('storeFlag') == 'false') {
|
||||
// 商家
|
||||
window.open(`${config.PC_STORE}order-detail?sn=${sn}`, '_blank')
|
||||
} else {
|
||||
// 用户
|
||||
window.open(`${config.PC_URL}/OrderDetail?sn=${sn}`, '_blank')
|
||||
}
|
||||
};
|
||||
|
||||
const Instance = new Vue({
|
||||
router,
|
||||
store,
|
||||
|
|
|
@ -65,7 +65,6 @@ class WsSocket {
|
|||
*/
|
||||
on (event, callBack) {
|
||||
// 对应 socket-instance.js
|
||||
console.log("事件绑定", event, callBack);
|
||||
this.onCallBacks[event] = callBack;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
},
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ const emojis = {
|
|||
};
|
||||
|
||||
/**
|
||||
* 符号表情
|
||||
*/
|
||||
* 符号表情
|
||||
*/
|
||||
const symbol = [
|
||||
"😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
|
||||
"😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
|
||||
|
@ -121,24 +121,23 @@ const symbol = [
|
|||
];
|
||||
|
||||
const emojisKeys = Object.keys(emojis);
|
||||
|
||||
export const emojiList = {
|
||||
symbol,
|
||||
emojis
|
||||
}
|
||||
|
||||
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
||||
|
||||
/**
|
||||
* 替换表情文字
|
||||
*
|
||||
* @param {String} content 需要替换的字符串
|
||||
*/
|
||||
export function textReplaceEmoji(content) {
|
||||
if(!content){
|
||||
* 替换表情文字
|
||||
*
|
||||
* @param {String} content 需要替换的字符串
|
||||
*/
|
||||
export function textReplaceEmoji (content) {
|
||||
if (!content) {
|
||||
return ""
|
||||
}
|
||||
return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
|
||||
return emojis[$1];
|
||||
});
|
||||
}
|
||||
export const emojistwo = Object.keys(emojis)
|
|
@ -7,7 +7,7 @@ import config from "@/config/config";
|
|||
*
|
||||
* @param {Object} datetime
|
||||
*/
|
||||
export function formatTime(datetime) {
|
||||
export function formatTime (datetime) {
|
||||
if (datetime == null) return "";
|
||||
|
||||
datetime = datetime.replace(/-/g, "/");
|
||||
|
@ -60,7 +60,7 @@ export function formatTime(datetime) {
|
|||
*
|
||||
* @param {String} value 文件大小(字节)
|
||||
*/
|
||||
export function formatSize(value) {
|
||||
export function formatSize (value) {
|
||||
if (null == value || value == "") {
|
||||
return "0";
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export function formatSize(value) {
|
|||
*
|
||||
* @param {String} fileName
|
||||
*/
|
||||
export function getFileExt(fileName) {
|
||||
export function getFileExt (fileName) {
|
||||
let ext = fileName.split(".");
|
||||
ext = ext[ext.length - 1]; // 获取文件后缀名
|
||||
return ext;
|
||||
|
@ -88,7 +88,7 @@ export function getFileExt(fileName) {
|
|||
* @param {String} imgsrc
|
||||
* @param {String} name
|
||||
*/
|
||||
export function downloadIamge(imgsrc, name) {
|
||||
export function downloadIamge (imgsrc, name) {
|
||||
//下载图片地址和图片名
|
||||
let image = new Image();
|
||||
// 解决跨域 Canvas 污染问题
|
||||
|
@ -114,7 +114,7 @@ export function downloadIamge(imgsrc, name) {
|
|||
*
|
||||
* @param {String} imgsrc 例如图片名: D8x5f13a53dbc4b9_350x345.png
|
||||
*/
|
||||
export function getImageInfo(imgsrc) {
|
||||
export function getImageInfo (imgsrc) {
|
||||
let data = {
|
||||
width: 0,
|
||||
height: 0,
|
||||
|
@ -138,14 +138,14 @@ export function getImageInfo(imgsrc) {
|
|||
*
|
||||
* @param {Number} cr_id
|
||||
*/
|
||||
export function download(cr_id) {
|
||||
export function download (cr_id) {
|
||||
let api = config.BASE_API_URL;
|
||||
let token = getToken();
|
||||
try {
|
||||
let link = document.createElement("a");
|
||||
link.href = `${api}/download/user-chat-file?cr_id=${cr_id}&token=${token}`;
|
||||
link.click();
|
||||
} catch (e) {}
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,7 +155,7 @@ export function download(cr_id) {
|
|||
* @param {String} cFormat
|
||||
* @returns {String | null}
|
||||
*/
|
||||
export function parseTime(time, cFormat) {
|
||||
export function parseTime (time, cFormat) {
|
||||
if (arguments.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ export function parseTime(time, cFormat) {
|
|||
*
|
||||
* @param {String} str
|
||||
*/
|
||||
export function trim(str, type = null) {
|
||||
export function trim (str, type = null) {
|
||||
if (type) {
|
||||
return str.replace(/(^\s*)|(\s*$)/g, "");
|
||||
} else if (type == "l") {
|
||||
|
@ -221,7 +221,7 @@ export function trim(str, type = null) {
|
|||
* @param {String} url
|
||||
* @returns {Object}
|
||||
*/
|
||||
export function param2Obj(url) {
|
||||
export function param2Obj (url) {
|
||||
const search = url.split("?")[1];
|
||||
|
||||
if (!search) return {};
|
||||
|
@ -241,7 +241,7 @@ export function param2Obj(url) {
|
|||
* @param {Object} json
|
||||
* @returns {Array}
|
||||
*/
|
||||
export function param(json) {
|
||||
export function param (json) {
|
||||
if (!json) return "";
|
||||
return cleanArray(
|
||||
Object.keys(json).map((key) => {
|
||||
|
@ -256,7 +256,7 @@ export function param(json) {
|
|||
* @param {Array} actual
|
||||
* @returns {Array}
|
||||
*/
|
||||
export function cleanArray(actual) {
|
||||
export function cleanArray (actual) {
|
||||
const newArray = [];
|
||||
for (let i = 0; i < actual.length; i++) {
|
||||
if (actual[i]) {
|
||||
|
@ -271,7 +271,7 @@ export function cleanArray(actual) {
|
|||
* @param {HTMLElement} element
|
||||
* @param {String} className
|
||||
*/
|
||||
export function toggleClass(element, className) {
|
||||
export function toggleClass (element, className) {
|
||||
if (!element || !className) {
|
||||
return;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ export function toggleClass(element, className) {
|
|||
* @param {String} cls
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
export function hasClass(ele, cls) {
|
||||
export function hasClass (ele, cls) {
|
||||
return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ export function hasClass(ele, cls) {
|
|||
* @param {HTMLElement} elm
|
||||
* @param {String} cls
|
||||
*/
|
||||
export function addClass(ele, cls) {
|
||||
export function addClass (ele, cls) {
|
||||
if (!hasClass(ele, cls)) ele.className += " " + cls;
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ export function addClass(ele, cls) {
|
|||
* @param {HTMLElement} elm
|
||||
* @param {String} cls
|
||||
*/
|
||||
export function removeClass(ele, cls) {
|
||||
export function removeClass (ele, cls) {
|
||||
if (hasClass(ele, cls)) {
|
||||
const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
|
||||
ele.className = ele.className.replace(reg, " ");
|
||||
|
@ -328,7 +328,7 @@ export function removeClass(ele, cls) {
|
|||
* @param {String} src
|
||||
* @param {Number} width
|
||||
*/
|
||||
export function imgZoom(src, width = 200) {
|
||||
export function imgZoom (src, width = 200) {
|
||||
const info = getImageInfo(src);
|
||||
|
||||
if (info.width < width) {
|
||||
|
@ -350,7 +350,7 @@ export function imgZoom(src, width = 200) {
|
|||
* @export
|
||||
* @returns
|
||||
*/
|
||||
export function getSelection() {
|
||||
export function getSelection () {
|
||||
return window.getSelection
|
||||
? window.getSelection().toString()
|
||||
: document.selection.createRange().text;
|
||||
|
@ -386,7 +386,7 @@ export const copyTextToClipboard = (value, callback) => {
|
|||
*
|
||||
* @param {String} phone 手机号
|
||||
*/
|
||||
export function hidePhone(phone) {
|
||||
export function hidePhone (phone) {
|
||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ export function hidePhone(phone) {
|
|||
*
|
||||
* @param {Object} datetime
|
||||
*/
|
||||
export function beautifyTime(datetime = "") {
|
||||
export function beautifyTime (datetime = "") {
|
||||
if (datetime == null) {
|
||||
return "";
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ export function beautifyTime(datetime = "") {
|
|||
return `${minutes}分钟前`;
|
||||
}
|
||||
|
||||
export function getSort(fn) {
|
||||
export function getSort (fn) {
|
||||
return function (a, b) {
|
||||
let ret = 0;
|
||||
|
||||
|
@ -465,7 +465,7 @@ export function getSort(fn) {
|
|||
*
|
||||
* @param {*} arr
|
||||
*/
|
||||
export function getMutipSort(arr) {
|
||||
export function getMutipSort (arr) {
|
||||
return function (a, b) {
|
||||
let tmp;
|
||||
let i = 0;
|
||||
|
@ -484,7 +484,7 @@ export function getMutipSort(arr) {
|
|||
* @param {String} text 文本
|
||||
* @param {String} color 超链接颜色
|
||||
*/
|
||||
export function textReplaceLink(text, color = "#409eff") {
|
||||
export function textReplaceLink (text, color = "#409eff") {
|
||||
let exp =
|
||||
/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
|
||||
return text.replace(
|
||||
|
@ -501,7 +501,7 @@ export function textReplaceLink(text, color = "#409eff") {
|
|||
* @param {*} immediate
|
||||
* @returns
|
||||
*/
|
||||
export function debounce(func, wait, immediate) {
|
||||
export function debounce (func, wait, immediate) {
|
||||
let timeout;
|
||||
|
||||
return function () {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -72,17 +72,17 @@ export default {
|
|||
}),
|
||||
},
|
||||
watch: {
|
||||
unreadNum(n, o) {
|
||||
unreadNum (n, o) {
|
||||
if (n > 0 && n > o && this.notifyCueTone) {
|
||||
this.play();
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
this.setApplyNum();
|
||||
},
|
||||
methods: {
|
||||
play() {
|
||||
play () {
|
||||
document
|
||||
.querySelector("#audio")
|
||||
.play()
|
||||
|
@ -90,10 +90,10 @@ export default {
|
|||
console.error("消息提示音播放异常");
|
||||
});
|
||||
},
|
||||
logout() {
|
||||
logout () {
|
||||
this.$store.dispatch("ACT_USER_LOGOUT");
|
||||
},
|
||||
setApplyNum() {
|
||||
setApplyNum () {
|
||||
// TODO 暂且return
|
||||
return;
|
||||
ServeFindFriendApplyNum().then((res) => {
|
||||
|
@ -108,7 +108,7 @@ export default {
|
|||
<style lang="less" >
|
||||
.main-layout {
|
||||
position: fixed;
|
||||
width: 75%;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -120,7 +120,7 @@ export default {
|
|||
border-radius: 5px;
|
||||
|
||||
&.full-mode {
|
||||
width: 70%;
|
||||
width: 1200px;
|
||||
height: 85%;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<p class="nickname">
|
||||
{{
|
||||
item.remark_name ? item.remark_name : item.name
|
||||
}}
|
||||
}}
|
||||
</p>
|
||||
<div v-show="item.unread" class="larkc-tag">
|
||||
{{ item.unread }}条未读
|
||||
|
@ -113,7 +113,7 @@
|
|||
<div class="content">
|
||||
<template v-if="
|
||||
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],
|
||||
|
|
Loading…
Reference in New Issue