调整企业基础信息数据格式增加商品权证管理发型模块
This commit is contained in:
@@ -33,12 +33,19 @@
|
||||
<view class="module-imgs">
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, index) in module.content.image.showpath"
|
||||
v-for="(item, index) in module.content.image"
|
||||
:key="index"
|
||||
@click="openImg(module.content.image.showpath, index)"
|
||||
@longpress="removeImg('imgs', moduleIndex, index)"
|
||||
>
|
||||
<image class="cover" :src="item" mode="aspectFill"></image>
|
||||
<image
|
||||
class="cover"
|
||||
:src="item.showpath"
|
||||
mode="aspectFill"
|
||||
@click="openImg(module.content.image, index, 'imgs')"
|
||||
@longpress="removeImg('imgs', moduleIndex, index)"
|
||||
/>
|
||||
<view class="item-input">
|
||||
<input type="text" v-model="item.title" placeholder="输入标题" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="updImgs(moduleIndex)">
|
||||
<view class="item-upd cover">
|
||||
@@ -56,18 +63,21 @@
|
||||
</view>
|
||||
<view class="module-videos">
|
||||
<view class="item">
|
||||
<image
|
||||
class="cover"
|
||||
v-if="module.content.video_image.showpath != ''"
|
||||
:src="module.content.video_image.showpath"
|
||||
mode="aspectFill"
|
||||
@click="openImg([module.content.video_image.showpath], 0)"
|
||||
@longpress="removeImg('videoCover', moduleIndex, '')"
|
||||
/>
|
||||
<view class="item-upd" @click="updImg('videoCover', moduleIndex)" v-else>
|
||||
<uni-icons type="plus" size="20" color="#999"/>
|
||||
<view>上传视频封面</view>
|
||||
</view>
|
||||
<block v-if="module.content.video_image.showpath != ''">
|
||||
<image
|
||||
class="cover"
|
||||
:src="module.content.video_image.showpath"
|
||||
mode="aspectFill"
|
||||
@click="openImg([module.content.video_image.showpath], 0, 'videos')"
|
||||
@longpress="removeImg('videoCover', moduleIndex, '')"
|
||||
/>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="item-upd" @click="updImg('videoCover', moduleIndex)">
|
||||
<uni-icons type="plus" size="20" color="#999"/>
|
||||
<view>上传视频封面</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="item">
|
||||
<video
|
||||
@@ -106,6 +116,8 @@
|
||||
},
|
||||
created() {
|
||||
Promise.all([basicsInfo('GET', {}), basicsConfig()]).then(res => {
|
||||
console.log(res)
|
||||
|
||||
let info = res[0]
|
||||
this.logo = info.base.cover
|
||||
this.description = info.base.description
|
||||
@@ -114,18 +126,19 @@
|
||||
this.modulesType = res[1]
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
// 图片预览
|
||||
openImg(paths, index){
|
||||
|
||||
console.log(paths)
|
||||
console.log(index)
|
||||
|
||||
openImg(paths, index, type){
|
||||
if(type === 'imgs'){
|
||||
paths = paths.map(val => {
|
||||
return val.showpath
|
||||
})
|
||||
}
|
||||
uni.previewImage({
|
||||
urls : paths,
|
||||
current : index,
|
||||
@@ -140,8 +153,7 @@
|
||||
modulesObj.content.video_image.path = ''
|
||||
}
|
||||
if(type === 'imgs'){
|
||||
modulesObj.content.image.showpath.splice(index, 1)
|
||||
modulesObj.content.image.path.splice(index, 1)
|
||||
modulesObj.content.image.splice(index, 1)
|
||||
}
|
||||
if(type === 'video'){
|
||||
modulesObj.content.video_url.showpath = ''
|
||||
@@ -224,11 +236,16 @@
|
||||
}
|
||||
})
|
||||
uploads(path).then(pathRes => {
|
||||
let modulesObj = this.modules[index]
|
||||
|
||||
modulesObj.content.image.showpath = [...modulesObj.content.image.showpath, ...pathRes.url]
|
||||
modulesObj.content.image.path = [...modulesObj.content.image.path, ...pathRes.path]
|
||||
|
||||
let modulesObj = this.modules[index],
|
||||
paths = []
|
||||
for(let i in pathRes.path){
|
||||
paths.push({
|
||||
showpath: pathRes.url[i],
|
||||
path : pathRes.path[i],
|
||||
title : ''
|
||||
})
|
||||
}
|
||||
modulesObj.content.image = [...modulesObj.content.image, ...paths]
|
||||
this.$set(this.modules, index, modulesObj)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
@@ -257,10 +274,11 @@
|
||||
break
|
||||
case 2:
|
||||
content = {
|
||||
image: {
|
||||
showpath: [],
|
||||
path : []
|
||||
}
|
||||
image: [{
|
||||
showpath: '',
|
||||
path : '',
|
||||
title : ''
|
||||
}]
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
@@ -442,6 +460,21 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.item-input{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba($color: #000000, $alpha: .7);
|
||||
input{
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
z-index: 4;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
.item-upd{
|
||||
@extend .vertical;
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user