taskfeeback.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 {
  23. taskfeedbacksave
  24. } from "@/api/index.js"
  25. export default {
  26. components: {
  27. cImg,
  28. },
  29. data() {
  30. return {
  31. taskdetail: "", //任务详情
  32. //反馈提交表单
  33. form: {
  34. content: "",
  35. images:''
  36. },
  37. }
  38. },
  39. onLoad() {
  40. this.taskdetail = this.$store.state.user.taskdetail
  41. },
  42. methods: {
  43. changeImg(img){
  44. this.form.images = img;
  45. },
  46. // 提交反馈请求
  47. submit() {
  48. const id = this.taskdetail.id
  49. taskfeedbacksave({
  50. taskId: id,
  51. ...this.form
  52. })
  53. .then(({
  54. code,
  55. message
  56. }) => {
  57. this.$refs.uToast.show({
  58. title: code == 200 ? "提交成功" : message,
  59. type: code == 200 ? 'success' : 'info',
  60. callback() {
  61. if (code == 200) {
  62. uni.navigateBack(1)
  63. }
  64. }
  65. })
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped>
  72. .backconfig {
  73. height: 100vh;
  74. position: relative;
  75. }
  76. .text-span {
  77. width: 690rpx;
  78. height: 400rpx;
  79. background: #F2F2F2;
  80. border-radius: 10rpx;
  81. margin-top: 28rpx;
  82. padding: 21rpx;
  83. }
  84. .task-btn {
  85. width: 690rpx;
  86. height: 90rpx;
  87. background: #4A8BFF;
  88. border-radius: 4rpx;
  89. position: absolute;
  90. bottom: 30rpx;
  91. font-size: 28rpx;
  92. font-family: Microsoft YaHei-3970(82674968);
  93. font-weight: bold;
  94. text-align: center;
  95. line-height: 90rpx;
  96. color: #FFFFFF;
  97. }
  98. </style>