index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  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. },
  282. methods: {
  283. checkPermi,
  284. checkRole,
  285. // 修改密码
  286. handleUpassword(){
  287. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  288. },
  289. // 账号信息
  290. handleToInfo() {
  291. this.$tab.navigateTo('/pages/mine/info/index')
  292. },
  293. //消息
  294. getNewsFn() {
  295. this.$tab.navigateTo('/work/pages/news/list')
  296. // if (checkPermi(['system:notice:list'])) {
  297. // this.$tab.navigateTo('/pages/work/message')
  298. // }
  299. },
  300. handleToAddNews(){
  301. this.$tab.navigateTo('/work/pages/news/add')
  302. },
  303. handleToAddhy(){
  304. this.$tab.navigateTo('/work/pages/meeting/add')
  305. },
  306. handleToAddzx(){
  307. this.$tab.navigateTo('/work/pages/case/mine')
  308. },
  309. handleToAddsqmy(){
  310. this.$tab.navigateTo('/work/pages/sqmyInfo/mine')
  311. },
  312. handleToAddlz(){
  313. this.$tab.navigateTo('/work/pages/report/info')
  314. },
  315. handleTohy(){
  316. this.$tab.navigateTo('/work/pages/meeting/list')
  317. },
  318. handleTotabl(){
  319. this.$tab.navigateTo('/work/pages/single/unitList')
  320. },
  321. handleTocu(){
  322. this.$tab.navigateTo('/work/pages/single/urge')
  323. },
  324. handleToLogin() {
  325. this.$tab.reLaunch('/pages/login')
  326. },
  327. handleToAvatar() {
  328. this.$tab.navigateTo('/pages/mine/avatar/index')
  329. },
  330. handleLogout() {
  331. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  332. this.$store.dispatch('LogOut').then(() => {
  333. this.$tab.reLaunch('/pages/index')
  334. })
  335. })
  336. },
  337. onlineWgt() {
  338. let that = this;
  339. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  340. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {})
  341. that.comparisonVersionNo(widgetInfo.versionCode);
  342. });
  343. // that.comparisonVersionNo()
  344. },
  345. comparisonVersionNo(versionCode) {
  346. let that = this;
  347. // console.log("aaaaaaa===versionCode", versionCode);
  348. const parmas = {
  349. model: that.platform
  350. }
  351. findVersion(parmas).then(res => {
  352. if (res.code == "200") {
  353. let versionNos = res.data.code;
  354. console.log(versionNos, 'versionNos')
  355. // console.log(res.data.path);
  356. let filePath = res.data.path;
  357. if (versionNos != versionCode) { //服务器返回1更新,0则不更新
  358. uni.showModal({
  359. title: '提示',
  360. content: '发现新版本,是否升级',
  361. success: function(res) {
  362. // console.log(widgetInfo.version);
  363. if (res.confirm) {
  364. console.log('用户点击确定');
  365. that.getProperty(filePath);
  366. } else if (res.cancel) {
  367. console.log('用户点击取消');
  368. }
  369. }
  370. });
  371. } else {
  372. this.$toast('该版本已是最新版')
  373. }
  374. }
  375. }).catch(error => {
  376. uni.hideLoading()
  377. console.log(error)
  378. })
  379. },
  380. getProperty(getProperty) {
  381. // console.log("bbbbbbbbb----------->", getProperty)
  382. let that = this;
  383. // 在线升级app/热更新
  384. that.showwri = true;
  385. const downloadTask = uni.downloadFile({ //下载文件
  386. url: baseUrl + getProperty,
  387. success: (downloadResult) => {
  388. // console.log(downloadResult);
  389. if (downloadResult.statusCode == 200) {
  390. // 更新升级
  391. plus.runtime.install(downloadResult.tempFilePath, {
  392. force: true
  393. }, function() {
  394. // console.log('install success...');
  395. that.showwri = false;
  396. plus.nativeUI.alert("应用资源更新完成!", function() {
  397. plus.runtime.restart();
  398. });
  399. }, function(e) {
  400. that.showwri = false;
  401. plus.nativeUI.alert("更新失败,请稍后再试");
  402. });
  403. }
  404. }
  405. });
  406. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  407. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  408. that.progress = res.progress; //当前下载比例
  409. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  410. });
  411. },
  412. getNoticenumber() {
  413. var params = {
  414. deptId: this.deptId
  415. }
  416. getNoticenumber(params).then(res => {
  417. if (res.code == 200) {
  418. this.noticenum = Number(res.data)
  419. } else {
  420. this.$toast(res.msg)
  421. }
  422. })
  423. },
  424. // 项目进展
  425. handleToAdd() {
  426. // this.$tab.navigateTo('/pages/work/addclues')
  427. // this.$tab.navigateTo('/pages/work/addcluelist')
  428. },
  429. // handleToSetting() {
  430. // this.$tab.navigateTo('/pages/mine/setting/index')
  431. // },
  432. // handleHelp() {
  433. // this.$tab.navigateTo('/pages/mine/help/index')
  434. // },
  435. // handleAbout() {
  436. // this.$tab.navigateTo('/pages/mine/about/index')
  437. // },
  438. // handleJiaoLiuQun() {
  439. // this.$toast('QQ群:133713780')
  440. // },
  441. // handleBuilding() {
  442. // this.$toast('模块建设中~')
  443. // }
  444. }
  445. }
  446. </script>
  447. <style lang="scss">
  448. page {background-color: #f5f5f5;}
  449. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  450. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  451. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  452. image{width: 100%;height: 100%;}
  453. .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  454. }
  455. }
  456. .zxbox{
  457. .bgimg{width: 100%;height: 416rpx;}
  458. .mbox{margin-top: -280rpx;padding: 0 24rpx;z-index: 1;position: relative;
  459. .infobox{
  460. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;}
  461. .cbox{flex: 1;z-index: 1;
  462. .tit{font-weight: bold;font-size: 40rpx;color: #ffffff;margin-bottom: 14rpx;}
  463. .txt{font-weight: 500;font-size: 26rpx;color: #ffffff;}
  464. }
  465. .rimg{width: 12rpx;height: 20rpx;flex: 0 0 auto;margin-left: 20rpx;}
  466. }
  467. .conts{margin-top: 60rpx;margin-bottom: 24rpx;
  468. .clist{width: 164rpx;height: 246rpx;background: #FFFFFF;border-radius: 10rpx;padding: 24rpx;box-sizing: border-box;display: flex;flex-direction: column;
  469. image{width: 42rpx;height: 42rpx;flex: 0 0 auto;}
  470. .num{font-weight: bold;font-size: 48rpx;color: #222327;flex: 1;display: flex;align-items: center;}
  471. .tit{font-weight: 500;font-size: 26rpx;color: #222327;flex: 0 0 auto;
  472. text{color: #AAAAAA;}
  473. }
  474. }
  475. }
  476. .mbgbox{width: 100%;background: #FFFFFF;border-radius: 10rpx;margin-bottom: 24rpx;
  477. .mine_list{
  478. padding: 28rpx 22rpx;
  479. .limg{flex: 0 0 auto;width: 42rpx;height: 42rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  480. .imga{width: 36rpx;height: 38rpx;}
  481. .imgb{width: 38rpx;height: 36rpx;}
  482. .imgc{width: 42rpx;height: 42rpx;}
  483. }
  484. .tit{font-weight: bold;font-size: 30rpx;color: #222327;}
  485. .txt{font-weight: 500;font-size: 30rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  486. .rimg{width: 12rpx;height: 20rpx;margin-left: 20rpx;flex: 0 0 auto;}
  487. }
  488. }
  489. }
  490. }
  491. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  492. </style>