2018-08-27 14:21:36 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<section-header>
|
|
|
|
<h4>{{ __('Selling') }}</h4>
|
|
|
|
</section-header>
|
2018-08-27 14:27:12 +00:00
|
|
|
<div class="row" v-if="items">
|
2018-08-27 14:21:36 +00:00
|
|
|
<div class="col-md-7"
|
|
|
|
style="margin-bottom: 30px;"
|
|
|
|
v-for="item of items"
|
|
|
|
:key="item.name"
|
|
|
|
>
|
|
|
|
<item-list-card
|
|
|
|
:item="item"
|
|
|
|
>
|
|
|
|
<div slot="subtitle">
|
|
|
|
<span class="text-muted">{{ __('{0} conversations', [item.received_messages.length]) }}</span>
|
|
|
|
</div>
|
|
|
|
</item-list-card>
|
|
|
|
<div class="hub-list-item" v-for="(message, index) in item.received_messages" :key="index"
|
|
|
|
v-route="'marketplace/selling/' + message.buyer_email + '/' + item.name"
|
|
|
|
>
|
|
|
|
<div class="hub-list-left">
|
|
|
|
<div class="hub-list-body">
|
|
|
|
<div class="hub-list-title">
|
|
|
|
{{ message.buyer }}
|
|
|
|
</div>
|
|
|
|
<div class="hub-list-subtitle">
|
|
|
|
{{ message.sender }}: {{ message.content }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-27 14:27:12 +00:00
|
|
|
<empty-state v-else :message="__('This page keeps track of your items in which buyers have showed some interest.')" :centered="false" />
|
2018-08-27 14:21:36 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2018-08-27 14:27:12 +00:00
|
|
|
import EmptyState from '../components/EmptyState.vue';
|
2018-08-27 14:21:36 +00:00
|
|
|
import SectionHeader from '../components/SectionHeader.vue';
|
|
|
|
import ItemListCard from '../components/ItemListCard.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
SectionHeader,
|
2018-08-27 14:27:12 +00:00
|
|
|
ItemListCard,
|
|
|
|
EmptyState
|
2018-08-27 14:21:36 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2018-08-27 14:27:12 +00:00
|
|
|
items: null
|
2018-08-27 14:21:36 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.get_items_for_messages()
|
|
|
|
.then(items => {
|
|
|
|
this.items = items;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
get_items_for_messages() {
|
|
|
|
return hub.call('get_selling_items_for_messages');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|