优化页面
This commit is contained in:
@@ -1 +1 @@
|
||||
{"version":3,"file":"env.js","sources":["TUIKit/tui-customer-service-plugin/utils/env.ts"],"sourcesContent":["import { getPlatform } from '@tencentcloud/universal-api';\ndeclare const uni: any;\n\nexport const isPC = getPlatform() === 'pc';\n\nexport const isH5 = getPlatform() === 'h5';\n\nexport const isWeChat = getPlatform() === 'wechat';\n\nexport const isApp = getPlatform() === 'app';\n\nexport const isUniFrameWork = typeof uni !== 'undefined';\n\n// H5、小程序、app 均认为是手机端产品,如果需要统一手机端 UI 样式,可以直接用 isMobile 控制\nexport const isMobile = isH5 || isWeChat || isApp;\n"],"names":["getPlatform"],"mappings":";;AAGoBA,sBAAkB;AAElBA,sBAAkB;AAEdA,sBAAkB;AAE7B,MAAA,QAAQA,sBAAkB;;"}
|
||||
{"version":3,"file":"env.js","sources":["TUIKit/tui-customer-service-plugin/utils/env.ts"],"sourcesContent":["import { getPlatform } from '@tencentcloud/universal-api';\r\ndeclare const uni: any;\r\n\r\nexport const isPC = getPlatform() === 'pc';\r\n\r\nexport const isH5 = getPlatform() === 'h5';\r\n\r\nexport const isWeChat = getPlatform() === 'wechat';\r\n\r\nexport const isApp = getPlatform() === 'app';\r\n\r\nexport const isUniFrameWork = typeof uni !== 'undefined';\r\n\r\n// H5、小程序、app 均认为是手机端产品,如果需要统一手机端 UI 样式,可以直接用 isMobile 控制\r\nexport const isMobile = isH5 || isWeChat || isApp;\r\n"],"names":["getPlatform"],"mappings":";;AAGoBA,sBAAkB;AAElBA,sBAAkB;AAEdA,sBAAkB;AAE7B,MAAA,QAAQA,sBAAkB;;"}
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["TUIKit/tui-customer-service-plugin/utils/index.ts"],"sourcesContent":["import { customerServicePayloadType, IMessageModel } from '../interface';\nimport { CUSTOM_MESSAGE_SRC, TYPES } from '../constant';\n\n// Determine if it is a JSON string\nexport function isJSON(str: string): boolean {\n // eslint-disable-next-line no-useless-escape\n if (typeof str === 'string') {\n try {\n const data = JSON.parse(str);\n if (data) {\n return true;\n }\n return false;\n } catch (error: any) {\n return false;\n }\n }\n return false;\n}\n\n// Determine if it is a JSON string\nexport function JSONToObject(str: string) {\n if (!isJSON(str)) {\n return str;\n }\n return JSON.parse(str);\n}\n\nexport function isCustomerServiceMessage(message: IMessageModel): boolean {\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\n return Number(customerServicePayload?.customerServicePlugin) === 0 || Number(customerServicePayload?.chatbotPlugin) === 1;\n}\n\nexport const isMessageRating = (message: IMessageModel): boolean => {\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\n return isCustomerServiceMessage(message) && customerServicePayload.src === CUSTOM_MESSAGE_SRC.MENU;\n};\n\nexport const isMessageInvisible = (message: IMessageModel): boolean => {\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\n const robotCommandArray = ['feedback', 'updateBotStatus'];\n const whiteList = [\n CUSTOM_MESSAGE_SRC.MENU,\n CUSTOM_MESSAGE_SRC.BRANCH,\n CUSTOM_MESSAGE_SRC.BRANCH_NUMBER,\n CUSTOM_MESSAGE_SRC.FROM_INPUT,\n CUSTOM_MESSAGE_SRC.PRODUCT_CARD,\n CUSTOM_MESSAGE_SRC.ROBOT_MSG,\n CUSTOM_MESSAGE_SRC.RICH_TEXT,\n CUSTOM_MESSAGE_SRC.STREAM_TEXT,\n ];\n const isCustomerMessage = message?.type === TYPES.MSG_CUSTOM;\n const isCustomerInvisible = customerServicePayload?.src && !whiteList.includes(customerServicePayload?.src);\n const isRobot = customerServicePayload?.src === CUSTOM_MESSAGE_SRC.ROBOT && robotCommandArray.indexOf(customerServicePayload?.content?.command) !== -1;\n return isCustomerMessage && (isCustomerInvisible || isRobot);\n};\n"],"names":["CUSTOM_MESSAGE_SRC","TYPES"],"mappings":";;AAIO,SAAS,OAAO,KAAsB;AAEvC,MAAA,OAAO,QAAQ,UAAU;AACvB,QAAA;AACI,YAAA,OAAO,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ACtD;;;;;"}
|
||||
{"version":3,"file":"index.js","sources":["TUIKit/tui-customer-service-plugin/utils/index.ts"],"sourcesContent":["import { customerServicePayloadType, IMessageModel } from '../interface';\r\nimport { CUSTOM_MESSAGE_SRC, TYPES } from '../constant';\r\n\r\n// Determine if it is a JSON string\r\nexport function isJSON(str: string): boolean {\r\n // eslint-disable-next-line no-useless-escape\r\n if (typeof str === 'string') {\r\n try {\r\n const data = JSON.parse(str);\r\n if (data) {\r\n return true;\r\n }\r\n return false;\r\n } catch (error: any) {\r\n return false;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n// Determine if it is a JSON string\r\nexport function JSONToObject(str: string) {\r\n if (!isJSON(str)) {\r\n return str;\r\n }\r\n return JSON.parse(str);\r\n}\r\n\r\nexport function isCustomerServiceMessage(message: IMessageModel): boolean {\r\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\r\n return Number(customerServicePayload?.customerServicePlugin) === 0 || Number(customerServicePayload?.chatbotPlugin) === 1;\r\n}\r\n\r\nexport const isMessageRating = (message: IMessageModel): boolean => {\r\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\r\n return isCustomerServiceMessage(message) && customerServicePayload.src === CUSTOM_MESSAGE_SRC.MENU;\r\n};\r\n\r\nexport const isMessageInvisible = (message: IMessageModel): boolean => {\r\n const customerServicePayload: customerServicePayloadType = JSONToObject(message?.payload?.data);\r\n const robotCommandArray = ['feedback', 'updateBotStatus'];\r\n const whiteList = [\r\n CUSTOM_MESSAGE_SRC.MENU,\r\n CUSTOM_MESSAGE_SRC.BRANCH,\r\n CUSTOM_MESSAGE_SRC.BRANCH_NUMBER,\r\n CUSTOM_MESSAGE_SRC.FROM_INPUT,\r\n CUSTOM_MESSAGE_SRC.PRODUCT_CARD,\r\n CUSTOM_MESSAGE_SRC.ROBOT_MSG,\r\n CUSTOM_MESSAGE_SRC.RICH_TEXT,\r\n CUSTOM_MESSAGE_SRC.STREAM_TEXT,\r\n ];\r\n const isCustomerMessage = message?.type === TYPES.MSG_CUSTOM;\r\n const isCustomerInvisible = customerServicePayload?.src && !whiteList.includes(customerServicePayload?.src);\r\n const isRobot = customerServicePayload?.src === CUSTOM_MESSAGE_SRC.ROBOT && robotCommandArray.indexOf(customerServicePayload?.content?.command) !== -1;\r\n return isCustomerMessage && (isCustomerInvisible || isRobot);\r\n};\r\n"],"names":["CUSTOM_MESSAGE_SRC","TYPES"],"mappings":";;AAIO,SAAS,OAAO,KAAsB;AAEvC,MAAA,OAAO,QAAQ,UAAU;AACvB,QAAA;AACI,YAAA,OAAO,KAAK,MAAM,GAAG;AAC3B,UAAI,MAAM;AACD,eAAA;AAAA,MACT;AACO,aAAA;AAAA,aACA,OAAY;AACZ,aAAA;AAAA,IACT;AAAA,EACF;AACO,SAAA;AACT;AAGO,SAAS,aAAa,KAAa;AACpC,MAAA,CAAC,OAAO,GAAG,GAAG;AACT,WAAA;AAAA,EACT;AACO,SAAA,KAAK,MAAM,GAAG;AACvB;AAEO,SAAS,yBAAyB,SAAiC;;AACxE,QAAM,yBAAqD,cAAa,wCAAS,YAAT,mBAAkB,IAAI;AACvF,SAAA,OAAO,iEAAwB,qBAAqB,MAAM,KAAK,OAAO,iEAAwB,aAAa,MAAM;AAC1H;AAEa,MAAA,kBAAkB,CAAC,YAAoC;;AAClE,QAAM,yBAAqD,cAAa,wCAAS,YAAT,mBAAkB,IAAI;AAC9F,SAAO,yBAAyB,OAAO,KAAK,uBAAuB,QAAQA,yCAAmB,mBAAA;AAChG;AAEa,MAAA,qBAAqB,CAAC,YAAoC;;AACrE,QAAM,yBAAqD,cAAa,wCAAS,YAAT,mBAAkB,IAAI;AACxF,QAAA,oBAAoB,CAAC,YAAY,iBAAiB;AACxD,QAAM,YAAY;AAAA,IAChBA,yCAAAA,mBAAmB;AAAA,IACnBA,yCAAAA,mBAAmB;AAAA,IACnBA,yCAAAA,mBAAmB;AAAA,IACnBA,yCAAAA,mBAAmB;AAAA,IACnBA,yCAAAA,mB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