...
|
...
|
@@ -2,16 +2,17 @@ |
|
|
<div>
|
|
|
<selectComp :cb="onClick">
|
|
|
<div class="hot">
|
|
|
<div class="hot-title">热门系列</div>
|
|
|
<div class="hot-title">{{name}}</div>
|
|
|
<div class="hot-body">
|
|
|
<img src="~assets/item_bg.png" alt="" srcset="" class="hot-title" v-for="i in list" :key="i.id">
|
|
|
<img src="~assets/item_bg.png" alt="" srcset="" class="hot-image" v-for="i in list" :key="i.id">
|
|
|
</div>
|
|
|
</div>
|
|
|
</selectComp>
|
|
|
|
|
|
<Modal v-model="show" title="系列资源位">
|
|
|
<hot-editor></hot-editor>
|
|
|
<Modal v-model="show" title="系列资源位" @on-ok="onOk" @on-cancel="onCancel">
|
|
|
<hot-editor :name.sync="name" :list.sync="list"></hot-editor>
|
|
|
</Modal>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
...
|
...
|
@@ -19,31 +20,44 @@ |
|
|
<script>
|
|
|
import selectComp from './select-comp';
|
|
|
import hotEditor from './hot-editor';
|
|
|
import ResourceService from '@/service/resource-service';
|
|
|
|
|
|
|
|
|
export default {
|
|
|
name: 'hot',
|
|
|
props: {
|
|
|
list: {
|
|
|
type: Array,
|
|
|
default () {
|
|
|
return []
|
|
|
}
|
|
|
},
|
|
|
click: {
|
|
|
type: Boolean,
|
|
|
default () {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
props: ['data', 'resContentDataId'],
|
|
|
data() {
|
|
|
let allData =JSON.parse(this.data);
|
|
|
|
|
|
return {
|
|
|
show: false
|
|
|
allData,
|
|
|
show: false,
|
|
|
name: allData.template_intro,
|
|
|
list: allData.data.split(','),
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.resourceService = new ResourceService();
|
|
|
},
|
|
|
methods: {
|
|
|
onClick() {
|
|
|
this.show = true;
|
|
|
},
|
|
|
onOk() {
|
|
|
this.allData.template_intro = this.name;
|
|
|
this.allData.data = this.list.join(',');
|
|
|
|
|
|
this.resourceService.editResource({
|
|
|
id: this.resContentDataId,
|
|
|
contentData: JSON.stringify(this.allData)
|
|
|
}).then(() => {
|
|
|
this.$bus.$emit('updated');
|
|
|
}).catch(() => {
|
|
|
this.$bus.$emit('updated');
|
|
|
})
|
|
|
},
|
|
|
onCancel() {
|
|
|
this.$bus.$emit('updated');
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
|