shouye.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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. <shengjiDialogIos ref="tipDialogRef" :showQuxiao="false" :title="tipTitle" :content="tipContent"
  115. @confirm-btn="BanbenConfirmBtn" okBtn="确认"></shengjiDialogIos>
  116. <!-- 安卓强制升级 -->
  117. <shengJiDialog ref="tipDialogRef2" :closeFlag='false' :title="tipTitle" @confirm-btn="BanbenConfirmBtn"
  118. :showTip="true" :notClose="true" :content="tipContentAndroid">
  119. </shengJiDialog>
  120. </view>
  121. </template>
  122. <script setup>
  123. import cacheManager from "@/utils/cacheManager.js";
  124. import {
  125. onLoad,
  126. onShow
  127. } from '@dcloudio/uni-app';
  128. import {
  129. reactive,
  130. ref
  131. } from "vue";
  132. import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  133. import {
  134. getAppNoticeList,
  135. getAppNoticeWait,
  136. getGlIndexInfo,
  137. getIndexKechengList
  138. } from '@/api/shouye.js'
  139. import shengjiDialogIos from '@/components/dialog/shengjiDialogIos.vue';
  140. import config from '../../../config.js'
  141. import * as httpApi from "@/api/login.js"
  142. import shengJiDialog from '@/components/dialog/shengJiDialog.vue';
  143. import {
  144. useVersionUpdate
  145. } from "@/utils/versionUpdate.js";
  146. const version = config.appInfo.version;
  147. const tipDialogRef = ref(null);
  148. const tipTitle = '升级提醒';
  149. const tipContent = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!';
  150. const auth = cacheManager.get('auth');
  151. const tjBtn = ref(1);
  152. const tzNum = ref(0);
  153. const tzContent = ref('');
  154. const searchType = ref('');
  155. const current = ref(0);
  156. const tipContentAndroid = '您的APP不是最新版本,部分功能不能使用,请升级至最新版本!'
  157. const tipDialogRef2 = ref(null)
  158. const updateUrl = ref(null)
  159. const {
  160. initDownload
  161. } = useVersionUpdate()
  162. let indexInfoData = reactive({
  163. searchType: 1,
  164. bzCount: 0,
  165. jzCount: 0,
  166. jzName: '',
  167. kechengCount: 0, //剩余课程数量
  168. kechengUsed: 0, //售出课程数量
  169. status: null, // 合同状态:0待签字,1审核中,2生效,3失效
  170. jzHtId: null,
  171. sfCount: null,
  172. });
  173. const swiperInfo = ref([]);
  174. const dotStyle = reactive({
  175. width: '8',
  176. height: '8',
  177. bottom: '-12',
  178. backgroundColor: 'rgba(226,230,236)',
  179. border: '1px rgb(226,230,236) solid',
  180. selectedBackgroundColor: 'rgb(92, 192, 147)',
  181. selectedBorder: '1px rgb(92, 192, 147) solid'
  182. });
  183. const goToExternalPage = () => {
  184. // const externalUrl = 'https://www.baidu.com/'
  185. const externalUrl =
  186. 'https://kf2.mtavip.com/aliyunZhibo/index.html?roomId=900803&appId=dehjl65ff&uid=1145&userName=123456&token=000eJxjYGBQkNwl6RPe+n+pxsfW/3yNTNsT46azfzZTMppyaIvoS6VnpxkYGDhSUjOycsxM0zLjuSb7xF8/kZkQIwoUZ7M0MLAwMAayWAwNTUwZGBlGwZACAEbtGUY='; // 替换为你的 H5 地址
  187. // 使用 encodeURIComponent 防止 URL 中含特殊字符(如 ? & =)
  188. uni.navigateTo({
  189. url: `/pages/admin/webview/index?url=${encodeURIComponent(externalUrl)}`
  190. });
  191. };
  192. function change(e) {
  193. current.value = e.detail.current
  194. }
  195. function gotoKc(item) {
  196. uni.navigateTo({
  197. url: `/pages/admin/Kecheng/study?kcId=${item.kcId}&from=shouye`
  198. })
  199. }
  200. onLoad((options) => {
  201. })
  202. function initPage() {
  203. getKcTg();
  204. getTzNum();
  205. getTzlist();
  206. getIndexInfo();
  207. }
  208. function getKcTg() {
  209. getIndexKechengList({}).then(res => {
  210. swiperInfo.value = res.data.data;
  211. })
  212. }
  213. function getTzNum() {
  214. getAppNoticeWait({}).then(res => {
  215. tzNum.value = res.data;
  216. })
  217. }
  218. function getIndexInfo() {
  219. getGlIndexInfo({
  220. searchType: indexInfoData.searchType
  221. }).then(res => {
  222. indexInfoData.bzCount = res.data.bzCount;
  223. indexInfoData.jzCount = res.data.jzCount;
  224. indexInfoData.jzName = res.data.jzName;
  225. indexInfoData.kechengCount = res.data.kechengCount;
  226. indexInfoData.kechengUsed = res.data.kechengUsed;
  227. indexInfoData.status = res.data.status;
  228. indexInfoData.jzHtId = res.data.jzHtId;
  229. indexInfoData.sfCount = res.data.sfCount;
  230. })
  231. }
  232. function getTzlist() {
  233. const opt = {
  234. page: 1,
  235. size: 10, // 固定查询10条
  236. }
  237. getAppNoticeList(opt).then(res => {
  238. tzContent.value = res.data.data[0].name;
  239. })
  240. }
  241. // 按钮切换
  242. function tjBtnClick(data) {
  243. tjBtn.value = data;
  244. indexInfoData.searchType = data;
  245. getIndexInfo();
  246. }
  247. // 获取用户头像
  248. function goToPage(data) {
  249. switch (data) {
  250. case 'kscx':
  251. uni.redirectTo({
  252. url: '/pages/admin/Kaoshi/checkList'
  253. })
  254. break;
  255. case 'jz':
  256. uni.redirectTo({
  257. url: '/pages/admin/Jiazheng/index'
  258. })
  259. break;
  260. case 'zzh':
  261. uni.redirectTo({
  262. url: '/pages/admin/zizhanghao/list'
  263. })
  264. break;
  265. case 'sykc':
  266. uni.redirectTo({
  267. url: '/pages/admin/yishou/yishou'
  268. })
  269. break;
  270. case 'bz':
  271. uni.redirectTo({
  272. url: '/pages/admin/banzheng/list'
  273. })
  274. break;
  275. case 'ks':
  276. uni.redirectTo({
  277. url: '/pages/admin/Kaoshi/list'
  278. })
  279. break;
  280. case 'cj':
  281. uni.redirectTo({
  282. url: '/pages/admin/Chengji/list'
  283. })
  284. break;
  285. case 'kc':
  286. uni.redirectTo({
  287. url: '/pages/admin/Kecheng/list'
  288. })
  289. break;
  290. case 'tz':
  291. uni.redirectTo({
  292. url: '/pages/admin/tongzhi/list'
  293. })
  294. break;
  295. case 'lc':
  296. uni.redirectTo({
  297. url: '/pages/admin/Lianxi/list'
  298. })
  299. break;
  300. case 'zjz':
  301. uni.redirectTo({
  302. url: '/pages/admin/zijiazheng/index'
  303. })
  304. break;
  305. case 'zjkh':
  306. uni.redirectTo({
  307. url: '/pages/admin/kehu/kehuList'
  308. })
  309. break;
  310. // 家政合同
  311. case 'jzht':
  312. if (indexInfoData.status === 0) {
  313. uni.navigateTo({
  314. url: `/pages/admin/Hetong/Hetong?id=${indexInfoData.jzHtId}`
  315. })
  316. } else {
  317. uni.redirectTo({
  318. url: '/pages/admin/Hetong/HetongList'
  319. })
  320. }
  321. break;
  322. case 'sfht':
  323. uni.navigateTo({
  324. url: '/pages/admin/Hetong/sanfangHetong?from=shouye'
  325. })
  326. break;
  327. case 'ycms':
  328. uni.navigateTo({
  329. url: '/pages/admin/mianshi/index'
  330. })
  331. break;
  332. case 'zyhb':
  333. uni.navigateTo({
  334. url: '/pages/admin/haibao/index'
  335. })
  336. break;
  337. case 'demo':
  338. uni.redirectTo({
  339. url: '/pages/demo/demo2'
  340. })
  341. break;
  342. }
  343. }
  344. function BanbenConfirmBtn() {
  345. const systemInfo = uni.getSystemInfoSync();
  346. if (systemInfo.platform == 'ios') {
  347. const appStoreUrl = 'itms-apps://itunes.apple.com/app/6754060756'
  348. plus.runtime.openURL(appStoreUrl)
  349. } else {
  350. initDownload(updateUrl.value)
  351. }
  352. }
  353. function getLoginInit() {
  354. httpApi.getVersion({}).then(res => {
  355. if (version != res.data.version) {
  356. updateUrl.value = res.data.updateUrl
  357. // test 版本相同唤起弹窗
  358. // tipDialogRef2.value.handleShow();
  359. const systemInfo = uni.getSystemInfoSync();
  360. if (systemInfo.platform == 'ios') {
  361. tipDialogRef.value.handleShow();
  362. } else {
  363. tipDialogRef2.value.handleShow();
  364. }
  365. }
  366. })
  367. }
  368. onShow(() => {
  369. initPage();
  370. getLoginInit()
  371. })
  372. </script>