the_oaOffice.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <view>
  3. <view class="wrap">
  4. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
  5. <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
  6. v-if="index<gridCol*2 && item.show">
  7. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  8. <image :src="item.src" class="sign"></image>
  9. </view>
  10. <text>{{item.name}}</text>
  11. </view>
  12. </view>
  13. </view>
  14. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  15. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='温馨提示'
  16. showCancelButton='false' :content="content" @confirm="goOpenService" @cancel="cancelClick"></u-modal>
  17. <u-modal v-model="isShowAlert1" :title-style="{fontSize: '18px',fontWeight:'500'}"
  18. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  19. showCancelButton='false' :content="content1" @confirm="alertBtn1" @cancel="cancelClick1"></u-modal>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. isShowAlert1: false,
  27. content1: '当前登入信息验证失败,是否重新登录?',
  28. isShowAlert: false,
  29. content: '您确定要退出吗?',
  30. a: false,
  31. inputShow: false,
  32. modalName: '',
  33. mycarStyle: '',
  34. feild: undefined,
  35. inputContent: '',
  36. coverTransform: 'translateY(0px)',
  37. coverTransition: '0s',
  38. moving: false,
  39. footprintList: [],
  40. isVip: false,
  41. userInfoTmp: [],
  42. inputStatus: 'none',
  43. carInfo: [],
  44. gridCol: 4,
  45. gridBorder: false,
  46. headUrl: "../../static/img/myimg/YongHu@3x.png",
  47. userphone: "",
  48. username: "请更改昵称",
  49. gridList: [{
  50. num: 0,
  51. name: '打卡',
  52. // icon: 'cuIcon-edit',
  53. src: '../../static/img/oa_office/clock.png',
  54. tips: 0,
  55. url: `/pages/clock/the_clock`,
  56. show: true
  57. },
  58. {
  59. num: 1,
  60. name: '请假',
  61. // icon: 'cuIcon-edit',
  62. src: '../../static/img/oa_office/leave.png',
  63. tips: 0,
  64. url: `/pages/leave/the_leave`,
  65. show: true
  66. },
  67. {
  68. num: 2,
  69. name: '加油',
  70. // icon: 'cuIcon-edit',
  71. src: '../../static/img/oa_office/fulling.png',
  72. tips: 0,
  73. url: `/pages/fuelfilling/the_fuel_filling`,
  74. show: true
  75. },
  76. {
  77. num: 3,
  78. name: '短途记录',
  79. // icon: 'cuIcon-edit',
  80. src: '../../static/img/oa_office/shortfull.png',
  81. tips: 0,
  82. url: `/pages/shortDistance/short_distance_record`,
  83. show: true
  84. },
  85. {
  86. num: 4,
  87. name: '报销',
  88. // icon: 'cuIcon-edit',
  89. src: '../../static/img/oa_office/reimbursement.png',
  90. tips: 0,
  91. url: `/pages/reimbursement/the_reimbursement`,
  92. show: true
  93. }
  94. ],
  95. }
  96. },
  97. onShow() {
  98. uni.hideKeyboard()
  99. uni.showTabBar()
  100. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  101. console.log("checkSession", res)
  102. if (res.data.data == "INVALID") {
  103. this.isShowAlert1 = true;
  104. }
  105. })
  106. console.log("hasLogin", this.hasLogin)
  107. if (this.userInfo) {
  108. if (!this.userInfo.avatarUrl) {
  109. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  110. } else {
  111. this.headUrl = this.userInfo.avatarUrl
  112. }
  113. this.username = this.userInfo.userName
  114. this.userphone = this.userInfo.phone
  115. var that = this
  116. this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
  117. console.log("noticeNumber", res)
  118. if (res.data.data) {
  119. let name = 'myTip';
  120. let value = res.data.data.total;
  121. that.$store.commit('$uStore', {
  122. name,
  123. value
  124. });
  125. if (value != 0 && value) {
  126. uni.setTabBarBadge({
  127. index: 4,
  128. text: value + ""
  129. })
  130. }
  131. name = 'taskTip';
  132. value = res.data.data.total;
  133. that.$store.commit('$uStore', {
  134. name,
  135. value
  136. });
  137. }
  138. })
  139. } else {
  140. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  141. this.username = "立即登录"
  142. }
  143. console.log("this.userInfo", this.userInfo)
  144. },
  145. methods: {
  146. alertBtn1() {
  147. uni.navigateTo({
  148. url: '/pages/public/login'
  149. })
  150. },
  151. cancelClick() {
  152. this.isShowAlert = false
  153. },
  154. cancelClick1() {
  155. this.isShowAlert = false
  156. },
  157. goOpenService() {
  158. uni.hideTabBarRedDot({
  159. index: 3
  160. })
  161. this.$store.commit('logout')
  162. this.$api.logout()
  163. uni.navigateTo({
  164. url: `/pages/public/login`
  165. })
  166. },
  167. gridClick(item, index) {
  168. var that = this
  169. if (!this.hasLogin) {
  170. uni.showModal({
  171. title: '提示',
  172. content: '您尚未登录,是否立即登录?',
  173. showCancel: true,
  174. confirmText: '登录',
  175. success: (e) => {
  176. if (e.confirm) {
  177. uni.navigateTo({
  178. url: '/pages/public/login'
  179. })
  180. }
  181. },
  182. fail: () => {},
  183. complete: () => {}
  184. })
  185. } else {
  186. if (item.url) {
  187. uni.navigateTo({
  188. url: item.url
  189. })
  190. }
  191. }
  192. },
  193. }
  194. }
  195. </script>
  196. <style lang='scss' scoped>
  197. page {
  198. background: #F5F6FA;
  199. }
  200. .container {
  201. padding-top: 85px;
  202. padding-top: 35px;
  203. background-color: #F5F6FA;
  204. position: relative;
  205. width: 100vw;
  206. height: 100vh;
  207. overflow: hidden;
  208. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  209. background-size: 100% 100%;
  210. margin: 0 auto;
  211. }
  212. .cu-tag.badge {
  213. right: 26rpx;
  214. }
  215. .path {
  216. color: #007aff;
  217. display: inline-block;
  218. text-align: center;
  219. }
  220. .icon {
  221. margin-right: 10rpx;
  222. }
  223. .portrait-box {
  224. margin-top: 20rpx;
  225. }
  226. .qr-wrap {
  227. margin-top: 20upx;
  228. color: #fff;
  229. font-size: 32rpx;
  230. }
  231. .cu-list {
  232. /* height: 483rpx;
  233. overflow-y: scroll; */
  234. background: transparent;
  235. }
  236. .cu-list.grid.no-border {
  237. padding: 0;
  238. }
  239. .badge_user {
  240. color: #fff;
  241. background-color: #dc3545;
  242. display: inline-block;
  243. padding: .25em .4em;
  244. font-size: 75%;
  245. font-weight: 700;
  246. line-height: 1;
  247. text-align: center;
  248. white-space: nowrap;
  249. vertical-align: top;
  250. border-radius: 50%;
  251. transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  252. }
  253. @keyframes move_wave {
  254. 0% {
  255. transform: translateX(0) translateZ(0) scaleY(1)
  256. }
  257. 50% {
  258. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  259. }
  260. 100% {
  261. transform: translateX(-50%) translateZ(0) scaleY(1)
  262. }
  263. }
  264. .bg {
  265. position: relative;
  266. height: 300rpx;
  267. /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
  268. /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
  269. background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
  270. }
  271. .bg_ware {
  272. position: absolute;
  273. left: 0;
  274. bottom: -2rpx;
  275. width: 100%;
  276. mix-blend-mode: screen;
  277. height: 224rpx;
  278. }
  279. %flex-center {
  280. display: flex;
  281. flex-direction: column;
  282. justify-content: center;
  283. align-items: center;
  284. }
  285. %section {
  286. display: flex;
  287. justify-content: space-around;
  288. align-content: center;
  289. background: #fff;
  290. border-radius: 10upx;
  291. }
  292. .grid-item-box {
  293. flex: 1;
  294. /* position: relative;
  295. */
  296. /* #ifndef APP-NVUE */
  297. display: flex;
  298. /* #endif */
  299. flex-direction: column;
  300. align-items: center;
  301. justify-content: center;
  302. padding: 15px 0;
  303. }
  304. .image {
  305. width: 80rpx;
  306. height: 80rpx;
  307. }
  308. .text {
  309. font-size: 26rpx;
  310. margin-top: 10rpx;
  311. }
  312. .user-section {
  313. height: 520upx;
  314. padding: 100upx 30upx 0;
  315. position: relative;
  316. .bg {
  317. position: absolute;
  318. left: 0;
  319. top: 0;
  320. width: 100%;
  321. height: 100%;
  322. filter: blur(1px);
  323. box-shadow: 0px 1px 8px #ccc;
  324. /* background:linear-gradient(#0eb0c9,#126bae); */
  325. /* opacity: .7; */
  326. }
  327. }
  328. .user-info-box {
  329. height: 180upx;
  330. /* display:flex; */
  331. /* align-items:center; */
  332. text-align: center;
  333. position: relative;
  334. z-index: 1;
  335. .portrait {
  336. width: 130upx;
  337. height: 130upx;
  338. border: 5upx solid #fff;
  339. border-radius: 50%;
  340. }
  341. .username {
  342. font-size: $font-lg + 3upx;
  343. color: #fff;
  344. margin-top: 20upx;
  345. }
  346. }
  347. .vip-card-box {
  348. display: flex;
  349. flex-direction: column;
  350. color: #f7d680;
  351. height: 240upx;
  352. background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
  353. border-radius: 16upx 16upx 0 0;
  354. overflow: hidden;
  355. position: relative;
  356. padding: 20upx 24upx;
  357. .card-bg {
  358. position: absolute;
  359. top: 20upx;
  360. right: 0;
  361. width: 380upx;
  362. height: 260upx;
  363. }
  364. .b-btn {
  365. position: absolute;
  366. right: 20upx;
  367. top: 16upx;
  368. width: 132upx;
  369. height: 40upx;
  370. text-align: center;
  371. line-height: 40upx;
  372. font-size: 22upx;
  373. color: #36343c;
  374. border-radius: 20px;
  375. background: linear-gradient(left, #f9e6af, #ffd465);
  376. z-index: 1;
  377. }
  378. .tit {
  379. font-size: $font-base+2upx;
  380. color: #f7d680;
  381. margin-bottom: 28upx;
  382. .yticon {
  383. color: #f6e5a3;
  384. margin-right: 16upx;
  385. }
  386. }
  387. .e-b {
  388. font-size: $font-sm;
  389. color: #d8cba9;
  390. margin-top: 10upx;
  391. }
  392. }
  393. .cover-container {
  394. padding: 1px 10px;
  395. padding-bottom: 200upx;
  396. /* background-color: #F5F6FA; */
  397. /* border-radius: 20px; */
  398. margin-top: 60upx;
  399. .arc {
  400. position: absolute;
  401. left: 0;
  402. top: -34upx;
  403. width: 100%;
  404. height: 36upx;
  405. }
  406. }
  407. .tj-sction {
  408. @extend %section;
  409. .tj-item {
  410. @extend %flex-center;
  411. flex-direction: column;
  412. height: 140upx;
  413. font-size: $font-sm;
  414. color: #75787d;
  415. }
  416. .num {
  417. font-size: $font-lg;
  418. color: $font-color-dark;
  419. margin-bottom: 8upx;
  420. }
  421. }
  422. .order-section {
  423. @extend %section;
  424. padding: 28upx 0;
  425. margin-top: 20upx;
  426. .order-item {
  427. @extend %flex-center;
  428. width: 120upx;
  429. height: 120upx;
  430. border-radius: 10upx;
  431. font-size: $font-sm;
  432. color: $font-color-dark;
  433. }
  434. .yticon {
  435. font-size: 48upx;
  436. margin-bottom: 18upx;
  437. color: #fa436a;
  438. }
  439. .icon-shouhoutuikuan {
  440. font-size: 44upx;
  441. }
  442. }
  443. .history-section {
  444. padding: 30upx 0 0;
  445. margin-top: 20upx;
  446. background: #fff;
  447. border-radius: 10upx;
  448. .sec-header {
  449. display: flex;
  450. align-items: center;
  451. font-size: $font-base;
  452. color: $font-color-dark;
  453. line-height: 40upx;
  454. margin-left: 30upx;
  455. .yticon {
  456. font-size: 44upx;
  457. color: #5eba8f;
  458. margin-right: 16upx;
  459. line-height: 40upx;
  460. }
  461. }
  462. .h-list {
  463. white-space: nowrap;
  464. padding: 30upx 30upx 0;
  465. image {
  466. display: inline-block;
  467. width: 160upx;
  468. height: 160upx;
  469. margin-right: 20upx;
  470. border-radius: 10upx;
  471. }
  472. }
  473. }
  474. .grid {
  475. display: flex;
  476. align-items: center;
  477. flex-wrap: wrap;
  478. /* border-top: 2upx solid rgba(172,172,172,.2); */
  479. .grid-item-3 {
  480. box-sizing: border-box;
  481. width: calc(100% / 3);
  482. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  483. border-right: 2upx solid rgba(172, 172, 172, .2);
  484. text-align: center;
  485. padding: 40upx 0;
  486. position: relative;
  487. /* view{
  488. font-size: $font-sm;
  489. margin-top: 16upx;
  490. color: $font-color-dark;
  491. } */
  492. .grid_icon {
  493. font-size: 48upx;
  494. margin-bottom: 18upx;
  495. color: #fa436a;
  496. }
  497. .tip_text {
  498. display: block;
  499. padding: 4upx 8upx;
  500. text-align: center;
  501. border-radius: 36upx;
  502. font-size: 24upx;
  503. background-color: #fa436a;
  504. color: rgba(255, 255, 255, 1);
  505. position: absolute;
  506. right: 6upx;
  507. top: 6upx;
  508. }
  509. }
  510. .grid-item-3:nth-child(3n + 3),
  511. .grid-item-4:nth-child(4n + 4) {
  512. border-right: none;
  513. }
  514. }
  515. .headPortrait {
  516. width: 75px;
  517. height: 75px;
  518. border-radius: 40px;
  519. border: 2px solid #ffffff;
  520. }
  521. .personal {
  522. margin-top: 10px;
  523. margin-left: 20px;
  524. }
  525. .information {
  526. font-size: 15px;
  527. font-weight: 600;
  528. height: 36px;
  529. }
  530. .indexlow {
  531. /* margin-top: 30px; */
  532. border-radius: 10px;
  533. }
  534. .cu-list>.cu-item:after {
  535. border: none;
  536. }
  537. .cu-list>.cu-item{
  538. text-align:center;
  539. }
  540. .sign {
  541. width: 40px;
  542. height: 40px;
  543. top: 4px;
  544. margin: 3px auto;
  545. }
  546. .indexUp {
  547. padding: 0 20px;
  548. align-items: center;
  549. }
  550. .wrap {
  551. background: #fff;
  552. margin: 10px;
  553. border-radius: 10px;
  554. padding: 10px;
  555. .title {
  556. font-size: 16px;
  557. }
  558. }
  559. .content2 {
  560. display: flex;
  561. justify-content: space-between;
  562. }
  563. </style>