opinion.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!-- 意见反馈 -->
  2. <template>
  3. <view v-if="allow" class="main_width">
  4. <textarea :value="content" @input="ipt_change" placeholder="请输入意见反馈" class="main_text_area"></textarea>
  5. <view @click="confirm" class="main_btn">确定</view>
  6. </view>
  7. <view style="text-align: center;margin-top: 60upx;" v-else>感谢您的反馈,请耐心等待!</view>
  8. </template>
  9. <script>
  10. import commonData from '../../../commonData.js'
  11. import commonFun from '../../../commonFun.js'
  12. export default {
  13. data() {
  14. return {
  15. content: '',
  16. allow: false,
  17. }
  18. },
  19. methods: {
  20. // 获取最新反馈(如果反馈了未回复则不允许继续反馈)
  21. get_data() {
  22. uni.showLoading({
  23. title: '加载中...',
  24. mask: true
  25. })
  26. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=entityDataHandle', {
  27. bizCatalog: 'InteractionEntity',
  28. handleMode: 'fetchLastSuggestion',
  29. },
  30. res => {
  31. if (res.status) {
  32. uni.hideLoading()
  33. console.log('获取最新反馈结果')
  34. console.log(res)
  35. if (!res.data.Result) {
  36. this.allow = true
  37. return
  38. }
  39. if (res.data.Result.status == 3) {
  40. this.allow = true
  41. return
  42. }
  43. }
  44. })
  45. },
  46. ipt_change(e) {
  47. this.content = e.target.value
  48. },
  49. confirm() {
  50. if (this.content == '') {
  51. uni.showModal({
  52. content: '请输入反馈内容!',
  53. showCancel: false,
  54. });
  55. return
  56. }
  57. uni.showLoading({
  58. title: '加载中...',
  59. mask: true
  60. })
  61. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=entityDataHandle', {
  62. bizCatalog: 'InteractionEntity',
  63. handleMode: 'submitNewSuggestion',
  64. content: this.content
  65. },
  66. res => {
  67. if (res.status) {
  68. uni.showModal({
  69. content: '反馈成功!',
  70. showCancel: false,
  71. success: () => {
  72. uni.navigateBack({
  73. delta: 1
  74. })
  75. }
  76. })
  77. uni.hideLoading()
  78. }
  79. })
  80. },
  81. },
  82. components: {},
  83. onLoad() {
  84. this.get_data()
  85. },
  86. }
  87. </script>
  88. <style>
  89. page {}
  90. </style>