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