shouye.vue 10 KB

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