comments.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <!-- style="background: #FFFFFF;" -->
  3. <view class="page" style="background: #f0f0f0; padding-top: 7rpx;">
  4. <!-- <view class="feedback-title">
  5. <view>问题和意见</view>
  6. <view class="feedback-quick" @tap="chooseMsg">
  7. <text>快速键入</text>
  8. <u-icon name="arrow-right"></u-icon>
  9. </view>
  10. </view> -->
  11. <view style="background: #FFFFFF;" class="feedback-body">
  12. <view class="flex align-center padding-tb-sm">
  13. <view>
  14. <image v-if="globalImages" :src="globalImages + 'images/order/tiem.png'" style="width: 100rpx;height: 100rpx;" mode=""></image>
  15. </view>
  16. <view style="margin-left: 30rpx; line-height: 40rpx;">
  17. <view style="color: #999;">司机师傅</view>
  18. <view>什么时间段的订单</view>
  19. </view>
  20. </view>
  21. <view class="flex align-center add_name" style="margin: 30rpx 0rpx 4rpx;">
  22. <view class="green"></view>出发地点:12312
  23. </view>
  24. <image v-if="globalImages" :src="globalImages + 'images/static/upload/up.png'" class="order_up"></image>
  25. <view class="flex align-center add_name">
  26. <view class="orgin"></view>到达地点:111111
  27. </view>
  28. </view>
  29. <view style="background: #FFFFFF;" class="feedback-body">
  30. <view class="titls" style="text-align: center;">
  31. 为本次服务评分
  32. </view>
  33. <view style="display: flex; justify-content: center; margin-bottom: 30rpx;">
  34. <u-rate :allow-half="false" :disabled="true" size="58" active-color="#fe6b01" :is-fill="false" :value="3.5" />
  35. </view>
  36. <view style="font-size: 24rpx;color: #ccc;text-align: center;">点击星星评分</view>
  37. </view>
  38. <view style="background: #FFFFFF;margin-top: 30rpx;" class="feedback-body">
  39. <view class="titls">
  40. 快速评价
  41. </view>
  42. <view class="flex-container">
  43. <view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_1.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>车内整洁</view>
  44. <view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_2.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>礼貌热情</view>
  45. <view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_3.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>准时到达</view>
  46. <view class="item"><image v-if="globalImages" :src="globalImages + 'images/evaluate/icon_4.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>乐于助人</view>
  47. <view class="item"><image v-if="globalImages" :src="globalImages + '/images/evaluate/icon_5.png'" style="width: 25rpx;height: 25rpx; margin-right: 10rpx;" mode=""></image>驾驶平稳</view>
  48. </view>
  49. </view>
  50. <view style="background: #FFFFFF;" class="feedback-body">
  51. <view class="titls">
  52. 详细评价
  53. </view>
  54. <textarea placeholder="说说这次乘车体验吧..." v-model="sendDate.content" class="feedback-textare" />
  55. </view>
  56. <!-- <view class="feedback-title"><text>QQ/邮箱</text></view> -->
  57. <!-- <view class="feedback-body"><input class="feedback-input" v-model="sendDate.contact" placeholder="方便我们联系你 " />
  58. </view> -->
  59. <!-- <view class="feedback-title feedback-star-view">
  60. <text>我的评价:</text>
  61. <view style="margin-left: 20rpx;">
  62. <u-radio-group v-model="value" @change="radioGroupChange">
  63. <u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.id"
  64. :disabled="item.disabled" active-color="#346EF6">
  65. {{item.name}}
  66. </u-radio>
  67. </u-radio-group>
  68. </view>
  69. <view class="feedback-star-view">
  70. <text class="feedback-star" v-for="(value, key) in stars" :key="key" :class="key < sendDate.score ? 'active' : ''" @tap="chooseStar(value)"></text>
  71. </view>
  72. </view> -->
  73. <view style="text-align: center; color: #999;">
  74. <view style="font-size: 24rpx;">评价信息仅供平台服务改进使用</view>
  75. <view style="font-size: 24rpx;">双峰均不可见具体评价内容</view>
  76. </view>
  77. <button type="primary" style="background: #fe6b01; margin-bottom: 30rpx;" class="feedback-submit" @tap="send">提交评价</button>
  78. </view>
  79. </template>
  80. <script>
  81. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  82. export default {
  83. data() {
  84. return {
  85. msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
  86. // stars: [1, 2, 3, 4, 5],
  87. // count: 5,
  88. // value: 0,
  89. list: [{
  90. id: 0,
  91. name: '满意',
  92. disabled: false
  93. }, {
  94. id:1,
  95. name: '不满意',
  96. disabled: false
  97. }],
  98. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  99. value: 0,
  100. imageList: [],
  101. sendDate: {
  102. score: 0,
  103. content: '',
  104. contact: ''
  105. },
  106. riderUserId: '',
  107. satisfactionFlag: '',
  108. globalImages: ''
  109. };
  110. },
  111. onLoad(e) {
  112. waitForGlobalImages().then((path) => {
  113. console.log('✅ 全局图片路径:', path)
  114. this.globalImages = path
  115. })
  116. console.log(e)
  117. this.riderUserId = e.riderUserId
  118. this.indentNumber = e.indentNumber
  119. // console.log(this.riderUserId,'........',this.indentNumber)
  120. // let deviceInfo = {
  121. // appid: plus.runtime.appid,
  122. // imei: plus.device.imei, //设备标识
  123. // p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
  124. // md: plus.device.model, //设备型号
  125. // app_version: plus.runtime.version,
  126. // plus_version: plus.runtime.innerVersion, //基座版本号
  127. // os: plus.os.version,
  128. // net: '' + plus.networkinfo.getCurrentType()
  129. // };
  130. // this.sendDate = Object.assign(deviceInfo, this.sendDate);
  131. },
  132. methods: {
  133. close(e) {
  134. this.imageList.splice(e, 1);
  135. },
  136. chooseMsg() {
  137. //快速输入
  138. uni.showActionSheet({
  139. itemList: this.msgContents,
  140. success: res => {
  141. this.sendDate.content = this.msgContents[res.tapIndex];
  142. }
  143. });
  144. },
  145. chooseImg() {
  146. //选择图片
  147. uni.chooseImage({
  148. sourceType: ['camera', 'album'],
  149. sizeType: 'compressed',
  150. count: 8 - this.imageList.length,
  151. success: res => {
  152. this.imageList = this.imageList.concat(res.tempFilePaths);
  153. }
  154. });
  155. },
  156. // 选中某个单选框时,由radio时触发
  157. radioChange(e) {
  158. console.log(e);
  159. if (this.value == "满意" && e == "满意") {
  160. this.satisfactionFlag = 1
  161. } else if (this.value == '不满意' && e == "不满意") {
  162. this.satisfactionFlag = 2
  163. }
  164. },
  165. // 选中任一radio时,由radio-group触发
  166. radioGroupChange(e) {
  167. // console.log(e);
  168. },
  169. // chooseStar(e) {
  170. // //点击评星
  171. // this.sendDate.score = e;
  172. // },
  173. // previewImage() {
  174. // //预览图片
  175. // uni.previewImage({
  176. // urls: this.imageList
  177. // });
  178. // },
  179. send() {
  180. //发送反馈
  181. // console.log(JSON.stringify(this.sendDate), '11111');
  182. if (!this.sendDate.content) {
  183. uni.showToast({
  184. icon: 'none',
  185. title: '请输入反馈内容'
  186. });
  187. return;
  188. }
  189. // if (this.value = 0) {
  190. // uni.showToast({
  191. // icon: 'none',
  192. // title: '请评论是否满意'
  193. // });
  194. // return;
  195. // }
  196. // uni.report( this.sendDate,'意见反馈');
  197. // console.log("uni.report( '意见反馈',this.sendDate)", uni.report('意见反馈', this.sendDate))
  198. uni.report('意见反馈', this.sendDate);
  199. console.log(this.indentNumber, this.satisfactionFlag)
  200. this.$queue.showLoading('加载中...');
  201. this.$Request
  202. .postJson('/app/indent/userEvaluate', {
  203. // state: this.value,
  204. // title: this.sendDate.contact,
  205. // evaluateMessage: JSON.stringify(this.sendDate.content),
  206. evaluateMessage: this.sendDate.content,
  207. // riderUserId: this.riderUserId,
  208. indentNumber: this.indentNumber,
  209. satisfactionFlag: this.value
  210. })
  211. .then(res => {
  212. if (res.code == 0) {
  213. uni.showToast({
  214. title: '评论成功'
  215. });
  216. setTimeout(function() {
  217. uni.navigateBack();
  218. }, 1000);
  219. } else {
  220. uni.hideLoading();
  221. uni.showModal({
  222. showCancel: false,
  223. title: '评论失败',
  224. content: res.msg
  225. });
  226. }
  227. });
  228. }
  229. }
  230. };
  231. </script>
  232. <style>
  233. /* @font-face {
  234. font-family: uniicons;
  235. font-weight: normal;
  236. font-style: normal;
  237. src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
  238. } */
  239. page {
  240. background-color: #FFFFFF;
  241. }
  242. view {
  243. font-size: 28upx;
  244. }
  245. .input-view {
  246. font-size: 28upx;
  247. }
  248. .close-view {
  249. text-align: center;
  250. line-height: 14px;
  251. height: 16px;
  252. width: 16px;
  253. border-radius: 50%;
  254. background: #ff5053;
  255. color: #ffffff;
  256. position: absolute;
  257. top: -6px;
  258. right: -4px;
  259. font-size: 12px;
  260. }
  261. /* 上传 */
  262. .uni-uploader {
  263. flex: 1;
  264. flex-direction: column;
  265. }
  266. .uni-uploader-head {
  267. display: flex;
  268. flex-direction: row;
  269. justify-content: space-between;
  270. }
  271. .uni-uploader-info {
  272. color: #b2b2b2;
  273. }
  274. .uni-uploader-body {
  275. margin-top: 16upx;
  276. }
  277. .uni-uploader__files {
  278. display: flex;
  279. flex-direction: row;
  280. flex-wrap: wrap;
  281. }
  282. .uni-uploader__file {
  283. margin: 10upx;
  284. width: 210upx;
  285. height: 210upx;
  286. }
  287. .uni-uploader__img {
  288. display: block;
  289. width: 210upx;
  290. height: 210upx;
  291. }
  292. .uni-uploader__input-box {
  293. position: relative;
  294. margin: 10upx;
  295. width: 208upx;
  296. height: 208upx;
  297. border: 2upx solid #d9d9d9;
  298. }
  299. .uni-uploader__input-box:before,
  300. .uni-uploader__input-box:after {
  301. content: ' ';
  302. position: absolute;
  303. top: 50%;
  304. left: 50%;
  305. -webkit-transform: translate(-50%, -50%);
  306. transform: translate(-50%, -50%);
  307. background-color: #d9d9d9;
  308. }
  309. .uni-uploader__input-box:before {
  310. width: 4upx;
  311. height: 79upx;
  312. }
  313. .uni-uploader__input-box:after {
  314. width: 79upx;
  315. height: 4upx;
  316. }
  317. .uni-uploader__input-box:active {
  318. border-color: #999999;
  319. }
  320. .uni-uploader__input-box:active:before,
  321. .uni-uploader__input-box:active:after {
  322. background-color: #999999;
  323. }
  324. .uni-uploader__input {
  325. position: absolute;
  326. z-index: 1;
  327. top: 0;
  328. left: 0;
  329. width: 100%;
  330. height: 100%;
  331. opacity: 0;
  332. }
  333. /*问题反馈*/
  334. .feedback-title {
  335. display: flex;
  336. flex-direction: row;
  337. justify-content: space-between;
  338. align-items: center;
  339. padding: 20upx;
  340. color: #8f8f94;
  341. font-size: 28upx;
  342. }
  343. .feedback-star-view.feedback-title {
  344. justify-content: flex-start;
  345. margin: 0;
  346. }
  347. .feedback-quick {
  348. /* position: relative; */
  349. /* padding-right: 40upx; */
  350. }
  351. /* .feedback-quick:after {
  352. font-family: uniicons;
  353. font-size: 40upx;
  354. content: '\e581';
  355. position: absolute;
  356. right: 0;
  357. top: 50%;
  358. color: #bbb;
  359. -webkit-transform: translateY(-50%);
  360. transform: translateY(-50%);
  361. } */
  362. .feedback-body {
  363. font-size: 32upx;
  364. padding: 30upx;
  365. margin: 30upx 30upx;
  366. border-radius: 16upx;
  367. background: #F8F8F8;
  368. }
  369. .feedback-textare {
  370. height: 200upx;
  371. font-size: 24upx;
  372. line-height: 50upx;
  373. width: 100%;
  374. box-sizing: border-box;
  375. padding:20upx 20upx 0;
  376. border: #e4e7ed 1rpx solid;
  377. background: #f5f5f5;
  378. border-radius: 15rpx;
  379. }
  380. .feedback-input {
  381. font-size: 32upx;
  382. height: 60upx;
  383. padding: 15upx 20upx;
  384. line-height: 60upx;
  385. }
  386. .feedback-uploader {
  387. padding: 22upx 20upx;
  388. }
  389. .feedback-star {
  390. font-family: uniicons;
  391. font-size: 40upx;
  392. margin-left: 6upx;
  393. }
  394. .feedback-star-view {
  395. margin-left: 20upx;
  396. }
  397. .feedback-star:after {
  398. content: '\e408';
  399. }
  400. .feedback-star.active {
  401. color: #ffb400;
  402. }
  403. .feedback-star.active:after {
  404. content: '\e438';
  405. }
  406. .feedback-submit {
  407. background: #007aff;
  408. color: #ffffff;
  409. margin: 20upx;
  410. }
  411. .titls {
  412. font-size: 32rpx;
  413. font-family: PingFang SC;
  414. color: #333333;
  415. padding-bottom: 30rpx;
  416. }
  417. .order_up {
  418. width: 6rpx;
  419. height: 24rpx;
  420. margin-left: 6rpx;
  421. }
  422. .add_name {
  423. font-family: PingFang SC;
  424. font-weight: 500;
  425. font-size: 28rpx;
  426. color: #1F1F1F;
  427. }
  428. .green {
  429. width: 16rpx;
  430. height: 16rpx;
  431. background: #1FC657;
  432. border-radius: 50%;
  433. margin-right: 20rpx;
  434. }
  435. .orgin {
  436. width: 16rpx;
  437. height: 16rpx;
  438. background: #FBAC04;
  439. border-radius: 50%;
  440. margin-right: 20rpx;
  441. }
  442. .flex-container {
  443. display: flex;
  444. flex-wrap: wrap; /* 允许换行 */
  445. }
  446. .item {
  447. flex-basis: calc(33.33% - 30rpx);
  448. text-align: center;
  449. border-radius: 8rpx;
  450. border: 1px solid #999; /* 为了便于观察布局,添加边框 */
  451. padding: 10rpx 15rpx;
  452. margin: 15rpx 10rpx;
  453. line-height: 50rpx;
  454. }
  455. </style>