yijian.vue 3.7 KB

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