调整参数
This commit is contained in:
@ -41,6 +41,7 @@ class manager extends PureComponent {
|
|||||||
supplierNumber: '', //智慧客服
|
supplierNumber: '', //智慧客服
|
||||||
staffId: '', //智慧客服'
|
staffId: '', //智慧客服'
|
||||||
staffName:'', //智慧客服
|
staffName:'', //智慧客服
|
||||||
|
kfType:0,//智慧客服
|
||||||
// NTKF_PARAM: {
|
// NTKF_PARAM: {
|
||||||
// siteid: "bl_1000", //企业ID,,为固定值
|
// siteid: "bl_1000", //企业ID,,为固定值
|
||||||
// settingid: "bl_1000_1492484340268", //接待组ID,为固定值,必填
|
// settingid: "bl_1000_1492484340268", //接待组ID,为固定值,必填
|
||||||
@ -82,10 +83,9 @@ class manager extends PureComponent {
|
|||||||
}
|
}
|
||||||
//智慧客服,获取供应商编码
|
//智慧客服,获取供应商编码
|
||||||
let userData = getSessionUserData()
|
let userData = getSessionUserData()
|
||||||
console.log(userData)
|
|
||||||
this.setState({staffId: userData.userId})
|
this.setState({staffId: userData.userId})
|
||||||
this.setState({staffName: userData.fullName})
|
this.setState({staffName: userData.fullName})
|
||||||
this.setState({supplierNumber: userData? userData.organizationId: 'EMPTY'})
|
this.setState({supplierNumber: userData.organizationId})
|
||||||
this.approvalDetail()
|
this.approvalDetail()
|
||||||
}
|
}
|
||||||
onChange = (date, dateString) => {
|
onChange = (date, dateString) => {
|
||||||
@ -173,7 +173,7 @@ class manager extends PureComponent {
|
|||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
const { downlist, projectlist, staloading, tlist, trelist, idList, dateNum } = this.props;
|
const { downlist, projectlist, staloading, tlist, trelist, idList, dateNum } = this.props;
|
||||||
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible, mainDetail, isModalVisible, isCloseWs, optionsModal, projectModal, supplierNumber, staffId, staffName, } = this.state;
|
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible, mainDetail, isModalVisible, isCloseWs, optionsModal, projectModal, supplierNumber, staffId, staffName, kfType,} = this.state;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
@ -318,15 +318,18 @@ class manager extends PureComponent {
|
|||||||
{/*智慧客服*/}
|
{/*智慧客服*/}
|
||||||
<ChatUI
|
<ChatUI
|
||||||
openProjectWin={()=>{
|
openProjectWin={()=>{
|
||||||
|
this.setState({kfType: 2})
|
||||||
this.setState({projectModal: true})
|
this.setState({projectModal: true})
|
||||||
}}
|
}}
|
||||||
openWin={()=>{
|
openWin={()=>{
|
||||||
|
this.setState({kfType: 1})
|
||||||
this.setState({optionsModal: false})
|
this.setState({optionsModal: false})
|
||||||
this.setState({isModalVisible: true})
|
this.setState({isModalVisible: true})
|
||||||
this.setState({isCloseWs: false})
|
this.setState({isCloseWs: false})
|
||||||
this.setState({isFlash :false})
|
this.setState({isFlash :false})
|
||||||
}}
|
}}
|
||||||
closeWin={()=>{
|
closeWin={()=>{
|
||||||
|
this.setState({kfType: 0})
|
||||||
this.setState({optionsModal: false})
|
this.setState({optionsModal: false})
|
||||||
this.setState({isModalVisible: false})
|
this.setState({isModalVisible: false})
|
||||||
this.setState({isCloseWs: true})
|
this.setState({isCloseWs: true})
|
||||||
@ -336,6 +339,7 @@ class manager extends PureComponent {
|
|||||||
projectModal={projectModal}
|
projectModal={projectModal}
|
||||||
isModalVisible={isModalVisible}
|
isModalVisible={isModalVisible}
|
||||||
//supplierNo='EMPTY'
|
//supplierNo='EMPTY'
|
||||||
|
kfType={kfType}
|
||||||
staffId={staffId}
|
staffId={staffId}
|
||||||
staffName={staffName}
|
staffName={staffName}
|
||||||
supplierNumber={supplierNumber}
|
supplierNumber={supplierNumber}
|
||||||
|
@ -25,6 +25,7 @@ const ChatInput = ((props) => {
|
|||||||
setPostion,
|
setPostion,
|
||||||
isModalVisible,
|
isModalVisible,
|
||||||
supplierNo,
|
supplierNo,
|
||||||
|
kfType,
|
||||||
conversationId,
|
conversationId,
|
||||||
isSend,
|
isSend,
|
||||||
sendMsg,
|
sendMsg,
|
||||||
@ -192,12 +193,12 @@ const ChatInput = ((props) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//发送消息给客服-websocket
|
//发送消息给客服-websocket 1 1 2
|
||||||
const sendToCs = (msg)=>{
|
const sendToCs = (msg)=>{
|
||||||
let params = {
|
let params = {
|
||||||
"clientNo": msg.user.id,
|
"clientNo": msg.user.id,
|
||||||
"contentType": msg.message.type=="text"?1:msg.message.type=="image"?2:msg.message.type=="file"?3:'',
|
"contentType": msg.message.type=="text"?1:msg.message.type=="image"?2:msg.message.type=="file"?3:'',
|
||||||
"custType": location.pathname.indexOf('/product-detail')!=-1? 2 : 1,
|
"custType": kfType == 2? 2 : 1,
|
||||||
"message": msg.message.type=="image" || msg.message.type=="file" ?JSON.stringify(msg.message.content):msg.message.content,
|
"message": msg.message.type=="image" || msg.message.type=="file" ?JSON.stringify(msg.message.content):msg.message.content,
|
||||||
//"questionType": location.pathname.indexOf('/home')!=-1? 3 : 1,
|
//"questionType": location.pathname.indexOf('/home')!=-1? 3 : 1,
|
||||||
"questionType": 2,
|
"questionType": 2,
|
||||||
@ -471,7 +472,7 @@ const str_substr = (start, end, str)=> {
|
|||||||
//评价
|
//评价
|
||||||
const onRateHandle = (score)=>{
|
const onRateHandle = (score)=>{
|
||||||
// const conversationId = '1506204072738394114'
|
// const conversationId = '1506204072738394114'
|
||||||
if(conversationId==''){
|
if(conversationId=='' || conversationId==undefined){
|
||||||
message.warn('您还没有发起咨询,无需评价')
|
message.warn('您还没有发起咨询,无需评价')
|
||||||
}else{
|
}else{
|
||||||
API.estimate({id: conversationId, remarkScore: score*2, remarkTime: moment(new Date()).format('yyyy-MM-DD HH:mm:ss')}).then(res=>{
|
API.estimate({id: conversationId, remarkScore: score*2, remarkTime: moment(new Date()).format('yyyy-MM-DD HH:mm:ss')}).then(res=>{
|
||||||
@ -517,7 +518,7 @@ const str_substr = (start, end, str)=> {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ChatToolBar onEmojiSelect={emojiSelectHandle} onImage={onImageHandle} onFile={onFileHandle} onRate={conversationId!=''? onRateHandle: null}/>
|
<ChatToolBar onEmojiSelect={emojiSelectHandle} onImage={onImageHandle} onFile={onFileHandle} onRate={conversationId!='' && conversationId!=undefined? onRateHandle: null}/>
|
||||||
<div
|
<div
|
||||||
onDragOver={(e)=>{e.preventDefault()}}
|
onDragOver={(e)=>{e.preventDefault()}}
|
||||||
className={style.input_area}
|
className={style.input_area}
|
||||||
|
@ -43,7 +43,7 @@ const conversation = (props) => {
|
|||||||
const wid = 600
|
const wid = 600
|
||||||
const hei = 500
|
const hei = 500
|
||||||
|
|
||||||
let {isModalVisible, isCloseWs, closeWin, hideWin, msgAlert, supplierNumber, staffId, staffName, optionsModal, projectModal, closeOptionsModal, closeProjectModal, openWin, openProjectWin} = props
|
let {isModalVisible, isCloseWs, closeWin, hideWin, msgAlert, supplierNumber, staffId, staffName, optionsModal, projectModal, closeOptionsModal, closeProjectModal, kfType, openWin, openProjectWin} = props
|
||||||
const onMsgRender = ()=>{
|
const onMsgRender = ()=>{
|
||||||
let serverAvatar = user
|
let serverAvatar = user
|
||||||
let data = wsMsg
|
let data = wsMsg
|
||||||
@ -95,7 +95,7 @@ const conversation = (props) => {
|
|||||||
const websocketInit = (id)=>{
|
const websocketInit = (id)=>{
|
||||||
//const bizServiceCustomService = 'http://10.242.31.158:8100/api/biz-customer-service'
|
//const bizServiceCustomService = 'http://10.242.31.158:8100/api/biz-customer-service'
|
||||||
var addr = `${REACT_APP_CUSTOMERSERVICE_WS_REDIRECT}` + '/websocketClient/'
|
var addr = `${REACT_APP_CUSTOMERSERVICE_WS_REDIRECT}` + '/websocketClient/'
|
||||||
let no = agentNumber!=''?agentNumber: supplierNumber
|
let no = kfType==1?'EMPTY':agentNumber
|
||||||
var ws = new WebSocket(addr+id+'/'+no);
|
var ws = new WebSocket(addr+id+'/'+no);
|
||||||
// 建立 web socket 连接成功触发事件
|
// 建立 web socket 连接成功触发事件
|
||||||
ws.onopen = function () {
|
ws.onopen = function () {
|
||||||
@ -135,7 +135,7 @@ const conversation = (props) => {
|
|||||||
})
|
})
|
||||||
API.check({
|
API.check({
|
||||||
clientNo: staffId,
|
clientNo: staffId,
|
||||||
supplierNo:agentNumber!=''?agentNumber: supplierNumber
|
supplierNo:kfType==1?'EMPTY':agentNumber
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
websocketInit(staffId)
|
websocketInit(staffId)
|
||||||
@ -268,7 +268,8 @@ const getProject = (params)=>{
|
|||||||
chatUI={chatUI}
|
chatUI={chatUI}
|
||||||
textHeight={textHeight}
|
textHeight={textHeight}
|
||||||
listHeight={listHeight}
|
listHeight={listHeight}
|
||||||
supplierNo={agentNumber!=''?agentNumber: supplierNumber}
|
kfType={kfType}
|
||||||
|
supplierNo={kfType==1?'EMPTY':agentNumber}
|
||||||
conversationId={conversationId}
|
conversationId={conversationId}
|
||||||
closeWin={()=>{
|
closeWin={()=>{
|
||||||
closeWin && closeWin()
|
closeWin && closeWin()
|
||||||
|
Reference in New Issue
Block a user