部署供货商客服入口

This commit is contained in:
unknown
2022-07-11 16:01:49 +08:00
parent e91466b3af
commit 503e8ed03f
7 changed files with 185 additions and 14 deletions

View File

@ -11,6 +11,7 @@ import { getDictName, getProjectTypeCode, getURLInformation, getUrlParam, getUrl
import { btnAuthority } from '@/utils/authority';
import ProList from '@ant-design/pro-list';
import { MessageOutlined } from '@ant-design/icons';
import CreateForm from '@/pages/ListTableList/components/CreateForm';
const { TabPane } = Tabs;
const { TextArea } = Input;
@ -127,7 +128,7 @@ const Index: React.FC<{}> = () => {
title: '我要咨询',
dataIndex: 'consult',
render: (text: any, record: any) => (
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{initChatUI(record)}}/>
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{createHiddenForm(record);initChatUI()}}/>
),
},
{
@ -291,6 +292,8 @@ const Index: React.FC<{}> = () => {
}
const saveProject = async (val: any) => { // 点击项目跟进存储项目信息
//创建临时表单-智慧客服
createHiddenForm(val)
val.returnURL = getReturnURL()
await followUpAProjectSupplier(val);
history.push('/ProjectLayout/Supplier/HomePageSectionList')
@ -403,10 +406,12 @@ const Index: React.FC<{}> = () => {
}
})
}
const initChatUI = (record:any) => { //智慧客服
const createHiddenForm = (record:any)=>{//智慧客服-创建临时表单
const customerservice = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=' + REACT_APP_CUSTOMERSERVICE_CLIENT_ID + '&redirect_uri=' + REACT_APP_CUSTOMERSERVICE_REDIRECT + '/redirect?page=home&mall3_token=';//智慧客服
var tempForm = document.createElement("form")
tempForm.id="tempForm1"
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
tempForm.id="tempForm_CustomerService"
tempForm.method="post"
tempForm.action=customerservice + sessionStorage.getItem('Authorization')
tempForm.target='_blank'
@ -512,12 +517,22 @@ const Index: React.FC<{}> = () => {
tempForm.appendChild(hideInput)
})
document.body.appendChild(tempForm);
tempForm.submit();
document.body.removeChild(tempForm);
}else{
message.warn('参数为空')
}
}
const initChatUI = () => { //智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.createElement("input")
if(tempForm){
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= 'PROJECTLIST'
tempForm.appendChild(hideInput)
tempForm.submit();
document.body.removeChild(tempForm);
}
}
return (
<>
<PageHeader