This commit is contained in:
parent
c775ba8592
commit
700701f055
|
@ -9,29 +9,33 @@ const props = defineProps({
|
||||||
const config = reactive({
|
const config = reactive({
|
||||||
sip: { icon: 'phone', href: `sip:${props.phoneNumber}` },
|
sip: { icon: 'phone', href: `sip:${props.phoneNumber}` },
|
||||||
'say-simple': {
|
'say-simple': {
|
||||||
icon: 'help', // 'whatsapp',
|
icon: 'help', // 'whatsapp icon #6818',
|
||||||
href: null,
|
href: null,
|
||||||
|
channel: props.channel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip';
|
const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip';
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
let url;
|
let url;
|
||||||
let channel = props.channel;
|
let { channel } = config[type];
|
||||||
if (type === 'say-simple')
|
if (type === 'sip') return;
|
||||||
url = (await axios.get('SaySimpleConfigs/findOne')).data.url;
|
|
||||||
if (!props.channel)
|
|
||||||
channel = (
|
|
||||||
await axios.get('SaySimpleCountries/findOne', {
|
|
||||||
params: {
|
|
||||||
filter: { fields: ['channel'], where: { countryFk: 0 } },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
).data?.channel;
|
|
||||||
|
|
||||||
config[
|
if (type === 'say-simple') {
|
||||||
'say-simple'
|
url = (await axios.get('SaySimpleConfigs/findOne')).data.url;
|
||||||
].href = `${url}?customerIdentity=%2B${props.phoneNumber}&channelId=${channel}`;
|
if (!channel)
|
||||||
|
channel = (
|
||||||
|
await axios.get('SaySimpleCountries/findOne', {
|
||||||
|
params: {
|
||||||
|
filter: { fields: ['channel'], where: { countryFk: 0 } },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).data?.channel;
|
||||||
|
|
||||||
|
config[
|
||||||
|
type
|
||||||
|
].href = `${url}?customerIdentity=%2B${props.phoneNumber}&channelId=${channel}`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue