shouye.vue 9.4 KB

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