This commit is contained in:
liuye
2022-05-25 16:02:14 +08:00
17 changed files with 130 additions and 36 deletions

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;

View File

@@ -22,7 +22,7 @@
export default {
name: 'Report',
appName: '工作汇报',
appName: '拼图汇报',
data () {
return {

View File

@@ -117,6 +117,10 @@
},
toEdit () {
if (!this.list.length) {
return this.$u.toast('相册无照片,请上传照片')
}
this.linkTo(`./EditAlbum?id=${this.id}`)
},
@@ -288,8 +292,8 @@
line-height: 56px;
margin-top: 16px;
text-align: center;
background: rgba(255, 255, 255, 0.1);
color: #beb2ab;
background: rgba(0, 0, 0, 0.6);
color: #fff;
border-radius: 28px;
}

View File

@@ -103,14 +103,14 @@
<switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" />
</div>
</div>
<div class="form-group__item form-group__checked" v-if="form.openWorkPoint === '1' && address.address">
<div class="form-group__item form-item__address form-group__checked" v-if="form.openWorkPoint === '1' && address.address">
<div class="left">
<h2>{{ address.title }}</h2>
<p>{{ address.address }}</p>
<p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p>
</div>
<div class="right" @click="address = {}">
<image :src="`${$cdn}askform/sc1.png`" />
<image src="./images/remove.png" />
<span>删除</span>
</div>
</div>
@@ -378,5 +378,24 @@
}
}
}
.form-item__address {
.left {
flex: 1;
margin-right: 10px;
p {
line-height: 1.3;
}
}
.right {
span {
margin-left: 10px;
color: #1088F9;
font-size: 28px;
}
}
}
}
</style>

View File

@@ -90,14 +90,14 @@
<switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" />
</div>
</div>
<div class="form-group__item form-group__checked" v-if="form.openWorkPoint === '1' && address.address">
<div class="form-group__item form-group__checked form-item__address" v-if="form.openWorkPoint === '1' && address.address">
<div class="left">
<h2>{{ address.title }}</h2>
<p>{{ address.address }}</p>
<p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p>
</div>
<div class="right" @click="address = {}">
<image :src="`${$cdn}askform/sc1.png`" />
<image src="./images/remove.png" />
<span>删除</span>
</div>
</div>
@@ -367,5 +367,24 @@
}
}
}
.form-item__address {
.left {
flex: 1;
margin-right: 10px;
p {
line-height: 1.3;
}
}
.right {
span {
margin-left: 10px;
color: #1088F9;
font-size: 28px;
}
}
}
}
</style>

View File

