complaint.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="content">
  3. <view class="online_box">
  4. <view class="part1">
  5. <view class="online_left">投诉类型</view>
  6. <view class="online_right" @click="show = true">
  7. {{complaintName}}
  8. <image <image v-if="globalImages" :src="globalImages + 'images/static/image/go.png'"></image>
  9. </view>
  10. </view>
  11. <u-line color="#E6E6E6" />
  12. <view class="online">
  13. <view class="tit">投诉理由</view>
  14. <view class="text_box" style="margin-top: 20rpx;">
  15. <u-input v-model="value" height="300" :type="type" :border="border" :clearable="false" placeholder="请描述问题发生的情况" />
  16. </view>
  17. </view>
  18. </view>
  19. <view class="btn" @click="bindorder">立即提交</view>
  20. <u-picker v-model="show" mode="selector" :range="typeList" range-key="illegal" @confirm='select' ></u-picker>
  21. </view>
  22. </template>
  23. <script>
  24. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  25. export default {
  26. data() {
  27. return {
  28. show: false,
  29. value: '',
  30. type: 'textarea',
  31. border: true,
  32. indentNumber:'',
  33. complaintName:'',
  34. typeList: [],
  35. IllegalId: '',
  36. globalImages: ''
  37. }
  38. },
  39. onLoad(options) {
  40. console.log(options)
  41. this.indentNumber =options.indentNumber
  42. this.getTypeList()
  43. waitForGlobalImages().then((path) => {
  44. console.log('✅ 全局图片路径:', path)
  45. this.globalImages = path
  46. })
  47. },
  48. methods: {
  49. select(e) {
  50. console.log(e)
  51. this.complaintName = this.typeList[e].illegal
  52. this.IllegalId = this.typeList[e].id
  53. },
  54. getTypeList() {
  55. this.$Request.get('/app/illegalType/selectIllegalTypeList').then(res => {
  56. if(res.code==0){
  57. this.typeList = res.data
  58. }
  59. });
  60. },
  61. bindorder(){
  62. if(this.IllegalId==''){
  63. uni.showToast({
  64. title:'请选择投诉类型',
  65. icon:'none'
  66. })
  67. return
  68. }
  69. if(this.value==''){
  70. uni.showToast({
  71. title:'请填写投诉原因',
  72. icon:'none'
  73. })
  74. return
  75. }
  76. this.$Request.postJson('/app/indent/insertComplaint',
  77. {
  78. indentNumber:this.indentNumber,
  79. wrongExplain:this.value,
  80. illegalId: this.IllegalId
  81. }).then(res => {
  82. if(res.code==0){
  83. uni.showToast({
  84. title:'提交成功',
  85. icon:'none'
  86. })
  87. setTimeout(function(){
  88. uni.navigateBack()
  89. },1000)
  90. }else{
  91. console.log('失败:',res.data)
  92. }
  93. });
  94. }
  95. }
  96. }
  97. </script>
  98. <style>
  99. body {
  100. background-color: #F5F5F5;
  101. }
  102. .content {
  103. width: 100%;
  104. }
  105. .online_box {
  106. width: 90%;
  107. margin: 0 auto;
  108. background: #FFFFFF;
  109. border-radius: 20rpx;
  110. margin-top: 30rpx;
  111. padding-bottom: 40rpx;
  112. }
  113. .part1 {
  114. width: 90%;
  115. margin: 0 auto;
  116. height: 80rpx;
  117. display: flex;
  118. align-items: center;
  119. }
  120. .online_left {
  121. flex: 1;
  122. font-size: 27rpx;
  123. font-weight: bold;
  124. letter-spacing: 2rpx;
  125. }
  126. .online_right {
  127. color: #999999;
  128. font-size: 22rpx;
  129. flex: 1;
  130. display: flex;
  131. justify-content: flex-end;
  132. align-items: center;
  133. }
  134. .online_right image {
  135. width: 12rpx;
  136. height: 21rpx;
  137. margin-left: 10rpx;
  138. }
  139. .online_title {
  140. font-size: 28rpx;
  141. font-weight: bold;
  142. letter-spacing: 2rpx;
  143. width: 90%;
  144. margin: 0 auto;
  145. line-height: 80rpx;
  146. }
  147. .online {
  148. width: 90%;
  149. margin: 0 auto;
  150. padding-bottom: 34rpx;
  151. }
  152. .tit {
  153. font-size: 27rpx;
  154. font-weight: bold;
  155. letter-spacing: 2rpx;
  156. margin-top: 19rpx;
  157. }
  158. .u-input--border {
  159. border: none !important;
  160. background: #F5F5F5 !important;
  161. }
  162. .btn {
  163. width: 90%;
  164. margin: 0 auto;
  165. background: #346EF6;
  166. line-height: 90rpx;
  167. text-align: center;
  168. color: white;
  169. border-radius: 15rpx;
  170. margin-top: 20rpx;
  171. font-size: 28rpx;
  172. }
  173. </style>