evaluate.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="container">
  3. <!-- 处理时效区域 -->
  4. <view class="score">
  5. <text>处理时效</text>
  6. <uni-rate activeColor="#FF5733" allowHalf size="30" value="0" @change="onChange" />
  7. </view>
  8. <!-- 服务评价区域 -->
  9. <view class="evaluate">
  10. 服务评价
  11. <textarea placeholder-style="color:#CCCCCC" placeholder="您宝贵的评价对我们很重要哦" v-model="textareaValue"></textarea>
  12. </view>
  13. <!-- 确认提交区域 -->
  14. <view class="btn" @click="handleSub">确认提交</view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. score: 0,
  22. textareaValue: ''
  23. }
  24. },
  25. methods: {
  26. onChange(e) {
  27. console.log(e)
  28. this.score = e.value * 2
  29. },
  30. handleSub() {
  31. if (this.score === 0) {
  32. uni.showToast({
  33. title: '请您给此次服务评分',
  34. icon: 'none'
  35. })
  36. return
  37. }
  38. if (!this.textareaValue) {
  39. uni.showToast({
  40. title: '请输入服务评价',
  41. icon: 'none'
  42. })
  43. return
  44. }
  45. console.log(this.score)
  46. console.log(this.textareaValue)
  47. uni.showToast({
  48. title: '评价成功',
  49. icon: 'none'
  50. })
  51. setTimeout(() => {
  52. uni.redirectTo({
  53. url: '/pagesRepairs/box/box'
  54. })
  55. }, 1500)
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .container {
  62. position: relative;
  63. padding-left: 30rpx;
  64. width: 100vw;
  65. height: 100vh;
  66. .score {
  67. display: flex;
  68. align-items: center;
  69. height: 172rpx;
  70. font-size: 28rpx;
  71. text {
  72. margin-right: 25rpx;
  73. }
  74. }
  75. .evaluate {
  76. display: flex;
  77. font-size: 28rpx;
  78. textarea {
  79. box-sizing: border-box;
  80. margin-left: 28rpx;
  81. padding: 14rpx 20rpx;
  82. width: 550rpx;
  83. height: 298rpx;
  84. font-size: 28rpx;
  85. border-radius: 11rpx;
  86. border: 1rpx solid #e6e6e6;
  87. }
  88. }
  89. .btn {
  90. position: absolute;
  91. left: 30rpx;
  92. bottom: 65rpx;
  93. display: flex;
  94. justify-content: center;
  95. align-items: center;
  96. width: 690rpx;
  97. height: 100rpx;
  98. color: #fff;
  99. font-size: 32rpx;
  100. border-radius: 12rpx;
  101. background-color: #6fb6b8;
  102. }
  103. }
  104. </style>