|
@@ -3,16 +3,18 @@
|
|
|
<u-cell-group class="form-info" :border="false">
|
|
|
<u-field label="视频名称" placeholder="请输入视频名称" label-width="180" v-model="videoInfo.videoName"></u-field>
|
|
|
<u-cell-item title="请上传视频" :arrow="false" v-if="type == 'add'">
|
|
|
- <cover-image slot="label" class="" :src="videoImg" v-if="videoImg"></cover-image>
|
|
|
- <view slot="label" class="upload-video" @tap="chooseVideoImage" v-else>
|
|
|
- <u-icon name="plus" size="40"></u-icon>
|
|
|
- <view class="u-add-tips" style="margin-top: 6px;">选择视频</view>
|
|
|
+ <view slot="label">
|
|
|
+ <cover-image class="video-img" :src="videoImg" v-show="videoImg"></cover-image>
|
|
|
+ <view class="upload-video" @tap="chooseVideoImage" v-if="!videoImg">
|
|
|
+ <u-icon name="plus" size="40"></u-icon>
|
|
|
+ <view class="u-add-tips" style="margin-top: 6px;">选择视频</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item title="请上传视频海报" :arrow="false" v-if="type == 'add'">
|
|
|
<view slot="label">
|
|
|
<u-upload :action="uploadUrl" :file-list="defaultList" :form-data="uploadData" @on-success="uploadSuccess"
|
|
|
- @on-error="uploadError" @on-remove="uploadRemove" max-count="5"></u-upload>
|
|
|
+ @on-error="uploadError" @on-remove="uploadRemove" max-count="1"></u-upload>
|
|
|
</view>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item title="绑定商品(可多选)" @click="popupShow = true" class="good-arrow">
|
|
@@ -36,9 +38,9 @@
|
|
|
</view>
|
|
|
<u-popup v-model="popupShow" mode="bottom" closeable border-radius="30">
|
|
|
<scroll-view scroll-y="true" class="good-select-box">
|
|
|
- <view class="select-good-row" v-for="(item, index) in goodList" :key="index">
|
|
|
+ <view class="select-good-row" v-for="(item, index) in goodList" :key="index" @click.native.stop="setCheck(item)">
|
|
|
<view class="good-check">
|
|
|
- <view class="iconfont" :class="item.check ? 'iconqueding' : 'iconfeigouxuan'" @click="item.check = !item.check"></view>
|
|
|
+ <view class="iconfont" :class="item.check ? 'iconqueding' : 'iconfeigouxuan'"></view>
|
|
|
</view>
|
|
|
<view class="good-card" style="width: calc(100% - 60px);">
|
|
|
<cover-image class="goods-img" :src="item.imgPath"></cover-image>
|
|
@@ -85,13 +87,13 @@
|
|
|
onLoad(options) {
|
|
|
this.uploadUrl = API.uploadFile
|
|
|
this.type = options.type
|
|
|
- this.videoInfo.videoId = options.videoId
|
|
|
if (this.type == 'edit') {
|
|
|
+ this.videoInfo.videoId = options.videoId
|
|
|
this.getDetail()
|
|
|
}
|
|
|
NET.request(API.getVideoGoods, {}, 'GET').then(res => {
|
|
|
res.data.forEach(site => {
|
|
|
- site.check = this.productIds && this.productIds.indexOf(site.productId) != -1
|
|
|
+ site.check = this.productIds && this.productIds.indexOf(site.productId) != -1 ? true : false
|
|
|
})
|
|
|
this.goodList = res.data
|
|
|
}).catch(res => {
|
|
@@ -103,6 +105,10 @@
|
|
|
},
|
|
|
onReady() {},
|
|
|
methods: {
|
|
|
+ // 切换选择状态
|
|
|
+ setCheck(item) {
|
|
|
+ item.check = !item.check
|
|
|
+ },
|
|
|
// 上传视频
|
|
|
chooseVideoImage() {
|
|
|
uni.chooseVideo({
|
|
@@ -257,6 +263,13 @@
|
|
|
color: #333333;
|
|
|
}
|
|
|
|
|
|
+ .video-img {
|
|
|
+ width: 100px;
|
|
|
+ height: 100px;
|
|
|
+ border-radius: 5px;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+
|
|
|
.upload-video {
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
@@ -275,6 +288,10 @@
|
|
|
top: 18px;
|
|
|
right: 10px;
|
|
|
}
|
|
|
+
|
|
|
+ /deep/.u-cell_title {
|
|
|
+ width: calc(100% - 10px) !important;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|