index.vue 18 KB

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