index.vue 13 KB

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