index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="">
  3. <view v-for="(item,index) in workPersonList" @click="chooseServiceTeacher(item)" class="h-item-row">
  4. <view class="h-img">
  5. <image src="../../static/logo.png" mode=""></image>
  6. </view>
  7. <view class="h-item-content">
  8. <view class="h-title">
  9. <view class="name">
  10. <text>{{item.personName}}</text>
  11. </view>
  12. <!-- <view class="btn">
  13. <text>包房</text>
  14. </view> -->
  15. </view>
  16. <view class="h-desc">
  17. <text>优质服务,从我做起</text>
  18. </view>
  19. <view class="h-content">
  20. <u-icon name="thumb-up" color="#333" size="16"></u-icon>
  21. <view class="h-text">
  22. <text>好评率:</text>
  23. </view>
  24. <view class="h-text1">
  25. <text>{{item.goodRate}}%</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. reqParm: {
  37. date: null,
  38. time: null,
  39. storeId: null, // 所属门店
  40. },
  41. workPersonList: []
  42. }
  43. },
  44. onLoad(option) {
  45. this.reqParm.date = option.schedulingDate;
  46. this.reqParm.time = option.time;
  47. this.reqParm.storeId = option.organization;
  48. // 查询服务工作人员列表
  49. // this.serviceWorkPersonList();
  50. this.getServicePerson();
  51. },
  52. methods: {
  53. // 查询服务工作人员列表
  54. serviceWorkPersonList() {
  55. this.$api.serviceWorkPersonList(this.reqParm).then((res) => {
  56. console.log(res)
  57. this.workPersonList = res.data.rows;
  58. this.getImgUrlByOssId(res.data.rows)
  59. }).catch((err) => {
  60. console.log('+++++++++++++err++++++++++++++',err)
  61. uni.showToast({
  62. title: "操作失败"
  63. })
  64. });
  65. },
  66. // 查询服务工作人员列表
  67. getServicePerson() {
  68. this.$api.getServicePerson(this.reqParm).then((res) => {
  69. console.log(res)
  70. this.workPersonList = res.data.data;
  71. this.getImgUrlByOssId(res.data.data)
  72. }).catch((err) => {
  73. console.log('+++++++++++++err++++++++++++++',err)
  74. uni.showToast({
  75. title: "操作失败"
  76. })
  77. });
  78. },
  79. // 获取图片
  80. getImgUrlByOssId(data){
  81. for (let i = 0; i < data.length; i++) {
  82. if (data[i].facePhoto){
  83. this.$api.getImage(data[i].facePhoto).then(res=>{
  84. data[i].imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
  85. });
  86. }
  87. }
  88. },
  89. // 选择服务老师
  90. chooseServiceTeacher(item) {
  91. console.log('+++++++++++++chooseServiceTeacher++++++++++++++',item)
  92. // 选择完成后返回上一页
  93. uni.navigateBack({
  94. delta: 1,
  95. });
  96. uni.$emit('selectedServiceTeacher', item);
  97. }
  98. },
  99. };
  100. </script>
  101. <style scoped lang="scss">
  102. .h-item-row {
  103. display: flex;
  104. font-family: PingFangSC-Medium, PingFang SC;
  105. margin: 12px;
  106. background: #fff;
  107. padding: 12px;
  108. .h-img {
  109. margin-right: 8px;
  110. image {
  111. height: 80px;
  112. width: 80px;
  113. }
  114. }
  115. .h-item-content {
  116. .h-title {
  117. font-size: 16px;
  118. font-weight: 500;
  119. line-height: 30px;
  120. display: flex;
  121. .name {
  122. padding-right: 6px;
  123. color: #111111;
  124. }
  125. .btn text {
  126. background: #fff5d0;
  127. color: #333333;
  128. font-size: 12px;
  129. border: 1px solid #FFE05C;
  130. padding-left: 10px;
  131. padding-right: 10px;
  132. }
  133. }
  134. .h-desc {
  135. font-size: 12px;
  136. font-weight: 400;
  137. color: #999999;
  138. line-height: 25px;
  139. }
  140. .h-content {
  141. display: flex;
  142. align-items: center;
  143. font-size: 12px;
  144. font-weight: 400;
  145. line-height: 25px;
  146. .h-text {
  147. color: #999999;
  148. }
  149. .h-text1 {
  150. color: #ED569F;
  151. }
  152. }
  153. }
  154. }
  155. </style>