index.vue 16 KB

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