积分申请事件类型

This commit is contained in:
liuye
2023-06-06 14:23:40 +08:00
parent c3e0f4878a
commit 50372f014d
5 changed files with 189 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -2,7 +2,12 @@
<div class="integralAdd">
<div class="item">
<div class="left">事件类型</div>
<AiSelect class="right" :list="dictList" v-model="form.applyItemId"></AiSelect>
<!-- <AiSelect class="right" :list="dictList" v-model="form.applyItemId"></AiSelect> -->
<div class="right" @click="toSelectType">
<span v-if="form.applyItemId">{{ form.applyItemName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</div>
<div class="items">
<p>详情描述</p>
@@ -73,6 +78,11 @@ export default {
this.getAuth()
this.form.girdId = this.user.girdId
this.form.girdName = this.user.girdName
uni.$on('applyTypeSelect', (res) => {
this.form.applyItemId = res[0].id
this.form.applyItemName = res[0].ruleName
this.form.applyIntegral = res[0].integral
})
},
watch: {
'form.applyItemId'(v) {
@@ -152,6 +162,9 @@ export default {
this.getType()
})
},
toSelectType() {
uni.navigateTo({url: `./selectType?applyItemId=${this.form.applyItemId}`})
}
}
}
</script>
@@ -174,6 +187,22 @@ export default {
.right {
width: calc(100% - 200px);
text-align: right;
font-size: 32px;
span {
display: inline-block;
max-width: 400px;
margin-right: 8px;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
i {
display: inline-block;
margin-right: 8px;
color: #999999;
}
}
::v-deep .AiSelect {
float: right;

View File

@@ -0,0 +1,155 @@
<template>
<div class="selectType">
<div class="user-list">
<template v-if="list.length>0">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="select-img" @click="checkClick(index)">
<img :src="item.isCheck ? checkIcon : cirIcon" alt="">
</div>
<div class="user-info">
{{ item.ruleName }}
</div>
</div>
</template>
<AiEmpty v-else/>
</div>
<div class="pad-b118"></div>
<div class="footer">
<div class="btn" @click="confirm">确定选择</div>
</div>
</div>
</template>
<script>
export default {
appName:"事件类型选择",
name: "selectType",
data() {
return {
list: [],
cirIcon: require('./img/xz.png'),
checkIcon: require('./img/xzh.png'),
applyItemId: ''
}
},
onLoad(option) {
this.applyItemId = option.applyItemId
this.getList()
},
methods: {
getList() {
this.$instance.post(`/app/appintegralrule/listByFdAndGirdInfo`).then(res => {
if (res.code == 0) {
res.data.map((item) => {
if(item.id == this.applyItemId) {
item.isCheck = true
}else {
item.isCheck = false
}
})
this.list = res.data
}
})
},
checkClick(index) {
this.list.map((item) => {
item.isCheck = false
})
this.list[index].isCheck = true
},
confirm() {
let checkList = []
this.list.map((item) => {
if (item.isCheck) {
checkList.push(item)
}
})
if (!checkList.length) {
return this.$u.toast('请先选择事件类型')
} else {
uni.navigateBack({
success: () => {
uni.$emit("applyTypeSelect", checkList)
}
})
}
}
},
}
</script>
<style lang="scss" scoped>
.selectType {
::v-deep .AiTopFixed .u-search {
margin-bottom: 0 !important;
}
.pad-b118 {
padding-bottom: 118px;
}
.user-list {
background-color: #fff;
.item {
.select-img {
display: inline-block;
img {
width: 48px;
height: 48px;
margin: 12px 36px 12px 30px;
vertical-align: middle;
}
}
.user-info {
display: inline-block;
padding: 20px 0 20px 0;
width: calc(100% - 114px);
height: 100%;
border-bottom: 1px solid #E4E5E6;
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 74px;
img {
width: 74px;
height: 74px;
border-radius: 8px;
margin-right: 34px;
vertical-align: bottom;
}
}
}
}
.footer {
width: 100%;
height: 118px;
background: #F4F8FB;
position: fixed;
left: 0;
bottom: 0;
text-align: right;
.btn {
display: inline-block;
width: 192px;
height: 80px;
line-height: 80px;
background: #1365DD;
border-radius: 4px;
text-align: center;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FFF;
margin: 20px 34px 0 0;
}
}
}
</style>

View File

@@ -7,11 +7,11 @@
<i>*</i>
<h2>事件类型</h2>
</div>
<div class="form-item__right" @click="toSelectType">
<!-- <AiSelect :list="dictList" v-model="form.groupId" placeholder="请选择"></AiSelect> -->
<span v-if="form.groupId">{{ form.groupName }}</span>
<div class="form-item__right">
<AiSelect :list="dictList" v-model="form.groupId" placeholder="请选择"></AiSelect>
<!-- <span v-if="form.groupId">{{ form.groupName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
<u-icon name="arrow-right" color="#ddd"/> -->
</div>
</div>
</div>