CellTip.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="">
  3. <view class="position" v-if="cellType=='1'">
  4. <text class="tag"></text>
  5. <text class="titles" v-text="title"></text>
  6. <slot></slot>
  7. </view>
  8. <view class="list-cell" v-if="cellType=='2'">
  9. <text class="list-cell-span" >
  10. <text v-text="title"></text>
  11. <text class="num" v-if="num<=99" v-text="num"></text>
  12. <text class="num" v-if="num>99">99+</text>
  13. </text>
  14. <slot></slot>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: "CellTip",
  21. props:{
  22. title:{
  23. type:String,
  24. default:''
  25. },
  26. num:{
  27. type:[String, Number],
  28. default:''
  29. },
  30. cellType:{
  31. type:[String, Number],
  32. default:'1'
  33. }
  34. },
  35. data() {
  36. return {
  37. };
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .position {
  43. position: relative;
  44. padding: 16rpx 24rpx;
  45. margin: 0 24rpx;
  46. margin-top: 12rpx;
  47. display: flex;
  48. align-items: center;
  49. background-color: transparent;
  50. font-size: $uni-font-size-base;
  51. color: $uni-text-color;
  52. .tag {
  53. display: inline-block;
  54. background-color: $j-primary-border-green;
  55. width: 8rpx;
  56. height: 32rpx;
  57. border-radius: 4rpx;
  58. }
  59. .titles {
  60. font-size: 32rpx;
  61. font-weight: bold;
  62. margin-left: 16rpx;
  63. }
  64. }
  65. .list-cell{
  66. position: relative;
  67. padding: 0 20rpx;
  68. background-color: #FFFFFF;
  69. font-size: $uni-font-size-base;
  70. color: $uni-text-regular-color;
  71. .list-cell-span{
  72. padding: 0 20rpx;
  73. position: relative;
  74. display: inline-block;
  75. height: 76rpx;
  76. line-height: 76rpx;
  77. border-bottom: 1px solid $j-primary-border-green;
  78. }
  79. .num{
  80. padding: 0 8rpx;
  81. height: 40rpx;
  82. line-height: 40rpx;
  83. position: absolute;
  84. top: 8rpx;
  85. right: -50rpx;
  86. display: inline-block;
  87. transform: scale(0.7);
  88. color: #FFFFFF;
  89. background-color: $uni-color-error;
  90. border-radius: 20rpx;
  91. text-align: center;
  92. }
  93. }
  94. </style>