12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view class="content">
- <u-form :model="form" ref="form" label-width="140">
- <u-form-item label="回复" prop="remark" required>
- <u-input v-model="form.remark" 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: {
- signId: 0,
- classId: 0,
- isCoach: true,
- remark: ''
- },
- rules: {
- remark: [{
- required: true,
- message: '请输入回复',
- trigger: 'change'
- }],
- },
- }
- },
- onLoad(options) {
- this.form.signId = options.id
- this.form.classId = options.classId
- },
- onReady() {
- this.$refs.form.setRules(this.rules);
- },
- methods: {
- // 提交表单
- submitForm() {
- this.$refs.form.validate(valid => {
- if (valid) {
- NET.request(API.setSignRemark, {
- ...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>
|