comments.vue 12 KB

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