yijian.vue 4.5 KB

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