|
|
@@ -16,7 +16,7 @@
|
|
|
</view>
|
|
|
<view class="grid col-4 grid-square flex-sub booder-top">
|
|
|
<view class="bg-img" v-for="(item, index) in form.photo" :key="index" @tap="ViewImage"
|
|
|
- :data-url="form.headPhoto[index]">
|
|
|
+ :data-url="item">
|
|
|
<image :src="item" mode="aspectFill"></image>
|
|
|
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
|
|
|
<text class='cuIcon-close'></text>
|
|
|
@@ -76,7 +76,7 @@
|
|
|
let obj = JSON.parse(decodeURIComponent(data.params));
|
|
|
console.log('111111',obj)
|
|
|
// this.video = obj.video ? obj.video : ''
|
|
|
- obj.photo = obj.photo ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
+ obj.photo = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
|
|
|
this.form = obj
|
|
|
|
|
|
}
|
|
|
@@ -95,6 +95,9 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ syncHeadPhoto() {
|
|
|
+ this.form.headPhoto = (this.form.photo || []).join(',')
|
|
|
+ },
|
|
|
back() {
|
|
|
uni.navigateBack()
|
|
|
},
|
|
|
@@ -116,10 +119,8 @@
|
|
|
confirmText: '确定',
|
|
|
success: res => {
|
|
|
if (res.confirm) {
|
|
|
- console.log('删除前的图片', this.form.headPhoto)
|
|
|
- // this.photoList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.form.photo.splice(e.currentTarget.dataset.index, 1)
|
|
|
- console.log('删除后的图片', this.form.photo)
|
|
|
+ this.syncHeadPhoto()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -142,19 +143,11 @@
|
|
|
success: (files) => {
|
|
|
let data = JSON.parse(files.data);
|
|
|
if (data.success) {
|
|
|
- let temp = this.form.headPhoto.split(',')
|
|
|
- if (this.form.headPhoto.split(',').length > 0) {
|
|
|
- // this.photoList = this.photoList.concat(res.tempFilePaths)
|
|
|
- this.form.photo.push(configService.apiUrl + '/' + data.message)
|
|
|
- this.form.headPhoto+(configService.apiUrl + '/' + data.message)
|
|
|
- temp.push(configService.apiUrl + '/' + data.message)
|
|
|
- this.form.headPhoto = temp.join(',')
|
|
|
- console.log('上传后的图片', this.form.headPhoto)
|
|
|
- } else {
|
|
|
- console.log('22222')
|
|
|
- // this.photoList =res.tempFilePaths
|
|
|
- this.form.headPhoto = [configService.apiUrl + '/' + data.message]
|
|
|
+ if (!this.form.photo) {
|
|
|
+ this.form.photo = []
|
|
|
}
|
|
|
+ this.form.photo.push(configService.apiUrl + '/' + data.message)
|
|
|
+ this.syncHeadPhoto()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -165,14 +158,14 @@
|
|
|
},
|
|
|
ViewImage(e) {
|
|
|
uni.previewImage({
|
|
|
- urls: this.form.headPhoto,
|
|
|
+ urls: this.form.photo,
|
|
|
current: e.currentTarget.dataset.url
|
|
|
});
|
|
|
},
|
|
|
sumbit() {
|
|
|
let data = {
|
|
|
merchantId: uni.getStorageSync(USER_INFO).merchantId,
|
|
|
- headPhoto: this.form.headPhoto,
|
|
|
+ headPhoto: (this.form.photo || []).join(','),
|
|
|
id:this.form.headPhotoId
|
|
|
}
|
|
|
if (this.form.headPhotoStatus == null) {
|