index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="content">
  3. <!-- 头部 -->
  4. <view class="head">
  5. <!-- 用户头像 -->
  6. <image :src="avatar" class="user" @click="userTo()">
  7. <text class="name">{{$store.state.user.name}}</text>
  8. </view>
  9. <!-- 司机报单 -->
  10. <view class="driverEntry" @click="driverClass('BD')">
  11. <!-- 图标 -->
  12. <span class="icon iconfont">&#xe509;</span>
  13. <view class="message">
  14. <text class="main">司机报单</text>
  15. <!-- <text class="assist">司机报单</text> -->
  16. </view>
  17. </view>
  18. <!-- 费用报销 -->
  19. <view class="driverEntry" @click="driverClass('BX')">
  20. <!-- 图标 -->
  21. <span class="icon iconfont">&#xe640;</span>
  22. <view class="message">
  23. <text class="main">费用报销</text>
  24. <!-- <text class="assist">费用报销</text> -->
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. }
  34. },
  35. computed: {
  36. avatar() {
  37. return this.$store.state.user.avatar
  38. }
  39. },
  40. onLoad() {
  41. // 调用获取位置信息
  42. uni.getLocation({
  43. type: 'wgs84',
  44. isHighAccuracy: true,
  45. geocode: true,
  46. success: (map) => {
  47. }
  48. });
  49. },
  50. onReachBottom() {},
  51. methods: {
  52. driverClass(type) {
  53. //跳转列表
  54. uni.navigateTo({
  55. url: '/pages/listview?type=' + type
  56. });
  57. }
  58. },
  59. }
  60. </script>
  61. <style lang="scss">
  62. @import url("/font/iconfont.css");
  63. .content {
  64. // background-color: #f6f6f6;
  65. // 头部
  66. .head {
  67. width: 100%;
  68. height: 360rpx;
  69. background-color: #3c9cff;
  70. position: relative;
  71. // 用户头像
  72. .user {
  73. width: 200rpx;
  74. height: 200rpx;
  75. border-radius: 100rpx;
  76. position: absolute;
  77. top: 40rpx;
  78. left: calc(50% - 100rpx);
  79. border-radius: 200rpx;
  80. }
  81. // 用户名字
  82. .name {
  83. color: #fff;
  84. font-size: 40rpx;
  85. position: absolute;
  86. bottom: 40rpx;
  87. left: 50%;
  88. transform: translateX(-50%);
  89. border-radius: 200rpx;
  90. }
  91. }
  92. // 司机报单
  93. .driverEntry {
  94. width: 90%;
  95. height: 300rpx;
  96. border-radius: 20rpx;
  97. margin: 30rpx auto 0 auto;
  98. // margin-top: 30rpx;
  99. position: relative;
  100. background-color: #fff;
  101. border: 4rpx solid #e6e6e6;
  102. .icon {
  103. position: absolute;
  104. top: 50%;
  105. transform: translateY(-50%);
  106. left: 60rpx;
  107. color: #377bdc;
  108. font-size: 160rpx;
  109. }
  110. .message {
  111. width: 60%;
  112. height: 100%;
  113. position: absolute;
  114. right: 0;
  115. .main {
  116. position: absolute;
  117. font-size: 30rpx;
  118. font-weight: 600;
  119. color: #4d88de;
  120. top: 100rpx;
  121. }
  122. .assist {
  123. position: absolute;
  124. font-size: 30rpx;
  125. color: #a0a0a0;
  126. top: 160rpx;
  127. }
  128. }
  129. }
  130. }
  131. </style>