index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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. const webUrl=config.webUrl
  141. export default {
  142. data() {
  143. return {
  144. bgimg: require("@/static/images/mine/habg.png"),
  145. avatarimg:require("@/static/images/mine/head.png"),
  146. listimga: require('@/static/images/mine/minea.png'),
  147. listimgb: require('@/static/images/mine/mineb.png'),
  148. listimgc: require('@/static/images/mine/minec.png'),
  149. listimgd: require('@/static/images/mine/mined.png'),
  150. listimge: require('@/static/images/mine/minee.png'),
  151. listimgf: require('@/static/images/mine/minef.png'),
  152. listimgg: require('@/static/images/mine/mineg.png'),
  153. listimgh: require('@/static/images/mine/mineh.png'),
  154. listimgi: require('@/static/images/mine/minei.png'),
  155. listimgj: require('@/static/images/mine/minej.png'),
  156. listimgk: require('@/static/images/mine/minek.png'),
  157. listimgl: require('@/static/images/mine/minel.png'),
  158. listimgm: require('@/static/images/mine/minem.png'),
  159. head:require('@/static/images/mine/head.png'),
  160. // wrimg:require("@/static/images/mine/wrimg.png"),
  161. rimg:require("@/static/images/mine/wrimg.png"),
  162. border: false,
  163. backgroundColor: 'transparent',
  164. name: this.$store.state.user.nickName,
  165. deptName:this.$store.state.user.deptName,
  166. // version: getApp().globalData.config.appInfo.version,
  167. footerindex: 'mine',
  168. isfootflag: true,
  169. noticenum: 0,
  170. deptId: this.$store.state.user.deptId,
  171. wgtcode: this.$store.state.user.wgtcode,
  172. platform: 'Android',
  173. nvaHeight:44,
  174. }
  175. },
  176. components: {
  177. footers
  178. },
  179. computed: {
  180. avatar() {
  181. return this.$store.state.user.avatar
  182. },
  183. windowHeight() {
  184. return uni.getSystemInfoSync().windowHeight - 50
  185. }
  186. },
  187. onPageScroll(e) {
  188. // var scrollTop = Number(e.scrollTop);
  189. // var listTop=Number(this.listTop)-Number(this.nvaHeight)
  190. // if (scrollTop <=this.nvaHeight) {
  191. // const opacity = scrollTop / 100 // 计算透明度值
  192. // const color = `rgba(29, 100, 226, ${opacity})`
  193. // this.backgroundColor = color // 更新盒子背景颜色
  194. // } else {
  195. // // this.backgroundColor = '#00A9F0'
  196. // }
  197. },
  198. onLoad() {
  199. var that=this;
  200. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  201. // #ifdef APP-PLUS
  202. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  203. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  204. that.wgtcode=widgetInfo.version
  205. })
  206. });
  207. // #endif
  208. },
  209. mounted() {
  210. },
  211. methods: {
  212. checkPermi,checkRole,
  213. // 待我审批
  214. handleToYy(){
  215. this.$tab.navigateTo("/pages/order/list")
  216. },
  217. //访客预约
  218. handleToAddYy(){
  219. this.$tab.navigateTo("/pages/order/come")
  220. },
  221. //在线会议
  222. getYqMeetFn(){
  223. // var url='https://www.baidu.com'
  224. this.$tab.navigateTo("/pages/common/webview/index?url="+webUrl)
  225. },
  226. //我的会议
  227. handleToMyhy(){
  228. this.$tab.navigateTo("/work/pages/yyorder/meetlist")
  229. },
  230. //我的就餐
  231. handleToMyjc(){
  232. this.$tab.navigateTo("/work/pages/yyorder/eatlist")
  233. },
  234. //我的申报
  235. handleToMysb(){
  236. // this.$tab.navigateTo("/work/pages/business/list?from=my&type=0")
  237. },
  238. // 考勤设置
  239. handleToKq(){
  240. this.$tab.navigateTo('/work/pages/clock/kaorules')
  241. },
  242. // 考勤记录
  243. getClockjlFn(){
  244. this.$tab.navigateTo("/work/pages/record/clockin")
  245. },
  246. // 考勤统计
  247. getClockcontFn(){
  248. this.$tab.navigateTo("/work/pages/clock/personnel")
  249. },
  250. // 设置
  251. handleToSetting() {
  252. this.$tab.navigateTo('/pages/mine/setting/index')
  253. },
  254. // 修改密码
  255. handleUpassword(){
  256. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  257. },
  258. // 账号信息
  259. handleToInfo() {
  260. this.$tab.navigateTo('/pages/mine/info/index')
  261. },
  262. handleToLogin() {
  263. this.$tab.reLaunch('/pages/login')
  264. },
  265. handleToAvatar() {
  266. this.$tab.navigateTo('/pages/mine/avatar/index')
  267. },
  268. handleLogout() {
  269. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  270. this.$store.dispatch('LogOut').then(() => {
  271. this.$tab.reLaunch('/pages/index')
  272. })
  273. })
  274. },
  275. onlineWgt() {
  276. let that = this;
  277. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  278. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  279. that.wgtcode=widgetInfo.version
  280. })
  281. that.comparisonVersionNo(widgetInfo.versionCode);
  282. });
  283. // that.comparisonVersionNo()
  284. },
  285. comparisonVersionNo(versionCode) {
  286. let that = this;
  287. // console.log("aaaaaaa===versionCode", versionCode);
  288. const parmas = {
  289. model: that.platform
  290. }
  291. findVersion(parmas).then(res => {
  292. if (res.code == "200") {
  293. let versionNos = res.data.code;
  294. console.log(versionNos, 'versionNos')
  295. // console.log(res.data.path);
  296. let filePath = res.data.path;
  297. if (Number(versionNos) > Number(versionCode)) { //服务器返回1更新,0则不更新
  298. uni.showModal({
  299. title: '提示',
  300. content: '发现新版本,是否升级',
  301. success: function(res) {
  302. // console.log(widgetInfo.version);
  303. if (res.confirm) {
  304. console.log('用户点击确定');
  305. that.getProperty(filePath);
  306. } else if (res.cancel) {
  307. console.log('用户点击取消');
  308. }
  309. }
  310. });
  311. } else {
  312. this.$toast('该版本已是最新版')
  313. }
  314. }
  315. }).catch(error => {
  316. uni.hideLoading()
  317. console.log(error)
  318. })
  319. },
  320. getProperty(getProperty) {
  321. // console.log("bbbbbbbbb----------->", getProperty)
  322. let that = this;
  323. // 在线升级app/热更新
  324. that.showwri = true;
  325. const downloadTask = uni.downloadFile({ //下载文件
  326. url: baseUrl + getProperty,
  327. success: (downloadResult) => {
  328. // console.log(downloadResult);
  329. if (downloadResult.statusCode == 200) {
  330. // 更新升级
  331. plus.runtime.install(downloadResult.tempFilePath, {
  332. force: true
  333. }, function() {
  334. // console.log('install success...');
  335. that.showwri = false;
  336. plus.nativeUI.alert("应用资源更新完成!", function() {
  337. plus.runtime.restart();
  338. });
  339. }, function(e) {
  340. that.showwri = false;
  341. plus.nativeUI.alert("更新失败,请稍后再试");
  342. });
  343. }
  344. }
  345. });
  346. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  347. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  348. that.progress = res.progress; //当前下载比例
  349. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  350. });
  351. },
  352. }
  353. }
  354. </script>
  355. <style lang="scss">
  356. page{background-color: #ffffff;}
  357. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  358. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  359. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  360. image{width: 100%;height: 100%;}
  361. // .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  362. // position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  363. // }
  364. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  365. }
  366. }
  367. .zxbox{
  368. .bgimg{width: 100%;height: 344rpx;}
  369. .mbox{margin-top: -190rpx;padding: 0 34rpx;z-index: 1;position: relative;
  370. .infobox{margin-bottom: 46rpx;padding: 0 20rpx;
  371. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;border: 4rpx solid #ffffff;box-sizing: border-box;}
  372. .cbox{flex: 1;z-index: 1;
  373. image{width: 32rpx;height: 38rpx;}
  374. .tit{font-weight: bold;font-size: 40rpx;color: #161616;margin-bottom: 20rpx;}
  375. .txt{font-weight: bold;font-size: 26rpx;color: #8A9AB5;}
  376. }
  377. }
  378. .conts{border-bottom: 2rpx solid #E6E6E6;;box-sizing: border-box;
  379. .contn{padding: 26rpx 0 44rpx;
  380. display: flex;align-items: center;flex: 0 0 auto;width: 33.3%;flex-direction: column;
  381. .img{width: 52rpx;height: 52rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 16rpx;flex: 0 0 auto;
  382. .imga{width: 48rpx;height: 52rpx;}
  383. .imgb{width: 52rpx;height: 46rpx;}
  384. .imgc{width: 50rpx;height: 52rpx;}
  385. }
  386. .ctit{font-weight: bold;font-size: 26rpx;color: #161616;}
  387. }
  388. }
  389. .mbgbox{width: 100%;margin-bottom: 24rpx;padding-top: 32rpx;
  390. .mine_list{
  391. padding: 28rpx 20rpx;
  392. .limg{flex: 0 0 auto;width: 32rpx;height: 30rpx;margin-right: 22rpx;display: flex;align-items: center;justify-content: center;
  393. .imga{width: 30rpx;height: 30rpx;}
  394. .imgb{width: 22rpx;height: 30rpx;}
  395. .imgc{width: 28rpx;height: 30rpx;}
  396. .imgd{width: 32rpx;height: 26rpx;}
  397. .imge{width: 30rpx;height: 28rpx;}
  398. }
  399. .tit{font-weight: bold;font-size: 26rpx;color: #161616;}
  400. .txt{font-weight: 500;font-size: 26rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  401. .rimg{width: 16rpx;height: 26rpx;margin-left: 20rpx;flex: 0 0 auto;}
  402. }
  403. }
  404. }
  405. }
  406. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  407. </style>