evaluate.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="content" :class="['qn-page-' + theme]">
  3. <view class="pj-top">
  4. <textarea placeholder="您对该项目的员工满意吗?说说你的评价." v-model="comment" placeholder-class="textholder"></textarea>
  5. </view>
  6. <view class="pj-xj">
  7. <view class="">
  8. 满意度:
  9. </view>
  10. <u-rate :count="count" v-model="score"></u-rate>
  11. </view>
  12. <view class="btn primary-btn" @click="fbpj()">
  13. 发布
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. comment: '',
  22. order_id: '',
  23. uid: '',
  24. yg: {},
  25. score: 5,
  26. count: 5,
  27. }
  28. },
  29. onLoad(opt) {
  30. this.order_id = opt.order_id
  31. this.uid = opt.uid
  32. },
  33. onShow() {
  34. },
  35. onReachBottom() {
  36. },
  37. onReady() {
  38. },
  39. methods: {
  40. fbpj() {
  41. if(this.comment == '') {
  42. return that.$u.toast('请输入评价');
  43. }
  44. console.log(this.score, this.comment)
  45. this.$u.api.pjYg({
  46. uid: this.uid, //员工id
  47. comment: this.comment, //评论
  48. score: this.score, //评分
  49. order_id: this.order_id //预约订单id
  50. }).then(res => {
  51. uni.showToast({
  52. title: '评价成功'
  53. });
  54. setTimeout(() => {
  55. uni.navigateBack()
  56. }, 1000);
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. page {
  64. background: #f8f6f6;
  65. height: auto;
  66. min-height: 100%;
  67. }
  68. .pj-top {
  69. background-color: #fff;
  70. padding: 20rpx;
  71. height: 250rpx;
  72. textarea {
  73. display: block;
  74. width: 100%;
  75. height: 100%;
  76. font-size: 28rpx;
  77. font-weight: 500;
  78. color: #333;
  79. }
  80. .textholder {
  81. font-size: 28rpx;
  82. font-weight: 500;
  83. color: #999;
  84. }
  85. }
  86. .pj-xj {
  87. margin-top: 20rpx;
  88. display: flex;
  89. justify-content: flex-start;
  90. align-items: center;
  91. background-color: #fff;
  92. padding: 0 20rpx;
  93. height: 75rpx;
  94. }
  95. .btn {
  96. width: 560rpx;
  97. height: 90rpx;
  98. background: #E02020;
  99. border-radius: 45px;
  100. font-size: 36rpx;
  101. font-weight: 500;
  102. color: #FFFFFF;
  103. text-align: center;
  104. line-height: 90rpx;
  105. margin: 88rpx auto 0;
  106. }
  107. </style>