This commit is contained in:
shijingjing
2023-04-03 15:33:27 +08:00
parent ba95e159f3
commit 878999c441
3 changed files with 174 additions and 36 deletions

View File

@@ -12,14 +12,14 @@
<div class="items"> <div class="items">
<p>上传图片</p> <p>上传图片</p>
<div class="upload"> <div class="upload">
<AiUploader v-model="form.files" placeholder="上传图片" type="image" :limit="9" multiple></AiUploader> <AiUploader v-model="form.images" placeholder="上传图片" type="image" :limit="9" multiple></AiUploader>
</div> </div>
<div class="tips left">可上传图片最多上传9张</div> <div class="tips left">可上传图片最多上传9张</div>
</div> </div>
<div class="items"> <div class="items">
<p>上传视频</p> <p>上传视频</p>
<div class="upload"> <div class="upload">
<AiUploader v-model="form.files" placeholder="上传视频" type="video" :limit="9" multiple :size="30 * 1024 * 1024"></AiUploader> <AiUploader v-model="form.videos" placeholder="上传视频" type="video" :limit="9" multiple :size="30 * 1024 * 1024"></AiUploader>
</div> </div>
<div class="tips left">可上传视频最大30M</div> <div class="tips left">可上传视频最大30M</div>
</div> </div>
@@ -44,16 +44,19 @@ export default {
data() { data() {
return { return {
form: { form: {
applyItemId: 0, applyItemId: '',
applyIntegral: '', applyIntegral: '',
applyItemName: '', applyItemName: '',
content: '', content: '',
files: [], files: [],
images: [],
videos: [],
girdId: '', girdId: '',
girdName: '', girdName: '',
}, },
list: [], list: [],
dictList: [], dictList: [],
flag: false,
} }
}, },
onLoad(o) { onLoad(o) {
@@ -70,11 +73,32 @@ export default {
}, },
methods: { methods: {
submit() { submit() {
if(this.flag) return
if (!this.form.applyItemId) {
return this.$u.toast('请选择事件类型')
}
if ((this.form.images.length + this.form.videos.length) > 9) {
return this.$u.toast('图片和视频不得超过9个')
} else {
this.form.files = [...this.form.images,...this.form.videos]
}
if (!this.form.girdId) {
return this.$u.toast('请选择所属网格')
}
this.flag = true
this.$instance.post(`/app/appintegraluserapply/addOrUpdate`,{ this.$instance.post(`/app/appintegraluserapply/addOrUpdate`,{
...this.form ...this.form
}).then(res=> { }).then(res=> {
this.flag = false
if(res?.data) { if(res?.data) {
console.log(res); this.$u.toast('提交成功')
setTimeout(()=> {
uni.navigateBack()
},500)
} }
}) })
}, },
@@ -102,7 +126,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.integralAdd { .integralAdd {
padding-bottom: 140px; padding: 24px 0 120px 0;
box-sizing: border-box; box-sizing: border-box;
.item { .item {
width: 100%; width: 100%;
@@ -111,7 +135,7 @@ export default {
background: #FFF; background: #FFF;
padding: 24px 32px; padding: 24px 32px;
box-sizing: border-box; box-sizing: border-box;
margin-top: 24px; margin-bottom: 24px;
.left { .left {
width: 250px;; width: 250px;;
} }
@@ -126,7 +150,7 @@ export default {
.items { .items {
width: 100%; width: 100%;
background: #FFF; background: #FFF;
margin-top: 24px; margin-bottom: 24px;
p { p {
padding: 24px 32px; padding: 24px 32px;
box-sizing: border-box; box-sizing: border-box;
@@ -151,22 +175,6 @@ export default {
.upload { .upload {
padding: 24px 32px; padding: 24px 32px;
box-sizing: border-box; box-sizing: border-box;
// .fodder_alls {
// display: flex;
// margin-top: 16px;
// align-items: center;
// .fodder_add {
// border: 2px solid #DBDCDF;
// padding: 20px 24px;
// box-sizing: border-box;
// border-radius: 8px;
// }
// .fodder_title {
// color: #8E8F91;
// margin-left: 20px;
// }
// }
} }
} }

View File

@@ -4,11 +4,11 @@
<div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./integralDetail?id=${item.id}`)"> <div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./integralDetail?id=${item.id}`)">
<div class="left"> <div class="left">
<div class="title">{{ item.applyItemName }}</div> <div class="title">{{ item.applyItemName }}</div>
<div class="time">{{ item.createTime }}</div> <div class="time">{{ item.createTime.slice(0,16) }}</div>
</div> </div>
<div class="right"> <div class="right">
<div class="integral">+{{ item.applyIntegral }}</div> <div class="integral">+{{ item.applyIntegral }}</div>
<div class="status">待审核</div> <div class="status" :class="item.status==0? 'status0':item.status==1? 'status1':'status2'">{{ $dict.getLabel('appIntegralApplyEventStatus',item.status) }}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -41,13 +41,15 @@ export default {
} }
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.list = res.data.records this.list = this.current==1 ? res.data.records: [...this.list, ...res.data.records]
} }
}) })
} }
}, },
onShow() { onShow() {
this.getList() this.$dict.load('appIntegralApplyEventStatus').then(()=> {
this.getList()
})
}, },
onReachBottom() { onReachBottom() {
this.current++ this.current++
@@ -58,11 +60,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.integralApply { .integralApply {
padding-bottom: 120px; padding: 24px 0 130px 0;
box-sizing: border-box; box-sizing: border-box;
.card-list { .card-list {
margin-top: 24px;
background: #FFF; background: #FFF;
.card { .card {
padding: 32px 40px; padding: 32px 40px;
@@ -99,10 +100,10 @@ export default {
.status0 { .status0 {
color: #FF9A40; color: #FF9A40;
} }
.status0 { .status1 {
color: #5AAD6A; color: #5AAD6A;
} }
.status0 { .status2 {
color: #CD413A; color: #CD413A;
} }
} }

View File

@@ -1,5 +1,28 @@
<template> <template>
<div class="integralDetail"></div> <div class="integralDetail">
<div class="detail">
<div class="title">
<h1>{{ info.applyItemName }}</h1>
<p :class="info.status==0?'status0':info.status==1?'status1':'status2'">{{ $dict.getLabel('appIntegralApplyEventStatus', info.status) }}</p>
</div>
<div class="content">{{ info.content }}</div>
<div class="imgs" v-if="images.length">
<image v-for="(img, i) in images" @click="preview(img.url,images)" :key="i" class="banner" :src="img.url"/>
</div>
<div class="imgs" v-if="videos.length">
<video v-for="(video, ins) in videos" :key="ins" class="file-img" :src="file.url"/>
</div>
<div class="refuse">
<p><span></span>未通过理由</p>
<div class="desc">{{ info.auditDesc }}</div>
</div>
</div>
<div class="btn-wrapper" v-if="info.status==2">
<div class="btn" hover-class="text-hover" @click="$linkTo(`./integralAdd?id=${info.id}`)">修改</div>
</div>
</div>
</template> </template>
<script> <script>
@@ -8,20 +31,126 @@ export default {
appName: "积分申请详情", appName: "积分申请详情",
data() { data() {
return { return {
id: '',
info: {},
images: [],
videos: [],
} }
}, },
methods: { methods: {
getDetail() {
this.$instance.post(`/app/appintegraluserapply/queryDetailById?id=${this.id}`).then(res=> {
if(res?.data) {
this.info = res.data
this.images = res.data.files.filter(e=> (['jpeg','jpg','png'].includes(e.name.split('.')[1])))
this.videos = res.data.files.filter(e => (['mp4'].includes(e.name.split('.')[1])))
}
})
},
preview(url, imgs) {
uni.previewImage({
urls: imgs.map((v) => v.url),
current: url,
})
},
}, },
onLoad(o) { onLoad(o) {
this.id = o.id
this.getDetail()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.integralDetail { .integralDetail {
padding: 24px 0 120px 0;
.detail {
.title {
padding: 32px 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
background: #FFF;
h1 {
font-size: 34px;
font-weight: 600;
}
p {
font-size: 28px;
font-weight: 400;
}
.status0 {
color: #FF9A40;
}
.status1 {
color: #5AAD6A;
}
.status2 {
color: #CD413A;
}
}
.content {
font-size: 28px;
font-weight: 400;
background: #FFF;
padding: 0 32px;
box-sizing: border-box;
}
.imgs {
display: flex;
flex-wrap: wrap;
padding: 20px 32px;
box-sizing: border-box;
background: #FFF;
image,
video {
width: 226px;
height: 226px;
margin: 0 4px 4px 0;
border-radius: 16px;
}
image:nth-child(3n + 0),
video:nth-child(3n + 0) {
margin: 0;
}
}
.refuse {
background: #FFF;
padding: 32px 32px;
box-sizing: border-box;
margin-top: 24px;
p {
margin-bottom: 32px;
font-size: 30px;
font-weight: 400;
color: #333333;
span {
display: inline-block;
width: 12px;
height: 12px;
background: #CD413A;
border-radius: 50%;
margin-right: 8px;
}
}
.desc {
font-size: 28px;
font-weight: 400;
color: #666666;
}
}
}
::v-deep .btn-wrapper {
background: #FFF;
}
::v-deep .btn-wrapper .btn {
height: 80px;
line-height: 80px;
border-radius: 40px;
}
} }
</style> </style>