You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
1.3 KiB

<template>
<uni-forms ref="form" :modelValue="formData" :rules="rules" style="margin: 12px">
<uni-forms-item label="意见反馈" name="content" label-position="top" required>
<uni-easyinput type="textarea" :input-border="false" placeholder="请输入具体意见反馈" v-model="formData.content" />
</uni-forms-item>
</uni-forms>
<view class="footer col-24 flex gap-8">
<button class="col-12" @tap="back">取消</button>
<button type="primary" @tap="submit" class="col-12">确定</button>
</view>
</template>
<script>
import {
addFeedback
} from '@/api/feedback.js'
let _this;
export default {
data() {
return {
formData: {
},
rules: {
thingDesc: {
rules: [{
required: true,
errorMessage: '请输入具体意见反馈',
}]
}
},
}
},
onLoad() {
_this = this;
},
methods: {
submit() {
this.$refs.form.validate().then(res => {
addFeedback(this.formData).then(data => {
_this.formData = {}
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 3000
})
uni.navigateBack({
});
})
}).catch(err => {
console.log('表单错误信息:', err, this.formData);
})
},
back() {
uni.navigateBack({
});
}
}
}
</script>
<style>
</style>