传参sceneUrl

This commit is contained in:
unknown
2022-07-18 10:01:12 +08:00
parent f2c3408fc8
commit 2bb91c7f76
4 changed files with 35 additions and 36 deletions

BIN
src/assets/img/kefu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -195,22 +195,24 @@ const Promenu: React.FC<{}> = () => {
setAnchorEl(null); setAnchorEl(null);
}; };
const initChatUI = () => { //智慧客服 const initChatUI = () => { //智慧客服
var pathname = window.location.pathname if(MethodDict!='procurement_mode_6' && MethodDict!='procurement_mode_7' && window.location.pathname.indexOf('BidEvaluation')!=-1){
var consultType = pathname.substring(pathname.lastIndexOf('/')+1) message.warn('非谈判类项目【评标】阶段禁止沟通')
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement }else{
if(tempForm){ var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.getElementById('tempInput_CustomerService') as HTMLInputElement if(tempForm){
if(hideInput){ var hideInput = document.getElementById('tempInput_CustomerService') as HTMLInputElement
hideInput.value= consultType if(hideInput){
}else{ hideInput.value= window.location.pathname
hideInput = document.createElement("input") }else{
hideInput.id = 'tempInput_CustomerService' hideInput = document.createElement("input")
hideInput.type="hidden" hideInput.id = 'tempInput_CustomerService'
hideInput.name= 'consultType' hideInput.type="hidden"
hideInput.value= consultType hideInput.name= 'sceneUrl'
tempForm.appendChild(hideInput) hideInput.value= window.location.pathname
tempForm.appendChild(hideInput)
}
tempForm.submit();
} }
tempForm.submit();
} }
} }
return ( return (

View File

@ -1,17 +1,15 @@
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, } from 'react';
import { Button, Tabs, Form, Input, Modal, Space, Checkbox, message, PageHeader, Popconfirm, Progress, Tag, Spin } from 'antd'; import { Button, Tabs, Form, Input, Modal, Checkbox, message, PageHeader, Popconfirm, Progress, Spin } from 'antd';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { getSection, exitProject, getProject, getOther, supplierRegister, exitProjectPayCheck } from './service'; import { getSection, exitProject, getProject, getOther, supplierRegister, exitProjectPayCheck } from './service';
import { getSupplierUser } from '@/utils/SupplierList/service' import { getSupplierUser } from '@/utils/SupplierList/service'
import { getProMethod, getSessionUserData, getRA } from '@/utils/session'; import { getProMethod, } from '@/utils/session';
import '@/assets/ld_style.less'; import '@/assets/ld_style.less';
import { history } from 'umi'; import { history } from 'umi';
import { followUpAProjectSupplier, getDicData } from '@/utils/session'; import { followUpAProjectSupplier, getDicData } from '@/utils/session';
import { getDictName, getProjectTypeCode, getURLInformation, getUrlParam, getUrlRelativePath, isEmpty, isNotEmpty, proTableValueEnum, proTableValueEnumOther } from '@/utils/CommonUtils'; import { getDictName, getProjectTypeCode, getURLInformation, getUrlParam, getUrlRelativePath, isEmpty, isNotEmpty, proTableValueEnum, proTableValueEnumOther } from '@/utils/CommonUtils';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
import ProList from '@ant-design/pro-list'; import kefu from '@/assets/img/kefu.png' //智慧客服
import { MessageOutlined } from '@ant-design/icons';
import CreateForm from '@/pages/ListTableList/components/CreateForm';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { TextArea } = Input; const { TextArea } = Input;
@ -128,7 +126,7 @@ const Index: React.FC<{}> = () => {
title: '我要咨询', title: '我要咨询',
dataIndex: 'consult', dataIndex: 'consult',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{createHiddenForm(record);initChatUI()}}/> <span onClick={()=>{createHiddenForm(record);initChatUI()}}><img style={{width:20,height:20, cursor:'pointer'}} src={kefu} alt="" /></span>
), ),
}, },
{ {
@ -407,7 +405,9 @@ const Index: React.FC<{}> = () => {
}) })
} }
const createHiddenForm = (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=';//智慧客服 //const customerservice = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=' + REACT_APP_CUSTOMERSERVICE_CLIENT_ID + '&redirect_uri=' + REACT_APP_CUSTOMERSERVICE_REDIRECT + '/redirect?page=home&mall3_token=';//智慧客服
const customerservice = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=S00hFPxc&redirect_uri=http://localhost:3000/redirect?page=home&mall3_token=';//智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm); if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form") tempForm = document.createElement("form")
@ -516,6 +516,10 @@ const Index: React.FC<{}> = () => {
} }
tempForm.appendChild(hideInput) tempForm.appendChild(hideInput)
}) })
var input = document.createElement("input")
input.name= 'sceneUrl'
input.value= window.location.pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm); document.body.appendChild(tempForm);
}else{ }else{
message.warn('参数为空') message.warn('参数为空')
@ -523,12 +527,7 @@ const Index: React.FC<{}> = () => {
} }
const initChatUI = () => { //智慧客服 const initChatUI = () => { //智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.createElement("input")
if(tempForm){ if(tempForm){
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= 'PROJECTLIST'
tempForm.appendChild(hideInput)
tempForm.submit(); tempForm.submit();
document.body.removeChild(tempForm); document.body.removeChild(tempForm);
} }

View File

@ -17,8 +17,7 @@ import Weboffice from "@/pages/webOffice/weboffice";
import { queryingPagingData } from '@/utils/PageUtils'; import { queryingPagingData } from '@/utils/PageUtils';
import ExtendUpload from '@/utils/ExtendUpload'; import ExtendUpload from '@/utils/ExtendUpload';
import { btnAuthority } from '@/utils/authority'; import { btnAuthority } from '@/utils/authority';
import { MessageOutlined } from '@ant-design/icons'; import kefu from '@/assets/img/kefu.png' //智慧客服
const { TabPane } = Tabs; const { TabPane } = Tabs;
//标的类型 //标的类型
@ -218,6 +217,10 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
} }
tempForm.appendChild(hideInput) tempForm.appendChild(hideInput)
}) })
var input = document.createElement("input")
input.name= 'sceneUrl'
input.value= window.location.pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm); document.body.appendChild(tempForm);
}else{ }else{
message.warn('参数为空') message.warn('参数为空')
@ -225,12 +228,7 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
} }
const initChatUI = () => { //智慧客服 const initChatUI = () => { //智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.createElement("input")
if(tempForm){ if(tempForm){
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= 'PROJECTLIST'
tempForm.appendChild(hideInput)
tempForm.submit(); tempForm.submit();
document.body.removeChild(tempForm); document.body.removeChild(tempForm);
} }
@ -287,7 +285,7 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
title: '我要咨询', title: '我要咨询',
dataIndex: 'consult', dataIndex: 'consult',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{createHiddenForm(record);initChatUI()}}/> <span onClick={()=>{createHiddenForm(record);initChatUI()}}><img style={{width:20,height:20, cursor:'pointer'}} src={kefu} alt="" /></span>
), ),
}, },
{ {