feat: refs #6818 saysimple integration #904

Merged
jorgep merged 11 commits from 6818-saySimpleIntegration into dev 2024-11-13 08:25:27 +00:00
2 changed files with 22 additions and 4 deletions
Showing only changes of commit a467c44b91 - Show all commits

View File

@ -1,16 +1,29 @@
<script setup>
defineProps({ phoneNumber: { type: [String, Number], default: null } });
import { useAttrs } from 'vue';
const props = defineProps({
phoneNumber: { type: [String, Number], default: null },
channel: { type: Number, default: 1320 },
});
const config = {
sip: { icon: 'phone_in_talk', href: `sip:${props.phoneNumber}` },
'say-simple': {
icon: 'help', // 'whatsapp',
href: `https://verdnatura.saysimple.io/start-conversation?customerIdentity=%2B${props.phoneNumber}&channelId=${props.channel}`,
jorgep marked this conversation as resolved Outdated
Outdated
Review

quitar comentario?

quitar comentario?

Lo quiero dejar porque está pendiente. Cuando Paco rico lo pase lo añadiré pero de momento pongo ese. Le añado el número de tarea

Lo quiero dejar porque está pendiente. Cuando Paco rico lo pase lo añadiré pero de momento pongo ese. Le añado el número de tarea
},
};
const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip';
</script>
<template>
<QBtn
v-if="phoneNumber"
flat
round
icon="phone"
:icon="config[type].icon"
size="sm"
jorgep marked this conversation as resolved Outdated
Outdated
Review

Y si el tipo no es say-simple igualmente le pone el canal?

Y si el tipo no es say-simple igualmente le pone el canal?
color="primary"
jorgep marked this conversation as resolved Outdated
Outdated
Review

es lo mismo que poner if (type === 'say-simple') directamente jaja

es lo mismo que poner if (type === 'say-simple') directamente jaja

Tiene usted razón

Tiene usted razón
padding="none"
:href="`sip:${phoneNumber}`"
:href="config[type].href"
@click.stop
/>
</template>

View File

@ -95,6 +95,11 @@ const sumRisk = ({ clientRisks }) => {
<template #label>
{{ t('customer.summary.mobile') }}
<VnLinkPhone :phone-number="entity.mobile" />
<VnLinkPhone
say-simple
:phone-number="entity.mobile"
:channel="entity.country?.saySimpleCountry?.channel"
/>
</template>
</VnLv>
<VnLv :value="entity.email" copy
@ -142,7 +147,7 @@ const sumRisk = ({ clientRisks }) => {
<VnLv
v-if="entity.country"
:label="t('customer.summary.country')"
:value="entity.country.country"
:value="entity.country.name"
/>
<VnLv :label="t('customer.summary.street')" :value="entity.street" />
</QCard>