shouye.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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"
  6. mode="dot" :dots-styles="dotStyle">
  7. <swiper class="swiper-box" @change="change" autoplay circular interval="5000">
  8. <!-- autoplay circular interval="3000" -->
  9. <swiper-item v-for="(item ,index) in swiperInfo" :key="index">
  10. <img class="index-banner-img" :src="item.pic" @click="gotoKc(item)" />
  11. </swiper-item>
  12. </swiper>
  13. </uni-swiper-dot>
  14. <view class="tj-btn-box">
  15. <text :class="{active: tjBtn == 1}" @click="tjBtnClick(1)">本周</text>
  16. <text :class="{active: tjBtn == 2}" @click="tjBtnClick(2)">本月</text>
  17. <text :class="{active: tjBtn == 0}" @click="tjBtnClick(0)">全部</text>
  18. </view>
  19. <view class="index-tj-row">
  20. <view class="index-tj-box">
  21. <view class="tj-num-box">{{indexInfoData.bzCount}}/{{indexInfoData.jzCount}}</view>
  22. <view class="tj-tip-box">考证人员/家政人员</view>
  23. </view>
  24. <view class="index-kc-box" @click="goToPage('sykc')">
  25. <view class="tj-num-box">{{indexInfoData.kechengCount}}/{{indexInfoData. kechengUsed}}</view>
  26. <view class="tj-tip-box">剩余课程/已售课程</view>
  27. <icon class="sjkc-jt-icon"></icon>
  28. </view>
  29. </view>
  30. <view class="index-tongzhi-box" @click="goToPage('tz')">
  31. <text class="tongzhi-num">{{tzNum}}</text>
  32. <rich-text :nodes="tzContent" class="tongzhi-content"></rich-text>
  33. <icon></icon>
  34. </view>
  35. <view class="card-list-box">
  36. <view class="card-list-title">用户管理</view>
  37. <view @click="goToPage('jz')" class="card-item-box">
  38. <icon class="index-icon jz-icon"></icon>
  39. <text>家政人员</text>
  40. </view>
  41. <!-- 添加子账号权限只有主账号拥有,其他子账号无法查看 -->
  42. <view @click="goToPage('zzh')" class="card-item-box" v-if="auth.type == 2">
  43. <icon class="index-icon zzh-icon"></icon>
  44. <text>创建子账号</text>
  45. </view>
  46. <view @click="goToPage('zjz')" class="card-item-box" v-if="auth.type == 2">
  47. <icon class="index-icon zjz-icon"></icon>
  48. <text>子家政公司</text>
  49. </view>
  50. <view @click="goToPage('zjkh')" class="card-item-box" v-if="auth.type == 2">
  51. <icon class="index-icon jzkh-icon"></icon>
  52. <text>家政客户</text>
  53. </view>
  54. <!-- <view @click="goToPage('demo')" class="card-item-box" v-if="auth.type == 2">
  55. <icon class="index-icon zjz-icon"></icon>
  56. <text>demo</text>
  57. </view> -->
  58. </view>
  59. <view class="card-list-box">
  60. <view class="card-list-title">考务管理</view>
  61. <view @click="goToPage('bz')" class="card-item-box">
  62. <icon class="index-icon kz-icon"></icon>
  63. <text>办证管理</text>
  64. </view>
  65. <view @click="goToPage('ks')" class="card-item-box">
  66. <icon class="index-icon ks-icon"></icon>
  67. <text>考试管理</text>
  68. </view>
  69. <view @click="goToPage('cj')" class="card-item-box">
  70. <icon class="index-icon cj-icon"></icon>
  71. <text>成绩管理</text>
  72. </view>
  73. <view @click="goToPage('kscx')" class="card-item-box">
  74. <icon class="index-icon kscx-icon"></icon>
  75. <text>考试查询</text>
  76. </view>
  77. <view @click="goToPage('lc')" class="card-item-box">
  78. <icon class="index-icon lx-icon"></icon>
  79. <text>练习管理</text>
  80. </view>
  81. <view @click="goToPage('kc')" class="card-item-box">
  82. <icon class="index-icon kc-icon"></icon>
  83. <text>课程管理</text>
  84. </view>
  85. </view>
  86. <view class="card-list-box">
  87. <view class="card-list-title">合同管理</view>
  88. <view @click="goToPage('jzht')" class="card-item-box">
  89. <icon class="index-icon ht-a-icon" v-if="indexInfoData.status === 0"></icon>
  90. <icon class="index-icon ht-sh-icon" v-if="indexInfoData.status === 1"></icon>
  91. <icon class="index-icon ht-icon" v-if="indexInfoData.status != 0 && indexInfoData.status != 1"></icon>
  92. <text>家政合同</text>
  93. </view>
  94. <view @click="goToPage('sfht')" class="card-item-box">
  95. <!-- sfCount待审核数量 -->
  96. <view class="num-icon-box" v-if="indexInfoData.sfCount > 0">{{indexInfoData.sfCount}}</view>
  97. <icon class="index-icon sfht-icon"></icon>
  98. <text>三方合同</text>
  99. </view>
  100. </view>
  101. <view class="card-list-box">
  102. <view class="card-list-title">其他服务</view>
  103. <view @click="goToPage('ycms')" class="card-item-box">
  104. <icon class="index-icon ycms-icon"></icon>
  105. <text>远程面试</text>
  106. </view>
  107. <view @click="goToPage('zyhb')" class="card-item-box">
  108. <icon class="index-icon zyhb-icon"></icon>
  109. <text>职业海报</text>
  110. </view>
  111. </view>
  112. <!-- 页面底端 -->
  113. <customTabbarAdminVue :current-tab="0"></customTabbarAdminVue>
  114. <tip-dialog ref="tipDialogRef" :title="tipTitle" :content="tipContent"></tip-dialog>
  115. <!-- 安卓强制升级 -->
  116. <shengJiDialog ref="tipDialogRef2" :closeFlag='false' :title="tipTitle" @confirm-btn="BanbenConfirmBtn"
  117. :showTip="true" :notClose="true" :content="tipContentAndroid">
  118. </shengJiDialog>
  119. </view>
  120. </template>
  121. <script setup>
  122. import cacheManager from "@/utils/cacheManager.js";
  123. import {
  124. onLoad,
  125. onShow
  126. } from '@dcloudio/uni-app';
  127. import {
  128. reactive,
  129. ref
  130. } from "vue";
  131. import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  132. import {
  133. getAppNoticeList,
  134. getAppNoticeWait,
  135. getGlIndexInfo,
  136. getIndexKechengList
  137. } from '@/api/shouye.js'
  138. import tipDialog from '@/components/dialog/tipDialog.vue';
  139. import config from '../../../config.js'
  140. import * as httpApi from "@/api/login.js"
  141. import shengJiDialog from '@/components/dialog/shengJiDialog.vue';
  142. import {
  143. useVersionUpdate
  144. } from "@/utils/versionUpdate.js";
  145. const version = config.appInfo.version;
  146. const tipDialogRef = ref(null);
  147. const tipTitle = '升级提醒';
  148. const tipContent = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!';
  149. const auth = cacheManager.get('auth');
  150. const tjBtn = ref(1);
  151. const tzNum = ref(0);
  152. const tzContent = ref('');
  153. const searchType = ref('');
  154. const current = ref(0);
  155. const tipContentAndroid = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!'
  156. const tipDialogRef2 = ref(null)
  157. const updateUrl = ref(null)
  158. const {
  159. initDownload
  160. } = useVersionUpdate()
  161. let indexInfoData = reactive({
  162. searchType: 1,
  163. bzCount: 0,
  164. jzCount: 0,
  165. jzName: '',
  166. kechengCount: 0, //剩余课程数量
  167. kechengUsed: 0, //售出课程数量
  168. status:null,// 合同状态:0待签字,1审核中,2生效,3失效
  169. jzHtId:null,
  170. sfCount:null,
  171. });
  172. const swiperInfo = ref([]);
  173. const dotStyle = reactive({
  174. width: '8',
  175. height: '8',
  176. bottom: '-12',
  177. backgroundColor: 'rgba(226,230,236)',
  178. border: '1px rgb(226,230,236) solid',
  179. selectedBackgroundColor: 'rgb(92, 192, 147)',
  180. selectedBorder: '1px rgb(92, 192, 147) solid'
  181. });
  182. const goToExternalPage = () => {
  183. // const externalUrl = 'https://www.baidu.com/'
  184. const externalUrl = 'https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65ff&uid=1145&userName=123456&token=000eJxjYGBQkNwl6RPe+n+pxsfW/3yNTNsT46azfzZTMppyaIvoS6VnpxkYGDhSUjOycsxM0zLjuSb7xF8/kZkQIwoUZ7M0MLAwMAayWAwNTUwZGBlGwZACAEbtGUY='; // 替换为你的 H5 地址
  185. // 使用 encodeURIComponent 防止 URL 中含特殊字符(如 ? & =)
  186. uni.navigateTo({
  187. url: `/pages/admin/webview/index?url=${encodeURIComponent(externalUrl)}`
  188. });
  189. };
  190. function change(e) {
  191. current.value = e.detail.current
  192. }
  193. function gotoKc(item) {
  194. uni.navigateTo({
  195. url: `/pages/admin/Kecheng/study?kcId=${item.kcId}&from=shouye`
  196. })
  197. }
  198. onLoad((options) => {
  199. })
  200. function initPage() {
  201. getKcTg();
  202. getTzNum();
  203. getTzlist();
  204. getIndexInfo();
  205. }
  206. function getKcTg() {
  207. getIndexKechengList({}).then(res => {
  208. swiperInfo.value = res.data.data;
  209. })
  210. }
  211. function getTzNum() {
  212. getAppNoticeWait({}).then(res => {
  213. tzNum.value = res.data;
  214. })
  215. }
  216. function getIndexInfo() {
  217. getGlIndexInfo({
  218. searchType: indexInfoData.searchType
  219. }).then(res => {
  220. indexInfoData.bzCount = res.data.bzCount;
  221. indexInfoData.jzCount = res.data.jzCount;
  222. indexInfoData.jzName = res.data.jzName;
  223. indexInfoData.kechengCount = res.data.kechengCount;
  224. indexInfoData.kechengUsed = res.data.kechengUsed;
  225. indexInfoData.status =res.data.status;
  226. indexInfoData.jzHtId =res.data.jzHtId;
  227. indexInfoData.sfCount = res.data.sfCount;
  228. })
  229. }
  230. function getTzlist() {
  231. const opt = {
  232. page: 1,
  233. size: 10, // 固定查询10条
  234. }
  235. getAppNoticeList(opt).then(res => {
  236. tzContent.value = res.data.data[0].name;
  237. })
  238. }
  239. // 按钮切换
  240. function tjBtnClick(data) {
  241. tjBtn.value = data;
  242. indexInfoData.searchType = data;
  243. getIndexInfo();
  244. }
  245. // 获取用户头像
  246. function goToPage(data) {
  247. switch (data) {
  248. case 'kscx':
  249. uni.redirectTo({
  250. url: '/pages/admin/Kaoshi/checkList'
  251. })
  252. break;
  253. case 'jz':
  254. uni.redirectTo({
  255. url: '/pages/admin/Jiazheng/index'
  256. })
  257. break;
  258. case 'zzh':
  259. uni.redirectTo({
  260. url: '/pages/admin/zizhanghao/list'
  261. })
  262. break;
  263. case 'sykc':
  264. uni.redirectTo({
  265. url: '/pages/admin/yishou/yishou'
  266. })
  267. break;
  268. case 'bz':
  269. uni.redirectTo({
  270. url: '/pages/admin/banzheng/list'
  271. })
  272. break;
  273. case 'ks':
  274. uni.redirectTo({
  275. url: '/pages/admin/Kaoshi/list'
  276. })
  277. break;
  278. case 'cj':
  279. uni.redirectTo({
  280. url: '/pages/admin/Chengji/list'
  281. })
  282. break;
  283. case 'kc':
  284. uni.redirectTo({
  285. url: '/pages/admin/Kecheng/list'
  286. })
  287. break;
  288. case 'tz':
  289. uni.redirectTo({
  290. url: '/pages/admin/tongzhi/list'
  291. })
  292. break;
  293. case 'lc':
  294. uni.redirectTo({
  295. url: '/pages/admin/Lianxi/list'
  296. })
  297. break;
  298. case 'zjz':
  299. uni.redirectTo({
  300. url: '/pages/admin/zijiazheng/index'
  301. })
  302. break;
  303. case 'zjkh':
  304. uni.redirectTo({
  305. url: '/pages/admin/kehu/kehuList'
  306. })
  307. break;
  308. // 家政合同
  309. case 'jzht':
  310. if(indexInfoData.status === 0){
  311. uni.navigateTo({
  312. url: `/pages/admin/Hetong/Hetong?id=${indexInfoData.jzHtId}`
  313. })
  314. }else{
  315. uni.redirectTo({
  316. url: '/pages/admin/Hetong/HetongList'
  317. })
  318. }
  319. break;
  320. case 'sfht':
  321. uni.navigateTo({
  322. url: '/pages/admin/Hetong/sanfangHetong?from=shouye'
  323. })
  324. break;
  325. case 'ycms':
  326. uni.navigateTo({
  327. url: '/pages/admin/mianshi/index'
  328. })
  329. break;
  330. case 'zyhb':
  331. uni.navigateTo({
  332. url: '/pages/admin/haibao/index'
  333. })
  334. break;
  335. case 'demo':
  336. uni.redirectTo({
  337. url: '/pages/demo/demo2'
  338. })
  339. break;
  340. }
  341. }
  342. function BanbenConfirmBtn() {
  343. const systemInfo = uni.getSystemInfoSync();
  344. if (systemInfo.platform == 'ios') {
  345. const appStoreUrl = 'itms-apps://itunes.apple.com/app/6754060756'
  346. plus.runtime.openURL(appStoreUrl)
  347. } else {
  348. initDownload(updateUrl.value)
  349. }
  350. }
  351. function getLoginInit() {
  352. httpApi.getVersion({}).then(res => {
  353. if (version != res.data.version) {
  354. updateUrl.value = res.data.updateUrl
  355. // test 版本相同唤起弹窗
  356. // tipDialogRef2.value.handleShow();
  357. const systemInfo = uni.getSystemInfoSync();
  358. if (systemInfo.platform == 'ios') {
  359. } else {
  360. tipDialogRef2.value.handleShow();
  361. }
  362. }
  363. })
  364. }
  365. onShow(() => {
  366. initPage();
  367. getLoginInit()
  368. })
  369. </script>