Files
dvcp_v2_wxcp_app/library/project/fd/AppHandSnapshotFd/AddSet.vue

211 lines
4.7 KiB
Vue
Raw Normal View History

2022-01-05 17:56:20 +08:00
<template>
<div class="AddSet">
<div class="contents">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
2022-01-06 09:25:10 +08:00
<u-form-item label="事项分组" prop="title" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.title" placeholder="请输入事项分组" />
2022-01-05 17:56:20 +08:00
</u-form-item>
2022-01-06 09:25:10 +08:00
<u-form-item label="类别" prop="status" required :border-bottom="false"> </u-form-item>
2022-01-05 17:56:20 +08:00
<div class="remove-item">
2022-01-06 09:25:10 +08:00
<img src="./components/img/remove-icon.png" alt="" />
2022-01-05 17:56:20 +08:00
<div class="input">
<u-input v-model="forms.status" placeholder="请输入" />
</div>
</div>
<div class="remove-item">
2022-01-06 09:25:10 +08:00
<img src="./components/img/add-icon.png" alt="" />
2022-01-05 17:56:20 +08:00
<div class="input color-2270F1">添加分类</div>
</div>
</u-form>
</div>
<!-- <div class="btn" @click="submit">保存</div> -->
<div class="footer">
<div class="remove">删除</div>
2022-01-06 09:25:10 +08:00
<div class="confirm" @click="submit">保存</div>
2022-01-05 17:56:20 +08:00
</div>
</div>
</template>
<script>
export default {
name: 'AddSet',
components: {},
props: {},
data() {
return {
forms: {
status: '',
content: '',
fileIds: [],
},
flag: false,
2022-01-06 09:25:10 +08:00
show: false,
2022-01-05 17:56:20 +08:00
}
},
methods: {
submit() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
2022-01-06 09:25:10 +08:00
if (!this.forms.title) {
return this.$u.toast('请输入事项分组')
2022-01-05 17:56:20 +08:00
}
const imgs = []
if (this.forms.fileIds) {
this.forms.fileIds.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
2022-01-06 09:25:10 +08:00
.post(`/app/appclapeventgroup/addOrUpdate`, {
2022-01-05 17:56:20 +08:00
title: this.forms.title,
content: this.forms.content,
// images: JSON.stringify(imgs) || [],
images: imgs || [],
people: this.forms.people,
phone: this.forms.phone,
id: this.id,
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('发布成功')
this.flag = false
uni.navigateTo({ url: `./AppHandSnapshot` })
}
})
} else {
this.$u.toast('失败')
}
})
},
},
}
</script>
<style scoped lang="scss">
.AddSet {
height: 100%;
.contents {
::v-deep .u-form {
.u-form-item {
padding: 0 45px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
padding-bottom: 0;
.u-input {
text-align: right !important;
}
}
}
}
.u-form-item:first-child {
.u-form-item__body {
border-bottom: 1px solid #ddd;
}
}
.line {
height: 24px;
background: #f3f6f9;
}
.contents {
padding-bottom: 20px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
.u-input {
text-align: left !important;
}
}
}
}
.avatars {
padding-bottom: 20px !important;
.u-form-item__body {
.default {
width: 160px;
height: 160px;
}
}
}
}
}
2022-01-06 09:25:10 +08:00
.remove-item {
2022-01-05 17:56:20 +08:00
padding: 42px 0 42px 32px;
box-sizing: border-box;
background-color: #fff;
2022-01-06 09:25:10 +08:00
img {
2022-01-05 17:56:20 +08:00
width: 36px;
height: 36px;
margin-right: 12px;
vertical-align: middle;
}
2022-01-06 09:25:10 +08:00
.input {
2022-01-05 17:56:20 +08:00
display: inline-block;
width: calc(100% - 48px);
height: 36px;
line-height: 36px;
}
2022-01-06 09:25:10 +08:00
.color-2270F1 {
color: #2270f1;
2022-01-05 17:56:20 +08:00
font-size: 30px;
font-family: PingFangSC-Regular, PingFang SC;
line-height: 42px;
}
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
background: #3975c6;
padding: 34px 0;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
2022-01-06 09:25:10 +08:00
.footer {
2022-01-05 17:56:20 +08:00
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
background: #fff;
padding: 32px;
display: flex;
justify-content: space-between;
2022-01-06 09:25:10 +08:00
div {
2022-01-05 17:56:20 +08:00
height: 92px;
line-height: 92px;
box-sizing: border-box;
text-align: center;
border-radius: 8px;
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
2022-01-06 09:25:10 +08:00
.remove {
2022-01-05 17:56:20 +08:00
flex: 1;
border: 1px solid #f46;
color: #f46;
margin-right: 32px;
}
2022-01-06 09:25:10 +08:00
.confirm {
2022-01-05 17:56:20 +08:00
flex: 2;
2022-01-06 09:25:10 +08:00
background: #3975c6;
2022-01-05 17:56:20 +08:00
color: #fff;
}
}
}
</style>