@@ -109,12 +109,13 @@
return this.$u.toast('请选择相片')
}
this.$confirm('确定删除该数据').then(() => {
this.$confirm('确定删除这些图片').then(() => {
this.$http.post(`/api/appalbumphoto/delete?ids=${this.chooseImg}`).then(res => {
if (res.code == 0) {
this.$u.toast('删除成功')
this.getAlbumList()
this.getList()
uni.$emit('update')
}
})
}).catch(() => {

View File

@@ -4,7 +4,7 @@
<div class="form-item" :class="[config.fieldType === '1' ? 'textarea' : '']">
<span>{{ mapFieldLable(config.type) }}</span>
<div class="form-item__right" v-if="config.fieldType === '0'">
<input :placeholder="'请输入' + mapFieldLable(config.type)" v-model="config.defaultValue">
<input :placeholder="'请输入' + mapFieldLable(config.type)" :maxlength="10" v-model="config.defaultValue">
<span></span>
</div>
<div class="form-item__right" v-if="config.fieldType === 'date'" @click="isShowDate = true">

View File

@@ -76,7 +76,7 @@
},
remove () {
this.$confirm('确定删除该数据').then(() => {
this.$confirm('确定删除该图片').then(() => {
this.$http.post(`/api/appalbumphoto/delete?ids=${this.id}`).then(res => {
if (res.code == 0) {
this.$u.toast('删除成功')

View File

@@ -27,7 +27,7 @@
v-for="(item, index) in watermarkList"
:key="item.id"
@click.stop="currIndex = index">
<image :src="item.thum" mode="aspectFill" />
<image :src="item.thum" />
<div class="water-item__bottom">{{ item.name }}</div>
</div>
</div>
@@ -123,8 +123,11 @@
this.img = query.url
this.height = uni.getSystemInfoSync().windowHeight
this.getWatermarkList()
this.getLocation()
this.$nextTick(() => {
this.getWatermarkList()
})
},
methods: {
@@ -273,7 +276,7 @@
})
this.$http.post('/api/appalbum/list', null, {
parmas: {
params: {
size: 1000
}
}).then(res => {
@@ -407,7 +410,7 @@
}
image {
width: 176px;
width: 236px;
height: 200px;
}

View File

@@ -5,7 +5,7 @@
<span>*选择水印后相册只能上传该水印照片</span>
</div>
<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">
<h2>不限</h2>
</div>
@@ -22,9 +22,9 @@
<h2>水印库</h2>
</div>
<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' : '']">
<image class="checked" v-if="checkedList.includes(item.id)" src="./images/xuanzhong.png" />
<image class="watermark" :src="item.thum" mode="aspectFill" />
<div class="item" @click="chooseIndex = index" v-for="(item, index) in list" :key="index" :class="[chooseIndex === index ? 'active' : '']">
<image class="checked" v-if="chooseIndex === index" src="./images/xuanzhong.png" />
<image class="watermark" :src="item.thum" mode="scaleToFill" />
</div>
</div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div>
@@ -42,8 +42,8 @@
return {
currIndex: 0,
config,
checkedList: [],
list: [],
chooseIndex: -1,
pageShow: false
}
},
@@ -51,7 +51,7 @@
onLoad (query) {
if (query.value) {
this.currIndex = 1
this.checkedList = query.value.split(',')
this.chooseIndex = query.value ? Number(query.value) : -1
}
this.getList()
@@ -60,7 +60,7 @@
methods: {
getList () {
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) {
this.list = res.data.records
}
@@ -74,20 +74,11 @@
save () {
uni.$emit('change', {
type: 'watermark',
value: this.checkedList.length ? this.checkedList.join(',') : ''
value: this.chooseIndex > -1 ? this.chooseIndex : ''
})
uni.navigateBack({
delta: 1
})
},
checked (type) {
const i = this.checkedList.indexOf(type)
if (i > -1) {
this.checkedList.splice(i, 1)
} else {
this.checkedList.push(type)
}
}
}
}
@@ -135,7 +126,7 @@
}
.watermark {
width: 200px;
width: 236px;
height: 200px;
}

View File

@@ -140,8 +140,8 @@
getAlbumList () {
this.$http.post('/api/appalbum/list', null, {
parmas: {
size: 100
params: {
size: 10000
}
}).then(res => {
if (res.code === 0) {

View File

@@ -157,6 +157,11 @@
image {
display: block;
width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
}
}

View File

@@ -150,6 +150,7 @@
<style lang="scss" scoped>
.InspectLog {
min-height: calc(100vh - 240px);
padding: 48px 32px 0;
background: #133CA5;
@@ -159,9 +160,15 @@
.imgs {
margin-top: 20px;
image {
display: block;
width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
}
}

View File

@@ -175,9 +175,15 @@
.imgs {
margin-top: 20px;
image {
display: block;
width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
}
}

View File

@@ -161,9 +161,15 @@
.imgs {
margin-top: 20px;
image {
display: block;
width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
}
}

View File

@@ -61,7 +61,7 @@
watch: {
configList: {
handler: function (v) {
if (v.length) {
if (v && v.length) {
const date = v.filter(v => v.type === '1')[0]
const time = v.filter(v => v.type === '0')[0]
const title = v.filter(v => v.type === '5')[0]
@@ -80,6 +80,7 @@
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || ''
this.address = uni.getStorageSync('address').address || ''
}
if (v.fieldType === '7') {

View File

@@ -120,6 +120,7 @@
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || ''
this.address = uni.getStorageSync('address').address || ''
}
return v