传参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,24 +195,26 @@ const Promenu: React.FC<{}> = () => {
setAnchorEl(null);
};
const initChatUI = () => { //智慧客服
var pathname = window.location.pathname
var consultType = pathname.substring(pathname.lastIndexOf('/')+1)
if(MethodDict!='procurement_mode_6' && MethodDict!='procurement_mode_7' && window.location.pathname.indexOf('BidEvaluation')!=-1){
message.warn('非谈判类项目【评标】阶段禁止沟通')
}else{
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm){
var hideInput = document.getElementById('tempInput_CustomerService') as HTMLInputElement
if(hideInput){
hideInput.value= consultType
hideInput.value= window.location.pathname
}else{
hideInput = document.createElement("input")
hideInput.id = 'tempInput_CustomerService'
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= consultType
hideInput.name= 'sceneUrl'
hideInput.value= window.location.pathname
tempForm.appendChild(hideInput)
}
tempForm.submit();
}
}
}
return (
<div key='promenuDiv1' style={{ borderRadius: "6px", overflow: "hidden" }}>
<div key='promenuDiv2' className="site-page-header-ghost-wrapper" style={{ background: '#ffffff' }}>

View File

@ -1,17 +1,15 @@
import React, { useState, useRef, useEffect } from 'react';
import { Button, Tabs, Form, Input, Modal, Space, Checkbox, message, PageHeader, Popconfirm, Progress, Tag, Spin } from 'antd';
import React, { useState, useRef, } from 'react';
import { Button, Tabs, Form, Input, Modal, Checkbox, message, PageHeader, Popconfirm, Progress, Spin } from 'antd';
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { getSection, exitProject, getProject, getOther, supplierRegister, exitProjectPayCheck } from './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 { history } from 'umi';
import { followUpAProjectSupplier, getDicData } from '@/utils/session';
import { getDictName, getProjectTypeCode, getURLInformation, getUrlParam, getUrlRelativePath, isEmpty, isNotEmpty, proTableValueEnum, proTableValueEnumOther } from '@/utils/CommonUtils';
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';
import kefu from '@/assets/img/kefu.png' //智慧客服
const { TabPane } = Tabs;
const { TextArea } = Input;
@ -128,7 +126,7 @@ const Index: React.FC<{}> = () => {
title: '我要咨询',
dataIndex: 'consult',
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 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
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
@ -516,6 +516,10 @@ const Index: React.FC<{}> = () => {
}
tempForm.appendChild(hideInput)
})
var input = document.createElement("input")
input.name= 'sceneUrl'
input.value= window.location.pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm);
}else{
message.warn('参数为空')
@ -523,12 +527,7 @@ const Index: React.FC<{}> = () => {
}
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);
}

View File

@ -17,8 +17,7 @@ import Weboffice from "@/pages/webOffice/weboffice";
import { queryingPagingData } from '@/utils/PageUtils';
import ExtendUpload from '@/utils/ExtendUpload';
import { btnAuthority } from '@/utils/authority';
import { MessageOutlined } from '@ant-design/icons';
import kefu from '@/assets/img/kefu.png' //智慧客服
const { TabPane } = Tabs;
//标的类型
@ -218,6 +217,10 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
}
tempForm.appendChild(hideInput)
})
var input = document.createElement("input")
input.name= 'sceneUrl'
input.value= window.location.pathname
tempForm.appendChild(input)
document.body.appendChild(tempForm);
}else{
message.warn('参数为空')
@ -225,12 +228,7 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
}
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);
}
@ -287,7 +285,7 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
title: '我要咨询',
dataIndex: 'consult',
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>
),
},
{