洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
3.7 KiB

  1. <template>
  2. <view class="topInfo card">
  3. <view class="user_row">
  4. <view class="avatar">
  5. <image :src="vuex_userInfo.photoPath" mode="widthFix" v-if="vuex_userInfo.photoPath"></image>
  6. </view>
  7. <view class="rightTxt" @click="showType=true">
  8. <view class="name">{{ vuex_userInfo.name?vuex_userInfo.name:vuex_userInfo.phone?vuex_userInfo.phone:'请登录' }}</view>
  9. <view class="btn_row">
  10. <view class="txt">{{ carType }}</view>
  11. <u-icon name="arrow-down-fill" color="#fff" size="10"></u-icon>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="bg">
  16. <view class="row">
  17. <view class="timeItem">
  18. <view class="flex">
  19. <view class="time">120</view>
  20. <view class="uni">分钟</view>
  21. </view>
  22. <view class="lab">已完成学时</view>
  23. </view>
  24. <view class="timeItem">
  25. <view class="flex">
  26. <view class="time">120</view>
  27. <view class="uni">分钟</view>
  28. </view>
  29. <view class="lab">应完成学时</view>
  30. </view>
  31. </view>
  32. <view class="row" v-if="carType=='科目三'">
  33. <view class="timeItem">
  34. <view class="flex ">
  35. <view class="time">120</view>
  36. <view class="uni">km</view>
  37. </view>
  38. <view class="lab">已完里程</view>
  39. </view>
  40. <view class="timeItem">
  41. <view class="flex ">
  42. <view class="time ">120</view>
  43. <view class="uni">km</view>
  44. </view>
  45. <view class="lab">已完里程</view>
  46. </view>
  47. </view>
  48. </view>
  49. <u-picker :show="showType" :columns="typeArr" keyName="name" @confirm="confirmType" @cancel="showType=false"></u-picker>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. props: ['carType'],
  55. data() {
  56. return {
  57. showType: false,
  58. typeArr: [
  59. [
  60. {name: '科目一', id: 1},
  61. {name: '科目二', id: 2},
  62. {name: '科目三', id: 3},
  63. {name: '科目四', id: 4},
  64. ]
  65. ],
  66. }
  67. },
  68. methods: {
  69. confirmType(val) {
  70. let item = val.value[0]
  71. // console.log(item)
  72. this.showType = false
  73. this.$emit('changeSubject', item)
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .topInfo.card {
  80. padding: 0rpx 20rpx 20rpx 20rpx;
  81. .user_row {
  82. display: flex;
  83. .avatar {
  84. width: 120rpx;
  85. height: 120rpx;
  86. border-radius: 50%;
  87. overflow: hidden;
  88. background: url('../../../../static/images/mineIcon/avatar.png');
  89. background-size: 100% 100%;
  90. margin-top: -36rpx;
  91. }
  92. .rightTxt {
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. flex: 1;
  97. width: 0;
  98. padding: 0 0 0 20rpx;
  99. .name {
  100. font-size: 28rpx;
  101. color: #333;
  102. }
  103. .btn_row {
  104. display: flex;
  105. align-items: center;
  106. justify-content: center;
  107. background: $themC;
  108. width: 150rpx;
  109. height: 50rpx;
  110. color: #fff;
  111. border-radius: 10rpx;
  112. font-size: 24rpx;
  113. lighting-color: 50rpx;
  114. .txt {
  115. margin-right: 10rpx;
  116. }
  117. }
  118. }
  119. }
  120. .bg {
  121. background: #F6F7FA;
  122. border-radius: 20rpx;
  123. padding: 20rpx;
  124. margin-top: 30rpx;
  125. .row {
  126. border-top: 1rpx solid #EDEDED;
  127. display: flex;
  128. &:first-child {
  129. border: none;
  130. }
  131. .timeItem {
  132. border-left: 1px solid #EDEDED;
  133. flex: 1;
  134. align-items: center;
  135. justify-content: center;
  136. color: #999;
  137. font-size: 24rpx;
  138. padding: 20rpx 0;
  139. &:first-child {
  140. border: none;
  141. }
  142. .flex {
  143. justify-content: center;
  144. .time {
  145. font-size: 36rpx;
  146. color: #333;
  147. font-weight: 700;
  148. }
  149. .uni {
  150. margin-top: -6rpx;
  151. margin-left: 4rpx;
  152. }
  153. }
  154. .lab {
  155. text-align: center;
  156. }
  157. }
  158. }
  159. }
  160. }
  161. </style>