JumpBox.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!-- 选择框-账户-下部 -->
  2. <template>
  3. <view class="content">
  4. <view class="mix-list-cell" :class="border" @click="eventClick" hover-class="cell-hover" :hover-stay-time="50">
  5. <!-- <text v-if="icon" class="cell-icon yticon" :style="[{color: iconColor,}]" :class="icon"></text> -->
  6. <img v-if="imagesrc" :src="imagesrc" :style="[{color: iconColor,}]" class="cell-icon yticon"></img>
  7. <image v-if="imagesrcnew" :src="imagesrcnew" :style="[{color: iconColor,width:'20px',height:'20px'}]"
  8. class="cell-icon yticon">
  9. </image>
  10. <text class="cell-tit clamp">{{title}}</text>
  11. <text v-if="tips" class="cell-tip">{{tips}}</text>
  12. <!-- <text class="cell-more yticon"
  13. :class="typeList[navigateType]"
  14. ></text> -->
  15. <i class="fa cell-more yticon" style="width: 25upx;color: #333;" :class="typeList[navigateType]"></i>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. /**
  21. * 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
  22. * 比如加入image, iconSize可控等
  23. */
  24. export default {
  25. data() {
  26. return {
  27. typeList: {
  28. left: 'fa-angle-left',
  29. right: 'fa-angle-right',
  30. up: 'fa-angle-up',
  31. down: 'fa-angle-down'
  32. },
  33. }
  34. },
  35. props: {
  36. icon: {
  37. type: String,
  38. default: ''
  39. },
  40. title: {
  41. type: String,
  42. default: '标题'
  43. },
  44. tips: {
  45. type: String,
  46. default: ''
  47. },
  48. navigateType: {
  49. type: String,
  50. default: 'right'
  51. },
  52. border: {
  53. type: String,
  54. default: 'b-b'
  55. },
  56. hoverClass: {
  57. type: String,
  58. default: 'cell-hover'
  59. },
  60. iconColor: {
  61. type: String,
  62. default: '#333'
  63. },
  64. imagesrc: {
  65. type: String,
  66. default: ''
  67. },
  68. imagesrcnew: {
  69. type: String,
  70. default: ''
  71. }
  72. },
  73. computed: {
  74. i18n() {
  75. return this.$t('common');
  76. }
  77. },
  78. onShow() {
  79. console.log(this.title);
  80. },
  81. methods: {
  82. eventClick() {
  83. this.$emit('eventClick');
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang='scss'>
  89. .icon .mix-list-cell.b-b:after {
  90. left: 90upx;
  91. }
  92. .mix-list-cell {
  93. display: flex;
  94. align-items: baseline;
  95. padding: 10upx $page-row-spacing;
  96. line-height: 60upx;
  97. position: relative;
  98. &.cell-hover {
  99. background: #fafafa;
  100. }
  101. &.b-b:after {
  102. left: 30upx;
  103. }
  104. .cell-icon {
  105. align-self: center;
  106. width: 40upx;
  107. max-height: 60upx;
  108. font-size: 38upx;
  109. margin-right: 10upx;
  110. }
  111. .cell-more {
  112. align-self: center;
  113. font-size: 30upx;
  114. color: $font-color-base;
  115. margin-left: $uni-spacing-row-sm;
  116. }
  117. .cell-tit {
  118. flex: 1;
  119. font-size: $font-base+2upx;
  120. color: $font-color-dark;
  121. margin-right: 10upx;
  122. }
  123. .cell-tip {
  124. font-size: $font-sm+2upx;
  125. color: $font-color-light;
  126. }
  127. }
  128. </style>