feedback.vue 6.9 KB

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