This commit is contained in:
Gdpao
2020-08-14 08:26:50 +08:00
parent fbdd3f20b4
commit 150c3337e4
5 changed files with 52 additions and 10 deletions

View File

@@ -31,10 +31,14 @@
></u-upload>
<!-- 标签 -->
<view>
<view class="titles">标签</view>
<view class="titles flex-title">
<text>标签</text>
<text @click="editing">{{ is_edit ? "取消编辑" : "编辑" }}</text>
</view>
<view class="form-view active" @click="show_add()">+ 新建标签</view>
<view :class="['form-view', item.state == true ? 'active' : '']" v-for="(item, index) in fileListes" :key="index" @click="changeselect(index)">
{{ item.name }}
<u-icon v-show="is_edit" class="close" name="close" color="#666" size="18"></u-icon>
</view>
</view>
<!-- 简介 -->
@@ -131,7 +135,8 @@ export default {
imgarr: [], //上传图片数组
cover: '', //图文封面
selectarr: [], //选中标签
tagcontent: ''
tagcontent: '',
is_edit: false, // 编辑
};
},
onLoad() {
@@ -233,6 +238,7 @@ export default {
} else {
this.tagcontent = '';
this.show = false;
this.fileListes.push(res.data);
this.$refs.uToast.show({
title: res.message,
type: 'success'
@@ -274,6 +280,10 @@ export default {
show_add() {
this.show = !this.show;
},
// 编辑标签
editing() {
this.is_edit = !this.is_edit;
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
let that = this;
@@ -339,18 +349,26 @@ export default {
width: 690rpx;
margin: 0 auto;
padding-bottom:20rpx;
.flex-title {
display: flex;
justify-content: space-between;
}
.form-view {
background: #cdc7c8;
border-radius: 6rpx;
margin-right: 20rpx;
font-size: 24rpx;
padding: 8rpx 20rpx;
display: inline-block;
padding: 8rpx 20rpx;
margin-right: 20rpx;
margin-bottom: 28rpx;
font-size: 24rpx;
color: #fff;
border-radius: 6rpx;
background-color: #cdc7c8;
.close {
margin-left: 10rpx;
vertical-align: middle;
}
}
.active {
background: #ff780f;
background-color: #ff780f;
}
.scroll {
width: 100%;

View File

@@ -265,6 +265,7 @@ export default {
} else {
this.tagcontent = '';
this.show = false;
this.fileListes.push(res.data);
this.$refs.uToast.show({
title: res.message,
type: 'success'