chooseServiceTeacher.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view>
  3. <uni-popup ref="chooseServiceTeacherPopup" :catchtouchmove="true" type="bottom">
  4. <view class="chooseServiceTeacherView">
  5. <view class="chooseServiceTeacherTitle">
  6. <text>选择服务人员</text>
  7. </view>
  8. <scroll-view class="scrollY" scroll-y>
  9. <view class="serviceTeacherView" v-for="(item,index) in workPersonList" @click="selectworkPerson(item,index)">
  10. <view v-if="item.personId === -1" class="serviceTeacher flex-col justify-center" :class="{selectBack: item.personId == serviceUserId}">
  11. <view class="flex-row">
  12. <text class="teacherName">{{item.personName}} </text>
  13. <u-icon name="rmb-circle" color="#666666"></u-icon>
  14. <text class="teacherMsg">预约费用:{{item.fee}}</text>
  15. </view>
  16. </view>
  17. <view v-else class="serviceTeacher1 flex-row" :class="{selectBack: item.personId == serviceUserId}">
  18. <image class="teacherImg" src="/static/order/nvren.png"></image>
  19. <view class="flex-col justify-around teacherR ">
  20. <view class="flex-row">
  21. <text class="teacherName1">{{item.personName}}</text>
  22. <text class="teacherTag">造型总监</text>
  23. </view>
  24. <view>
  25. <text class="teacherMsg1">优质服务,从我做起</text>
  26. </view>
  27. <view class="flex-row ">
  28. <view :style="{'marginTop':'7rpx'}">
  29. <u-icon name="rmb-circle" color="#666666"></u-icon>
  30. </view>
  31. <text class="teacherMsg">预约费用:</text>
  32. <text class="teacherMsg" :style="{'color':'#ED569F'}">{{item.fee}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="serobV" v-if="item.personId == serviceUserId">
  37. <image class="serobVicon" src="/static/order/ud20.png"></image>
  38. </view>
  39. </view>
  40. </scroll-view>
  41. <view class="flex-row justify-between chooseServiceTeacherButton">
  42. <view class="chooseServiceTeacherButtonL" @click="closePopup">
  43. <text>取消</text>
  44. </view>
  45. <view class="chooseServiceTeacherButtonR" @click="submit">
  46. <text>确定</text>
  47. </view>
  48. </view>
  49. </view>
  50. </uni-popup>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. name: 'chooseServiceTeacher',
  56. props: {
  57. storeId: {
  58. type: String,
  59. default () {
  60. return ''
  61. }
  62. },
  63. date: {
  64. type: String,
  65. default () {
  66. return ''
  67. }
  68. }
  69. },
  70. data() {
  71. return {
  72. serviceUserId:'',
  73. selectIndex:'',
  74. workPersonList: []
  75. }
  76. },
  77. methods: {
  78. submit(){
  79. this.$emit("getWorkPerson",this.workPersonList[this.selectIndex])
  80. this.closePopup()
  81. },
  82. closePopup() {
  83. this.$refs.chooseServiceTeacherPopup.close()
  84. },
  85. selectworkPerson(e,index){
  86. this.serviceUserId = e.personId
  87. this.selectIndex = index
  88. },
  89. openPopup(serviceUserId) {
  90. this.serviceUserId = serviceUserId
  91. this.$refs.chooseServiceTeacherPopup.open()
  92. this.getServicePerson()
  93. },
  94. // 查询服务工作人员列表
  95. getServicePerson() {
  96. this.$api.getServicePerson({
  97. date: this.date,
  98. storeId: this.storeId,
  99. }).then((res) => {
  100. console.log(res)
  101. this.workPersonList = res.data.data;
  102. this.getImgUrlByOssId(res.data.data)
  103. })
  104. },
  105. // 获取图片
  106. getImgUrlByOssId(data) {
  107. for (let i = 0; i < data.length; i++) {
  108. if (data[i].facePhoto) {
  109. this.$api.getImage(data[i].facePhoto).then(res => {
  110. data[i].imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
  111. this.$set(this.workPersonList, i, data[i])
  112. });
  113. }
  114. }
  115. },
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .chooseServiceTeacherView {
  121. width: 750rpx;
  122. height: 850rpx;
  123. background: #FFFFFF;
  124. border-radius: 24rpx 24rpx 0rpx 0rpx;
  125. }
  126. .chooseServiceTeacherTitle {
  127. font-size: 32rpx;
  128. font-weight: bold;
  129. color: #333333;
  130. line-height: 44rpx;
  131. margin-left: 34rpx;
  132. padding-top: 26rpx;
  133. }
  134. .scrollY {
  135. width: 686rpx;
  136. height: 604rpx;
  137. margin-left: 32rpx;
  138. margin-top: 32rpx;
  139. }
  140. .serviceTeacherView {
  141. position: relative;
  142. }
  143. .serviceTeacher {
  144. width: 678rpx;
  145. height: 92rpx;
  146. background: #FAFAFA;
  147. border-radius: 8rpx;
  148. border: 4rpx solid #FAFAFA;
  149. position: relative;
  150. }
  151. .teacherName {
  152. padding-right: 26rpx;
  153. font-size: 32rpx;
  154. font-weight: bold;
  155. color: #111111;
  156. margin-left: 24rpx;
  157. }
  158. .teacherName1 {
  159. font-size: 32rpx;
  160. font-weight: bold;
  161. color: #111111;
  162. }
  163. .teacherTag {
  164. padding: 6rpx 24rpx;
  165. background: #FFF6CE;
  166. border-radius: 8rpx;
  167. border: 2rpx solid #FFE05C;
  168. font-size: 20rpx;
  169. font-weight: 400;
  170. color: #333333;
  171. line-height: 32rpx;
  172. margin-left: 16rpx;
  173. }
  174. .teacherMsg {
  175. font-size: 24rpx;
  176. font-family: PingFangSC, PingFang SC;
  177. font-weight: 400;
  178. color: #999999;
  179. margin-left: 8rpx;
  180. margin-top: 5rpx;
  181. }
  182. .teacherR {
  183. width: 400rpx;
  184. height: 180rpx;
  185. margin-top: 24rpx;
  186. margin-left: 24rpx;
  187. }
  188. .teacherMsg1 {
  189. font-size: 24rpx;
  190. font-family: PingFangSC, PingFang SC;
  191. font-weight: 400;
  192. color: #999999;
  193. line-height: 40rpx;
  194. }
  195. .teacherImg {
  196. width: 180rpx;
  197. height: 180rpx;
  198. border-radius: 8rpx;
  199. margin-top: 22rpx;
  200. margin-left: 22rpx;
  201. }
  202. .serviceTeacher1 {
  203. width: 678rpx;
  204. height: 222rpx;
  205. background: #FAFAFA;
  206. border-radius: 16rpx;
  207. border: 4rpx solid #FAFAFA;
  208. margin-top: 24rpx;
  209. }
  210. .chooseServiceTeacherButton {
  211. width: 686rpx;
  212. height: 80rpx;
  213. margin-left: 32rpx;
  214. margin-top: 32rpx;
  215. }
  216. .chooseServiceTeacherButtonL {
  217. width: 332rpx;
  218. height: 80rpx;
  219. background: #F5F5F5;
  220. border-radius: 54rpx;
  221. text-align: center;
  222. line-height: 80rpx;
  223. font-size: 28rpx;
  224. font-weight: 400;
  225. color: #666666;
  226. }
  227. .chooseServiceTeacherButtonR {
  228. width: 332rpx;
  229. height: 80rpx;
  230. background: #FFE05C;
  231. border-radius: 54rpx;
  232. text-align: center;
  233. line-height: 80rpx;
  234. font-size: 28rpx;
  235. font-weight: 400;
  236. color: #333333;
  237. }
  238. .serobV {
  239. width: 32rpx;
  240. height: 32rpx;
  241. position: absolute;
  242. top: 0;
  243. right: 0;
  244. }
  245. .serobVicon {
  246. width: 32rpx;
  247. height: 32rpx;
  248. }
  249. .selectBack {
  250. background: rgba(255, 224, 92, 0.1);
  251. border: 4rpx solid #FFE05C;
  252. box-sizing:border-box
  253. }
  254. </style>