This commit is contained in:
liuye
2023-11-21 13:56:24 +08:00
parent d6d6c44560
commit 57f93aeb0f
3 changed files with 312 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
<template>
<div class="AppPointsApply">
<div class="points_img" @click="toAdd">
<img src="./imgs/points.png" alt="">
</div>
<h3>申请记录</h3>
<div v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" >
<div class="top">
<div class="top_title">{{ item.applyItem }}</div>
<div><span class="top_status" :class="item.status==0? 'status0' : item.status==1? 'status1': 'status2'">{{ $dict.getLabel('integralDeclareStatus',item.status) }}</span></div>
</div>
<div class="bottom">
<div class="bottom_points">积分+{{ item.applyIntegral }}</div>
<div class="bottom_time">{{ item.createTime }}</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
</template>
<script>
export default {
name: 'AppPointsApply',
appName: '积分申请',
data() {
return {
current: 1,
list: [],
}
},
onShow() {
this.$dict.load('integralDeclareStatus').then(() => {
this.getPointsList()
})
},
methods: {
toAdd() {
uni.navigateTo({url: './addPoints'})
},
getPointsList() {
this.$http.post(`/app/appintegralmemberapply/listByGirdMember`, null, {
params: {
current: this.current,
}
}).then(res=> {
if(res?.data) {
this.list = this.current > 1 ? [...this.list, ...res.data.records]: res.data.records
}
})
}
},
onReachBottom() {
this.current ++
this.getPointsList()
}
}
</script>
<style lang="scss" scoped>
.AppPointsApply {
padding: 250px 32px 32px;
box-sizing: border-box;
.points_img {
padding: 16px 32px;
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #F5F5F5;
z-index: 9;
img {
width: 100%;
}
}
h3 {
margin-top: 48px;
}
.card {
margin-top: 24px;
padding: 24px;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.02);
border-radius: 16px;
.top {
display: flex;
justify-content: space-between;
.top_title {
width: 450px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #333333;
font-weight: 500;
}
.top_status {
padding: 6px 16px;
box-sizing: border-box;
border-radius: 8px;
text-align: right;
width: calc(100% - 450px);
}
.status0 {
background: #FFEDE2;
color: #FF883C;
}
.status1 {
background: #E2F6E1;
color: #3BBC37;
}
.status2 {
background: #FAE2E2;
color: #E23C3C;
}
}
.bottom {
display: flex;
justify-content: space-between;
margin-top: 24px;
.bottom_points {
color: #FF6900;
}
.bottom_time {
color: #999999;
}
}
}
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<div class="addPoints">
<div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">事件类型</span></div>
<AiSelect dict="integralApplyEventType" v-model="form.eventType"/>
</div>
<div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">申请事项</span></div>
<div class="input"><u-input v-model="form.applyItem" type="text" placeholder="请输入" /></div>
</div>
<div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">积分数量</span></div>
<div class="input"><u-input v-model="form.applyIntegral" type="number" disabled placeholder="请输入"/></div>
</div>
<div class="items">
<div><span class="red">*</span><span class="color-666">上传图片</span></div>
<AiUploader style="margin-top: 12px;" :def.sync="form.files" :limit="1" action="/admin/file/add2"></AiUploader>
</div>
<div class="btn">
<div class="subBtn" @click="submit">提交</div>
</div>
</div>
</template>
<script>
export default {
name: 'addPoints',
data() {
return {
value: '',
form: {
eventType: '',
applyItem: '',
applyIntegral: '',
voucherImageUrl: '',
files: []
},
flag: false,
}
},
onLoad(opt) {
document.title = '积分申请'
if(opt) {
this.getDetail(opt.id)
}
this.$dict.load('integralApplyEventType')
},
watch: {
'form.eventType'(val) {
if(val==0 || val == 1 || val == 5) {
this.form.applyIntegral = 2
} else if(val == 2 || val == 3 || val == 4) {
this.form.applyIntegral = 5
}
}
},
methods: {
getDetail(id) {
this.$http.post(`/app/appintegralmemberapply/queryDetailById?id=${id}`).then(res=> {
if(res?.data) {
this.form = res.data
this.form.files = [{url:res.data.voucherImageUrl}]
}
})
},
submit() {
if(this.flag) return
if(!this.form.eventType) {
return this.$u.toast('请选择事件类型')
}
if(!this.form.applyItem) {
return this.$u.toast('请输入申请事项')
}
if(!this.form.applyIntegral) {
return this.$u.toast('请输入积分数量')
}
if(!this.form.files.length) {
return this.$u.toast('请上传图片')
}
if(this.form.files.length) {
this.form.voucherImageUrl = this.form.files[0].url
}
this.flag = true
this.$http.post(`/app/appintegralmemberapply/addOrUpdate`,{...this.form}).then(res=> {
if(res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
uni.navigateBack()
}, 400)
}
}).catch(err=> {
this.$u.toast(err.message)
})
}
}
}
</script>
<style lang="scss" scoped>
.addPoints {
padding: 0 16px 120px;
box-sizing: border-box;
font-size: 32px;
.item {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24px;
background: #FFF;
box-shadow: inset 0 0 0 0 #EEEEEE;
border-radius: 32px;
padding: 16px 32px;
box-sizing: border-box;
.item_left {
font-size: 32px;
.red {
color: #E64A4A;
}
.color-666 {
color: #666666;
}
}
.input {
width: calc(100% - 200px);
}
::v-deep .uni-input-input,
.uni-input-placeholder {
text-align: right;
}
}
.items {
margin-top: 24px;
background: #FFF;
box-shadow: inset 0 0 0 0 #EEEEEE;
border-radius: 32px;
padding: 16px 32px;
box-sizing: border-box;
.red {
color: #E64A4A;
}
}
.btn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: #F5F5F5;
padding: 16px 32px;
box-sizing: border-box;
height: 120px;
line-height: 120px;
.subBtn {
text-align: center;
color: #FFF;
background: #3975C6;
border-radius: 44px;
width: 100%;
height: 88px;
line-height: 88px;
font-style: 34px;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB