index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <view class="zxbox">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" @clickRight="getNewsFn" :background-color="backgroundColor" :border="false"
  5. statusBar='true' fixed="true">
  6. <block slot="right">
  7. <view class="topr">
  8. <image :src="noticimg"></image>
  9. <view class="cir"></view>
  10. </view>
  11. </block>
  12. </uni-nav-bar>
  13. </view>
  14. <image :src="bgimg" class="bgimg"></image>
  15. <view class="mbox">
  16. <view class="infobox flexc" @click="handleToInfo">
  17. <image v-if="avatar" @click.stop="handleToAvatar" :src="avatar" class="limg" mode="aspectFill"></image>
  18. <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image>
  19. <view class="cbox">
  20. <view class="tit">{{name?name:'登录账号'}}</view>
  21. <view class="txt">Hi,欢迎登陆潜山智慧政协平台</view>
  22. </view>
  23. <image :src="wrimg" class="rimg"></image>
  24. </view>
  25. <!-- <view class="conts flexcj">
  26. <view class="clist">
  27. <image :src="mconta"></image>
  28. <view class="num">31</view>
  29. <view class="tit">审查中<text>/件</text></view>
  30. </view>
  31. <view class="clist">
  32. <image :src="mcontb"></image>
  33. <view class="num">31</view>
  34. <view class="tit">交办中<text>/件</text></view>
  35. </view>
  36. <view class="clist">
  37. <image :src="mcontc"></image>
  38. <view class="num">31</view>
  39. <view class="tit">办理中<text>/件</text></view>
  40. </view>
  41. <view class="clist">
  42. <image :src="mcontd"></image>
  43. <view class="num">31</view>
  44. <view class="tit">办结中<text>/件</text></view>
  45. </view>
  46. </view> -->
  47. <view class="mbgbox">
  48. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['projectV2:sbbzb:add'])">
  49. <view class="limg">
  50. <image :src="listimga" class="imga"></image>
  51. </view>
  52. <view class="tit flex1">发布通知</view>
  53. <image :src="rimg" class="rimg"></image>
  54. </view>
  55. <view class="flexc mine_list" @click="handleToAddhy" v-if="checkPermi(['zxConference:conference:add'])">
  56. <view class="limg">
  57. <image :src="listimgb" class="imgb"></image>
  58. </view>
  59. <view class="tit flex1">创建会议</view>
  60. <image :src="rimg" class="rimg"></image>
  61. </view>
  62. </view>
  63. <view class="mbgbox">
  64. <view class="flexc mine_list" @click="handleToAddzx" v-if="checkPermi(['proposalInfo:info:list'])">
  65. <view class="limg">
  66. <image :src="listimgc" class="imgc"></image>
  67. </view>
  68. <view class="tit flex1">政协提案</view>
  69. <image :src="rimg" class="rimg"></image>
  70. </view>
  71. <view class="flexc mine_list" @click="handleToAddsqmy" v-if="checkPermi(['sqmyInfo:info:list'])">
  72. <view class="limg">
  73. <image :src="listimgd" class="imgc"></image>
  74. </view>
  75. <view class="tit flex1">社情民意</view>
  76. <image :src="rimg" class="rimg"></image>
  77. </view>
  78. <view class="flexc mine_list" @click="handleToAddlz" v-if="checkPermi(['member:info:list'])">
  79. <view class="limg">
  80. <image :src="listimge" class="imgc"></image>
  81. </view>
  82. <view class="tit flex1">履职信息</view>
  83. <image :src="rimg" class="rimg"></image>
  84. </view>
  85. <view class="flexc mine_list" @click="handleTohy" v-if="checkPermi(['zxConference:conference:list'])">
  86. <view class="limg">
  87. <image :src="listimgf" class="imgc"></image>
  88. </view>
  89. <view class="tit flex1">会议活动</view>
  90. <image :src="rimg" class="rimg"></image>
  91. </view>
  92. <!-- <view class="flexc mine_list" @click="handleTotabl" v-if="checkPermi(['proposalInfo:info:unitList','sqmyInfo:info:unitList'])">
  93. <view class="limg">
  94. <image :src="listimgf" class="imgc"></image>
  95. </view>
  96. <view class="tit flex1">提案办理</view>
  97. <image :src="rimg" class="rimg"></image>
  98. </view>
  99. <view class="flexc mine_list" @click="handleTocu" v-if="checkPermi(['zxUrge:urge:list'])">
  100. <view class="limg">
  101. <image :src="listimgf" class="imgc"></image>
  102. </view>
  103. <view class="tit flex1">催办列表</view>
  104. <image :src="rimg" class="rimg"></image>
  105. </view> -->
  106. </view>
  107. <view class="mbgbox">
  108. <view class="flexc mine_list" @click="handleUpassword">
  109. <view class="limg">
  110. <image :src="listimgg" class="imgc"></image>
  111. </view>
  112. <view class="tit flex1">修改密码</view>
  113. <image :src="rimg" class="rimg"></image>
  114. </view>
  115. <view class="flexc mine_list"@click="onlineWgt">
  116. <view class="limg">
  117. <image :src="listimgh" class="imgc"></image>
  118. </view>
  119. <view class="tit flex1">版本号</view>
  120. <view class="txt">{{wgtcode}}</view>
  121. </view>
  122. <view class="flexc mine_list" @click="handleLogout">
  123. <view class="limg">
  124. <image :src="listimgi" class="imgc"></image>
  125. </view>
  126. <view class="tit flex1">退出登录</view>
  127. <image :src="rimg" class="rimg"></image>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  132. <!-- <view class="header-section" style="display: none;">
  133. <view class="flex padding justify-between">
  134. <view class="flex align-center">
  135. <view v-if="!avatar" class="cu-avatar xl round bg-white">
  136. <view class="iconfont icon-people text-gray icon"></view>
  137. </view>
  138. <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
  139. </image>
  140. <view v-if="!name" @click="handleToLogin" class="login-tip">
  141. 点击登录
  142. </view>
  143. <view v-if="name" @click="handleToInfo" class="user-info">
  144. <view class="u_title">
  145. 用户名:{{ name }}
  146. </view>
  147. </view>
  148. </view>
  149. <view @click="handleToInfo" class="flex align-center">
  150. <text>个人信息</text>
  151. <view class="iconfont icon-right"></view>
  152. </view>
  153. </view>
  154. </view> -->
  155. <!-- <view class="content-section" style="display: none;">
  156. <view class="mine-actions grid col-4 text-center">
  157. <view class="action-item" @click="handleJiaoLiuQun">
  158. <view class="iconfont icon-friendfill text-pink icon"></view>
  159. <text class="text">交流群</text>
  160. </view>
  161. <view class="action-item" @click="handleBuilding">
  162. <view class="iconfont icon-service text-blue icon"></view>
  163. <text class="text">在线客服</text>
  164. </view>
  165. <view class="action-item" @click="handleBuilding">
  166. <view class="iconfont icon-community text-mauve icon"></view>
  167. <text class="text">反馈社区</text>
  168. </view>
  169. <view class="action-item" @click="handleBuilding">
  170. <view class="iconfont icon-dianzan text-green icon"></view>
  171. <text class="text">点赞我们</text>
  172. </view>
  173. </view>
  174. </view> -->
  175. <!-- <view class="flex0"></view> -->
  176. <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked"
  177. :color_nochecked="color_nochecked" :isHomeIndex="false"></footers>
  178. </view>
  179. </template>
  180. <script>
  181. import storage from '@/utils/storage'
  182. import footers from '@/components/footer/footer.vue'
  183. // import {getNoticenumber} from "@/api/work/index.js"
  184. import {updateUserProfile,findVersion} from "@/api/system/user.js"
  185. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  186. import config from '@/config'
  187. const baseUrl = config.baseUrl
  188. export default {
  189. data() {
  190. return {
  191. bgimg: require("@/static/images/bg.png"),
  192. avatarimg:require("@/static/images/mine/header.png"),
  193. noticimg: require("@/static/images/home/notice.png"),
  194. mconta:require("@/static/images/mine/mconta.png"),
  195. mcontb:require("@/static/images/mine/mcontb.png"),
  196. mcontc:require("@/static/images/mine/mcontc.png"),
  197. mcontd:require("@/static/images/mine/mcontd.png"),
  198. listimga: require('@/static/images/mine/minea.png'),
  199. listimgb: require('@/static/images/mine/mineb.png'),
  200. listimgc: require('@/static/images/mine/minec.png'),
  201. listimgd: require('@/static/images/mine/mined.png'),
  202. listimge: require('@/static/images/mine/minee.png'),
  203. listimgf: require('@/static/images/mine/minef.png'),
  204. listimgg: require('@/static/images/mine/mineg.png'),
  205. listimgh: require('@/static/images/mine/mineh.png'),
  206. listimgi: require('@/static/images/mine/minei.png'),
  207. rimg:require("@/static/images/mine/rimg.png"),
  208. wrimg:require("@/static/images/mine/wrimgs.png"),
  209. border: false,
  210. backgroundColor: 'transparent',
  211. name: this.$store.state.user.name,
  212. // version: getApp().globalData.config.appInfo.version,
  213. footlist: [{
  214. module: 'home',
  215. title: '潜山政协',
  216. icon_checked: require('@/static/images/tabbar/home_.png'),
  217. icon_nochecked: require('@/static/images/tabbar/home.png')
  218. },
  219. {
  220. module: 'report',
  221. title: '履职报告',
  222. icon_checked: require('@/static/images/tabbar/report_.png'),
  223. icon_nochecked: require('@/static/images/tabbar/report.png')
  224. },
  225. {
  226. module: 'notice',
  227. title: '会议通知',
  228. icon_checked: require('@/static/images/tabbar/notice_.png'),
  229. icon_nochecked: require('@/static/images/tabbar/notice.png')
  230. },
  231. {
  232. module: 'mine',
  233. title: '个人中心',
  234. icon_checked: require('@/static/images/tabbar/mine_.png'),
  235. icon_nochecked: require('@/static/images/tabbar/mine.png')
  236. },
  237. ],
  238. color_checked: '222327',
  239. color_nochecked: 'AAAAAA',
  240. footerindex: 'mine',
  241. isfootflag: true,
  242. noticenum: 0,
  243. deptId: this.$store.state.user.deptId,
  244. wgtcode: this.$store.state.user.wgtcode,
  245. platform: 'Android',
  246. nvaHeight:44,
  247. }
  248. },
  249. components: {
  250. footers
  251. },
  252. computed: {
  253. avatar() {
  254. return this.$store.state.user.avatar
  255. },
  256. windowHeight() {
  257. return uni.getSystemInfoSync().windowHeight - 50
  258. }
  259. },
  260. onPageScroll(e) {
  261. var scrollTop = Number(e.scrollTop);
  262. var listTop=Number(this.listTop)-Number(this.nvaHeight)
  263. if (scrollTop <=this.nvaHeight) {
  264. const opacity = scrollTop / 100 // 计算透明度值
  265. const color = `rgba(29, 100, 226, ${opacity})`
  266. this.backgroundColor = color // 更新盒子背景颜色
  267. } else {
  268. this.backgroundColor = '#1D64E2'
  269. }
  270. // if(scrollTop>listTop){
  271. // this.fixedflag=true
  272. // }else{
  273. // this.fixedflag=false
  274. // }
  275. },
  276. onLoad() {
  277. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  278. if (checkPermi(['system:notice:number'])) {
  279. // this.getNoticenumber()
  280. }
  281. // #ifdef APP-PLUS
  282. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  283. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  284. that.wgtcode=widgetInfo.version
  285. })
  286. });
  287. // #endif
  288. },
  289. methods: {
  290. checkPermi,
  291. checkRole,
  292. // 修改密码
  293. handleUpassword(){
  294. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  295. },
  296. // 账号信息
  297. handleToInfo() {
  298. this.$tab.navigateTo('/pages/mine/info/index')
  299. },
  300. //消息
  301. getNewsFn() {
  302. this.$tab.navigateTo('/work/pages/news/list')
  303. // if (checkPermi(['system:notice:list'])) {
  304. // this.$tab.navigateTo('/pages/work/message')
  305. // }
  306. },
  307. handleToAddNews(){
  308. this.$tab.navigateTo('/work/pages/news/add')
  309. },
  310. handleToAddhy(){
  311. this.$tab.navigateTo('/work/pages/meeting/add')
  312. },
  313. handleToAddzx(){
  314. this.$tab.navigateTo('/work/pages/case/mine')
  315. },
  316. handleToAddsqmy(){
  317. this.$tab.navigateTo('/work/pages/sqmyInfo/mine')
  318. },
  319. handleToAddlz(){
  320. this.$tab.navigateTo('/work/pages/report/info')
  321. },
  322. handleTohy(){
  323. this.$tab.navigateTo('/work/pages/meeting/list')
  324. },
  325. handleTotabl(){
  326. this.$tab.navigateTo('/work/pages/single/unitList')
  327. },
  328. handleTocu(){
  329. this.$tab.navigateTo('/work/pages/single/urge')
  330. },
  331. handleToLogin() {
  332. this.$tab.reLaunch('/pages/login')
  333. },
  334. handleToAvatar() {
  335. this.$tab.navigateTo('/pages/mine/avatar/index')
  336. },
  337. handleLogout() {
  338. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  339. this.$store.dispatch('LogOut').then(() => {
  340. this.$tab.reLaunch('/pages/index')
  341. })
  342. })
  343. },
  344. onlineWgt() {
  345. let that = this;
  346. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  347. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {
  348. that.wgtcode=widgetInfo.version
  349. })
  350. that.comparisonVersionNo(widgetInfo.versionCode);
  351. });
  352. // that.comparisonVersionNo()
  353. },
  354. comparisonVersionNo(versionCode) {
  355. let that = this;
  356. // console.log("aaaaaaa===versionCode", versionCode);
  357. const parmas = {
  358. model: that.platform
  359. }
  360. findVersion(parmas).then(res => {
  361. if (res.code == "200") {
  362. let versionNos = res.data.code;
  363. console.log(versionNos, 'versionNos')
  364. // console.log(res.data.path);
  365. let filePath = res.data.path;
  366. if (Number(versionNos) > Number(versionCode)) { //服务器返回1更新,0则不更新
  367. uni.showModal({
  368. title: '提示',
  369. content: '发现新版本,是否升级',
  370. success: function(res) {
  371. // console.log(widgetInfo.version);
  372. if (res.confirm) {
  373. console.log('用户点击确定');
  374. that.getProperty(filePath);
  375. } else if (res.cancel) {
  376. console.log('用户点击取消');
  377. }
  378. }
  379. });
  380. } else {
  381. this.$toast('该版本已是最新版')
  382. }
  383. }
  384. }).catch(error => {
  385. uni.hideLoading()
  386. console.log(error)
  387. })
  388. },
  389. getProperty(getProperty) {
  390. // console.log("bbbbbbbbb----------->", getProperty)
  391. let that = this;
  392. // 在线升级app/热更新
  393. that.showwri = true;
  394. const downloadTask = uni.downloadFile({ //下载文件
  395. url: baseUrl + getProperty,
  396. success: (downloadResult) => {
  397. // console.log(downloadResult);
  398. if (downloadResult.statusCode == 200) {
  399. // 更新升级
  400. plus.runtime.install(downloadResult.tempFilePath, {
  401. force: true
  402. }, function() {
  403. // console.log('install success...');
  404. that.showwri = false;
  405. plus.nativeUI.alert("应用资源更新完成!", function() {
  406. plus.runtime.restart();
  407. });
  408. }, function(e) {
  409. that.showwri = false;
  410. plus.nativeUI.alert("更新失败,请稍后再试");
  411. });
  412. }
  413. }
  414. });
  415. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  416. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  417. that.progress = res.progress; //当前下载比例
  418. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  419. });
  420. },
  421. getNoticenumber() {
  422. var params = {
  423. deptId: this.deptId
  424. }
  425. getNoticenumber(params).then(res => {
  426. if (res.code == 200) {
  427. this.noticenum = Number(res.data)
  428. } else {
  429. this.$toast(res.msg)
  430. }
  431. })
  432. },
  433. // 项目进展
  434. handleToAdd() {
  435. // this.$tab.navigateTo('/pages/work/addclues')
  436. // this.$tab.navigateTo('/pages/work/addcluelist')
  437. },
  438. // handleToSetting() {
  439. // this.$tab.navigateTo('/pages/mine/setting/index')
  440. // },
  441. // handleHelp() {
  442. // this.$tab.navigateTo('/pages/mine/help/index')
  443. // },
  444. // handleAbout() {
  445. // this.$tab.navigateTo('/pages/mine/about/index')
  446. // },
  447. // handleJiaoLiuQun() {
  448. // this.$toast('QQ群:133713780')
  449. // },
  450. // handleBuilding() {
  451. // this.$toast('模块建设中~')
  452. // }
  453. }
  454. }
  455. </script>
  456. <style lang="scss">
  457. page {background-color: #f5f5f5;}
  458. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  459. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  460. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  461. image{width: 100%;height: 100%;}
  462. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  463. }
  464. }
  465. .zxbox{
  466. .bgimg{width: 100%;height: 416rpx;}
  467. .mbox{margin-top: -280rpx;padding: 0 24rpx;z-index: 1;position: relative;
  468. .infobox{margin-bottom: 60rpx;
  469. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;}
  470. .cbox{flex: 1;z-index: 1;
  471. .tit{font-weight: bold;font-size: 40rpx;color: #ffffff;margin-bottom: 14rpx;}
  472. .txt{font-weight: 500;font-size: 26rpx;color: #ffffff;}
  473. }
  474. .rimg{width: 12rpx;height: 20rpx;flex: 0 0 auto;margin-left: 20rpx;}
  475. }
  476. .conts{margin-bottom: 24rpx;
  477. .clist{width: 164rpx;height: 246rpx;background: #FFFFFF;border-radius: 10rpx;padding: 24rpx;box-sizing: border-box;display: flex;flex-direction: column;
  478. image{width: 42rpx;height: 42rpx;flex: 0 0 auto;}
  479. .num{font-weight: bold;font-size: 48rpx;color: #222327;flex: 1;display: flex;align-items: center;}
  480. .tit{font-weight: 500;font-size: 26rpx;color: #222327;flex: 0 0 auto;
  481. text{color: #AAAAAA;}
  482. }
  483. }
  484. }
  485. .mbgbox{width: 100%;background: #FFFFFF;border-radius: 10rpx;margin-bottom: 24rpx;
  486. .mine_list{
  487. padding: 28rpx 22rpx;
  488. .limg{flex: 0 0 auto;width: 42rpx;height: 42rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  489. .imga{width: 36rpx;height: 38rpx;}
  490. .imgb{width: 38rpx;height: 36rpx;}
  491. .imgc{width: 42rpx;height: 42rpx;}
  492. }
  493. .tit{font-weight: bold;font-size: 30rpx;color: #222327;}
  494. .txt{font-weight: 500;font-size: 30rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  495. .rimg{width: 12rpx;height: 20rpx;margin-left: 20rpx;flex: 0 0 auto;}
  496. }
  497. }
  498. }
  499. }
  500. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  501. </style>