信用积分
This commit is contained in:
@@ -1,25 +1,262 @@
|
||||
<template>
|
||||
<div class="adds">1</div>
|
||||
<div class="add">
|
||||
<div class="u-forms">
|
||||
<u-form class="u-form" :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
|
||||
<u-form-item label="申请人" prop="name" required :border-bottom="false">
|
||||
<u-input v-model="forms.name" placeholder="请输入申请人" maxlength="30" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="申请时间" prop="beginTime" required :border-bottom="false" right-icon="arrow-right">
|
||||
<u-input v-model="forms.beginTime" disabled placeholder="请选择申请时间" @click="showStartTime = true" />
|
||||
|
||||
<!-- <u-picker mode="time" :params="params" v-model="showStartTime" @confirm="confirmPicker"></u-picker> -->
|
||||
<u-calendar mode="date" v-model="showStartTime" @change="changeCalendar"></u-calendar>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="位置" prop="address" required :border-bottom="false">
|
||||
<u-input v-model="forms.address" disabled placeholder="请选择位置" @click="chooseAddress" />
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="积分类型" prop="type" required :border-bottom="false" right-icon="arrow-right">
|
||||
<u-input v-model="forms.type" disabled placeholder="请选择积分类型" @click="showStstus = true" />
|
||||
|
||||
<u-select v-model="showStstus" :list="$dict.getDict('marriageType')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="申请描述" prop="content" :border-bottom="false" label-position="top" class="contents">
|
||||
<u-input v-model="forms.content" placeholder="请输入详细描述信息" type="textarea" :auto-height="true" maxlength="500" />
|
||||
</u-form-item>
|
||||
<div class="wordLength">{{ forms.content.length }}/500</div>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="图片上传 (最多9张)" prop="files" :border-bottom="false" class="avatars" label-position="top">
|
||||
<AiUploader :v-model="forms.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
</u-form>
|
||||
</div>
|
||||
|
||||
<div class="btn" @click="submit">提交</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
name: 'Add',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
forms: {
|
||||
name: '',
|
||||
beginTime: '',
|
||||
address: '',
|
||||
lat: '',
|
||||
lng: '',
|
||||
|
||||
type: '',
|
||||
typeValue: '',
|
||||
|
||||
phone: '',
|
||||
address: '',
|
||||
content: '',
|
||||
|
||||
personType: 1,
|
||||
files: [],
|
||||
},
|
||||
showStstus: false,
|
||||
showModeType: false,
|
||||
flag: false,
|
||||
|
||||
showStartTime: false,
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: false,
|
||||
timestamp: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad() {
|
||||
this.$dict.load('marriageType', 'modeType')
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
onLoad() {},
|
||||
onShow() {},
|
||||
methods: {},
|
||||
|
||||
mounted() {},
|
||||
methods: {
|
||||
submit() {
|
||||
if (this.flag) return
|
||||
|
||||
this.$refs.uForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.forms.name) {
|
||||
return this.$u.toast('请输入申请人')
|
||||
}
|
||||
if (!this.forms.beginTime) {
|
||||
return this.$u.toast('请选择申请时间')
|
||||
}
|
||||
if (!this.forms.address) {
|
||||
return this.$u.toast('请选择位置')
|
||||
}
|
||||
if (!this.forms.type) {
|
||||
return this.$u.toast('请选择积分类型')
|
||||
}
|
||||
if (!this.forms.content) {
|
||||
return this.$u.toast('请输入描述信息')
|
||||
}
|
||||
|
||||
const imgs = []
|
||||
if (this.forms.files) {
|
||||
this.forms.files.map((e) => {
|
||||
imgs.push({ url: e.url, id: e.id })
|
||||
})
|
||||
}
|
||||
|
||||
this.flag = true
|
||||
this.$instance
|
||||
.post(`/app/appmarriagefuneralinfo/addOrUpdate`, {
|
||||
name: this.forms.name,
|
||||
beginTime: this.forms.beginTime,
|
||||
address: this.forms.address,
|
||||
lat: this.forms.lat,
|
||||
lng: this.forms.lng,
|
||||
|
||||
type: this.forms.typeValue,
|
||||
content: this.forms.content,
|
||||
|
||||
files: imgs || [],
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.flag = false
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('updateList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$u.toast('提交失败')
|
||||
})
|
||||
.finally(() => {
|
||||
this.flag = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
selectStatus(e) {
|
||||
this.forms.type = e[0].label
|
||||
this.forms.typeValue = e[0].value
|
||||
},
|
||||
|
||||
changeCalendar(e) {
|
||||
this.forms.beginTime = e.result
|
||||
},
|
||||
|
||||
chooseAddress() {
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
this.forms.address = res.address
|
||||
this.forms.lat = res.latitude
|
||||
this.forms.lng = res.longitude
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.adds {
|
||||
<style lang="scss" scoped>
|
||||
.add {
|
||||
height: 100%;
|
||||
|
||||
.u-forms {
|
||||
padding-bottom: 112px;
|
||||
::v-deep .u-form {
|
||||
background: #fff;
|
||||
.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:last-child {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.contents {
|
||||
padding-bottom: 20px !important;
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
.u-input {
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
.default {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.avatars {
|
||||
::v-deep .ai-uploader {
|
||||
.imgs {
|
||||
.img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
.image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 24px;
|
||||
background: #f3f6f9;
|
||||
}
|
||||
}
|
||||
}
|
||||
.wordLength {
|
||||
color: #999;
|
||||
text-align: right;
|
||||
padding: 10px 40px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #1365dd;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user