index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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. <block v-if="roleName&&roleName.length">
  26. <view class="txt" v-for="(ite,idx) in roleName" :key="idx">{{ite}}</view>
  27. </block>
  28. <image :src="headr"></image>
  29. </view>
  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. }
  282. if(type==1){
  283. params['params[beginTime]']=this.year
  284. }else{
  285. params['params[beginTime]']=this.monthtime
  286. }
  287. getCount(params).then(res=>{
  288. if(res.code==200){
  289. if(type==1){
  290. this.yearcont=res.data;
  291. }else{
  292. this.monthcont=res.data;
  293. }
  294. }
  295. })
  296. },
  297. bindDateChangea(e){
  298. var val=e.detail.value;
  299. this.monthtime=val;
  300. this.getCount(2)
  301. },
  302. bindDateChangeb(e){
  303. var val=e.detail.value;
  304. this.year=val;
  305. this.getCount(1)
  306. },
  307. getNoticeFn(){
  308. this.$tab.navigateTo("/pages/index/notice")
  309. },
  310. getHeightFn(){
  311. let query = uni.createSelectorQuery().in(this);
  312. //需要给黄色区域设置一个id标识,在这里是demo
  313. query.select('.zxbox').boundingClientRect(data => {
  314. var top=data.top<0 ? -data.top : data.top;
  315. this.listTop = data.height//赋值,待会要用
  316. if (top <=this.nvaHeight) {
  317. const opacity = top / 100 // 计算透明度值
  318. const color = `rgba(4, 145, 253, ${opacity})`
  319. this.backgroundColor = color // 更新盒子背景颜色
  320. } else {
  321. this.backgroundColor = '#00A9F0'
  322. }
  323. }).exec();
  324. },
  325. // 修改密码
  326. handleUpassword(){
  327. this.$tab.navigateTo(`/pages/mine/pwd/index`)
  328. },
  329. // 账号信息
  330. handleToInfo() {
  331. this.$tab.navigateTo('/pages/mine/info/index')
  332. },
  333. handleToAddNews(){
  334. this.$tab.navigateTo('/work/pages/news/add')
  335. },
  336. handleToAddQy(){
  337. this.$tab.navigateTo('/work/pages/prove/qylist')
  338. },
  339. handleToLogin() {
  340. this.$tab.reLaunch('/pages/login')
  341. },
  342. handleToAvatar() {
  343. this.$tab.navigateTo('/pages/mine/avatar/index')
  344. },
  345. handleLogout() {
  346. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  347. this.$store.dispatch('LogOut').then(() => {
  348. this.$tab.reLaunch('/pages/index')
  349. })
  350. })
  351. },
  352. onlineWgt() {
  353. let that = this;
  354. plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
  355. that.$store.dispatch('SetwgtFn', widgetInfo.version).then(() => {})
  356. that.comparisonVersionNo(widgetInfo.versionCode);
  357. });
  358. // that.comparisonVersionNo()
  359. },
  360. comparisonVersionNo(versionCode) {
  361. let that = this;
  362. // console.log("aaaaaaa===versionCode", versionCode);
  363. const parmas = {
  364. model: that.platform
  365. }
  366. findVersion(parmas).then(res => {
  367. if (res.code == "200") {
  368. let versionNos = res.data.code;
  369. console.log(versionNos, 'versionNos')
  370. // console.log(res.data.path);
  371. let filePath = res.data.path;
  372. if (versionNos != versionCode) { //服务器返回1更新,0则不更新
  373. uni.showModal({
  374. title: '提示',
  375. content: '发现新版本,是否升级',
  376. success: function(res) {
  377. // console.log(widgetInfo.version);
  378. if (res.confirm) {
  379. console.log('用户点击确定');
  380. that.getProperty(filePath);
  381. } else if (res.cancel) {
  382. console.log('用户点击取消');
  383. }
  384. }
  385. });
  386. } else {
  387. this.$toast('该版本已是最新版')
  388. }
  389. }
  390. }).catch(error => {
  391. uni.hideLoading()
  392. console.log(error)
  393. })
  394. },
  395. getProperty(getProperty) {
  396. // console.log("bbbbbbbbb----------->", getProperty)
  397. let that = this;
  398. // 在线升级app/热更新
  399. that.showwri = true;
  400. const downloadTask = uni.downloadFile({ //下载文件
  401. url: baseUrl + getProperty,
  402. success: (downloadResult) => {
  403. // console.log(downloadResult);
  404. if (downloadResult.statusCode == 200) {
  405. // 更新升级
  406. plus.runtime.install(downloadResult.tempFilePath, {
  407. force: true
  408. }, function() {
  409. // console.log('install success...');
  410. that.showwri = false;
  411. plus.nativeUI.alert("应用资源更新完成!", function() {
  412. plus.runtime.restart();
  413. });
  414. }, function(e) {
  415. that.showwri = false;
  416. plus.nativeUI.alert("更新失败,请稍后再试");
  417. });
  418. }
  419. }
  420. });
  421. downloadTask.onProgressUpdate((res) => { //下载文件的进度
  422. that.totalBytesWritten = res.totalBytesWritten; //当前下载大小
  423. that.progress = res.progress; //当前下载比例
  424. that.totalBytesExpectedToWrite = res.totalBytesExpectedToWrite; //
  425. });
  426. },
  427. getNoticenumber() {
  428. var params = {
  429. deptId: this.deptId
  430. }
  431. getNoticenumber(params).then(res => {
  432. if (res.code == 200) {
  433. this.noticenum = Number(res.data)
  434. } else {
  435. this.$toast(res.msg)
  436. }
  437. })
  438. },
  439. }
  440. }
  441. </script>
  442. <style lang="scss">
  443. page{background-color: #f6f6f6;}
  444. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  445. .topl{width: 274rpx;height: 50rpx;margin-left: 14rpx;}
  446. .topr{width: 36rpx;height: 36rpx;position: relative;margin-right: 10rpx;
  447. image{width: 100%;height: 100%;}
  448. .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  449. position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  450. }
  451. // .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  452. }
  453. }
  454. .zxbox{
  455. .bgimg{width: 100%;height: 680rpx;}
  456. .mbox{margin-top: -540rpx;padding: 0 36rpx;z-index: 1;position: relative;
  457. .infobox{margin-bottom: 60rpx;
  458. .limg{width: 140rpx;height: 140rpx;flex: 0 0 auto;margin-right: 26rpx;border-radius: 50%;}
  459. .cbox{flex: 1;z-index: 1;
  460. image{width: 32rpx;height: 38rpx;}
  461. .tit{font-weight: bold;font-size: 40rpx;color: #ffffff;margin-bottom: 14rpx;}
  462. .txt{font-weight: bold;font-size: 24rpx;background-color: #2973C7;color: #FFFFFF;height: 38rpx;line-height: 38rpx;margin: 0 -2rpx;padding:0 2rpx;}
  463. }
  464. .rimg{width: 12rpx;height: 20rpx;flex: 0 0 auto;margin-left: 20rpx;}
  465. }
  466. .conts{margin-bottom: 24rpx;background: #FFFFFF;box-shadow: 0px 0px 10rpx 0px rgba(216,216,216,0.4);border-radius: 20rpx;
  467. padding: 0 20rpx;box-sizing: border-box;
  468. .conta{border-bottom: 2rpx dashed #E6E6E6;padding: 38rpx 0 44rpx;
  469. .rimg{width: 16rpx;height: 22rpx;margin-left: 22rpx;flex: 0 0 auto;}
  470. .contn{
  471. display: flex;align-items: center;flex: 0 0 auto;width: 286rpx;
  472. .img{width: 42rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 18rpx;flex: 0 0 auto;
  473. .imga{width: 42rpx;height: 40rpx;}
  474. .imgb{width: 30rpx;height: 40rpx;}
  475. .imgc{width: 38rpx;height: 40rpx;}
  476. .imgd{width: 34rpx;height: 40rpx;}
  477. }
  478. .ctit{font-weight: 500;font-size: 26rpx;color: #222327;flex: 0 0 auto;}
  479. .ctxt{flex: 1;text-align: right;font-weight: bold;font-size: 32rpx;word-break: break-all;}
  480. }
  481. .line{width: 2rpx;height: 28rpx;background: #E6E6E6;margin: 0 32rpx;flex: 0 0 auto;}
  482. }
  483. }
  484. .mbgbox{width: 100%;background: #FFFFFF;border-radius: 10rpx;margin-bottom: 24rpx;
  485. .mine_list{
  486. padding: 34rpx 22rpx;
  487. .limg{flex: 0 0 auto;width: 42rpx;height: 42rpx;margin-right: 26rpx;display: flex;align-items: center;justify-content: center;
  488. .imga{width: 40rpx;height: 40rpx;}
  489. .imgb{width: 38rpx;height: 40rpx;}
  490. .imgc{width: 42rpx;height: 42rpx;}
  491. }
  492. .tit{font-weight: bold;font-size: 30rpx;color: #222327;}
  493. .txt{font-weight: 500;font-size: 30rpx;color: #666666;margin-left: 20rpx;flex: 0 0 auto;}
  494. .rimg{width: 16rpx;height: 22rpx;margin-left: 20rpx;flex: 0 0 auto;}
  495. }
  496. }
  497. }
  498. }
  499. .ztit{font-size: 24rpx;color:#c6c6c9;text-align: center;flex:0 0 auto;margin-bottom: 28rpx;margin-top: 40rpx;}
  500. </style>