index.vue 16 KB

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