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.

117 lines
2.1 KiB

3 years ago
  1. <template>
  2. <view class="content">
  3. <view class="mix-list-cell" :class="border" @click="onClick" hover-class="cell-hover" :hover-stay-time="50">
  4. <text
  5. v-if="icon"
  6. class="cell-icon mix-icon"
  7. :style="[{
  8. color: iconColor,
  9. }]"
  10. :class="icon"
  11. ></text>
  12. <text class="cell-tit clamp">{{ title }}</text>
  13. <text v-if="tips" class="cell-tip" :style="{color: tipsColor}">{{ tips }}</text>
  14. <text class="cell-more mix-icon"
  15. :class="typeList[navigateType]"
  16. ></text>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. /**
  22. * 简单封装了下 应用范围比较狭窄可以在此基础上进行扩展使用
  23. * 比如加入image iconSize可控等
  24. */
  25. export default {
  26. data() {
  27. return {
  28. typeList: {
  29. left: 'icon-zuo',
  30. right: 'icon-you',
  31. up: 'icon-shang',
  32. down: 'icon-xia'
  33. },
  34. }
  35. },
  36. props: {
  37. icon: {
  38. type: String,
  39. default: ''
  40. },
  41. title: {
  42. type: String,
  43. default: '标题'
  44. },
  45. tips: {
  46. type: String,
  47. default: ''
  48. },
  49. tipsColor: {
  50. type: String,
  51. default: '#999'
  52. },
  53. navigateType: {
  54. type: String,
  55. default: 'right'
  56. },
  57. border: {
  58. type: String,
  59. default: 'b-b'
  60. },
  61. hoverClass: {
  62. type: String,
  63. default: 'cell-hover'
  64. },
  65. iconColor: {
  66. type: String,
  67. default: '#333'
  68. }
  69. },
  70. methods: {
  71. onClick(){
  72. this.$emit('onClick');
  73. }
  74. },
  75. }
  76. </script>
  77. <style scoped lang='scss'>
  78. .mix-list-cell{
  79. display:flex;
  80. align-items: center;
  81. height: 96rpx;
  82. padding: 0 24rpx;
  83. position:relative;
  84. &.cell-hover{
  85. background:#fafafa;
  86. }
  87. &.b-b{
  88. &:after{
  89. left: 30rpx;
  90. border-color: #f0f0f0;
  91. }
  92. }
  93. .cell-icon{
  94. align-self: center;
  95. width: 60rpx;
  96. font-size: 38rpx;
  97. }
  98. .cell-more{
  99. align-self: center;
  100. font-size: 24rpx;
  101. color: #999;
  102. margin-left: 16rpx;
  103. }
  104. .cell-tit{
  105. flex: 1;
  106. font-size: 30rpx;
  107. color: #333;
  108. margin-right:10rpx;
  109. }
  110. .cell-tip{
  111. font-size: 26rpx;
  112. }
  113. }
  114. </style>