add reason to listennow first row

This commit is contained in:
vapormusic 2022-03-26 08:53:05 +07:00
parent 786e2b3038
commit 70e13ce6f4
5 changed files with 35 additions and 17 deletions

View file

@ -1829,6 +1829,13 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
}
}
.reasonSP{
// margin-left: 15px;
color: rgb(167 163 163);
font-weight: 500;
margin-left: 15px;
}
.text-overflow-elipsis {
display: -webkit-box;
min-width: 0px;

View file

@ -15,6 +15,7 @@
</template>
<template v-else>
<mediaitem-scroller-horizontal-sp
:withReason="index==0"
:items="recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-sp>
</template>
</template>
@ -27,7 +28,7 @@
<script>
Vue.component('listennow-child', {
template: "#listennow-child",
props: ["recom"],
props: ["recom","index"],
data: function () {
return {
isVisible: true,

View file

@ -2,7 +2,7 @@
<div class="cd-hmedia-scroller hmedia-scroller-card">
<vue-horizontal>
<template>
<mediaitem-square kind="card" :item="item" size="300"
<mediaitem-square kind="card" :item="item" size="300" :reasonShown="withReason"
v-for="item in items"></mediaitem-square>
</template>
</vue-horizontal>
@ -12,7 +12,10 @@
<script>
Vue.component('mediaitem-scroller-horizontal-sp', {
template: '#mediaitem-scroller-horizontal-sp',
props: ['items'],
props: {
'items': { type: Array , required: false },
'withReason': { type: Boolean, required: false, default: false },
},
data: function () {
return {
app: this.$root,

View file

@ -1,12 +1,13 @@
<script type="text/x-template" id="mediaitem-square">
<div
tabindex="0"
<div tabindex="0"
@click.self="app.routeView(item)"
@controller-click="app.routeView(item)"
@contextmenu.self="contextMenu"
class="cd-mediaitem-square" :class="getClasses()" @contextmenu="contextMenu"
v-observe-visibility="{callback: visibilityChanged}"
:style="{'--spcolor': getBgColor()}">
>
<div v-if="reasonShown && isVisible" class="reasonSP ">{{item?.meta?.reason?.stringForDisplay ?? ' '}}</div>
<div style="{'--spcolor': getBgColor()}"
class="cd-mediaitem-square" :class="getClasses()" @contextmenu="contextMenu">
<template v-if="isVisible">
<div class="artwork-container">
<div class="unavailable-overlay" v-if="unavailable">
@ -47,6 +48,7 @@
</div>
</template>
</div>
</div>
</script>
<script>
@ -69,6 +71,11 @@
type: Boolean,
default: false
},
reasonShown: {
type: Boolean,
default: false,
required: false
},
'contextExt': {type: Object, required: false},
},
data: function () {

View file

@ -1,8 +1,8 @@
<script type="text/x-template" id="cider-listen-now">
<div class="content-inner">
<h1 class="header-text">{{app.getLz('term.listenNow')}}</h1>
<template v-for="recom in data.data">
<listennow-child :recom="recom"></listennow-child>
<template v-for="(recom,index) in data.data">
<listennow-child :recom="recom" :index="index"></listennow-child>
</template>
</div>
</script>