taskfeeback.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="u-p-30 backconfig">
  3. <view class="u-f-28 u-p-b-28" style="font-weight: 400; color: #333333">任务标题:{{ taskdetail.title }}</view>
  4. <view class="text-span">
  5. <textarea style="width: 100%; height: 180rpx" v-model="form.content" placeholder="请输入你反馈的内容"></textarea>
  6. <view class="m-w u-flex">
  7. <!-- <block>
  8. <view class="u-m-l-6" v-for="(item,index) in uploadlist4" :key="index">
  9. <u-image @click="previewImage(index,uploadlist4)" width="76" height="76" :src="item"></u-image>
  10. </view>
  11. </block>
  12. <view @click="unloadimg(3)" class="upload-image ">+</view> -->
  13. <c-img class="u-border" @changeImg="changeImg($event)"></c-img>
  14. </view>
  15. <view @click="submit" class="task-btn">提交</view>
  16. <u-toast ref="uToast" />
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import cImg from '@/components/c-img/index.vue'
  22. import { taskfeedbacksave } from '@/api/index.js'
  23. export default {
  24. components: {
  25. cImg
  26. },
  27. data() {
  28. return {
  29. taskdetail: '', //任务详情
  30. //反馈提交表单
  31. form: {
  32. content: '',
  33. images: ''
  34. }
  35. }
  36. },
  37. onLoad() {
  38. this.taskdetail = this.$store.state.user.taskdetail
  39. },
  40. methods: {
  41. changeImg(img) {
  42. this.form.images = img
  43. },
  44. // 提交反馈请求
  45. submit() {
  46. const id = this.taskdetail.id
  47. taskfeedbacksave({
  48. taskId: id,
  49. ...this.form
  50. }).then(({ code, message }) => {
  51. this.$refs.uToast.show({
  52. title: code == 200 ? '提交成功' : message,
  53. type: code == 200 ? 'success' : 'info',
  54. callback() {
  55. if (code == 200) {
  56. uni.navigateBack(1)
  57. }
  58. }
  59. })
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped>
  66. .backconfig {
  67. height: 100vh;
  68. position: relative;
  69. }
  70. .text-span {
  71. width: 690rpx;
  72. height: 400rpx;
  73. background: #f2f2f2;
  74. border-radius: 10rpx;
  75. margin-top: 28rpx;
  76. padding: 21rpx;
  77. }
  78. .task-btn {
  79. width: 690rpx;
  80. height: 90rpx;
  81. background: #4a8bff;
  82. border-radius: 4rpx;
  83. position: absolute;
  84. bottom: 30rpx;
  85. font-size: 28rpx;
  86. font-family: Microsoft YaHei-3970(82674968);
  87. font-weight: bold;
  88. text-align: center;
  89. line-height: 90rpx;
  90. color: #ffffff;
  91. }
  92. </style>