index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="container">
  3. <title-status bg-color="transparent" :has-height="false" />
  4. <view class="head-layout">
  5. <template v-if="isLogin">
  6. <view class="user-layout">
  7. <u-image :src="userInfo.avatar || null" width="140rpx" height="140rpx" shape="circle" bgColor="#D9D9D9" loadingIcon="" lazy-load />
  8. <view class="user-name">{{ userInfo.name }}</view>
  9. <u-icon name="/static/images/index-logout.png" width="56rpx" height="56rpx" @click="logoutClick"></u-icon>
  10. </view>
  11. </template>
  12. <template v-else>
  13. <u-button text="去登录" style="margin-top: 150rpx;width: 220rpx;height: 80rpx;color: #306DF6;font-weight: 700;font-size: 40rpx;" :hairline="false" shape="circle" @click="$navigate.navigateToPage($config.route.login)"></u-button>
  14. </template>
  15. <view style="flex: auto;"></view>
  16. <view class="head-bottom-layout">
  17. <template v-if="isLogin">
  18. <view style="margin-left: 30rpx;">单位:{{ userInfo.username || '' }}</view>
  19. <view style="margin-left: 30rpx;margin-top: 2rpx;">部门:{{ userInfo.deptName || '' }}</view>
  20. </template>
  21. <template v-else>
  22. <view style="align-self: center;">暂无人员信息,请尽快登录~</view>
  23. </template>
  24. </view>
  25. </view>
  26. <u-image src="/static/images/index-func1.png" mode="aspectFit" width="620rpx" height="340rpx" class="fun-img" loadingIcon="" @click="$navigate.navigateToPage($config.route.fillin, null, true)" />
  27. <u-image src="/static/images/index-func2.png" mode="aspectFit" width="620rpx" height="340rpx" class="fun-img" loadingIcon="" @click="$navigate.navigateToPage($config.route.myFillin, null, true)" />
  28. </view>
  29. </template>
  30. <script>
  31. import { mapGetters, mapActions } from 'vuex'
  32. import TitleStatus from '@/components/title-status/title-status'
  33. export default {
  34. components: {
  35. TitleStatus
  36. },
  37. data() {
  38. return {
  39. }
  40. },
  41. computed: {
  42. ...mapGetters(['isLogin', 'userInfo'])
  43. },
  44. onLoad() {},
  45. methods: {
  46. ...mapActions(['goOut']),
  47. logoutClick() {
  48. const that = this
  49. uni.showModal({
  50. title: '提示',
  51. content: '确定要退出吗?',
  52. success: function (res) {
  53. if (res.confirm) {
  54. that.goOut()
  55. }
  56. }
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .container {
  64. display: flex;
  65. flex-direction: column;
  66. align-items: center;
  67. .head-layout {
  68. width: 100%;
  69. height: 400rpx;
  70. background-image: url('@/static/images/index-head-bg.jpg');
  71. background-repeat: no-repeat;
  72. background-size: 100% 100%;
  73. display: flex;
  74. flex-direction: column;
  75. /deep/ .u-button__text {
  76. font-size: 36rpx !important;
  77. }
  78. .user-layout {
  79. margin: 120rpx 0 0 50rpx;
  80. display: flex;
  81. align-items: center;
  82. .user-name {
  83. margin: 0 16rpx 0 32rpx;
  84. font-weight: 500;
  85. font-size: 40rpx;
  86. color: #fff;
  87. }
  88. }
  89. .head-bottom-layout {
  90. align-self: center;
  91. width: 640rpx;
  92. height: 112rpx;
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: center;
  96. font-size: 28rpx;
  97. font-weight: 400;
  98. color: #fff;
  99. }
  100. }
  101. .fun-img {
  102. margin-top: 36rpx;
  103. }
  104. }
  105. </style>