feedback.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <div class="feedback">
  3. <ul class="detailUl">
  4. <div class="record" @click.stop="toRecord">
  5. 反馈记录 <img src="https://www.idea-co-sf.com/gardenProduct/image/rightIcon.png" class="recordImg">
  6. </div>
  7. <li class="detailLi2">
  8. <div class="detailLi2Box">
  9. <van-field
  10. :value="form.contant"
  11. autosize
  12. type="textarea"
  13. placeholder="请输入文字进行报事报修描述"
  14. class="myField"
  15. maxlength="800"
  16. show-word-limit
  17. />
  18. </div>
  19. </li>
  20. <li class="detailLi2">
  21. <span class="liName">
  22. 上传照片
  23. <span style="color: #B3B3B3;font-size: 28rpx">(支持图片/视频上传限20M内,最多6张)</span>
  24. </span>
  25. <div class="detailLi2Box" style="margin: 24rpx 0 0 0">
  26. <van-uploader
  27. :max-count="6"
  28. @delete="deleteRYXXZP"
  29. :file-list="fileList"
  30. @after-read="uploadRYXXZP"
  31. :show-upload="true"
  32. />
  33. </div>
  34. </li>
  35. </ul>
  36. <button class="submitBtn">
  37. 提交
  38. </button>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. name: "feedback",
  44. data(){
  45. return{
  46. form:{
  47. contant:''
  48. },
  49. fileList:[]
  50. }
  51. },
  52. methods:{
  53. toRecord(){
  54. uni.navigateTo({
  55. url:'/pages/subPackages/minePages/feedback_record'
  56. })
  57. },
  58. deleteRYXXZP(event) {
  59. this.fileList.splice(event.detail.index, 1);
  60. this.$forceUpdate();
  61. },
  62. uploadRYXXZP(event) {
  63. console.log(event)
  64. let that = this;
  65. const { file } = event.detail;
  66. uni.uploadFile({
  67. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  68. filePath: file.url,
  69. name: "file",
  70. formData: { user: "test" },
  71. success(res) {
  72. // 上传完成需要更新 fileList
  73. let data = JSON.parse(res.data);
  74. that.fileList.push({
  75. imgUrl: "/FileController/download/" + data.data[0],
  76. id: data.data[0],
  77. url:
  78. that.$constant.BASE_URI +
  79. "/FileController/download/" +
  80. data.data[0],
  81. isImage: true,
  82. });
  83. },
  84. fail(res) {},
  85. });
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .feedback{
  92. .record {
  93. display: flex;
  94. align-items: center;
  95. justify-content: flex-end;
  96. color: #0365F9;
  97. font-size: 32rpx;
  98. padding-top: 24rpx;
  99. .recordImg{
  100. width: 36rpx;
  101. height: 36rpx;
  102. padding: 5rpx 0 0 10rpx;
  103. }
  104. }
  105. .detailUl{
  106. margin-top: 20rpx;
  107. background: white;
  108. padding: 0 32rpx;
  109. .liName{
  110. font-size: 32rpx;
  111. color: rgba(51, 51, 51, 1);
  112. white-space: nowrap;
  113. }
  114. .detailLi{
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. padding: 32rpx 0;
  119. border-bottom: 2rpx solid #E6E6E6;
  120. .liInfo{
  121. display: inline-block;
  122. text-align: right;
  123. max-width: 428rpx;
  124. color: rgba(102, 102, 102, 1);
  125. font-size: 32rpx;
  126. line-height: 38rpx;
  127. .radio{
  128. margin-left: 64rpx;
  129. }
  130. }
  131. }
  132. .detailLi2{
  133. display: flex;
  134. flex-direction: column;
  135. padding: 32rpx 0;
  136. border-bottom: 2rpx solid #E6E6E6;
  137. .detailLi2BoxTop{
  138. display: flex;
  139. flex-wrap: wrap;
  140. justify-content: space-between;
  141. margin: 12rpx 0;
  142. .checkItem{
  143. width: 160rpx;
  144. height: 64rpx;
  145. font-size: 28rpx;
  146. color: #666666;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. background: #F5F7FA;
  151. border-radius: 8rpx;
  152. margin: 12rpx 0;
  153. }
  154. .checked{
  155. background: #0365F9;
  156. color: white;
  157. }
  158. }
  159. }
  160. .van-cell {
  161. background: #F5F7FA !important;
  162. border-radius: 8rpx;
  163. font-size: 28rpx;
  164. }
  165. }
  166. .submitBtn{
  167. width: 654rpx;
  168. height: 96rpx;
  169. background: #0365F9;
  170. border-radius: 8rpx;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. margin: 64rpx 48rpx;
  175. color: white;
  176. }
  177. }
  178. </style>