shouye.vue 10 KB

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