complaint.vue 3.7 KB

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