evaluate.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. console.log(this.taskId)
  95. this.getTag()
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .evaluate{
  101. position: fixed;
  102. top: 0;
  103. left: 0;
  104. background: rgba(0, 0, 0, 0.7);
  105. width: 100%;
  106. // height: calc(100vh - 100rpx);
  107. height: 100vh;
  108. display: flex;
  109. align-items: end;
  110. z-index: 999;
  111. .content{
  112. width: 100%;
  113. background-color: #fff;
  114. padding: 20rpx 25rpx;
  115. border-radius: 20rpx;
  116. .title{
  117. text-align: center;
  118. border-bottom: 1px solid #EEEEEE;
  119. padding-bottom: 20rpx;
  120. margin-bottom: 44rpx;
  121. image{
  122. width:37rpx ;
  123. height: 37rpx;
  124. float: right;
  125. }
  126. }
  127. .rate{
  128. font-weight: 600;
  129. font-size: 30rpx;
  130. margin-bottom: 48rpx;
  131. display: flex;
  132. align-items: center;
  133. }
  134. .tag{
  135. padding-bottom: 42rpx;
  136. border-bottom: 1px solid #EEEEEE;
  137. display: flex;
  138. .item_tag{
  139. width: 140rpx;
  140. height: 52rpx;
  141. border-radius: 4rpx;
  142. border: 1px solid #C2C2C2;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. font-size: 26rpx;
  147. margin-right: 37rpx;
  148. }
  149. .active{
  150. background: rgba(68,154,255,0.1);
  151. border-radius: 4rpx;
  152. border: 1px solid #449AFF;
  153. color: #2983EC;
  154. }
  155. }
  156. .btn{
  157. width: 100%;
  158. height:112rpx ;
  159. padding: 16rpx 24rpx;
  160. .sub{
  161. width: 100%;
  162. height:100%;
  163. background: linear-gradient( 90deg, #77B6FF 0%, #449AFF 100%);
  164. border-radius: 53px;
  165. display: flex;
  166. align-items: center;
  167. justify-content: center;
  168. font-size: 28rpx;
  169. color: #FFFFFF;
  170. }
  171. }
  172. }
  173. }
  174. </style>