index.vue 17 KB

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