index.vue 15 KB

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