chooseServiceTeacher.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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(index)">
  10. <view v-if="item.personId === -1" class="serviceTeacher flex-col justify-center" :class="{selectBack: index == selectIndex}">
  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: index == selectIndex}">
  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="index == selectIndex">
  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. selectIndex:0,
  73. workPersonList: []
  74. }
  75. },
  76. methods: {
  77. submit(){
  78. this.$emit("getWorkPerson",this.workPersonList[this.selectIndex])
  79. this.closePopup()
  80. },
  81. closePopup() {
  82. this.$refs.chooseServiceTeacherPopup.close()
  83. },
  84. selectworkPerson(e){
  85. this.selectIndex = e
  86. },
  87. openPopup() {
  88. this.$refs.chooseServiceTeacherPopup.open()
  89. this.getServicePerson()
  90. },
  91. // 查询服务工作人员列表
  92. getServicePerson() {
  93. this.$api.getServicePerson({
  94. date: this.date,
  95. storeId: this.storeId,
  96. }).then((res) => {
  97. console.log(res)
  98. this.workPersonList = res.data.data;
  99. this.getImgUrlByOssId(res.data.data)
  100. })
  101. },
  102. // 获取图片
  103. getImgUrlByOssId(data) {
  104. for (let i = 0; i < data.length; i++) {
  105. if (data[i].facePhoto) {
  106. this.$api.getImage(data[i].facePhoto).then(res => {
  107. data[i].imgUrl = res.data.data[0].url.replace(/^http:/, "https:")
  108. this.$set(this.workPersonList, i, data[i])
  109. });
  110. }
  111. }
  112. },
  113. }
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .chooseServiceTeacherView {
  118. width: 750rpx;
  119. height: 850rpx;
  120. background: #FFFFFF;
  121. border-radius: 24rpx 24rpx 0rpx 0rpx;
  122. }
  123. .chooseServiceTeacherTitle {
  124. font-size: 32rpx;
  125. font-weight: bold;
  126. color: #333333;
  127. line-height: 44rpx;
  128. margin-left: 34rpx;
  129. padding-top: 26rpx;
  130. }
  131. .scrollY {
  132. width: 686rpx;
  133. height: 604rpx;
  134. margin-left: 32rpx;
  135. margin-top: 32rpx;
  136. }
  137. .serviceTeacherView {
  138. position: relative;
  139. }
  140. .serviceTeacher {
  141. width: 678rpx;
  142. height: 92rpx;
  143. background: #FAFAFA;
  144. border-radius: 8rpx;
  145. border: 4rpx solid #FAFAFA;
  146. position: relative;
  147. }
  148. .teacherName {
  149. padding-right: 26rpx;
  150. font-size: 32rpx;
  151. font-weight: bold;
  152. color: #111111;
  153. margin-left: 24rpx;
  154. }
  155. .teacherName1 {
  156. font-size: 32rpx;
  157. font-weight: bold;
  158. color: #111111;
  159. }
  160. .teacherTag {
  161. padding: 6rpx 24rpx;
  162. background: #FFF6CE;
  163. border-radius: 8rpx;
  164. border: 2rpx solid #FFE05C;
  165. font-size: 20rpx;
  166. font-weight: 400;
  167. color: #333333;
  168. line-height: 32rpx;
  169. margin-left: 16rpx;
  170. }
  171. .teacherMsg {
  172. font-size: 24rpx;
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. color: #999999;
  176. margin-left: 8rpx;
  177. margin-top: 5rpx;
  178. }
  179. .teacherR {
  180. width: 400rpx;
  181. height: 180rpx;
  182. margin-top: 24rpx;
  183. margin-left: 24rpx;
  184. }
  185. .teacherMsg1 {
  186. font-size: 24rpx;
  187. font-family: PingFangSC, PingFang SC;
  188. font-weight: 400;
  189. color: #999999;
  190. line-height: 40rpx;
  191. }
  192. .teacherImg {
  193. width: 180rpx;
  194. height: 180rpx;
  195. border-radius: 8rpx;
  196. margin-top: 22rpx;
  197. margin-left: 22rpx;
  198. }
  199. .serviceTeacher1 {
  200. width: 678rpx;
  201. height: 222rpx;
  202. background: #FAFAFA;
  203. border-radius: 16rpx;
  204. border: 4rpx solid #FAFAFA;
  205. margin-top: 24rpx;
  206. }
  207. .chooseServiceTeacherButton {
  208. width: 686rpx;
  209. height: 80rpx;
  210. margin-left: 32rpx;
  211. margin-top: 32rpx;
  212. }
  213. .chooseServiceTeacherButtonL {
  214. width: 332rpx;
  215. height: 80rpx;
  216. background: #F5F5F5;
  217. border-radius: 54rpx;
  218. text-align: center;
  219. line-height: 80rpx;
  220. font-size: 28rpx;
  221. font-weight: 400;
  222. color: #666666;
  223. }
  224. .chooseServiceTeacherButtonR {
  225. width: 332rpx;
  226. height: 80rpx;
  227. background: #FFE05C;
  228. border-radius: 54rpx;
  229. text-align: center;
  230. line-height: 80rpx;
  231. font-size: 28rpx;
  232. font-weight: 400;
  233. color: #333333;
  234. }
  235. .serobV {
  236. width: 32rpx;
  237. height: 32rpx;
  238. position: absolute;
  239. top: 0;
  240. right: 0;
  241. }
  242. .serobVicon {
  243. width: 32rpx;
  244. height: 32rpx;
  245. }
  246. .selectBack {
  247. background: rgba(255, 224, 92, 0.1);
  248. border: 4rpx solid #FFE05C;
  249. }
  250. </style>