selectService.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="div">
  3. <view class="content">
  4. <view class="type">
  5. <view class="type_item" v-for="(item,index) in selectLocality" :key="item.id" @click="transmitType(item)">
  6. {{item.name}}
  7. </view>
  8. </view>
  9. <view class="btn" @click="cut">
  10. 取消
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'selectService',
  18. data() {
  19. return {
  20. selectLocality: [],
  21. }
  22. },
  23. methods:{
  24. transmitType(item){
  25. this.$emit('transmitType',{id: item.id, name: item.name})
  26. },
  27. cut(){
  28. this.$emit('cutPopup')
  29. },
  30. getClass(){
  31. this.$http.get("/sys/category/childList?pid=" + '1889836358116098050').then(res => {
  32. console.log(res)
  33. if (res.data.success) {
  34. this.selectLocality = res.data.result
  35. }
  36. else {
  37. }
  38. })
  39. }
  40. },
  41. //
  42. mounted() {
  43. this.getClass()
  44. }
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .div {
  49. width: 100vw;
  50. height: 100vh;
  51. background: rgba(0, 0, 0, 0.4);
  52. position: fixed;
  53. top: 0;
  54. left: 0;
  55. display: flex;
  56. align-items: end;
  57. .content {
  58. width: 100%;
  59. border-radius: 20rpx 20rpx 0px 0px;
  60. overflow-y: hidden;
  61. .type {
  62. width: 100%;
  63. height: 455rpx;
  64. margin-bottom: 20rpx;
  65. background-color: #fff;
  66. display: flex;
  67. flex-direction: column;
  68. justify-content: space-between;
  69. .type_item{
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. flex: 1;
  74. }
  75. }
  76. .btn {
  77. width: 100%;
  78. height: 114rpx;
  79. background-color: #fff;
  80. font-weight: 500;
  81. font-size: 32rpx;
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. }
  86. }
  87. }
  88. </style>