comments.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/img/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"
  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. }
  37. },
  38. onLoad(options) {
  39. console.log(options)
  40. this.indentNumber = options.indentNumber
  41. console.log(options.indentNumber)
  42. this.getTypeList()
  43. },
  44. methods: {
  45. select(e) {
  46. console.log(e)
  47. this.complaintName = this.typeList[e].illegal
  48. this.IllegalId = this.typeList[e].id
  49. },
  50. getTypeList() {
  51. this.$Request.get('/shop/illegalType/selectIllegalTypeList').then(res => {
  52. if (res.code == 0) {
  53. this.typeList = res.data
  54. }
  55. });
  56. },
  57. bindorder() {
  58. if (this.IllegalId == '') {
  59. uni.showToast({
  60. title: '请选择投诉类型',
  61. icon: 'none'
  62. })
  63. return
  64. }
  65. if (this.value == '') {
  66. uni.showToast({
  67. title: '请填写投诉原因',
  68. icon: 'none'
  69. })
  70. return
  71. }
  72. this.$Request.postJson('/app/tbindent/insertComplaint', {
  73. // indentNumber:this.indentNumber,
  74. indentNumber: this.indentNumber,
  75. wrongExplain: this.value,
  76. illegalId: this.IllegalId,
  77. type: '2',
  78. indentType: '5',
  79. shopId: uni.getStorageSync('shopId')
  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>