feedback.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view style="padding: 0 32upx;margin-bottom: 35upx;">
  3. <view class="comment">满意度星级评价(完成此项送30圈币)</view>
  4. <view class="comment">您对酒店的整体满意度</view>
  5. <view class="comment">
  6. <van-rate
  7. :value="satisfaction"
  8. void-icon="star"
  9. void-color="#eee"
  10. color="#ee0a24"
  11. @change="getsatisfaction"
  12. />
  13. </view>
  14. <view class="comment">您是否会再次入住或向他人介绍本酒店</view>
  15. <view class="comment">
  16. <van-rate
  17. :value="recommend"
  18. void-icon="star"
  19. void-color="#eee"
  20. color="#ee0a24"
  21. @change="getrecommend"
  22. />
  23. </view>
  24. <view class="comment">您对酒店的设施是否满意</view>
  25. <view class="comment">
  26. <van-rate
  27. :value="facilities"
  28. void-icon="star"
  29. void-color="#eee"
  30. @change="getfacilities"
  31. color="#ee0a24"
  32. />
  33. </view>
  34. <view class="comment">您对员工的待客礼仪否满意</view>
  35. <view class="comment">
  36. <van-rate
  37. :value="ceremony"
  38. void-icon="star"
  39. @change="getceremony"
  40. void-color="#eee"
  41. color="#ee0a24"
  42. />
  43. </view>
  44. <view class="comment">您对我们提供的网上购物的总体评价</view>
  45. <view class="comment">
  46. <van-rate
  47. :value="shopping"
  48. void-icon="star"
  49. @change="getshopping"
  50. void-color="#eee"
  51. color="#ee0a24"
  52. />
  53. </view>
  54. <view class="comment">文字建议与评价(完成此项送20圈币)</view>
  55. <view class="comment" style="padding: 20rpx 40rpx;">对我们的酒店设施与服务,您还有什么建议吗?对我们的服务人员您有什么批评或表扬吗?请告诉我们...</view>
  56. <TextArea :maxnumber="maxnumber" :tips="tips" @submitValue="submitValue"/>
  57. <view style="padding: 15upx 32upx;">
  58. <view>添加图片(最多3张)</view>
  59. <uploadImage @getImg="getImg" />
  60. </view>
  61. <view class="submitRemin" @click="submitRemin">提交</view>
  62. </view>
  63. </template>
  64. <script>
  65. import TextArea from '@/component/textarea.vue'
  66. import uploadImage from '@/component/uploadImage.vue'
  67. export default {
  68. components: {
  69. TextArea,
  70. uploadImage
  71. },
  72. data() {
  73. return{
  74. conent:'',
  75. maxnumber: 300,
  76. tips: '',
  77. satisfaction:'', //酒店整体满意度评分 取值范围1-5
  78. recommend:'', // 是否再次入住评分 取值范围1-5
  79. facilities:'', //设施评分 取值范围1-5
  80. ceremony:'', //是 string 礼仪评分 取值范围1-5
  81. shopping:'', //是 string 网上购物评分 取值范围1-5
  82. content:'', //否 string 评价内容评分 取值范围1-5
  83. img_list:'',
  84. store_id: 0
  85. }
  86. },
  87. onLoad(e) {
  88. this.store_id = e.store_id;
  89. },
  90. methods: {
  91. getsatisfaction(e) {
  92. this.satisfaction = e.detail;
  93. },
  94. getrecommend(e) {
  95. this.recommend = e.detail;
  96. },
  97. getfacilities(e) {
  98. this.facilities = e.detail;
  99. },
  100. getceremony(e){
  101. this.ceremony = e.detail;
  102. },
  103. getshopping(e){
  104. this.shopping = e.detail;
  105. },
  106. getImg(e) {
  107. this.img_list = e.join(',');
  108. },
  109. submitValue(e) {
  110. this.content = e.detail.value;
  111. },
  112. submitRemin() {
  113. if(this.satisfaction == '' || this.recommend == ''
  114. || this.facilities == ''|| this.ceremony == ''|| this.shopping == '') {
  115. this.$msg("请完成星级评价!");
  116. return;
  117. }
  118. if(this.content == '') {
  119. this.$msg('请填写反馈内容!');
  120. return;
  121. }
  122. if(this.content.length < 20 ) {
  123. this.$msg( '反馈内容不能少于20个字!');
  124. return;
  125. }
  126. this.request({
  127. url: '/v2/store/feedback',
  128. method: 'post',
  129. data: {
  130. store_id: this.store_id,
  131. satisfaction: this.satisfaction,
  132. recommend: this.recommend,
  133. facilities: this.facilities,
  134. ceremony: this.ceremony,
  135. shopping: this.shopping,
  136. content: this.content,
  137. img_list: this.img_list,
  138. },
  139. success: (res) => {
  140. uni.navigateBack();
  141. }
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style>
  148. .comment {
  149. text-align: center;
  150. padding: 20upx 0;
  151. }
  152. </style>