Commit 1cebc707 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 隐藏采购订单待收货单号,接入第三方七鱼客服

parent f5316a2b
......@@ -6,8 +6,6 @@ import theme from './lingxi.theme.config';
const OPEN_THEME_BUILD = process.env.NODE_ENV === 'production' ? true : false; // 是否开启动态主题
const isProduction = process.env.NODE_ENV === 'production' ? true : false;
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const config: any = {
// 如需写入环境变量 需在config中先写入
define: {
......@@ -18,8 +16,6 @@ const config: any = {
// layout: {},
esbuild: {},
antd: {},
mfsu: {},
webpack5: {},
locale: {
antd: true,
// 默认情况下,当前语言环境的识别按照:localStorage 中 umi_locale 值 > 浏览器检测 > default 设置的默认语言 > 中文
......@@ -114,50 +110,10 @@ const config: any = {
},
priority: 10,
},
antd: {
name: "antd",
test: /[\\/]node_modules[\\/]antd[\\/]/,
chunks: "all",
priority: 9
},
lodash: {
name: "lodash",
test: /[\\/]node_modules[\\/]lodash[\\/]/,
chunks: "all",
priority: -2
},
bizcharts: {
name: "bizcharts",
test: /[\\/]node_modules[\\/]bizcharts[\\/]/,
chunks: "all",
priority: 10
},
},
},
},
});
//过滤掉momnet的那些不使用的国际化文件
config
.plugin("replace")
.use(require("webpack").ContextReplacementPlugin).tap(() => {
return [/moment[/\\]locale$/, /zh-cn/];
});
isProduction &&
config.plugin('compression-webpack-plugin').use(
new CompressionWebpackPlugin({
// filename: 文件名称,这里我们不设置,让它保持和未压缩的文件同一个名称
algorithm: 'gzip', // 指定生成gzip格式
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'), // 匹配哪些格式文件需要压缩
threshold: 10240, //对超过10k的数据进行压缩
minRatio: 0.6 // 压缩比例,值为0 ~ 1
})
);
},
cssLoader: {
localsConvention: 'camelCase', // 将style中的class由 .foo-body 转化为fooBody调用
......
......@@ -102,7 +102,7 @@
"rgbaster": "^2.1.1",
"sortablejs": "^1.12.0",
"typescript": "^3.9.7",
"umi": "~3.5.20",
"umi": "~3.2.28",
"video-react": "^0.14.1",
"yorkie": "^2.0.0"
},
......
import React from 'react';
import React, {useEffect} from 'react';
import styles from './index.less';
import ask from '@/assets/imgs/ask.png';
import { getAuth } from '@/utils/auth';
import { configUsr, initQiyuImServer, toChatRoom } from '@/utils/im';
interface Iprops {}
const AnyQuestion: React.FC<Iprops> = () => {
const authInfo: any = getAuth() || {}
// @todo 根据pass平台接口配置 决定是跳转lx-IM还是网易七鱼IM 先接七鱼
const _self = false
useEffect(() => {
if(!_self) {
// 判断是否接入过
const _window: any = window
!_window?.ysf && initQiyuImServer('f5e5143fcbf14e0ad6126681dd359f0c')
}
}, [])
const openIMServer = () => {
if(!_self) {
configUsr(authInfo)
const _window: any = window
_window?.ysf && _window.ysf('open')
} else {
toChatRoom(authInfo.memberId)
}
}
return (
<div className={styles.anyQuestion}>
<div className={styles.title}>平台使用中遇到问题</div>
......@@ -15,7 +40,7 @@ const AnyQuestion: React.FC<Iprops> = () => {
<div className={styles.ask}>
<a
target={"__blank"}
href="http://p.qiao.baidu.com/cps/chat?siteId=11220066&userId=24534830&siteToken=49f62d4365e46c0f2c81538e4d168ab9"
onClick={openIMServer}
>
我要提问
</a>
......
......@@ -4,7 +4,7 @@ import { Popover, Row, Space } from 'antd'
export const AddressPop = (props) => {
const { pickInfo = null, children } = props
return pickInfo && pickInfo.deliverType === 2 ? <Space>
return pickInfo && pickInfo.deliveryType === 2 ? <Space>
<EnvironmentOutlined style={{marginRight: 8}}/>
<Popover content={
<Row>
......
......@@ -56,13 +56,13 @@ export const useSelfTable = () => {
key: 'batchNo',
render: text => text ? `第${text}次` : ''
},
{
title: '收货单号',
align: 'center',
dataIndex: 'receiptNo',
key: 'receiptNo',
render: (t, r) => r.orderDeliveryDetailsId ? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`}>{t}</Link> : <a href={`https://www.kuaidi100.com/chaxun?nu=${t}`} target="blank">{t}</a>
},
// {
// title: '收货单号',
// align: 'center',
// dataIndex: 'receiptNo',
// key: 'receiptNo',
// render: (t, r) => r.orderDeliveryDetailsId ? <Link to={`/memberCenter/tranactionAbility/stockSellStorage/bills/detail?id=${r.orderDeliveryDetailsId}&preview=1`}>{t}</Link> : <a href={`https://www.kuaidi100.com/chaxun?nu=${t}`} target="blank">{t}</a>
// },
{
title: '订单类型',
align: 'center',
......
......@@ -78,7 +78,7 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
})
}
const handleEvaluate = (id) => {
const handleEvaluate = () => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
}
......@@ -184,7 +184,7 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
const operationHandler = {
'取消订单': () => handleCancel(record),
'中止': () => handleSuspend(record),
'评价': () => handleEvaluate(record.orderId),
'评价': () => handleEvaluate(),
'转单': () => onlyTransform(record.orderId),
}
......
......@@ -100,6 +100,8 @@ export const removeAuth = () => {
removeCookie(AUTH_ROLES_KEY, { path: '/', domain: getTopDomainByHost(TOP_DOMAIN, true) })
window.localStorage.removeItem(AUTH_KEY)
removeRouters()
const _window: any = window
_window?.ysf && _window.ysf('logoff')
}
const HOME_URL = [
......
......@@ -102,3 +102,41 @@ export const notificationChatRoom = (content: any) => {
onClose: close,
});
}
/**
* 七鱼客服 注册用户信息
* @param authInfo 用户信息
*/
export const configUsr = (authInfo) => {
const _window: any = window
_window?.ysf && _window.ysf('config', {
uid: authInfo.token,
name: authInfo.company,
mobile: authInfo.account,
level : authInfo.levelTag,
data:JSON.stringify([
{"index":2, "key":"name", "label":"会员名称", "value":authInfo.name},
{"index":3, "key":"levelTag", "label":"会员等级", "value":authInfo.levelTag},
{"index":4, "key":"userId", "label":"用户ID", "value":authInfo.userId},
{"index":5, "key":"memberId", "label":"会员ID", "value":authInfo.memberId},
{"index":6, "key":"memberRoleId", "label":"会员角色ID", "value":authInfo.memberRoleId},
])
});
}
/**
* 初始化 七鱼客服
* @param secretKey 标识字符串
* @returns
*/
export const initQiyuImServer = (secretKey: string) => {
return (function (w, d, n, a, j) {
w[n] = w[n] || function () {
(w[n].a = w[n].a || []).push(arguments);
};
j = d.createElement('script');
j.async = true;
j.src =`https://qiyukf.com/script/${secretKey}.js?hidden=1`;
d.body.appendChild(j);
})(window, document, 'ysf');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment