evaluate.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="evaluate">
  3. <view class="content">
  4. <view class="title">
  5. 对客户做出评价
  6. <image src="/static/store/detele.png" mode="" @click="cut"></image>
  7. </view>
  8. <view class="rate">
  9. 综合评价:<u-rate :count="count" v-model="evaluateGrade" active-icon="heart-fill" inactive-icon="heart" size="56"></u-rate>
  10. </view>
  11. <view class="tag">
  12. <view class="item_tag" :class="item.check?'active':''" v-for="item in tagList" :key="item.id" @click="select(item)">
  13. {{item.labelContent}}
  14. </view>
  15. </view>
  16. <view class="btn">
  17. <view class="sub" @click="submit">
  18. 确定
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default{
  26. name:'evaluate',
  27. props:{
  28. userId:{
  29. type:String,
  30. default:''
  31. },
  32. taskId:{
  33. type:String,
  34. default:''
  35. }
  36. },
  37. data(){
  38. return{
  39. count: 5,
  40. evaluateGrade: 0,
  41. tagList:[]
  42. }
  43. },
  44. methods:{
  45. getTag(){
  46. this.$http.get("/ts/merchant/selectLabel?serviceType="+'1909434886438043649').then(res => {
  47. console.log(res)
  48. if (res.data.code == 200) {
  49. res.data.result.forEach(item => {
  50. item.check = false
  51. })
  52. this.tagList = res.data.result
  53. }
  54. })
  55. },
  56. select(item){
  57. item.check = !item.check
  58. },
  59. cut(){
  60. this.$emit('cut')
  61. },
  62. submit(){
  63. let data = {
  64. merchantId: uni.getStorageSync('login_user_info').merchantId,
  65. merchantName: uni.getStorageSync('login_user_info').merchantName,
  66. merchantUserId:uni.getStorageSync('login_user_info').id,
  67. merchantUserName:uni.getStorageSync('login_user_info').name,
  68. localTsMerchantEvaluateUserLinkLabel:[],
  69. evaluateGrade:this.evaluateGrade,
  70. userId:this.userId,
  71. taskId:this.taskId
  72. }
  73. this.tagList.forEach(item => {
  74. if(item.check){
  75. data.localTsMerchantEvaluateUserLinkLabel.push({
  76. labelId:item.id,
  77. labelName:item.labelContent
  78. })
  79. }
  80. })
  81. this.$http.post("/ts/merchant/commentUser",data).then(res => {
  82. console.log(res)
  83. if (res.data.code == 200) {
  84. uni.showToast({
  85. icon:'none',
  86. title:'评论成功'
  87. })
  88. this.cut()
  89. }
  90. })
  91. }
  92. },
  93. mounted() {
  94. this.getTag()
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .evaluate{
  100. position: fixed;
  101. top: 0;
  102. left: 0;
  103. background: rgba(0, 0, 0, 0.7);
  104. width: 100%;
  105. // height: calc(100vh - 100rpx);
  106. height: 100vh;
  107. display: flex;
  108. align-items: end;
  109. z-index: 999;
  110. .content{
  111. width: 100%;
  112. background-color: #fff;
  113. padding: 20rpx 25rpx;
  114. border-radius: 20rpx;
  115. .title{
  116. text-align: center;
  117. border-bottom: 1px solid #EEEEEE;
  118. padding-bottom: 20rpx;
  119. margin-bottom: 44rpx;
  120. image{
  121. width:37rpx ;
  122. height: 37rpx;
  123. float: right;
  124. }
  125. }
  126. .rate{
  127. font-weight: 600;
  128. font-size: 30rpx;
  129. margin-bottom: 48rpx;
  130. display: flex;
  131. align-items: center;
  132. }
  133. .tag{
  134. padding-bottom: 42rpx;
  135. border-bottom: 1px solid #EEEEEE;
  136. display: flex;
  137. .item_tag{
  138. width: 140rpx;
  139. height: 52rpx;
  140. border-radius: 4rpx;
  141. border: 1px solid #C2C2C2;
  142. display: flex;
  143. align-items: center;
  144. justify-content: center;
  145. font-size: 26rpx;
  146. margin-right: 37rpx;
  147. }
  148. .active{
  149. background: rgba(68,154,255,0.1);
  150. border-radius: 4rpx;
  151. border: 1px solid #449AFF;
  152. color: #2983EC;
  153. }
  154. }
  155. .btn{
  156. width: 100%;
  157. height:112rpx ;
  158. padding: 16rpx 24rpx;
  159. .sub{
  160. width: 100%;
  161. height:100%;
  162. background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);
  163. border-radius: 53px;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. font-size: 28rpx;
  168. color: #FFFFFF;
  169. }
  170. }
  171. }
  172. }
  173. </style>