feedback.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view class="page">
  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 class="feedback-title"><text>QQ/邮箱</text></view> -->
  10. <!-- <view class="feedback-body"><input class="feedback-input" v-model="sendDate.mail" placeholder="方便我们联系你 " /></view> -->
  11. <view class="feedback-title feedback-star-view">
  12. <text>订单评分</text>
  13. <view class="feedback-star-view">
  14. <!-- <text class="feedback-star" v-for="(value, key) in stars" :key="key" :class="key < sendDate.score ? 'active' : ''" @tap="chooseStar(value)"></text> -->
  15. </view>
  16. <u-rate :count="count" v-model="value"></u-rate>
  17. </view>
  18. <button type="primary" style="background: #557EFD;margin-top: 32upx;" class="feedback-submit"
  19. @tap="send">提交</button>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
  27. stars: [1, 2, 3, 4, 5],
  28. imageList: [],
  29. sendDate: {
  30. score: 5,
  31. content: '',
  32. contact: ''
  33. },
  34. id: '',
  35. count: 5,
  36. value: 5,
  37. ordersId: ''
  38. };
  39. },
  40. onLoad(e) {
  41. this.id = e.id
  42. this.ordersId = e.ordersId
  43. // let deviceInfo = {
  44. // appid: plus.runtime.appid,
  45. // imei: plus.device.imei, //设备标识
  46. // p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
  47. // md: plus.device.model, //设备型号
  48. // app_version: plus.runtime.version,
  49. // plus_version: plus.runtime.innerVersion, //基座版本号
  50. // os: plus.os.version,
  51. // net: '' + plus.networkinfo.getCurrentType()
  52. // };
  53. // this.sendDate = Object.assign(deviceInfo, this.sendDate);
  54. },
  55. methods: {
  56. close(e) {
  57. this.imageList.splice(e, 1);
  58. },
  59. chooseMsg() {
  60. //快速输入
  61. uni.showActionSheet({
  62. itemList: this.msgContents,
  63. success: res => {
  64. this.sendDate.content = this.msgContents[res.tapIndex];
  65. }
  66. });
  67. },
  68. chooseImg() {
  69. //选择图片
  70. uni.chooseImage({
  71. sourceType: ['camera', 'album'],
  72. sizeType: 'compressed',
  73. count: 8 - this.imageList.length,
  74. success: res => {
  75. this.imageList = this.imageList.concat(res.tempFilePaths);
  76. }
  77. });
  78. },
  79. chooseStar(e) {
  80. //点击评星
  81. this.sendDate.score = e;
  82. },
  83. previewImage() {
  84. //预览图片
  85. uni.previewImage({
  86. urls: this.imageList
  87. });
  88. },
  89. send() {
  90. //发送反馈
  91. console.log(JSON.stringify(this.sendDate));
  92. if (!this.sendDate.content) {
  93. uni.showToast({
  94. icon: 'none',
  95. title: '请输入评价内容'
  96. });
  97. return;
  98. }
  99. // if (!this.sendDate.contact) {
  100. // uni.showToast({
  101. // icon: 'none',
  102. // title: '请填写QQ或邮箱'
  103. // });
  104. // return;
  105. // }
  106. // uni.report('意见反馈', this.sendDate);
  107. this.$queue.showLoading('加载中...');
  108. this.$Request.post('/app/takingComment/addGoodsNum', {
  109. id: this.id,
  110. content: this.sendDate.content,
  111. score: this.value,
  112. ordersId: this.ordersId
  113. }).then(res => {
  114. if (res.code === 0) {
  115. uni.showToast({
  116. title: '评价成功'
  117. });
  118. setTimeout(function() {
  119. uni.navigateBack();
  120. }, 1000);
  121. } else {
  122. uni.hideLoading();
  123. uni.showModal({
  124. showCancel: false,
  125. title: '评价失败',
  126. content: res.msg
  127. });
  128. }
  129. });
  130. }
  131. }
  132. };
  133. </script>
  134. <style>
  135. @font-face {
  136. font-family: uniicons;
  137. font-weight: normal;
  138. font-style: normal;
  139. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  140. }
  141. page {
  142. background-color: #F5F5F5;
  143. }
  144. view {
  145. font-size: 28upx;
  146. }
  147. .input-view {
  148. font-size: 28upx;
  149. }
  150. .close-view {
  151. text-align: center;
  152. line-height: 14px;
  153. height: 16px;
  154. width: 16px;
  155. border-radius: 50%;
  156. background: #ff5053;
  157. color: #ffffff;
  158. position: absolute;
  159. top: -6px;
  160. right: -4px;
  161. font-size: 12px;
  162. }
  163. /* 上传 */
  164. .uni-uploader {
  165. flex: 1;
  166. flex-direction: column;
  167. }
  168. .uni-uploader-head {
  169. display: flex;
  170. flex-direction: row;
  171. justify-content: space-between;
  172. }
  173. .uni-uploader-info {
  174. color: #b2b2b2;
  175. }
  176. .uni-uploader-body {
  177. margin-top: 16upx;
  178. }
  179. .uni-uploader__files {
  180. display: flex;
  181. flex-direction: row;
  182. flex-wrap: wrap;
  183. }
  184. .uni-uploader__file {
  185. margin: 10upx;
  186. width: 210upx;
  187. height: 210upx;
  188. }
  189. .uni-uploader__img {
  190. display: block;
  191. width: 210upx;
  192. height: 210upx;
  193. }
  194. .uni-uploader__input-box {
  195. position: relative;
  196. margin: 10upx;
  197. width: 208upx;
  198. height: 208upx;
  199. border: 2upx solid #d9d9d9;
  200. }
  201. .uni-uploader__input-box:before,
  202. .uni-uploader__input-box:after {
  203. content: ' ';
  204. position: absolute;
  205. top: 50%;
  206. left: 50%;
  207. -webkit-transform: translate(-50%, -50%);
  208. transform: translate(-50%, -50%);
  209. background-color: #d9d9d9;
  210. }
  211. .uni-uploader__input-box:before {
  212. width: 4upx;
  213. height: 79upx;
  214. }
  215. .uni-uploader__input-box:after {
  216. width: 79upx;
  217. height: 4upx;
  218. }
  219. .uni-uploader__input-box:active {
  220. border-color: #999999;
  221. }
  222. .uni-uploader__input-box:active:before,
  223. .uni-uploader__input-box:active:after {
  224. background-color: #999999;
  225. }
  226. .uni-uploader__input {
  227. position: absolute;
  228. z-index: 1;
  229. top: 0;
  230. left: 0;
  231. width: 100%;
  232. height: 100%;
  233. opacity: 0;
  234. }
  235. /*问题反馈*/
  236. .feedback-title {
  237. display: flex;
  238. flex-direction: row;
  239. justify-content: space-between;
  240. align-items: center;
  241. padding: 20upx;
  242. color: #8f8f94;
  243. font-size: 28upx;
  244. }
  245. .feedback-star-view.feedback-title {
  246. justify-content: flex-start;
  247. margin: 0;
  248. }
  249. .feedback-quick {
  250. position: relative;
  251. padding-right: 40upx;
  252. }
  253. .feedback-quick:after {
  254. font-family: uniicons;
  255. font-size: 40upx;
  256. content: '\e581';
  257. position: absolute;
  258. right: 0;
  259. top: 50%;
  260. color: #bbb;
  261. -webkit-transform: translateY(-50%);
  262. transform: translateY(-50%);
  263. }
  264. .feedback-body {
  265. font-size: 32upx;
  266. padding: 16upx;
  267. margin: 16upx;
  268. border-radius: 16upx;
  269. background: #FFFFFF;
  270. /* color: #FFF; */
  271. }
  272. .feedback-textare {
  273. height: 200upx;
  274. font-size: 34upx;
  275. line-height: 50upx;
  276. width: 100%;
  277. box-sizing: border-box;
  278. padding: 20upx 30upx 0;
  279. color: #8f8f94;
  280. }
  281. .feedback-input {
  282. font-size: 32upx;
  283. height: 60upx;
  284. padding: 15upx 20upx;
  285. line-height: 60upx;
  286. }
  287. .feedback-uploader {
  288. padding: 22upx 20upx;
  289. }
  290. .feedback-star {
  291. font-family: uniicons;
  292. font-size: 40upx;
  293. margin-left: 6upx;
  294. }
  295. .feedback-star-view {
  296. margin-left: 20upx;
  297. }
  298. .feedback-star:after {
  299. content: '\e408';
  300. }
  301. .feedback-star.active {
  302. color: #ffb400;
  303. }
  304. .feedback-star.active:after {
  305. content: '\e438';
  306. }
  307. .feedback-submit {
  308. background: #007aff;
  309. color: #ffffff;
  310. margin: 20upx;
  311. }
  312. </style>