kechengBind.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="admin-jiazheng-page">
  3. <view class="icon-title-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">家政人员</text>
  6. </view>
  7. <v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
  8. class="admin-tab-box"></v-tabs>
  9. <uni-list v-if="current ==1" class="admin-list-box">
  10. <uni-list-item v-for="item in list" class="jz-list-item-box">
  11. <template v-slot:body>
  12. <view @click="lookUserInfo(item)" class="card-body-row">
  13. <view class="card-img-box">
  14. <img :src="item.pic" v-if="item.pic">
  15. <icon class="phone-default-userImg" v-else></icon>
  16. </view>
  17. <view class="body-content-row">
  18. <view class="content-text-row">
  19. <view> {{item.name}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. </uni-list-item>
  25. </uni-list>
  26. <uni-list v-if="current ==2" class="admin-list-box">
  27. <view class="jz-new-btn-box">
  28. <button type="default" class="phone-green-btn" @click="addJiazhengRenyuan">新增人员</button>
  29. </view>
  30. <uni-list-item v-for="item in list" class="jz-list-item-box">
  31. <template v-slot:body>
  32. <view @click="lookUserInfo(item)" class="card-body-row">
  33. <view class="card-img-box">
  34. <img :src="item.pic" v-if="item.pic">
  35. <icon class="phone-default-userImg" v-else></icon>
  36. </view>
  37. <view class="body-content-row">
  38. <view class="content-text-row">
  39. <view> {{item.name}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. </uni-list-item>
  45. </uni-list>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. ref
  51. } from "vue";
  52. import {
  53. kcSelectList
  54. } from "@/api/jiazheng.js";
  55. import commonDialog from '@/components/dialog/commonDialog.vue';
  56. export default {
  57. data() {
  58. return {
  59. kcClassifyId: 0,
  60. id: '',
  61. current: 1,
  62. list:[],
  63. tabs: [{
  64. id: 1,
  65. name: '未绑定课程',
  66. },
  67. {
  68. id: 2,
  69. name: '已绑定课程',
  70. },
  71. ],
  72. }
  73. },
  74. components: {
  75. commonDialog,
  76. },
  77. onLoad(options) {
  78. this.id = options.id
  79. this.getList()
  80. },
  81. methods: {
  82. changeTab(data){
  83. console.log('data',data);
  84. },
  85. goUpPage() {
  86. if (this.pageInfo.from == 'banzheng') {
  87. uni.redirectTo({
  88. url: "/pages/admin/banzheng/list"
  89. })
  90. } else {
  91. uni.redirectTo({
  92. url: "/pages/admin/Jiazheng/index"
  93. })
  94. }
  95. },
  96. getList() {
  97. let req = {
  98. id: this.id,
  99. "kcClassifyId": this.kcClassifyId,
  100. }
  101. kcSelectList(req).then(res => {
  102. if (res.code == 0) {
  103. this.list = res.data
  104. } else {
  105. return false
  106. }
  107. })
  108. },
  109. }
  110. }
  111. </script>