This commit is contained in:
yanran200730
2022-05-25 14:49:48 +08:00
parent 409a7ffb34
commit 4629399692
3 changed files with 10 additions and 18 deletions

View File

@@ -292,8 +292,8 @@
line-height: 56px; line-height: 56px;
margin-top: 16px; margin-top: 16px;
text-align: center; text-align: center;
background: rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.6);
color: #beb2ab; color: #fff;
border-radius: 28px; border-radius: 28px;
} }

View File

@@ -115,6 +115,7 @@
this.$u.toast('删除成功') this.$u.toast('删除成功')
this.getAlbumList() this.getAlbumList()
this.getList() this.getList()
uni.$emit('update')
} }
}) })
}).catch(() => { }).catch(() => {

View File

@@ -5,7 +5,7 @@
<span>*选择水印后相册只能上传该水印照片</span> <span>*选择水印后相册只能上传该水印照片</span>
</div> </div>
<div class="cell-group"> <div class="cell-group">
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 0, checkedList = []"> <div class="cell-item" hover-class="bg-hover" @click="currIndex = 0, chooseIndex = -1">
<div class="cell-item__left"> <div class="cell-item__left">
<h2>不限</h2> <h2>不限</h2>
</div> </div>
@@ -22,8 +22,8 @@
<h2>水印库</h2> <h2>水印库</h2>
</div> </div>
<div class="watermark-list" v-if="currIndex === 1"> <div class="watermark-list" v-if="currIndex === 1">
<div class="item" @click="checked(item.id)" v-for="(item, index) in list" :key="index" :class="[checkedList.includes(item.id) ? 'active' : '']"> <div class="item" @click="chooseIndex = index" v-for="(item, index) in list" :key="index" :class="[chooseIndex === index ? 'active' : '']">
<image class="checked" v-if="checkedList.includes(item.id)" src="./images/xuanzhong.png" /> <image class="checked" v-if="chooseIndex === index" src="./images/xuanzhong.png" />
<image class="watermark" :src="item.thum" mode="aspectFill" /> <image class="watermark" :src="item.thum" mode="aspectFill" />
</div> </div>
</div> </div>
@@ -42,8 +42,8 @@
return { return {
currIndex: 0, currIndex: 0,
config, config,
checkedList: [],
list: [], list: [],
chooseIndex: -1,
pageShow: false pageShow: false
} }
}, },
@@ -51,7 +51,7 @@
onLoad (query) { onLoad (query) {
if (query.value) { if (query.value) {
this.currIndex = 1 this.currIndex = 1
this.checkedList = query.value.split(',') this.chooseIndex = query.value ? Number(query.value) : -1
} }
this.getList() this.getList()
@@ -60,7 +60,7 @@
methods: { methods: {
getList () { getList () {
this.$loading() this.$loading()
this.$http.post(`/api/appalbumtemplate/list?size=100&status=1`).then(res => { this.$http.post(`/api/appalbumtemplate/list?size=1000&status=1`).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.list = res.data.records this.list = res.data.records
} }
@@ -74,20 +74,11 @@
save () { save () {
uni.$emit('change', { uni.$emit('change', {
type: 'watermark', type: 'watermark',
value: this.checkedList.length ? this.checkedList.join(',') : '' value: this.chooseIndex > -1 ? this.chooseIndex : ''
}) })
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
},
checked (type) {
const i = this.checkedList.indexOf(type)
if (i > -1) {
this.checkedList.splice(i, 1)
} else {
this.checkedList.push(type)
}
} }
} }
} }