index.vue 15 KB

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