complain.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="page" style="background-color: #ffffff;">
  3. <view class="feedback-title">
  4. <text>投诉</text>
  5. </view>
  6. <view class="feedback-body"><textarea placeholder="请详细描述你的问题..." v-model="sendDate.content" class="feedback-textare" /></view>
  7. <view class="feedback-title"><text>QQ/邮箱</text></view>
  8. <view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " /></view>
  9. <button type="primary" style="" class="feedback-submit" @tap="send">提交</button>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
  17. stars: [1, 2, 3, 4, 5],
  18. imageList: [],
  19. sendDate: {
  20. content: '',
  21. contact: ''
  22. },
  23. ordersId: ''
  24. };
  25. },
  26. onLoad(e) {
  27. this.ordersId = e.id
  28. let deviceInfo = {
  29. appid: plus.runtime.appid,
  30. imei: plus.device.imei, //设备标识
  31. p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
  32. md: plus.device.model, //设备型号
  33. app_version: plus.runtime.version,
  34. plus_version: plus.runtime.innerVersion, //基座版本号
  35. os: plus.os.version,
  36. net: '' + plus.networkinfo.getCurrentType()
  37. };
  38. this.sendDate = Object.assign(deviceInfo, this.sendDate);
  39. },
  40. methods: {
  41. close(e) {
  42. this.imageList.splice(e, 1);
  43. },
  44. send() {
  45. //发送反馈
  46. console.log(JSON.stringify(this.sendDate));
  47. if (!this.sendDate.content) {
  48. uni.showToast({
  49. icon: 'none',
  50. title: '请输入投诉内容'
  51. });
  52. return;
  53. }
  54. if (!this.sendDate.contact) {
  55. uni.showToast({
  56. icon: 'none',
  57. title: '请填写QQ或邮箱'
  58. });
  59. return;
  60. }
  61. this.$queue.showLoading('加载中...');
  62. console.log(this.ordersId)
  63. this.$Request.postJson('/app/message/insertMessage', {
  64. ordersId: this.ordersId,
  65. title: this.sendDate.contact,
  66. content: JSON.stringify(this.sendDate),
  67. state: 9,
  68. }).then(res => {
  69. if (res.code === 0) {
  70. uni.showToast({
  71. title: '投诉成功'
  72. });
  73. setTimeout(function() {
  74. uni.navigateBack();
  75. }, 1000);
  76. } else {
  77. uni.hideLoading();
  78. uni.showModal({
  79. showCancel: false,
  80. title: '投诉失败',
  81. content: res.msg
  82. });
  83. }
  84. });
  85. }
  86. }
  87. };
  88. </script>
  89. <style>
  90. @font-face {
  91. font-family: uniicons;
  92. font-weight: normal;
  93. font-style: normal;
  94. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  95. }
  96. page {
  97. background-color: #ffffff !important;
  98. }
  99. view {
  100. font-size: 28upx;
  101. }
  102. /*问题反馈*/
  103. .feedback-title {
  104. display: flex;
  105. flex-direction: row;
  106. justify-content: space-between;
  107. align-items: center;
  108. padding: 20upx;
  109. color: #8f8f94;
  110. font-size: 28upx;
  111. }
  112. .feedback-star-view.feedback-title {
  113. justify-content: flex-start;
  114. margin: 0;
  115. }
  116. .feedback-body {
  117. font-size: 32upx;
  118. padding: 16upx;
  119. margin: 16upx;
  120. border-radius: 16upx;
  121. background: #1E1F31;
  122. color: #FFF;
  123. }
  124. .feedback-textare {
  125. height: 200upx;
  126. font-size: 34upx;
  127. line-height: 50upx;
  128. width: 100%;
  129. box-sizing: border-box;
  130. padding: 20upx 30upx 0;
  131. }
  132. .feedback-input {
  133. font-size: 32upx;
  134. height: 60upx;
  135. padding: 15upx 20upx;
  136. line-height: 60upx;
  137. }
  138. .feedback-submit {
  139. background: #1789FD;
  140. color: #ffffff;
  141. margin: 20upx;
  142. margin-top: 32upx;
  143. }
  144. </style>