1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <view class="content">
- <u-form :model="form" ref="form" label-width="140">
- <u-form-item label="沟通内容" prop="content" required>
- <u-input v-model="form.content" type="text" placeholder="请输入沟通内容" />
- </u-form-item>
- </u-form>
- <view class="handle-fix-box">
- <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="submitForm()">提交</u-button>
- </view>
- <u-top-tips ref="uTips"></u-top-tips>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from 'vuex'
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- computed: {
- ...mapGetters([
- 'customStyle',
- ])
- },
- data() {
- return {
- id: '',
- type: '',
- form: {
- content: '',
- },
- rules: {
- content: [{
- required: true,
- message: '请输入沟通内容',
- trigger: 'change'
- }],
- },
- }
- },
- onLoad(options) {
- this.id = options.id
- this.type = options.type
- },
- onReady() {
- this.$refs.form.setRules(this.rules);
- },
- methods: {
- // 提交表单
- submitForm() {
- this.$refs.form.validate(valid => {
- if (valid) {
- NET.request(this.type == 2 ? API.submitRenewCommunicateForm : API.submitSignCommunicateForm, {
- studentId: this.id,
- ...this.form
- }, 'POST').then(res => {
- this.$refs.uTips.show({
- title: '提交成功',
- type: 'success',
- })
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- }).catch(error => {
- this.$refs.uTips.show({
- title: error.message,
- type: 'warning',
- })
- })
- }
- });
- },
- },
- }
- </script>
- <style>
- page {
- width: 100%;
- height: 100%;
- position: relative;
- }
- </style>
- <style lang="scss" scoped>
- @import "@/static/css/themes.scss";
- .content {
- width: 100%;
- float: left;
- padding: 0 15px 60px 15px;
- box-sizing: border-box;
- }
- </style>
|