shouye.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="admin-shouye-page">
  3. <view class="shouye-head-box">{{indexInfoData.jzName}}</view>
  4. <view class="index-tj-box">
  5. <view class="tj-btn-box">
  6. <text :class="{active: tjBtn == 1}" @click="tjBtnClick(1)">本周</text>
  7. <text :class="{active: tjBtn == 2}" @click="tjBtnClick(2)">本月</text>
  8. <text :class="{active: tjBtn == 0}" @click="tjBtnClick(0)">全部</text>
  9. </view>
  10. <view class="tj-num-box">0/0</view>
  11. <view class="tj-tip-box">考证人员/家政人员</view>
  12. </view>
  13. <view class="index-tongzhi-box" @click="goToPage('tz')">
  14. <text class="tongzhi-num">{{tzNum}}</text>
  15. <rich-text :nodes="tzContent" class="tongzhi-content"></rich-text>
  16. <icon></icon>
  17. </view>
  18. <view class="card-list-box">
  19. <view class="card-list-title">管理家政人员</view>
  20. <view @click="goToPage('jz')" class="card-item-box">
  21. <icon class="index-icon jz-icon"></icon>
  22. <text>家政人员</text>
  23. </view>
  24. </view>
  25. <view class="card-list-box">
  26. <view class="card-list-title">管理考证人员</view>
  27. <view @click="goToPage('bz')" class="card-item-box">
  28. <icon class="index-icon kz-icon"></icon>
  29. <text>办证管理</text>
  30. </view>
  31. <view @click="goToPage('ks')" class="card-item-box">
  32. <icon class="index-icon ks-icon"></icon>
  33. <text>考试管理</text>
  34. </view>
  35. <view @click="goToPage('cj')" class="card-item-box">
  36. <icon class="index-icon cj-icon"></icon>
  37. <text>成绩管理</text>
  38. </view>
  39. <view @click="goToPage('lc')" class="card-item-box">
  40. <icon class="index-icon lx-icon"></icon>
  41. <text>练习管理</text>
  42. </view>
  43. <view @click="goToPage('kc')" class="card-item-box">
  44. <icon class="index-icon kc-icon"></icon>
  45. <text>课程管理</text>
  46. </view>
  47. </view>
  48. <!-- 页面底端 -->
  49. <customTabbarAdminVue :current-tab="0"></customTabbarAdminVue>
  50. </view>
  51. </template>
  52. <script setup>
  53. import {onLoad,onShow} from '@dcloudio/uni-app';
  54. import {reactive,ref} from "vue";
  55. import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  56. import {getAppNoticeList,getAppNoticeWait,getGlIndexInfo} from '@/api/shouye.js'
  57. const tjBtn = ref(1);
  58. const tzNum = ref(0);
  59. const tzContent = ref('');
  60. const searchType = ref('');
  61. let indexInfoData = reactive({
  62. searchType:1,
  63. bzCount: 0,
  64. jzCount: 0,
  65. jzName: '',
  66. });
  67. onLoad((options) => {
  68. initPage();
  69. })
  70. function initPage() {
  71. getTzNum();
  72. getTzlist();
  73. getIndexInfo();
  74. }
  75. function getTzNum(){
  76. getAppNoticeWait({}).then(res => {
  77. tzNum.value = res.data;
  78. })
  79. }
  80. function getIndexInfo(){
  81. getGlIndexInfo({searchType:indexInfoData.searchType}).then(res => {
  82. indexInfoData.bzCount = res.data.bzCount;
  83. indexInfoData.jzCount = res.data.jzCount;
  84. indexInfoData.jzName = res.data.jzName;
  85. })
  86. }
  87. function getTzlist(){
  88. const opt = {
  89. page: 1,
  90. size: 10, // 固定查询10条
  91. }
  92. getAppNoticeList(opt).then(res => {
  93. tzContent.value = res.data.data[0].content;
  94. })
  95. }
  96. // 按钮切换
  97. function tjBtnClick(data){
  98. tjBtn.value = data;
  99. indexInfoData.searchType = data;
  100. getIndexInfo();
  101. }
  102. // 获取用户头像
  103. function goToPage(data){
  104. switch (data) {
  105. case 'jz':
  106. uni.redirectTo({
  107. url:'/pages/admin/Jiazheng/index'
  108. })
  109. break;
  110. case 'bz':
  111. uni.redirectTo({
  112. url:'/pages/admin/banzheng/list'
  113. })
  114. break;
  115. case 'ks':
  116. uni.redirectTo({
  117. url:'/pages/admin/Kaoshi/list'
  118. })
  119. break;
  120. case 'cj':
  121. uni.redirectTo({
  122. url:'/pages/admin/Chengji/list'
  123. })
  124. break;
  125. case 'kc':
  126. uni.redirectTo({
  127. url:'/pages/admin/Kecheng/list'
  128. })
  129. break;
  130. case 'tz':
  131. uni.redirectTo({
  132. url:'/pages/admin/tongzhi/list'
  133. })
  134. break;
  135. case 'lc':
  136. uni.redirectTo({
  137. url:'/pages/admin/Lianxi/list'
  138. })
  139. break;
  140. }
  141. }
  142. </script>