shouye.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="admin-shouye-page">
  3. <view class="shouye-head-box">{{indexInfoData.jzName}}</view>
  4. <view class="index-banner-default" v-if="!swiperInfo.length>0"></view>
  5. <uni-swiper-dot v-else class="shouye-swiper-box" :info="swiperInfo" :current="current" field="content" mode="dot" :dots-styles="dotStyle">
  6. <swiper class="swiper-box" @change="change" autoplay circular interval="5000">
  7. <!-- autoplay circular interval="3000" -->
  8. <swiper-item v-for="(item ,index) in swiperInfo" :key="index">
  9. <img class="index-banner-img" :src="item.pic" @click="gotoKc(item)"/>
  10. </swiper-item>
  11. </swiper>
  12. </uni-swiper-dot>
  13. <view class="tj-btn-box">
  14. <text :class="{active: tjBtn == 1}" @click="tjBtnClick(1)">本周</text>
  15. <text :class="{active: tjBtn == 2}" @click="tjBtnClick(2)">本月</text>
  16. <text :class="{active: tjBtn == 0}" @click="tjBtnClick(0)">全部</text>
  17. </view>
  18. <view class="index-tj-row">
  19. <view class="index-tj-box">
  20. <view class="tj-num-box">{{indexInfoData.bzCount}}/{{indexInfoData.jzCount}}</view>
  21. <view class="tj-tip-box">考证人员/家政人员</view>
  22. </view>
  23. <view class="index-tongzhi-box" @click="goToPage('tz')">
  24. <text class="tongzhi-num">{{tzNum}}</text>
  25. <rich-text :nodes="tzContent" class="tongzhi-content"></rich-text>
  26. <icon></icon>
  27. </view>
  28. </view>
  29. <view class="card-list-box">
  30. <view class="card-list-title">管理家政人员</view>
  31. <view @click="goToPage('jz')" class="card-item-box">
  32. <icon class="index-icon jz-icon"></icon>
  33. <text>家政人员</text>
  34. </view>
  35. </view>
  36. <view class="card-list-box">
  37. <view class="card-list-title">管理考证人员</view>
  38. <view @click="goToPage('bz')" class="card-item-box">
  39. <icon class="index-icon kz-icon"></icon>
  40. <text>办证管理</text>
  41. </view>
  42. <view @click="goToPage('ks')" class="card-item-box">
  43. <icon class="index-icon ks-icon"></icon>
  44. <text>考试管理</text>
  45. </view>
  46. <view @click="goToPage('cj')" class="card-item-box">
  47. <icon class="index-icon cj-icon"></icon>
  48. <text>成绩管理</text>
  49. </view>
  50. <view @click="goToPage('lc')" class="card-item-box">
  51. <icon class="index-icon lx-icon"></icon>
  52. <text>练习管理</text>
  53. </view>
  54. <view @click="goToPage('kc')" class="card-item-box">
  55. <icon class="index-icon kc-icon"></icon>
  56. <text>课程管理</text>
  57. </view>
  58. </view>
  59. <!-- 页面底端 -->
  60. <customTabbarAdminVue :current-tab="0"></customTabbarAdminVue>
  61. </view>
  62. </template>
  63. <script setup>
  64. import {onLoad,onShow} from '@dcloudio/uni-app';
  65. import {reactive,ref} from "vue";
  66. import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  67. import {getAppNoticeList,getAppNoticeWait,getGlIndexInfo,getIndexKechengList} from '@/api/shouye.js'
  68. const tjBtn = ref(1);
  69. const tzNum = ref(0);
  70. const tzContent = ref('');
  71. const searchType = ref('');
  72. const current = ref(0);
  73. let indexInfoData = reactive({
  74. searchType:1,
  75. bzCount: 0,
  76. jzCount: 0,
  77. jzName: '',
  78. });
  79. const swiperInfo = ref([]);
  80. const dotStyle = reactive({
  81. width:'8',
  82. height:'8',
  83. bottom:'-12',
  84. backgroundColor: 'rgba(226,230,236)',
  85. border: '1px rgb(226,230,236) solid',
  86. selectedBackgroundColor: 'rgb(92, 192, 147)',
  87. selectedBorder: '1px rgb(92, 192, 147) solid'
  88. });
  89. function change(e) {
  90. current.value = e.detail.current
  91. }
  92. function gotoKc(item){
  93. uni.navigateTo({
  94. url: `/pages/admin/Kecheng/study?kcId=${item.kcId}&from=shouye`
  95. })
  96. }
  97. onLoad((options) => {
  98. initPage();
  99. })
  100. function initPage() {
  101. getKcTg();
  102. getTzNum();
  103. getTzlist();
  104. getIndexInfo();
  105. }
  106. function getKcTg(){
  107. getIndexKechengList({}).then(res => {
  108. swiperInfo.value = res.data.data;
  109. })
  110. }
  111. function getTzNum(){
  112. getAppNoticeWait({}).then(res => {
  113. tzNum.value = res.data;
  114. })
  115. }
  116. function getIndexInfo(){
  117. getGlIndexInfo({searchType:indexInfoData.searchType}).then(res => {
  118. indexInfoData.bzCount = res.data.bzCount;
  119. indexInfoData.jzCount = res.data.jzCount;
  120. indexInfoData.jzName = res.data.jzName;
  121. })
  122. }
  123. function getTzlist(){
  124. const opt = {
  125. page: 1,
  126. size: 10, // 固定查询10条
  127. }
  128. getAppNoticeList(opt).then(res => {
  129. tzContent.value = res.data.data[0].name;
  130. })
  131. }
  132. // 按钮切换
  133. function tjBtnClick(data){
  134. tjBtn.value = data;
  135. indexInfoData.searchType = data;
  136. getIndexInfo();
  137. }
  138. // 获取用户头像
  139. function goToPage(data){
  140. switch (data) {
  141. case 'jz':
  142. uni.redirectTo({
  143. url:'/pages/admin/Jiazheng/index'
  144. })
  145. break;
  146. case 'bz':
  147. uni.redirectTo({
  148. url:'/pages/admin/banzheng/list'
  149. })
  150. break;
  151. case 'ks':
  152. uni.redirectTo({
  153. url:'/pages/admin/Kaoshi/list'
  154. })
  155. break;
  156. case 'cj':
  157. uni.redirectTo({
  158. url:'/pages/admin/Chengji/list'
  159. })
  160. break;
  161. case 'kc':
  162. uni.redirectTo({
  163. url:'/pages/admin/Kecheng/list'
  164. })
  165. break;
  166. case 'tz':
  167. uni.redirectTo({
  168. url:'/pages/admin/tongzhi/list'
  169. })
  170. break;
  171. case 'lc':
  172. uni.redirectTo({
  173. url:'/pages/admin/Lianxi/list'
  174. })
  175. break;
  176. }
  177. }
  178. </script>