+
-
+
-
-
-
订单号:{{ item.text.sn }}
+
+
{{ item.text.groupName }}
{{ item.text.paymentTime }}
+
+ 订单金额:¥{{ item.text.flowPrice }}
+
+
{{
+ 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' ?
+ '待校验' : ''
+ }}
-
-
@@ -149,19 +164,19 @@
+ talk_type: params.talk_type,
+ receiver_id: params.receiver_id,
+ title: params.nickname,
+ }" @close="findChatRecord = false" />
-
+
\ No newline at end of file
diff --git a/im/src/components/editor/MeEditor.vue b/im/src/components/editor/MeEditor.vue
index cc0605c0..345297ba 100644
--- a/im/src/components/editor/MeEditor.vue
+++ b/im/src/components/editor/MeEditor.vue
@@ -33,99 +33,66 @@
发起投票
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
+
-
+
- {
- this.vote.isShow = false;
- }
- "
- />
+ {
+ this.vote.isShow = false;
+ }
+ " />
@@ -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;
diff --git a/im/src/components/layout/WelcomeModule.vue b/im/src/components/layout/WelcomeModule.vue
index 7d2fa6c0..cc9d3e79 100644
--- a/im/src/components/layout/WelcomeModule.vue
+++ b/im/src/components/layout/WelcomeModule.vue
@@ -2,7 +2,6 @@
-
@@ -10,10 +9,10 @@
diff --git a/im/src/config/config.js b/im/src/config/config.js
index a5dd35ba..7cc7377c 100644
--- a/im/src/config/config.js
+++ b/im/src/config/config.js
@@ -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',
};
diff --git a/im/src/im-server/event/talk.js b/im/src/im-server/event/talk.js
index ddc61385..52d487d9 100644
--- a/im/src/im-server/event/talk.js
+++ b/im/src/im-server/event/talk.js
@@ -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");
diff --git a/im/src/main.js b/im/src/main.js
index 7ceab5ac..045a82fe 100644
--- a/im/src/main.js
+++ b/im/src/main.js
@@ -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}`)
- window.open(`${config.PC_URL}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank')
+ 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,
diff --git a/im/src/plugins/ws-socket.js b/im/src/plugins/ws-socket.js
index 802d0b17..e7516700 100644
--- a/im/src/plugins/ws-socket.js
+++ b/im/src/plugins/ws-socket.js
@@ -65,7 +65,6 @@ class WsSocket {
*/
on (event, callBack) {
// 对应 socket-instance.js
- console.log("事件绑定", event, callBack);
this.onCallBacks[event] = callBack;
return this;
}
diff --git a/im/src/store/modules/talk.js b/im/src/store/modules/talk.js
index 10882241..d52847d4 100644
--- a/im/src/store/modules/talk.js
+++ b/im/src/store/modules/talk.js
@@ -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)
},
diff --git a/im/src/utils/emojis.js b/im/src/utils/emojis.js
index 030fda59..937f8529 100644
--- a/im/src/utils/emojis.js
+++ b/im/src/utils/emojis.js
@@ -2,143 +2,142 @@
* 动态表情
*/
const emojis = {
- "[微笑]": "
",
- "[撇嘴]": "
",
- "[色]": "
",
- "[发呆]": "
",
- "[得意]": "
",
- "[流泪]": "
",
- "[害羞]": "
",
- "[闭嘴]": "
",
- "[睡]": "
",
- "[大哭]": "
",
- "[尴尬]": "
",
- "[发怒]": "
",
- "[调皮]": "
",
- "[呲牙]": "
",
- "[惊讶]": "
",
- "[难过]": "
",
- "[酷]": "
",
- "[冷汗]": "
",
- "[抓狂]": "
",
- "[吐]": "
",
- "[偷笑]": "
",
- "[可爱]": "
",
- "[白眼]": "
",
- "[傲慢]": "
",
- "[饥饿]": "
",
- "[困]": "
",
- "[惊恐]": "
",
- "[流汗]": "
",
- "[憨笑]": "
",
- "[大兵]": "
",
- "[奋斗]": "
",
- "[咒骂]": "
",
- "[疑问]": "
",
- "[嘘]": "
",
- "[晕]": "
",
- "[折磨]": "
",
- "[衰]": "
",
- "[骷髅]": "
",
- "[敲打]": "
",
- "[再见]": "
",
- "[擦汗]": "
",
- "[抠鼻]": "
",
- "[鼓掌]": "
",
- "[糗大了]": "
",
- "[坏笑]": "
",
- "[左哼哼]": "
",
- "[右哼哼]": "
",
- "[哈欠]": "
",
- "[鄙视]": "
",
- "[委屈]": "
",
- "[快哭了]": "
",
- "[阴险]": "
",
- "[亲亲]": "
",
- "[吓]": "
",
- "[可怜]": "
",
- "[菜刀]": "
",
- "[西瓜]": "
",
- "[啤酒]": "
",
- "[篮球]": "
",
- "[乒乓]": "
",
- "[咖啡]": "
",
- "[饭]": "
",
- "[猪头]": "
",
- "[玫瑰]": "
",
- "[凋谢]": "
",
- "[示爱]": "
",
- "[爱心]": "
",
- "[心碎]": "
",
- "[蛋糕]": "
",
- "[闪电]": "
",
- "[炸弹]": "
",
- "[刀]": "
",
- "[足球]": "
",
- "[瓢虫]": "
",
- "[便便]": "
",
- "[月亮]": "
",
- "[太阳]": "
",
- "[礼物]": "
",
- "[拥抱]": "
",
- "[强]": "
",
- "[弱]": "
",
- "[握手]": "
",
- "[胜利]": "
",
- "[抱拳]": "
",
- "[勾引]": "
",
- "[拳头]": "
",
- "[差劲]": "
",
- "[爱你]": "
",
- "[NO]": "
",
- "[OK]": "
",
- "[爱情]": "
",
- "[飞吻]": "
",
- "[跳跳]": "
",
- "[发抖]": "
",
- "[怄火]": "
",
- "[转圈]": "
",
- "[磕头]": "
",
- "[回头]": "
",
- "[跳绳]": "
",
- "[挥手]": "
",
- "[激动]": "
",
- "[街舞]": "
",
- "[献吻]": "
",
- "[左太极]": "
",
- "[右太极]": "
",
+ "[微笑]": "
",
+ "[撇嘴]": "
",
+ "[色]": "
",
+ "[发呆]": "
",
+ "[得意]": "
",
+ "[流泪]": "
",
+ "[害羞]": "
",
+ "[闭嘴]": "
",
+ "[睡]": "
",
+ "[大哭]": "
",
+ "[尴尬]": "
",
+ "[发怒]": "
",
+ "[调皮]": "
",
+ "[呲牙]": "
",
+ "[惊讶]": "
",
+ "[难过]": "
",
+ "[酷]": "
",
+ "[冷汗]": "
",
+ "[抓狂]": "
",
+ "[吐]": "
",
+ "[偷笑]": "
",
+ "[可爱]": "
",
+ "[白眼]": "
",
+ "[傲慢]": "
",
+ "[饥饿]": "
",
+ "[困]": "
",
+ "[惊恐]": "
",
+ "[流汗]": "
",
+ "[憨笑]": "
",
+ "[大兵]": "
",
+ "[奋斗]": "
",
+ "[咒骂]": "
",
+ "[疑问]": "
",
+ "[嘘]": "
",
+ "[晕]": "
",
+ "[折磨]": "
",
+ "[衰]": "
",
+ "[骷髅]": "
",
+ "[敲打]": "
",
+ "[再见]": "
",
+ "[擦汗]": "
",
+ "[抠鼻]": "
",
+ "[鼓掌]": "
",
+ "[糗大了]": "
",
+ "[坏笑]": "
",
+ "[左哼哼]": "
",
+ "[右哼哼]": "
",
+ "[哈欠]": "
",
+ "[鄙视]": "
",
+ "[委屈]": "
",
+ "[快哭了]": "
",
+ "[阴险]": "
",
+ "[亲亲]": "
",
+ "[吓]": "
",
+ "[可怜]": "
",
+ "[菜刀]": "
",
+ "[西瓜]": "
",
+ "[啤酒]": "
",
+ "[篮球]": "
",
+ "[乒乓]": "
",
+ "[咖啡]": "
",
+ "[饭]": "
",
+ "[猪头]": "
",
+ "[玫瑰]": "
",
+ "[凋谢]": "
",
+ "[示爱]": "
",
+ "[爱心]": "
",
+ "[心碎]": "
",
+ "[蛋糕]": "
",
+ "[闪电]": "
",
+ "[炸弹]": "
",
+ "[刀]": "
",
+ "[足球]": "
",
+ "[瓢虫]": "
",
+ "[便便]": "
",
+ "[月亮]": "
",
+ "[太阳]": "
",
+ "[礼物]": "
",
+ "[拥抱]": "
",
+ "[强]": "
",
+ "[弱]": "
",
+ "[握手]": "
",
+ "[胜利]": "
",
+ "[抱拳]": "
",
+ "[勾引]": "
",
+ "[拳头]": "
",
+ "[差劲]": "
",
+ "[爱你]": "
",
+ "[NO]": "
",
+ "[OK]": "
",
+ "[爱情]": "
",
+ "[飞吻]": "
",
+ "[跳跳]": "
",
+ "[发抖]": "
",
+ "[怄火]": "
",
+ "[转圈]": "
",
+ "[磕头]": "
",
+ "[回头]": "
",
+ "[跳绳]": "
",
+ "[挥手]": "
",
+ "[激动]": "
",
+ "[街舞]": "
",
+ "[献吻]": "
",
+ "[左太极]": "
",
+ "[右太极]": "
",
};
/**
- * 符号表情
- */
+* 符号表情
+*/
const symbol = [
- "😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
- "😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
- "😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉",
- "✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉",
- "👋", "👏", "👌", "👎"
+ "😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
+ "😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
+ "😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉",
+ "✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉",
+ "👋", "👏", "👌", "👎"
];
const emojisKeys = Object.keys(emojis);
-
export const emojiList = {
- symbol,
- emojis
+ symbol,
+ emojis
}
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
-
/**
- * 替换表情文字
- *
- * @param {String} content 需要替换的字符串
- */
-export function textReplaceEmoji(content) {
- if(!content){
- return ""
- }
- return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
- return emojis[$1];
- });
-}
\ No newline at end of file
+* 替换表情文字
+*
+* @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)
\ No newline at end of file
diff --git a/im/src/utils/functions.js b/im/src/utils/functions.js
index 9e39260e..a466d7a6 100644
--- a/im/src/utils/functions.js
+++ b/im/src/utils/functions.js
@@ -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,19 +221,19 @@ 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 {};
return JSON.parse(
'{"' +
- decodeURIComponent(search)
- .replace(/"/g, '\\"')
- .replace(/&/g, '","')
- .replace(/=/g, '":"')
- .replace(/\+/g, " ") +
- '"}'
+ decodeURIComponent(search)
+ .replace(/"/g, '\\"')
+ .replace(/&/g, '","')
+ .replace(/=/g, '":"')
+ .replace(/\+/g, " ") +
+ '"}'
);
}
@@ -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 () {
diff --git a/im/src/utils/talk.js b/im/src/utils/talk.js
index 2322882d..b8c12920 100644
--- a/im/src/utils/talk.js
+++ b/im/src/utils/talk.js
@@ -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);
diff --git a/im/src/views/layout/MainLayout.vue b/im/src/views/layout/MainLayout.vue
index 0406c1a8..1cb9b102 100644
--- a/im/src/views/layout/MainLayout.vue
+++ b/im/src/views/layout/MainLayout.vue
@@ -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 {