complain.vue 3.5 KB

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