|
|
@ -30,10 +30,10 @@
|
|
|
|
<q-card-main>
|
|
|
|
<q-card-main>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="csc-call-info">
|
|
|
|
<div class="csc-call-info">
|
|
|
|
<q-field v-if="isPreparing" :helper="$t('call.inputNumber')" :count="64" dark
|
|
|
|
<q-field v-show="isPreparing" :helper="$t('call.inputNumber')" :count="64" dark
|
|
|
|
:error="validationEnabled && phoneNumberError" :error-label="$t('call.inputValidNumber')">
|
|
|
|
:error="validationEnabled && phoneNumberError" :error-label="$t('call.inputValidNumber')">
|
|
|
|
<q-input :float-label="$t('call.number')" v-model.trim="formattedPhoneNumber"
|
|
|
|
<q-input :float-label="$t('call.number')" v-model.trim="formattedPhoneNumber"
|
|
|
|
dark clearable max="64" @blur="phoneNumberBlur()" @focus="phoneNumberFocus()"/>
|
|
|
|
ref="numberInput" dark clearable max="64" @blur="phoneNumberBlur()" @focus="phoneNumberFocus()"/>
|
|
|
|
</q-field>
|
|
|
|
</q-field>
|
|
|
|
<div v-if="!isPreparing" class="phone-number">
|
|
|
|
<div v-if="!isPreparing" class="phone-number">
|
|
|
|
<q-icon v-if="isCalling && (localMediaType == 'audioVideo' || remoteMediaType == 'audioVideo')"
|
|
|
|
<q-icon v-if="isCalling && (localMediaType == 'audioVideo' || remoteMediaType == 'audioVideo')"
|
|
|
@ -73,6 +73,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
import _ from 'lodash';
|
|
|
|
import _ from 'lodash';
|
|
|
|
import { mapState, mapGetters } from 'vuex'
|
|
|
|
import { mapState, mapGetters } from 'vuex'
|
|
|
|
import CscMedia from './CscMedia'
|
|
|
|
import CscMedia from './CscMedia'
|
|
|
@ -92,14 +93,6 @@
|
|
|
|
validationEnabled: false
|
|
|
|
validationEnabled: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updated() {
|
|
|
|
|
|
|
|
if(this.$store.state.call.callState === 'incoming' ||
|
|
|
|
|
|
|
|
this.$store.state.call.callState === 'ringing') {
|
|
|
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$refs.incomingSound.pause();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
QLayout,
|
|
|
|
QLayout,
|
|
|
|
QCard,
|
|
|
|
QCard,
|
|
|
@ -116,6 +109,14 @@
|
|
|
|
Dialog
|
|
|
|
Dialog
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
focusNumberInput() {
|
|
|
|
|
|
|
|
Vue.nextTick(() => {
|
|
|
|
|
|
|
|
this.$refs.numberInput.focus();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
blurNumberInput() {
|
|
|
|
|
|
|
|
this.$refs.numberInput.blur();
|
|
|
|
|
|
|
|
},
|
|
|
|
init() {
|
|
|
|
init() {
|
|
|
|
this.phoneNumber = '';
|
|
|
|
this.phoneNumber = '';
|
|
|
|
this.validationEnabled = false;
|
|
|
|
this.validationEnabled = false;
|
|
|
@ -278,16 +279,24 @@
|
|
|
|
'localMediaType',
|
|
|
|
'localMediaType',
|
|
|
|
'remoteMediaType',
|
|
|
|
'remoteMediaType',
|
|
|
|
'isCaller',
|
|
|
|
'isCaller',
|
|
|
|
'isCallee'
|
|
|
|
'isCallee',
|
|
|
|
|
|
|
|
'callState'
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
isMobile() {
|
|
|
|
isMobile() {
|
|
|
|
return Platform.is.mobile;
|
|
|
|
return Platform.is.mobile;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
isIncoming(value) {
|
|
|
|
callState(state) {
|
|
|
|
if(value) {
|
|
|
|
if(state === 'incoming') {
|
|
|
|
showCallNotification(numberFormat(this.getNumber));
|
|
|
|
showCallNotification(numberFormat(this.getNumber));
|
|
|
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
|
|
|
} else if (state === 'input') {
|
|
|
|
|
|
|
|
this.focusNumberInput();
|
|
|
|
|
|
|
|
} else if (state === 'ringing') {
|
|
|
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$refs.incomingSound.pause();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|