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.

75 lines
1.7 KiB

8 months ago
8 months ago
  1. <template>
  2. <view class="technician-select-list">
  3. <mNavbar title="选择技师" :leftClick="leftClick"></mNavbar>
  4. <view class="technician-list">
  5. <selectTechnicianCompoents :technicianList="technicianList" :select="toPayOrder" />
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import mNavbar from '../../components/base/m-navbar.vue'
  11. import selectTechnicianCompoents from "../../components/selectTechnicianCompoents.vue"
  12. export default {
  13. components: {
  14. mNavbar,
  15. selectTechnicianCompoents
  16. },
  17. data() {
  18. return {
  19. queryParams: {
  20. pageNo: 1,
  21. pageSize: 10,
  22. title: ''
  23. },
  24. technicianList: sessionStorage.getItem('technicianList') ? JSON.parse(sessionStorage.getItem(
  25. 'technicianList')) : [],
  26. loading: false,
  27. finished: false
  28. }
  29. },
  30. methods: {
  31. onLoad() {
  32. },
  33. leftClick() {
  34. let { current , active } = this.$route.query
  35. if(current && active > -2){
  36. return uni.reLaunch({
  37. url: `/pages/index/order?active=${active}`
  38. })
  39. }
  40. uni.switchTab({
  41. url: '/pages/index/index'
  42. })
  43. },
  44. toPayOrder(item) {
  45. if (item.bookable != 'Y') {
  46. return uni.showToast({
  47. title: '技师未开启接单',
  48. icon: 'none'
  49. })
  50. }
  51. this.$api('createVipOrder', {
  52. projectId: this.$route.query.serviceId,
  53. technicianId: item.id
  54. }, res => {
  55. if (res.code == 200) {
  56. uni.navigateTo({
  57. url: `/pages/order/payOrder?orderId=${res.result.id}&distance=${item.setKmOpen == 'Y' ? item.setKm : item.km}&setKmOpen=${item.setKmOpen}`
  58. })
  59. }
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. .technician-select-list {
  67. background: #F5F5F5;
  68. min-height: 100vh;
  69. width: 750rpx;
  70. margin: 0rpx auto;
  71. box-sizing: border-box;
  72. }
  73. </style>