|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-form-item label="标题:" prop="name">
|
|
|
- <el-input v-model="form.name" :maxlength="INPUTLENGTH" show-word-limit></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.name"
|
|
|
+ :maxlength="INPUTLENGTH"
|
|
|
+ show-word-limit
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="精品类型:">
|
|
@@ -13,11 +17,12 @@
|
|
|
<ul class="tuku">
|
|
|
<li v-for="(item, i) in filelist" :key="i">
|
|
|
<div class="imgcon">
|
|
|
- <el-image
|
|
|
- class="img"
|
|
|
+ <el-image
|
|
|
+ class="img"
|
|
|
:src="item.filePath"
|
|
|
:fit="'cover'"
|
|
|
- :preview-src-list="[item.filePath]">
|
|
|
+ :preview-src-list="[item.filePath]"
|
|
|
+ >
|
|
|
</el-image>
|
|
|
<div class="cover" v-if="item.isIndex">封面图片</div>
|
|
|
<el-button
|
|
@@ -44,6 +49,10 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</el-form-item>
|
|
|
+ <!-- 新增的链接 -->
|
|
|
+ <el-form-item label="链接:">
|
|
|
+ <el-input v-model="form.href"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -62,26 +71,26 @@ export default {
|
|
|
thumbUrl: this.$serverName + "cms/goods/uploadImg",
|
|
|
};
|
|
|
},
|
|
|
- watch:{
|
|
|
- 'filelist':function (newVal) {
|
|
|
- if (newVal.length<=0) {
|
|
|
- this.form.indexId = ''
|
|
|
- this.form.thumb = ''
|
|
|
+ watch: {
|
|
|
+ filelist: function (newVal) {
|
|
|
+ if (newVal.length <= 0) {
|
|
|
+ this.form.indexId = "";
|
|
|
+ this.form.thumb = "";
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
setCover(item) {
|
|
|
- this.form.indexId = item.id
|
|
|
- this.form.thumb = item.filePath
|
|
|
+ this.form.indexId = item.id;
|
|
|
+ this.form.thumb = item.filePath;
|
|
|
this.filelist.forEach((sub) => {
|
|
|
- //匹配置为0
|
|
|
- if (item.id == sub.id) {
|
|
|
- sub.isIndex = 1;
|
|
|
- } else {
|
|
|
- sub.isIndex = 0;
|
|
|
- }
|
|
|
- });
|
|
|
+ //匹配置为0
|
|
|
+ if (item.id == sub.id) {
|
|
|
+ sub.isIndex = 1;
|
|
|
+ } else {
|
|
|
+ sub.isIndex = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
del(item, i) {
|
|
@@ -104,15 +113,14 @@ export default {
|
|
|
reupload() {},
|
|
|
|
|
|
updateImg(data) {
|
|
|
-
|
|
|
this.filelist.push({
|
|
|
...data,
|
|
|
- isIndex:0
|
|
|
- })
|
|
|
+ isIndex: 0,
|
|
|
+ });
|
|
|
|
|
|
- if (this.filelist.length===1) {
|
|
|
- this.form.indexId = data.id
|
|
|
- this.form.thumb = data.filePath
|
|
|
+ if (this.filelist.length === 1) {
|
|
|
+ this.form.indexId = data.id;
|
|
|
+ this.form.thumb = data.filePath;
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -136,13 +144,13 @@ export default {
|
|
|
margin-bottom: @gap / 2;
|
|
|
position: relative;
|
|
|
background: #f0f0f0;
|
|
|
- overflow:hidden;
|
|
|
+ overflow: hidden;
|
|
|
.img {
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
}
|
|
|
.cover {
|
|
|
position: absolute;
|