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.

88 lines
1.9 KiB

8 months ago
8 months ago
8 months ago
8 months ago
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
  6. v-if="loading"
  7. :technicianList="technicianList" :select="toPayOrder" />
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import mNavbar from '../../components/base/m-navbar.vue'
  13. import selectTechnicianCompoents from "../../components/selectTechnicianCompoents.vue"
  14. export default {
  15. components: {
  16. mNavbar,
  17. selectTechnicianCompoents
  18. },
  19. data() {
  20. return {
  21. queryParams: {
  22. pageNo: 1,
  23. pageSize: 10,
  24. title: ''
  25. },
  26. technicianList: [],
  27. loading: false,
  28. finished: false
  29. }
  30. },
  31. onLoad() {
  32. this.getProjectDetail()
  33. },
  34. methods: {
  35. //获取项目详情
  36. getProjectDetail() {
  37. let queryParams = {
  38. id: this.$route.query.serviceId
  39. }
  40. if(this.$store.state.selectArea.id){
  41. queryParams.county = this.$store.state.selectArea.id
  42. }
  43. this.$api('getProjectDetail', queryParams, res => {
  44. this.loading = true
  45. if (res.code == 200) {
  46. this.technicianList = res.result.tenPageList;
  47. }
  48. })
  49. },
  50. leftClick() {
  51. let { current , active } = this.$route.query
  52. if(current && active > -2){
  53. return uni.reLaunch({
  54. url: `/pages/index/order?active=${active}`
  55. })
  56. }
  57. uni.switchTab({
  58. url: '/pages/index/index'
  59. })
  60. },
  61. toPayOrder(item) {
  62. this.$api('createVipOrder', {
  63. projectId: this.$route.query.serviceId,
  64. technicianId: item.id
  65. }, res => {
  66. if (res.code == 200) {
  67. uni.navigateTo({
  68. url: `/pages/order/payOrder?orderId=${res.result.id}&distance=${item.setKmOpen == 'Y' ? item.setKm : item.km}&setKmOpen=${item.setKmOpen}`
  69. })
  70. }
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .technician-select-list {
  78. background: #F5F5F5;
  79. min-height: 100vh;
  80. width: 750rpx;
  81. margin: 0rpx auto;
  82. box-sizing: border-box;
  83. }
  84. </style>