feedback.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="page" style="background-color: #ffffff" v-if="XCXIsSelect == '是'">
  3. <view class="feedback-title">
  4. <text>问题和意见</text>
  5. <text @tap="chooseMsg">快速键入</text>
  6. </view>
  7. <view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.feedbackMessage" class="feedback-textare" /></view>
  8. <view class="feedback-title"><text>联系方式</text></view>
  9. <view class="feedback-body"><input class="feedback-input" v-model="sendDate.userEmail" placeholder="方便我们联系你" /></view>
  10. <button style="" class="feedback-submit" @tap="send">提交</button>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. XCXIsSelect: '是',
  18. msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
  19. sendDate: {
  20. score: 5,
  21. feedbackMessage: '',
  22. userEmail: ''
  23. }
  24. }
  25. },
  26. onLoad() {
  27. this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
  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. chooseMsg() {
  42. //快速输入
  43. uni.showActionSheet({
  44. itemList: this.msgContents,
  45. success: (res) => {
  46. this.sendDate.feedbackMessage = this.msgContents[res.tapIndex]
  47. }
  48. })
  49. },
  50. send() {
  51. //发送反馈
  52. console.log(JSON.stringify(this.sendDate))
  53. if (!this.sendDate.feedbackMessage) {
  54. uni.showToast({
  55. icon: 'none',
  56. title: '请输入反馈内容'
  57. })
  58. return
  59. }
  60. if (!this.sendDate.userEmail) {
  61. uni.showToast({
  62. icon: 'none',
  63. title: '请填写联系方式'
  64. })
  65. return
  66. }
  67. this.$queue.showLoading('加载中...')
  68. this.$Request
  69. .postJson('/app/userinfo/userFeedback', {
  70. userEmail: this.sendDate.userEmail,
  71. feedbackMessage: this.sendDate.feedbackMessage,
  72. feedbackType: 1
  73. })
  74. .then((res) => {
  75. if (res.code === 0) {
  76. uni.showToast({
  77. title: '提交成功'
  78. })
  79. setTimeout(function () {
  80. uni.navigateBack()
  81. }, 1000)
  82. } else {
  83. uni.hideLoading()
  84. uni.showModal({
  85. showCancel: false,
  86. title: '提交失败',
  87. feedbackMessage: res.msg
  88. })
  89. }
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. @font-face {
  97. font-family: uniicons;
  98. font-weight: normal;
  99. font-style: normal;
  100. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  101. }
  102. page {
  103. background-color: #f5f5f5 !important;
  104. }
  105. view {
  106. font-size: 28upx;
  107. }
  108. /*问题反馈*/
  109. .feedback-title {
  110. display: flex;
  111. flex-direction: row;
  112. justify-content: space-between;
  113. align-items: center;
  114. padding: 20upx;
  115. color: #8f8f94;
  116. font-size: 28upx;
  117. }
  118. .feedback-star-view.feedback-title {
  119. justify-content: flex-start;
  120. margin: 0;
  121. }
  122. .feedback-body {
  123. font-size: 32upx;
  124. padding: 16upx;
  125. margin: 16upx;
  126. border-radius: 16upx;
  127. background: #ffffff;
  128. /* color: #FFF; */
  129. }
  130. .feedback-textare {
  131. height: 200upx;
  132. font-size: 34upx;
  133. line-height: 50upx;
  134. width: 100%;
  135. box-sizing: border-box;
  136. padding: 20upx 30upx 0;
  137. }
  138. .feedback-input {
  139. font-size: 32upx;
  140. height: 60upx;
  141. /* padding: 15upx 20upx; */
  142. line-height: 60upx;
  143. }
  144. .feedback-submit {
  145. background: #ffcc00;
  146. /* color: #ffffff; */
  147. margin: 20upx;
  148. margin-top: 32upx;
  149. }
  150. </style>