PureCloud WebChat
https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
https://apps.mypurecloud.com/widgets/9.0/cxbus.min.js
window._genesys = {
widgets: {
main: {
theme: ‘custom’,
lang: «es»,
i18n: «https://apps.mypurecloud.com/widgets/9.0/i18n/widgets-es.i18n.json»,
themes: {
custom: ‘cx-theme-custom’
}
},
webchat: {
emojis: true,
uploadsEnabled: false,
transport: {
type: ‘purecloud-v2-sockets’,
dataURL: ‘https://api.usw2.pure.cloud’,
deploymentKey: ‘2f1bcfc7-a591-4488-8cc5-87bda97becbc’,
orgGuid: ‘e13b2dd9-5679-4a6b-ab49-08129012b857’,
interactionData: {
routing: {
targetType: ‘QUEUE’,
targetAddress: ‘WebChat’,
priority: 2
}
}
},
userData: {
customField1Label: «Seguros»,
customField2Label: «Cédula»,
customField3Label: «Motivo»
}
}
}
};
const customPlugin = CXBus.registerPlugin(‘Custom’);
customPlugin.subscribe(‘WebChatService.started’, function (e) {
console.log(‘Chat started’, e);
});
customPlugin.subscribe(‘WebChatService.ended’, function (e) {
console.log(‘Chat ended’, e);
});
$(document).ready(function () {
validarHorario();
});
function validarHorario() {
const horaInicio = 6; //7am
const horaFinal = 19;//19pm
var d = new Date();
var hora = d.getHours();
var dia = d.getDay();
if (hora > horaInicio && hora < horaFinal) {
$('#divOcultar').show();
} else {
$('#divOcultar').hide();
}
}
function getAdvancedConfig() {
return {
form: {
autoSubmit: false,
},
formJSON: {
wrapper: '
‘,
inputs: [
{
id: ‘cx_webchat_form_firstname’,
name: ‘firstname’,
maxlength: ‘100’,
placeholder: ‘Requerido’,
label: ‘Nombres’,
},
{
id: ‘cx_webchat_form_phoneNumber’,
name: ‘phoneNumber’,
maxlength: ‘100’,
placeholder: ‘Opcional’,
label: ‘Teléfono’
},
{
id: ‘cx_webchat_form_email’,
name: ‘email’,
maxlength: ‘100’,
placeholder: ‘Optional’,
label: ‘Correo’
},
{
id: ‘custom_field_2’,
name: ‘customField2’,
maxlength: ‘100’,
placeholder: ‘Opcional’,
label: ‘Cédula’,
},
{
id: ‘custom_field_3’,
name: ‘customField3’,
maxlength: ‘100’,
placeholder: ‘Optional’,
label: ‘Motivo’
},
{
id: ‘custom_field_1′,
name:’customField1’,
type:»select»,
label: ‘Seguros’,
options:[
{text: ‘Seleccione’, value: ‘No seleccionó’},
{text: ‘PACIENTE PARTICULAR’, value: ‘PACIENTE PARTICULAR’},
{text: ‘ASISKEN’, value: ‘ASISKEN’},
{text: ‘BMI’, value: ‘BMI’},
{text: ‘ECUASANITAS’, value: ‘ECUASANITAS’},
{text: ‘GENERALI’, value: ‘GENERALI’},
{text: ‘HUMANA’, value: ‘HUMANA’},
{text: ‘MEDEC’, value: ‘MEDEC’},
{text: ‘PANAMERICAN LIFE’, value: ‘PANAMERICAN LIFE’},
{text: ‘PLAN PREVENTIVO FAMILIAR’, value: ‘PLAN PREVENTIVO FAMILIAR’},
{text: ‘SALUD’, value: ‘SALUD’},
{text: ‘SEGUROS SUCRE’, value: ‘SEGUROS SUCRE’},
{text: ‘TECNISEGUROS’, value: ‘TECNISEGUROS’},
]
},
]
}
};
}