This commit is contained in:
yanran200730
2022-05-25 15:51:03 +08:00
parent ccc2333fc1
commit cbe6b8b162

View File

@@ -41,10 +41,13 @@
</div>
</div>
</div>
<button v-if="user.openId === info.createUserId" @click="remove" class="form-btn form-btn__remove" hover-class="text-hover">删除相册</button>
<button :loading="isLoading" @click="save" class="form-btn" hover-class="text-hover">保存</button>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'AddAlbum',
@@ -58,10 +61,15 @@
watermarkId: '',
isLoading: false,
id: '',
info: {},
albumUserList: []
}
},
computed: {
...mapState(['user']),
},
onLoad (query) {
this.id = query.id || ''
@@ -70,7 +78,6 @@
}
uni.$on('change', e => {
console.log(e)
if (e.type === 'watermark') {
this.watermarkId = e.value
}
@@ -92,6 +99,24 @@
})
},
remove () {
this.$confirm('确定删除该相册?').then(() => {
this.$http.post(`/api/appalbum/delete?ids=${this.id}`).then(res => {
if (res.code == 0) {
this.$u.toast('删除成功')
uni.$emit('update')
setTimeout(() => {
uni.reLaunch({
url: './AppCountryAlbum'
})
}, 500)
}
})
}).catch(() => {
})
},
getInfo (id) {
this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
@@ -168,6 +193,12 @@
&:active {
opacity: 0.8;
}
&.form-btn__remove {
bottom: 140rpx;
background: #FF4466;
color: #fff;
}
}
.form-group {
margin-bottom: 16px;