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