index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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. <block slot="right">
  7. <view class="topr" @click='getNoticeFn'>
  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. getNoticeFn(){
  244. this.$tab.navigateTo("/pages/index/notice")
  245. },
  246. getHeightFn(){
  247. let query = uni.createSelectorQuery().in(this);
  248. //需要给黄色区域设置一个id标识,在这里是demo
  249. query.select('.zxbox').boundingClientRect(data => {
  250. var top=data.top<0 ? -data.top : data.top;
  251. this.listTop = data.height//赋值,待会要用
  252. if (top <=this.nvaHeight) {
  253. const opacity = top / 100 // 计算透明度值
  254. const color = `rgba(4, 145, 253, ${opacity})`
  255. this.backgroundColor = color // 更新盒子背景颜色
  256. } else {
  257. this.backgroundColor = '#00A9F0'
  258. }
  259. }).exec();
  260. },
  261. // 修改密码
  262. handleUpassword(){
  263. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  264. },
  265. // 账号信息
  266. handleToInfo() {
  267. this.$tab.navigateTo('/pages/mine/info/index')
  268. },
  269. handleToAddNews(){
  270. this.$tab.navigateTo('/work/pages/news/add')
  271. },
  272. handleToLogin() {
  273. this.$tab.reLaunch('/pages/login')
  274. },
  275. handleToAvatar() {
  276. this.$tab.navigateTo('/pages/mine/avatar/index')
  277. },
  278. handleLogout() {
  279. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  280. this.$store.dispatch('LogOut').then(() => {
  281. this.$tab.reLaunch('/pages/index')
  282. })
  283. })
  284. },
  285. onlineWgt() {
  286. let that = this;
  287. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  288. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {})
  289. that.comparisonVersionNo(widgetInfo.versionCode);
  290. });
  291. // that.comparisonVersionNo()
  292. },
  293. comparisonVersionNo(versionCode) {
  294. let that = this;
  295. // console.log("aaaaaaa===versionCode", versionCode);
  296. const parmas = {
  297. model: that.platform
  298. }
  299. findVersion(parmas).then(res => {
  300. if (res.code == "200") {
  301. let versionNos = res.data.code;
  302. console.log(versionNos, 'versionNos')
  303. // console.log(res.data.path);
  304. let filePath = res.data.path;
  305. if (versionNos != versionCode) { //服务器返回1更新,0则不更新
  306. uni.showModal({
  307. title: '提示',
  308. content: '发现新版本,是否升级',
  309. success: function(res) {
  310. // console.log(widgetInfo.version);
  311. if (res.confirm) {
  312. console.log('用户点击确定');
  313. that.getProperty(filePath);
  314. } else if (res.cancel) {
  315. console.log('用户点击取消');
  316. }
  317. }
  318. });
  319. } else {
  320. this.$toast('该版本已是最新版')
  321. }
  322. }
  323. }).catch(error => {
  324. uni.hideLoading()
  325. console.log(error)
  326. })
  327. },
  328. getProperty(getProperty) {
  329. // console.log("bbbbbbbbb----------->", getProperty)
  330. let that = this;
  331. // 在线升级app/热更新
  332. that.showwri = true;
  333. const downloadTask = uni.downloadFile({ //下载文件
  334. url: baseUrl + getProperty,
  335. success: (downloadResult) => {
  336. // console.log(downloadResult);
  337. if (downloadResult.statusCode == 200) {
  338. // 更新升级
  339. plus.runtime.install(downloadResult.tempFilePath, {
  340. force: true
  341. }, function() {
  342. // console.log('install success...');
  343. that.showwri = false;
  344. plus.nativeUI.alert("应用资源更新完成!", function() {
  345. plus.runtime.restart();
  346. });
  347. }, function(e) {
  348. that.showwri = false;
  349. plus.nativeUI.alert("更新失败,请稍后再试");
  350. });
  351. }
  352. }
  353. });
  354. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  355. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  356. that.progress = res.progress; //当前下载比例
  357. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  358. });
  359. },
  360. getNoticenumber() {
  361. var params = {
  362. deptId: this.deptId
  363. }
  364. getNoticenumber(params).then(res => {
  365. if (res.code == 200) {
  366. this.noticenum = Number(res.data)
  367. } else {
  368. this.$toast(res.msg)
  369. }
  370. })
  371. },
  372. }
  373. }
  374. </script>
  375. <style lang="scss">
  376. page{background-color: #f6f6f6;}
  377. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  378. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  379. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  380. image{width: 100%;height: 100%;}
  381. .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  382. position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  383. }
  384. // .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  385. }
  386. }
  387. .zxbox{
  388. .bgimg{width: 100%;height: 680rpx;}
  389. .mbox{margin-top: -540rpx;padding: 0 36rpx;z-index: 1;position: relative;
  390. .infobox{margin-bottom: 60rpx;
  391. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;}
  392. .cbox{flex: 1;z-index: 1;
  393. image{width: 32rpx;height: 38rpx;}
  394. .tit{font-weight: bold;font-size: 40rpx;color: #ffffff;margin-bottom: 14rpx;}
  395. .txt{font-weight: bold;font-size: 24rpx;background-color: #2973C7;color: #FFFFFF;height: 38rpx;line-height: 38rpx;margin: 0 -2rpx;padding:0 2rpx;}
  396. }
  397. .rimg{width: 12rpx;height: 20rpx;flex: 0 0 auto;margin-left: 20rpx;}
  398. }
  399. .conts{margin-bottom: 24rpx;background: #FFFFFF;box-shadow: 0px 0px 10rpx 0px rgba(216,216,216,0.4);border-radius: 20rpx;
  400. padding: 0 20rpx;box-sizing: border-box;
  401. .conta{border-bottom: 2rpx dashed #E6E6E6;padding: 38rpx 0 44rpx;
  402. .rimg{width: 16rpx;height: 22rpx;margin-left: 22rpx;flex: 0 0 auto;}
  403. .contn{
  404. display: flex;align-items: center;flex: 0 0 auto;width: 286rpx;
  405. .img{width: 42rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 18rpx;flex: 0 0 auto;
  406. .imga{width: 42rpx;height: 40rpx;}
  407. .imgb{width: 30rpx;height: 40rpx;}
  408. .imgc{width: 38rpx;height: 40rpx;}
  409. .imgd{width: 34rpx;height: 40rpx;}
  410. }
  411. .ctit{font-weight: 500;font-size: 26rpx;color: #222327;flex: 0 0 auto;}
  412. .ctxt{flex: 1;text-align: right;font-weight: bold;font-size: 32rpx;word-break: break-all;}
  413. }
  414. .line{width: 2rpx;height: 28rpx;background: #E6E6E6;margin: 0 32rpx;flex: 0 0 auto;}
  415. }
  416. }
  417. .mbgbox{width: 100%;background: #FFFFFF;border-radius: 10rpx;margin-bottom: 24rpx;
  418. .mine_list{
  419. padding: 34rpx 22rpx;
  420. .limg{flex: 0 0 auto;width: 42rpx;height: 42rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  421. .imga{width: 40rpx;height: 40rpx;}
  422. .imgb{width: 38rpx;height: 40rpx;}
  423. }
  424. .tit{font-weight: bold;font-size: 30rpx;color: #222327;}
  425. .txt{font-weight: 500;font-size: 30rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  426. .rimg{width: 16rpx;height: 22rpx;margin-left: 20rpx;flex: 0 0 auto;}
  427. }
  428. }
  429. }
  430. }
  431. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  432. </style>