Spinners working, needs styling detail
This commit is contained in:
parent
9a353913da
commit
4dadb01fe8
3 changed files with 71 additions and 63 deletions
|
|
@ -16,17 +16,22 @@
|
|||
}}</span>
|
||||
<div
|
||||
class="availability-indicator rounded-pill"
|
||||
:class="availabilityRating === 'Good' ? 'green' : 'red'">
|
||||
<div class="availability-badge"></div>
|
||||
<span class="m-0 button-auxillary-copy">{{ availabilityRating == 'Good' ? "Appts available" : "Appts low" }}</span>
|
||||
<loader v-if="isLoaderDisplayed" :class="[this.loaderColor, this.loaderPosition]" />
|
||||
:class="availabilityRatingClass">
|
||||
<div v-if="!isLoaderDisplayed" class="availability-badge"></div>
|
||||
<span v-if="!isLoaderDisplayed" class="m-0 button-auxillary-copy">{{
|
||||
availabilityRating == "Good" ? "Appts available" : "Appts low"
|
||||
}}</span>
|
||||
<loader
|
||||
v-if="isLoaderDisplayed"
|
||||
:class="[this.loaderColor, this.loaderPosition]" />
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
<div class="row-two">
|
||||
<span
|
||||
v-if="buttonBodyCopy"
|
||||
class="m-0 button-label-sub-copy small"
|
||||
:class="textPosition"
|
||||
v-html="buttonBodyCopy"></span>
|
||||
</div>
|
||||
<span v-if="screenReaderOnlyText" class="sr-only">
|
||||
{{ screenReaderOnlyText }}
|
||||
</span>
|
||||
|
|
@ -46,24 +51,23 @@ export default {
|
|||
mixins: [inputButtonWrapperMixin],
|
||||
props: {
|
||||
loaderColor: String,
|
||||
loaderPosition: {
|
||||
type: String,
|
||||
default: "right",
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.displayLoader();
|
||||
this.additionalButtonData.availabilityRatingCallback(this.modelValue)
|
||||
.then((data) => {
|
||||
this.availabilityRating = data;
|
||||
//this.isLoaderDisplayed = false;
|
||||
})
|
||||
this.additionalButtonData.availabilityRatingCallback(this.modelValue).then((data) => {
|
||||
this.availabilityRating = data;
|
||||
this.isLoaderDisplayed = false;
|
||||
});
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoaderDisplayed: false,
|
||||
badgeText: "",
|
||||
availabilityRating: ""
|
||||
availabilityRating: "None",
|
||||
availabilityRatingClass: "",
|
||||
loaderPosition: "left"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -76,6 +80,18 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
availabilityRating: {
|
||||
handler(newValue) {
|
||||
if (newValue == "None") {
|
||||
this.availabilityRatingClass = "gray"
|
||||
} else {
|
||||
this.availabilityRatingClass = newValue == "Good" ? "green" : "red";
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
loader,
|
||||
baseInputButton,
|
||||
|
|
@ -84,7 +100,6 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.list-button {
|
||||
outline: none;
|
||||
input[type="radio"],
|
||||
|
|
@ -134,12 +149,15 @@ export default {
|
|||
}
|
||||
}
|
||||
.button-content {
|
||||
row-gap: 0.25rem;
|
||||
|
||||
.row-one {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
line-height: 1.5rem;
|
||||
|
||||
.button-label-copy {
|
||||
font-weight: 500;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.availability-indicator {
|
||||
|
|
@ -147,7 +165,7 @@ export default {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: auto;
|
||||
padding: .125rem .5rem;
|
||||
padding: 0.125rem 0.5rem;
|
||||
|
||||
.availability-badge {
|
||||
display: inline;
|
||||
|
|
@ -159,8 +177,6 @@ export default {
|
|||
margin: 0 0.25rem 0 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.button-auxillary-copy {
|
||||
box-sizing: border-box;
|
||||
justify-content: right;
|
||||
|
|
@ -168,32 +184,20 @@ export default {
|
|||
font-weight: 500;
|
||||
font-size: 0.75rem;
|
||||
align-items: center;
|
||||
//padding-right: 0.5rem;
|
||||
// background-image: url("data:image/svg+xml,%3Csvg width='13' height='12' viewBox='0 0 13 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 12C3.19159 12 0.5 9.30841 0.5 6C0.5 2.69159 3.19159 0 6.5 0C9.80841 0 12.5 2.69159 12.5 6C12.5 9.30841 9.80841 12 6.5 12ZM6.5 0.785047C3.62449 0.785047 1.28505 3.12449 1.28505 6C1.28505 8.87551 3.62449 11.215 6.5 11.215C9.37551 11.215 11.715 8.87551 11.715 6C11.715 3.12449 9.37551 0.785047 6.5 0.785047Z' fill='%23006A36'/%3E%3Cpath d='M5.697 7.95252C5.5927 7.95252 5.49289 7.91102 5.41999 7.837L3.90597 6.32299C3.75233 6.16934 3.75233 5.92149 3.90597 5.76785C4.05962 5.6142 4.30747 5.6142 4.46111 5.76785L5.69812 7.00373L8.53999 4.16186C8.69364 4.00822 8.94149 4.00822 9.09513 4.16186C9.24878 4.31551 9.24878 4.56336 9.09513 4.717L5.97626 7.83588C5.90224 7.9099 5.80242 7.9514 5.69925 7.9514L5.697 7.95252Z' fill='%23006A36'/%3E%3C/svg%3E%0A");
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: 0.75rem;
|
||||
// background-position: left;
|
||||
}
|
||||
|
||||
// .button-auxillary-copy::before {
|
||||
// display: inline-flex;
|
||||
// //content: url("data:image/svg+xml,%3Csvg width='13' height='12' viewBox='0 0 13 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 12C3.19159 12 0.5 9.30841 0.5 6C0.5 2.69159 3.19159 0 6.5 0C9.80841 0 12.5 2.69159 12.5 6C12.5 9.30841 9.80841 12 6.5 12ZM6.5 0.785047C3.62449 0.785047 1.28505 3.12449 1.28505 6C1.28505 8.87551 3.62449 11.215 6.5 11.215C9.37551 11.215 11.715 8.87551 11.715 6C11.715 3.12449 9.37551 0.785047 6.5 0.785047Z' fill='%23006A36'/%3E%3Cpath d='M5.697 7.95252C5.5927 7.95252 5.49289 7.91102 5.41999 7.837L3.90597 6.32299C3.75233 6.16934 3.75233 5.92149 3.90597 5.76785C4.05962 5.6142 4.30747 5.6142 4.46111 5.76785L5.69812 7.00373L8.53999 4.16186C8.69364 4.00822 8.94149 4.00822 9.09513 4.16186C9.24878 4.31551 9.24878 4.56336 9.09513 4.717L5.97626 7.83588C5.90224 7.9099 5.80242 7.9514 5.69925 7.9514L5.697 7.95252Z' fill='%23006A36'/%3E%3C/svg%3E%0A");
|
||||
// height: 1.25rem;
|
||||
// padding: 4px;
|
||||
// width: 1.25rem;
|
||||
|
||||
// background-image: url("data:image/svg+xml,%3Csvg width='13' height='12' viewBox='0 0 13 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5 12C3.19159 12 0.5 9.30841 0.5 6C0.5 2.69159 3.19159 0 6.5 0C9.80841 0 12.5 2.69159 12.5 6C12.5 9.30841 9.80841 12 6.5 12ZM6.5 0.785047C3.62449 0.785047 1.28505 3.12449 1.28505 6C1.28505 8.87551 3.62449 11.215 6.5 11.215C9.37551 11.215 11.715 8.87551 11.715 6C11.715 3.12449 9.37551 0.785047 6.5 0.785047Z' fill='%23006A36'/%3E%3Cpath d='M5.697 7.95252C5.5927 7.95252 5.49289 7.91102 5.41999 7.837L3.90597 6.32299C3.75233 6.16934 3.75233 5.92149 3.90597 5.76785C4.05962 5.6142 4.30747 5.6142 4.46111 5.76785L5.69812 7.00373L8.53999 4.16186C8.69364 4.00822 8.94149 4.00822 9.09513 4.16186C9.24878 4.31551 9.24878 4.56336 9.09513 4.717L5.97626 7.83588C5.90224 7.9099 5.80242 7.9514 5.69925 7.9514L5.697 7.95252Z' fill='%23006A36'/%3E%3C/svg%3E%0A");
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: 0.75rem;
|
||||
// background-position: left;
|
||||
// }
|
||||
|
||||
.loader {
|
||||
display: none;
|
||||
padding: 0.25rem 0.5rem;
|
||||
padding: 0 0.25rem 0 0.25rem;
|
||||
|
||||
//position: absolute;
|
||||
}
|
||||
|
||||
.loader:after {
|
||||
background-color: $gray-300 !important;
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
}
|
||||
|
||||
&.green {
|
||||
color: $green-700;
|
||||
background-color: $green-100;
|
||||
|
|
@ -203,7 +207,20 @@ export default {
|
|||
color: $red-600;
|
||||
background-color: $red-100;
|
||||
}
|
||||
|
||||
&.gray {
|
||||
color: $gray-600 !important;
|
||||
background-color: $gray-100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row-two {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.row-three {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
textPosition="text-start"
|
||||
v-model="selectedProviderNumber"
|
||||
isRequired
|
||||
validationRules="option-required"
|
||||
:additionalButtonData="additionalButtonData"/>
|
||||
validationRules="option-required"
|
||||
:additionalButtonData="additionalButtonData" />
|
||||
<textLink
|
||||
v-show="displaySeeMoreLocationsLink"
|
||||
ref="showMoreShopsLink"
|
||||
|
|
@ -107,9 +107,9 @@ export default {
|
|||
},
|
||||
additionalButtonData() {
|
||||
return {
|
||||
availabilityRatingCallback: getAvailabilityRating
|
||||
}
|
||||
}
|
||||
availabilityRatingCallback: getAvailabilityRating,
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
loadInitialData(serviceZipCode) {
|
||||
|
|
@ -166,16 +166,7 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
// for (let i = 0; i < this.answers.length; i++) {
|
||||
// const availabilityRating = await this.answers[i].getAvailabilityRating(
|
||||
// this.answers[i].value
|
||||
// );
|
||||
|
||||
// this.answers[i].buttonAuxillaryCopy = availabilityRating ? "Appts available" : "Appts low";
|
||||
|
||||
// }
|
||||
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
|
||||
if (this.shopIndex == this.shopProviders.length) {
|
||||
this.displaySeeMoreLocationsLink = false;
|
||||
|
|
@ -183,7 +174,7 @@ export default {
|
|||
this.displaySeeMoreLocationsLink = true;
|
||||
}
|
||||
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
|
||||
this.scrollToPageBottom();
|
||||
},
|
||||
|
|
@ -220,13 +211,13 @@ export default {
|
|||
async handler(newValue) {
|
||||
this.resetAnswers();
|
||||
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
|
||||
this.selectedProviderNumber = null;
|
||||
|
||||
this.$refs.buttonQuestion?.resetField();
|
||||
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
|
||||
if (newValue !== "Mobile") {
|
||||
await this.getNextShopsFromList();
|
||||
|
|
@ -235,7 +226,7 @@ export default {
|
|||
},
|
||||
shopProviders: {
|
||||
async handler(newValue) {
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
|
||||
if (this.selectedAppointmentType) {
|
||||
const selectedShopIndex = this.getSelectedProviderIndex(
|
||||
|
|
@ -247,7 +238,7 @@ export default {
|
|||
await this.getNextShopsFromList(selectedShopIndex + 1);
|
||||
} else {
|
||||
await this.getNextShopsFromList();
|
||||
await this.$nextTick();
|
||||
await nextTick();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1139,7 +1139,7 @@ export const actions = {
|
|||
getShopTimeSlots(
|
||||
context,
|
||||
{
|
||||
providerNumber,
|
||||
providerNumber = null,
|
||||
startDate = "2023-01-01",
|
||||
endDate = "2023-05-01",
|
||||
shopAppointmentType = "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue