feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
二进制
public/assets/tool/audio/notice.wav
普通文件
二进制
public/assets/tool/audio/notice.wav
普通文件
二进制文件未显示。
1
public/assets/tool/libs/Sortable.min.js
vendored
普通文件
1
public/assets/tool/libs/Sortable.min.js
vendored
普通文件
文件差异因一行或多行过长而隐藏
32
public/assets/tool/libs/antv.js
普通文件
32
public/assets/tool/libs/antv.js
普通文件
文件差异因一行或多行过长而隐藏
856
public/assets/tool/libs/chat.js
普通文件
856
public/assets/tool/libs/chat.js
普通文件
@@ -0,0 +1,856 @@
|
||||
define(['vue'], function (Vue) {
|
||||
Vue.directive('dialogDrag', {
|
||||
bind(el, binding, vnode, oldVnode) {
|
||||
const dialogHeaderEl = el.querySelector('.el-dialog__header');
|
||||
const dragDom = el.querySelector('.el-dialog');
|
||||
|
||||
dialogHeaderEl.style.cssText += ';cursor:move;'
|
||||
dragDom.style.cssText += ';top:0px;'
|
||||
|
||||
const sty = (() => {
|
||||
if (window.document.currentStyle) {
|
||||
return (dom, attr) => dom.currentStyle[attr];
|
||||
} else {
|
||||
return (dom, attr) => getComputedStyle(dom, false)[attr];
|
||||
}
|
||||
})()
|
||||
dialogHeaderEl.onmousedown = (e) => {
|
||||
document.onselectstart = function () {
|
||||
return false;
|
||||
};
|
||||
document.ondragstart = function () {
|
||||
return false;
|
||||
};
|
||||
$(document).find("iframe").css("pointer-events", "none");
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft;
|
||||
const disY = e.clientY - dialogHeaderEl.offsetTop;
|
||||
|
||||
const screenWidth = document.body.clientWidth;
|
||||
const screenHeight = document.documentElement.clientHeight;
|
||||
|
||||
const dragDomWidth = dragDom.offsetWidth;
|
||||
const dragDomheight = dragDom.offsetHeight;
|
||||
const minDragDomLeft = dragDom.offsetLeft;
|
||||
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
||||
|
||||
const minDragDomTop = dragDom.offsetTop;
|
||||
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
|
||||
let styL = sty(dragDom, 'left');
|
||||
let styT = sty(dragDom, 'top');
|
||||
if (styL.includes('%')) {
|
||||
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100);
|
||||
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100);
|
||||
} else {
|
||||
styL = +styL.replace(/\px/g, '');
|
||||
styT = +styT.replace(/\px/g, '');
|
||||
};
|
||||
document.onmousemove = function (e) {
|
||||
let left = e.clientX - disX;
|
||||
let top = e.clientY - disY;
|
||||
if (-(left) > minDragDomLeft) {
|
||||
left = -(minDragDomLeft);
|
||||
} else if (left > maxDragDomLeft) {
|
||||
left = maxDragDomLeft;
|
||||
}
|
||||
if (-(top) > minDragDomTop) {
|
||||
top = -(minDragDomTop);
|
||||
} else if (top > maxDragDomTop) {
|
||||
top = maxDragDomTop;
|
||||
}
|
||||
|
||||
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
|
||||
};
|
||||
document.onmouseup = function (e) {
|
||||
document.onselectstart = function () {
|
||||
return true;
|
||||
};
|
||||
$(document).find("iframe").css("pointer-events", "auto");
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
Vue.component('Chat', {
|
||||
template: '#chatTemp',
|
||||
props: ['passvalue'],
|
||||
data() {
|
||||
return {
|
||||
isButtonShow: false,
|
||||
isClick: false,
|
||||
dialogVisible: false,
|
||||
lineOptions: [{
|
||||
value: 'online',
|
||||
label: '在线',
|
||||
color: '#7438D5',
|
||||
}, {
|
||||
value: 'offline',
|
||||
label: '离开',
|
||||
color: '#ED655F',
|
||||
}, {
|
||||
value: 'busy',
|
||||
label: '忙碌',
|
||||
color: '#666666',
|
||||
}],
|
||||
lineStatus: '',
|
||||
liaoData: [{
|
||||
title: '会话中',
|
||||
type: 'buyerOnlines',
|
||||
|
||||
}, {
|
||||
title: '排队中',
|
||||
type: 'buyerWaitings',
|
||||
}, {
|
||||
title: '历史记录',
|
||||
type: 'buyerHistories',
|
||||
}],
|
||||
openGroupList: [],
|
||||
groupIndex: 0,
|
||||
|
||||
commonWordsvisible: false,
|
||||
sendMessage: '',
|
||||
|
||||
specificChatMessage: [],
|
||||
last_id: '',
|
||||
page: 1,
|
||||
per_page: 10,
|
||||
|
||||
emoji_list: [],
|
||||
emojivisible: false,
|
||||
|
||||
websocket: null,
|
||||
relink: 0,
|
||||
max_relink: 0,
|
||||
buylist: {
|
||||
buyerHistories: [],
|
||||
buyerOnlines: [],
|
||||
buyerWaitings: [],
|
||||
},
|
||||
|
||||
isChatingId: '',
|
||||
|
||||
temporaryObj: {}, //临时消息的id
|
||||
user_offline: [], //用户下线
|
||||
shoproKefuShake: false,
|
||||
shoproChatContainerRefScrollTop: 0,
|
||||
scrollHeight: 0,
|
||||
|
||||
message_num: 10,
|
||||
adminData: [],
|
||||
commonWordsList: [],
|
||||
timeInterval: null,
|
||||
kefuButtonvisible: false,
|
||||
rightShowId: null,
|
||||
rightShowPosition: {
|
||||
top: 0,
|
||||
left: 0
|
||||
},
|
||||
changeKefu: null,
|
||||
|
||||
changeKefuList: [],
|
||||
value: '',
|
||||
transferAdminList: '',
|
||||
openPing: null,
|
||||
errorTipVisible: false,
|
||||
|
||||
// 客服是否介入
|
||||
kefuAccessStatus: false,
|
||||
kefuAccessStatusSend: false,
|
||||
kefuAccessTip: '',
|
||||
kefuLinkNum: 0
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.adminData = this.passvalue.adminData;
|
||||
this.emoji_list = this.passvalue.emoji_list;
|
||||
this.commonWordsList = this.passvalue.commonWordsList;
|
||||
if ("WebSocket" in window) {
|
||||
this.linkWebSocket(this.passvalue.wsUri, this.passvalue.token, this.passvalue.expire_time, this.passvalue.customer_service_id);
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: `浏览器不支持 WebSocket!`,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
if (localStorage.getItem("shopro_kefu_button_position")) {
|
||||
let left = localStorage.getItem("shopro_kefu_button_position").split(',')[0];
|
||||
let top = localStorage.getItem("shopro_kefu_button_position").split(',')[1];
|
||||
this.$refs.shoproKefuButtonRef.style.left = `${left}px`;
|
||||
this.$refs.shoproKefuButtonRef.style.top = `${top}px`
|
||||
this.isButtonShow = true;
|
||||
} else {
|
||||
this.isButtonShow = true;
|
||||
}
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
// this.dialogVisible = false;
|
||||
this.$refs.shoproKefuButtonRef.style.left = `unset`;
|
||||
this.$refs.shoproKefuButtonRef.style.top = `80%`;
|
||||
this.rightShowId = null;
|
||||
})();
|
||||
};
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
closerightShowId() {
|
||||
this.rightShowId = null;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
show(e, service_id) {
|
||||
if (this.groupIndex == 0) {
|
||||
this.rightShowId = service_id;
|
||||
this.rightShowPosition.top = e.clientY + 'px';
|
||||
this.rightShowPosition.left = e.clientX + 'px';
|
||||
}
|
||||
},
|
||||
transferKfu(value) {
|
||||
let data = {
|
||||
session_id: this.rightShowId,
|
||||
identify: 'customer_service',
|
||||
type: 'transfer',
|
||||
data: {
|
||||
customer_service_id: value
|
||||
}
|
||||
}
|
||||
this.websocket.send(JSON.stringify(data));
|
||||
this.rightShowId = null;
|
||||
this.isChatingId = false
|
||||
},
|
||||
getimageload(index) {
|
||||
this.$set(this.specificChatMessage[index], 'hidden', true)
|
||||
},
|
||||
imagerror(index) {
|
||||
this.$set(this.specificChatMessage[index], 'hidden', true)
|
||||
},
|
||||
linkWebSocket(wsUri, token, expire_time, customer_service_id) {
|
||||
this.errorTipVisible = false
|
||||
wsUri = wsUri + '?identify=customer_service&token=' + token + '&expire_time=' + expire_time + '&customer_service_id=' + customer_service_id
|
||||
this.websocket = new WebSocket(wsUri);
|
||||
this.websocket.onopen = (evt) => {
|
||||
this.relink = 1;
|
||||
this.openPing = setInterval(() => {
|
||||
let data = {
|
||||
type: 'ping',
|
||||
}
|
||||
this.websocket.send(JSON.stringify(data));
|
||||
}, 20000)
|
||||
};
|
||||
this.websocket.onclose = (evt) => {
|
||||
this.errorTipVisible = true
|
||||
this.lineStatus = 'offline'
|
||||
this.kefuLinkNum++
|
||||
if(this.kefuLinkNum<=3){
|
||||
this.linkWebSocket(this.passvalue.wsUri, this.passvalue.token, this.passvalue.expire_time, this.passvalue.customer_service_id);
|
||||
}
|
||||
};
|
||||
this.websocket.onmessage = (evt) => {
|
||||
let result = JSON.parse(evt.data);
|
||||
let data = result.data;
|
||||
if (result.code) {
|
||||
switch (result.type) {
|
||||
case 'nologin': //请先登录管理后台
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请先登录管理后台',
|
||||
type: 'warning'
|
||||
});
|
||||
break;
|
||||
case 'no_customer_service': //您还不是客服
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '您还不是客服',
|
||||
type: 'warning'
|
||||
});
|
||||
break;
|
||||
case 'init': //链接成功
|
||||
this.lineStatus = data.customer_service.status;
|
||||
this.buylist.buyerHistories = data.histories;
|
||||
this.buylist.buyerOnlines = data.onlines;
|
||||
this.buylist.buyerWaitings = data.waitings;
|
||||
this.openGroupList = this.buylist[this.liaoData[this.groupIndex].type];
|
||||
this.buylist.buyerHistories.forEach(h => {
|
||||
if (h.status == 0) {
|
||||
this.user_offline.push(h.session_id)
|
||||
}
|
||||
})
|
||||
this.lineStatus = 'online'
|
||||
break;
|
||||
case 'customer_service_update':
|
||||
if (data.customer_services.length > 0) {
|
||||
data.customer_services.forEach((i, index) => {
|
||||
if (i.id == this.adminData.customer_service.id) {
|
||||
data.customer_services.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.changeKefuList = data.customer_services;
|
||||
break;
|
||||
case 'transfer_success':
|
||||
this.transferAdminList = ''
|
||||
this.buylist.buyerOnlines.forEach((i, index) => {
|
||||
if (i.session_id == data.session_id) {
|
||||
this.buylist.buyerOnlines.splice(index, 1)
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'user_online': //用户上线
|
||||
if (this.user_offline.includes(data.session_id)) {
|
||||
this.user_offline.splice(this.user_offline.indexOf(data.session_id), 1)
|
||||
}
|
||||
// 更改历史接待人状态上线
|
||||
this.buylist.buyerHistories.forEach(history => {
|
||||
if (history.session_id == data.session_id) {
|
||||
history.customer_service = data.customer_service
|
||||
history.status = 1
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'user_offline': //用户下线
|
||||
this.user_offline.push(data.session_id);
|
||||
// 更改历史接待人状态下线
|
||||
this.buylist.buyerHistories.forEach(history => {
|
||||
if (history.session_id == data.session_id) {
|
||||
history.customer_service = null
|
||||
history.status = 0
|
||||
}
|
||||
})
|
||||
break;
|
||||
case 'user_accessed': //用户被接入 从排队中删除
|
||||
if (this.buylist.buyerWaitings.length > 0) {
|
||||
this.buylist.buyerWaitings.forEach((i, index) => {
|
||||
if (i.session_id == data.session_id) {
|
||||
this.buylist.buyerWaitings.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
//切换列表
|
||||
// this.changeGroup(0)
|
||||
// 更改历史接待人状态上线
|
||||
this.buylist.buyerHistories.forEach(history => {
|
||||
if (history.session_id == data.session_id) {
|
||||
history.customer_service = data.customer_service
|
||||
history.status = 1
|
||||
}
|
||||
})
|
||||
// 前台刷新
|
||||
if (this.adminData.customer_service.id != data.customer_service.id) {
|
||||
let deleteIndex = -1
|
||||
this.buylist.buyerOnlines.forEach((online, oindex) => {
|
||||
if (online.session_id == data.session_id) {
|
||||
deleteIndex = oindex
|
||||
}
|
||||
})
|
||||
if (deleteIndex != -1) {
|
||||
this.buylist.buyerOnlines.splice(deleteIndex, 1)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'user_access': //用户接入 从排队中删除,放到会话中
|
||||
this.voicePlay();
|
||||
this.rightShowId = null;
|
||||
if (this.buylist.buyerWaitings.length > 0) {
|
||||
this.buylist.buyerWaitings.forEach((i, index) => {
|
||||
if (i.session_id == data.session_id) {
|
||||
this.buylist.buyerWaitings.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
let flag = true
|
||||
if (this.buylist.buyerOnlines.length > 0) {
|
||||
this.buylist.buyerOnlines.forEach(i => {
|
||||
if (i.session_id == data.session_id) {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
}
|
||||
if (flag) {
|
||||
this.buylist.buyerOnlines.push(data.chat_user)
|
||||
}
|
||||
break;
|
||||
case 'receipt': //发送成功
|
||||
this.$refs.shoproChatContainerRef.scrollTop = this.$refs.shoproChatContainerRef.scrollHeight;
|
||||
$(".shopro-send-pre").empty();
|
||||
break;
|
||||
case 'message': //接收到消息
|
||||
this.voicePlay();
|
||||
this.rightShowId = null;
|
||||
this.kefuButtonvisible = true;
|
||||
if (data.message.message_type == 'text') {
|
||||
data.message.message = this.replaceEmjio(data.message.message);
|
||||
}
|
||||
if (data.message.message_type == 'goods' || data.message.message_type == 'order') {
|
||||
data.message.message = JSON.parse(data.message.message);
|
||||
}
|
||||
if (this.isChatingId == data.session_id) {
|
||||
this.specificChatMessage.push(data.message)
|
||||
} else {
|
||||
this.buylist.buyerOnlines.forEach(k => {
|
||||
if (k.session_id == data.session_id) {
|
||||
k.message_unread_num++
|
||||
}
|
||||
})
|
||||
}
|
||||
let addIndex = true
|
||||
this.buylist.buyerOnlines.forEach((j, jindex) => {
|
||||
if (j.session_id == data.session_id) {
|
||||
j.last_message = data.message
|
||||
addIndex = false
|
||||
}
|
||||
})
|
||||
if (addIndex) {
|
||||
this.buylist.buyerOnlines.unshift({
|
||||
avatar: data.message.identify.avatar,
|
||||
createtime: data.message.identify.createtime,
|
||||
customer_service_id: data.message.identify.customer_service_id,
|
||||
id: data.message.identify.id,
|
||||
last_message: data.message,
|
||||
lasttime: data.message.identify.lasttime,
|
||||
message_unread_num: 1,
|
||||
nickname: data.message.identify.nickname,
|
||||
session_id: data.message.identify.session_id,
|
||||
status: 1,
|
||||
updatetime: data.message.identify.updatetime,
|
||||
user_id: data.message.identify.user_id,
|
||||
})
|
||||
}
|
||||
this.$forceUpdate();
|
||||
//调整滚动条
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.shoproChatContainerRef) {
|
||||
this.$refs.shoproChatContainerRef.scrollTop = this.$refs.shoproChatContainerRef.scrollHeight;
|
||||
}
|
||||
})
|
||||
this.shoproKefuShake = true
|
||||
break;
|
||||
case 'message_list': //接收到的消息列表
|
||||
data.message_list.data.forEach(i => {
|
||||
if (i.message_type == 'goods' || i.message_type == 'order') {
|
||||
i.message = JSON.parse(i.message)
|
||||
}
|
||||
if (i.message_type == 'text') {
|
||||
i.message = this.replaceEmjio(i.message);
|
||||
}
|
||||
});
|
||||
//拿到this.last_id
|
||||
if (this.page == 1 && data.message_list.data.length > 0) {
|
||||
this.last_id = data.message_list.data[0].id
|
||||
}
|
||||
this.message_num = JSON.parse(JSON.stringify(data.message_list.data)).length
|
||||
|
||||
this.specificChatMessage = data.message_list.data.reverse().concat(this.specificChatMessage)
|
||||
//滚动条
|
||||
this.$nextTick(() => {
|
||||
if (this.page == 1) {
|
||||
this.$refs.shoproChatContainerRef.scrollTop = this.$refs.shoproChatContainerRef.scrollHeight;
|
||||
} else {
|
||||
this.$refs.shoproChatContainerRef.scrollTop = this.$refs.shoproChatContainerRef.scrollHeight - this.scrollHeight;
|
||||
}
|
||||
|
||||
//保存原来的滚动条
|
||||
this.scrollHeight = this.$refs.shoproChatContainerRef.scrollHeight;
|
||||
|
||||
this.$refs.shoproChatContainerRef.removeEventListener("scroll", this.listmore, false);
|
||||
this.$refs.shoproChatContainerRef.addEventListener('scroll', this.listmore, false)
|
||||
})
|
||||
this.shoproKefuShake = false;
|
||||
|
||||
break;
|
||||
case 'del_success': //接收到的消息列表
|
||||
this.buylist[this.liaoData[this.groupIndex].type].forEach((i, index) => {
|
||||
if (i.session_id == data.session_id) {
|
||||
this.buylist[this.liaoData[this.groupIndex].type].splice(index, 1)
|
||||
}
|
||||
})
|
||||
this.isChatingId = null;
|
||||
break;
|
||||
case 'switch_ok':
|
||||
this.lineStatus = data.status
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: `错误响应:${result.msg}`,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
};
|
||||
this.websocket.onerror = (evt) => { };
|
||||
},
|
||||
closeErrorTipVisible() {
|
||||
this.errorTipVisible = false
|
||||
},
|
||||
listmore() {
|
||||
let that = this;
|
||||
if (that.$refs.shoproChatContainerRef.scrollTop <= 0 && that.message_num == 10) {
|
||||
this.page++;
|
||||
let ChatingData = {
|
||||
identify: 'customer_service',
|
||||
type: 'message_list',
|
||||
session_id: that.isChatingId,
|
||||
data: {
|
||||
page: that.page,
|
||||
per_page: that.per_page,
|
||||
last_id: that.last_id
|
||||
}
|
||||
}
|
||||
that.websocket.send(JSON.stringify(ChatingData));
|
||||
}
|
||||
},
|
||||
//切换在线状态
|
||||
changeLineStatus(value) {
|
||||
this.lineStatus = value;
|
||||
let lineStatusData = {
|
||||
identify: 'customer_service',
|
||||
type: 'switch_status',
|
||||
data: {
|
||||
status: value
|
||||
}
|
||||
}
|
||||
this.websocket.send(JSON.stringify(lineStatusData));
|
||||
},
|
||||
//更换左侧列表
|
||||
changeGroup(index) {
|
||||
this.kefuAccessStatus = false;
|
||||
this.kefuAccessStatusSend = false;
|
||||
this.kefuAccessTip = ''
|
||||
this.isChatingId = '';
|
||||
this.groupIndex = index;
|
||||
this.openGroupList = this.buylist[this.liaoData[this.groupIndex].type];
|
||||
},
|
||||
//选择聊天
|
||||
selectChating(chatid, index, opt, row) {
|
||||
this.rightShowId = null;
|
||||
this.kefuAccessStatus = false;
|
||||
this.kefuAccessStatusSend = false;
|
||||
this.kefuAccessTip = ''
|
||||
|
||||
//避免重复请求
|
||||
if (chatid == this.isChatingId && opt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.isChatingId = chatid;
|
||||
this.page = 1;
|
||||
this.specificChatMessage = [];
|
||||
this.message_num = 10;
|
||||
this.scrollHeight = 0;
|
||||
|
||||
//清除未读
|
||||
this.buylist[this.liaoData[this.groupIndex].type][index].message_unread_num = 0;
|
||||
//将排队中的拿过来
|
||||
if (this.groupIndex == 1) {
|
||||
this.buylist.buyerWaitings.splice(index, 1);
|
||||
let data = {
|
||||
session_id: chatid,
|
||||
identify: 'customer_service',
|
||||
type: 'access',
|
||||
}
|
||||
this.websocket.send(JSON.stringify(data)); //
|
||||
} else {
|
||||
let ChatingData = {
|
||||
identify: 'customer_service',
|
||||
type: 'message_list',
|
||||
session_id: this.isChatingId,
|
||||
data: {
|
||||
page: this.page,
|
||||
per_page: this.per_page,
|
||||
// last_id: 第一页不用传,以后一直传 第一页的第一条的消息的 id
|
||||
}
|
||||
}
|
||||
this.websocket.send(JSON.stringify(ChatingData));
|
||||
|
||||
// 监听这个dom的scroll事件
|
||||
if (this.$refs.shoproChatContainerRef) {
|
||||
this.$refs.shoproChatContainerRef.removeEventListener("scroll", this.listmore, false);
|
||||
}
|
||||
}
|
||||
if (this.groupIndex == 2) {
|
||||
if (row.status == 1) {
|
||||
if (!row.customer_service) {
|
||||
this.kefuAccessStatus = true;
|
||||
this.kefuAccessStatusSend = true;
|
||||
this.kefuAccessTip = '等待客服接入';
|
||||
return false
|
||||
}
|
||||
if (row.customer_service && row.customer_service.id != this.adminData.customer_service.id) {
|
||||
this.kefuAccessStatus = true;
|
||||
this.kefuAccessStatusSend = true;
|
||||
this.kefuAccessTip = '客服 ' + row.customer_service.name + ' 正在服务,暂时无法与之会话!';
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
closeKefuAccessStatus() {
|
||||
this.kefuAccessStatus = false;
|
||||
this.kefuAccessTip = ''
|
||||
},
|
||||
deleteChating(chatid, index, opt) {
|
||||
let data = {
|
||||
identify: 'customer_service',
|
||||
type: 'del_user',
|
||||
data: {
|
||||
session_id: chatid
|
||||
}
|
||||
}
|
||||
this.websocket.send(JSON.stringify(data));
|
||||
},
|
||||
selectCommonWords(index) {
|
||||
this.commonWordsvisible = false;
|
||||
this.doSend('text', this.commonWordsList[index].content)
|
||||
this.specificChatMessage.push(this.initSendData('text', this.commonWordsList[index].content));
|
||||
},
|
||||
selectEmoji(emoji) {
|
||||
this.emojivisible = false
|
||||
$(".shopro-send-pre").append(`<img class="emoji" src="${'/assets/addons/shopro/img/emoji/' + emoji.file}"/>`)
|
||||
},
|
||||
selectGoods() {
|
||||
let that = this;
|
||||
parent.Fast.api.open("shopro/goods/goods/select?multiple=false", "选择商品", {
|
||||
callback: function (data) {
|
||||
that.doSend('goods', {
|
||||
id: data.data.id,
|
||||
title: data.data.title,
|
||||
image: data.data.image,
|
||||
price: data.data.price,
|
||||
stock: data.data.stock
|
||||
})
|
||||
that.specificChatMessage.push(that.initSendData('goods', data.data));
|
||||
}
|
||||
});
|
||||
},
|
||||
openGoods(id) {
|
||||
Fast.api.open("shopro/goods/goods/edit/ids/" + id + "?id=" + id + "&type=edit", '查看商品');
|
||||
},
|
||||
openOrder(id) {
|
||||
Fast.api.open('shopro/order/order/detail?id=' + id, '查看订单');
|
||||
},
|
||||
successMessage(event) {
|
||||
if (this.lineStatus == 'offline') {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '离开不能发消息,请切换为在线',
|
||||
type: 'warning'
|
||||
});
|
||||
return false
|
||||
}
|
||||
if (event) {
|
||||
//enter
|
||||
if (event.keyCode == "13" && !event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
event.cancelBubble = true;
|
||||
let html = $(".shopro-send-pre").html();
|
||||
var reg = new RegExp('<div><br></div>', "g")
|
||||
html = html.replace(reg, '')
|
||||
if (html) {
|
||||
this.doSend('text', html)
|
||||
this.specificChatMessage.push(this.initSendData('text', html));
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '消息不能为空',
|
||||
type: 'warning'
|
||||
});
|
||||
$(".shopro-send-pre").html('')
|
||||
return false;
|
||||
}
|
||||
} else if (event.keyCode == "13" && event.ctrlKey) {
|
||||
$('.shopro-send-pre').html($('.shopro-send-pre').html() + "<div><br/></div>");
|
||||
var send = $('.shopro-send-pre')[0];
|
||||
//兼容问题
|
||||
if (window.getSelection) {
|
||||
send.focus();
|
||||
var move = window.getSelection();
|
||||
move.selectAllChildren(send);
|
||||
move.collapseToEnd();
|
||||
} else if (document.selection) {
|
||||
var move = document.selection.createRange();
|
||||
move.moveToElementText(send);
|
||||
move.collapse(false);
|
||||
move.select();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//发送按钮
|
||||
if ($(".shopro-send-pre").html()) {
|
||||
this.doSend('text', $(".shopro-send-pre").html())
|
||||
this.specificChatMessage.push(this.initSendData('text', $(".shopro-send-pre").html()));
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '消息不能为空',
|
||||
type: 'warning'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.shoproKefuShake = false;
|
||||
this.kefuButtonvisible = false;
|
||||
this.rightShowId = null;
|
||||
},
|
||||
moveKefu(e) {
|
||||
this.isClick = false
|
||||
let odiv = e.target;
|
||||
document.onselectstart = function () {
|
||||
return false;
|
||||
};
|
||||
document.ondragstart = function () {
|
||||
return false;
|
||||
};
|
||||
$(document).find("iframe").css("pointer-events", "none");
|
||||
let disX = e.clientX - odiv.offsetLeft;
|
||||
let disY = e.clientY - odiv.offsetTop;
|
||||
document.onmousemove = (e) => {
|
||||
let left = e.clientX - disX;
|
||||
let top = e.clientY - disY;
|
||||
if (Math.abs(left - this.positionY + top - this.positionX) > 6) {
|
||||
this.isClick = true;
|
||||
}
|
||||
this.positionX = top;
|
||||
this.positionY = left;
|
||||
|
||||
odiv.style.left = left + 'px';
|
||||
odiv.style.top = top + 'px';
|
||||
|
||||
var shopro_kefu_button_position = [left, top];
|
||||
localStorage.setItem("shopro_kefu_button_position", shopro_kefu_button_position);
|
||||
document.querySelector(".error-tip-popover").style.left = (left - 275) + 'px'
|
||||
document.querySelector(".error-tip-popover").style.top = (top + 3) + 'px';
|
||||
};
|
||||
document.onmouseup = (e) => {
|
||||
document.onselectstart = function () {
|
||||
return true;
|
||||
};
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
$(document).find("iframe").css("pointer-events", "auto");
|
||||
};
|
||||
},
|
||||
openDialog() {
|
||||
if (!this.isClick) {
|
||||
this.dialogVisible = true;
|
||||
this.kefuButtonvisible = false;
|
||||
}
|
||||
},
|
||||
addfile(event) {
|
||||
let that = this;
|
||||
let formData = new FormData();
|
||||
formData.append("file", that.$refs.inputFileRef.files[0]);
|
||||
$.ajax({
|
||||
url: window.location.origin + "/addons/shopro/index/upload",
|
||||
type: 'post',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (res) {
|
||||
that.doSend('image', res.data.url)
|
||||
that.specificChatMessage.push(that.initSendData('image', res.data.url))
|
||||
},
|
||||
error: function (e) {
|
||||
layer.msg('文件上传失败');
|
||||
},
|
||||
complete: function () {
|
||||
that.$refs.inputFileRef.value = ""
|
||||
}
|
||||
})
|
||||
},
|
||||
voicePlay() {
|
||||
new Audio('/assets/addons/shopro/audio/notice.wav').play();
|
||||
},
|
||||
//发送消息的数据组装
|
||||
doSend(type, message, index) {
|
||||
var submessage = message
|
||||
if (type == 'text') {
|
||||
let reg = /<img class="emoji".*?(?:>|\/>)/gi; // [] img
|
||||
let zhEmojiName = submessage.match(reg);
|
||||
if (zhEmojiName) {
|
||||
zhEmojiName.forEach(item => {
|
||||
let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i
|
||||
let path = item.match(srcReg)[1]
|
||||
let pathArr = path.split('/');
|
||||
let file = pathArr[pathArr.length - 1];
|
||||
let noimage = {
|
||||
name: '[常用语]'
|
||||
}
|
||||
let emojiItem = this.selEmjioFile('file', file) ? this.selEmjioFile('file', file) : noimage;
|
||||
submessage = submessage.replace(
|
||||
item, `${emojiItem.name}`
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
let data = {
|
||||
session_id: this.isChatingId,
|
||||
identify: 'customer_service',
|
||||
type: 'message',
|
||||
message: {
|
||||
message_type: type,
|
||||
message: submessage
|
||||
},
|
||||
}
|
||||
this.websocket.send(JSON.stringify(data));
|
||||
},
|
||||
|
||||
//发送之前处理数据
|
||||
initSendData(type, message) {
|
||||
return {
|
||||
message: message,
|
||||
message_type: type,
|
||||
sender_identify: "customer_service",
|
||||
identify: this.adminData.customer_service
|
||||
}
|
||||
},
|
||||
timeFilter(datetime) {
|
||||
let timeday = ''
|
||||
// let timestamp = Date.parse(new Date())
|
||||
let datestamp = new Date(datetime)
|
||||
// if (timestamp - datetime < 86400) {
|
||||
// var hour = ("0" + datestamp.getHours()).slice(-2),
|
||||
// minute = ("0" + datestamp.getMinutes()).slice(-2);
|
||||
// timeday = hour + ":" + minute
|
||||
// }else if (timestamp - datetime < 172800 && timestamp - datetime > 86400) {
|
||||
// timeday = '昨天'
|
||||
// } else {
|
||||
timeday = datestamp.getFullYear() + '/' + (Number(datestamp.getMonth()) + 1) + '/' + datestamp.getDate() + ' ' + ("0" + datestamp.getHours()).slice(-2) + ':' + ("0" + datestamp.getMinutes()).slice(-2)
|
||||
// }
|
||||
return timeday;
|
||||
},
|
||||
|
||||
// 表情地址
|
||||
selEmjioFile(type, value) {
|
||||
for (let index in this.emoji_list) {
|
||||
if (this.emoji_list[index][type] === value) {
|
||||
return this.emoji_list[index];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// 替换表情
|
||||
replaceEmjio(data) {
|
||||
let newData = data;
|
||||
let reg = /\[(.+?)\]/g; // [] 中括号
|
||||
let zhEmojiName = newData.match(reg);
|
||||
if (zhEmojiName) {
|
||||
zhEmojiName.forEach(item => {
|
||||
let emojiItem = this.selEmjioFile('name', item);
|
||||
newData = newData.replace(
|
||||
item,
|
||||
`<img class="emoji" src="${'/assets/addons/shopro/img/emoji/' + emojiItem.file}"/>`
|
||||
);
|
||||
});
|
||||
}
|
||||
return newData;
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
1
public/assets/tool/libs/clipboard.min.js
vendored
普通文件
1
public/assets/tool/libs/clipboard.min.js
vendored
普通文件
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
780
public/assets/tool/libs/common.css
普通文件
780
public/assets/tool/libs/common.css
普通文件
@@ -0,0 +1,780 @@
|
||||
/* elementui */
|
||||
.el-pagination,
|
||||
.el-pagination__total,
|
||||
.el-input__inner,
|
||||
.el-pagination__jump {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.el-radio-button__inner {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-radio-button__inner,
|
||||
.el-radio-button__inner:hover {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked + .el-radio__label,
|
||||
.el-tabs__item.is-active,
|
||||
.el-tabs__item:hover,
|
||||
.el-pager li.active,
|
||||
.el-select-dropdown__item.selected,
|
||||
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected,
|
||||
.el-checkbox__input.is-checked + .el-checkbox__label {
|
||||
color: #7438d5;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked .el-radio__inner,
|
||||
.el-tabs__active-bar,
|
||||
.el-checkbox__input.is-checked .el-checkbox__inner,
|
||||
.el-checkbox__input.is-indeterminate .el-checkbox__inner,
|
||||
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
||||
background: #7438d5;
|
||||
border-color: #7438d5;
|
||||
}
|
||||
|
||||
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
||||
box-shadow: -1px 0 0 0 #7438d5;
|
||||
}
|
||||
|
||||
.el-button--primary,
|
||||
.el-button--primary:hover,
|
||||
.el-button--primary:focus,
|
||||
.el-button--primary:active {
|
||||
background: #7438d5;
|
||||
border-color: #7438d5;
|
||||
color: #fff;
|
||||
}
|
||||
.el-button--primary.is-disabled,
|
||||
.el-button--primary.is-disabled:active,
|
||||
.el-button--primary.is-disabled:focus,
|
||||
.el-button--primary.is-disabled:hover {
|
||||
color: #fff;
|
||||
background-color: rgba(128, 106, 246, 0.6);
|
||||
border-color: rgba(128, 106, 246, 0.6);
|
||||
}
|
||||
|
||||
.el-date-editor .el-range-separator {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.el-table,
|
||||
.el-table thead,
|
||||
.el-table th {
|
||||
color: #444;
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.el-table th {
|
||||
background: #f9f9f9;
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
width: 80px;
|
||||
padding: 0;
|
||||
padding-right: 20px;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.el-tabs__nav-wrap::after {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.el-table td,
|
||||
.el-table th,
|
||||
.el-table th.is-leaf {
|
||||
border-color: #f7f7f7;
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
.el-table th .cell,
|
||||
.el-table td .cell {
|
||||
/* padding: 8px 10px; */
|
||||
/* height: 44px;
|
||||
line-height: 20px;*/
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.el-table th .cell {
|
||||
/* height: 40px; */
|
||||
/* padding: 8px 10px; */
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-input__icon {
|
||||
/* height: 34px;
|
||||
line-height: 34px; */
|
||||
}
|
||||
|
||||
/* image */
|
||||
.el-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-slot {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.tabs-custom {
|
||||
position: relative;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.el-tabs__header {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* form */
|
||||
.el-form-item__label,
|
||||
.el-radio {
|
||||
color: #444;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input-group__append {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.el-input-group__prepend {
|
||||
/* padding: 0 10px; */
|
||||
width: 116px;
|
||||
background: #f0f0f0;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* 超出省略号 */
|
||||
.ellipsis-item {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.ellipsis-item-2 {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.ellipsis-1 {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* flex布局 */
|
||||
.display-flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.display-flex-c {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.display-flex-b {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.flex-1 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 主题颜色 */
|
||||
.theme-color {
|
||||
color: #7536d0;
|
||||
}
|
||||
|
||||
.theme-delete-color {
|
||||
color: #ff5959;
|
||||
}
|
||||
|
||||
.color-444 {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.color-666 {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* index页面32px */
|
||||
.custom-index .el-input__inner {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.custom-index .el-input__inner,
|
||||
.custom-index .el-input__icon {
|
||||
/* height: 32px;
|
||||
line-height: 32px; */
|
||||
}
|
||||
|
||||
/* 标题头部 */
|
||||
.custom-header {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.custom-header-title {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
/* 头部按钮 */
|
||||
.custom-button-container {
|
||||
margin-bottom: 14px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.custom-table-header {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
/* 刷新 */
|
||||
.custom-refresh {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin-right: 14px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.create-btn {
|
||||
background: #7536d0;
|
||||
color: #fff;
|
||||
width: 100px;
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.create-btn i {
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.recycle-btn {
|
||||
width: 88px;
|
||||
color: #444;
|
||||
border: #444 1px solid;
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.recycle-btn i {
|
||||
margin-right: 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* table */
|
||||
.custom-table-body {
|
||||
margin: 14px 0 30px;
|
||||
}
|
||||
|
||||
.el-table__fixed-right::before,
|
||||
.el-table__fixed::before {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.el-table .bg-color {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.cell-left .cell {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
|
||||
.border-right {
|
||||
border-right: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
.table-edit-text {
|
||||
color: #7536d0;
|
||||
cursor: pointer;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.table-delete-text {
|
||||
color: #ff5959;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 分页 */
|
||||
.pagination-container {
|
||||
justify-content: flex-end;
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shopro-container-scrollbar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.shopro-container-scrollbar::-webkit-scrollbar-thumb {
|
||||
width: 6px;
|
||||
background: #ccc;
|
||||
height: 20px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* add edit */
|
||||
.dialog-form {
|
||||
height: calc(100vh - 110px);
|
||||
overflow-y: auto;
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
.dialog-form::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.dialog-form::-webkit-scrollbar-thumb {
|
||||
width: 6px;
|
||||
background: #e6e6e6;
|
||||
height: 20px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.create-store {
|
||||
margin-left: 45px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
padding: 10px;
|
||||
height: 46px;
|
||||
justify-content: flex-end;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dialog-cancel-btn {
|
||||
width: 88px;
|
||||
height: 36px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dialog-define-btn {
|
||||
width: 88px;
|
||||
height: 36px;
|
||||
background: #7438d5;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* .el-dialog */
|
||||
.el-dialog {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.shopro-button {
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shopro-reset-button {
|
||||
width: 78px;
|
||||
height: 32px;
|
||||
color: #888;
|
||||
background: #ffffff;
|
||||
border: 1px solid #999999;
|
||||
}
|
||||
|
||||
.shopro-screen-button {
|
||||
width: 78px;
|
||||
height: 32px;
|
||||
background: #6e3dc8;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.shopro-add-button {
|
||||
background: #7536d0;
|
||||
color: #fff;
|
||||
width: 98px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.shopro-add-button i {
|
||||
margin-right: 5px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.shopro-delete-button {
|
||||
width: 88px;
|
||||
height: 36px;
|
||||
color: #ff5959;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.shopro-refresh-button {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid #e6e6e6;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.shopro-edit-text {
|
||||
color: #7438d5;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.shopro-delete-text {
|
||||
color: #ed655f;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.shopro-detail-text {
|
||||
color: #0ace97;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.shopro-form-group-title {
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
margin-bottom: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.shopro-form-group-title-line {
|
||||
width: 2px;
|
||||
height: 16px;
|
||||
background: #7438d5;
|
||||
border-radius: 4px;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
/* index */
|
||||
.shopro-tabs-container {
|
||||
}
|
||||
|
||||
.shopro-tabs-container .el-tabs__nav-scroll {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.shopro-tabs-container .el-tabs__item {
|
||||
width: 100px;
|
||||
padding: 0;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.shopro-tabs-container .el-tabs__active-bar {
|
||||
width: 80px !important;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.shopro-screen-container {
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.shopro-screen-container .shopro-screen-item {
|
||||
margin-right: 30px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.shopro-screen-container .shopro-screen-item:last-of-type {
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.shopro-screen-item-button {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.shopro-screen-container .shopro-screen-tip {
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.shopro-screen-container .shopro-screen-condition {
|
||||
width: 176px;
|
||||
}
|
||||
|
||||
.shopro-header-container {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
padding: 0 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.shopro-index-button-container {
|
||||
margin-bottom: 14px;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.shopro-table-container {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.shopro-table-container .el-table .table-image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border: 1px solid #e6e6e6;
|
||||
box-sizing: border-box;
|
||||
border-radius: 2px;
|
||||
margin-right: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.shopro-table-container .cell > div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.shopro-table-container .cell-left .cell > div {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.shopro-pagination-container {
|
||||
padding: 30px 20px 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.el-date-editor.el-input,
|
||||
.el-date-editor.el-input__inner {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.shopro-status-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
margin-right: 6px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.shopro-status-normal {
|
||||
color: #65c62c;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.shopro-status-normal-dot {
|
||||
background: #65c62c;
|
||||
}
|
||||
|
||||
.shopro-status-nonormal {
|
||||
color: #ed5b56;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.shopro-status-nonormal-dot {
|
||||
background: #ed5b56;
|
||||
}
|
||||
|
||||
.shopro-status-default {
|
||||
color: #777;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.shopro-status-default-dot {
|
||||
background: #777;
|
||||
}
|
||||
|
||||
.shopro-status-special {
|
||||
color: #4390f7;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.shopro-status-special-dot {
|
||||
background: #4390f7;
|
||||
}
|
||||
|
||||
.shopro-status-other {
|
||||
color: #f0af41;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.shopro-status-other-dot {
|
||||
background: #f0af41;
|
||||
}
|
||||
|
||||
.nice-validator .el-input__inner {
|
||||
vertical-align: baseline !important;
|
||||
}
|
||||
|
||||
.shopro-submit-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0px;
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
padding: 10px 36px;
|
||||
border-top: 1px solid #ededed;
|
||||
z-index: 10;
|
||||
}
|
||||
.is-center .cell {
|
||||
text-align: center;
|
||||
}
|
||||
.el-table .is-center .cell {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.is-left .cell {
|
||||
text-align: left;
|
||||
}
|
||||
.el-table .is-left .cell {
|
||||
justify-content: left;
|
||||
}
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
}
|
||||
.activity-tags {
|
||||
padding: 4px 8px;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
color: #fff;
|
||||
border-radius: 2px;
|
||||
margin-right: 4px;
|
||||
width: fit-content;
|
||||
}
|
||||
.activity-tags:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
.groupon-activity-tag {
|
||||
background: #9b7dd9;
|
||||
}
|
||||
.seckill-activity-tag {
|
||||
background: #ff8d7c;
|
||||
}
|
||||
.full-activity-tag {
|
||||
background: #f5ae6b;
|
||||
}
|
||||
|
||||
/* status */
|
||||
.shopro-status-info {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.shopro-status-info .shopro-status-dot {
|
||||
background: #777;
|
||||
}
|
||||
|
||||
.shopro-status-error {
|
||||
color: #ed5b56;
|
||||
}
|
||||
|
||||
.shopro-status-error .shopro-status-dot {
|
||||
background: #ed5b56;
|
||||
}
|
||||
|
||||
.shopro-status-warning {
|
||||
color: #f0af41;
|
||||
}
|
||||
|
||||
.shopro-status-warning .shopro-status-dot {
|
||||
background: #f0af41;
|
||||
}
|
||||
|
||||
.shopro-status-success {
|
||||
color: #65c62c;
|
||||
}
|
||||
|
||||
.shopro-status-success .shopro-status-dot {
|
||||
background: #65c62c;
|
||||
}
|
||||
26302
public/assets/tool/libs/element/element.css
普通文件
26302
public/assets/tool/libs/element/element.css
普通文件
文件差异内容过多而无法显示
加载差异
文件差异因一行或多行过长而隐藏
二进制文件未显示。
二进制文件未显示。
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{"name":"[笑掉牙]","file":"xiaodiaoya.png"},
|
||||
{"name":"[可爱]","file":"keai.png"},
|
||||
{"name":"[冷酷]","file":"lengku.png"},
|
||||
{"name":"[闭嘴]","file":"bizui.png"},
|
||||
{"name":"[生气]","file":"shengqi.png"},
|
||||
{"name":"[惊恐]","file":"jingkong.png"},
|
||||
{"name":"[瞌睡]","file":"keshui.png"},
|
||||
{"name":"[大笑]","file":"daxiao.png"},
|
||||
{"name":"[爱心]","file":"aixin.png"},
|
||||
{"name":"[坏笑]","file":"huaixiao.png"},
|
||||
{"name":"[飞吻]","file":"feiwen.png"},
|
||||
{"name":"[疑问]","file":"yiwen.png"},
|
||||
{"name":"[开心]","file":"kaixin.png"},
|
||||
{"name":"[发呆]","file":"fadai.png"},
|
||||
{"name":"[流泪]","file":"liulei.png"},
|
||||
{"name":"[汗颜]","file":"hanyan.png"},
|
||||
{"name":"[惊悚]","file":"jingshu.png"},
|
||||
{"name":"[困~]","file":"kun.png"},
|
||||
{"name":"[心碎]","file":"xinsui.png"},
|
||||
{"name":"[天使]","file":"tianshi.png"},
|
||||
{"name":"[晕]","file":"yun.png"},
|
||||
{"name":"[啊]","file":"a.png"},
|
||||
{"name":"[愤怒]","file":"fennu.png"},
|
||||
{"name":"[睡着]","file":"shuizhuo.png"},
|
||||
{"name":"[面无表情]","file":"mianwubiaoqing.png"},
|
||||
{"name":"[难过]","file":"nanguo.png"},
|
||||
{"name":"[犯困]","file":"fankun.png"},
|
||||
{"name":"[好吃]","file":"haochi.png"},
|
||||
{"name":"[呕吐]","file":"outu.png"},
|
||||
{"name":"[龇牙]","file":"ziya.png"},
|
||||
{"name":"[懵比]","file":"mengbi.png"},
|
||||
{"name":"[白眼]","file":"baiyan.png"},
|
||||
{"name":"[饿死]","file":"esi.png"},
|
||||
{"name":"[凶]","file":"xiong.png"},
|
||||
{"name":"[感冒]","file":"ganmao.png"},
|
||||
{"name":"[流汗]","file":"liuhan.png"},
|
||||
{"name":"[笑哭]","file":"xiaoku.png"},
|
||||
{"name":"[流口水]","file":"liukoushui.png"},
|
||||
{"name":"[尴尬]","file":"ganga.png"},
|
||||
{"name":"[惊讶]","file":"jingya.png"},
|
||||
{"name":"[大惊]","file":"dajing.png"},
|
||||
{"name":"[不好意思]","file":"buhaoyisi.png"},
|
||||
{"name":"[大闹]","file":"danao.png"},
|
||||
{"name":"[不可思议]","file":"bukesiyi.png"},
|
||||
{"name":"[爱你]","file":"aini.png"},
|
||||
{"name":"[红心]","file":"hongxin.png"},
|
||||
{"name":"[点赞]","file":"dianzan.png"},
|
||||
{"name":"[恶魔]","file":"emo.png"}
|
||||
]
|
||||
7037
public/assets/tool/libs/html2canvas.js
普通文件
7037
public/assets/tool/libs/html2canvas.js
普通文件
文件差异内容过多而无法显示
加载差异
4602
public/assets/tool/libs/moment.js
普通文件
4602
public/assets/tool/libs/moment.js
普通文件
文件差异内容过多而无法显示
加载差异
@@ -0,0 +1,412 @@
|
||||
/**
|
||||
* @license text 2.0.16 Copyright jQuery Foundation and other contributors.
|
||||
* Released under MIT license, http://github.com/requirejs/text/LICENSE
|
||||
*/
|
||||
/*jslint regexp: true */
|
||||
/*global require, XMLHttpRequest, ActiveXObject,
|
||||
define, window, process, Packages,
|
||||
java, location, Components, FileUtils */
|
||||
|
||||
define(['module'], function (module) {
|
||||
'use strict';
|
||||
|
||||
var text, fs, Cc, Ci, xpcIsWindows,
|
||||
progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
|
||||
xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
|
||||
bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
|
||||
hasLocation = typeof location !== 'undefined' && location.href,
|
||||
defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
|
||||
defaultHostName = hasLocation && location.hostname,
|
||||
defaultPort = hasLocation && (location.port || undefined),
|
||||
buildMap = {},
|
||||
masterConfig = (module.config && module.config()) || {};
|
||||
|
||||
function useDefault(value, defaultValue) {
|
||||
return value === undefined || value === '' ? defaultValue : value;
|
||||
}
|
||||
|
||||
//Allow for default ports for http and https.
|
||||
function isSamePort(protocol1, port1, protocol2, port2) {
|
||||
if (port1 === port2) {
|
||||
return true;
|
||||
} else if (protocol1 === protocol2) {
|
||||
if (protocol1 === 'http') {
|
||||
return useDefault(port1, '80') === useDefault(port2, '80');
|
||||
} else if (protocol1 === 'https') {
|
||||
return useDefault(port1, '443') === useDefault(port2, '443');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
text = {
|
||||
version: '2.0.16',
|
||||
|
||||
strip: function (content) {
|
||||
//Strips <?xml ...?> declarations so that external SVG and XML
|
||||
//documents can be added to a document without worry. Also, if the string
|
||||
//is an HTML document, only the part inside the body tag is returned.
|
||||
if (content) {
|
||||
content = content.replace(xmlRegExp, "");
|
||||
var matches = content.match(bodyRegExp);
|
||||
if (matches) {
|
||||
content = matches[1];
|
||||
}
|
||||
} else {
|
||||
content = "";
|
||||
}
|
||||
return content;
|
||||
},
|
||||
|
||||
jsEscape: function (content) {
|
||||
return content.replace(/(['\\])/g, '\\$1')
|
||||
.replace(/[\f]/g, "\\f")
|
||||
.replace(/[\b]/g, "\\b")
|
||||
.replace(/[\n]/g, "\\n")
|
||||
.replace(/[\t]/g, "\\t")
|
||||
.replace(/[\r]/g, "\\r")
|
||||
.replace(/[\u2028]/g, "\\u2028")
|
||||
.replace(/[\u2029]/g, "\\u2029");
|
||||
},
|
||||
|
||||
createXhr: masterConfig.createXhr || function () {
|
||||
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
||||
var xhr, i, progId;
|
||||
if (typeof XMLHttpRequest !== "undefined") {
|
||||
return new XMLHttpRequest();
|
||||
} else if (typeof ActiveXObject !== "undefined") {
|
||||
for (i = 0; i < 3; i += 1) {
|
||||
progId = progIds[i];
|
||||
try {
|
||||
xhr = new ActiveXObject(progId);
|
||||
} catch (e) {}
|
||||
|
||||
if (xhr) {
|
||||
progIds = [progId]; // so faster next time
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return xhr;
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a resource name into its component parts. Resource names
|
||||
* look like: module/name.ext!strip, where the !strip part is
|
||||
* optional.
|
||||
* @param {String} name the resource name
|
||||
* @returns {Object} with properties "moduleName", "ext" and "strip"
|
||||
* where strip is a boolean.
|
||||
*/
|
||||
parseName: function (name) {
|
||||
var modName, ext, temp,
|
||||
strip = false,
|
||||
index = name.lastIndexOf("."),
|
||||
isRelative = name.indexOf('./') === 0 ||
|
||||
name.indexOf('../') === 0;
|
||||
|
||||
if (index !== -1 && (!isRelative || index > 1)) {
|
||||
modName = name.substring(0, index);
|
||||
ext = name.substring(index + 1);
|
||||
} else {
|
||||
modName = name;
|
||||
}
|
||||
|
||||
temp = ext || modName;
|
||||
index = temp.indexOf("!");
|
||||
if (index !== -1) {
|
||||
//Pull off the strip arg.
|
||||
strip = temp.substring(index + 1) === "strip";
|
||||
temp = temp.substring(0, index);
|
||||
if (ext) {
|
||||
ext = temp;
|
||||
} else {
|
||||
modName = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
moduleName: modName,
|
||||
ext: ext,
|
||||
strip: strip
|
||||
};
|
||||
},
|
||||
|
||||
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
|
||||
|
||||
/**
|
||||
* Is an URL on another domain. Only works for browser use, returns
|
||||
* false in non-browser environments. Only used to know if an
|
||||
* optimized .js version of a text resource should be loaded
|
||||
* instead.
|
||||
* @param {String} url
|
||||
* @returns Boolean
|
||||
*/
|
||||
useXhr: function (url, protocol, hostname, port) {
|
||||
var uProtocol, uHostName, uPort,
|
||||
match = text.xdRegExp.exec(url);
|
||||
if (!match) {
|
||||
return true;
|
||||
}
|
||||
uProtocol = match[2];
|
||||
uHostName = match[3];
|
||||
|
||||
uHostName = uHostName.split(':');
|
||||
uPort = uHostName[1];
|
||||
uHostName = uHostName[0];
|
||||
|
||||
return (!uProtocol || uProtocol === protocol) &&
|
||||
(!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
|
||||
((!uPort && !uHostName) || isSamePort(uProtocol, uPort, protocol, port));
|
||||
},
|
||||
|
||||
finishLoad: function (name, strip, content, onLoad) {
|
||||
content = strip ? text.strip(content) : content;
|
||||
if (masterConfig.isBuild) {
|
||||
buildMap[name] = content;
|
||||
}
|
||||
onLoad(content);
|
||||
},
|
||||
|
||||
load: function (name, req, onLoad, config) {
|
||||
//Name has format: some.module.filext!strip
|
||||
//The strip part is optional.
|
||||
//if strip is present, then that means only get the string contents
|
||||
//inside a body tag in an HTML string. For XML/SVG content it means
|
||||
//removing the <?xml ...?> declarations so the content can be inserted
|
||||
//into the current doc without problems.
|
||||
|
||||
// Do not bother with the work if a build and text will
|
||||
// not be inlined.
|
||||
if (config && config.isBuild && !config.inlineText) {
|
||||
onLoad();
|
||||
return;
|
||||
}
|
||||
|
||||
masterConfig.isBuild = config && config.isBuild;
|
||||
|
||||
var parsed = text.parseName(name),
|
||||
nonStripName = parsed.moduleName +
|
||||
(parsed.ext ? '.' + parsed.ext : ''),
|
||||
url = req.toUrl(nonStripName),
|
||||
useXhr = (masterConfig.useXhr) ||
|
||||
text.useXhr;
|
||||
|
||||
// Do not load if it is an empty: url
|
||||
if (url.indexOf('empty:') === 0) {
|
||||
onLoad();
|
||||
return;
|
||||
}
|
||||
|
||||
//Load the text. Use XHR if possible and in a browser.
|
||||
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
|
||||
text.get(url, function (content) {
|
||||
text.finishLoad(name, parsed.strip, content, onLoad);
|
||||
}, function (err) {
|
||||
if (onLoad.error) {
|
||||
onLoad.error(err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//Need to fetch the resource across domains. Assume
|
||||
//the resource has been optimized into a JS module. Fetch
|
||||
//by the module name + extension, but do not include the
|
||||
//!strip part to avoid file system issues.
|
||||
req([nonStripName], function (content) {
|
||||
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
|
||||
parsed.strip, content, onLoad);
|
||||
}, function (err) {
|
||||
if (onLoad.error) {
|
||||
onLoad.error(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
write: function (pluginName, moduleName, write, config) {
|
||||
if (buildMap.hasOwnProperty(moduleName)) {
|
||||
var content = text.jsEscape(buildMap[moduleName]);
|
||||
write.asModule(pluginName + "!" + moduleName,
|
||||
"define(function () { return '" +
|
||||
content +
|
||||
"';});\n");
|
||||
}
|
||||
},
|
||||
|
||||
writeFile: function (pluginName, moduleName, req, write, config) {
|
||||
var parsed = text.parseName(moduleName),
|
||||
extPart = parsed.ext ? '.' + parsed.ext : '',
|
||||
nonStripName = parsed.moduleName + extPart,
|
||||
//Use a '.js' file name so that it indicates it is a
|
||||
//script that can be loaded across domains.
|
||||
fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
|
||||
|
||||
//Leverage own load() method to load plugin value, but only
|
||||
//write out values that do not have the strip argument,
|
||||
//to avoid any potential issues with ! in file names.
|
||||
text.load(nonStripName, req, function (value) {
|
||||
//Use own write() method to construct full module value.
|
||||
//But need to create shell that translates writeFile's
|
||||
//write() to the right interface.
|
||||
var textWrite = function (contents) {
|
||||
return write(fileName, contents);
|
||||
};
|
||||
textWrite.asModule = function (moduleName, contents) {
|
||||
return write.asModule(moduleName, fileName, contents);
|
||||
};
|
||||
|
||||
text.write(pluginName, nonStripName, textWrite, config);
|
||||
}, config);
|
||||
}
|
||||
};
|
||||
|
||||
if (masterConfig.env === 'node' || (!masterConfig.env &&
|
||||
typeof process !== "undefined" &&
|
||||
process.versions &&
|
||||
!!process.versions.node &&
|
||||
!process.versions['node-webkit'] &&
|
||||
!process.versions['atom-shell'])) {
|
||||
//Using special require.nodeRequire, something added by r.js.
|
||||
fs = require.nodeRequire('fs');
|
||||
|
||||
text.get = function (url, callback, errback) {
|
||||
try {
|
||||
var file = fs.readFileSync(url, 'utf8');
|
||||
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
|
||||
if (file[0] === '\uFEFF') {
|
||||
file = file.substring(1);
|
||||
}
|
||||
callback(file);
|
||||
} catch (e) {
|
||||
if (errback) {
|
||||
errback(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
|
||||
text.createXhr())) {
|
||||
text.get = function (url, callback, errback, headers) {
|
||||
var xhr = text.createXhr(), header;
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
//Allow plugins direct access to xhr headers
|
||||
if (headers) {
|
||||
for (header in headers) {
|
||||
if (headers.hasOwnProperty(header)) {
|
||||
xhr.setRequestHeader(header.toLowerCase(), headers[header]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Allow overrides specified in config
|
||||
if (masterConfig.onXhr) {
|
||||
masterConfig.onXhr(xhr, url);
|
||||
}
|
||||
|
||||
xhr.onreadystatechange = function (evt) {
|
||||
var status, err;
|
||||
//Do not explicitly handle errors, those should be
|
||||
//visible via console output in the browser.
|
||||
if (xhr.readyState === 4) {
|
||||
status = xhr.status || 0;
|
||||
if (status > 399 && status < 600) {
|
||||
//An http 4xx or 5xx error. Signal an error.
|
||||
err = new Error(url + ' HTTP status: ' + status);
|
||||
err.xhr = xhr;
|
||||
if (errback) {
|
||||
errback(err);
|
||||
}
|
||||
} else {
|
||||
callback(xhr.responseText);
|
||||
}
|
||||
|
||||
if (masterConfig.onXhrComplete) {
|
||||
masterConfig.onXhrComplete(xhr, url);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
};
|
||||
} else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
|
||||
typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
|
||||
//Why Java, why is this so awkward?
|
||||
text.get = function (url, callback) {
|
||||
var stringBuffer, line,
|
||||
encoding = "utf-8",
|
||||
file = new java.io.File(url),
|
||||
lineSeparator = java.lang.System.getProperty("line.separator"),
|
||||
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
|
||||
content = '';
|
||||
try {
|
||||
stringBuffer = new java.lang.StringBuffer();
|
||||
line = input.readLine();
|
||||
|
||||
// Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
|
||||
// http://www.unicode.org/faq/utf_bom.html
|
||||
|
||||
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
|
||||
if (line && line.length() && line.charAt(0) === 0xfeff) {
|
||||
// Eat the BOM, since we've already found the encoding on this file,
|
||||
// and we plan to concatenating this buffer with others; the BOM should
|
||||
// only appear at the top of a file.
|
||||
line = line.substring(1);
|
||||
}
|
||||
|
||||
if (line !== null) {
|
||||
stringBuffer.append(line);
|
||||
}
|
||||
|
||||
while ((line = input.readLine()) !== null) {
|
||||
stringBuffer.append(lineSeparator);
|
||||
stringBuffer.append(line);
|
||||
}
|
||||
//Make sure we return a JavaScript string and not a Java string.
|
||||
content = String(stringBuffer.toString()); //String
|
||||
} finally {
|
||||
input.close();
|
||||
}
|
||||
callback(content);
|
||||
};
|
||||
} else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
|
||||
typeof Components !== 'undefined' && Components.classes &&
|
||||
Components.interfaces)) {
|
||||
//Avert your gaze!
|
||||
Cc = Components.classes;
|
||||
Ci = Components.interfaces;
|
||||
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
|
||||
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
|
||||
|
||||
text.get = function (url, callback) {
|
||||
var inStream, convertStream, fileObj,
|
||||
readData = {};
|
||||
|
||||
if (xpcIsWindows) {
|
||||
url = url.replace(/\//g, '\\');
|
||||
}
|
||||
|
||||
fileObj = new FileUtils.File(url);
|
||||
|
||||
//XPCOM, you so crazy
|
||||
try {
|
||||
inStream = Cc['@mozilla.org/network/file-input-stream;1']
|
||||
.createInstance(Ci.nsIFileInputStream);
|
||||
inStream.init(fileObj, 1, 0, false);
|
||||
|
||||
convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
|
||||
.createInstance(Ci.nsIConverterInputStream);
|
||||
convertStream.init(inStream, "utf-8", inStream.available(),
|
||||
Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
|
||||
|
||||
convertStream.readString(inStream.available(), readData);
|
||||
convertStream.close();
|
||||
inStream.close();
|
||||
callback(readData.value);
|
||||
} catch (e) {
|
||||
throw new Error((fileObj && fileObj.path || '') + ': ' + e);
|
||||
}
|
||||
};
|
||||
}
|
||||
return text;
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
function shoproSelectGoods(params,title) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
let url="shopro/goods/goods/select?multiple=" + params.multiple + "&type=" + params.type + "&ids=" + params.ids
|
||||
Fast.api.open(url, title, {
|
||||
callback: function (data) {
|
||||
resolve(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function shoproGoodsList(ids){
|
||||
return new Promise(function (resolve, reject) {
|
||||
let domain=window.location.origin;
|
||||
Fast.api.ajax({
|
||||
url: domain+'/addons/shopro/goods/lists?goods_ids=' + ids +"&per_page=999999999&type=all",
|
||||
loading: false,
|
||||
}, function (ret, res) {
|
||||
resolve(res.data);
|
||||
return false;
|
||||
})
|
||||
});
|
||||
}
|
||||
function shoproGoodsDetail(id){
|
||||
return new Promise(function (resolve, reject) {
|
||||
let domain=window.location.origin;
|
||||
Fast.api.ajax({
|
||||
url: domain+'/addons/shopro/goods/detail?id='+id,
|
||||
loading: false,
|
||||
}, function (ret, res) {
|
||||
resolve(res.data);
|
||||
return false;
|
||||
}, function (ret, res) {
|
||||
reject(res.data);
|
||||
return false;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
11965
public/assets/tool/libs/vue-dev.js
普通文件
11965
public/assets/tool/libs/vue-dev.js
普通文件
文件差异内容过多而无法显示
加载差异
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
在新工单中引用
屏蔽一个用户