comments.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="content">
  3. <text style="margin-left: 20px;">此投诉为本小程序自有投诉渠道,非微信官方投诉渠道</text>
  4. <view class="online_box">
  5. <view class="part1">
  6. <view class="online_left">投诉类型</view>
  7. <view class="online_right" @click="show = true">
  8. {{complaintName?complaintName:'请选择投诉类型'}}
  9. <image src="../../static/images/img/go.png"></image>
  10. </view>
  11. </view>
  12. <u-line color="#E6E6E6" />
  13. <view class="online">
  14. <view class="tit">投诉理由</view>
  15. <view class="text_box" style="margin-top: 20rpx;">
  16. <u-input v-model="value" height="300" :type="type" :border="border" :clearable="false"
  17. placeholder="请描述问题发生的情况" />
  18. </view>
  19. </view>
  20. </view>
  21. <view class="btn" @click="bindorder">立即提交</view>
  22. <u-picker v-model="show" mode="selector" :range="typeList" range-key="illegal" @confirm='select'></u-picker>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. show: false,
  30. value: '',
  31. type: 'textarea',
  32. border: true,
  33. indentNumber: '',
  34. complaintName: '',
  35. typeList: [],
  36. IllegalId: ''
  37. }
  38. },
  39. onLoad(options) {
  40. console.log(options)
  41. this.indentNumber = options.indentNumber
  42. console.log(options.indentNumber)
  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. indentNumber: this.indentNumber,
  76. wrongExplain: this.value,
  77. illegalId: this.IllegalId,
  78. type: '2',
  79. indentType: '5',
  80. shopId: uni.getStorageSync('shopId')
  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: #FF7F00;
  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>