index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <view class="zxbox">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" :background-color="backgroundColor" :border="false"
  5. statusBar='true' fixed="true">
  6. </uni-nav-bar>
  7. </view>
  8. <image :src="bgimg" class="bgimg"></image>
  9. <view class="mbox">
  10. <view class="infobox flexc" @click="handleToInfo">
  11. <view class="cbox">
  12. <view class="tit">{{name?name:'登录账号'}}</view>
  13. <view class="txt">点击详情 享受更多精彩信息</view>
  14. <!-- <view class="flexc pr" v-if="deptName">
  15. <image :src="headl"></image>
  16. <view class="txt">{{deptName}}点击登录 享受更多精彩信息</view>
  17. <image :src="headr"></image>
  18. </view> -->
  19. </view>
  20. <!-- 登录 -->
  21. <!-- <image v-if="avatar" @click.stop="handleToAvatar" :src="avatar" class="limg" mode="aspectFill"></image>
  22. <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image> -->
  23. <!-- 未登录 -->
  24. <image @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image>
  25. </view>
  26. <view class="conts flexc">
  27. <!-- <view class="contn" v-if="checkPermi(['system:reservat:sh'])" @click="handleToYy">
  28. <view class="img">
  29. <image :src="listimga" class="imga"></image>
  30. </view>
  31. <view class="ctit">待我审批</view>
  32. </view> -->
  33. <view class="contn" v-if="checkPermi(['system:reservat:list'])" @click="handleToYy">
  34. <view class="img">
  35. <image :src="listimgb" class="imgb"></image>
  36. </view>
  37. <view class="ctit">预约管理</view>
  38. </view>
  39. <!-- <view class="contn">
  40. <view class="img">
  41. <image :src="listimgc" class="imgc"></image>
  42. </view>
  43. <view class="ctit">访客管理</view>
  44. </view> -->
  45. </view>
  46. <view class="mbgbox">
  47. <view class="flexc mine_list" @click="getClockjlFn" v-if="checkPermi(['system:info:record:list'])">
  48. <view class="limg">
  49. <image :src="listimgl" class="imga"></image>
  50. </view>
  51. <view class="tit flex1">考勤记录</view>
  52. <image :src="rimg" class="rimg"></image>
  53. </view>
  54. <view class="flexc mine_list" @click="getClockcontFn" v-if="checkPermi(['system:clock:all:month'])">
  55. <view class="limg">
  56. <image :src="listimgm" class="imga"></image>
  57. </view>
  58. <view class="tit flex1">考勤统计</view>
  59. <image :src="rimg" class="rimg"></image>
  60. </view>
  61. <view class="flexc mine_list" @click="getYqMeetFn">
  62. <view class="limg">
  63. <image :src="listimgj" class="imge"></image>
  64. </view>
  65. <view class="tit flex1">在线会议</view>
  66. <image :src="rimg" class="rimg"></image>
  67. </view>
  68. <view class="flexc mine_list" @click="handleToMyhy" v-if="checkPermi(['system:order:list'])">
  69. <view class="limg">
  70. <image :src="listimgd" class="imga"></image>
  71. </view>
  72. <view class="tit flex1">会议预约</view>
  73. <image :src="rimg" class="rimg"></image>
  74. </view>
  75. <view class="flexc mine_list" @click="handleToMyjc" v-if="checkPermi(['system:food:list'])">
  76. <view class="limg">
  77. <image :src="listimge" class="imgb"></image>
  78. </view>
  79. <view class="tit flex1">订餐记录</view>
  80. <image :src="rimg" class="rimg"></image>
  81. </view>
  82. <!-- <view class="flexc mine_list" v-if="checkPermi(['system:reservat:add'])" @click="handleToAddYy" >
  83. <view class="limg">
  84. <image :src="listimgf" class="imgc"></image>
  85. </view>
  86. <view class="tit flex1">访客预约</view>
  87. <image :src="rimg" class="rimg"></image>
  88. </view> -->
  89. <view class="flexc mine_list" @click="handleToKq" v-if="checkPermi(['system:schedule:add'])">
  90. <view class="limg">
  91. <image :src="listimgk" class="imgc"></image>
  92. </view>
  93. <view class="tit flex1">考勤设置</view>
  94. <image :src="rimg" class="rimg"></image>
  95. </view>
  96. <view class="flexc mine_list" @click="handleToSetting">
  97. <view class="limg">
  98. <image :src="listimgg" class="imga"></image>
  99. </view>
  100. <view class="tit flex1">设置</view>
  101. <image :src="rimg" class="rimg"></image>
  102. </view>
  103. <!-- #ifdef APP-PLUS -->
  104. <view class="flexc mine_list"@click="onlineWgt">
  105. <view class="limg">
  106. <image :src="listimgi" class="imga"></image>
  107. </view>
  108. <view class="tit flex1">版本号</view>
  109. <view class="txt">{{wgtcode}}</view>
  110. <image :src="rimg" class="rimg"></image>
  111. </view>
  112. <!-- #endif -->
  113. <view class="flexc mine_list" @click="handleLogout">
  114. <view class="limg">
  115. <image :src="listimgh" class="imgd"></image>
  116. </view>
  117. <view class="tit flex1">退出登录</view>
  118. <image :src="rimg" class="rimg"></image>
  119. </view>
  120. <!-- <view class="flexc mine_list" @click="handleUpassword">
  121. <view class="limg">
  122. <image :src="listimgh" class="imga"></image>
  123. </view>
  124. <view class="tit flex1">修改密码</view>
  125. <image :src="rimg" class="rimg"></image>
  126. </view> -->
  127. </view>
  128. </view>
  129. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  130. <footers v-if="isfootflag" :footerindex="footerindex" :isHomeIndex="false"></footers>
  131. </view>
  132. </template>
  133. <script>
  134. import storage from '@/utils/storage'
  135. import footers from '@/components/footer/footer.vue'
  136. import {findVersion} from "@/api/system/user.js"
  137. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  138. import config from '@/config'
  139. const baseUrl = config.baseUrl
  140. export default {
  141. data() {
  142. return {
  143. bgimg: require("@/static/images/mine/habg.png"),
  144. avatarimg:require("@/static/images/mine/head.png"),
  145. listimga: require('@/static/images/mine/minea.png'),
  146. listimgb: require('@/static/images/mine/mineb.png'),
  147. listimgc: require('@/static/images/mine/minec.png'),
  148. listimgd: require('@/static/images/mine/mined.png'),
  149. listimge: require('@/static/images/mine/minee.png'),
  150. listimgf: require('@/static/images/mine/minef.png'),
  151. listimgg: require('@/static/images/mine/mineg.png'),
  152. listimgh: require('@/static/images/mine/mineh.png'),
  153. listimgi: require('@/static/images/mine/minei.png'),
  154. listimgj: require('@/static/images/mine/minej.png'),
  155. listimgk: require('@/static/images/mine/minek.png'),
  156. listimgl: require('@/static/images/mine/minel.png'),
  157. listimgm: require('@/static/images/mine/minem.png'),
  158. head:require('@/static/images/mine/head.png'),
  159. // wrimg:require("@/static/images/mine/wrimg.png"),
  160. rimg:require("@/static/images/mine/wrimg.png"),
  161. border: false,
  162. backgroundColor: 'transparent',
  163. name: this.$store.state.user.nickName,
  164. deptName:this.$store.state.user.deptName,
  165. // version: getApp().globalData.config.appInfo.version,
  166. footerindex: 'mine',
  167. isfootflag: true,
  168. noticenum: 0,
  169. deptId: this.$store.state.user.deptId,
  170. wgtcode: this.$store.state.user.wgtcode,
  171. platform: 'Android',
  172. nvaHeight:44,
  173. }
  174. },
  175. components: {
  176. footers
  177. },
  178. computed: {
  179. avatar() {
  180. return this.$store.state.user.avatar
  181. },
  182. windowHeight() {
  183. return uni.getSystemInfoSync().windowHeight - 50
  184. }
  185. },
  186. onPageScroll(e) {
  187. // var scrollTop = Number(e.scrollTop);
  188. // var listTop=Number(this.listTop)-Number(this.nvaHeight)
  189. // if (scrollTop <=this.nvaHeight) {
  190. // const opacity = scrollTop / 100 // 计算透明度值
  191. // const color = `rgba(29, 100, 226, ${opacity})`
  192. // this.backgroundColor = color // 更新盒子背景颜色
  193. // } else {
  194. // // this.backgroundColor = '#00A9F0'
  195. // }
  196. },
  197. onLoad() {
  198. var that=this;
  199. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  200. // #ifdef APP-PLUS
  201. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  202. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  203. that.wgtcode=widgetInfo.version
  204. })
  205. });
  206. // #endif
  207. },
  208. mounted() {
  209. },
  210. methods: {
  211. checkPermi,checkRole,
  212. // 待我审批
  213. handleToYy(){
  214. this.$tab.navigateTo("/pages/order/list")
  215. },
  216. //访客预约
  217. handleToAddYy(){
  218. this.$tab.navigateTo("/pages/order/come")
  219. },
  220. //在线会议
  221. getYqMeetFn(){
  222. var url='https://www.baidu.com'
  223. this.$tab.navigateTo("/pages/common/webview/index?url="+url)
  224. },
  225. //我的会议
  226. handleToMyhy(){
  227. this.$tab.navigateTo("/work/pages/yyorder/meetlist")
  228. },
  229. //我的就餐
  230. handleToMyjc(){
  231. this.$tab.navigateTo("/work/pages/yyorder/eatlist")
  232. },
  233. //我的申报
  234. handleToMysb(){
  235. // this.$tab.navigateTo("/work/pages/business/list?from=my&type=0")
  236. },
  237. // 考勤设置
  238. handleToKq(){
  239. this.$tab.navigateTo('/work/pages/clock/kaorules')
  240. },
  241. // 考勤记录
  242. getClockjlFn(){
  243. this.$tab.navigateTo("/work/pages/record/clockin")
  244. },
  245. // 考勤统计
  246. getClockcontFn(){
  247. this.$tab.navigateTo("/work/pages/clock/personnel")
  248. },
  249. // 设置
  250. handleToSetting() {
  251. this.$tab.navigateTo('/pages/mine/setting/index')
  252. },
  253. // 修改密码
  254. handleUpassword(){
  255. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  256. },
  257. // 账号信息
  258. handleToInfo() {
  259. this.$tab.navigateTo('/pages/mine/info/index')
  260. },
  261. handleToLogin() {
  262. this.$tab.reLaunch('/pages/login')
  263. },
  264. handleToAvatar() {
  265. this.$tab.navigateTo('/pages/mine/avatar/index')
  266. },
  267. handleLogout() {
  268. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  269. this.$store.dispatch('LogOut').then(() => {
  270. this.$tab.reLaunch('/pages/index')
  271. })
  272. })
  273. },
  274. onlineWgt() {
  275. let that = this;
  276. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  277. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  278. that.wgtcode=widgetInfo.version
  279. })
  280. that.comparisonVersionNo(widgetInfo.versionCode);
  281. });
  282. // that.comparisonVersionNo()
  283. },
  284. comparisonVersionNo(versionCode) {
  285. let that = this;
  286. // console.log("aaaaaaa===versionCode", versionCode);
  287. const parmas = {
  288. model: that.platform
  289. }
  290. findVersion(parmas).then(res => {
  291. if (res.code == "200") {
  292. let versionNos = res.data.code;
  293. console.log(versionNos, 'versionNos')
  294. // console.log(res.data.path);
  295. let filePath = res.data.path;
  296. if (Number(versionNos) > Number(versionCode)) { //服务器返回1更新,0则不更新
  297. uni.showModal({
  298. title: '提示',
  299. content: '发现新版本,是否升级',
  300. success: function(res) {
  301. // console.log(widgetInfo.version);
  302. if (res.confirm) {
  303. console.log('用户点击确定');
  304. that.getProperty(filePath);
  305. } else if (res.cancel) {
  306. console.log('用户点击取消');
  307. }
  308. }
  309. });
  310. } else {
  311. this.$toast('该版本已是最新版')
  312. }
  313. }
  314. }).catch(error => {
  315. uni.hideLoading()
  316. console.log(error)
  317. })
  318. },
  319. getProperty(getProperty) {
  320. // console.log("bbbbbbbbb----------->", getProperty)
  321. let that = this;
  322. // 在线升级app/热更新
  323. that.showwri = true;
  324. const downloadTask = uni.downloadFile({ //下载文件
  325. url: baseUrl + getProperty,
  326. success: (downloadResult) => {
  327. // console.log(downloadResult);
  328. if (downloadResult.statusCode == 200) {
  329. // 更新升级
  330. plus.runtime.install(downloadResult.tempFilePath, {
  331. force: true
  332. }, function() {
  333. // console.log('install success...');
  334. that.showwri = false;
  335. plus.nativeUI.alert("应用资源更新完成!", function() {
  336. plus.runtime.restart();
  337. });
  338. }, function(e) {
  339. that.showwri = false;
  340. plus.nativeUI.alert("更新失败,请稍后再试");
  341. });
  342. }
  343. }
  344. });
  345. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  346. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  347. that.progress = res.progress; //当前下载比例
  348. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  349. });
  350. },
  351. }
  352. }
  353. </script>
  354. <style lang="scss">
  355. page{background-color: #ffffff;}
  356. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  357. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  358. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  359. image{width: 100%;height: 100%;}
  360. // .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  361. // position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  362. // }
  363. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  364. }
  365. }
  366. .zxbox{
  367. .bgimg{width: 100%;height: 344rpx;}
  368. .mbox{margin-top: -190rpx;padding: 0 34rpx;z-index: 1;position: relative;
  369. .infobox{margin-bottom: 46rpx;padding: 0 20rpx;
  370. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;border: 4rpx solid #ffffff;box-sizing: border-box;}
  371. .cbox{flex: 1;z-index: 1;
  372. image{width: 32rpx;height: 38rpx;}
  373. .tit{font-weight: bold;font-size: 40rpx;color: #161616;margin-bottom: 20rpx;}
  374. .txt{font-weight: bold;font-size: 26rpx;color: #8A9AB5;}
  375. }
  376. }
  377. .conts{border-bottom: 2rpx solid #E6E6E6;;box-sizing: border-box;
  378. .contn{padding: 26rpx 0 44rpx;
  379. display: flex;align-items: center;flex: 0 0 auto;width: 33.3%;flex-direction: column;
  380. .img{width: 52rpx;height: 52rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 16rpx;flex: 0 0 auto;
  381. .imga{width: 48rpx;height: 52rpx;}
  382. .imgb{width: 52rpx;height: 46rpx;}
  383. .imgc{width: 50rpx;height: 52rpx;}
  384. }
  385. .ctit{font-weight: bold;font-size: 26rpx;color: #161616;}
  386. }
  387. }
  388. .mbgbox{width: 100%;margin-bottom: 24rpx;padding-top: 32rpx;
  389. .mine_list{
  390. padding: 28rpx 20rpx;
  391. .limg{flex: 0 0 auto;width: 32rpx;height: 30rpx;margin-right: 22rpx;display: flex;align-items: center;justify-content: center;
  392. .imga{width: 30rpx;height: 30rpx;}
  393. .imgb{width: 22rpx;height: 30rpx;}
  394. .imgc{width: 28rpx;height: 30rpx;}
  395. .imgd{width: 32rpx;height: 26rpx;}
  396. .imge{width: 30rpx;height: 28rpx;}
  397. }
  398. .tit{font-weight: bold;font-size: 26rpx;color: #161616;}
  399. .txt{font-weight: 500;font-size: 26rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  400. .rimg{width: 16rpx;height: 26rpx;margin-left: 20rpx;flex: 0 0 auto;}
  401. }
  402. }
  403. }
  404. }
  405. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  406. </style>