相册删除
This commit is contained in:
@@ -33,15 +33,15 @@
|
|||||||
<div class="img-item" v-for="(e, indexs) in item.list" :key="indexs">
|
<div class="img-item" v-for="(e, indexs) in item.list" :key="indexs">
|
||||||
<p>{{e.createUserName}} 上传</p>
|
<p>{{e.createUserName}} 上传</p>
|
||||||
<img :src="e.url" alt="" @click.stop="previewImage(item.list, e.url)">
|
<img :src="e.url" alt="" @click.stop="previewImage(item.list, e.url)">
|
||||||
<span class="cir-icon" v-if="editText== '取消' && !i.isCheked" @click="checkImg(e, index, indexs)"></span>
|
<span class="cir-icon" v-if="editText== '取消' && !e.isCheked" @click="checkImg(e, index, indexs)"></span>
|
||||||
<u-icon name="checkmark-circle-fill" color="#26f" size="40" class="del-icon" @click="delSelect(e, index, indexs)" v-if="editText== '取消' && i.isCheked"></u-icon>
|
<u-icon name="checkmark-circle-fill" color="#26f" size="54" class="del-icon" @click="delSelect(e, index, indexs)" v-if="editText== '取消' && e.isCheked"></u-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer-btn" @click="uploadImg" v-if="editText == '编辑' ">上传图片</div>
|
<div class="footer-btn" @click="uploadImg" v-if="editText == '编辑' ">上传图片</div>
|
||||||
<div class="footer-btn" @click="del" v-if="editText == '取消' ">确定</div>
|
<div class="footer-btn" @click="delConfirm" v-if="editText == '取消'">确定</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,18 +72,20 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
del() {
|
delConfirm() {
|
||||||
if(!this.ids) {
|
if(!this.delIds.length) {
|
||||||
return this.$u.toast('请先选中需要删除的照片')
|
return this.$u.toast('请先选中需要删除的照片')
|
||||||
}
|
}
|
||||||
var id = this.ids.jion(',')
|
var id = this.delIds.join(',')
|
||||||
this.$confirm('确定删除这些相片?').then(() => {
|
this.$confirm('确定删除这些相片?').then(() => {
|
||||||
this.$http.post(`/app/appvillagepicturealbum/deleteForWx?id=${id}`).then((res) => {
|
this.$http.post(`/app/appvillagepicturealbum/delete?ids=${id}`).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$u.toast('删除成功!')
|
this.$u.toast('删除成功!')
|
||||||
this.list = []
|
this.list = []
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.getStatistic()
|
||||||
this.editClick('取消')
|
this.editClick('取消')
|
||||||
|
uni.$emit('updateList')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -91,7 +93,7 @@ export default {
|
|||||||
editClick(text) {
|
editClick(text) {
|
||||||
this.editText = text == '编辑' ? '取消' : '编辑'
|
this.editText = text == '编辑' ? '取消' : '编辑'
|
||||||
this.delIds = []
|
this.delIds = []
|
||||||
if(text == '取消') {
|
if(text == '取消' && this.delIds.length) {
|
||||||
this.list = []
|
this.list = []
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
@@ -99,6 +101,7 @@ export default {
|
|||||||
checkImg(row, index, indexs) {
|
checkImg(row, index, indexs) {
|
||||||
this.list[index].list[indexs].isCheked = true
|
this.list[index].list[indexs].isCheked = true
|
||||||
this.delIds.push(row.id)
|
this.delIds.push(row.id)
|
||||||
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
delSelect(row, index, indexs) {
|
delSelect(row, index, indexs) {
|
||||||
this.list[index].list[indexs].isCheked = false
|
this.list[index].list[indexs].isCheked = false
|
||||||
@@ -107,6 +110,7 @@ export default {
|
|||||||
this.delIds.splice(i, 1)
|
this.delIds.splice(i, 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
previewImage(images, img) {
|
previewImage(images, img) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
|
|||||||
Reference in New Issue
Block a user