index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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">99+</view>
  10. <!-- <block v-if="noticenum>99">99+</block>
  11. <block v-else>{{noticenum}}</block> -->
  12. </view>
  13. </block>
  14. </uni-nav-bar>
  15. </view>
  16. <image :src="bgimg" class="bgimg"></image>
  17. <view class="mbox">
  18. <view class="infobox flexc" @click="handleToInfo">
  19. <image v-if="avatar" @click.stop="handleToAvatar" :src="avatar" class="limg" mode="aspectFill"></image>
  20. <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="limg" mode="aspectFill"></image>
  21. <view class="cbox">
  22. <view class="tit">{{name?name:'登录账号'}}</view>
  23. <view class="flexc pr">
  24. <image :src="headl"></image>
  25. <view class="txt">超级管理员</view>
  26. <image :src="headr"></image>
  27. </view>
  28. </view>
  29. <image :src="wrimg" class="rimg"></image>
  30. </view>
  31. <view class="conts">
  32. <view class="conta">
  33. <view class="flexcj mb19">
  34. <view class="f15 fw co23 flex0 ml8">季度放款统计 <text class="coa ml4">/万元</text></view>
  35. <view class="f12 coa fw5 flexc">2024年第二季度
  36. <image :src="rimg" class="rimg"></image>
  37. </view>
  38. </view>
  39. <view class="flexc">
  40. <view class="contn">
  41. <view class="img">
  42. <image :src="mconta" class="imga"></image>
  43. </view>
  44. <view class="ctit">待放款</view>
  45. <view class="ctxt co1l">1230</view>
  46. </view>
  47. <view class="line"></view>
  48. <view class="contn">
  49. <view class="img">
  50. <image :src="mcontb" class="imgb"></image>
  51. </view>
  52. <view class="ctit">已放款</view>
  53. <view class="ctxt co1l">4731</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="conta">
  58. <view class="flexcj mb19">
  59. <view class="f15 fw co23 flex0 ml8">年度申报<text class="coa ml4">/个</text></view>
  60. <view class="f12 coa fw5 flexc">2024年度
  61. <image :src="rimg" class="rimg"></image>
  62. </view>
  63. </view>
  64. <view class="flexc">
  65. <view class="contn">
  66. <view class="img">
  67. <image :src="mcontc" class="imgc"></image>
  68. </view>
  69. <view class="ctit">待完成</view>
  70. <view class="ctxt co1y">11</view>
  71. </view>
  72. <view class="line"></view>
  73. <view class="contn">
  74. <view class="img">
  75. <image :src="mcontd" class="imgd"></image>
  76. </view>
  77. <view class="ctit">已归档</view>
  78. <view class="ctxt co1y">56</view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="mbgbox">
  84. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['projectV2:sbbzb:add'])">
  85. <view class="limg">
  86. <image :src="listimga" class="imga"></image>
  87. </view>
  88. <view class="tit flex1">业务申报</view>
  89. <image :src="rimg" class="rimg"></image>
  90. </view>
  91. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['zxConference:conference:add'])">
  92. <view class="limg">
  93. <image :src="listimgb" class="imga"></image>
  94. </view>
  95. <view class="tit flex1">我的申报</view>
  96. <image :src="rimg" class="rimg"></image>
  97. </view>
  98. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['proposalInfo:info:list'])">
  99. <view class="limg">
  100. <image :src="listimgc" class="imga"></image>
  101. </view>
  102. <view class="tit flex1">待办事项</view>
  103. <image :src="rimg" class="rimg"></image>
  104. </view>
  105. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['sqmyInfo:info:list'])">
  106. <view class="limg">
  107. <image :src="listimgd" class="imga"></image>
  108. </view>
  109. <view class="tit flex1">我的暂存</view>
  110. <image :src="rimg" class="rimg"></image>
  111. </view>
  112. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['member:info:list'])">
  113. <view class="limg">
  114. <image :src="listimge" class="imgb"></image>
  115. </view>
  116. <view class="tit flex1">回收站</view>
  117. <image :src="rimg" class="rimg"></image>
  118. </view>
  119. </view>
  120. <view class="mbgbox">
  121. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['zxConference:conference:list'])">
  122. <view class="limg">
  123. <image :src="listimgf" class="imga"></image>
  124. </view>
  125. <view class="tit flex1">台账表</view>
  126. <image :src="rimg" class="rimg"></image>
  127. </view>
  128. <view class="flexc mine_list" @click="handleToAddNews" v-if="checkPermi(['zxConference:conference:list'])">
  129. <view class="limg">
  130. <image :src="listimgg" class="imga"></image>
  131. </view>
  132. <view class="tit flex1">担保材料清单</view>
  133. <image :src="rimg" class="rimg"></image>
  134. </view>
  135. </view>
  136. <view class="mbgbox">
  137. <view class="flexc mine_list" @click="handleUpassword">
  138. <view class="limg">
  139. <image :src="listimgh" class="imga"></image>
  140. </view>
  141. <view class="tit flex1">修改密码</view>
  142. <image :src="rimg" class="rimg"></image>
  143. </view>
  144. <view class="flexc mine_list"@click="onlineWgt">
  145. <view class="limg">
  146. <image :src="listimgi" class="imga"></image>
  147. </view>
  148. <view class="tit flex1">版本号</view>
  149. <view class="txt">{{wgtcode}}</view>
  150. </view>
  151. <view class="flexc mine_list" @click="handleLogout">
  152. <view class="limg">
  153. <image :src="listimgj" class="imga"></image>
  154. </view>
  155. <view class="tit flex1">退出登录</view>
  156. <image :src="rimg" class="rimg"></image>
  157. </view>
  158. </view>
  159. </view>
  160. <view class="ztit">安徽中新云计算有限公司提供支持</view>
  161. <footers v-if="isfootflag" :footerindex="footerindex" :isHomeIndex="false"></footers>
  162. </view>
  163. </template>
  164. <script>
  165. import storage from '@/utils/storage'
  166. import footers from '@/components/footer/footer.vue'
  167. // import {getNoticenumber} from "@/api/work/index.js"
  168. import {updateUserProfile,findVersion} from "@/api/system/user.js"
  169. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  170. import config from '@/config'
  171. const baseUrl = config.baseUrl
  172. export default {
  173. data() {
  174. return {
  175. bgimg: require("@/static/images/bg.png"),
  176. avatarimg:require("@/static/images/mine/profile.png"),
  177. noticimg: require("@/static/images/home/notice.png"),
  178. mconta:require("@/static/images/mine/mconta.png"),
  179. mcontb:require("@/static/images/mine/mcontb.png"),
  180. mcontc:require("@/static/images/mine/mcontc.png"),
  181. mcontd:require("@/static/images/mine/mcontd.png"),
  182. listimga: require('@/static/images/mine/minea.png'),
  183. listimgb: require('@/static/images/mine/mineb.png'),
  184. listimgc: require('@/static/images/mine/minec.png'),
  185. listimgd: require('@/static/images/mine/mined.png'),
  186. listimge: require('@/static/images/mine/minee.png'),
  187. listimgf: require('@/static/images/mine/minef.png'),
  188. listimgg: require('@/static/images/mine/mineg.png'),
  189. listimgh: require('@/static/images/mine/mineh.png'),
  190. listimgi: require('@/static/images/mine/minei.png'),
  191. listimgj: require('@/static/images/mine/minej.png'),
  192. headl:require('@/static/images/mine/headl.png'),
  193. headr:require('@/static/images/mine/headr.png'),
  194. wrimg:require("@/static/images/mine/wrimg.png"),
  195. rimg:require("@/static/images/mine/rimg.png"),
  196. border: false,
  197. backgroundColor: 'transparent',
  198. name: this.$store.state.user.name,
  199. // version: getApp().globalData.config.appInfo.version,
  200. footerindex: 'mine',
  201. isfootflag: true,
  202. noticenum: 0,
  203. deptId: this.$store.state.user.deptId,
  204. wgtcode: this.$store.state.user.wgtcode,
  205. platform: 'Android',
  206. nvaHeight:44,
  207. }
  208. },
  209. components: {
  210. footers
  211. },
  212. computed: {
  213. avatar() {
  214. return this.$store.state.user.avatar
  215. },
  216. windowHeight() {
  217. return uni.getSystemInfoSync().windowHeight - 50
  218. }
  219. },
  220. onPageScroll(e) {
  221. var scrollTop = Number(e.scrollTop);
  222. var listTop=Number(this.listTop)-Number(this.nvaHeight)
  223. if (scrollTop <=this.nvaHeight) {
  224. const opacity = scrollTop / 100 // 计算透明度值
  225. const color = `rgba(29, 100, 226, ${opacity})`
  226. this.backgroundColor = color // 更新盒子背景颜色
  227. } else {
  228. this.backgroundColor = '#00A9F0'
  229. }
  230. },
  231. onLoad() {
  232. this.nvaHeight=uni.getSystemInfoSync().statusBarHeight+44;
  233. if (checkPermi(['system:notice:number'])) {
  234. // this.getNoticenumber()
  235. }
  236. },
  237. mounted() {
  238. this.getHeightFn()
  239. },
  240. methods: {
  241. checkPermi,
  242. checkRole,
  243. getHeightFn(){
  244. let query = uni.createSelectorQuery().in(this);
  245. //需要给黄色区域设置一个id标识,在这里是demo
  246. query.select('.zxbox').boundingClientRect(data => {
  247. var top=data.top<0 ? -data.top : data.top;
  248. this.listTop = data.height//赋值,待会要用
  249. if (top <=this.nvaHeight) {
  250. const opacity = top / 100 // 计算透明度值
  251. const color = `rgba(4, 145, 253, ${opacity})`
  252. this.backgroundColor = color // 更新盒子背景颜色
  253. } else {
  254. this.backgroundColor = '#00A9F0'
  255. }
  256. }).exec();
  257. },
  258. // 修改密码
  259. handleUpassword(){
  260. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  261. },
  262. // 账号信息
  263. handleToInfo() {
  264. this.$tab.navigateTo('/pages/mine/info/index')
  265. },
  266. //消息
  267. getNewsFn() {
  268. this.$tab.navigateTo('/work/pages/news/list')
  269. // if (checkPermi(['system:notice:list'])) {
  270. // this.$tab.navigateTo('/pages/work/message')
  271. // }
  272. },
  273. handleToAddNews(){
  274. this.$tab.navigateTo('/work/pages/news/add')
  275. },
  276. handleToLogin() {
  277. this.$tab.reLaunch('/pages/login')
  278. },
  279. handleToAvatar() {
  280. this.$tab.navigateTo('/pages/mine/avatar/index')
  281. },
  282. handleLogout() {
  283. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  284. this.$store.dispatch('LogOut').then(() => {
  285. this.$tab.reLaunch('/pages/index')
  286. })
  287. })
  288. },
  289. onlineWgt() {
  290. let that = this;
  291. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  292. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {})
  293. that.comparisonVersionNo(widgetInfo.versionCode);
  294. });
  295. // that.comparisonVersionNo()
  296. },
  297. comparisonVersionNo(versionCode) {
  298. let that = this;
  299. // console.log("aaaaaaa===versionCode", versionCode);
  300. const parmas = {
  301. model: that.platform
  302. }
  303. findVersion(parmas).then(res => {
  304. if (res.code == "200") {
  305. let versionNos = res.data.code;
  306. console.log(versionNos, 'versionNos')
  307. // console.log(res.data.path);
  308. let filePath = res.data.path;
  309. if (versionNos != versionCode) { //服务器返回1更新,0则不更新
  310. uni.showModal({
  311. title: '提示',
  312. content: '发现新版本,是否升级',
  313. success: function(res) {
  314. // console.log(widgetInfo.version);
  315. if (res.confirm) {
  316. console.log('用户点击确定');
  317. that.getProperty(filePath);
  318. } else if (res.cancel) {
  319. console.log('用户点击取消');
  320. }
  321. }
  322. });
  323. } else {
  324. this.$toast('该版本已是最新版')
  325. }
  326. }
  327. }).catch(error => {
  328. uni.hideLoading()
  329. console.log(error)
  330. })
  331. },
  332. getProperty(getProperty) {
  333. // console.log("bbbbbbbbb----------->", getProperty)
  334. let that = this;
  335. // 在线升级app/热更新
  336. that.showwri = true;
  337. const downloadTask = uni.downloadFile({ //下载文件
  338. url: baseUrl + getProperty,
  339. success: (downloadResult) => {
  340. // console.log(downloadResult);
  341. if (downloadResult.statusCode == 200) {
  342. // 更新升级
  343. plus.runtime.install(downloadResult.tempFilePath, {
  344. force: true
  345. }, function() {
  346. // console.log('install success...');
  347. that.showwri = false;
  348. plus.nativeUI.alert("应用资源更新完成!", function() {
  349. plus.runtime.restart();
  350. });
  351. }, function(e) {
  352. that.showwri = false;
  353. plus.nativeUI.alert("更新失败,请稍后再试");
  354. });
  355. }
  356. }
  357. });
  358. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  359. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  360. that.progress = res.progress; //当前下载比例
  361. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  362. });
  363. },
  364. getNoticenumber() {
  365. var params = {
  366. deptId: this.deptId
  367. }
  368. getNoticenumber(params).then(res => {
  369. if (res.code == 200) {
  370. this.noticenum = Number(res.data)
  371. } else {
  372. this.$toast(res.msg)
  373. }
  374. })
  375. },
  376. }
  377. }
  378. </script>
  379. <style lang="scss">
  380. page {background-color: #f5f5f5;}
  381. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  382. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  383. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  384. image{width: 100%;height: 100%;}
  385. .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  386. position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  387. }
  388. // .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  389. }
  390. }
  391. .zxbox{
  392. .bgimg{width: 100%;height: 680rpx;}
  393. .mbox{margin-top: -540rpx;padding: 0 36rpx;z-index: 1;position: relative;
  394. .infobox{margin-bottom: 60rpx;
  395. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;}
  396. .cbox{flex: 1;z-index: 1;
  397. image{width: 32rpx;height: 38rpx;}
  398. .tit{font-weight: bold;font-size: 40rpx;color: #ffffff;margin-bottom: 14rpx;}
  399. .txt{font-weight: bold;font-size: 24rpx;background-color: #2973C7;color: #FFFFFF;height: 38rpx;line-height: 38rpx;margin: 0 -2rpx;padding:0 2rpx;}
  400. }
  401. .rimg{width: 12rpx;height: 20rpx;flex: 0 0 auto;margin-left: 20rpx;}
  402. }
  403. .conts{margin-bottom: 24rpx;background: #FFFFFF;box-shadow: 0px 0px 10rpx 0px rgba(216,216,216,0.4);border-radius: 20rpx;
  404. padding: 0 20rpx;box-sizing: border-box;
  405. .conta{border-bottom: 2rpx dashed #E6E6E6;padding: 38rpx 0 44rpx;
  406. .rimg{width: 16rpx;height: 22rpx;margin-left: 22rpx;flex: 0 0 auto;}
  407. .contn{
  408. display: flex;align-items: center;flex: 0 0 auto;width: 286rpx;
  409. .img{width: 42rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 18rpx;flex: 0 0 auto;
  410. .imga{width: 42rpx;height: 40rpx;}
  411. .imgb{width: 30rpx;height: 40rpx;}
  412. .imgc{width: 38rpx;height: 40rpx;}
  413. .imgd{width: 34rpx;height: 40rpx;}
  414. }
  415. .ctit{font-weight: 500;font-size: 26rpx;color: #222327;flex: 0 0 auto;}
  416. .ctxt{flex: 1;text-align: right;font-weight: bold;font-size: 32rpx;word-break: break-all;}
  417. }
  418. .line{width: 2rpx;height: 28rpx;background: #E6E6E6;margin: 0 32rpx;flex: 0 0 auto;}
  419. }
  420. }
  421. .mbgbox{width: 100%;background: #FFFFFF;border-radius: 10rpx;margin-bottom: 24rpx;
  422. .mine_list{
  423. padding: 34rpx 22rpx;
  424. .limg{flex: 0 0 auto;width: 42rpx;height: 42rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  425. .imga{width: 40rpx;height: 40rpx;}
  426. .imgb{width: 38rpx;height: 40rpx;}
  427. }
  428. .tit{font-weight: bold;font-size: 30rpx;color: #222327;}
  429. .txt{font-weight: 500;font-size: 30rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  430. .rimg{width: 16rpx;height: 22rpx;margin-left: 20rpx;flex: 0 0 auto;}
  431. }
  432. }
  433. }
  434. }
  435. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  436. </style>