移动端
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

3 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. title="投诉建议"
  5. left-arrow
  6. @click-left="$router.back(-1)"
  7. />
  8. <van-cell-group style="width: 96%;margin:2%;border-radius: 6px;overflow: hidden;padding-top: 10px;padding-bottom: 10px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);">
  9. <van-cell>
  10. <template #title>
  11. <van-row style="">
  12. <van-col span="4" :offset="1">
  13. <h3 style="">类型:</h3>
  14. </van-col>
  15. <van-col span="10" >
  16. <van-radio-group v-model="form.type" direction="horizontal">
  17. <van-radio name="1">投诉</van-radio>
  18. <van-radio name="2">建议</van-radio>
  19. </van-radio-group>
  20. </van-col>
  21. </van-row>
  22. </template>
  23. </van-cell>
  24. <van-cell>
  25. <template #title>
  26. <van-row>
  27. <van-col span="24">
  28. <van-field
  29. v-model="form.adviceContent"
  30. rows="7"
  31. autosize
  32. type="textarea"
  33. maxlength="1000"
  34. placeholder="请输入您的反馈意见(字数1000以内)"
  35. show-word-limit
  36. />
  37. </van-col>
  38. </van-row>
  39. </template>
  40. </van-cell>
  41. </van-cell-group>
  42. <van-cell-group style="width: 96%;margin:2%;border-radius: 6px;overflow: hidden;padding-top: 10px;padding-bottom: 10px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);">
  43. <van-cell>
  44. <template #title>
  45. <van-row style="">
  46. <van-col span="23" :offset="1">
  47. <van-field name="uploader" label="">
  48. <template #input>
  49. <van-uploader :after-read="afterRead" :before-delete="deleteFile" v-model="fileList" multiple :max-count="5" />
  50. </template>
  51. </van-field>
  52. </van-col>
  53. </van-row>
  54. </template>
  55. </van-cell>
  56. </van-cell-group>
  57. <van-row style="text-align: center;margin-top: 40px">
  58. <van-button color="#1D6FE9" style="border-radius: 6px;width: 90%;margin: 0 auto" @click="adviceAdd">提交</van-button>
  59. </van-row>
  60. </div>
  61. </template>
  62. <script>
  63. import onlineHomeIndex from "../onlineHomeIndex";
  64. import {adviceAdd} from "../../api/onlineHome/my";
  65. import * as Toast from "vant";
  66. import {uploadFileBase} from "../../api/authenticRight";
  67. import {Dialog} from "vant";
  68. import {base64Attach, deleteUserImg} from "../../api/user";
  69. export default {
  70. components: {
  71. onlineHomeIndex
  72. },
  73. name: "advice",
  74. data() {
  75. return {
  76. form:{
  77. id:'',
  78. type: '1',
  79. adviceContent:'',
  80. url:[],
  81. files:[],
  82. },
  83. file: {
  84. files:[],
  85. fileType:'',
  86. bizPath:'advice',
  87. tableName:'t_sys_advice',
  88. tableId:''
  89. },
  90. fileList:[],
  91. upLoadList:[],
  92. };
  93. },
  94. created() {
  95. this.reset();
  96. },
  97. methods: {
  98. reset(){
  99. this.form={
  100. id:'',
  101. type: '1',
  102. adviceContent:'',
  103. url:[],
  104. files:[],
  105. }
  106. },
  107. afterRead(file) {
  108. // 此时可以自行将文件上传至服务器
  109. for ( let i = 0 ; i < this.fileList.length ; i++){
  110. if(this.fileList[i].url == undefined&&this.fileList!='') {
  111. this.fileList[i] = {url:this.fileList[i].content, id: '', isImage: true};
  112. }
  113. }
  114. },
  115. deleteFile(elIndex){
  116. if(elIndex.id != ''){
  117. deleteUserImg(elIndex.id).then(response => {});
  118. }
  119. return (file, name) => {
  120. let fileIndex = name.index
  121. this.fileList[elIndex].splice(fileIndex, 1)
  122. this.upLoadList[elIndex].splice(fileIndex, 1)
  123. }
  124. },
  125. adviceAdd(){
  126. adviceAdd(this.form).then(res => {
  127. this.file.tableId = res.data;
  128. for(let i = 0 ; i < this.fileList.length ; i++){
  129. this.file.files.push(this.fileList[i].url);
  130. }
  131. base64Attach(this.file).then(response => {
  132. if (response.code == 200){
  133. Dialog.confirm({
  134. title: '系统提示',
  135. message: '发布成功',
  136. confirmButtonText: '确定',
  137. showCancelButton:false
  138. }).then(() => {
  139. self.location=document.referrer;
  140. })
  141. }
  142. });
  143. });
  144. }
  145. },
  146. }
  147. </script>
  148. <style scoped>
  149. </style>