2023-10-11 15:35:10 +08:00
|
|
|
<template v-if="value.reminder === true">
|
2023-10-19 17:02:13 +08:00
|
|
|
<div class="inline-block float-right cursor-pointer relative" :title="reminderTitle"
|
2023-10-11 15:35:10 +08:00
|
|
|
tabindex='-1'>
|
|
|
|
<i class="sn-icon sn-icon-notifications row-reminders-icon"></i>
|
|
|
|
<span :class="`inline-block absolute rounded-full w-2 h-2 right-1 top-0.5 ${reminderColor}`"></span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'Reminder',
|
|
|
|
props: {
|
|
|
|
valueType: null,
|
2023-10-19 17:02:13 +08:00
|
|
|
value: null
|
2023-10-11 15:35:10 +08:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
reminderColor() {
|
|
|
|
if (this.value.reminder && (this.value.stock_amount > 0 || this.value.days_left > 0)) {
|
2023-10-19 17:02:13 +08:00
|
|
|
return 'bg-sn-alert-brittlebush';
|
2023-10-11 15:35:10 +08:00
|
|
|
}
|
|
|
|
return 'bg-sn-alert-passion';
|
2023-10-19 17:02:13 +08:00
|
|
|
},
|
|
|
|
reminderTitle() {
|
|
|
|
let title = this.value.reminder_text
|
|
|
|
if (this.value.reminder_message) title = `${title}\n${this.value.reminder_message}`;
|
|
|
|
|
|
|
|
return title;
|
2023-10-11 15:35:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|