From a743dbd6dfbfbc2c3e8cbd392d7c87e8ed32d91d Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 24 Dec 2021 21:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E4=BC=9A=E4=B8=80=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/AppCountryAlbum/detail.vue | 78 ++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/src/apps/AppCountryAlbum/detail.vue b/src/apps/AppCountryAlbum/detail.vue index 664289c4..77244098 100644 --- a/src/apps/AppCountryAlbum/detail.vue +++ b/src/apps/AppCountryAlbum/detail.vue @@ -27,17 +27,21 @@
{{item.name}} + {{editText}}

{{e.createUserName}} 上传

+ +
- + + @@ -52,6 +56,8 @@ export default { fileList: [], numInfo: {}, params: {}, + editText: '编辑', + delIds: [] } }, computed: { ...mapState(['user']) }, @@ -66,6 +72,42 @@ export default { }, methods: { + del() { + if(!this.ids) { + return this.$u.toast('请先选中需要删除的照片') + } + var id = this.ids.jion(',') + this.$confirm('确定删除这些相片?').then(() => { + this.$http.post(`/app/appvillagepicturealbum/deleteForWx?id=${id}`).then((res) => { + if (res.code == 0) { + this.$u.toast('删除成功!') + this.list = [] + this.getList() + this.editClick('取消') + } + }) + }) + }, + editClick(text) { + this.editText = text == '编辑' ? '取消' : '编辑' + this.delIds = [] + if(text == '取消') { + this.list = [] + this.getList() + } + }, + checkImg(row, index, indexs) { + this.list[index].list[indexs].isCheked = true + this.delIds.push(row.id) + }, + delSelect(row, index, indexs) { + this.list[index].list[indexs].isCheked = false + this.delIds.map((item, i) => { + if(item == row.id) { + this.delIds.splice(i, 1) + } + }) + }, previewImage(images, img) { uni.previewImage({ urls: images.map(v => v.url), @@ -80,12 +122,17 @@ export default { } }).then(res => { if (res.code == 0) { - this.list = Object.keys(res.data).map(v => { + this.list = Object.keys(res.data).map(v => { return { name: v, list: res.data[v] } }) + this.list.map((item) => { + item.list.map((e) => { + e.isCheked = false + }) + }) } }) }, @@ -228,10 +275,23 @@ export default { font-family: PingFangSC-Semibold, PingFang SC; font-weight: 600; color: #333; + position: relative; span{ display: inline-block; margin-right: 16px; } + .edit-btn{ + display: inline-block; + color: #26f; + font-weight: 400; + width: 200px; + text-align: right; + line-height: 88px; + position: absolute; + font-size: 32px; + right: 18px; + top: 20px; + } } .img-list{ overflow: hidden; @@ -256,6 +316,20 @@ export default { color: #FFF; line-height: 36px; } + .del-icon{ + position: absolute; + right: 0; + top: 0; + } + .cir-icon{ + width: 40px; + height: 40px; + border-radius: 50%; + border: 4px solid #ccc; + position: absolute; + right: 0; + top: 0; + } } } .footer-btn{