湘妃到家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.0 KiB

1 month ago
  1. <template>
  2. <van-popup
  3. v-model:show="showBottom"
  4. round
  5. position="bottom"
  6. @close="close"
  7. :style="{ height: '75%' }"
  8. >
  9. <view class="box">
  10. <view class="title">
  11. {{ title || '选择技师' }}
  12. </view>
  13. <view class="technician-list">
  14. <van-list
  15. v-model:loading="loading"
  16. :finished="finished"
  17. finished-text=""
  18. @load="onLoad"
  19. >
  20. <selectTechnicianCompoents :technicianList="technicianList" :select="select"/>
  21. </van-list>
  22. </view>
  23. </view>
  24. </van-popup>
  25. </template>
  26. <script>
  27. import selectTechnicianCompoents from "../selectTechnicianCompoents.vue"
  28. export default {
  29. components: {
  30. selectTechnicianCompoents
  31. },
  32. name:"selectTechnicianPopup",
  33. props : ['show', 'title'],
  34. data() {
  35. return {
  36. showBottom : false,
  37. i : 0,
  38. queryParams : {
  39. pageNo : 1,
  40. pageSize : 10,
  41. title : ''
  42. },
  43. technicianList : [],
  44. loading : false,
  45. finished : false,
  46. }
  47. },
  48. onShow(){
  49. this.getTechnicianList();
  50. },
  51. methods : {
  52. onLoad(){
  53. this.queryParams.pageSize += 10
  54. this.getTechnicianList()
  55. },
  56. //获取技师列表
  57. getTechnicianList(){
  58. this.$api( "getTechnicianList" , this.queryParams , res => {
  59. if(res.code == 200){
  60. this.technicianList = res.result.records
  61. if(this.queryParams.pageSize > res.result.total){
  62. this.finished = true
  63. }
  64. }
  65. this.loading = false
  66. })
  67. },
  68. select(e){
  69. this.$emit('select', e)
  70. },
  71. close(){
  72. this.$emit('close')
  73. }
  74. },
  75. watch: {
  76. show: {
  77. handler (newValue, oldValue) {
  78. this.showBottom = newValue
  79. },
  80. immediate: true
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .box{
  87. width: 100%;
  88. height: 100%;
  89. background: linear-gradient(#57CAA0, #55B16E);
  90. box-sizing: border-box;
  91. padding: 40rpx;
  92. .title{
  93. font-size: 32rpx;
  94. text-align: center;
  95. color: #fff;
  96. margin-bottom: 40rpx;
  97. }
  98. .technician-list{
  99. overflow: auto;
  100. width: 100%;
  101. height: calc(100% - 45rpx);
  102. }
  103. }
  104. </style>