This commit is contained in:
2020-08-14 14:51:16 +08:00
5 changed files with 164 additions and 13 deletions

View File

@@ -38,7 +38,7 @@
<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>
<u-icon v-show="is_edit && item.user_id != 0" class="close" name="close" color="#666" size="18" @click="isTable(item.id,index)"></u-icon>
</view>
</view>
<!-- 简介 -->
@@ -246,6 +246,31 @@ export default {
}
});
},
// 删除标签
isTable(id,index) {
uni.showModal({
title: "提示",
content: "是否删除此标签?",
success: (res) => {
console.log();
if (res.confirm) {
this.delTable(id,index);
}
}
})
},
delTable(id,index) {
let me = this;
this.$u.post("Streaming/deltLabel", {label_id: id}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
this.fileListes.splice(index,1);
}
})
},
// 上传封面
uploadcover(data) {
console.log(data);

View File

@@ -16,17 +16,26 @@
@on-success="uploadcover"
></u-upload>
<view class="titles">视频</view>
<view class="videobox" v-if="videostate == false" @click="uploadvideo">
<view class="videobox video-flex" v-if="videostate == false" @click="uploadvideo">
<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
<view class="videotext">选择视频</view>
</view>
<view class="videobox" v-else @click="uploadvideo"><video :src="videopath" controls></video></view>
<view class="videobox" v-else @click="uploadvideo">
<video v-if="!is_video" :src="videopath" controls></video>
<view v-else class="video-mode">
<image src="../../static/videoPlay.png" mode=""></image>
</view>
</view>
<!-- 标签 -->
<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 && item.user_id != 0" class="close" name="close" color="#666" size="18" @click="isTable(item.id,index)"></u-icon>
</view>
</view>
<!-- 简介 -->
@@ -167,6 +176,7 @@ export default {
videopath: '', //视频链接
fileListes: [],
show: false,
is_video: false,
show_two: false,
arres_list: [],
shoplist: [], //选择商品列表
@@ -176,13 +186,27 @@ export default {
tagcontent: '', //新建标签名字
selectvideo: '', //视频名字
videostate: false, //视频状态
progress: 0
progress: 0,
is_edit: false, // 编辑标签
};
},
onLoad() {
this.getLiveSpec();
this.resetgood();
},
watch: {
show() {
let me = this;
if (this.show) {
this.is_video = true;
} else {
setTimeout(function() {
me.is_video = false;
},600)
}
},
immediate: true
},
methods: {
// 获取可以推荐的商品
resetgood() {
@@ -291,6 +315,31 @@ export default {
}
});
},
// 删除标签
isTable(id,index) {
uni.showModal({
title: "提示",
content: "是否删除此标签?",
success: (res) => {
console.log();
if (res.confirm) {
this.delTable(id,index);
}
}
})
},
delTable(id,index) {
let me = this;
this.$u.post("Streaming/deltLabel", {label_id: id}).then(res => {
if (res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success'
});
this.fileListes.splice(index,1);
}
})
},
// 上传封面
uploadcover(data) {
let obj = data.data;
@@ -305,6 +354,10 @@ export default {
show_add() {
this.show = !this.show;
},
// 编辑标签
editing() {
this.is_edit = !this.is_edit;
},
// 选择直播商品点击确定
changes() {
let that = this;
@@ -353,6 +406,10 @@ export default {
width: 690rpx;
margin: 0 auto;
padding-bottom:20rpx;
.flex-title {
display: flex;
justify-content: space-between;
}
.titles_border,
.uni-textarea-compute {
border: 1px #bababa solid !important;
@@ -487,6 +544,10 @@ export default {
display: inline-block;
margin-bottom: 28rpx;
color: #fff;
.close {
margin-left: 10rpx;
vertical-align: middle;
}
}
.active {
background: #ff780f;
@@ -497,16 +558,33 @@ export default {
color: rgba(51, 51, 51, 1);
margin: 30rpx 0;
}
.video-flex {
flex-direction: column;
font-size: 28rpx;
color: #666;
}
.videobox {
width: 200rpx;
height: 200rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #f4f5f6;
background-color: #f4f5f6;
margin-left: 10rpx;
border-radius: 10rpx;
.video-mode {
width: 200rpx;
height: 200rpx;
line-height: 280rpx;
text-align: center;
border-radius: 10rpx;
background-color: #000;
& > image {
width: 100rpx;
height: 100rpx;
}
}
}
.videotext {
margin-top: 10rpx;