index.vue 14 KB

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